diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 326ba3352..a8bcb7cef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,8 +13,6 @@ jobs: uses: actions/setup-go@v3 with: go-version: '>=1.17.0' - - name: setup-docker - uses: docker-practice/actions-setup-docker@1.0.11 - name: 'Set up Cloud SDK' uses: 'google-github-actions/setup-gcloud@v0' - name: Build Compiler image @@ -51,8 +49,6 @@ jobs: uses: actions/setup-go@v3 with: go-version: '>=1.17.0' - - name: setup-docker - uses: docker-practice/actions-setup-docker@1.0.11 - name: Test Generate Code and Render templates run: | git config --global url."https://github.com/".insteadOf "git@github.com:" diff --git a/compiler/.gitignore b/compiler/.gitignore index 43119c410..2155e068a 100644 --- a/compiler/.gitignore +++ b/compiler/.gitignore @@ -7,6 +7,7 @@ cmd/nexus-openapi-gen cmd/gqlgen compiler.tar _generated +_tsm_temp ### GoLand ### .idea diff --git a/compiler/Dockerfile b/compiler/Dockerfile index 09b477c72..7000e2fc7 100644 --- a/compiler/Dockerfile +++ b/compiler/Dockerfile @@ -23,4 +23,4 @@ RUN go mod download WORKDIR /go/src/github.com/vmware-tanzu/graph-framework-for-microservices/compiler RUN go mod download -CMD make docker.gitlab_credentials && make generate_code +CMD make docker.gitlab_credentials && make preparser diff --git a/compiler/Makefile b/compiler/Makefile index 10b0a3d49..d19855289 100644 --- a/compiler/Makefile +++ b/compiler/Makefile @@ -20,6 +20,7 @@ CONFIG_FILE ?= "" GENERATED_OUTPUT_DIRECTORY ?= generated COMPILER_SRC_DIRECTORY ?= "" FORCE ?= false +PREPARSER_MODPATH ?= model NEXUS_KUBEOPENAPI_VERSION ?= 7416bd4754d3c0dd8b3fa37fff53d36594f11607 NEXUS_GRAPHQLGEN_VERSION ?= 32f028bce22efeb70b47a640195bd969dbb337f0 @@ -134,11 +135,41 @@ generate_example_in_container: test_in_container: ${BUILDER_NAME}\:${BUILDER_TAG}.image.exists $(call run_in_container, make test) +.PHONY: preparser +preparser: + @echo "Nexus Compiler: Start Preparser" + @echo "Cleaning up workdir" + rm -rf _generated + @echo "Copying generated_base_structure to create directory structure" + @echo "COMPILER_SRC_DIRECTORY: ${COMPILER_SRC_DIRECTORY}" + cp -R _generated_base_structure _generated + @echo "Cleaning up temp dir" + rm -rf _tsm_temp + @echo "Copying Datamodel to temp directory" + cp -R ${DATAMODEL_PATH} _tsm_temp + cp -R _generated_base_structure/* ${DATAMODEL_PATH}/build + @echo "Nexus Compiler: Running Preparser" + go run cmd/preparser/main.go -dsl _tsm_temp -output _generated -modpath ${PREPARSER_MODPATH} + @echo "Nexus Compiler: Remove empty directories from model directory" + @find _generated/model -depth -type d -empty -delete + + @if [ -d "_tsm_temp/global" ]; then \ + cp _tsm_temp/go.mod _tsm_temp/global/go.mod; \ + for d in _tsm_temp/*/; do \ + if [[ ! "$$d" == "_tsm_temp/global/" && ! "$$d" == "_tsm_temp/build/" ]]; then \ + cp -r "$$d" "_tsm_temp/global/"; \ + fi; \ + done; \ + $(MAKE) generate_code DATAMODEL_PATH=_tsm_temp/global; \ + else \ + $(MAKE) generate_code; \ + fi + .PHONY: generate_code generate_code: @echo "Nexus Compiler: Running compiler code generation" @echo "Cleaning up workdir" - rm -rf _generated ${GOPATH}/src/nexustempmodule + rm -rf ${GOPATH}/src/nexustempmodule @echo "Copying generated_base_structure to create directory structure" @echo "COMPILER_SRC_DIRECTORY: ${COMPILER_SRC_DIRECTORY}" cp -R _generated_base_structure _generated @@ -158,11 +189,12 @@ generate_code: @echo "Nexus Compiler: Generating CRD yamls" go run cmd/generate-openapischema/generate-openapischema.go -yamls-path _generated/crds -existing-CRDs-Path ${GENERATED_OUTPUT_DIRECTORY}/crds -force ${FORCE} git checkout -- pkg/openapi_generator/openapi/openapi_generated.go - rm -rf ${GENERATED_OUTPUT_DIRECTORY}/{client,apis,crds,common,nexus-client,helper,nexus-gql} - cp -r _generated/{client,apis,crds,common,nexus-client,helper,nexus-gql} ${GENERATED_OUTPUT_DIRECTORY} + rm -rf ${GENERATED_OUTPUT_DIRECTORY}/{client,apis,crds,common,nexus-client,helper,nexus-gql,tsm-nexus-gql,model} + cp -r _generated/{client,apis,crds,common,nexus-client,helper,nexus-gql,tsm-nexus-gql,model} ${GENERATED_OUTPUT_DIRECTORY} @echo "Nexus Compiler: Generating GRAPHQL PKG" - cd _generated && goimports -w . + cd _generated && mv model/model.go model/model.tmp && goimports -w . && mv model/model.tmp model/model.go cd _generated/nexus-gql && gqlgen generate + @echo "Nexus Compiler: GRAPHQL Generating completed" cp -rf _generated/* ${GOPATH}/src/nexustempmodule/ cd ${GOPATH}/src/nexustempmodule && cd nexus-gql && go mod init && \ go mod edit -replace nexustempmodule=${GOPATH}/src/nexustempmodule && \ @@ -174,10 +206,10 @@ generate_code: ./scripts/replace_mod_path.sh find . -name "*.bak" -type f -delete @echo "Sorting imports" - cd _generated && goimports -w . + cd _generated && mv model/model.go model/model.tmp && goimports -w . && mv model/model.tmp model/model.go @echo "Nexus Compiler: Moving files to output directory" - cp -r _generated/{client,apis,crds,common,nexus-client,helper,nexus-gql} ${GENERATED_OUTPUT_DIRECTORY} - cp -r ${GOPATH}/src/nexustempmodule/nexus-gql/graphql.so ${GENERATED_OUTPUT_DIRECTORY}/nexus-gql + cp -r _generated/{client,apis,crds,common,nexus-client,helper,nexus-gql,tsm-nexus-gql,model} ${GENERATED_OUTPUT_DIRECTORY} + cp -r ${GOPATH}/src/nexustempmodule/nexus-gql/* ${GENERATED_OUTPUT_DIRECTORY}/nexus-gql/ @echo "Nexus Compiler: Compiler code generation completed" .PHONY: test_generate_code_in_container diff --git a/compiler/_generated_base_structure/model/.gitkeep b/compiler/_generated_base_structure/model/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/_generated_base_structure/tsm-nexus-gql/graph/.gitkeep b/compiler/_generated_base_structure/tsm-nexus-gql/graph/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/builder/Dockerfile b/compiler/builder/Dockerfile index 41727e876..c4479d337 100644 --- a/compiler/builder/Dockerfile +++ b/compiler/builder/Dockerfile @@ -15,7 +15,7 @@ RUN tdnf -y --refresh install \ make=4.3-2.ph4 \ coreutils=8.32-3.ph4 \ build-essential=0.1-3.ph4 \ - openssh-clients=8.8p1-3.ph4 \ + openssh-clients \ jq=1.6-2.ph4 \ && go install github.com/onsi/ginkgo/ginkgo@v1.16.0 \ && go install github.com/onsi/gomega/...@v1.18.0 \ diff --git a/compiler/cmd/nexus-sdk/main.go b/compiler/cmd/nexus-sdk/main.go index 2627e8257..184f474dc 100644 --- a/compiler/cmd/nexus-sdk/main.go +++ b/compiler/cmd/nexus-sdk/main.go @@ -49,10 +49,11 @@ func main() { config.ConfigInstance = conf pkgs := parser.ParseDSLPkg(*dslDir) graphlqQueries := parser.ParseGraphqlQuerySpecs(pkgs) - graph := parser.ParseDSLNodes(*dslDir, conf.GroupName, pkgs, graphlqQueries) + graph, nonNexusTypes, fileset := parser.ParseDSLNodes(*dslDir, conf.GroupName, pkgs, graphlqQueries) methods, codes := rest.ParseResponses(pkgs) + graphqlFiles := parser.ParseGraphQLFiles(*dslDir) if err = generator.RenderCRDTemplate(conf.GroupName, conf.CrdModulePath, pkgs, graph, - *crdDir, methods, codes); err != nil { + *crdDir, methods, codes, nonNexusTypes, fileset, graphqlFiles); err != nil { log.Fatalf("Error rendering crd template: %v", err) } } diff --git a/compiler/cmd/preparser/main.go b/compiler/cmd/preparser/main.go new file mode 100644 index 000000000..16b13217a --- /dev/null +++ b/compiler/cmd/preparser/main.go @@ -0,0 +1,39 @@ +package main + +import ( + "flag" + + log "github.com/sirupsen/logrus" + "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/pkg/preparser" +) + +func main() { + dslDir := flag.String("dsl", "datamodel", "DSL file location.") + outputDir := flag.String("output", "_generated", "output dir location.") + modPath := flag.String("modpath", "datamodel", "ModPath for rendered imports") + logLevel := flag.String("log-level", "ERROR", "Log level") + flag.Parse() + + lvl, err := log.ParseLevel(*logLevel) + if err != nil { + log.Fatalf("Failed to configure logging: %v\n", err) + } + log.SetLevel(lvl) + + packages := preparser.Parse(*dslDir) + err = preparser.Render(*dslDir, packages) + if err != nil { + log.Fatal(err) + } + + err = preparser.CopyPkgsToBuild(*dslDir, *outputDir) + if err != nil { + log.Fatal(err) + } + + packages = preparser.Parse(*dslDir) + err = preparser.RenderImports(packages, *outputDir, *modPath) + if err != nil { + log.Fatal(err) + } +} diff --git a/compiler/example/output/_rendered_templates/model/model.go b/compiler/example/output/_rendered_templates/model/model.go new file mode 100644 index 000000000..6676e2381 --- /dev/null +++ b/compiler/example/output/_rendered_templates/model/model.go @@ -0,0 +1,224 @@ +type CInt uint8 + +type CrossPackageTester struct { + Test gns.MyStr +} + +type ReplicationSource struct { + Kind SourceKind +} + +type PolicyCfgAction struct { + Action PolicyActionType `json:"action" mapstructure:"action"` +} + +type ResourceGroupID struct { + Name string `json:"name" mapstruction:"name"` + Type string `json:"type" mapstruction:"type"` +} + +type Config struct { + GNS gns.Gns `nexus:"child"` +} + +type EmptyStructTest struct{} + +type queryFilters struct { + StartTime string + EndTime string + Interval string + IsServiceDeployment bool + StartVal int +} + +type BArray []string + +type TestValMarkers struct { + //nexus-validation: MaxLength=8, MinLength=2, Pattern=ab + MyStr string `json:"myStr" yaml:"myStr"` + + //nexus-validation: Maximum=8, Minimum=2 + //nexus-validation: ExclusiveMaximum=true + MyInt int `json:"myInt" yaml:"myInt"` + + //nexus-validation: MaxItems=3, MinItems=2 + //nexus-validation: UniqueItems=true + MySlice []string `json:"mySlice" yaml:"mySlice"` +} + +type RandomConst3 string + +type MyConst string + +type PolicyActionType string + +type PolicyCfgActions []PolicyCfgAction + +type StructWithEmbeddedField struct { + SomeStruct + gns.MyStr +} + +type TempConst2 string + +type RandomStatus struct { + StatusX int + StatusY int +} + +type Host string + +type Instance float32 + +type Answer struct { + Name string +} + +type ServiceSegmentRef struct { + Field1 string + Field2 string +} + +type AMap map[string]string + +type TempConst1 string + +type TempConst3 string + +type RandomConst1 string + +type HostPort struct { + Host Host + Port Port +} + +type AliasArr []int + +type NonNexusType struct { + Test int +} + +type Cluster struct { + Name string + MyID int +} + +type AdditionalStatus struct { + StatusX int + StatusY int +} + +type ResourceGroupRef struct { + Name string + Type string +} + +type MatchCondition struct { + Name string + Type gns.Host +} + +type DFloat float32 + +type SomeStruct struct{} + +type gnsQueryFilters struct { + StartTime string + EndTime string + Interval string + IsServiceDeployment bool + StartVal int +} + +// This is Description struct. +type Description struct { + Color string + Version string + ProjectId string + TestAns []Answer + Instance Instance + HostPort HostPort +} + +type MyStr string + +type metricsFilers struct { + StartTime string + EndTime string + TimeInterval string + SomeUserArg1 string + SomeUserArg2 int + SomeUserArg3 bool +} + +type GnsState struct { + Working bool + Temperature int +} + +type ClusterNamespace struct { + Cluster MatchCondition + Namespace MatchCondition +} + +type AdditionalDescription struct { + DiscriptionA string + DiscriptionB string + DiscriptionC string + DiscriptionD string +} + +type RandomDescription struct { + DiscriptionA string + DiscriptionB string + DiscriptionC string + DiscriptionD string +} + +type RandomConst2 string + +type SourceKind string + +type Port uint16 + +type ACPStatus struct { + StatusABC int + StatusXYZ int +} + +type ACPSvcGroupLinkInfo struct { + ServiceName string + ServiceType string +} + +type ResourceGroupIDs []ResourceGroupID + +var nonNexusValue = 1 + +var nonValue int + +const ( + Const3 TempConst3 = "Const3" + Const2 TempConst2 = "Const2" + Const1 TempConst1 = "Const1" +) + +const ( + MyConst3 RandomConst3 = "Const3" + MyConst2 RandomConst2 = "Const2" + MyConst1 RandomConst1 = "Const1" +) + +const ( + Object SourceKind = "Object" + Type SourceKind = "Type" + XYZ MyConst = "xyz" +) + +const ( + PolicyActionType_Allow PolicyActionType = "ALLOW" + PolicyActionType_Deny PolicyActionType = "DENY" + PolicyActionType_Log PolicyActionType = "LOG" + PolicyActionType_Mirror PolicyActionType = "MIRROR" +) + diff --git a/compiler/example/output/_rendered_templates/nexus-gql/gqlgen.yml b/compiler/example/output/_rendered_templates/nexus-gql/gqlgen.yml index d37aa546e..d5e13d028 100644 --- a/compiler/example/output/_rendered_templates/nexus-gql/gqlgen.yml +++ b/compiler/example/output/_rendered_templates/nexus-gql/gqlgen.yml @@ -68,6 +68,12 @@ models: fields: PolicyConfigs: resolver: true + policypkg_ACPConfig: + fields: + DestSvcGroups: + resolver: true + SourceSvcGroups: + resolver: true policypkg_VMpolicy: fields: queryGns1: diff --git a/compiler/example/output/_rendered_templates/nexus-gql/graph/graphqlResolver.go b/compiler/example/output/_rendered_templates/nexus-gql/graph/graphqlResolver.go index 168230efc..e269110af 100644 --- a/compiler/example/output/_rendered_templates/nexus-gql/graph/graphqlResolver.go +++ b/compiler/example/output/_rendered_templates/nexus-gql/graph/graphqlResolver.go @@ -15,23 +15,33 @@ import ( ) var c = GrpcClients{ - mtx: sync.Mutex{}, - Clients: map[string]GrpcClient{}, + mtx: sync.Mutex{}, + Clients: map[string]GrpcClient{}, } var nc *nexus_client.Clientset func getParentName(parentLabels map[string]interface{}, key string) string { - if v, ok := parentLabels[key]; ok && v != nil { - return v.(string) + if v, ok := parentLabels[key]; ok && v != nil { + return v.(string) } return "" } +type NodeMetricTypeEnum string +type ServiceMetricTypeEnum string +type ServiceGroupByEnum string +type HTTPMethodEnum string +type EventSeverityEnum string +type AnalyticsMetricEnum string +type AnalyticsSubMetricEnum string +type TrafficDirectionEnum string +type SloDetailsEnum string + ////////////////////////////////////// // Nexus K8sAPIEndpointConfig ////////////////////////////////////// func getK8sAPIEndpointConfig() *rest.Config { - var ( + var ( config *rest.Config err error ) @@ -42,14 +52,15 @@ func getK8sAPIEndpointConfig() *rest.Config { return nil } } else { - config, err = rest.InClusterConfig() - if err != nil { - return nil - } + config, err = rest.InClusterConfig() + if err != nil { + return nil + } } config.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(200, 300) return config } + ////////////////////////////////////// // Singleton Resolver for Parent Node // PKG: Root, NODE: Root @@ -72,17 +83,18 @@ func getRootResolver() (*model.RootRoot, error) { return nil, nil } dn := vRoot.DisplayName() -parentLabels := map[string]interface{}{"roots.root.tsm.tanzu.vmware.com":dn} + parentLabels := map[string]interface{}{"roots.root.tsm.tanzu.vmware.com": dn} - ret := &model.RootRoot { - Id: &dn, - ParentLabels: parentLabels, + ret := &model.RootRoot{ + Id: &dn, + ParentLabels: parentLabels, } log.Debugf("[getRootResolver]Output Root object %+v", ret) return ret, nil } + // Custom query -func getConfigConfigQueryExampleResolver(obj *model.ConfigConfig, StartTime *string, EndTime *string, Interval *string, IsServiceDeployment *bool, StartVal *int, ) (*model.NexusGraphqlResponse, error) { +func getConfigConfigQueryExampleResolver(obj *model.ConfigConfig, StartTime *string, EndTime *string, Interval *string, IsServiceDeployment *bool, StartVal *int) (*model.NexusGraphqlResponse, error) { parentLabels := make(map[string]string) if obj != nil { for k, v := range obj.ParentLabels { @@ -95,11 +107,11 @@ func getConfigConfigQueryExampleResolver(obj *model.ConfigConfig, StartTime *st query := &graphql.GraphQLQuery{ Query: "QueryExample", UserProvidedArgs: map[string]string{ - "StartTime": pointerToString(StartTime), - "EndTime": pointerToString(EndTime), - "Interval": pointerToString(Interval), + "StartTime": pointerToString(StartTime), + "EndTime": pointerToString(EndTime), + "Interval": pointerToString(Interval), "IsServiceDeployment": pointerToString(IsServiceDeployment), - "StartVal": pointerToString(StartVal), + "StartVal": pointerToString(StartVal), }, Hierarchy: parentLabels, } @@ -110,8 +122,9 @@ func getConfigConfigQueryExampleResolver(obj *model.ConfigConfig, StartTime *st } return resp.(*model.NexusGraphqlResponse), nil } + // Custom query -func getGnsGnsqueryGns1Resolver(obj *model.GnsGns, StartTime *string, EndTime *string, Interval *string, IsServiceDeployment *bool, StartVal *int, ) (*model.NexusGraphqlResponse, error) { +func getGnsGnsqueryGns1Resolver(obj *model.GnsGns, StartTime *string, EndTime *string, Interval *string, IsServiceDeployment *bool, StartVal *int) (*model.NexusGraphqlResponse, error) { parentLabels := make(map[string]string) if obj != nil { for k, v := range obj.ParentLabels { @@ -124,11 +137,11 @@ func getGnsGnsqueryGns1Resolver(obj *model.GnsGns, StartTime *string, EndTime query := &graphql.GraphQLQuery{ Query: "queryGns1", UserProvidedArgs: map[string]string{ - "StartTime": pointerToString(StartTime), - "EndTime": pointerToString(EndTime), - "Interval": pointerToString(Interval), + "StartTime": pointerToString(StartTime), + "EndTime": pointerToString(EndTime), + "Interval": pointerToString(Interval), "IsServiceDeployment": pointerToString(IsServiceDeployment), - "StartVal": pointerToString(StartVal), + "StartVal": pointerToString(StartVal), }, Hierarchy: parentLabels, } @@ -139,8 +152,9 @@ func getGnsGnsqueryGns1Resolver(obj *model.GnsGns, StartTime *string, EndTime } return resp.(*model.NexusGraphqlResponse), nil } + // Custom query -func getGnsGnsqueryGnsQM1Resolver(obj *model.GnsGns, ) (*model.TimeSeriesData, error) { +func getGnsGnsqueryGnsQM1Resolver(obj *model.GnsGns) (*model.TimeSeriesData, error) { parentLabels := make(map[string]string) if obj != nil { for k, v := range obj.ParentLabels { @@ -151,10 +165,9 @@ func getGnsGnsqueryGnsQM1Resolver(obj *model.GnsGns, ) (*model.TimeSeriesData, e } } metricArgs := &qm.MetricArg{ - QueryType: "/queryGnsQM1", - Hierarchy: parentLabels, - UserProvidedArgs: map[string]string{ - }, + QueryType: "/queryGnsQM1", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{}, } resp, err := c.Request("query-manager:15002", nexus.GetMetricsApi, metricArgs) if err != nil { @@ -162,8 +175,9 @@ func getGnsGnsqueryGnsQM1Resolver(obj *model.GnsGns, ) (*model.TimeSeriesData, e } return resp.(*model.TimeSeriesData), nil } + // Custom query -func getGnsGnsqueryGnsQMResolver(obj *model.GnsGns, StartTime *string, EndTime *string, TimeInterval *string, SomeUserArg1 *string, SomeUserArg2 *int, SomeUserArg3 *bool, ) (*model.TimeSeriesData, error) { +func getGnsGnsqueryGnsQMResolver(obj *model.GnsGns, StartTime *string, EndTime *string, TimeInterval *string, SomeUserArg1 *string, SomeUserArg2 *int, SomeUserArg3 *bool) (*model.TimeSeriesData, error) { parentLabels := make(map[string]string) if obj != nil { for k, v := range obj.ParentLabels { @@ -174,11 +188,11 @@ func getGnsGnsqueryGnsQMResolver(obj *model.GnsGns, StartTime *string, EndTime } } metricArgs := &qm.MetricArg{ - QueryType: "/queryGnsQM", - StartTime: *StartTime, - EndTime: *EndTime, + QueryType: "/queryGnsQM", + StartTime: *StartTime, + EndTime: *EndTime, TimeInterval: *TimeInterval, - Hierarchy: parentLabels, + Hierarchy: parentLabels, UserProvidedArgs: map[string]string{ "SomeUserArg1": pointerToString(SomeUserArg1), "SomeUserArg2": pointerToString(SomeUserArg2), @@ -191,8 +205,9 @@ func getGnsGnsqueryGnsQMResolver(obj *model.GnsGns, StartTime *string, EndTime } return resp.(*model.TimeSeriesData), nil } + // Custom query -func getPolicypkgVMpolicyqueryGns1Resolver(obj *model.PolicypkgVMpolicy, StartTime *string, EndTime *string, Interval *string, IsServiceDeployment *bool, StartVal *int, ) (*model.NexusGraphqlResponse, error) { +func getPolicypkgVMpolicyqueryGns1Resolver(obj *model.PolicypkgVMpolicy, StartTime *string, EndTime *string, Interval *string, IsServiceDeployment *bool, StartVal *int) (*model.NexusGraphqlResponse, error) { parentLabels := make(map[string]string) if obj != nil { for k, v := range obj.ParentLabels { @@ -205,11 +220,11 @@ func getPolicypkgVMpolicyqueryGns1Resolver(obj *model.PolicypkgVMpolicy, StartT query := &graphql.GraphQLQuery{ Query: "queryGns1", UserProvidedArgs: map[string]string{ - "StartTime": pointerToString(StartTime), - "EndTime": pointerToString(EndTime), - "Interval": pointerToString(Interval), + "StartTime": pointerToString(StartTime), + "EndTime": pointerToString(EndTime), + "Interval": pointerToString(Interval), "IsServiceDeployment": pointerToString(IsServiceDeployment), - "StartVal": pointerToString(StartVal), + "StartVal": pointerToString(StartVal), }, Hierarchy: parentLabels, } @@ -220,8 +235,9 @@ func getPolicypkgVMpolicyqueryGns1Resolver(obj *model.PolicypkgVMpolicy, StartT } return resp.(*model.NexusGraphqlResponse), nil } + // Custom query -func getPolicypkgVMpolicyqueryGnsQM1Resolver(obj *model.PolicypkgVMpolicy, ) (*model.TimeSeriesData, error) { +func getPolicypkgVMpolicyqueryGnsQM1Resolver(obj *model.PolicypkgVMpolicy) (*model.TimeSeriesData, error) { parentLabels := make(map[string]string) if obj != nil { for k, v := range obj.ParentLabels { @@ -232,10 +248,9 @@ func getPolicypkgVMpolicyqueryGnsQM1Resolver(obj *model.PolicypkgVMpolicy, ) (*m } } metricArgs := &qm.MetricArg{ - QueryType: "/queryGnsQM1", - Hierarchy: parentLabels, - UserProvidedArgs: map[string]string{ - }, + QueryType: "/queryGnsQM1", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{}, } resp, err := c.Request("query-manager:15002", nexus.GetMetricsApi, metricArgs) if err != nil { @@ -243,8 +258,9 @@ func getPolicypkgVMpolicyqueryGnsQM1Resolver(obj *model.PolicypkgVMpolicy, ) (*m } return resp.(*model.TimeSeriesData), nil } + // Custom query -func getPolicypkgVMpolicyqueryGnsQMResolver(obj *model.PolicypkgVMpolicy, StartTime *string, EndTime *string, TimeInterval *string, SomeUserArg1 *string, SomeUserArg2 *int, SomeUserArg3 *bool, ) (*model.TimeSeriesData, error) { +func getPolicypkgVMpolicyqueryGnsQMResolver(obj *model.PolicypkgVMpolicy, StartTime *string, EndTime *string, TimeInterval *string, SomeUserArg1 *string, SomeUserArg2 *int, SomeUserArg3 *bool) (*model.TimeSeriesData, error) { parentLabels := make(map[string]string) if obj != nil { for k, v := range obj.ParentLabels { @@ -255,11 +271,11 @@ func getPolicypkgVMpolicyqueryGnsQMResolver(obj *model.PolicypkgVMpolicy, Start } } metricArgs := &qm.MetricArg{ - QueryType: "/queryGnsQM", - StartTime: *StartTime, - EndTime: *EndTime, + QueryType: "/queryGnsQM", + StartTime: *StartTime, + EndTime: *EndTime, TimeInterval: *TimeInterval, - Hierarchy: parentLabels, + Hierarchy: parentLabels, UserProvidedArgs: map[string]string{ "SomeUserArg1": pointerToString(SomeUserArg1), "SomeUserArg2": pointerToString(SomeUserArg2), @@ -272,6 +288,7 @@ func getPolicypkgVMpolicyqueryGnsQMResolver(obj *model.PolicypkgVMpolicy, Start } return resp.(*model.TimeSeriesData), nil } + ////////////////////////////////////// // CHILD RESOLVER (Non Singleton) // FieldName: Config Node: Root PKG: Root @@ -279,47 +296,47 @@ func getPolicypkgVMpolicyqueryGnsQMResolver(obj *model.PolicypkgVMpolicy, Start func getRootRootConfigResolver(obj *model.RootRoot, id *string) (*model.ConfigConfig, error) { log.Debugf("[getRootRootConfigResolver]Parent Object %+v", obj) if id != nil && *id != "" { - log.Debugf("[getRootRootConfigResolver]Id %q", *id) + log.Debugf("[getRootRootConfigResolver]Id %q", *id) vConfig, err := nc.RootRoot().GetConfig(context.TODO(), *id) if err != nil { log.Errorf("[getRootRootConfigResolver]Error getting Config node %q : %s", *id, err) return &model.ConfigConfig{}, nil } dn := vConfig.DisplayName() -parentLabels := map[string]interface{}{"configs.config.tsm.tanzu.vmware.com":dn} -MyStr0, _ := json.Marshal(vConfig.Spec.MyStr0) -MyStr0Data := string(MyStr0) -MyStr1, _ := json.Marshal(vConfig.Spec.MyStr1) -MyStr1Data := string(MyStr1) -MyStr2, _ := json.Marshal(vConfig.Spec.MyStr2) -MyStr2Data := string(MyStr2) -XYZPort, _ := json.Marshal(vConfig.Spec.XYZPort) -XYZPortData := string(XYZPort) -ABCHost, _ := json.Marshal(vConfig.Spec.ABCHost) -ABCHostData := string(ABCHost) -ClusterNamespaces, _ := json.Marshal(vConfig.Spec.ClusterNamespaces) -ClusterNamespacesData := string(ClusterNamespaces) -TestValMarkers, _ := json.Marshal(vConfig.Spec.TestValMarkers) -TestValMarkersData := string(TestValMarkers) -vInstance := float64(vConfig.Spec.Instance) -vCuOption := string(vConfig.Spec.CuOption) + parentLabels := map[string]interface{}{"configs.config.tsm.tanzu.vmware.com": dn} + MyStr0, _ := json.Marshal(vConfig.Spec.MyStr0) + MyStr0Data := string(MyStr0) + MyStr1, _ := json.Marshal(vConfig.Spec.MyStr1) + MyStr1Data := string(MyStr1) + MyStr2, _ := json.Marshal(vConfig.Spec.MyStr2) + MyStr2Data := string(MyStr2) + XYZPort, _ := json.Marshal(vConfig.Spec.XYZPort) + XYZPortData := string(XYZPort) + ABCHost, _ := json.Marshal(vConfig.Spec.ABCHost) + ABCHostData := string(ABCHost) + ClusterNamespaces, _ := json.Marshal(vConfig.Spec.ClusterNamespaces) + ClusterNamespacesData := string(ClusterNamespaces) + TestValMarkers, _ := json.Marshal(vConfig.Spec.TestValMarkers) + TestValMarkersData := string(TestValMarkers) + vInstance := float64(vConfig.Spec.Instance) + vCuOption := string(vConfig.Spec.CuOption) for k, v := range obj.ParentLabels { parentLabels[k] = v } - ret := &model.ConfigConfig { - Id: &dn, - ParentLabels: parentLabels, - MyStr0: &MyStr0Data, - MyStr1: &MyStr1Data, - MyStr2: &MyStr2Data, - XYZPort: &XYZPortData, - ABCHost: &ABCHostData, - ClusterNamespaces: &ClusterNamespacesData, - TestValMarkers: &TestValMarkersData, - Instance: &vInstance, - CuOption: &vCuOption, - } + ret := &model.ConfigConfig{ + Id: &dn, + ParentLabels: parentLabels, + MyStr0: &MyStr0Data, + MyStr1: &MyStr1Data, + MyStr2: &MyStr2Data, + XYZPort: &XYZPortData, + ABCHost: &ABCHostData, + ClusterNamespaces: &ClusterNamespacesData, + TestValMarkers: &TestValMarkersData, + Instance: &vInstance, + CuOption: &vCuOption, + } log.Debugf("[getRootRootConfigResolver]Output object %v", ret) return ret, nil @@ -327,48 +344,48 @@ vCuOption := string(vConfig.Spec.CuOption) log.Debug("[getRootRootConfigResolver]Id is empty, process all Configs") vConfigParent, err := nc.GetRootRoot(context.TODO()) if err != nil { - log.Errorf("[getRootRootConfigResolver]Failed to get parent node %s", err) - return &model.ConfigConfig{}, nil - } + log.Errorf("[getRootRootConfigResolver]Failed to get parent node %s", err) + return &model.ConfigConfig{}, nil + } vConfig, err := vConfigParent.GetConfig(context.TODO()) if err != nil { - log.Errorf("[getRootRootConfigResolver]Error getting Config node %s", err) - return &model.ConfigConfig{}, nil - } + log.Errorf("[getRootRootConfigResolver]Error getting Config node %s", err) + return &model.ConfigConfig{}, nil + } dn := vConfig.DisplayName() -parentLabels := map[string]interface{}{"configs.config.tsm.tanzu.vmware.com":dn} -MyStr0, _ := json.Marshal(vConfig.Spec.MyStr0) -MyStr0Data := string(MyStr0) -MyStr1, _ := json.Marshal(vConfig.Spec.MyStr1) -MyStr1Data := string(MyStr1) -MyStr2, _ := json.Marshal(vConfig.Spec.MyStr2) -MyStr2Data := string(MyStr2) -XYZPort, _ := json.Marshal(vConfig.Spec.XYZPort) -XYZPortData := string(XYZPort) -ABCHost, _ := json.Marshal(vConfig.Spec.ABCHost) -ABCHostData := string(ABCHost) -ClusterNamespaces, _ := json.Marshal(vConfig.Spec.ClusterNamespaces) -ClusterNamespacesData := string(ClusterNamespaces) -TestValMarkers, _ := json.Marshal(vConfig.Spec.TestValMarkers) -TestValMarkersData := string(TestValMarkers) -vInstance := float64(vConfig.Spec.Instance) -vCuOption := string(vConfig.Spec.CuOption) - - for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.ConfigConfig { - Id: &dn, - ParentLabels: parentLabels, - MyStr0: &MyStr0Data, - MyStr1: &MyStr1Data, - MyStr2: &MyStr2Data, - XYZPort: &XYZPortData, - ABCHost: &ABCHostData, - ClusterNamespaces: &ClusterNamespacesData, - TestValMarkers: &TestValMarkersData, - Instance: &vInstance, - CuOption: &vCuOption, + parentLabels := map[string]interface{}{"configs.config.tsm.tanzu.vmware.com": dn} + MyStr0, _ := json.Marshal(vConfig.Spec.MyStr0) + MyStr0Data := string(MyStr0) + MyStr1, _ := json.Marshal(vConfig.Spec.MyStr1) + MyStr1Data := string(MyStr1) + MyStr2, _ := json.Marshal(vConfig.Spec.MyStr2) + MyStr2Data := string(MyStr2) + XYZPort, _ := json.Marshal(vConfig.Spec.XYZPort) + XYZPortData := string(XYZPort) + ABCHost, _ := json.Marshal(vConfig.Spec.ABCHost) + ABCHostData := string(ABCHost) + ClusterNamespaces, _ := json.Marshal(vConfig.Spec.ClusterNamespaces) + ClusterNamespacesData := string(ClusterNamespaces) + TestValMarkers, _ := json.Marshal(vConfig.Spec.TestValMarkers) + TestValMarkersData := string(TestValMarkers) + vInstance := float64(vConfig.Spec.Instance) + vCuOption := string(vConfig.Spec.CuOption) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.ConfigConfig{ + Id: &dn, + ParentLabels: parentLabels, + MyStr0: &MyStr0Data, + MyStr1: &MyStr1Data, + MyStr2: &MyStr2Data, + XYZPort: &XYZPortData, + ABCHost: &ABCHostData, + ClusterNamespaces: &ClusterNamespacesData, + TestValMarkers: &TestValMarkersData, + Instance: &vInstance, + CuOption: &vCuOption, } log.Debugf("[getRootRootConfigResolver]Output object %v", ret) @@ -383,58 +400,58 @@ vCuOption := string(vConfig.Spec.CuOption) func getConfigConfigGNSResolver(obj *model.ConfigConfig, id *string) (*model.GnsGns, error) { log.Debugf("[getConfigConfigGNSResolver]Parent Object %+v", obj) if id != nil && *id != "" { - log.Debugf("[getConfigConfigGNSResolver]Id %q", *id) + log.Debugf("[getConfigConfigGNSResolver]Id %q", *id) vGns, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GetGNS(context.TODO(), *id) if err != nil { log.Errorf("[getConfigConfigGNSResolver]Error getting GNS node %q : %s", *id, err) return &model.GnsGns{}, nil } dn := vGns.DisplayName() -parentLabels := map[string]interface{}{"gnses.gns.tsm.tanzu.vmware.com":dn} -vDomain := string(vGns.Spec.Domain) -vUseSharedGateway := bool(vGns.Spec.UseSharedGateway) -Description, _ := json.Marshal(vGns.Spec.Description) -DescriptionData := string(Description) -vMeta := string(vGns.Spec.Meta) -OtherDescription, _ := json.Marshal(vGns.Spec.OtherDescription) -OtherDescriptionData := string(OtherDescription) -MapPointer, _ := json.Marshal(vGns.Spec.MapPointer) -MapPointerData := string(MapPointer) -SlicePointer, _ := json.Marshal(vGns.Spec.SlicePointer) -SlicePointerData := string(SlicePointer) -WorkloadSpec, _ := json.Marshal(vGns.Spec.WorkloadSpec) -WorkloadSpecData := string(WorkloadSpec) -DifferentSpec, _ := json.Marshal(vGns.Spec.DifferentSpec) -DifferentSpecData := string(DifferentSpec) -ServiceSegmentRef, _ := json.Marshal(vGns.Spec.ServiceSegmentRef) -ServiceSegmentRefData := string(ServiceSegmentRef) -ServiceSegmentRefPointer, _ := json.Marshal(vGns.Spec.ServiceSegmentRefPointer) -ServiceSegmentRefPointerData := string(ServiceSegmentRefPointer) -ServiceSegmentRefs, _ := json.Marshal(vGns.Spec.ServiceSegmentRefs) -ServiceSegmentRefsData := string(ServiceSegmentRefs) -ServiceSegmentRefMap, _ := json.Marshal(vGns.Spec.ServiceSegmentRefMap) -ServiceSegmentRefMapData := string(ServiceSegmentRefMap) + parentLabels := map[string]interface{}{"gnses.gns.tsm.tanzu.vmware.com": dn} + vDomain := string(vGns.Spec.Domain) + vUseSharedGateway := bool(vGns.Spec.UseSharedGateway) + Description, _ := json.Marshal(vGns.Spec.Description) + DescriptionData := string(Description) + vMeta := string(vGns.Spec.Meta) + OtherDescription, _ := json.Marshal(vGns.Spec.OtherDescription) + OtherDescriptionData := string(OtherDescription) + MapPointer, _ := json.Marshal(vGns.Spec.MapPointer) + MapPointerData := string(MapPointer) + SlicePointer, _ := json.Marshal(vGns.Spec.SlicePointer) + SlicePointerData := string(SlicePointer) + WorkloadSpec, _ := json.Marshal(vGns.Spec.WorkloadSpec) + WorkloadSpecData := string(WorkloadSpec) + DifferentSpec, _ := json.Marshal(vGns.Spec.DifferentSpec) + DifferentSpecData := string(DifferentSpec) + ServiceSegmentRef, _ := json.Marshal(vGns.Spec.ServiceSegmentRef) + ServiceSegmentRefData := string(ServiceSegmentRef) + ServiceSegmentRefPointer, _ := json.Marshal(vGns.Spec.ServiceSegmentRefPointer) + ServiceSegmentRefPointerData := string(ServiceSegmentRefPointer) + ServiceSegmentRefs, _ := json.Marshal(vGns.Spec.ServiceSegmentRefs) + ServiceSegmentRefsData := string(ServiceSegmentRefs) + ServiceSegmentRefMap, _ := json.Marshal(vGns.Spec.ServiceSegmentRefMap) + ServiceSegmentRefMapData := string(ServiceSegmentRefMap) for k, v := range obj.ParentLabels { parentLabels[k] = v } - ret := &model.GnsGns { - Id: &dn, - ParentLabels: parentLabels, - Domain: &vDomain, - UseSharedGateway: &vUseSharedGateway, - Description: &DescriptionData, - Meta: &vMeta, - OtherDescription: &OtherDescriptionData, - MapPointer: &MapPointerData, - SlicePointer: &SlicePointerData, - WorkloadSpec: &WorkloadSpecData, - DifferentSpec: &DifferentSpecData, - ServiceSegmentRef: &ServiceSegmentRefData, - ServiceSegmentRefPointer: &ServiceSegmentRefPointerData, - ServiceSegmentRefs: &ServiceSegmentRefsData, - ServiceSegmentRefMap: &ServiceSegmentRefMapData, - } + ret := &model.GnsGns{ + Id: &dn, + ParentLabels: parentLabels, + Domain: &vDomain, + UseSharedGateway: &vUseSharedGateway, + Description: &DescriptionData, + Meta: &vMeta, + OtherDescription: &OtherDescriptionData, + MapPointer: &MapPointerData, + SlicePointer: &SlicePointerData, + WorkloadSpec: &WorkloadSpecData, + DifferentSpec: &DifferentSpecData, + ServiceSegmentRef: &ServiceSegmentRefData, + ServiceSegmentRefPointer: &ServiceSegmentRefPointerData, + ServiceSegmentRefs: &ServiceSegmentRefsData, + ServiceSegmentRefMap: &ServiceSegmentRefMapData, + } log.Debugf("[getConfigConfigGNSResolver]Output object %v", ret) return ret, nil @@ -442,59 +459,59 @@ ServiceSegmentRefMapData := string(ServiceSegmentRefMap) log.Debug("[getConfigConfigGNSResolver]Id is empty, process all GNSs") vGnsParent, err := nc.RootRoot().GetConfig(context.TODO(), getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")) if err != nil { - log.Errorf("[getConfigConfigGNSResolver]Failed to get parent node %s", err) - return &model.GnsGns{}, nil - } + log.Errorf("[getConfigConfigGNSResolver]Failed to get parent node %s", err) + return &model.GnsGns{}, nil + } vGns, err := vGnsParent.GetGNS(context.TODO()) if err != nil { - log.Errorf("[getConfigConfigGNSResolver]Error getting GNS node %s", err) - return &model.GnsGns{}, nil - } + log.Errorf("[getConfigConfigGNSResolver]Error getting GNS node %s", err) + return &model.GnsGns{}, nil + } dn := vGns.DisplayName() -parentLabels := map[string]interface{}{"gnses.gns.tsm.tanzu.vmware.com":dn} -vDomain := string(vGns.Spec.Domain) -vUseSharedGateway := bool(vGns.Spec.UseSharedGateway) -Description, _ := json.Marshal(vGns.Spec.Description) -DescriptionData := string(Description) -vMeta := string(vGns.Spec.Meta) -OtherDescription, _ := json.Marshal(vGns.Spec.OtherDescription) -OtherDescriptionData := string(OtherDescription) -MapPointer, _ := json.Marshal(vGns.Spec.MapPointer) -MapPointerData := string(MapPointer) -SlicePointer, _ := json.Marshal(vGns.Spec.SlicePointer) -SlicePointerData := string(SlicePointer) -WorkloadSpec, _ := json.Marshal(vGns.Spec.WorkloadSpec) -WorkloadSpecData := string(WorkloadSpec) -DifferentSpec, _ := json.Marshal(vGns.Spec.DifferentSpec) -DifferentSpecData := string(DifferentSpec) -ServiceSegmentRef, _ := json.Marshal(vGns.Spec.ServiceSegmentRef) -ServiceSegmentRefData := string(ServiceSegmentRef) -ServiceSegmentRefPointer, _ := json.Marshal(vGns.Spec.ServiceSegmentRefPointer) -ServiceSegmentRefPointerData := string(ServiceSegmentRefPointer) -ServiceSegmentRefs, _ := json.Marshal(vGns.Spec.ServiceSegmentRefs) -ServiceSegmentRefsData := string(ServiceSegmentRefs) -ServiceSegmentRefMap, _ := json.Marshal(vGns.Spec.ServiceSegmentRefMap) -ServiceSegmentRefMapData := string(ServiceSegmentRefMap) - - for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.GnsGns { - Id: &dn, - ParentLabels: parentLabels, - Domain: &vDomain, - UseSharedGateway: &vUseSharedGateway, - Description: &DescriptionData, - Meta: &vMeta, - OtherDescription: &OtherDescriptionData, - MapPointer: &MapPointerData, - SlicePointer: &SlicePointerData, - WorkloadSpec: &WorkloadSpecData, - DifferentSpec: &DifferentSpecData, - ServiceSegmentRef: &ServiceSegmentRefData, - ServiceSegmentRefPointer: &ServiceSegmentRefPointerData, - ServiceSegmentRefs: &ServiceSegmentRefsData, - ServiceSegmentRefMap: &ServiceSegmentRefMapData, + parentLabels := map[string]interface{}{"gnses.gns.tsm.tanzu.vmware.com": dn} + vDomain := string(vGns.Spec.Domain) + vUseSharedGateway := bool(vGns.Spec.UseSharedGateway) + Description, _ := json.Marshal(vGns.Spec.Description) + DescriptionData := string(Description) + vMeta := string(vGns.Spec.Meta) + OtherDescription, _ := json.Marshal(vGns.Spec.OtherDescription) + OtherDescriptionData := string(OtherDescription) + MapPointer, _ := json.Marshal(vGns.Spec.MapPointer) + MapPointerData := string(MapPointer) + SlicePointer, _ := json.Marshal(vGns.Spec.SlicePointer) + SlicePointerData := string(SlicePointer) + WorkloadSpec, _ := json.Marshal(vGns.Spec.WorkloadSpec) + WorkloadSpecData := string(WorkloadSpec) + DifferentSpec, _ := json.Marshal(vGns.Spec.DifferentSpec) + DifferentSpecData := string(DifferentSpec) + ServiceSegmentRef, _ := json.Marshal(vGns.Spec.ServiceSegmentRef) + ServiceSegmentRefData := string(ServiceSegmentRef) + ServiceSegmentRefPointer, _ := json.Marshal(vGns.Spec.ServiceSegmentRefPointer) + ServiceSegmentRefPointerData := string(ServiceSegmentRefPointer) + ServiceSegmentRefs, _ := json.Marshal(vGns.Spec.ServiceSegmentRefs) + ServiceSegmentRefsData := string(ServiceSegmentRefs) + ServiceSegmentRefMap, _ := json.Marshal(vGns.Spec.ServiceSegmentRefMap) + ServiceSegmentRefMapData := string(ServiceSegmentRefMap) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GnsGns{ + Id: &dn, + ParentLabels: parentLabels, + Domain: &vDomain, + UseSharedGateway: &vUseSharedGateway, + Description: &DescriptionData, + Meta: &vMeta, + OtherDescription: &OtherDescriptionData, + MapPointer: &MapPointerData, + SlicePointer: &SlicePointerData, + WorkloadSpec: &WorkloadSpecData, + DifferentSpec: &DifferentSpecData, + ServiceSegmentRef: &ServiceSegmentRefData, + ServiceSegmentRefPointer: &ServiceSegmentRefPointerData, + ServiceSegmentRefs: &ServiceSegmentRefsData, + ServiceSegmentRefMap: &ServiceSegmentRefMapData, } log.Debugf("[getConfigConfigGNSResolver]Output object %v", ret) @@ -510,23 +527,24 @@ func getConfigConfigDNSResolver(obj *model.ConfigConfig) (*model.GnsDns, error) log.Debugf("[getConfigConfigDNSResolver]Parent Object %+v", obj) vDns, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GetDNS(context.TODO()) if err != nil { - log.Errorf("[getConfigConfigDNSResolver]Error getting Config node %s", err) - return &model.GnsDns{}, nil - } + log.Errorf("[getConfigConfigDNSResolver]Error getting Config node %s", err) + return &model.GnsDns{}, nil + } dn := vDns.DisplayName() -parentLabels := map[string]interface{}{"dnses.gns.tsm.tanzu.vmware.com":dn} + parentLabels := map[string]interface{}{"dnses.gns.tsm.tanzu.vmware.com": dn} - for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.GnsDns { - Id: &dn, - ParentLabels: parentLabels, + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GnsDns{ + Id: &dn, + ParentLabels: parentLabels, } - log.Debugf("[getConfigConfigDNSResolver]Output object %+v", ret) + log.Debugf("[getConfigConfigDNSResolver]Output object %+v", ret) return ret, nil } + ////////////////////////////////////// // CHILD RESOLVER (Non Singleton) // FieldName: VMPPolicies Node: Config PKG: Config @@ -534,22 +552,22 @@ parentLabels := map[string]interface{}{"dnses.gns.tsm.tanzu.vmware.com":dn} func getConfigConfigVMPPoliciesResolver(obj *model.ConfigConfig, id *string) (*model.PolicypkgVMpolicy, error) { log.Debugf("[getConfigConfigVMPPoliciesResolver]Parent Object %+v", obj) if id != nil && *id != "" { - log.Debugf("[getConfigConfigVMPPoliciesResolver]Id %q", *id) + log.Debugf("[getConfigConfigVMPPoliciesResolver]Id %q", *id) vVMpolicy, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GetVMPPolicies(context.TODO(), *id) if err != nil { log.Errorf("[getConfigConfigVMPPoliciesResolver]Error getting VMPPolicies node %q : %s", *id, err) return &model.PolicypkgVMpolicy{}, nil } dn := vVMpolicy.DisplayName() -parentLabels := map[string]interface{}{"vmpolicies.policypkg.tsm.tanzu.vmware.com":dn} + parentLabels := map[string]interface{}{"vmpolicies.policypkg.tsm.tanzu.vmware.com": dn} for k, v := range obj.ParentLabels { parentLabels[k] = v } - ret := &model.PolicypkgVMpolicy { - Id: &dn, - ParentLabels: parentLabels, - } + ret := &model.PolicypkgVMpolicy{ + Id: &dn, + ParentLabels: parentLabels, + } log.Debugf("[getConfigConfigVMPPoliciesResolver]Output object %v", ret) return ret, nil @@ -557,23 +575,23 @@ parentLabels := map[string]interface{}{"vmpolicies.policypkg.tsm.tanzu.vmware.co log.Debug("[getConfigConfigVMPPoliciesResolver]Id is empty, process all VMPPoliciess") vVMpolicyParent, err := nc.RootRoot().GetConfig(context.TODO(), getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")) if err != nil { - log.Errorf("[getConfigConfigVMPPoliciesResolver]Failed to get parent node %s", err) - return &model.PolicypkgVMpolicy{}, nil - } + log.Errorf("[getConfigConfigVMPPoliciesResolver]Failed to get parent node %s", err) + return &model.PolicypkgVMpolicy{}, nil + } vVMpolicy, err := vVMpolicyParent.GetVMPPolicies(context.TODO()) if err != nil { - log.Errorf("[getConfigConfigVMPPoliciesResolver]Error getting VMPPolicies node %s", err) - return &model.PolicypkgVMpolicy{}, nil - } + log.Errorf("[getConfigConfigVMPPoliciesResolver]Error getting VMPPolicies node %s", err) + return &model.PolicypkgVMpolicy{}, nil + } dn := vVMpolicy.DisplayName() -parentLabels := map[string]interface{}{"vmpolicies.policypkg.tsm.tanzu.vmware.com":dn} + parentLabels := map[string]interface{}{"vmpolicies.policypkg.tsm.tanzu.vmware.com": dn} - for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.PolicypkgVMpolicy { - Id: &dn, - ParentLabels: parentLabels, + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.PolicypkgVMpolicy{ + Id: &dn, + ParentLabels: parentLabels, } log.Debugf("[getConfigConfigVMPPoliciesResolver]Output object %v", ret) @@ -588,43 +606,43 @@ parentLabels := map[string]interface{}{"vmpolicies.policypkg.tsm.tanzu.vmware.co func getConfigConfigDomainResolver(obj *model.ConfigConfig, id *string) (*model.ConfigDomain, error) { log.Debugf("[getConfigConfigDomainResolver]Parent Object %+v", obj) if id != nil && *id != "" { - log.Debugf("[getConfigConfigDomainResolver]Id %q", *id) + log.Debugf("[getConfigConfigDomainResolver]Id %q", *id) vDomain, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GetDomain(context.TODO(), *id) if err != nil { log.Errorf("[getConfigConfigDomainResolver]Error getting Domain node %q : %s", *id, err) return &model.ConfigDomain{}, nil } dn := vDomain.DisplayName() -parentLabels := map[string]interface{}{"domains.config.tsm.tanzu.vmware.com":dn} -PointPort, _ := json.Marshal(vDomain.Spec.PointPort) -PointPortData := string(PointPort) -PointMap, _ := json.Marshal(vDomain.Spec.PointMap) -PointMapData := string(PointMap) -PointSlice, _ := json.Marshal(vDomain.Spec.PointSlice) -PointSliceData := string(PointSlice) -SliceOfPoints, _ := json.Marshal(vDomain.Spec.SliceOfPoints) -SliceOfPointsData := string(SliceOfPoints) -SliceOfArrPoints, _ := json.Marshal(vDomain.Spec.SliceOfArrPoints) -SliceOfArrPointsData := string(SliceOfArrPoints) -MapOfArrsPoints, _ := json.Marshal(vDomain.Spec.MapOfArrsPoints) -MapOfArrsPointsData := string(MapOfArrsPoints) -PointStruct, _ := json.Marshal(vDomain.Spec.PointStruct) -PointStructData := string(PointStruct) + parentLabels := map[string]interface{}{"domains.config.tsm.tanzu.vmware.com": dn} + PointPort, _ := json.Marshal(vDomain.Spec.PointPort) + PointPortData := string(PointPort) + PointMap, _ := json.Marshal(vDomain.Spec.PointMap) + PointMapData := string(PointMap) + PointSlice, _ := json.Marshal(vDomain.Spec.PointSlice) + PointSliceData := string(PointSlice) + SliceOfPoints, _ := json.Marshal(vDomain.Spec.SliceOfPoints) + SliceOfPointsData := string(SliceOfPoints) + SliceOfArrPoints, _ := json.Marshal(vDomain.Spec.SliceOfArrPoints) + SliceOfArrPointsData := string(SliceOfArrPoints) + MapOfArrsPoints, _ := json.Marshal(vDomain.Spec.MapOfArrsPoints) + MapOfArrsPointsData := string(MapOfArrsPoints) + PointStruct, _ := json.Marshal(vDomain.Spec.PointStruct) + PointStructData := string(PointStruct) for k, v := range obj.ParentLabels { parentLabels[k] = v } - ret := &model.ConfigDomain { - Id: &dn, - ParentLabels: parentLabels, - PointPort: &PointPortData, - PointMap: &PointMapData, - PointSlice: &PointSliceData, - SliceOfPoints: &SliceOfPointsData, - SliceOfArrPoints: &SliceOfArrPointsData, - MapOfArrsPoints: &MapOfArrsPointsData, - PointStruct: &PointStructData, - } + ret := &model.ConfigDomain{ + Id: &dn, + ParentLabels: parentLabels, + PointPort: &PointPortData, + PointMap: &PointMapData, + PointSlice: &PointSliceData, + SliceOfPoints: &SliceOfPointsData, + SliceOfArrPoints: &SliceOfArrPointsData, + MapOfArrsPoints: &MapOfArrsPointsData, + PointStruct: &PointStructData, + } log.Debugf("[getConfigConfigDomainResolver]Output object %v", ret) return ret, nil @@ -632,44 +650,44 @@ PointStructData := string(PointStruct) log.Debug("[getConfigConfigDomainResolver]Id is empty, process all Domains") vDomainParent, err := nc.RootRoot().GetConfig(context.TODO(), getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")) if err != nil { - log.Errorf("[getConfigConfigDomainResolver]Failed to get parent node %s", err) - return &model.ConfigDomain{}, nil - } + log.Errorf("[getConfigConfigDomainResolver]Failed to get parent node %s", err) + return &model.ConfigDomain{}, nil + } vDomain, err := vDomainParent.GetDomain(context.TODO()) if err != nil { - log.Errorf("[getConfigConfigDomainResolver]Error getting Domain node %s", err) - return &model.ConfigDomain{}, nil - } + log.Errorf("[getConfigConfigDomainResolver]Error getting Domain node %s", err) + return &model.ConfigDomain{}, nil + } dn := vDomain.DisplayName() -parentLabels := map[string]interface{}{"domains.config.tsm.tanzu.vmware.com":dn} -PointPort, _ := json.Marshal(vDomain.Spec.PointPort) -PointPortData := string(PointPort) -PointMap, _ := json.Marshal(vDomain.Spec.PointMap) -PointMapData := string(PointMap) -PointSlice, _ := json.Marshal(vDomain.Spec.PointSlice) -PointSliceData := string(PointSlice) -SliceOfPoints, _ := json.Marshal(vDomain.Spec.SliceOfPoints) -SliceOfPointsData := string(SliceOfPoints) -SliceOfArrPoints, _ := json.Marshal(vDomain.Spec.SliceOfArrPoints) -SliceOfArrPointsData := string(SliceOfArrPoints) -MapOfArrsPoints, _ := json.Marshal(vDomain.Spec.MapOfArrsPoints) -MapOfArrsPointsData := string(MapOfArrsPoints) -PointStruct, _ := json.Marshal(vDomain.Spec.PointStruct) -PointStructData := string(PointStruct) - - for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.ConfigDomain { - Id: &dn, - ParentLabels: parentLabels, - PointPort: &PointPortData, - PointMap: &PointMapData, - PointSlice: &PointSliceData, - SliceOfPoints: &SliceOfPointsData, - SliceOfArrPoints: &SliceOfArrPointsData, - MapOfArrsPoints: &MapOfArrsPointsData, - PointStruct: &PointStructData, + parentLabels := map[string]interface{}{"domains.config.tsm.tanzu.vmware.com": dn} + PointPort, _ := json.Marshal(vDomain.Spec.PointPort) + PointPortData := string(PointPort) + PointMap, _ := json.Marshal(vDomain.Spec.PointMap) + PointMapData := string(PointMap) + PointSlice, _ := json.Marshal(vDomain.Spec.PointSlice) + PointSliceData := string(PointSlice) + SliceOfPoints, _ := json.Marshal(vDomain.Spec.SliceOfPoints) + SliceOfPointsData := string(SliceOfPoints) + SliceOfArrPoints, _ := json.Marshal(vDomain.Spec.SliceOfArrPoints) + SliceOfArrPointsData := string(SliceOfArrPoints) + MapOfArrsPoints, _ := json.Marshal(vDomain.Spec.MapOfArrsPoints) + MapOfArrsPointsData := string(MapOfArrsPoints) + PointStruct, _ := json.Marshal(vDomain.Spec.PointStruct) + PointStructData := string(PointStruct) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.ConfigDomain{ + Id: &dn, + ParentLabels: parentLabels, + PointPort: &PointPortData, + PointMap: &PointMapData, + PointSlice: &PointSliceData, + SliceOfPoints: &SliceOfPointsData, + SliceOfArrPoints: &SliceOfArrPointsData, + MapOfArrsPoints: &MapOfArrsPointsData, + PointStruct: &PointStructData, } log.Debugf("[getConfigConfigDomainResolver]Output object %v", ret) @@ -684,30 +702,30 @@ PointStructData := string(PointStruct) func getConfigConfigSvcGrpInfoResolver(obj *model.ConfigConfig, id *string) (*model.ServicegroupSvcGroupLinkInfo, error) { log.Debugf("[getConfigConfigSvcGrpInfoResolver]Parent Object %+v", obj) if id != nil && *id != "" { - log.Debugf("[getConfigConfigSvcGrpInfoResolver]Id %q", *id) + log.Debugf("[getConfigConfigSvcGrpInfoResolver]Id %q", *id) vSvcGroupLinkInfo, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GetSvcGrpInfo(context.TODO(), *id) if err != nil { log.Errorf("[getConfigConfigSvcGrpInfoResolver]Error getting SvcGrpInfo node %q : %s", *id, err) return &model.ServicegroupSvcGroupLinkInfo{}, nil } dn := vSvcGroupLinkInfo.DisplayName() -parentLabels := map[string]interface{}{"svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com":dn} -vClusterName := string(vSvcGroupLinkInfo.Spec.ClusterName) -vDomainName := string(vSvcGroupLinkInfo.Spec.DomainName) -vServiceName := string(vSvcGroupLinkInfo.Spec.ServiceName) -vServiceType := string(vSvcGroupLinkInfo.Spec.ServiceType) + parentLabels := map[string]interface{}{"svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com": dn} + vClusterName := string(vSvcGroupLinkInfo.Spec.ClusterName) + vDomainName := string(vSvcGroupLinkInfo.Spec.DomainName) + vServiceName := string(vSvcGroupLinkInfo.Spec.ServiceName) + vServiceType := string(vSvcGroupLinkInfo.Spec.ServiceType) for k, v := range obj.ParentLabels { parentLabels[k] = v } - ret := &model.ServicegroupSvcGroupLinkInfo { - Id: &dn, - ParentLabels: parentLabels, - ClusterName: &vClusterName, - DomainName: &vDomainName, - ServiceName: &vServiceName, - ServiceType: &vServiceType, - } + ret := &model.ServicegroupSvcGroupLinkInfo{ + Id: &dn, + ParentLabels: parentLabels, + ClusterName: &vClusterName, + DomainName: &vDomainName, + ServiceName: &vServiceName, + ServiceType: &vServiceType, + } log.Debugf("[getConfigConfigSvcGrpInfoResolver]Output object %v", ret) return ret, nil @@ -715,31 +733,31 @@ vServiceType := string(vSvcGroupLinkInfo.Spec.ServiceType) log.Debug("[getConfigConfigSvcGrpInfoResolver]Id is empty, process all SvcGrpInfos") vSvcGroupLinkInfoParent, err := nc.RootRoot().GetConfig(context.TODO(), getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")) if err != nil { - log.Errorf("[getConfigConfigSvcGrpInfoResolver]Failed to get parent node %s", err) - return &model.ServicegroupSvcGroupLinkInfo{}, nil - } + log.Errorf("[getConfigConfigSvcGrpInfoResolver]Failed to get parent node %s", err) + return &model.ServicegroupSvcGroupLinkInfo{}, nil + } vSvcGroupLinkInfo, err := vSvcGroupLinkInfoParent.GetSvcGrpInfo(context.TODO()) if err != nil { - log.Errorf("[getConfigConfigSvcGrpInfoResolver]Error getting SvcGrpInfo node %s", err) - return &model.ServicegroupSvcGroupLinkInfo{}, nil - } + log.Errorf("[getConfigConfigSvcGrpInfoResolver]Error getting SvcGrpInfo node %s", err) + return &model.ServicegroupSvcGroupLinkInfo{}, nil + } dn := vSvcGroupLinkInfo.DisplayName() -parentLabels := map[string]interface{}{"svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com":dn} -vClusterName := string(vSvcGroupLinkInfo.Spec.ClusterName) -vDomainName := string(vSvcGroupLinkInfo.Spec.DomainName) -vServiceName := string(vSvcGroupLinkInfo.Spec.ServiceName) -vServiceType := string(vSvcGroupLinkInfo.Spec.ServiceType) - - for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.ServicegroupSvcGroupLinkInfo { - Id: &dn, - ParentLabels: parentLabels, - ClusterName: &vClusterName, - DomainName: &vDomainName, - ServiceName: &vServiceName, - ServiceType: &vServiceType, + parentLabels := map[string]interface{}{"svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com": dn} + vClusterName := string(vSvcGroupLinkInfo.Spec.ClusterName) + vDomainName := string(vSvcGroupLinkInfo.Spec.DomainName) + vServiceName := string(vSvcGroupLinkInfo.Spec.ServiceName) + vServiceType := string(vSvcGroupLinkInfo.Spec.ServiceType) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.ServicegroupSvcGroupLinkInfo{ + Id: &dn, + ParentLabels: parentLabels, + ClusterName: &vClusterName, + DomainName: &vDomainName, + ServiceName: &vServiceName, + ServiceType: &vServiceType, } log.Debugf("[getConfigConfigSvcGrpInfoResolver]Output object %v", ret) @@ -759,30 +777,30 @@ func getConfigConfigFooExampleResolver(obj *model.ConfigConfig, id *string) ([]* vFooTypeABC, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GetFooExample(context.TODO(), *id) if err != nil { log.Errorf("[getConfigConfigFooExampleResolver]Error getting FooExample node %q : %s", *id, err) - return vConfigFooTypeABCList, nil - } + return vConfigFooTypeABCList, nil + } dn := vFooTypeABC.DisplayName() -parentLabels := map[string]interface{}{"footypeabcs.config.tsm.tanzu.vmware.com":dn} -FooA, _ := json.Marshal(vFooTypeABC.Spec.FooA) -FooAData := string(FooA) -FooB, _ := json.Marshal(vFooTypeABC.Spec.FooB) -FooBData := string(FooB) -FooD, _ := json.Marshal(vFooTypeABC.Spec.FooD) -FooDData := string(FooD) -FooF, _ := json.Marshal(vFooTypeABC.Spec.FooF) -FooFData := string(FooF) - - for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.ConfigFooTypeABC { - Id: &dn, - ParentLabels: parentLabels, - FooA: &FooAData, - FooB: &FooBData, - FooD: &FooDData, - FooF: &FooFData, - } + parentLabels := map[string]interface{}{"footypeabcs.config.tsm.tanzu.vmware.com": dn} + FooA, _ := json.Marshal(vFooTypeABC.Spec.FooA) + FooAData := string(FooA) + FooB, _ := json.Marshal(vFooTypeABC.Spec.FooB) + FooBData := string(FooB) + FooD, _ := json.Marshal(vFooTypeABC.Spec.FooD) + FooDData := string(FooD) + FooF, _ := json.Marshal(vFooTypeABC.Spec.FooF) + FooFData := string(FooF) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.ConfigFooTypeABC{ + Id: &dn, + ParentLabels: parentLabels, + FooA: &FooAData, + FooB: &FooBData, + FooD: &FooDData, + FooF: &FooFData, + } vConfigFooTypeABCList = append(vConfigFooTypeABCList, ret) log.Debugf("[getConfigConfigFooExampleResolver]Output FooExample objects %v", vConfigFooTypeABCList) @@ -794,42 +812,42 @@ FooFData := string(FooF) vFooTypeABCParent, err := nc.RootRoot().GetConfig(context.TODO(), getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")) if err != nil { - log.Errorf("[getConfigConfigFooExampleResolver]Error getting parent node %s", err) - return vConfigFooTypeABCList, nil - } + log.Errorf("[getConfigConfigFooExampleResolver]Error getting parent node %s", err) + return vConfigFooTypeABCList, nil + } vFooTypeABCAllObj, err := vFooTypeABCParent.GetAllFooExample(context.TODO()) if err != nil { - log.Errorf("[getConfigConfigFooExampleResolver]Error getting FooExample objects %s", err) - return vConfigFooTypeABCList, nil - } + log.Errorf("[getConfigConfigFooExampleResolver]Error getting FooExample objects %s", err) + return vConfigFooTypeABCList, nil + } for _, i := range vFooTypeABCAllObj { vFooTypeABC, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GetFooExample(context.TODO(), i.DisplayName()) if err != nil { - log.Errorf("[getConfigConfigFooExampleResolver]Error getting FooExample node %q : %s", i.DisplayName(), err) - continue + log.Errorf("[getConfigConfigFooExampleResolver]Error getting FooExample node %q : %s", i.DisplayName(), err) + continue } dn := vFooTypeABC.DisplayName() -parentLabels := map[string]interface{}{"footypeabcs.config.tsm.tanzu.vmware.com":dn} -FooA, _ := json.Marshal(vFooTypeABC.Spec.FooA) -FooAData := string(FooA) -FooB, _ := json.Marshal(vFooTypeABC.Spec.FooB) -FooBData := string(FooB) -FooD, _ := json.Marshal(vFooTypeABC.Spec.FooD) -FooDData := string(FooD) -FooF, _ := json.Marshal(vFooTypeABC.Spec.FooF) -FooFData := string(FooF) + parentLabels := map[string]interface{}{"footypeabcs.config.tsm.tanzu.vmware.com": dn} + FooA, _ := json.Marshal(vFooTypeABC.Spec.FooA) + FooAData := string(FooA) + FooB, _ := json.Marshal(vFooTypeABC.Spec.FooB) + FooBData := string(FooB) + FooD, _ := json.Marshal(vFooTypeABC.Spec.FooD) + FooDData := string(FooD) + FooF, _ := json.Marshal(vFooTypeABC.Spec.FooF) + FooFData := string(FooF) for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.ConfigFooTypeABC { - Id: &dn, - ParentLabels: parentLabels, - FooA: &FooAData, - FooB: &FooBData, - FooD: &FooDData, - FooF: &FooFData, - } + parentLabels[k] = v + } + ret := &model.ConfigFooTypeABC{ + Id: &dn, + ParentLabels: parentLabels, + FooA: &FooAData, + FooB: &FooBData, + FooD: &FooDData, + FooF: &FooFData, + } vConfigFooTypeABCList = append(vConfigFooTypeABCList, ret) } @@ -858,15 +876,15 @@ func getConfigConfigACPPoliciesResolver(obj *model.ConfigConfig, id *string) ([] return vPolicypkgAccessControlPolicyList, nil } dn := vAccessControlPolicy.DisplayName() -parentLabels := map[string]interface{}{"accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com":dn} + parentLabels := map[string]interface{}{"accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com": dn} - for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.PolicypkgAccessControlPolicy { - Id: &dn, - ParentLabels: parentLabels, - } + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.PolicypkgAccessControlPolicy{ + Id: &dn, + ParentLabels: parentLabels, + } vPolicypkgAccessControlPolicyList = append(vPolicypkgAccessControlPolicyList, ret) log.Debugf("[getConfigConfigACPPoliciesResolver]Output ACPPolicies objects %v", vPolicypkgAccessControlPolicyList) @@ -878,35 +896,35 @@ parentLabels := map[string]interface{}{"accesscontrolpolicies.policypkg.tsm.tanz vAccessControlPolicyParent, err := nc.RootRoot().GetConfig(context.TODO(), getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")) if err != nil { - log.Errorf("[getConfigConfigACPPoliciesResolver]Error getting parent node %s", err) - return vPolicypkgAccessControlPolicyList, nil - } + log.Errorf("[getConfigConfigACPPoliciesResolver]Error getting parent node %s", err) + return vPolicypkgAccessControlPolicyList, nil + } vAccessControlPolicyAllObj, err := vAccessControlPolicyParent.GetAllACPPolicies(context.TODO()) if err != nil { - log.Errorf("[getConfigConfigACPPoliciesResolver]Error getting ACPPolicies %s", err) - return vPolicypkgAccessControlPolicyList, nil - } + log.Errorf("[getConfigConfigACPPoliciesResolver]Error getting ACPPolicies %s", err) + return vPolicypkgAccessControlPolicyList, nil + } for _, i := range vAccessControlPolicyAllObj { vAccessControlPolicyParent, err := nc.RootRoot().GetConfig(context.TODO(), getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")) if err != nil { log.Errorf("[getConfigConfigACPPoliciesResolver]Error getting parent node %s, skipping...", err) - continue + continue } vAccessControlPolicy, err := vAccessControlPolicyParent.GetACPPolicies(context.TODO(), i.DisplayName()) if err != nil { - log.Errorf("[getConfigConfigACPPoliciesResolver]Error getting ACPPolicies node %q : %s, skipping...", i.DisplayName(), err) + log.Errorf("[getConfigConfigACPPoliciesResolver]Error getting ACPPolicies node %q : %s, skipping...", i.DisplayName(), err) continue } dn := vAccessControlPolicy.DisplayName() -parentLabels := map[string]interface{}{"accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com":dn} + parentLabels := map[string]interface{}{"accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com": dn} for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.PolicypkgAccessControlPolicy { - Id: &dn, - ParentLabels: parentLabels, - } + parentLabels[k] = v + } + ret := &model.PolicypkgAccessControlPolicy{ + Id: &dn, + ParentLabels: parentLabels, + } vPolicypkgAccessControlPolicyList = append(vPolicypkgAccessControlPolicyList, ret) } log.Debugf("[getConfigConfigACPPoliciesResolver]List of ACPPolicies object %v", vPolicypkgAccessControlPolicyList) @@ -920,22 +938,22 @@ parentLabels := map[string]interface{}{"accesscontrolpolicies.policypkg.tsm.tanz func getGnsGnsGnsAccessControlPolicyResolver(obj *model.GnsGns, id *string) (*model.PolicypkgAccessControlPolicy, error) { log.Debugf("[getGnsGnsGnsAccessControlPolicyResolver]Parent Object %+v", obj) if id != nil && *id != "" { - log.Debugf("[getGnsGnsGnsAccessControlPolicyResolver]Id %q", *id) + log.Debugf("[getGnsGnsGnsAccessControlPolicyResolver]Id %q", *id) vAccessControlPolicy, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GNS(getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")).GetGnsAccessControlPolicy(context.TODO(), *id) if err != nil { log.Errorf("[getGnsGnsGnsAccessControlPolicyResolver]Error getting GnsAccessControlPolicy node %q : %s", *id, err) return &model.PolicypkgAccessControlPolicy{}, nil } dn := vAccessControlPolicy.DisplayName() -parentLabels := map[string]interface{}{"accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com":dn} + parentLabels := map[string]interface{}{"accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com": dn} for k, v := range obj.ParentLabels { parentLabels[k] = v } - ret := &model.PolicypkgAccessControlPolicy { - Id: &dn, - ParentLabels: parentLabels, - } + ret := &model.PolicypkgAccessControlPolicy{ + Id: &dn, + ParentLabels: parentLabels, + } log.Debugf("[getGnsGnsGnsAccessControlPolicyResolver]Output object %v", ret) return ret, nil @@ -943,23 +961,23 @@ parentLabels := map[string]interface{}{"accesscontrolpolicies.policypkg.tsm.tanz log.Debug("[getGnsGnsGnsAccessControlPolicyResolver]Id is empty, process all GnsAccessControlPolicys") vAccessControlPolicyParent, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GetGNS(context.TODO(), getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")) if err != nil { - log.Errorf("[getGnsGnsGnsAccessControlPolicyResolver]Failed to get parent node %s", err) - return &model.PolicypkgAccessControlPolicy{}, nil - } + log.Errorf("[getGnsGnsGnsAccessControlPolicyResolver]Failed to get parent node %s", err) + return &model.PolicypkgAccessControlPolicy{}, nil + } vAccessControlPolicy, err := vAccessControlPolicyParent.GetGnsAccessControlPolicy(context.TODO()) if err != nil { - log.Errorf("[getGnsGnsGnsAccessControlPolicyResolver]Error getting GnsAccessControlPolicy node %s", err) - return &model.PolicypkgAccessControlPolicy{}, nil - } + log.Errorf("[getGnsGnsGnsAccessControlPolicyResolver]Error getting GnsAccessControlPolicy node %s", err) + return &model.PolicypkgAccessControlPolicy{}, nil + } dn := vAccessControlPolicy.DisplayName() -parentLabels := map[string]interface{}{"accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com":dn} + parentLabels := map[string]interface{}{"accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com": dn} - for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.PolicypkgAccessControlPolicy { - Id: &dn, - ParentLabels: parentLabels, + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.PolicypkgAccessControlPolicy{ + Id: &dn, + ParentLabels: parentLabels, } log.Debugf("[getGnsGnsGnsAccessControlPolicyResolver]Output object %v", ret) @@ -975,25 +993,26 @@ func getGnsGnsFooChildResolver(obj *model.GnsGns) (*model.GnsBarChild, error) { log.Debugf("[getGnsGnsFooChildResolver]Parent Object %+v", obj) vBarChild, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GNS(getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")).GetFooChild(context.TODO()) if err != nil { - log.Errorf("[getGnsGnsFooChildResolver]Error getting Gns node %s", err) - return &model.GnsBarChild{}, nil - } + log.Errorf("[getGnsGnsFooChildResolver]Error getting Gns node %s", err) + return &model.GnsBarChild{}, nil + } dn := vBarChild.DisplayName() -parentLabels := map[string]interface{}{"barchilds.gns.tsm.tanzu.vmware.com":dn} -vName := string(vBarChild.Spec.Name) + parentLabels := map[string]interface{}{"barchilds.gns.tsm.tanzu.vmware.com": dn} + vName := string(vBarChild.Spec.Name) - for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.GnsBarChild { - Id: &dn, - ParentLabels: parentLabels, - Name: &vName, + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GnsBarChild{ + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, } - log.Debugf("[getGnsGnsFooChildResolver]Output object %+v", ret) + log.Debugf("[getGnsGnsFooChildResolver]Output object %+v", ret) return ret, nil } + ////////////////////////////////////// // CHILDREN RESOLVER // FieldName: PolicyConfigs Node: AccessControlPolicy PKG: Policypkg @@ -1006,32 +1025,32 @@ func getPolicypkgAccessControlPolicyPolicyConfigsResolver(obj *model.PolicypkgAc vACPConfig, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GNS(getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")).GnsAccessControlPolicy(getParentName(obj.ParentLabels, "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), *id) if err != nil { log.Errorf("[getPolicypkgAccessControlPolicyPolicyConfigsResolver]Error getting PolicyConfigs node %q : %s", *id, err) - return vPolicypkgACPConfigList, nil - } + return vPolicypkgACPConfigList, nil + } dn := vACPConfig.DisplayName() -parentLabels := map[string]interface{}{"acpconfigs.policypkg.tsm.tanzu.vmware.com":dn} -vDisplayName := string(vACPConfig.Spec.DisplayName) -vGns := string(vACPConfig.Spec.Gns) -vDescription := string(vACPConfig.Spec.Description) -Tags, _ := json.Marshal(vACPConfig.Spec.Tags) -TagsData := string(Tags) -vProjectId := string(vACPConfig.Spec.ProjectId) -Conditions, _ := json.Marshal(vACPConfig.Spec.Conditions) -ConditionsData := string(Conditions) - - for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.PolicypkgACPConfig { - Id: &dn, - ParentLabels: parentLabels, - DisplayName: &vDisplayName, - Gns: &vGns, - Description: &vDescription, - Tags: &TagsData, - ProjectId: &vProjectId, - Conditions: &ConditionsData, - } + parentLabels := map[string]interface{}{"acpconfigs.policypkg.tsm.tanzu.vmware.com": dn} + vDisplayName := string(vACPConfig.Spec.DisplayName) + vGns := string(vACPConfig.Spec.Gns) + vDescription := string(vACPConfig.Spec.Description) + Tags, _ := json.Marshal(vACPConfig.Spec.Tags) + TagsData := string(Tags) + vProjectId := string(vACPConfig.Spec.ProjectId) + Conditions, _ := json.Marshal(vACPConfig.Spec.Conditions) + ConditionsData := string(Conditions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.PolicypkgACPConfig{ + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + Gns: &vGns, + Description: &vDescription, + Tags: &TagsData, + ProjectId: &vProjectId, + Conditions: &ConditionsData, + } vPolicypkgACPConfigList = append(vPolicypkgACPConfigList, ret) log.Debugf("[getPolicypkgAccessControlPolicyPolicyConfigsResolver]Output PolicyConfigs objects %v", vPolicypkgACPConfigList) @@ -1043,44 +1062,44 @@ ConditionsData := string(Conditions) vACPConfigParent, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GNS(getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")).GetGnsAccessControlPolicy(context.TODO(), getParentName(obj.ParentLabels, "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com")) if err != nil { - log.Errorf("[getPolicypkgAccessControlPolicyPolicyConfigsResolver]Error getting parent node %s", err) - return vPolicypkgACPConfigList, nil - } + log.Errorf("[getPolicypkgAccessControlPolicyPolicyConfigsResolver]Error getting parent node %s", err) + return vPolicypkgACPConfigList, nil + } vACPConfigAllObj, err := vACPConfigParent.GetAllPolicyConfigs(context.TODO()) if err != nil { - log.Errorf("[getPolicypkgAccessControlPolicyPolicyConfigsResolver]Error getting PolicyConfigs objects %s", err) - return vPolicypkgACPConfigList, nil - } + log.Errorf("[getPolicypkgAccessControlPolicyPolicyConfigsResolver]Error getting PolicyConfigs objects %s", err) + return vPolicypkgACPConfigList, nil + } for _, i := range vACPConfigAllObj { vACPConfig, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GNS(getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")).GnsAccessControlPolicy(getParentName(obj.ParentLabels, "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), i.DisplayName()) if err != nil { - log.Errorf("[getPolicypkgAccessControlPolicyPolicyConfigsResolver]Error getting PolicyConfigs node %q : %s", i.DisplayName(), err) - continue + log.Errorf("[getPolicypkgAccessControlPolicyPolicyConfigsResolver]Error getting PolicyConfigs node %q : %s", i.DisplayName(), err) + continue } dn := vACPConfig.DisplayName() -parentLabels := map[string]interface{}{"acpconfigs.policypkg.tsm.tanzu.vmware.com":dn} -vDisplayName := string(vACPConfig.Spec.DisplayName) -vGns := string(vACPConfig.Spec.Gns) -vDescription := string(vACPConfig.Spec.Description) -Tags, _ := json.Marshal(vACPConfig.Spec.Tags) -TagsData := string(Tags) -vProjectId := string(vACPConfig.Spec.ProjectId) -Conditions, _ := json.Marshal(vACPConfig.Spec.Conditions) -ConditionsData := string(Conditions) + parentLabels := map[string]interface{}{"acpconfigs.policypkg.tsm.tanzu.vmware.com": dn} + vDisplayName := string(vACPConfig.Spec.DisplayName) + vGns := string(vACPConfig.Spec.Gns) + vDescription := string(vACPConfig.Spec.Description) + Tags, _ := json.Marshal(vACPConfig.Spec.Tags) + TagsData := string(Tags) + vProjectId := string(vACPConfig.Spec.ProjectId) + Conditions, _ := json.Marshal(vACPConfig.Spec.Conditions) + ConditionsData := string(Conditions) for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.PolicypkgACPConfig { - Id: &dn, - ParentLabels: parentLabels, - DisplayName: &vDisplayName, - Gns: &vGns, - Description: &vDescription, - Tags: &TagsData, - ProjectId: &vProjectId, - Conditions: &ConditionsData, - } + parentLabels[k] = v + } + ret := &model.PolicypkgACPConfig{ + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + Gns: &vGns, + Description: &vDescription, + Tags: &TagsData, + ProjectId: &vProjectId, + Conditions: &ConditionsData, + } vPolicypkgACPConfigList = append(vPolicypkgACPConfigList, ret) } @@ -1089,3 +1108,132 @@ ConditionsData := string(Conditions) return vPolicypkgACPConfigList, nil } +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: DestSvcGroups Node: ACPConfig PKG: Policypkg +////////////////////////////////////// +func getPolicypkgACPConfigDestSvcGroupsResolver(obj *model.PolicypkgACPConfig, id *string) ([]*model.ServicegroupSvcGroup, error) { + log.Debugf("[getPolicypkgACPConfigDestSvcGroupsResolver]Parent Object %+v", obj) + var vServicegroupSvcGroupList []*model.ServicegroupSvcGroup + if id != nil && *id != "" { + log.Debugf("[getPolicypkgACPConfigDestSvcGroupsResolver]Id %q", *id) + vSvcGroupParent, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GNS(getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")).GnsAccessControlPolicy(getParentName(obj.ParentLabels, "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), getParentName(obj.ParentLabels, "acpconfigs.policypkg.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getPolicypkgACPConfigDestSvcGroupsResolver]Error getting DestSvcGroups %q : %s", *id, err) + return vServicegroupSvcGroupList, nil + } + vSvcGroup, err := vSvcGroupParent.GetDestSvcGroups(context.TODO(), *id) + if err != nil { + log.Errorf("[getPolicypkgACPConfigDestSvcGroupsResolver]Error getting DestSvcGroups %q : %s", *id, err) + return vServicegroupSvcGroupList, nil + } + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + + vServicegroupSvcGroupList = append(vServicegroupSvcGroupList, ret) + + log.Debugf("[getPolicypkgACPConfigDestSvcGroupsResolver]Output DestSvcGroups objects %v", vServicegroupSvcGroupList) + + return vServicegroupSvcGroupList, nil + } + + log.Debug("[getPolicypkgACPConfigDestSvcGroupsResolver]Id is empty, process all DestSvcGroupss") + + vSvcGroupParent, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GNS(getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")).GnsAccessControlPolicy(getParentName(obj.ParentLabels, "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), getParentName(obj.ParentLabels, "acpconfigs.policypkg.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getPolicypkgACPConfigDestSvcGroupsResolver]Error getting parent node %s", err) + return vServicegroupSvcGroupList, nil + } + vSvcGroupAllObj, err := vSvcGroupParent.GetAllDestSvcGroups(context.TODO()) + if err != nil { + log.Errorf("[getPolicypkgACPConfigDestSvcGroupsResolver]Error getting DestSvcGroups %s", err) + return vServicegroupSvcGroupList, nil + } + for _, i := range vSvcGroupAllObj { + vSvcGroupParent, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GNS(getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")).GnsAccessControlPolicy(getParentName(obj.ParentLabels, "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), getParentName(obj.ParentLabels, "acpconfigs.policypkg.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getPolicypkgACPConfigDestSvcGroupsResolver]Error getting parent node %s, skipping...", err) + continue + } + vSvcGroup, err := vSvcGroupParent.GetDestSvcGroups(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getPolicypkgACPConfigDestSvcGroupsResolver]Error getting DestSvcGroups node %q : %s, skipping...", i.DisplayName(), err) + continue + } + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + + vServicegroupSvcGroupList = append(vServicegroupSvcGroupList, ret) + } + log.Debugf("[getPolicypkgACPConfigDestSvcGroupsResolver]List of DestSvcGroups object %v", vServicegroupSvcGroupList) + return vServicegroupSvcGroupList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: SourceSvcGroups Node: ACPConfig PKG: Policypkg +////////////////////////////////////// +func getPolicypkgACPConfigSourceSvcGroupsResolver(obj *model.PolicypkgACPConfig, id *string) ([]*model.ServicegroupSvcGroup, error) { + log.Debugf("[getPolicypkgACPConfigSourceSvcGroupsResolver]Parent Object %+v", obj) + var vServicegroupSvcGroupList []*model.ServicegroupSvcGroup + if id != nil && *id != "" { + log.Debugf("[getPolicypkgACPConfigSourceSvcGroupsResolver]Id %q", *id) + vSvcGroupParent, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GNS(getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")).GnsAccessControlPolicy(getParentName(obj.ParentLabels, "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), getParentName(obj.ParentLabels, "acpconfigs.policypkg.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getPolicypkgACPConfigSourceSvcGroupsResolver]Error getting SourceSvcGroups %q : %s", *id, err) + return vServicegroupSvcGroupList, nil + } + vSvcGroup, err := vSvcGroupParent.GetSourceSvcGroups(context.TODO(), *id) + if err != nil { + log.Errorf("[getPolicypkgACPConfigSourceSvcGroupsResolver]Error getting SourceSvcGroups %q : %s", *id, err) + return vServicegroupSvcGroupList, nil + } + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + + vServicegroupSvcGroupList = append(vServicegroupSvcGroupList, ret) + + log.Debugf("[getPolicypkgACPConfigSourceSvcGroupsResolver]Output SourceSvcGroups objects %v", vServicegroupSvcGroupList) + + return vServicegroupSvcGroupList, nil + } + + log.Debug("[getPolicypkgACPConfigSourceSvcGroupsResolver]Id is empty, process all SourceSvcGroupss") + + vSvcGroupParent, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GNS(getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")).GnsAccessControlPolicy(getParentName(obj.ParentLabels, "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), getParentName(obj.ParentLabels, "acpconfigs.policypkg.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getPolicypkgACPConfigSourceSvcGroupsResolver]Error getting parent node %s", err) + return vServicegroupSvcGroupList, nil + } + vSvcGroupAllObj, err := vSvcGroupParent.GetAllSourceSvcGroups(context.TODO()) + if err != nil { + log.Errorf("[getPolicypkgACPConfigSourceSvcGroupsResolver]Error getting SourceSvcGroups %s", err) + return vServicegroupSvcGroupList, nil + } + for _, i := range vSvcGroupAllObj { + vSvcGroupParent, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GNS(getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")).GnsAccessControlPolicy(getParentName(obj.ParentLabels, "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), getParentName(obj.ParentLabels, "acpconfigs.policypkg.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getPolicypkgACPConfigSourceSvcGroupsResolver]Error getting parent node %s, skipping...", err) + continue + } + vSvcGroup, err := vSvcGroupParent.GetSourceSvcGroups(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getPolicypkgACPConfigSourceSvcGroupsResolver]Error getting SourceSvcGroups node %q : %s, skipping...", i.DisplayName(), err) + continue + } + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + + vServicegroupSvcGroupList = append(vServicegroupSvcGroupList, ret) + } + log.Debugf("[getPolicypkgACPConfigSourceSvcGroupsResolver]List of SourceSvcGroups object %v", vServicegroupSvcGroupList) + return vServicegroupSvcGroupList, nil +} diff --git a/compiler/example/output/_rendered_templates/nexus-gql/graph/schema.graphqls b/compiler/example/output/_rendered_templates/nexus-gql/graph/schema.graphqls index dc5d49a9b..72f2153a8 100644 --- a/compiler/example/output/_rendered_templates/nexus-gql/graph/schema.graphqls +++ b/compiler/example/output/_rendered_templates/nexus-gql/graph/schema.graphqls @@ -20,7 +20,6 @@ type config_Config { IsServiceDeployment: Boolean StartVal: Int ): NexusGraphqlResponse - ACPPolicies(Id: ID): [policypkg_AccessControlPolicy!] FooExample(Id: ID): [config_FooTypeABC!] MyStr0: String @@ -73,9 +72,7 @@ type gns_Gns { Interval: String IsServiceDeployment: Boolean StartVal: Int - ): NexusGraphqlResponse - queryGnsQM1: TimeSeriesData - queryGnsQM( + ): NexusGraphqlResponse queryGnsQM1: TimeSeriesData queryGnsQM( StartTime: String EndTime: String TimeInterval: String @@ -83,7 +80,6 @@ type gns_Gns { SomeUserArg2: Int SomeUserArg3: Boolean ): TimeSeriesData - Domain: String UseSharedGateway: Boolean Description: String @@ -143,6 +139,8 @@ type policypkg_ACPConfig { Id: ID ParentLabels: Map + DestSvcGroups(Id: ID): [servicegroup_SvcGroup!] + SourceSvcGroups(Id: ID): [servicegroup_SvcGroup!] DisplayName: String Gns: String Description: String @@ -160,9 +158,7 @@ type policypkg_VMpolicy { Interval: String IsServiceDeployment: Boolean StartVal: Int - ): NexusGraphqlResponse - queryGnsQM1: TimeSeriesData - queryGnsQM( + ): NexusGraphqlResponse queryGnsQM1: TimeSeriesData queryGnsQM( StartTime: String EndTime: String TimeInterval: String @@ -170,7 +166,6 @@ type policypkg_VMpolicy { SomeUserArg2: Int SomeUserArg3: Boolean ): TimeSeriesData - } type NexusGraphqlResponse { @@ -188,3 +183,8 @@ type TimeSeriesData { Last: String TotalRecords: Int } + +directive @jsonencoded(file: String, gofile: String, name: String) on FIELD_DEFINITION +directive @relation(name: String, parameters: String, softlink: String, uuidkey: String) on FIELD_DEFINITION +directive @timeseriesAPI(file: String!, handler: String!) on FIELD_DEFINITION +directive @protobuf(file: String!, name: String!) on FIELD_DEFINITION diff --git a/compiler/example/output/_rendered_templates/tsm-nexus-gql/graph/schema.graphqls b/compiler/example/output/_rendered_templates/tsm-nexus-gql/graph/schema.graphqls new file mode 100644 index 000000000..e71b0f737 --- /dev/null +++ b/compiler/example/output/_rendered_templates/tsm-nexus-gql/graph/schema.graphqls @@ -0,0 +1,167 @@ + + +type root_Root { + id: ID + config: config_Config @jsonencoded(gofile:"model.go" name:"Config") +} + +type config_Config { + id: ID + QueryExample( + StartTime: String + EndTime: String + Interval: String + IsServiceDeployment: Boolean + StartVal: Int + ): NexusGraphqlResponse + gNS: gns_Gns @jsonencoded(gofile:"model.go" name:"Gns") + dNS: gns_Dns @jsonencoded(gofile:"model.go" name:"Dns") + vMPPolicies: policypkg_VMpolicy @jsonencoded(gofile:"model.go" name:"VMpolicy") + aCPPolicies(id: ID): [policypkg_AccessControlPolicy!] @jsonencoded(gofile:"model.go" name:"AccessControlPolicy") + domain: config_Domain @jsonencoded(gofile:"model.go" name:"Domain") + fooExample(id: ID): [config_FooTypeABC!] @jsonencoded(gofile:"model.go" name:"FooTypeABC") + svcGrpInfo: servicegroup_SvcGroupLinkInfo @jsonencoded(gofile:"model.go" name:"SvcGroupLinkInfo") + myStr0: String + myStr2: String + xYZPort: String @jsonencoded(gofile:"model.go" name:"Port") + clusterNamespaces: [] + testValMarkers: String @jsonencoded(gofile:"model.go" name:"TestValMarkers") + instance: Float + cuOption: String +} + +type config_FooTypeABC { + id: ID + fooA: String @jsonencoded(gofile:"model.go" name:"AMap") + fooB: String @jsonencoded(gofile:"model.go" name:"BArray") + fooD: String @jsonencoded(gofile:"model.go" name:"DFloat") + fooF: String @jsonencoded(gofile:"model.go" name:"DFloat") +} + +type config_Domain { + id: ID + pointPort: String + pointString: String + pointInt: Int + pointMap: String + pointSlice: String + sliceOfPoints: [String] + sliceOfArrPoints: [] + mapOfArrsPoints: String + pointStruct: String +} + +type gns_RandomGnsData { + id: ID + description: String @jsonencoded(gofile:"model.go" name:"RandomDescription") +} + +type gns_Gns { + id: ID + queryGns1( + StartTime: String + EndTime: String + Interval: String + IsServiceDeployment: Boolean + StartVal: Int + ): NexusGraphqlResponse + queryGnsQM1: TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryGnsQM1") + queryGnsQM( + StartTime: String + EndTime: String + TimeInterval: String + SomeUserArg1: String + SomeUserArg2: Int + SomeUserArg3: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryGnsQM") + gnsAccessControlPolicy: String @jsonencoded(gofile:"model.go" name:"AccessControlPolicy") + fooChild: String @jsonencoded(gofile:"model.go" name:"BarChild") + domain: String + useSharedGateway: Boolean + description: String @jsonencoded(gofile:"model.go" name:"Description") + meta: String + port: Int + otherDescription: String + mapPointer: String + slicePointer: String + workloadSpec: String @jsonencoded(gofile:"model.go" name:"WorkloadSpec") + differentSpec: String + serviceSegmentRef: String @jsonencoded(gofile:"model.go" name:"ServiceSegmentRef") + serviceSegmentRefPointer: String + serviceSegmentRefs: [] + serviceSegmentRefMap: String +} + +type gns_BarChild { + id: ID + name: String +} + +type gns_IgnoreChild { + id: ID + name: String +} + +type gns_Dns { + id: ID +} + +type gns_AdditionalGnsData { + id: ID + description: String @jsonencoded(gofile:"model.go" name:"AdditionalDescription") +} + +type servicegroup_SvcGroupLinkInfo { + id: ID + clusterName: String + domainName: String + serviceName: String + serviceType: String +} + +type policypkg_AdditionalPolicyData { + id: ID + description: String @jsonencoded(gofile:"model.go" name:"AdditionalDescription") +} + +type policypkg_AccessControlPolicy { + id: ID + policyConfigs(id: ID): [policypkg_ACPConfig!] @jsonencoded(gofile:"model.go" name:"ACPConfig") +} + +type policypkg_ACPConfig { + id: ID + destSvcGroups(id: ID): [servicegroup_SvcGroup!] @jsonencoded(gofile:"model.go" name:"SvcGroup") + sourceSvcGroups(id: ID): [servicegroup_SvcGroup!] @jsonencoded(gofile:"model.go" name:"SvcGroup") + displayName: String + gns: String + description: String + tags: [String] + projectId: String + conditions: [String] +} + +type policypkg_VMpolicy { + id: ID + queryGns1( + StartTime: String + EndTime: String + Interval: String + IsServiceDeployment: Boolean + StartVal: Int + ): NexusGraphqlResponse + queryGnsQM1: TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryGnsQM1") + queryGnsQM( + StartTime: String + EndTime: String + TimeInterval: String + SomeUserArg1: String + SomeUserArg2: Int + SomeUserArg3: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryGnsQM") +} + +type policypkg_RandomPolicyData { + id: ID + description: String @jsonencoded(gofile:"model.go" name:"RandomDescription") +} diff --git a/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/register.go b/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/register.go deleted file mode 100644 index 708da5dc0..000000000 --- a/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/register.go +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -package config_tsm_tanzu_vmware_com - -const ( - GroupName = "config.tsm.tanzu.vmware.com" -) diff --git a/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1/doc.go b/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1/doc.go deleted file mode 100644 index cde9b4d79..000000000 --- a/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -// +k8s:deepcopy-gen=package -// +groupName=config.tsm.tanzu.vmware.com -// +groupGoName=ConfigTsm - -package v1 diff --git a/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1/register.go b/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1/register.go deleted file mode 100644 index 618b72a0c..000000000 --- a/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1/register.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -package v1 - -import ( - config_tsm_tanzu_vmware_com "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -const ResourceVersion = "v1" - -// GroupVersion is the identifier for the API which includes -// the name of the group and the version of the API -var SchemeGroupVersion = schema.GroupVersion{ - Group: config_tsm_tanzu_vmware_com.GroupName, - Version: ResourceVersion, -} - -// Kind takes an unqualified kind and returns back a Group qualified GroupKind -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -// addKnownTypes adds our types to the API scheme by registering -// MyResource and MyResourceList -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes( - SchemeGroupVersion, - &Config{}, - &ConfigList{}, - &FooTypeABC{}, - &FooTypeABCList{}, - &Domain{}, - &DomainList{}, - ) - - // register the type in the scheme - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1/types.go b/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1/types.go deleted file mode 100644 index 48f7f832a..000000000 --- a/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1/types.go +++ /dev/null @@ -1,235 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -package v1 - -import ( - gnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/common" -) - -// +k8s:openapi-gen=true -type Child struct { - Group string `json:"group" yaml:"group"` - Kind string `json:"kind" yaml:"kind"` - Name string `json:"name" yaml:"name"` -} - -// +k8s:openapi-gen=true -type Link struct { - Group string `json:"group" yaml:"group"` - Kind string `json:"kind" yaml:"kind"` - Name string `json:"name" yaml:"name"` -} - -// +k8s:openapi-gen=true -type NexusStatus struct { - SourceGeneration int64 `json:"sourceGeneration" yaml:"sourceGeneration"` - RemoteGeneration int64 `json:"remoteGeneration" yaml:"remoteGeneration"` -} - -/* ------------------- CRDs definitions ------------------- */ - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type Config struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - Spec ConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` - Status ConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type ConfigNexusStatus struct { - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *Config) CRDName() string { - return "configs.config.tsm.tanzu.vmware.com" -} - -func (c *Config) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:openapi-gen=true -type ConfigSpec struct { - MyStr0 *gnstsmtanzuvmwarecomv1.MyStr `json:"myStr0" yaml:"myStr0"` - MyStr1 []gnstsmtanzuvmwarecomv1.MyStr `json:"myStr1" yaml:"myStr1"` - MyStr2 map[string]gnstsmtanzuvmwarecomv1.MyStr `json:"myStr2" yaml:"myStr2"` - XYZPort gnstsmtanzuvmwarecomv1.Port `json:"xYZPort" yaml:"xYZPort"` - ABCHost []gnstsmtanzuvmwarecomv1.Host `json:"aBCHost" yaml:"aBCHost"` - ClusterNamespaces []ClusterNamespace `json:"clusterNamespaces" yaml:"clusterNamespaces"` - TestValMarkers TestValMarkers `json:"testValMarkers" yaml:"testValMarkers"` - Instance float32 `json:"instance" yaml:"instance"` - CuOption string `json:"option_cu"` - GNSGvk *Child `json:"gNSGvk,omitempty" yaml:"gNSGvk,omitempty" nexus:"child"` - DNSGvk *Child `json:"dNSGvk,omitempty" yaml:"dNSGvk,omitempty" nexus:"child"` - VMPPoliciesGvk *Child `json:"vMPPoliciesGvk,omitempty" yaml:"vMPPoliciesGvk,omitempty" nexus:"child"` - DomainGvk *Child `json:"domainGvk,omitempty" yaml:"domainGvk,omitempty" nexus:"child"` - FooExampleGvk map[string]Child `json:"fooExampleGvk,omitempty" yaml:"fooExampleGvk,omitempty" nexus:"children"` - SvcGrpInfoGvk *Child `json:"svcGrpInfoGvk,omitempty" yaml:"svcGrpInfoGvk,omitempty" nexus:"child"` - ACPPoliciesGvk map[string]Link `json:"aCPPoliciesGvk,omitempty" yaml:"aCPPoliciesGvk,omitempty" nexus:"links"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type ConfigList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []Config `json:"items" yaml:"items"` -} - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type FooTypeABC struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - Spec FooTypeABCSpec `json:"spec,omitempty" yaml:"spec,omitempty"` - Status FooTypeABCNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type FooTypeABCNexusStatus struct { - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *FooTypeABC) CRDName() string { - return "footypeabcs.config.tsm.tanzu.vmware.com" -} - -func (c *FooTypeABC) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:openapi-gen=true -type FooTypeABCSpec struct { - FooA AMap `json:"fooA" yaml:"fooA"` - FooB BArray `json:"fooB" yaml:"fooB"` - FooC CInt `nexus-graphql:"ignore:true"` - FooD DFloat `nexus-graphql:"type:string"` - FooE CInt `json:"foo_e" nexus-graphql:"ignore:true"` - FooF DFloat `json:"foo_f" yaml:"c_int" nexus-graphql:"type:string"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type FooTypeABCList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []FooTypeABC `json:"items" yaml:"items"` -} - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type Domain struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - Spec DomainSpec `json:"spec,omitempty" yaml:"spec,omitempty"` - Status DomainNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type DomainNexusStatus struct { - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *Domain) CRDName() string { - return "domains.config.tsm.tanzu.vmware.com" -} - -func (c *Domain) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:openapi-gen=true -type DomainSpec struct { - PointPort *gnstsmtanzuvmwarecomv1.Port `json:"pointPort" yaml:"pointPort"` - PointString *string `json:"pointString" yaml:"pointString"` - PointInt *int `json:"pointInt" yaml:"pointInt"` - PointMap *map[string]string `json:"pointMap" yaml:"pointMap"` - PointSlice *[]string `json:"pointSlice" yaml:"pointSlice"` - SliceOfPoints []*string `json:"sliceOfPoints" yaml:"sliceOfPoints"` - SliceOfArrPoints []*BArray `json:"sliceOfArrPoints" yaml:"sliceOfArrPoints"` - MapOfArrsPoints map[string]*BArray `json:"mapOfArrsPoints" yaml:"mapOfArrsPoints"` - PointStruct *Cluster `json:"pointStruct" yaml:"pointStruct"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type DomainList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []Domain `json:"items" yaml:"items"` -} - -// +k8s:openapi-gen=true -type ClusterNamespace struct { - Cluster MatchCondition `json:"cluster" yaml:"cluster"` - Namespace MatchCondition `json:"namespace" yaml:"namespace"` -} - -// +k8s:openapi-gen=true -type MatchCondition struct { - Name string `json:"name" yaml:"name"` - Type gnstsmtanzuvmwarecomv1.Host `json:"type" yaml:"type"` -} - -// +k8s:openapi-gen=true -type Cluster struct { - Name string `json:"name" yaml:"name"` - MyID int `json:"myID" yaml:"myID"` -} - -// +k8s:openapi-gen=true -type CrossPackageTester struct { - Test gnstsmtanzuvmwarecomv1.MyStr `json:"test" yaml:"test"` -} - -// +k8s:openapi-gen=true -type EmptyStructTest struct { -} - -// +k8s:openapi-gen=true -type TestValMarkers struct { - //nexus-validation: MaxLength=8, MinLength=2, Pattern=ab - MyStr string `json:"myStr" yaml:"myStr"` - //nexus-validation: Maximum=8, Minimum=2 - //nexus-validation: ExclusiveMaximum=true - MyInt int `json:"myInt" yaml:"myInt"` - //nexus-validation: MaxItems=3, MinItems=2 - //nexus-validation: UniqueItems=true - MySlice []string `json:"mySlice" yaml:"mySlice"` -} - -// +k8s:openapi-gen=true -type SomeStruct struct { -} - -// +k8s:openapi-gen=true -type StructWithEmbeddedField struct { - SomeStruct - gnstsmtanzuvmwarecomv1.MyStr -} - -type AMap map[string]string -type BArray []string -type CInt uint8 -type DFloat float32 diff --git a/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go b/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go deleted file mode 100644 index 3c9297dd9..000000000 --- a/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,700 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -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 deepcopy-gen. DO NOT EDIT. - -package v1 - -import ( - gnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in AMap) DeepCopyInto(out *AMap) { - { - in := &in - *out = make(AMap, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - return - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AMap. -func (in AMap) DeepCopy() AMap { - if in == nil { - return nil - } - out := new(AMap) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in BArray) DeepCopyInto(out *BArray) { - { - in := &in - *out = make(BArray, len(*in)) - copy(*out, *in) - return - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BArray. -func (in BArray) DeepCopy() BArray { - if in == nil { - return nil - } - out := new(BArray) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Child) DeepCopyInto(out *Child) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Child. -func (in *Child) DeepCopy() *Child { - if in == nil { - return nil - } - out := new(Child) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Cluster) DeepCopyInto(out *Cluster) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. -func (in *Cluster) DeepCopy() *Cluster { - if in == nil { - return nil - } - out := new(Cluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterNamespace) DeepCopyInto(out *ClusterNamespace) { - *out = *in - out.Cluster = in.Cluster - out.Namespace = in.Namespace - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterNamespace. -func (in *ClusterNamespace) DeepCopy() *ClusterNamespace { - if in == nil { - return nil - } - out := new(ClusterNamespace) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Config) DeepCopyInto(out *Config) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config. -func (in *Config) DeepCopy() *Config { - if in == nil { - return nil - } - out := new(Config) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Config) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigList) DeepCopyInto(out *ConfigList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Config, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigList. -func (in *ConfigList) DeepCopy() *ConfigList { - if in == nil { - return nil - } - out := new(ConfigList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ConfigList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigNexusStatus) DeepCopyInto(out *ConfigNexusStatus) { - *out = *in - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigNexusStatus. -func (in *ConfigNexusStatus) DeepCopy() *ConfigNexusStatus { - if in == nil { - return nil - } - out := new(ConfigNexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigSpec) DeepCopyInto(out *ConfigSpec) { - *out = *in - if in.MyStr0 != nil { - in, out := &in.MyStr0, &out.MyStr0 - *out = new(gnstsmtanzuvmwarecomv1.MyStr) - **out = **in - } - if in.MyStr1 != nil { - in, out := &in.MyStr1, &out.MyStr1 - *out = make([]gnstsmtanzuvmwarecomv1.MyStr, len(*in)) - copy(*out, *in) - } - if in.MyStr2 != nil { - in, out := &in.MyStr2, &out.MyStr2 - *out = make(map[string]gnstsmtanzuvmwarecomv1.MyStr, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ABCHost != nil { - in, out := &in.ABCHost, &out.ABCHost - *out = make([]gnstsmtanzuvmwarecomv1.Host, len(*in)) - copy(*out, *in) - } - if in.ClusterNamespaces != nil { - in, out := &in.ClusterNamespaces, &out.ClusterNamespaces - *out = make([]ClusterNamespace, len(*in)) - copy(*out, *in) - } - in.TestValMarkers.DeepCopyInto(&out.TestValMarkers) - if in.GNSGvk != nil { - in, out := &in.GNSGvk, &out.GNSGvk - *out = new(Child) - **out = **in - } - if in.DNSGvk != nil { - in, out := &in.DNSGvk, &out.DNSGvk - *out = new(Child) - **out = **in - } - if in.VMPPoliciesGvk != nil { - in, out := &in.VMPPoliciesGvk, &out.VMPPoliciesGvk - *out = new(Child) - **out = **in - } - if in.DomainGvk != nil { - in, out := &in.DomainGvk, &out.DomainGvk - *out = new(Child) - **out = **in - } - if in.FooExampleGvk != nil { - in, out := &in.FooExampleGvk, &out.FooExampleGvk - *out = make(map[string]Child, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.SvcGrpInfoGvk != nil { - in, out := &in.SvcGrpInfoGvk, &out.SvcGrpInfoGvk - *out = new(Child) - **out = **in - } - if in.ACPPoliciesGvk != nil { - in, out := &in.ACPPoliciesGvk, &out.ACPPoliciesGvk - *out = make(map[string]Link, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigSpec. -func (in *ConfigSpec) DeepCopy() *ConfigSpec { - if in == nil { - return nil - } - out := new(ConfigSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CrossPackageTester) DeepCopyInto(out *CrossPackageTester) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossPackageTester. -func (in *CrossPackageTester) DeepCopy() *CrossPackageTester { - if in == nil { - return nil - } - out := new(CrossPackageTester) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Domain) DeepCopyInto(out *Domain) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Domain. -func (in *Domain) DeepCopy() *Domain { - if in == nil { - return nil - } - out := new(Domain) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Domain) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DomainList) DeepCopyInto(out *DomainList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Domain, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainList. -func (in *DomainList) DeepCopy() *DomainList { - if in == nil { - return nil - } - out := new(DomainList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DomainList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DomainNexusStatus) DeepCopyInto(out *DomainNexusStatus) { - *out = *in - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainNexusStatus. -func (in *DomainNexusStatus) DeepCopy() *DomainNexusStatus { - if in == nil { - return nil - } - out := new(DomainNexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DomainSpec) DeepCopyInto(out *DomainSpec) { - *out = *in - if in.PointPort != nil { - in, out := &in.PointPort, &out.PointPort - *out = new(gnstsmtanzuvmwarecomv1.Port) - **out = **in - } - if in.PointString != nil { - in, out := &in.PointString, &out.PointString - *out = new(string) - **out = **in - } - if in.PointInt != nil { - in, out := &in.PointInt, &out.PointInt - *out = new(int) - **out = **in - } - if in.PointMap != nil { - in, out := &in.PointMap, &out.PointMap - *out = new(map[string]string) - if **in != nil { - in, out := *in, *out - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - } - if in.PointSlice != nil { - in, out := &in.PointSlice, &out.PointSlice - *out = new([]string) - if **in != nil { - in, out := *in, *out - *out = make([]string, len(*in)) - copy(*out, *in) - } - } - if in.SliceOfPoints != nil { - in, out := &in.SliceOfPoints, &out.SliceOfPoints - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.SliceOfArrPoints != nil { - in, out := &in.SliceOfArrPoints, &out.SliceOfArrPoints - *out = make([]*BArray, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(BArray) - if **in != nil { - in, out := *in, *out - *out = make([]string, len(*in)) - copy(*out, *in) - } - } - } - } - if in.MapOfArrsPoints != nil { - in, out := &in.MapOfArrsPoints, &out.MapOfArrsPoints - *out = make(map[string]*BArray, len(*in)) - for key, val := range *in { - var outVal *BArray - if val == nil { - (*out)[key] = nil - } else { - in, out := &val, &outVal - *out = new(BArray) - if **in != nil { - in, out := *in, *out - *out = make([]string, len(*in)) - copy(*out, *in) - } - } - (*out)[key] = outVal - } - } - if in.PointStruct != nil { - in, out := &in.PointStruct, &out.PointStruct - *out = new(Cluster) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainSpec. -func (in *DomainSpec) DeepCopy() *DomainSpec { - if in == nil { - return nil - } - out := new(DomainSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EmptyStructTest) DeepCopyInto(out *EmptyStructTest) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmptyStructTest. -func (in *EmptyStructTest) DeepCopy() *EmptyStructTest { - if in == nil { - return nil - } - out := new(EmptyStructTest) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FooTypeABC) DeepCopyInto(out *FooTypeABC) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FooTypeABC. -func (in *FooTypeABC) DeepCopy() *FooTypeABC { - if in == nil { - return nil - } - out := new(FooTypeABC) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *FooTypeABC) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FooTypeABCList) DeepCopyInto(out *FooTypeABCList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]FooTypeABC, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FooTypeABCList. -func (in *FooTypeABCList) DeepCopy() *FooTypeABCList { - if in == nil { - return nil - } - out := new(FooTypeABCList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *FooTypeABCList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FooTypeABCNexusStatus) DeepCopyInto(out *FooTypeABCNexusStatus) { - *out = *in - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FooTypeABCNexusStatus. -func (in *FooTypeABCNexusStatus) DeepCopy() *FooTypeABCNexusStatus { - if in == nil { - return nil - } - out := new(FooTypeABCNexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FooTypeABCSpec) DeepCopyInto(out *FooTypeABCSpec) { - *out = *in - if in.FooA != nil { - in, out := &in.FooA, &out.FooA - *out = make(AMap, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.FooB != nil { - in, out := &in.FooB, &out.FooB - *out = make(BArray, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FooTypeABCSpec. -func (in *FooTypeABCSpec) DeepCopy() *FooTypeABCSpec { - if in == nil { - return nil - } - out := new(FooTypeABCSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Link) DeepCopyInto(out *Link) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Link. -func (in *Link) DeepCopy() *Link { - if in == nil { - return nil - } - out := new(Link) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MatchCondition) DeepCopyInto(out *MatchCondition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MatchCondition. -func (in *MatchCondition) DeepCopy() *MatchCondition { - if in == nil { - return nil - } - out := new(MatchCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NexusStatus) DeepCopyInto(out *NexusStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NexusStatus. -func (in *NexusStatus) DeepCopy() *NexusStatus { - if in == nil { - return nil - } - out := new(NexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SomeStruct) DeepCopyInto(out *SomeStruct) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SomeStruct. -func (in *SomeStruct) DeepCopy() *SomeStruct { - if in == nil { - return nil - } - out := new(SomeStruct) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StructWithEmbeddedField) DeepCopyInto(out *StructWithEmbeddedField) { - *out = *in - out.SomeStruct = in.SomeStruct - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StructWithEmbeddedField. -func (in *StructWithEmbeddedField) DeepCopy() *StructWithEmbeddedField { - if in == nil { - return nil - } - out := new(StructWithEmbeddedField) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TestValMarkers) DeepCopyInto(out *TestValMarkers) { - *out = *in - if in.MySlice != nil { - in, out := &in.MySlice, &out.MySlice - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestValMarkers. -func (in *TestValMarkers) DeepCopy() *TestValMarkers { - if in == nil { - return nil - } - out := new(TestValMarkers) - in.DeepCopyInto(out) - return out -} diff --git a/compiler/example/output/generated/apis/custom.tsm.tanzu.vmware.com/register.go b/compiler/example/output/generated/apis/custom.tsm.tanzu.vmware.com/register.go new file mode 100644 index 000000000..eff4289b2 --- /dev/null +++ b/compiler/example/output/generated/apis/custom.tsm.tanzu.vmware.com/register.go @@ -0,0 +1,7 @@ +// Code generated by nexus. DO NOT EDIT. + +package custom_tsm_tanzu_vmware_com + +const ( + GroupName = "custom.tsm.tanzu.vmware.com" +) diff --git a/compiler/example/output/generated/apis/custom.tsm.tanzu.vmware.com/v1/doc.go b/compiler/example/output/generated/apis/custom.tsm.tanzu.vmware.com/v1/doc.go new file mode 100644 index 000000000..d03984298 --- /dev/null +++ b/compiler/example/output/generated/apis/custom.tsm.tanzu.vmware.com/v1/doc.go @@ -0,0 +1,7 @@ +// Code generated by nexus. DO NOT EDIT. + +// +k8s:deepcopy-gen=package +// +groupName=custom.tsm.tanzu.vmware.com +// +groupGoName=CustomTsm + +package v1 diff --git a/compiler/example/output/generated/apis/custom.tsm.tanzu.vmware.com/v1/register.go b/compiler/example/output/generated/apis/custom.tsm.tanzu.vmware.com/v1/register.go new file mode 100644 index 000000000..0e1ef0b3c --- /dev/null +++ b/compiler/example/output/generated/apis/custom.tsm.tanzu.vmware.com/v1/register.go @@ -0,0 +1,45 @@ +// Code generated by nexus. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + custom_tsm_tanzu_vmware_com "nexustempmodule/apis/custom.tsm.tanzu.vmware.com" +) + +const ResourceVersion = "v1" + +// GroupVersion is the identifier for the API which includes +// the name of the group and the version of the API +var SchemeGroupVersion = schema.GroupVersion{ + Group: custom_tsm_tanzu_vmware_com.GroupName, + Version: ResourceVersion, +} + +// Kind takes an unqualified kind and returns back a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +// addKnownTypes adds our types to the API scheme by registering +// MyResource and MyResourceList +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes( + SchemeGroupVersion, + ) + + // register the type in the scheme + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/compiler/example/output/generated/apis/custom.tsm.tanzu.vmware.com/v1/types.go b/compiler/example/output/generated/apis/custom.tsm.tanzu.vmware.com/v1/types.go new file mode 100644 index 000000000..032f19779 --- /dev/null +++ b/compiler/example/output/generated/apis/custom.tsm.tanzu.vmware.com/v1/types.go @@ -0,0 +1,1421 @@ +// Code generated by nexus. DO NOT EDIT. + +package v1 + +import ( + istioauth "istio.io/api/authentication/v1alpha1" + "istio.io/api/networking/v1alpha3" + istio "istio.io/api/networking/v1alpha3" + k8sappsv1 "k8s.io/api/apps/v1" + k8sbatchv1 "k8s.io/api/batch/v1" + k8sbatchv1beta1 "k8s.io/api/batch/v1beta1" + k8scorev1 "k8s.io/api/core/v1" + k8sapimachineryv1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/intstr" +) + +// +k8s:openapi-gen=true +type Child struct { + Group string `json:"group" yaml:"group"` + Kind string `json:"kind" yaml:"kind"` + Name string `json:"name" yaml:"name"` +} + +// +k8s:openapi-gen=true +type Link struct { + Group string `json:"group" yaml:"group"` + Kind string `json:"kind" yaml:"kind"` + Name string `json:"name" yaml:"name"` +} + +// +k8s:openapi-gen=true +type NexusStatus struct { + SourceGeneration int64 `json:"sourceGeneration" yaml:"sourceGeneration"` + RemoteGeneration int64 `json:"remoteGeneration" yaml:"remoteGeneration"` +} + +/* ------------------- CRDs definitions ------------------- */ + +// +k8s:openapi-gen=true +type CertificateConfig struct { + Name string `json:"name" mapstructure:"name" yaml:"name"` + Description string `json:"description" mapstructure:"description" yaml:"description"` + CertificateType string `json:"certificateType" mapstructure:"certificateType" yaml:"certificateType"` + ManagedCertificate ManagedCertificateConfig `json:"managedCertificate,omitempty" mapstructure:"managedCertificate" yaml:"managedCertificate"` + UnManagedCertificate UnManagedCertificateConfig `json:"unManagedCertificate,omitempty" mapstructure:"unManagedCertificate" yaml:"unManagedCertificate"` +} + +// +k8s:openapi-gen=true +type CertificateDetails struct { + Id string `json:"id,omitempty" yaml:"id"` + CertificateType string `json:"certificateType" yaml:"certificateType"` + SignedCertificate string `json:"signed_certificate,omitempty" yaml:"signedCertificate"` + IssuedToCn string `json:"issued_to_cn,omitempty" yaml:"issuedToCn"` + IssuedToO string `json:"issued_to_o,omitempty" yaml:"issuedToO"` + IssuedToOu string `json:"issued_to_ou,omitempty" yaml:"issuedToOu"` + IssuedToSerialNumber string `json:"issued_to_serial_number,omitempty" yaml:"issuedToSerialNumber"` + IssuedByCn string `json:"issued_by_cn,omitempty" yaml:"issuedByCn"` + IssuedByO string `json:"issued_by_o,omitempty" yaml:"issuedByO"` + IssuedByOu string `json:"issued_by_ou,omitempty" yaml:"issuedByOu"` + BeginsOn string `json:"begins_on,omitempty" yaml:"beginsOn"` + ExpiresOn string `json:"expires_on,omitempty" yaml:"expiresOn"` + Sha256Fingerprint string `json:"sha_256_fingerprint,omitempty" yaml:"sha256Fingerprint"` + Sha1Fingerprint string `json:"sha_1_fingerprint,omitempty" yaml:"sha1Fingerprint"` +} + +// +k8s:openapi-gen=true +type CertificateStatus struct { + State string `json:"state" yaml:"state"` + Message string `json:"message,omitempty" yaml:"message"` +} + +// +k8s:openapi-gen=true +type ManagedCertificateConfig struct { + CountryName string `json:"country_name,omitempty" yaml:"countryName"` + StateName string `json:"state_name,omitempty" yaml:"stateName"` + CityName string `json:"city_name,omitempty" yaml:"cityName"` + OrganizationName string `json:"organization_name,omitempty" yaml:"organizationName"` + OrganizationalUnit string `json:"organizational_unit,omitempty" yaml:"organizationalUnit"` + CommonName string `json:"common_name,omitempty" yaml:"commonName"` + EmailAddress string `json:"email_address,omitempty" yaml:"emailAddress"` + CompanyName string `json:"company_name,omitempty" yaml:"companyName"` + AutoGeneratedSingleDomain bool `json:"auto_generated_single_domain,omitempty" yaml:"autoGeneratedSingleDomain"` + SelfSign bool `json:"self_sign,omitempty" yaml:"selfSign"` + ExternalCaPluginConfigPlaceholder string `json:"external_ca_plugin_config_placeholder,omitempty" yaml:"externalCaPluginConfigPlaceholder"` +} + +// +k8s:openapi-gen=true +type UnManagedCertificateConfig struct { + PrivateKey string `json:"private_key,omitempty" mapstructure:"private_key" yaml:"privateKey"` + SignedCertificate string `json:"signed_certificate,omitempty" mapstructure:"signed_certificate" yaml:"signedCertificate"` + CertChain string `json:"cert_chain,omitempty" mapstructure:"cert_chain" yaml:"certChain"` +} + +// +k8s:openapi-gen=true +type CaLabel struct { + Key string `json:"key" mapstructure:"key" yaml:"key"` + Value string `json:"value" mapstructure:"value" yaml:"value"` +} + +// +k8s:openapi-gen=true +type Status struct { + State State `json:"state" mapstructure:"state" yaml:"state"` +} + +// +k8s:openapi-gen=true +type VenafiConfig struct { + Zone string `json:"zone,omitempty" mapstructure:"zone" yaml:"zone"` +} + +// +k8s:openapi-gen=true +type CertificateAuthorityConfig struct { + Name string `json:"name" mapstructure:"name" yaml:"name"` + Description string `json:"description,omitempty" mapstructure:"description" yaml:"description"` + AccoundId string `json:"accountId" mapstructure:"accountId" yaml:"accoundId"` + Labels []CaLabel `json:"labels" mapstructure:"labels" yaml:"labels"` + Venafi VenafiConfig `json:"venafi" mapstructure:"venafi" yaml:"venafi"` +} + +// +k8s:openapi-gen=true +type CertificateAuthorityConfigWithId struct { + Name string `json:"name" mapstructure:"name" yaml:"name"` + Description string `json:"description,omitempty" mapstructure:"description" yaml:"description"` + AccoundId string `json:"account_id" mapstructure:"account_id" yaml:"accoundId"` + Labels []CaLabel `json:"labels" mapstructure:"labels" yaml:"labels"` + Venafi VenafiConfig `json:"venafi" mapstructure:"venafi" yaml:"venafi"` + Id string `json:"id,omitempty" mapstructure:"id" yaml:"id"` +} + +// +k8s:openapi-gen=true +type StatusCondition struct { + Status string `json:"status" mapstructure:"status" yaml:"status"` + Reason string `json:"reason" mapstructure:"reason" yaml:"reason"` + Message string `json:"message" mapstructure:"message" yaml:"message"` +} + +// +k8s:openapi-gen=true +type CertStatus struct { + conditions StatusConditions `json:"conditions" mapstructure:"conditions" yaml:"conditions"` + notBefore string `json:"notBefore" mapstructure:"notBefore" yaml:"notBefore"` + notAfter string `json:"notAfter" mapstructure:"notAfter" yaml:"notAfter"` + renewalTime string `json:"renewalTime" mapstructure:"renewalTime" yaml:"renewalTime"` +} + +// +k8s:openapi-gen=true +type IssuerStatus struct { + conditions StatusConditions `json:"conditions" mapstructure:"conditions" yaml:"conditions"` +} + +// +k8s:openapi-gen=true +type CertRequestStatus struct { + conditions StatusConditions `json:"conditions" mapstructure:"conditions" yaml:"conditions"` + ca string `json:"ca" mapstructure:"ca" yaml:"ca"` + certificate string `json:"certificate" mapstructure:"certificate" yaml:"certificate"` +} + +// +k8s:openapi-gen=true +type ClusterSyncStatus struct { + State ClusterSyncState `json:"state" mapstructure:"state" yaml:"state"` +} + +// +k8s:openapi-gen=true +type CaSyncStatus struct { + State CaSyncState `json:"state" mapstructure:"state" yaml:"state"` + Message string `json:"message" mapstructure:"message" yaml:"message"` +} + +// +k8s:openapi-gen=true +type ClusterStatusMetadata struct { + Substate string `json:"substate" mapstructure:"substate" yaml:"substate"` + Progress int32 `json:"progress" mapstructure:"progress" yaml:"progress"` +} + +// +k8s:openapi-gen=true +type ClusterStatus struct { + State ClusterState `json:"state" mapstructure:"state" yaml:"state"` + Metadata ClusterStatusMetadata `json:"metadata" mapstructure:"metadata" yaml:"metadata"` + Code int32 `json:"code" mapstructure:"code" yaml:"code"` + Message string `json:"message" mapstructure:"message" yaml:"message"` + UpdateTimestamp string `json:"updateTimestamp" mapstructure:"updateTimestamp" yaml:"updateTimestamp"` +} + +// +k8s:openapi-gen=true +type CaStatus struct { + Name string `json:"name" mapstructure:"name" yaml:"name"` + State CaState `json:"state" mapstructure:"state" yaml:"state"` + Reason string `json:"reason" mapstructure:"reason" yaml:"reason"` + Message string `json:"message" mapstructure:"message" yaml:"message"` + UpdateTimestamp string `json:"updateTimestamp" mapstructure:"updateTimestamp" yaml:"updateTimestamp"` +} + +// +k8s:openapi-gen=true +type ComponentStatus struct { + Component string `json:"component" mapstructure:"component" yaml:"component"` + State ComponentState `json:"state" mapstructure:"state" yaml:"state"` + Code int32 `json:"code" mapstructure:"code" yaml:"code"` + Message string `json:"message" mapstructure:"message" yaml:"message"` + UpdateTimestamp string `json:"updateTimestamp" mapstructure:"updateTimestamp" yaml:"updateTimestamp"` +} + +// +k8s:openapi-gen=true +type ComponentStatuses struct { + Statuses []ComponentStatus `json:"statuses" mapstructure:"statuses" yaml:"statuses"` +} + +// +k8s:openapi-gen=true +type Application struct { + Version string `json:"version" mapstructure:"version" yaml:"version"` +} + +// +k8s:openapi-gen=true +type ApplicationInstance struct { + Version string `json:"version" mapstructure:"version" yaml:"version"` + PreviousVersion string `json:"previousVersion" mapstructure:"previousVersion" yaml:"previousVersion"` + State ApplicationState `json:"state" mapstructure:"state" yaml:"state"` + UpgradeableVersions []UpgradeableVersion `json:"upgradeableVersions" mapstructure:"upgradeableVersions" yaml:"upgradeableVersions"` +} + +// +k8s:openapi-gen=true +type UpgradeableVersion struct { + Version string `json:"version" mapstructure:"version" yaml:"version"` + State ApplicationState `json:"state" mapstructure:"state" yaml:"state"` +} + +// +k8s:openapi-gen=true +type Version struct { + Version string `json:"version" mapstructure:"version" yaml:"version"` + Installable bool `json:"installable" mapstructure:"installable" yaml:"installable"` + Reason string `json:"reason" mapstructure:"reason" yaml:"reason"` +} + +// +k8s:openapi-gen=true +type ApplicationStatus struct { + Name string `json:"name" mapstructure:"name" yaml:"name"` + Version string `json:"version" mapstructure:"version" yaml:"version"` + Id string `json:"id" mapstructure:"id" yaml:"id"` + State ApplicationState `json:"state" mapstructure:"state" yaml:"state"` + AvailableVersions Versions `json:"availableVersions" mapstructure:"availableVersions" yaml:"availableVersions"` +} + +// +k8s:openapi-gen=true +type ClusterIDs struct { + Ids []string `json:"ids" mapstructure:"ids" yaml:"ids"` +} + +// +k8s:openapi-gen=true +type Token struct { + Token string `json:"token" mapstructure:"token" yaml:"token"` +} + +// +k8s:openapi-gen=true +type LogRequest struct { + Type LogType `json:"type" mapstructure:"type" yaml:"type"` + Namespace string `json:"namespace" mapstructure:"namespace" yaml:"namespace"` +} + +// +k8s:openapi-gen=true +type ProxyConfigRequest struct { + Proxy ProxyType `json:"proxyType" mapstructure:"proxyType" yaml:"proxy"` + Protocol ProxyProtocol `json:"proxyProtocol" mapstructure:"proxyProtocol" yaml:"protocol"` + Host string `json:"host" mapstructure:"host" yaml:"host"` + Port int32 `json:"port" mapstructure:"port" yaml:"port"` + Username string `json:"username" mapstructure:"username" yaml:"username"` + Password string `json:"password" mapstructure:"password" yaml:"password"` + Certificate string `json:"certificate" mapstructure:"certificate" yaml:"certificate"` +} + +// +k8s:openapi-gen=true +type AutoInstallServiceMeshConfig struct { + RestrictDefaultExternalAccess bool `json:"restrictDefaultExternalAccess" mapstructure:"restrictDefaultExternalAccess" yaml:"restrictDefaultExternalAccess"` +} + +// +k8s:openapi-gen=true +type AttributeValue struct { + BoolValue bool `json:"boolValue" mapstructure:"boolValue" yaml:"boolValue"` + NumValue int32 `json:"numValue" mapstructure:"numValue" yaml:"numValue"` + StrValue string `json:"strValue" mapstructure:"strValue" yaml:"strValue"` +} + +// +k8s:openapi-gen=true +type MtlsException struct { + Enabled bool `json:"enabled" mapstructure:"enabled" yaml:"enabled"` + Services []string `json:"services" mapstructure:"services" yaml:"services"` + Service_groups []string `json:"service_groups" mapstructure:"service_groups" yaml:"service_groups"` +} + +// +k8s:openapi-gen=true +type HealthCheckType struct { + Name string `json:"name" mapstructure:"name" yaml:"name"` + Protocol string `json:"protocol" mapstructure:"protocol" yaml:"protocol"` + Port int32 `json:"port" mapstructure:"port" yaml:"port"` + Path string `json:"path" mapstructure:"path" yaml:"path"` + FailureThreshold int32 `json:"failureThreshold" mapstructure:"failureThreshold" yaml:"failureThreshold"` + HealthCheckInterval int32 `json:"healthCheckInterval" mapstructure:"healthCheckInterval" yaml:"healthCheckInterval"` +} + +// +k8s:openapi-gen=true +type ClusterList struct { + Weight int32 `json:"weight" mapstructure:"weight" yaml:"weight"` + Primary bool `json:"primary" mapstructure:"primary" yaml:"primary"` + Country string `json:"country" mapstructure:"country" yaml:"country"` +} + +// +k8s:openapi-gen=true +type Routing struct { + Clusters map[string]ClusterList `json:"clusters" mapstructure:"clusters" yaml:"clusters"` +} + +// +k8s:openapi-gen=true +type RoutingPolicyType struct { + Name string `json:"name" mapstructure:"name" yaml:"name"` + Type string `json:"type" mapstructure:"type" yaml:"type"` + Policy Routing `json:"policy" mapstructure:"policy" yaml:"policy"` +} + +// +k8s:openapi-gen=true +type Condition struct { + Type MatchFunction `json:"type" mapstructure:"type" yaml:"type"` + Match string `json:"match" mapstructure:"match" yaml:"match"` +} + +// +k8s:openapi-gen=true +type GnsServiceGroupSpec struct { + Name string `json:"name,omitempty" mapstructure:"name" yaml:"name"` +} + +// +k8s:openapi-gen=true +type GnsServiceSelector struct { + Services []string `json:"services,omitempty" mapstructure:"services" yaml:"services"` + ServiceGroup []GnsServiceGroupSpec `json:"service_group,omitempty" mapstructure:"service_group" yaml:"serviceGroup"` +} + +// +k8s:openapi-gen=true +type ClusterResourceSelectorRT struct { + Services []string `json:"services,omitempty" mapstructure:"services" yaml:"services"` + ServiceGroup []GnsServiceGroupSpec `json:"service_group,omitempty" mapstructure:"service_group" yaml:"serviceGroup"` +} + +// +k8s:openapi-gen=true +type RoutingRuleConfigHeaderOperations struct { + Set map[string]string `json:"set" mapstructure:"set" yaml:"set"` + Add map[string]string `json:"add" mapstructure:"add" yaml:"add"` + Remove []string `json:"remove" mapstructure:"remove" yaml:"remove"` +} + +// +k8s:openapi-gen=true +type RoutingRuleConfigHeaders struct { + Request RoutingRuleConfigHeaderOperations `json:"request" mapstructure:"request" yaml:"request"` + Response RoutingRuleConfigHeaderOperations `json:"response" mapstructure:"response" yaml:"response"` +} + +// +k8s:openapi-gen=true +type RoutingRuleConfigStringMatch struct { + Exact string `json:"exact" mapstructure:"exact" yaml:"exact"` + Prefix string `json:"prefix" mapstructure:"prefix" yaml:"prefix"` + Regex string `json:"regex" mapstructure:"regex" yaml:"regex"` +} + +// +k8s:openapi-gen=true +type RouteStringMatch struct { + Type StringMatchType `json:"type" mapstructure:"type" yaml:"type"` + Value string `json:"value" mapstructure:"value" yaml:"value"` +} + +// +k8s:openapi-gen=true +type RouteMapMatch struct { + Type StringMatchType `json:"type" mapstructure:"type" yaml:"type"` + Values map[string]string `json:"value" mapstructure:"value" yaml:"values"` +} + +// +k8s:openapi-gen=true +type HTTPRouteMatch struct { + Path RouteStringMatch `json:"path" mapstructure:"path" yaml:"path"` + Headers RouteMapMatch `json:"headers" mapstructure:"headers" yaml:"headers"` + QueryParams RouteMapMatch `json:"queryParams" mapstructure:"queryParams" yaml:"queryParams"` +} + +// +k8s:openapi-gen=true +type TargetRoute struct { + ServiceVersion string `json:"service_version" mapstructure:"service_version" yaml:"serviceVersion"` + Weight int64 `json:"weight" mapstructure:"weight" yaml:"weight"` +} + +// +k8s:openapi-gen=true +type HTTPRoutingRule struct { + Name string `json:"name" mapstructure:"name" yaml:"name"` + Matches []HTTPRouteMatch `json:"matches" mapstructure:"matches" yaml:"matches"` + Targets []TargetRoute `json:"targets" mapstructure:"targets" yaml:"targets"` +} + +// +k8s:openapi-gen=true +type TrafficPolicy struct { + Http []HTTPRoutingRule `json:"http" mapstructure:"http" yaml:"http"` +} + +// +k8s:openapi-gen=true +type TrafficRoutingPolicy struct { + Service string `json:"service" mapstructure:"service" yaml:"service"` + Port int32 `json:"port" mapstructure:"port" yaml:"port"` + TrafficPolicy TrafficPolicy `json:"traffic_policy" mapstructure:"traffic_policy" yaml:"trafficPolicy"` +} + +// +k8s:openapi-gen=true +type ServiceSelector struct { + Service string `json:"service" mapstructure:"service" yaml:"service"` +} + +// +k8s:openapi-gen=true +type Label struct { + Key string `json:"key" mapstructure:"key" yaml:"key"` + Value string `json:"value" mapstructure:"value" yaml:"value"` +} + +// +k8s:openapi-gen=true +type GatewayConfigListener struct { + Name string `json:"name" mapstructure:"name" yaml:"name"` + Port int32 `json:"port" mapstructure:"port" yaml:"port"` + Protocol string `json:"protocol" mapstructure:"protocol" yaml:"protocol"` + Hosts []string `json:"hosts" mapstructure:"hosts" yaml:"hosts"` + RoutingRules []GatewayRoutingRule `json:"routingRules" mapstructure:"routingRules" yaml:"routingRules"` +} + +// +k8s:openapi-gen=true +type GatewayRoutingRuleSNI struct { + SniRoutingRule struct { + Name string + Match string + Replace string + } `json:"sniRoutingRule" mapstructure:"sniRoutingRule" yaml:"sniRoutingRule"` +} + +// +k8s:openapi-gen=true +type MatchCondition struct { + Namespace Condition `json:"namespace" mapstructure:"namespace" yaml:"namespace"` + Cluster Condition `json:"cluster" mapstructure:"cluster" yaml:"cluster"` +} + +// +k8s:openapi-gen=true +type GnsACPPolicyMatch struct { + Port []string `json:"port,omitempty" mapstructure:"port" yaml:"port"` + Hostname []string `json:"hostname,omitempty" mapstructure:"hostname" yaml:"hostname"` + Path []string `json:"path,omitempty" mapstructure:"path" yaml:"path"` + Method []GnsACPMatchMethod `json:"method,omitempty" mapstructure:"method" yaml:"method"` +} + +// +k8s:openapi-gen=true +type GnsACPServiceGroup struct { + ServiceGroup []GnsServiceGroupSpec `json:"service_group,omitempty" mapstructure:"service_group" yaml:"serviceGroup"` +} + +// +k8s:openapi-gen=true +type GnsAccessControlPolicySpec struct { + Destination GnsACPServiceGroup `json:"destination,omitempty" mapstructure:"destination" yaml:"destination"` + Source GnsACPServiceGroup `json:"source,omitempty" mapstructure:"source" yaml:"source"` + Action string `json:"action,omitempty" mapstructure:"action" yaml:"action"` + Match []GnsACPPolicyMatch `json:"match,omitempty" mapstructure:"match" yaml:"match"` +} + +// +k8s:openapi-gen=true +type ConfigDedup struct { + Name string `json:"name,omitempty" mapstructure:"name" yaml:"name"` + SegmentRegex []string `json:"segment_regex,omitempty" mapstructure:"segment_regex" yaml:"segmentRegex"` + PathTemplate []string `json:"path_template,omitempty" mapstructure:"path_template" yaml:"pathTemplate"` + GenerationId string `json:"generation_id,omitempty" mapstructure:"generation_id" yaml:"generationId"` +} + +// +k8s:openapi-gen=true +type APIMimeConfig struct { + IgnoredMime []string `json:"ignored_mime,omitempty" mapstructure:"ignored_mime" yaml:"ignoredMime"` +} + +// +k8s:openapi-gen=true +type APIAsyncWorkerLimits struct { + TotalMemory *int `json:"total_memory,omitempty" mapstructure:"total_memory" yaml:"totalMemory"` + ThroughputLimitingWindow *int `json:"throughput_limiting_window,omitempty" mapstructure:"throughput_limiting_window" yaml:"throughputLimitingWindow"` + TransactionsPerWindow *int `json:"transactions_per_window,omitempty" mapstructure:"transactions_per_window" yaml:"transactionsPerWindow"` + BytesPerWindow *int `json:"bytes_per_window,omitempty" mapstructure:"bytes_per_window" yaml:"bytesPerWindow"` +} + +// +k8s:openapi-gen=true +type APIDiscoveryAppConfig struct { + SchemaFlushIntervals *int `json:"schema_flush_interval_s,omitempty" mapstructure:"schema_flush_interval_s" yaml:"schemaFlushIntervals"` + EnableAsyncReporting *bool `json:"enable_async_reporting,omitempty" mapstructure:"enable_async_reporting" yaml:"enableAsyncReporting"` + GroupBy []string `json:"group_by,omitempty" mapstructure:"group_by" yaml:"groupBy"` + UseDefaultGrouping *bool `json:"use_default_grouping,omitempty" mapstructure:"use_default_grouping" yaml:"useDefaultGrouping"` + BranchingLimit *int `json:"branching_limit,omitempty" mapstructure:"branching_limit" yaml:"branchingLimit"` + SchemaUpdateSendDelayMs *int `json:"schema_update_send_delay_ms,omitempty" mapstructure:"schema_update_send_delay_ms" yaml:"schemaUpdateSendDelayMs"` + APIMimeConfig *APIMimeConfig `json:"mime_config,omitempty" mapstructure:"mime_config" yaml:"aPIMimeConfig"` + WhitelistedResponseCodes []int `json:"whitelisted_response_codes,omitempty" mapstructure:"whitelisted_response_codes" yaml:"whitelistedResponseCodes"` + UseDefaultResponseCodesWhitelist string `json:"use_default_response_codes_whitelist,omitempty" mapstructure:"use_default_response_codes_whitelist" yaml:"useDefaultResponseCodesWhitelist"` + Limits *APIAsyncWorkerLimits `json:"limits,omitempty" mapstructure:"limits" yaml:"limits"` + CacheMemoryLimit *int `json:"cache_memory_limit,omitempty" mapstructure:"cache_memory_limit" yaml:"cacheMemoryLimit"` + Hostnames []ConfigDedup `json:"-" mapstructure:"hostnames" yaml:"hostnames"` + InternalEditTimestamp string `json:"internal_edit_timestamp,omitempty" mapstructure:"internal_edit_timestamp" yaml:"internalEditTimestamp"` + EnableSquashing *bool `json:"enable_squashing,omitempty" mapstructure:"enable_squashing" yaml:"enableSquashing"` +} + +// +k8s:openapi-gen=true +type APIDiscoveryIsEndpointApiPrechecks struct { + ProtocolVersions []string `json:"protocol_versions,omitempty" mapstructure:"protocol_versions" yaml:"protocolVersions"` + Methods []string `json:"methods,omitempty" mapstructure:"methods" yaml:"methods"` + ContentTypes []string `json:"content_types,omitempty" mapstructure:"content_types" yaml:"contentTypes"` + PathExtensions []string `json:"path_extensions,omitempty" mapstructure:"path_extensions" yaml:"pathExtensions"` + MaxRequestBufferSize *uint64 `json:"max_request_buffer_size,omitempty" mapstructure:"max_request_buffer_size" yaml:"maxRequestBufferSize"` + MaxResponseBufferSize *uint64 `json:"max_response_buffer_size,omitempty" mapstructure:"max_response_buffer_size" yaml:"maxResponseBufferSize"` +} + +// +k8s:openapi-gen=true +type APIDiscoveryProcessingToggles struct { + RequestHeaderParameters *bool `json:"request_header_parameters,omitempty" mapstructure:"request_header_parameters" yaml:"requestHeaderParameters"` + ResponseHeaderParameters *bool `json:"response_header_parameters,omitempty" mapstructure:"response_header_parameters" yaml:"responseHeaderParameters"` +} + +// +k8s:openapi-gen=true +type ApiDiscoveryConfig struct { + Selectors GnsServiceSelector `json:"selectors,omitempty" mapstructure:"selectors" yaml:"selectors"` + Application ApiDiscoveryApplicationConfigList `json:"application,omitempty" mapstructure:"application" yaml:"application"` + CompressionEnabled bool `json:"compression_enabled,omitempty" mapstructure:"compression_enabled" yaml:"compressionEnabled"` + IsEndpointApiPrechecks APIDiscoveryIsEndpointApiPrechecks `json:"is_endpoint_api_prechecks,omitempty" mapstructure:"is_endpoint_api_prechecks" yaml:"isEndpointApiPrechecks"` + ProcessingToggles APIDiscoveryProcessingToggles `json:"processing_toggles,omitempty" mapstructure:"processing_toggles" yaml:"processingToggles"` +} + +// +k8s:openapi-gen=true +type QueryParam struct { + CaseSensitive bool `json:"case_sensitive,omitempty" mapstructure:"case_sensitive" yaml:"caseSensitive"` + Path string `json:"path,omitempty" mapstructure:"path" yaml:"path"` + Prefix string `json:"prefix,omitempty" mapstructure:"prefix" yaml:"prefix"` + Regex string `json:"regex,omitempty" mapstructure:"regex" yaml:"regex"` +} + +// +k8s:openapi-gen=true +type QueryParamMatchValue struct { + CaseSensitive bool `json:"case_sensitive,omitempty" mapstructure:"case_sensitive" yaml:"caseSensitive"` + Path string `json:"path,omitempty" mapstructure:"path" yaml:"path"` + Prefix string `json:"prefix,omitempty" mapstructure:"prefix" yaml:"prefix"` + Regex string `json:"regex,omitempty" mapstructure:"regex" yaml:"regex"` +} + +// +k8s:openapi-gen=true +type QueryParamsMatch struct { + MaskValue string `json:"mask_value,omitempty" mapstructure:"mask_value" yaml:"maskValue"` + Param QueryParam `json:"param,omitempty" mapstructure:"param" yaml:"param"` + Value QueryParamMatchValue `json:"value,omitempty" mapstructure:"value" yaml:"value"` +} + +// +k8s:openapi-gen=true +type CacheConfig struct { + QueryParamsMatches []QueryParamsMatch `json:"query_params_matches,omitempty" mapstructure:"query_params_matches" yaml:"queryParamsMatches"` + Size int `json:"size,omitempty" mapstructure:"size" yaml:"size"` +} + +// +k8s:openapi-gen=true +type RuleRange struct { + IdFrom int `json:"id_from,omitempty" mapstructure:"id_from" yaml:"idFrom"` + IdTo int `json:"id_to,omitempty" mapstructure:"id_to" yaml:"idTo"` +} + +// +k8s:openapi-gen=true +type RulesGroup struct { + CustomRules []string `json:"custom_rules,omitempty" mapstructure:"custom_rules" yaml:"customRules"` + Mode string `json:"mode,omitempty" mapstructure:"mode" yaml:"mode"` + Name string `json:"name,omitempty" mapstructure:"name" yaml:"name"` + RulesRanges []*RuleRange `json:"rules_ranges,omitempty" mapstructure:"rules_ranges" yaml:"rulesRanges"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationPolicyPreConditions struct { + AllowedHTTPVersions []string `json:"allowed_http_versions,omitempty" mapstructure:"allowed_http_versions" yaml:"allowedHTTPVersions"` + AllowedHTTPMethods []string `json:"allowed_http_methods,omitempty" mapstructure:"allowed_http_methods" yaml:"allowedHTTPMethods"` + AllowedContentTypes []string `json:"allowed_content_types,omitempty" mapstructure:"allowed_content_types" yaml:"allowedContentTypes"` + ScannedContentTypes []string `json:"scanned_content_types,omitempty" mapstructure:"scanned_content_types" yaml:"scannedContentTypes"` + AllowedHTTPPathFileExtensions []string `json:"allowed_http_path_file_extensions,omitempty" mapstructure:"allowed_http_path_file_extensions" yaml:"allowedHTTPPathFileExtensions"` + ForbiddenHTTPHeaders []string `json:"forbidden_http_headers,omitempty" mapstructure:"forbidden_http_headers" yaml:"forbiddenHTTPHeaders"` + MaxFileUploadSize int64 `json:"max_file_upload_size,omitempty" mapstructure:"max_file_upload_size" yaml:"maxFileUploadSize"` + MaxRequestBufferSize int64 `json:"max_request_buffer_size,omitempty" mapstructure:"max_request_buffer_size" yaml:"maxRequestBufferSize"` + MaxResponsePayloadSize int64 `json:"max_response_payload_size,omitempty" mapstructure:"max_response_payload_size" yaml:"maxResponsePayloadSize"` + MaxResponseBufferSize int64 `json:"max_response_buffer_size,omitempty" mapstructure:"max_response_buffer_size" yaml:"maxResponseBufferSize"` +} + +// +k8s:openapi-gen=true +type ProcessingToggles struct { + RequestHeaders string `json:"request_headers,omitempty" mapstructure:"request_headers" yaml:"requestHeaders"` + RequestBody string `json:"request_body,omitempty" mapstructure:"request_body" yaml:"requestBody"` + ResponseHeaders string `json:"response_headers,omitempty" mapstructure:"response_headers" yaml:"responseHeaders"` + ResponseBody string `json:"response_body,omitempty" mapstructure:"response_body" yaml:"responseBody"` +} + +// +k8s:openapi-gen=true +type AttackDiscoveryAppConfig struct { + AuditLogEnable *bool `json:"audit_log_enable,omitempty" mapstructure:"audit_log_enable" yaml:"auditLogEnable"` + CacheConfig *CacheConfig `json:"cache_config,omitempty" mapstructure:"cache_config" yaml:"cacheConfig"` + CfgFile string `json:"cfg_file,omitempty" mapstructure:"cfg_file" yaml:"cfgFile"` + CfgPlain string `json:"cfg_plain,omitempty" mapstructure:"cfg_plain" yaml:"cfgPlain"` + MaxMatchedDataSize *int `json:"max_matched_data_size,omitempty" mapstructure:"max_matched_data_size" yaml:"maxMatchedDataSize"` + ParanoiaLevel *int `json:"paranoia_level,omitempty" mapstructure:"paranoia_level" yaml:"paranoiaLevel"` + RulesGroups []*RulesGroup `json:"rules_groups,omitempty" mapstructure:"rules_groups" yaml:"rulesGroups"` + PreConditions *GnsSegmentationPolicyPreConditions `json:"pre_conditions,omitempty" mapstructure:"pre_conditions" yaml:"preConditions"` + RulesDirectory string `json:"rules_directory,omitempty" mapstructure:"rules_directory" yaml:"rulesDirectory"` + Process *ProcessingToggles `json:"process,omitempty" mapstructure:"process" yaml:"process"` +} + +// +k8s:openapi-gen=true +type AttackDiscoveryConfig struct { + Selectors GnsServiceSelector `json:"selectors,omitempty" mapstructure:"selectors" yaml:"selectors"` + Application AttackDiscoveryApplicationConfigList `json:"application,omitempty" mapstructure:"application" yaml:"application"` +} + +// +k8s:openapi-gen=true +type Center struct { + Latitude string `json:"latitude,omitempty" mapstructure:"latitude" yaml:"latitude"` + Longitude string `json:"longitude,omitempty" mapstructure:"longitude" yaml:"longitude"` +} + +// +k8s:openapi-gen=true +type GeoMeta struct { + Name string `json:"name,omitempty" mapstructure:"name" yaml:"name"` + Center *Center `json:"center,omitempty" mapstructure:"center" yaml:"center"` + Country string `json:"country,omitempty" mapstructure:"country" yaml:"country"` + Proximity string `json:"proximity,omitempty" mapstructure:"proximity" yaml:"proximity"` + State string `json:"state,omitempty" mapstructure:"state" yaml:"state"` +} + +// +k8s:openapi-gen=true +type GeoDiscoveryConfig struct { + Selectors GnsServiceSelector `json:"selectors,omitempty" mapstructure:"selectors" yaml:"selectors"` + GeoFences GeoDiscoveryGeoFencesConfigList `json:"geofences" mapstructure:"geofences" yaml:"geoFences"` +} + +// +k8s:openapi-gen=true +type DLPMatch struct { + PatternGroups []string `json:"pattern_groups,omitempty" mapstructure:"pattern_groups" yaml:"patternGroups"` + Patterns []string `json:"patterns,omitempty" mapstructure:"patterns" yaml:"patterns"` +} + +// +k8s:openapi-gen=true +type Query struct { + Name *string `json:"name,omitempty" mapstructure:"name" yaml:"name"` + Regex []string `json:"regex,omitempty" mapstructure:"regex" yaml:"regex"` +} + +// +k8s:openapi-gen=true +type CheckFunction struct { + Name string `json:"name,omitempty" mapstructure:"name" yaml:"name"` + Parameters string `json:"parameters,omitempty" mapstructure:"parameters" yaml:"parameters"` +} + +// +k8s:openapi-gen=true +type Check struct { + Name *string `json:"name,omitempty" mapstructure:"name" yaml:"name"` + Confidence *uint32 `json:"confidence,omitempty" mapstructure:"confidence" yaml:"confidence"` + Proximity *uint32 `json:"proximity,omitempty" mapstructure:"proximity" yaml:"proximity"` + QueryName string `json:"query_name,omitempty" mapstructure:"query_name" yaml:"queryName"` + Function *CheckFunction `json:"function,omitempty" mapstructure:"function" yaml:"function"` + Mandatory *bool `json:"mandatory,omitempty" mapstructure:"mandatory" yaml:"mandatory"` +} + +// +k8s:openapi-gen=true +type BaseCheck struct { + Name *string `json:"name,omitempty" mapstructure:"name" yaml:"name"` + Confidence *uint32 `json:"confidence,omitempty" mapstructure:"confidence" yaml:"confidence"` + QueryName *string `json:"query_name,omitempty" mapstructure:"query_name" yaml:"queryName"` +} + +// +k8s:openapi-gen=true +type Pattern struct { + Name *string `json:"name,omitempty" mapstructure:"name" yaml:"name"` + MinConfidence int `json:"min_confidence,omitempty" mapstructure:"min_confidence" yaml:"minConfidence"` + Exceptions []*Check `json:"exceptions,omitempty" mapstructure:"exceptions" yaml:"exceptions"` + AdditionalChecks []*Check `json:"additional_checks,omitempty" mapstructure:"additional_checks" yaml:"additionalChecks"` + BaseCheck *BaseCheck `json:"base_check,omitempty" mapstructure:"base_check" yaml:"baseCheck"` +} + +// +k8s:openapi-gen=true +type PatternGroup struct { + Name *string `json:"name,omitempty" mapstructure:"name" yaml:"name"` + Patterns []string `json:"patterns,omitempty" mapstructure:"patterns" yaml:"patterns"` +} + +// +k8s:openapi-gen=true +type PatternDatabase struct { + DatabaseFile *string `json:"database_file,omitempty" mapstructure:"database_file" yaml:"databaseFile"` + UseDefault *bool `json:"use_default,omitempty" mapstructure:"use_default" yaml:"useDefault"` + Queries []*Query `json:"queries,omitempty" mapstructure:"queries" yaml:"queries"` + Patterns []*Pattern `json:"patterns,omitempty" mapstructure:"patterns" yaml:"patterns"` + PatternGroups []*PatternGroup `json:"pattern_groups,omitempty" mapstructure:"pattern_groups" yaml:"patternGroups"` +} + +// +k8s:openapi-gen=true +type DLPConfig struct { + MatchingPolicy *DLPMatch `json:"matching_policy,omitempty" mapstructure:"matching_policy" yaml:"matchingPolicy"` + PatternDatabase *PatternDatabase `json:"pattern_database,omitempty" mapstructure:"pattern_database" yaml:"patternDatabase"` +} + +// +k8s:openapi-gen=true +type PIIMimeConfig struct { + IgnoredMime []string `json:"ignored_mime,omitempty" mapstructure:"ignored_mime" yaml:"ignoredMime"` +} + +// +k8s:openapi-gen=true +type PIIAsyncWorkerLimits struct { + TotalMemory *uint64 `json:"total_memory,omitempty" mapstructure:"total_memory" yaml:"totalMemory"` + ThroughputLimitingWindow *uint64 `json:"throughput_limiting_window,omitempty" mapstructure:"throughput_limiting_window" yaml:"throughputLimitingWindow"` + TransactionsPerWindow *uint64 `json:"transactions_per_window,omitempty" mapstructure:"transactions_per_window" yaml:"transactionsPerWindow"` + BytesPerWindow *uint64 `json:"bytes_per_window,omitempty" mapstructure:"bytes_per_window" yaml:"bytesPerWindow"` +} + +// +k8s:openapi-gen=true +type RuleConfig struct { + OnlineBufferSize *uint32 `json:"online_buffer_size,omitempty" mapstructure:"online_buffer_size" yaml:"onlineBufferSize"` + EnableOffline string `json:"enable_offline,omitempty" mapstructure:"enable_offline" yaml:"enableOffline"` + DLPConfig *DLPConfig `json:"dlp_config,omitempty" mapstructure:"dlp_config" yaml:"dLPConfig"` + EnableDetailedLogging *bool `json:"enable_detailed_logging,omitempty" mapstructure:"enable_detailed_logging" yaml:"enableDetailedLogging"` + PIIMimeConfig *PIIMimeConfig `json:"mime_config,omitempty" mapstructure:"mime_config" yaml:"pIIMimeConfig"` + Limits *PIIAsyncWorkerLimits `json:"limits,omitempty" mapstructure:"limits" yaml:"limits"` +} + +// +k8s:openapi-gen=true +type PiiDiscoveryAppConfig struct { + Rule *RuleConfig `json:"rule,omitempty" mapstructure:"rule" yaml:"rule"` +} + +// +k8s:openapi-gen=true +type PiiDiscoveryConfig struct { + Selectors GnsServiceSelector `json:"selectors,omitempty" mapstructure:"selectors" yaml:"selectors"` + Application PiiDiscoveryApplicationConfigList `json:"application,omitempty" mapstructure:"application" yaml:"application"` +} + +// +k8s:openapi-gen=true +type OpenAPI struct { + Inline string `json:"inline,omitempty" yaml:"inline"` + URL string `json:"url,omitempty" yaml:"uRL"` +} + +// +k8s:openapi-gen=true +type SubToggles struct { + Extra Mode `json:"extra,omitempty" mapstructure:"extra" yaml:"extra"` + Missing Mode `json:"missing,omitempty" mapstructure:"missing" yaml:"missing"` + SchemaViolation Mode `json:"schema_violation,omitempty" mapstructure:"schema_violation" yaml:"schemaViolation"` + MissingSchema Mode `json:"missing_schema,omitempty" mapstructure:"missing_schema" yaml:"missingSchema"` +} + +// +k8s:openapi-gen=true +type Toggles struct { + QueryParameters *SubToggles `json:"query_parameters,omitempty" mapstructure:"query_parameters" yaml:"queryParameters"` + RequestHeaders *SubToggles `json:"request_headers,omitempty" mapstructure:"request_headers" yaml:"requestHeaders"` + ResponseHeaders *SubToggles `json:"response_headers,omitempty" mapstructure:"response_headers" yaml:"responseHeaders"` + RequestPayload *SubToggles `json:"request_payload,omitempty" mapstructure:"request_payload" yaml:"requestPayload"` + ResponsePayload *SubToggles `json:"response_payload,omitempty" mapstructure:"response_payload" yaml:"responsePayload"` + RequestCookies *SubToggles `json:"request_cookies,omitempty" mapstructure:"request_cookies" yaml:"requestCookies"` + PathParametersSchemaViolation Mode `json:"path_parameters_schema_violation,omitempty" mapstructure:"path_parameters_schema_violation" yaml:"pathParametersSchemaViolation"` + UnexpectedEndpoint Mode `json:"unexpected_endpoint,omitempty" mapstructure:"unexpected_endpoint" yaml:"unexpectedEndpoint"` + UnexpectedResponseCode Mode `json:"unexpected_response_code,omitempty" mapstructure:"unexpected_response_code" yaml:"unexpectedResponseCode"` + UnexpectedRequestContentType Mode `json:"unexpected_request_content_type,omitempty" mapstructure:"unexpected_request_content_type" yaml:"unexpectedRequestContentType"` + UnexpectedResponseContentType Mode `json:"unexpected_response_content_type,omitempty" mapstructure:"unexpected_response_content_type" yaml:"unexpectedResponseContentType"` +} + +// +k8s:openapi-gen=true +type GnsSchemaViolationDiscoveryConfig struct { + Selectors struct{ Service string } `json:"selectors" mapstructure:"selectors" yaml:"selectors"` + OpenAPI OpenAPI `json:"openapi,omitempty" mapstructure:"openapi" yaml:"openAPI"` + Toggles *Toggles `json:"toggles,omitempty" mapstructure:"toggles" yaml:"toggles"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationPolicyActionCode struct { + Code *uint32 `json:"code,omitempty" mapstructure:"code" yaml:"code"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationPolicyActionEmpty struct { +} + +// +k8s:openapi-gen=true +type GnsSegmentationPolicyActionType struct { + RateLimit *GnsSegmentationRateLimitingPools `json:"rate_limit,omitempty" mapstructure:"rate_limit" yaml:"rateLimit"` + Allow *GnsSegmentationPolicyActionEmpty `json:"allow,omitempty" mapstructure:"allow" yaml:"allow"` + Deny *GnsSegmentationPolicyActionCode `json:"deny,omitempty" mapstructure:"deny" yaml:"deny"` + Skip *GnsSegmentationPolicyActionEmpty `json:"skip,omitempty" mapstructure:"skip" yaml:"skip"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationRateLimitingPool struct { + GroupBy string `json:"group_by,omitempty" mapstructure:"group_by" yaml:"groupBy"` + Limit *uint64 `json:"limit,omitempty" mapstructure:"limit" yaml:"limit"` + Action string `json:"action,omitempty" mapstructure:"action" yaml:"action"` + Cadency string `json:"cadency,omitempty" mapstructure:"cadency" yaml:"cadency"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationRateLimitingPoolMap struct { + Name string `json:"name,omitempty" mapstructure:"name" yaml:"name"` + Pool *GnsSegmentationRateLimitingPool `json:"pool,omitempty" mapstructure:"pool" yaml:"pool"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationRateLimitingPoolSelector struct { + UsePool string `json:"use_pool,omitempty" mapstructure:"use_pool" yaml:"usePool"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationRateLimitingPools struct { + Pools []*GnsSegmentationRateLimitingPoolSelector `json:"pools,omitempty" mapstructure:"pools" yaml:"pools"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationPolicyPiiAction struct { + Action *GnsSegmentationPolicyActionType `json:"action,omitempty" mapstructure:"action" yaml:"action"` + Pattern string `json:"pattern,omitempty" mapstructure:"pattern" yaml:"pattern"` + PatternGroup string `json:"pattern_group,omitempty" mapstructure:"pattern_group" yaml:"patternGroup"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationDLPPolicy struct { + DefaultAction *GnsSegmentationPolicyActionType `json:"default_action,omitempty" mapstructure:"default_action" yaml:"defaultAction"` + PiiActions []*GnsSegmentationPolicyPiiAction `json:"pii_actions,omitempty" mapstructure:"pii_actions" yaml:"piiActions"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationDefensePolicyRule struct { + Action *GnsSegmentationPolicyActionType `json:"action,omitempty" mapstructure:"action" yaml:"action"` + Group string `json:"group,omitempty" mapstructure:"group" yaml:"group"` + Id uint32 `json:"id,omitempty" mapstructure:"id" yaml:"id"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationPolicyProcessingToggles struct { + RequestHeaders string `json:"request_headers,omitempty" mapstructure:"request_headers" yaml:"requestHeaders"` + RequestBody string `json:"request_body,omitempty" mapstructure:"request_body" yaml:"requestBody"` + ResponseHeaders string `json:"response_headers,omitempty" mapstructure:"response_headers" yaml:"responseHeaders"` + ResponseBody string `json:"response_body,omitempty" mapstructure:"response_body" yaml:"responseBody"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationAttackDefense struct { + Action *GnsSegmentationPolicyActionType `json:"action,omitempty" mapstructure:"action" yaml:"action"` + Process *GnsSegmentationPolicyProcessingToggles `json:"process,omitempty" mapstructure:"process" yaml:"process"` + Rules []*GnsSegmentationDefensePolicyRule `json:"rules,omitempty" mapstructure:"rules" yaml:"rules"` + PreconditionAction *GnsSegmentationPolicyActionType `json:"precondition_action,omitempty" mapstructure:"precondition_action" yaml:"preconditionAction"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationSubPolicy struct { + Extra *GnsSegmentationPolicyActionType `json:"extra,omitempty" mapstructure:"extra" yaml:"extra"` + Missing *GnsSegmentationPolicyActionType `json:"missing,omitempty" mapstructure:"missing" yaml:"missing"` + SchemaViolation *GnsSegmentationPolicyActionType `json:"schema_violation,omitempty" mapstructure:"schema_violation" yaml:"schemaViolation"` + MissingSchema *GnsSegmentationPolicyActionType `json:"missing_schema,omitempty" mapstructure:"missing_schema" yaml:"missingSchema"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationSchemaValidation struct { + ViolationAction *GnsSegmentationPolicyActionType `json:"violation_action,omitempty" mapstructure:"violation_action" yaml:"violationAction"` + PathParametersSchemaViolation *GnsSegmentationPolicyActionType `json:"path_parameters_schema_violation,omitempty" mapstructure:"path_parameters_schema_violation" yaml:"pathParametersSchemaViolation"` + QueryParameters *GnsSegmentationSubPolicy `json:"query_parameters,omitempty" mapstructure:"query_parameters" yaml:"queryParameters"` + RequestHeaders *GnsSegmentationSubPolicy `json:"request_headers,omitempty" mapstructure:"request_headers" yaml:"requestHeaders"` + ResponseHeaders *GnsSegmentationSubPolicy `json:"response_headers,omitempty" mapstructure:"response_headers" yaml:"responseHeaders"` + RequestPayload *GnsSegmentationSubPolicy `json:"request_payload,omitempty" mapstructure:"request_payload" yaml:"requestPayload"` + ResponsePayload *GnsSegmentationSubPolicy `json:"response_payload,omitempty" mapstructure:"response_payload" yaml:"responsePayload"` + RequestCookies *GnsSegmentationSubPolicy `json:"request_cookies,omitempty" mapstructure:"request_cookies" yaml:"requestCookies"` + UnexpectedEndpoint *GnsSegmentationPolicyActionType `json:"unexpected_endpoint,omitempty" mapstructure:"unexpected_endpoint" yaml:"unexpectedEndpoint"` + UnexpectedResponseCode *GnsSegmentationPolicyActionType `json:"unexpected_response_code,omitempty" mapstructure:"unexpected_response_code" yaml:"unexpectedResponseCode"` + UnexpectedRequestContentType *GnsSegmentationPolicyActionType `json:"unexpected_request_content_type,omitempty" mapstructure:"unexpected_request_content_type" yaml:"unexpectedRequestContentType"` + UnexpectedResponseContentType *GnsSegmentationPolicyActionType `json:"unexpected_response_content_type,omitempty" mapstructure:"unexpected_response_content_type" yaml:"unexpectedResponseContentType"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationPolicyIngressFeatures struct { + APISegmentation *GnsSegmentationPolicyActionType `json:"api_segmentation,omitempty" mapstructure:"api_segmentation" yaml:"aPISegmentation"` + PIISegmentation *GnsSegmentationDLPPolicy `json:"pii_segmentation,omitempty" mapstructure:"pii_segmentation" yaml:"pIISegmentation"` + RateLimit []*GnsSegmentationRateLimitingPools `json:"rate_limit,omitempty" mapstructure:"rate_limit" yaml:"rateLimit"` + AttackDefense *GnsSegmentationAttackDefense `json:"attack_defense,omitempty" mapstructure:"attack_defense" yaml:"attackDefense"` + SchemaValidation *GnsSegmentationSchemaValidation `json:"schema_validation,omitempty" mapstructure:"schema_validation" yaml:"schemaValidation"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationPolicyMatchEndpoint struct { + Method string `json:"method,omitempty" mapstructure:"method" yaml:"method"` + Path string `json:"path,omitempty" mapstructure:"path" yaml:"path"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationSourceSelectorIpBlock struct { + Cidr []string `json:"cidr,omitempty" mapstructure:"cidr" yaml:"cidr"` + Except []string `json:"except,omitempty" mapstructure:"except" yaml:"except"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationServiceGroupSpec struct { + Name string `json:"name,omitempty" mapstructure:"name" yaml:"name"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationSourceSelector struct { + IpBlock *GnsSegmentationSourceSelectorIpBlock `json:"ip_block,omitempty" mapstructure:"ip_block" yaml:"ipBlock"` + ServiceGroup []string `json:"service_group,omitempty" mapstructure:"service_group" yaml:"serviceGroup"` + ServiceName []string `json:"service_name,omitempty" mapstructure:"service_name" yaml:"serviceName"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationPolicyHeadersMap struct { + Key string `json:"key,omitempty" mapstructure:"key" yaml:"key"` + Value string `json:"value,omitempty" mapstructure:"value" yaml:"value"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationIngressApplication struct { + Hostname []string `json:"hostname,omitempty" mapstructure:"hostname" yaml:"hostname"` + UserID []string `json:"user_id,omitempty" mapstructure:"user_id" yaml:"userID"` + UserAgent []string `json:"user_agent,omitempty" mapstructure:"user_agent" yaml:"userAgent"` + Headers []*GnsSegmentationPolicyHeadersMap `json:"headers,omitempty" mapstructure:"headers" yaml:"headers"` + Endpoint []*GnsSegmentationPolicyMatchEndpoint `json:"endpoint,omitempty" mapstructure:"endpoint" yaml:"endpoint"` + Protocol string `json:"protocol,omitempty" mapstructure:"protocol" yaml:"protocol"` + ServiceGroup []string `json:"service_group,omitempty" mapstructure:"service_group" yaml:"serviceGroup"` + SourceSelector *GnsSegmentationSourceSelector `json:"source_selector,omitempty" mapstructure:"source_selector" yaml:"sourceSelector"` + IngressFeatures GnsSegmentationPolicyIngressFeatures `json:"ingress_features,omitempty" mapstructure:"ingress_features" yaml:"ingressFeatures"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationPolicySpec struct { + Selectors struct{ Service string } `json:"selectors" mapstructure:"selectors" yaml:"selectors"` + RateLimitingPools []GnsSegmentationRateLimitingPoolMap `json:"rate_limiting_pools,omitempty" mapstructure:"rate_limiting_pools" yaml:"rateLimitingPools"` + Application []GnsSegmentationIngressApplication `json:"application,omitempty" mapstructure:"application" yaml:"application"` + Default GnsSegmentationPolicyIngressFeatures `json:"default,omitempty" mapstructure:"default" yaml:"default"` +} + +// +k8s:openapi-gen=true +type IdentityFormat_Jwt struct { + Claim string `json:"claim,omitempty" mapstructure:"claim" yaml:"claim"` + ClaimPath string `json:"claim_path,omitempty" mapstructure:"claim_path" yaml:"claimPath"` +} + +// +k8s:openapi-gen=true +type IdentityFormat_Json struct { + ClaimPath string `json:"claim_path,omitempty" mapstructure:"claim_path" yaml:"claimPath"` +} + +// +k8s:openapi-gen=true +type IdentityFormat struct { + Type string `json:"type,omitempty" mapstructure:"type" yaml:"type"` + Jwt *IdentityFormat_Jwt `json:"jwt,omitempty" mapstructure:"jwt" yaml:"jwt"` + Json *IdentityFormat_Json `json:"json,omitempty" mapstructure:"json" yaml:"json"` +} + +// +k8s:openapi-gen=true +type LocationHeader struct { + Name string `json:"name,omitempty" mapstructure:"name" yaml:"name"` + ValuePrefix string `json:"value_prefix,omitempty" mapstructure:"value_prefix" yaml:"valuePrefix"` +} + +// +k8s:openapi-gen=true +type TokenLocation struct { + Headers []*LocationHeader `json:"headers,omitempty" mapstructure:"headers" yaml:"headers"` + UrlParams []string `json:"url_params,omitempty" mapstructure:"url_params" yaml:"urlParams"` + Cookies []string `json:"cookies,omitempty" mapstructure:"cookies" yaml:"cookies"` + Body []string `json:"body,omitempty" mapstructure:"body" yaml:"body"` +} + +// +k8s:openapi-gen=true +type RouteMatch struct { + Prefix string `json:"prefix,omitempty" mapstructure:"prefix" yaml:"prefix"` + Path string `json:"path,omitempty" mapstructure:"path" yaml:"path"` + Regex string `json:"regex,omitempty" mapstructure:"regex" yaml:"regex"` + CaseSensitive *bool `json:"case_sensitive,omitempty" mapstructure:"case_sensitive" yaml:"caseSensitive"` +} + +// +k8s:openapi-gen=true +type IdentityProvider struct { + IdentityType string `json:"identity_type,omitempty" mapstructure:"identity_type" yaml:"identityType"` + Format *IdentityFormat `json:"format,omitempty" mapstructure:"format" yaml:"format"` + From *TokenLocation `json:"from,omitempty" mapstructure:"from" yaml:"from"` + Direction string `json:"direction,omitempty" mapstructure:"direction" yaml:"direction"` + Route *RouteMatch `json:"route,omitempty" mapstructure:"route" yaml:"route"` +} + +// +k8s:openapi-gen=true +type UserIdentityProviderItem struct { + Name string `json:"name,omitempty" mapstructure:"name" yaml:"name"` + Provider *IdentityProvider `json:"provider,omitempty" mapstructure:"provider" yaml:"provider"` +} + +// +k8s:openapi-gen=true +type UserDiscoveryAppConfig struct { + Providers []UserIdentityProviderItem `json:"-" mapstructure:"providers" yaml:"providers"` + RequestBufferSize *uint64 `json:"request_buffer_size,omitempty" mapstructure:"request_buffer_size" yaml:"requestBufferSize"` + ResponseBufferSize *uint64 `json:"response_buffer_size,omitempty" mapstructure:"response_buffer_size" yaml:"responseBufferSize"` +} + +// +k8s:openapi-gen=true +type UserDiscoveryConfig struct { + Selectors GnsServiceSelector `json:"selectors,omitempty" mapstructure:"selectors" yaml:"selectors"` + Application UserDiscoveryApplicationConfigList `json:"application,omitempty" mapstructure:"application" yaml:"application"` +} + +// +k8s:openapi-gen=true +type HealthCheckConfig struct { + Name string `json:"name" mapstructure:"name" yaml:"name"` + Protocol HealthCheckConfigProtocol `json:"protocol" mapstructure:"protocol" yaml:"protocol"` + Domain string `json:"domain" mapstructure:"domain" yaml:"domain"` + Port int `json:"port" mapstructure:"port" yaml:"port"` + Path string `json:"path" mapstructure:"path" yaml:"path"` + HealthThreshold int `json:"healthThreshold" mapstructure:"healthThreshold" yaml:"healthThreshold"` + Interval int `json:"interval" mapstructure:"interval" yaml:"interval"` +} + +// +k8s:openapi-gen=true +type HealthCheckStatus struct { + Healthy bool `json:"healthy" mapstructure:"healthy" yaml:"healthy"` + Message string `json:"message" mapstructure:"message" yaml:"message"` + LastCheckTime int64 `json:"last_check_time" mapstructure:"last_check_time" yaml:"lastCheckTime"` + LastChangeTime int64 `json:"last_change_time" mapstructure:"last_change_time" yaml:"lastChangeTime"` +} + +// +k8s:openapi-gen=true +type PeerAuthenticationPolicy struct { + Mtls *PeerAuthentication_MutualTLS `json:"mtls" mapstructure:"mtls" yaml:"mtls"` +} + +// +k8s:openapi-gen=true +type PeerAuthentication_MutualTLS struct { + Mode PeerAuthentication_MutualTLS_Mode `json:"mode" mapstructure:"mode" yaml:"mode"` +} + +// +k8s:openapi-gen=true +type JobID struct { + Id string `json:"id" mapstructure:"id" yaml:"id"` +} + +// +k8s:openapi-gen=true +type JobIDs struct { + Ids []string `json:"ids" mapstructure:"ids" yaml:"ids"` +} + +// +k8s:openapi-gen=true +type JobInfo struct { + Uri string `json:"uri" mapstructure:"uri" yaml:"uri"` + Type JobType `json:"type" mapstructure:"type" yaml:"type"` + Payload string `json:"payload" mapstructure:"payload" yaml:"payload"` + CreateTimestamp string `json:"createTimestamp" mapstructure:"createTimestamp" yaml:"createTimestamp"` +} + +// +k8s:openapi-gen=true +type JobStatusInfo struct { + Uri string `json:"uri" mapstructure:"uri" yaml:"uri"` + Type JobType `json:"type" mapstructure:"type" yaml:"type"` + Payload string `json:"payload" mapstructure:"payload" yaml:"payload"` + CreateTimestamp string `json:"createTimestamp" mapstructure:"createTimestamp" yaml:"createTimestamp"` + Id string `json:"id" mapstructure:"id" yaml:"id"` + State JobState `json:"state" mapstructure:"state" yaml:"state"` + Progress int32 `json:"progress" mapstructure:"progress" yaml:"progress"` + UpdateTimestamp string `json:"updateTimestamp" mapstructure:"updateTimestamp" yaml:"updateTimestamp"` + Code int32 `json:"code" mapstructure:"code" yaml:"code"` + Message string `json:"message" mapstructure:"message" yaml:"message"` + OutputPath string `json:"outputPath" mapstructure:"outputPath" yaml:"outputPath"` +} + +// +k8s:openapi-gen=true +type PolicyCfgAction struct { + Action PolicyActionType `json:"action" mapstructure:"action" yaml:"action"` +} + +// +k8s:openapi-gen=true +type ResourceGroupID struct { + Name string `json:"name" mapstruction:"name" yaml:"name"` + Type string `json:"type" mapstruction:"type" yaml:"type"` +} + +// +k8s:openapi-gen=true +type ProgressiveUpgradeStep struct { + Current int32 `json:"current" mapstructure:"current" yaml:"current"` + TotalSteps int32 `json:"totalSteps" mapstructure:"totalSteps" yaml:"totalSteps"` + LastStepRunAt int32 `json:"lastStepRunAt" mapstructure:"lastStepRunAt" yaml:"lastStepRunAt"` +} + +// +k8s:openapi-gen=true +type ProgressiveUpgradeStatus struct { + RunningState ProgressiveUpgradeState `json:"runningState" mapstructure:"runningState" yaml:"runningState"` + SubState ProgressiveUpgradeSubstate `json:"subState" mapstructure:"subState" yaml:"subState"` + StateDescription string `json:"stateDescription" mapstructure:"stateDescription" yaml:"stateDescription"` +} + +// +k8s:openapi-gen=true +type ProgressiveUpgradeStrategy struct { + StepCount int32 `json:"stepCount" mapstructure:"stepCount" yaml:"stepCount"` + StepDelay int32 `json:"stepDelay" mapstructure:"stepDelay" yaml:"stepDelay"` +} + +// +k8s:openapi-gen=true +type TargetVersion struct { + ExistingVersionName string `json:"existingVersionName" mapstructure:"existingVersionName" yaml:"existingVersionName"` +} + +// +k8s:openapi-gen=true +type CurrentVersion struct { + Name string `json:"name" mapstructure:"name" yaml:"name"` + OriginalTrafficWeight int32 `json:"originalTrafficWeight" mapstructure:"originalTrafficWeight" yaml:"originalTrafficWeight"` +} + +// +k8s:openapi-gen=true +type UpgradeTargetVersion struct { + Version TargetVersion `json:"version" mapstructure:"version" yaml:"version"` + OriginalTrafficWeight int32 `json:"originalTrafficWeight" mapstructure:"originalTrafficWeight" yaml:"originalTrafficWeight"` +} + +// +k8s:openapi-gen=true +type UpgradeService struct { + Name string `json:"name" mapstructure:"name" yaml:"name"` + Cluster string `json:"cluster" mapstructure:"cluster" yaml:"cluster"` + Domain string `json:"domain" mapstructure:"domain" yaml:"domain"` + Namespace string `json:"namespace" mapstructure:"namespace" yaml:"namespace"` + CurrentVersion CurrentVersion `json:"currentVersion" mapstructure:"currentVersion" yaml:"currentVersion"` + TargetVersion UpgradeTargetVersion `json:"targetVersion" mapstructure:"targetVersion" yaml:"targetVersion"` +} + +// +k8s:openapi-gen=true +type ServicePort struct { + Name string `json:"name" mapstructure:"name" yaml:"name"` + Port int32 `json:"port" mapstructure:"port" yaml:"port"` + TargetPort intstr.IntOrString `json:"targetPort" mapstructure:"targetPort" yaml:"targetPort"` + NodePort int32 `json:"nodePort" mapstructure:"nodePort" yaml:"nodePort"` + Proto string `json:"proto" mapstructure:"proto" yaml:"proto"` + Protocol string `json:"protocol" mapstructure:"protocol" yaml:"protocol"` + AppProtocol string `json:"appProtocol" mapstructure:"port" yaml:"appProtocol"` +} + +// +k8s:openapi-gen=true +type ServiceEndpoint struct { + Address string `json:"address" mapstructure:"address" yaml:"address"` + Ports map[string]int32 `json:"ports" mapstructure:"ports" yaml:"ports"` +} + +// +k8s:openapi-gen=true +type ServiceEndpointList struct { + List []ServiceEndpoint `json:"list" mapstructure:"list" yaml:"list"` +} + +// +k8s:openapi-gen=true +type ServiceVersionList struct { + List []SvcVersion `json:"list" mapstructure:"list" yaml:"list"` +} + +// +k8s:openapi-gen=true +type SvcVersion struct { + Version string `json:"version" mapstructure:"version" yaml:"version"` + IsLocalPresent bool `json:"isLocalPresent" mapstructure:"isLocalPresent" yaml:"isLocalPresent"` + RemoteEndpoints []ServiceEndpoint `json:"remoteEndpoints" mapstructure:"remoteEndpoints" yaml:"remoteEndpoints"` +} + +// +k8s:openapi-gen=true +type PortLevelAuthenticationMap struct { + Ports map[string]int32 `json:"ports" mapstructure:"ports" yaml:"ports"` +} + +// +k8s:openapi-gen=true +type SloService struct { + Cluster string `json:"cluster" mapstructure:"cluster" yaml:"cluster"` + Domain string `json:"domain" mapstructure:"domain" yaml:"domain"` + Name string `json:"name" mapstructure:"name" yaml:"name"` +} + +// +k8s:openapi-gen=true +type SloServices struct { + Services []SloService `json:"services" yaml:"services"` + ServiceGroups []string `json:"serviceGroups" yaml:"serviceGroups"` +} + +// +k8s:openapi-gen=true +type SloTargetValue struct { + Value float64 `json:"value" mapstructure:"value" yaml:"value"` +} + +// +k8s:openapi-gen=true +type ServiceLevelIndication struct { + MetricName ServiceLevelIndicationMetricName `json:"metricName" mapstructure:"metricName" yaml:"metricName"` + Value float64 `json:"value" mapstructure:"value" yaml:"value"` +} + +type State string +type StatusConditions []StatusCondition +type ClusterSyncState string +type CaSyncState string +type ClusterState string +type ClusterStatusHistory []ClusterStatus +type CaState string +type ComponentState string +type ComponentStatusesHistory []ComponentStatuses +type CaStatusHistory []CaStatus +type ApplicationState string +type Versions []Version +type LogType string +type ProxyProtocol string +type ProxyType string +type Labels map[string]string +type CaLabels map[string]string +type ASLabels []map[string]string +type Selector []map[string]string +type DMSet map[string]bool +type MtlsExceptions []MtlsException +type StringList []string +type MatchFunction string +type Conditions []Condition +type StringMatchType string +type HTTPRoutingRules []HTTPRoutingRule +type RoutingProtocolType string +type LabelsList []Label + +// Defines platform type for a service. +// KUBERNETES : The service is a Kuberbetes Service +type ServiceType string +type EnvoyFilterSpec v1alpha3.EnvoyFilter +type GatewaySpec istio.Gateway +type GatewayConfigListeners []GatewayConfigListener +type GatewayRoutingRule GatewayRoutingRuleSNI +type MatchConditions []MatchCondition +type GnsACPMatchMethod string +type ApiDiscoveryApplicationConfigList []APIDiscoveryAppConfig +type ApiDiscoveryClusterResourceSelectorRT ClusterResourceSelectorRT +type AttackDiscoveryApplicationConfigList []AttackDiscoveryAppConfig +type AttackDiscoveryClusterResourceSelectorRT ClusterResourceSelectorRT +type GeoDiscoveryGeoFencesConfigList []GeoMeta +type GeoDiscoveryClusterResourceSelectorRT ClusterResourceSelectorRT +type PiiDiscoveryApplicationConfigList []PiiDiscoveryAppConfig +type PiiDiscoveryClusterResourceSelectorRT ClusterResourceSelectorRT +type Mode string +type GnsSchemaViolationDiscoveryClusterResourceSelectorRT ServiceSelector +type UserDiscoveryApplicationConfigList []UserDiscoveryAppConfig +type UserDiscoveryClusterResourceSelectorRT ClusterResourceSelectorRT +type HealthCheckConfigProtocol string +type PeerAuthenticationSpec PeerAuthenticationPolicy +type PeerAuthentication_MutualTLS_Mode int32 +type PolicySpec istioauth.Policy +type JobType string +type JobState string +type DeploymentSpec k8sappsv1.DeploymentSpec +type DeploymentStatus k8sappsv1.DeploymentStatus +type ReplicaSetSpec k8sappsv1.ReplicaSetSpec +type ReplicaSetStatus k8sappsv1.ReplicaSetStatus +type StatefulSetSpec k8sappsv1.StatefulSetSpec +type StatefulSetStatus k8sappsv1.StatefulSetStatus +type DaemonSetSpec k8sappsv1.DaemonSetSpec +type DaemonSetStatus k8sappsv1.DaemonSetStatus +type CronJobSpec k8sbatchv1beta1.CronJobSpec +type CronJobStatus k8sbatchv1beta1.CronJobStatus +type JobSpec k8sbatchv1.JobSpec +type JobStatus k8sbatchv1.JobStatus +type ServiceInstanceSpec k8scorev1.PodSpec +type ServiceInstanceStatus k8scorev1.PodStatus +type ServiceSpec k8scorev1.ServiceSpec +type ServiceStatus k8scorev1.ServiceStatus +type Metadata k8sapimachineryv1.ObjectMeta +type NodeSpec k8scorev1.NodeSpec +type KNodeStatus k8scorev1.NodeStatus +type EndpointSubsets []k8scorev1.EndpointSubset +type IntOrString intstr.IntOrString +type PolicyActionType string +type PolicyCfgActions []PolicyCfgAction +type ResourceGroupIDs []ResourceGroupID + +// ProgressiveUpgradeState represents runnig status of the upgrade +type ProgressiveUpgradeState int + +// ProgressiveUpgradeSubstate represents error/ok status of the upgrade +type ProgressiveUpgradeSubstate int +type UpgradeServices []UpgradeService +type ServicePortList []ServicePort + +// It defines the mTLS mode used for peer authentication which is +// used to configure what type of mTLS traffic the sidecar will Accept. +// INHERIT : Inherit mTLS mode from namespace (or mesh) settings +// +// This mode is used in conjunction with the port level mtls settings. +// This is useful when user wants to override namespace level mtls settings for specific port(s). +// +// DISABLE : Connection is not tunneled. +// PERMISSIVE : Connection can be either plaintext or mTLS tunnel. +// STRICT : Connection is an mTLS tunnel (TLS with client cert must be presented). +type InboundMode string + +// It is used to configure what type of TLS traffic the downstream endpoint will send. +// DISABLE: Do not setup a TLS connection to the upstream endpoint. +// SIMPLE: Originate a TLS connection to the upstream endpoint. +// MUTUAL_WITH_USER_PROVIDED_CERTS: Secure connections to the upstream using mutual TLS by presenting client certificates for authentication. +// +// In this mode, user will provide client certificates that will be used to program the downstream endpoint. +// +// MUTUAL_WITH_INTERNAL_CERTS: Compared to Mutual mode, this mode uses certificates generated automatically by Internal CA for mTLS authentication. +// +// In this mode, downstream endpoints are pre-programmed with certificates provided by the Internal CA (TSM CA), so user does not need to provide any certificates. +type OutboundMode string +type HAType string +type DNSList []string +type ServiceLevelIndicationMetricName string +type ServiceLevelIndicationGroup []ServiceLevelIndication + +const ( + ActiveState State = "Active" + ExpiredState State = "Expired" + InvalidState State = "Invalid" + UnknownState State = "Unknown" + ApprovedState State = "Approved" + DeniedState State = "Denied" + ReadyState State = "Ready" + ClusterSyncState_Syncing ClusterSyncState = "Syncing" + ClusterSyncState_Synced ClusterSyncState = "Synced" + ClusterSyncState_Error ClusterSyncState = "Error" + CaSyncState_Applied CaSyncState = "Applied" + CaSyncState_InSync CaSyncState = "InSync" + CaSyncState_Error CaSyncState = "Error" + ClusterState_Connecting ClusterState = "Connecting" + ClusterState_ConnectFailed ClusterState = "ConnectFailed" + ClusterState_Connected ClusterState = "Connected" + ClusterState_Disconnected ClusterState = "Disconnected" + ClusterState_Validating ClusterState = "Validating" + ClusterState_ValidateFailed ClusterState = "ValidateFailed" + ClusterState_Validated ClusterState = "Validated" + ClusterState_Installing ClusterState = "Installing" + ClusterState_InstallFailed ClusterState = "InstallFailed" + ClusterState_Ready ClusterState = "Ready" + ClusterState_Upgrading ClusterState = "Upgrading" + ClusterState_UpgradeFailed ClusterState = "UpgradeFailed" + ClusterState_Uninstalling ClusterState = "Uninstalling" + ClusterState_UninstallFailed ClusterState = "UninstallFailed" + ClusterState_Deleting ClusterState = "Deleting" + ClusterState_DeleteFailed ClusterState = "DeleteFailed" + ClusterState_Deleted ClusterState = "Deleted" + ClusterState_PermanentError ClusterState = "PermanentError" + CaState_Connected CaState = "Connected" + CaState_Connecting CaState = "Connecting" + CaState_Error CaState = "Error" + CaState_Unknown CaState = "Unknown" + ComponentState_Unknown ComponentState = "Unknown" + ComponentState_Healthy ComponentState = "Healthy" + ComponentState_Unhealthy ComponentState = "Unhealthy" + ApplicationState_NotInstalled ApplicationState = "NotInstalled" + ApplicationState_Installing ApplicationState = "Installing" + ApplicationState_InstallFailed ApplicationState = "InstallFailed" + ApplicationState_InstallComplete ApplicationState = "InstallComplete" + ApplicationState_Uninstalling ApplicationState = "Uninstalling" + ApplicationState_UninstallFailed ApplicationState = "UninstallFailed" + ApplicationState_Healthy ApplicationState = "Healthy" + ApplicationState_Unhealthy ApplicationState = "Unhealthy" + ApplicationState_Upgrading ApplicationState = "Upgrading" + ApplicationState_UpgradeFailed ApplicationState = "UpgradeFailed" + ApplicationState_UpgradeAvailable ApplicationState = "UpgradeAvailable" + ApplicationState_UpgradeComplete ApplicationState = "UpgradeComplete" + ApplicationState_RollbackAvailable ApplicationState = "RollbackAvailable" + ApplicationState_RollbackComplete ApplicationState = "RollbackComplete" + ApplicationState_RollbackFailed ApplicationState = "RollbackFailed" + ApplicationState_RollingBack ApplicationState = "RollingBack" + LogTypeAgent LogType = "Agent" + LogTypeServiceMesh LogType = "ServiceMesh" + LogTypeSidecar LogType = "Sidecar" + LogTypeDNS LogType = "DNS" + LogTypePlatform LogType = "Platform" + ProxyProtocol_HTTPS ProxyProtocol = "HTTPS" + ProxyProtocol_HTTP ProxyProtocol = "HTTP" + ProxyType_Explicit ProxyType = "Explicit" + ProxyType_Transparent ProxyType = "Transparent" + MatchFunction_EXACT MatchFunction = "EXACT" + MatchFunction_START_WITH MatchFunction = "START_WITH" + StringMatchType_Exact StringMatchType = "Exact" + StringMatchType_Prefix StringMatchType = "Prefix" + StringMatchType_RegularExpression StringMatchType = "RegularExpression" + StringMatchType_ImplementationSpecific StringMatchType = "ImplementationSpecific" + RoutingProtocolType_HTTP RoutingProtocolType = "HTTP" + RoutingProtocolType_HTTPS RoutingProtocolType = "HTTPS" + RoutingProtocolType_TLS RoutingProtocolType = "TLS" + RoutingProtocolType_TCP RoutingProtocolType = "TCP" + GnsACPMatchMethod_GET GnsACPMatchMethod = "GET" + GnsACPMatchMethod_HEAD GnsACPMatchMethod = "HEAD" + GnsACPMatchMethod_POST GnsACPMatchMethod = "POST" + GnsACPMatchMethod_PUT GnsACPMatchMethod = "PUT" + GnsACPMatchMethod_DELETE GnsACPMatchMethod = "DELETE" + GnsACPMatchMethod_CONNECT GnsACPMatchMethod = "CONNECT" + GnsACPMatchMethod_OPTIONS GnsACPMatchMethod = "OPTIONS" + GnsACPMatchMethod_TRACE GnsACPMatchMethod = "TRACE" + GnsACPMatchMethod_PATCH GnsACPMatchMethod = "PATCH" + // Check is enabled + Enabled Mode = "ENABLED" + // Check is disabled + Disabled = "DISABLED" + HealthCheckConfigProtocol_HTTP HealthCheckConfigProtocol = "HTTP" + HealthCheckConfigProtocol_HTTPS HealthCheckConfigProtocol = "HTTPS" + HealthCheckConfigProtocol_TCP HealthCheckConfigProtocol = "TCP" + HealthCheckConfigProtocol_UNKNOWN HealthCheckConfigProtocol = "UNKNOWN" + PeerAuthentication_MutualTLS_UNSET PeerAuthentication_MutualTLS_Mode = 0 + PeerAuthentication_MutualTLS_DISABLE PeerAuthentication_MutualTLS_Mode = 1 + PeerAuthentication_MutualTLS_PERMISSIVE PeerAuthentication_MutualTLS_Mode = 2 + PeerAuthentication_MutualTLS_STRICT PeerAuthentication_MutualTLS_Mode = 3 + JobType_Create JobType = "Create" + JobType_Update JobType = "Update" + JobType_Delete JobType = "Delete" + NotStarted JobState = "NotStarted" + Deleted JobState = "Deleted" + Started JobState = "Started" + Restarted JobState = "Restarted" + Failed JobState = "Failed" + Aborted JobState = "Aborted" + Completed JobState = "Completed" + PolicyActionType_Allow PolicyActionType = "ALLOW" + PolicyActionType_Deny PolicyActionType = "DENY" + PolicyActionType_Log PolicyActionType = "LOG" + PolicyActionType_Mirror PolicyActionType = "MIRROR" + NOT_STARTED ProgressiveUpgradeState = iota + IN_PROGRESS + PAUSED + COMPLETED + OK ProgressiveUpgradeSubstate = iota + ERROR + InboundMode_Inherit InboundMode = "INHERIT" + InboundMode_Disable InboundMode = "DISABLE" + InboundMode_Permissive InboundMode = "PERMISSIVE" + InboundMode_Strict InboundMode = "STRICT" + OutboundMode_Mutual_Using_User_Provided_Certs OutboundMode = "MUTUAL_USING_USER_PROVIDED_CERTS" + OutboundMode_Simple OutboundMode = "SIMPLE" + OutboundMode_Disable OutboundMode = "DISABLE" + OutboundMode_Mutual_Using_Internal_Certs OutboundMode = "MUTUAL_USING_INTERNAL_CERTS" + HAType_BASIC HAType = "BASIC" + ServiceLevelIndicationMetricName_UNKNOWN ServiceLevelIndicationMetricName = "UNKNOWN" + ServiceLevelIndicationMetricName_P50LATENCY ServiceLevelIndicationMetricName = "p50LATENCY" + ServiceLevelIndicationMetricName_P90LATENCY ServiceLevelIndicationMetricName = "p90LATENCY" + ServiceLevelIndicationMetricName_P99LATENCY ServiceLevelIndicationMetricName = "p99LATENCY" + ServiceLevelIndicationMetricName_ERRORRATE ServiceLevelIndicationMetricName = "ERRORRATE" +) diff --git a/compiler/example/output/generated/apis/custom.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go b/compiler/example/output/generated/apis/custom.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go new file mode 100644 index 000000000..bc1b1e771 --- /dev/null +++ b/compiler/example/output/generated/apis/custom.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go @@ -0,0 +1,5533 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +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 deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + v1alpha1 "istio.io/api/authentication/v1alpha1" + v1alpha3 "istio.io/api/networking/v1alpha3" + appsv1 "k8s.io/api/apps/v1" + batchv1 "k8s.io/api/batch/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIAsyncWorkerLimits) DeepCopyInto(out *APIAsyncWorkerLimits) { + *out = *in + if in.TotalMemory != nil { + in, out := &in.TotalMemory, &out.TotalMemory + *out = new(int) + **out = **in + } + if in.ThroughputLimitingWindow != nil { + in, out := &in.ThroughputLimitingWindow, &out.ThroughputLimitingWindow + *out = new(int) + **out = **in + } + if in.TransactionsPerWindow != nil { + in, out := &in.TransactionsPerWindow, &out.TransactionsPerWindow + *out = new(int) + **out = **in + } + if in.BytesPerWindow != nil { + in, out := &in.BytesPerWindow, &out.BytesPerWindow + *out = new(int) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIAsyncWorkerLimits. +func (in *APIAsyncWorkerLimits) DeepCopy() *APIAsyncWorkerLimits { + if in == nil { + return nil + } + out := new(APIAsyncWorkerLimits) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIDiscoveryAppConfig) DeepCopyInto(out *APIDiscoveryAppConfig) { + *out = *in + if in.SchemaFlushIntervals != nil { + in, out := &in.SchemaFlushIntervals, &out.SchemaFlushIntervals + *out = new(int) + **out = **in + } + if in.EnableAsyncReporting != nil { + in, out := &in.EnableAsyncReporting, &out.EnableAsyncReporting + *out = new(bool) + **out = **in + } + if in.GroupBy != nil { + in, out := &in.GroupBy, &out.GroupBy + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.UseDefaultGrouping != nil { + in, out := &in.UseDefaultGrouping, &out.UseDefaultGrouping + *out = new(bool) + **out = **in + } + if in.BranchingLimit != nil { + in, out := &in.BranchingLimit, &out.BranchingLimit + *out = new(int) + **out = **in + } + if in.SchemaUpdateSendDelayMs != nil { + in, out := &in.SchemaUpdateSendDelayMs, &out.SchemaUpdateSendDelayMs + *out = new(int) + **out = **in + } + if in.APIMimeConfig != nil { + in, out := &in.APIMimeConfig, &out.APIMimeConfig + *out = new(APIMimeConfig) + (*in).DeepCopyInto(*out) + } + if in.WhitelistedResponseCodes != nil { + in, out := &in.WhitelistedResponseCodes, &out.WhitelistedResponseCodes + *out = make([]int, len(*in)) + copy(*out, *in) + } + if in.Limits != nil { + in, out := &in.Limits, &out.Limits + *out = new(APIAsyncWorkerLimits) + (*in).DeepCopyInto(*out) + } + if in.CacheMemoryLimit != nil { + in, out := &in.CacheMemoryLimit, &out.CacheMemoryLimit + *out = new(int) + **out = **in + } + if in.Hostnames != nil { + in, out := &in.Hostnames, &out.Hostnames + *out = make([]ConfigDedup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.EnableSquashing != nil { + in, out := &in.EnableSquashing, &out.EnableSquashing + *out = new(bool) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIDiscoveryAppConfig. +func (in *APIDiscoveryAppConfig) DeepCopy() *APIDiscoveryAppConfig { + if in == nil { + return nil + } + out := new(APIDiscoveryAppConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIDiscoveryIsEndpointApiPrechecks) DeepCopyInto(out *APIDiscoveryIsEndpointApiPrechecks) { + *out = *in + if in.ProtocolVersions != nil { + in, out := &in.ProtocolVersions, &out.ProtocolVersions + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Methods != nil { + in, out := &in.Methods, &out.Methods + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ContentTypes != nil { + in, out := &in.ContentTypes, &out.ContentTypes + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.PathExtensions != nil { + in, out := &in.PathExtensions, &out.PathExtensions + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.MaxRequestBufferSize != nil { + in, out := &in.MaxRequestBufferSize, &out.MaxRequestBufferSize + *out = new(uint64) + **out = **in + } + if in.MaxResponseBufferSize != nil { + in, out := &in.MaxResponseBufferSize, &out.MaxResponseBufferSize + *out = new(uint64) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIDiscoveryIsEndpointApiPrechecks. +func (in *APIDiscoveryIsEndpointApiPrechecks) DeepCopy() *APIDiscoveryIsEndpointApiPrechecks { + if in == nil { + return nil + } + out := new(APIDiscoveryIsEndpointApiPrechecks) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIDiscoveryProcessingToggles) DeepCopyInto(out *APIDiscoveryProcessingToggles) { + *out = *in + if in.RequestHeaderParameters != nil { + in, out := &in.RequestHeaderParameters, &out.RequestHeaderParameters + *out = new(bool) + **out = **in + } + if in.ResponseHeaderParameters != nil { + in, out := &in.ResponseHeaderParameters, &out.ResponseHeaderParameters + *out = new(bool) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIDiscoveryProcessingToggles. +func (in *APIDiscoveryProcessingToggles) DeepCopy() *APIDiscoveryProcessingToggles { + if in == nil { + return nil + } + out := new(APIDiscoveryProcessingToggles) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIMimeConfig) DeepCopyInto(out *APIMimeConfig) { + *out = *in + if in.IgnoredMime != nil { + in, out := &in.IgnoredMime, &out.IgnoredMime + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIMimeConfig. +func (in *APIMimeConfig) DeepCopy() *APIMimeConfig { + if in == nil { + return nil + } + out := new(APIMimeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ASLabels) DeepCopyInto(out *ASLabels) { + { + in := &in + *out = make(ASLabels, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ASLabels. +func (in ASLabels) DeepCopy() ASLabels { + if in == nil { + return nil + } + out := new(ASLabels) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ApiDiscoveryApplicationConfigList) DeepCopyInto(out *ApiDiscoveryApplicationConfigList) { + { + in := &in + *out = make(ApiDiscoveryApplicationConfigList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApiDiscoveryApplicationConfigList. +func (in ApiDiscoveryApplicationConfigList) DeepCopy() ApiDiscoveryApplicationConfigList { + if in == nil { + return nil + } + out := new(ApiDiscoveryApplicationConfigList) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApiDiscoveryClusterResourceSelectorRT) DeepCopyInto(out *ApiDiscoveryClusterResourceSelectorRT) { + *out = *in + if in.Services != nil { + in, out := &in.Services, &out.Services + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ServiceGroup != nil { + in, out := &in.ServiceGroup, &out.ServiceGroup + *out = make([]GnsServiceGroupSpec, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApiDiscoveryClusterResourceSelectorRT. +func (in *ApiDiscoveryClusterResourceSelectorRT) DeepCopy() *ApiDiscoveryClusterResourceSelectorRT { + if in == nil { + return nil + } + out := new(ApiDiscoveryClusterResourceSelectorRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApiDiscoveryConfig) DeepCopyInto(out *ApiDiscoveryConfig) { + *out = *in + in.Selectors.DeepCopyInto(&out.Selectors) + if in.Application != nil { + in, out := &in.Application, &out.Application + *out = make(ApiDiscoveryApplicationConfigList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.IsEndpointApiPrechecks.DeepCopyInto(&out.IsEndpointApiPrechecks) + in.ProcessingToggles.DeepCopyInto(&out.ProcessingToggles) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApiDiscoveryConfig. +func (in *ApiDiscoveryConfig) DeepCopy() *ApiDiscoveryConfig { + if in == nil { + return nil + } + out := new(ApiDiscoveryConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Application) DeepCopyInto(out *Application) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Application. +func (in *Application) DeepCopy() *Application { + if in == nil { + return nil + } + out := new(Application) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApplicationInstance) DeepCopyInto(out *ApplicationInstance) { + *out = *in + if in.UpgradeableVersions != nil { + in, out := &in.UpgradeableVersions, &out.UpgradeableVersions + *out = make([]UpgradeableVersion, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationInstance. +func (in *ApplicationInstance) DeepCopy() *ApplicationInstance { + if in == nil { + return nil + } + out := new(ApplicationInstance) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApplicationStatus) DeepCopyInto(out *ApplicationStatus) { + *out = *in + if in.AvailableVersions != nil { + in, out := &in.AvailableVersions, &out.AvailableVersions + *out = make(Versions, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationStatus. +func (in *ApplicationStatus) DeepCopy() *ApplicationStatus { + if in == nil { + return nil + } + out := new(ApplicationStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttackDiscoveryAppConfig) DeepCopyInto(out *AttackDiscoveryAppConfig) { + *out = *in + if in.AuditLogEnable != nil { + in, out := &in.AuditLogEnable, &out.AuditLogEnable + *out = new(bool) + **out = **in + } + if in.CacheConfig != nil { + in, out := &in.CacheConfig, &out.CacheConfig + *out = new(CacheConfig) + (*in).DeepCopyInto(*out) + } + if in.MaxMatchedDataSize != nil { + in, out := &in.MaxMatchedDataSize, &out.MaxMatchedDataSize + *out = new(int) + **out = **in + } + if in.ParanoiaLevel != nil { + in, out := &in.ParanoiaLevel, &out.ParanoiaLevel + *out = new(int) + **out = **in + } + if in.RulesGroups != nil { + in, out := &in.RulesGroups, &out.RulesGroups + *out = make([]*RulesGroup, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(RulesGroup) + (*in).DeepCopyInto(*out) + } + } + } + if in.PreConditions != nil { + in, out := &in.PreConditions, &out.PreConditions + *out = new(GnsSegmentationPolicyPreConditions) + (*in).DeepCopyInto(*out) + } + if in.Process != nil { + in, out := &in.Process, &out.Process + *out = new(ProcessingToggles) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttackDiscoveryAppConfig. +func (in *AttackDiscoveryAppConfig) DeepCopy() *AttackDiscoveryAppConfig { + if in == nil { + return nil + } + out := new(AttackDiscoveryAppConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in AttackDiscoveryApplicationConfigList) DeepCopyInto(out *AttackDiscoveryApplicationConfigList) { + { + in := &in + *out = make(AttackDiscoveryApplicationConfigList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttackDiscoveryApplicationConfigList. +func (in AttackDiscoveryApplicationConfigList) DeepCopy() AttackDiscoveryApplicationConfigList { + if in == nil { + return nil + } + out := new(AttackDiscoveryApplicationConfigList) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttackDiscoveryClusterResourceSelectorRT) DeepCopyInto(out *AttackDiscoveryClusterResourceSelectorRT) { + *out = *in + if in.Services != nil { + in, out := &in.Services, &out.Services + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ServiceGroup != nil { + in, out := &in.ServiceGroup, &out.ServiceGroup + *out = make([]GnsServiceGroupSpec, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttackDiscoveryClusterResourceSelectorRT. +func (in *AttackDiscoveryClusterResourceSelectorRT) DeepCopy() *AttackDiscoveryClusterResourceSelectorRT { + if in == nil { + return nil + } + out := new(AttackDiscoveryClusterResourceSelectorRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttackDiscoveryConfig) DeepCopyInto(out *AttackDiscoveryConfig) { + *out = *in + in.Selectors.DeepCopyInto(&out.Selectors) + if in.Application != nil { + in, out := &in.Application, &out.Application + *out = make(AttackDiscoveryApplicationConfigList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttackDiscoveryConfig. +func (in *AttackDiscoveryConfig) DeepCopy() *AttackDiscoveryConfig { + if in == nil { + return nil + } + out := new(AttackDiscoveryConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttributeValue) DeepCopyInto(out *AttributeValue) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttributeValue. +func (in *AttributeValue) DeepCopy() *AttributeValue { + if in == nil { + return nil + } + out := new(AttributeValue) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoInstallServiceMeshConfig) DeepCopyInto(out *AutoInstallServiceMeshConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoInstallServiceMeshConfig. +func (in *AutoInstallServiceMeshConfig) DeepCopy() *AutoInstallServiceMeshConfig { + if in == nil { + return nil + } + out := new(AutoInstallServiceMeshConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BaseCheck) DeepCopyInto(out *BaseCheck) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Confidence != nil { + in, out := &in.Confidence, &out.Confidence + *out = new(uint32) + **out = **in + } + if in.QueryName != nil { + in, out := &in.QueryName, &out.QueryName + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BaseCheck. +func (in *BaseCheck) DeepCopy() *BaseCheck { + if in == nil { + return nil + } + out := new(BaseCheck) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CaLabel) DeepCopyInto(out *CaLabel) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaLabel. +func (in *CaLabel) DeepCopy() *CaLabel { + if in == nil { + return nil + } + out := new(CaLabel) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in CaLabels) DeepCopyInto(out *CaLabels) { + { + in := &in + *out = make(CaLabels, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaLabels. +func (in CaLabels) DeepCopy() CaLabels { + if in == nil { + return nil + } + out := new(CaLabels) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CaStatus) DeepCopyInto(out *CaStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaStatus. +func (in *CaStatus) DeepCopy() *CaStatus { + if in == nil { + return nil + } + out := new(CaStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in CaStatusHistory) DeepCopyInto(out *CaStatusHistory) { + { + in := &in + *out = make(CaStatusHistory, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaStatusHistory. +func (in CaStatusHistory) DeepCopy() CaStatusHistory { + if in == nil { + return nil + } + out := new(CaStatusHistory) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CaSyncStatus) DeepCopyInto(out *CaSyncStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaSyncStatus. +func (in *CaSyncStatus) DeepCopy() *CaSyncStatus { + if in == nil { + return nil + } + out := new(CaSyncStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CacheConfig) DeepCopyInto(out *CacheConfig) { + *out = *in + if in.QueryParamsMatches != nil { + in, out := &in.QueryParamsMatches, &out.QueryParamsMatches + *out = make([]QueryParamsMatch, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CacheConfig. +func (in *CacheConfig) DeepCopy() *CacheConfig { + if in == nil { + return nil + } + out := new(CacheConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Center) DeepCopyInto(out *Center) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Center. +func (in *Center) DeepCopy() *Center { + if in == nil { + return nil + } + out := new(Center) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertRequestStatus) DeepCopyInto(out *CertRequestStatus) { + *out = *in + if in.conditions != nil { + in, out := &in.conditions, &out.conditions + *out = make(StatusConditions, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertRequestStatus. +func (in *CertRequestStatus) DeepCopy() *CertRequestStatus { + if in == nil { + return nil + } + out := new(CertRequestStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertStatus) DeepCopyInto(out *CertStatus) { + *out = *in + if in.conditions != nil { + in, out := &in.conditions, &out.conditions + *out = make(StatusConditions, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertStatus. +func (in *CertStatus) DeepCopy() *CertStatus { + if in == nil { + return nil + } + out := new(CertStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateAuthorityConfig) DeepCopyInto(out *CertificateAuthorityConfig) { + *out = *in + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make([]CaLabel, len(*in)) + copy(*out, *in) + } + out.Venafi = in.Venafi + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateAuthorityConfig. +func (in *CertificateAuthorityConfig) DeepCopy() *CertificateAuthorityConfig { + if in == nil { + return nil + } + out := new(CertificateAuthorityConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateAuthorityConfigWithId) DeepCopyInto(out *CertificateAuthorityConfigWithId) { + *out = *in + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make([]CaLabel, len(*in)) + copy(*out, *in) + } + out.Venafi = in.Venafi + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateAuthorityConfigWithId. +func (in *CertificateAuthorityConfigWithId) DeepCopy() *CertificateAuthorityConfigWithId { + if in == nil { + return nil + } + out := new(CertificateAuthorityConfigWithId) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateConfig) DeepCopyInto(out *CertificateConfig) { + *out = *in + out.ManagedCertificate = in.ManagedCertificate + out.UnManagedCertificate = in.UnManagedCertificate + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateConfig. +func (in *CertificateConfig) DeepCopy() *CertificateConfig { + if in == nil { + return nil + } + out := new(CertificateConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateDetails) DeepCopyInto(out *CertificateDetails) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateDetails. +func (in *CertificateDetails) DeepCopy() *CertificateDetails { + if in == nil { + return nil + } + out := new(CertificateDetails) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateStatus) DeepCopyInto(out *CertificateStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateStatus. +func (in *CertificateStatus) DeepCopy() *CertificateStatus { + if in == nil { + return nil + } + out := new(CertificateStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Check) DeepCopyInto(out *Check) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Confidence != nil { + in, out := &in.Confidence, &out.Confidence + *out = new(uint32) + **out = **in + } + if in.Proximity != nil { + in, out := &in.Proximity, &out.Proximity + *out = new(uint32) + **out = **in + } + if in.Function != nil { + in, out := &in.Function, &out.Function + *out = new(CheckFunction) + **out = **in + } + if in.Mandatory != nil { + in, out := &in.Mandatory, &out.Mandatory + *out = new(bool) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Check. +func (in *Check) DeepCopy() *Check { + if in == nil { + return nil + } + out := new(Check) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CheckFunction) DeepCopyInto(out *CheckFunction) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CheckFunction. +func (in *CheckFunction) DeepCopy() *CheckFunction { + if in == nil { + return nil + } + out := new(CheckFunction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Child) DeepCopyInto(out *Child) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Child. +func (in *Child) DeepCopy() *Child { + if in == nil { + return nil + } + out := new(Child) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterIDs) DeepCopyInto(out *ClusterIDs) { + *out = *in + if in.Ids != nil { + in, out := &in.Ids, &out.Ids + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterIDs. +func (in *ClusterIDs) DeepCopy() *ClusterIDs { + if in == nil { + return nil + } + out := new(ClusterIDs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterList) DeepCopyInto(out *ClusterList) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. +func (in *ClusterList) DeepCopy() *ClusterList { + if in == nil { + return nil + } + out := new(ClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterResourceSelectorRT) DeepCopyInto(out *ClusterResourceSelectorRT) { + *out = *in + if in.Services != nil { + in, out := &in.Services, &out.Services + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ServiceGroup != nil { + in, out := &in.ServiceGroup, &out.ServiceGroup + *out = make([]GnsServiceGroupSpec, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceSelectorRT. +func (in *ClusterResourceSelectorRT) DeepCopy() *ClusterResourceSelectorRT { + if in == nil { + return nil + } + out := new(ClusterResourceSelectorRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { + *out = *in + out.Metadata = in.Metadata + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus. +func (in *ClusterStatus) DeepCopy() *ClusterStatus { + if in == nil { + return nil + } + out := new(ClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ClusterStatusHistory) DeepCopyInto(out *ClusterStatusHistory) { + { + in := &in + *out = make(ClusterStatusHistory, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatusHistory. +func (in ClusterStatusHistory) DeepCopy() ClusterStatusHistory { + if in == nil { + return nil + } + out := new(ClusterStatusHistory) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterStatusMetadata) DeepCopyInto(out *ClusterStatusMetadata) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatusMetadata. +func (in *ClusterStatusMetadata) DeepCopy() *ClusterStatusMetadata { + if in == nil { + return nil + } + out := new(ClusterStatusMetadata) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterSyncStatus) DeepCopyInto(out *ClusterSyncStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSyncStatus. +func (in *ClusterSyncStatus) DeepCopy() *ClusterSyncStatus { + if in == nil { + return nil + } + out := new(ClusterSyncStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComponentStatus) DeepCopyInto(out *ComponentStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentStatus. +func (in *ComponentStatus) DeepCopy() *ComponentStatus { + if in == nil { + return nil + } + out := new(ComponentStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComponentStatuses) DeepCopyInto(out *ComponentStatuses) { + *out = *in + if in.Statuses != nil { + in, out := &in.Statuses, &out.Statuses + *out = make([]ComponentStatus, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentStatuses. +func (in *ComponentStatuses) DeepCopy() *ComponentStatuses { + if in == nil { + return nil + } + out := new(ComponentStatuses) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ComponentStatusesHistory) DeepCopyInto(out *ComponentStatusesHistory) { + { + in := &in + *out = make(ComponentStatusesHistory, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentStatusesHistory. +func (in ComponentStatusesHistory) DeepCopy() ComponentStatusesHistory { + if in == nil { + return nil + } + out := new(ComponentStatusesHistory) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition) DeepCopyInto(out *Condition) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. +func (in *Condition) DeepCopy() *Condition { + if in == nil { + return nil + } + out := new(Condition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Conditions) DeepCopyInto(out *Conditions) { + { + in := &in + *out = make(Conditions, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Conditions. +func (in Conditions) DeepCopy() Conditions { + if in == nil { + return nil + } + out := new(Conditions) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigDedup) DeepCopyInto(out *ConfigDedup) { + *out = *in + if in.SegmentRegex != nil { + in, out := &in.SegmentRegex, &out.SegmentRegex + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.PathTemplate != nil { + in, out := &in.PathTemplate, &out.PathTemplate + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigDedup. +func (in *ConfigDedup) DeepCopy() *ConfigDedup { + if in == nil { + return nil + } + out := new(ConfigDedup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CronJobSpec) DeepCopyInto(out *CronJobSpec) { + *out = *in + if in.StartingDeadlineSeconds != nil { + in, out := &in.StartingDeadlineSeconds, &out.StartingDeadlineSeconds + *out = new(int64) + **out = **in + } + if in.Suspend != nil { + in, out := &in.Suspend, &out.Suspend + *out = new(bool) + **out = **in + } + in.JobTemplate.DeepCopyInto(&out.JobTemplate) + if in.SuccessfulJobsHistoryLimit != nil { + in, out := &in.SuccessfulJobsHistoryLimit, &out.SuccessfulJobsHistoryLimit + *out = new(int32) + **out = **in + } + if in.FailedJobsHistoryLimit != nil { + in, out := &in.FailedJobsHistoryLimit, &out.FailedJobsHistoryLimit + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CronJobSpec. +func (in *CronJobSpec) DeepCopy() *CronJobSpec { + if in == nil { + return nil + } + out := new(CronJobSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CronJobStatus) DeepCopyInto(out *CronJobStatus) { + *out = *in + if in.Active != nil { + in, out := &in.Active, &out.Active + *out = make([]corev1.ObjectReference, len(*in)) + copy(*out, *in) + } + if in.LastScheduleTime != nil { + in, out := &in.LastScheduleTime, &out.LastScheduleTime + *out = (*in).DeepCopy() + } + if in.LastSuccessfulTime != nil { + in, out := &in.LastSuccessfulTime, &out.LastSuccessfulTime + *out = (*in).DeepCopy() + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CronJobStatus. +func (in *CronJobStatus) DeepCopy() *CronJobStatus { + if in == nil { + return nil + } + out := new(CronJobStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CurrentVersion) DeepCopyInto(out *CurrentVersion) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CurrentVersion. +func (in *CurrentVersion) DeepCopy() *CurrentVersion { + if in == nil { + return nil + } + out := new(CurrentVersion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DLPConfig) DeepCopyInto(out *DLPConfig) { + *out = *in + if in.MatchingPolicy != nil { + in, out := &in.MatchingPolicy, &out.MatchingPolicy + *out = new(DLPMatch) + (*in).DeepCopyInto(*out) + } + if in.PatternDatabase != nil { + in, out := &in.PatternDatabase, &out.PatternDatabase + *out = new(PatternDatabase) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DLPConfig. +func (in *DLPConfig) DeepCopy() *DLPConfig { + if in == nil { + return nil + } + out := new(DLPConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DLPMatch) DeepCopyInto(out *DLPMatch) { + *out = *in + if in.PatternGroups != nil { + in, out := &in.PatternGroups, &out.PatternGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Patterns != nil { + in, out := &in.Patterns, &out.Patterns + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DLPMatch. +func (in *DLPMatch) DeepCopy() *DLPMatch { + if in == nil { + return nil + } + out := new(DLPMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in DMSet) DeepCopyInto(out *DMSet) { + { + in := &in + *out = make(DMSet, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DMSet. +func (in DMSet) DeepCopy() DMSet { + if in == nil { + return nil + } + out := new(DMSet) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in DNSList) DeepCopyInto(out *DNSList) { + { + in := &in + *out = make(DNSList, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSList. +func (in DNSList) DeepCopy() DNSList { + if in == nil { + return nil + } + out := new(DNSList) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DaemonSetSpec) DeepCopyInto(out *DaemonSetSpec) { + *out = *in + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } + in.Template.DeepCopyInto(&out.Template) + in.UpdateStrategy.DeepCopyInto(&out.UpdateStrategy) + if in.RevisionHistoryLimit != nil { + in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DaemonSetSpec. +func (in *DaemonSetSpec) DeepCopy() *DaemonSetSpec { + if in == nil { + return nil + } + out := new(DaemonSetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DaemonSetStatus) DeepCopyInto(out *DaemonSetStatus) { + *out = *in + if in.CollisionCount != nil { + in, out := &in.CollisionCount, &out.CollisionCount + *out = new(int32) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]appsv1.DaemonSetCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DaemonSetStatus. +func (in *DaemonSetStatus) DeepCopy() *DaemonSetStatus { + if in == nil { + return nil + } + out := new(DaemonSetStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec) { + *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } + in.Template.DeepCopyInto(&out.Template) + in.Strategy.DeepCopyInto(&out.Strategy) + if in.RevisionHistoryLimit != nil { + in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit + *out = new(int32) + **out = **in + } + if in.ProgressDeadlineSeconds != nil { + in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentSpec. +func (in *DeploymentSpec) DeepCopy() *DeploymentSpec { + if in == nil { + return nil + } + out := new(DeploymentSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]appsv1.DeploymentCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CollisionCount != nil { + in, out := &in.CollisionCount, &out.CollisionCount + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentStatus. +func (in *DeploymentStatus) DeepCopy() *DeploymentStatus { + if in == nil { + return nil + } + out := new(DeploymentStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in EndpointSubsets) DeepCopyInto(out *EndpointSubsets) { + { + in := &in + *out = make(EndpointSubsets, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointSubsets. +func (in EndpointSubsets) DeepCopy() EndpointSubsets { + if in == nil { + return nil + } + out := new(EndpointSubsets) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EnvoyFilterSpec) DeepCopyInto(out *EnvoyFilterSpec) { + *out = *in + in.state.DeepCopyInto(&out.state) + if in.unknownFields != nil { + in, out := &in.unknownFields, &out.unknownFields + *out = make([]byte, len(*in)) + copy(*out, *in) + } + if in.WorkloadSelector != nil { + in, out := &in.WorkloadSelector, &out.WorkloadSelector + *out = (*in).DeepCopy() + } + if in.ConfigPatches != nil { + in, out := &in.ConfigPatches, &out.ConfigPatches + *out = make([]*v1alpha3.EnvoyFilter_EnvoyConfigObjectPatch, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = (*in).DeepCopy() + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilterSpec. +func (in *EnvoyFilterSpec) DeepCopy() *EnvoyFilterSpec { + if in == nil { + return nil + } + out := new(EnvoyFilterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfigListener) DeepCopyInto(out *GatewayConfigListener) { + *out = *in + if in.Hosts != nil { + in, out := &in.Hosts, &out.Hosts + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.RoutingRules != nil { + in, out := &in.RoutingRules, &out.RoutingRules + *out = make([]GatewayRoutingRule, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfigListener. +func (in *GatewayConfigListener) DeepCopy() *GatewayConfigListener { + if in == nil { + return nil + } + out := new(GatewayConfigListener) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in GatewayConfigListeners) DeepCopyInto(out *GatewayConfigListeners) { + { + in := &in + *out = make(GatewayConfigListeners, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfigListeners. +func (in GatewayConfigListeners) DeepCopy() GatewayConfigListeners { + if in == nil { + return nil + } + out := new(GatewayConfigListeners) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayRoutingRule) DeepCopyInto(out *GatewayRoutingRule) { + *out = *in + out.SniRoutingRule = in.SniRoutingRule + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayRoutingRule. +func (in *GatewayRoutingRule) DeepCopy() *GatewayRoutingRule { + if in == nil { + return nil + } + out := new(GatewayRoutingRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayRoutingRuleSNI) DeepCopyInto(out *GatewayRoutingRuleSNI) { + *out = *in + out.SniRoutingRule = in.SniRoutingRule + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayRoutingRuleSNI. +func (in *GatewayRoutingRuleSNI) DeepCopy() *GatewayRoutingRuleSNI { + if in == nil { + return nil + } + out := new(GatewayRoutingRuleSNI) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewaySpec) DeepCopyInto(out *GatewaySpec) { + *out = *in + in.state.DeepCopyInto(&out.state) + if in.unknownFields != nil { + in, out := &in.unknownFields, &out.unknownFields + *out = make([]byte, len(*in)) + copy(*out, *in) + } + if in.Servers != nil { + in, out := &in.Servers, &out.Servers + *out = make([]*v1alpha3.Server, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = (*in).DeepCopy() + } + } + } + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewaySpec. +func (in *GatewaySpec) DeepCopy() *GatewaySpec { + if in == nil { + return nil + } + out := new(GatewaySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GeoDiscoveryClusterResourceSelectorRT) DeepCopyInto(out *GeoDiscoveryClusterResourceSelectorRT) { + *out = *in + if in.Services != nil { + in, out := &in.Services, &out.Services + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ServiceGroup != nil { + in, out := &in.ServiceGroup, &out.ServiceGroup + *out = make([]GnsServiceGroupSpec, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GeoDiscoveryClusterResourceSelectorRT. +func (in *GeoDiscoveryClusterResourceSelectorRT) DeepCopy() *GeoDiscoveryClusterResourceSelectorRT { + if in == nil { + return nil + } + out := new(GeoDiscoveryClusterResourceSelectorRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GeoDiscoveryConfig) DeepCopyInto(out *GeoDiscoveryConfig) { + *out = *in + in.Selectors.DeepCopyInto(&out.Selectors) + if in.GeoFences != nil { + in, out := &in.GeoFences, &out.GeoFences + *out = make(GeoDiscoveryGeoFencesConfigList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GeoDiscoveryConfig. +func (in *GeoDiscoveryConfig) DeepCopy() *GeoDiscoveryConfig { + if in == nil { + return nil + } + out := new(GeoDiscoveryConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in GeoDiscoveryGeoFencesConfigList) DeepCopyInto(out *GeoDiscoveryGeoFencesConfigList) { + { + in := &in + *out = make(GeoDiscoveryGeoFencesConfigList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GeoDiscoveryGeoFencesConfigList. +func (in GeoDiscoveryGeoFencesConfigList) DeepCopy() GeoDiscoveryGeoFencesConfigList { + if in == nil { + return nil + } + out := new(GeoDiscoveryGeoFencesConfigList) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GeoMeta) DeepCopyInto(out *GeoMeta) { + *out = *in + if in.Center != nil { + in, out := &in.Center, &out.Center + *out = new(Center) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GeoMeta. +func (in *GeoMeta) DeepCopy() *GeoMeta { + if in == nil { + return nil + } + out := new(GeoMeta) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsACPPolicyMatch) DeepCopyInto(out *GnsACPPolicyMatch) { + *out = *in + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Hostname != nil { + in, out := &in.Hostname, &out.Hostname + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Path != nil { + in, out := &in.Path, &out.Path + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Method != nil { + in, out := &in.Method, &out.Method + *out = make([]GnsACPMatchMethod, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsACPPolicyMatch. +func (in *GnsACPPolicyMatch) DeepCopy() *GnsACPPolicyMatch { + if in == nil { + return nil + } + out := new(GnsACPPolicyMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsACPServiceGroup) DeepCopyInto(out *GnsACPServiceGroup) { + *out = *in + if in.ServiceGroup != nil { + in, out := &in.ServiceGroup, &out.ServiceGroup + *out = make([]GnsServiceGroupSpec, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsACPServiceGroup. +func (in *GnsACPServiceGroup) DeepCopy() *GnsACPServiceGroup { + if in == nil { + return nil + } + out := new(GnsACPServiceGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsAccessControlPolicySpec) DeepCopyInto(out *GnsAccessControlPolicySpec) { + *out = *in + in.Destination.DeepCopyInto(&out.Destination) + in.Source.DeepCopyInto(&out.Source) + if in.Match != nil { + in, out := &in.Match, &out.Match + *out = make([]GnsACPPolicyMatch, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsAccessControlPolicySpec. +func (in *GnsAccessControlPolicySpec) DeepCopy() *GnsAccessControlPolicySpec { + if in == nil { + return nil + } + out := new(GnsAccessControlPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSchemaViolationDiscoveryClusterResourceSelectorRT) DeepCopyInto(out *GnsSchemaViolationDiscoveryClusterResourceSelectorRT) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSchemaViolationDiscoveryClusterResourceSelectorRT. +func (in *GnsSchemaViolationDiscoveryClusterResourceSelectorRT) DeepCopy() *GnsSchemaViolationDiscoveryClusterResourceSelectorRT { + if in == nil { + return nil + } + out := new(GnsSchemaViolationDiscoveryClusterResourceSelectorRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSchemaViolationDiscoveryConfig) DeepCopyInto(out *GnsSchemaViolationDiscoveryConfig) { + *out = *in + out.Selectors = in.Selectors + out.OpenAPI = in.OpenAPI + if in.Toggles != nil { + in, out := &in.Toggles, &out.Toggles + *out = new(Toggles) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSchemaViolationDiscoveryConfig. +func (in *GnsSchemaViolationDiscoveryConfig) DeepCopy() *GnsSchemaViolationDiscoveryConfig { + if in == nil { + return nil + } + out := new(GnsSchemaViolationDiscoveryConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationAttackDefense) DeepCopyInto(out *GnsSegmentationAttackDefense) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(GnsSegmentationPolicyActionType) + (*in).DeepCopyInto(*out) + } + if in.Process != nil { + in, out := &in.Process, &out.Process + *out = new(GnsSegmentationPolicyProcessingToggles) + **out = **in + } + if in.Rules != nil { + in, out := &in.Rules, &out.Rules + *out = make([]*GnsSegmentationDefensePolicyRule, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(GnsSegmentationDefensePolicyRule) + (*in).DeepCopyInto(*out) + } + } + } + if in.PreconditionAction != nil { + in, out := &in.PreconditionAction, &out.PreconditionAction + *out = new(GnsSegmentationPolicyActionType) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationAttackDefense. +func (in *GnsSegmentationAttackDefense) DeepCopy() *GnsSegmentationAttackDefense { + if in == nil { + return nil + } + out := new(GnsSegmentationAttackDefense) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationDLPPolicy) DeepCopyInto(out *GnsSegmentationDLPPolicy) { + *out = *in + if in.DefaultAction != nil { + in, out := &in.DefaultAction, &out.DefaultAction + *out = new(GnsSegmentationPolicyActionType) + (*in).DeepCopyInto(*out) + } + if in.PiiActions != nil { + in, out := &in.PiiActions, &out.PiiActions + *out = make([]*GnsSegmentationPolicyPiiAction, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(GnsSegmentationPolicyPiiAction) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationDLPPolicy. +func (in *GnsSegmentationDLPPolicy) DeepCopy() *GnsSegmentationDLPPolicy { + if in == nil { + return nil + } + out := new(GnsSegmentationDLPPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationDefensePolicyRule) DeepCopyInto(out *GnsSegmentationDefensePolicyRule) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(GnsSegmentationPolicyActionType) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationDefensePolicyRule. +func (in *GnsSegmentationDefensePolicyRule) DeepCopy() *GnsSegmentationDefensePolicyRule { + if in == nil { + return nil + } + out := new(GnsSegmentationDefensePolicyRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationIngressApplication) DeepCopyInto(out *GnsSegmentationIngressApplication) { + *out = *in + if in.Hostname != nil { + in, out := &in.Hostname, &out.Hostname + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.UserID != nil { + in, out := &in.UserID, &out.UserID + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.UserAgent != nil { + in, out := &in.UserAgent, &out.UserAgent + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Headers != nil { + in, out := &in.Headers, &out.Headers + *out = make([]*GnsSegmentationPolicyHeadersMap, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(GnsSegmentationPolicyHeadersMap) + **out = **in + } + } + } + if in.Endpoint != nil { + in, out := &in.Endpoint, &out.Endpoint + *out = make([]*GnsSegmentationPolicyMatchEndpoint, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(GnsSegmentationPolicyMatchEndpoint) + **out = **in + } + } + } + if in.ServiceGroup != nil { + in, out := &in.ServiceGroup, &out.ServiceGroup + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SourceSelector != nil { + in, out := &in.SourceSelector, &out.SourceSelector + *out = new(GnsSegmentationSourceSelector) + (*in).DeepCopyInto(*out) + } + in.IngressFeatures.DeepCopyInto(&out.IngressFeatures) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationIngressApplication. +func (in *GnsSegmentationIngressApplication) DeepCopy() *GnsSegmentationIngressApplication { + if in == nil { + return nil + } + out := new(GnsSegmentationIngressApplication) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicyActionCode) DeepCopyInto(out *GnsSegmentationPolicyActionCode) { + *out = *in + if in.Code != nil { + in, out := &in.Code, &out.Code + *out = new(uint32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicyActionCode. +func (in *GnsSegmentationPolicyActionCode) DeepCopy() *GnsSegmentationPolicyActionCode { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicyActionCode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicyActionEmpty) DeepCopyInto(out *GnsSegmentationPolicyActionEmpty) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicyActionEmpty. +func (in *GnsSegmentationPolicyActionEmpty) DeepCopy() *GnsSegmentationPolicyActionEmpty { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicyActionEmpty) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicyActionType) DeepCopyInto(out *GnsSegmentationPolicyActionType) { + *out = *in + if in.RateLimit != nil { + in, out := &in.RateLimit, &out.RateLimit + *out = new(GnsSegmentationRateLimitingPools) + (*in).DeepCopyInto(*out) + } + if in.Allow != nil { + in, out := &in.Allow, &out.Allow + *out = new(GnsSegmentationPolicyActionEmpty) + **out = **in + } + if in.Deny != nil { + in, out := &in.Deny, &out.Deny + *out = new(GnsSegmentationPolicyActionCode) + (*in).DeepCopyInto(*out) + } + if in.Skip != nil { + in, out := &in.Skip, &out.Skip + *out = new(GnsSegmentationPolicyActionEmpty) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicyActionType. +func (in *GnsSegmentationPolicyActionType) DeepCopy() *GnsSegmentationPolicyActionType { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicyActionType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicyHeadersMap) DeepCopyInto(out *GnsSegmentationPolicyHeadersMap) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicyHeadersMap. +func (in *GnsSegmentationPolicyHeadersMap) DeepCopy() *GnsSegmentationPolicyHeadersMap { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicyHeadersMap) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicyIngressFeatures) DeepCopyInto(out *GnsSegmentationPolicyIngressFeatures) { + *out = *in + if in.APISegmentation != nil { + in, out := &in.APISegmentation, &out.APISegmentation + *out = new(GnsSegmentationPolicyActionType) + (*in).DeepCopyInto(*out) + } + if in.PIISegmentation != nil { + in, out := &in.PIISegmentation, &out.PIISegmentation + *out = new(GnsSegmentationDLPPolicy) + (*in).DeepCopyInto(*out) + } + if in.RateLimit != nil { + in, out := &in.RateLimit, &out.RateLimit + *out = make([]*GnsSegmentationRateLimitingPools, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(GnsSegmentationRateLimitingPools) + (*in).DeepCopyInto(*out) + } + } + } + if in.AttackDefense != nil { + in, out := &in.AttackDefense, &out.AttackDefense + *out = new(GnsSegmentationAttackDefense) + (*in).DeepCopyInto(*out) + } + if in.SchemaValidation != nil { + in, out := &in.SchemaValidation, &out.SchemaValidation + *out = new(GnsSegmentationSchemaValidation) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicyIngressFeatures. +func (in *GnsSegmentationPolicyIngressFeatures) DeepCopy() *GnsSegmentationPolicyIngressFeatures { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicyIngressFeatures) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicyMatchEndpoint) DeepCopyInto(out *GnsSegmentationPolicyMatchEndpoint) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicyMatchEndpoint. +func (in *GnsSegmentationPolicyMatchEndpoint) DeepCopy() *GnsSegmentationPolicyMatchEndpoint { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicyMatchEndpoint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicyPiiAction) DeepCopyInto(out *GnsSegmentationPolicyPiiAction) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(GnsSegmentationPolicyActionType) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicyPiiAction. +func (in *GnsSegmentationPolicyPiiAction) DeepCopy() *GnsSegmentationPolicyPiiAction { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicyPiiAction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicyPreConditions) DeepCopyInto(out *GnsSegmentationPolicyPreConditions) { + *out = *in + if in.AllowedHTTPVersions != nil { + in, out := &in.AllowedHTTPVersions, &out.AllowedHTTPVersions + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AllowedHTTPMethods != nil { + in, out := &in.AllowedHTTPMethods, &out.AllowedHTTPMethods + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AllowedContentTypes != nil { + in, out := &in.AllowedContentTypes, &out.AllowedContentTypes + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ScannedContentTypes != nil { + in, out := &in.ScannedContentTypes, &out.ScannedContentTypes + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AllowedHTTPPathFileExtensions != nil { + in, out := &in.AllowedHTTPPathFileExtensions, &out.AllowedHTTPPathFileExtensions + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ForbiddenHTTPHeaders != nil { + in, out := &in.ForbiddenHTTPHeaders, &out.ForbiddenHTTPHeaders + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicyPreConditions. +func (in *GnsSegmentationPolicyPreConditions) DeepCopy() *GnsSegmentationPolicyPreConditions { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicyPreConditions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicyProcessingToggles) DeepCopyInto(out *GnsSegmentationPolicyProcessingToggles) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicyProcessingToggles. +func (in *GnsSegmentationPolicyProcessingToggles) DeepCopy() *GnsSegmentationPolicyProcessingToggles { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicyProcessingToggles) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicySpec) DeepCopyInto(out *GnsSegmentationPolicySpec) { + *out = *in + out.Selectors = in.Selectors + if in.RateLimitingPools != nil { + in, out := &in.RateLimitingPools, &out.RateLimitingPools + *out = make([]GnsSegmentationRateLimitingPoolMap, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Application != nil { + in, out := &in.Application, &out.Application + *out = make([]GnsSegmentationIngressApplication, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.Default.DeepCopyInto(&out.Default) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicySpec. +func (in *GnsSegmentationPolicySpec) DeepCopy() *GnsSegmentationPolicySpec { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationRateLimitingPool) DeepCopyInto(out *GnsSegmentationRateLimitingPool) { + *out = *in + if in.Limit != nil { + in, out := &in.Limit, &out.Limit + *out = new(uint64) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationRateLimitingPool. +func (in *GnsSegmentationRateLimitingPool) DeepCopy() *GnsSegmentationRateLimitingPool { + if in == nil { + return nil + } + out := new(GnsSegmentationRateLimitingPool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationRateLimitingPoolMap) DeepCopyInto(out *GnsSegmentationRateLimitingPoolMap) { + *out = *in + if in.Pool != nil { + in, out := &in.Pool, &out.Pool + *out = new(GnsSegmentationRateLimitingPool) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationRateLimitingPoolMap. +func (in *GnsSegmentationRateLimitingPoolMap) DeepCopy() *GnsSegmentationRateLimitingPoolMap { + if in == nil { + return nil + } + out := new(GnsSegmentationRateLimitingPoolMap) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationRateLimitingPoolSelector) DeepCopyInto(out *GnsSegmentationRateLimitingPoolSelector) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationRateLimitingPoolSelector. +func (in *GnsSegmentationRateLimitingPoolSelector) DeepCopy() *GnsSegmentationRateLimitingPoolSelector { + if in == nil { + return nil + } + out := new(GnsSegmentationRateLimitingPoolSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationRateLimitingPools) DeepCopyInto(out *GnsSegmentationRateLimitingPools) { + *out = *in + if in.Pools != nil { + in, out := &in.Pools, &out.Pools + *out = make([]*GnsSegmentationRateLimitingPoolSelector, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(GnsSegmentationRateLimitingPoolSelector) + **out = **in + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationRateLimitingPools. +func (in *GnsSegmentationRateLimitingPools) DeepCopy() *GnsSegmentationRateLimitingPools { + if in == nil { + return nil + } + out := new(GnsSegmentationRateLimitingPools) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationSchemaValidation) DeepCopyInto(out *GnsSegmentationSchemaValidation) { + *out = *in + if in.ViolationAction != nil { + in, out := &in.ViolationAction, &out.ViolationAction + *out = new(GnsSegmentationPolicyActionType) + (*in).DeepCopyInto(*out) + } + if in.PathParametersSchemaViolation != nil { + in, out := &in.PathParametersSchemaViolation, &out.PathParametersSchemaViolation + *out = new(GnsSegmentationPolicyActionType) + (*in).DeepCopyInto(*out) + } + if in.QueryParameters != nil { + in, out := &in.QueryParameters, &out.QueryParameters + *out = new(GnsSegmentationSubPolicy) + (*in).DeepCopyInto(*out) + } + if in.RequestHeaders != nil { + in, out := &in.RequestHeaders, &out.RequestHeaders + *out = new(GnsSegmentationSubPolicy) + (*in).DeepCopyInto(*out) + } + if in.ResponseHeaders != nil { + in, out := &in.ResponseHeaders, &out.ResponseHeaders + *out = new(GnsSegmentationSubPolicy) + (*in).DeepCopyInto(*out) + } + if in.RequestPayload != nil { + in, out := &in.RequestPayload, &out.RequestPayload + *out = new(GnsSegmentationSubPolicy) + (*in).DeepCopyInto(*out) + } + if in.ResponsePayload != nil { + in, out := &in.ResponsePayload, &out.ResponsePayload + *out = new(GnsSegmentationSubPolicy) + (*in).DeepCopyInto(*out) + } + if in.RequestCookies != nil { + in, out := &in.RequestCookies, &out.RequestCookies + *out = new(GnsSegmentationSubPolicy) + (*in).DeepCopyInto(*out) + } + if in.UnexpectedEndpoint != nil { + in, out := &in.UnexpectedEndpoint, &out.UnexpectedEndpoint + *out = new(GnsSegmentationPolicyActionType) + (*in).DeepCopyInto(*out) + } + if in.UnexpectedResponseCode != nil { + in, out := &in.UnexpectedResponseCode, &out.UnexpectedResponseCode + *out = new(GnsSegmentationPolicyActionType) + (*in).DeepCopyInto(*out) + } + if in.UnexpectedRequestContentType != nil { + in, out := &in.UnexpectedRequestContentType, &out.UnexpectedRequestContentType + *out = new(GnsSegmentationPolicyActionType) + (*in).DeepCopyInto(*out) + } + if in.UnexpectedResponseContentType != nil { + in, out := &in.UnexpectedResponseContentType, &out.UnexpectedResponseContentType + *out = new(GnsSegmentationPolicyActionType) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationSchemaValidation. +func (in *GnsSegmentationSchemaValidation) DeepCopy() *GnsSegmentationSchemaValidation { + if in == nil { + return nil + } + out := new(GnsSegmentationSchemaValidation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationServiceGroupSpec) DeepCopyInto(out *GnsSegmentationServiceGroupSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationServiceGroupSpec. +func (in *GnsSegmentationServiceGroupSpec) DeepCopy() *GnsSegmentationServiceGroupSpec { + if in == nil { + return nil + } + out := new(GnsSegmentationServiceGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationSourceSelector) DeepCopyInto(out *GnsSegmentationSourceSelector) { + *out = *in + if in.IpBlock != nil { + in, out := &in.IpBlock, &out.IpBlock + *out = new(GnsSegmentationSourceSelectorIpBlock) + (*in).DeepCopyInto(*out) + } + if in.ServiceGroup != nil { + in, out := &in.ServiceGroup, &out.ServiceGroup + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ServiceName != nil { + in, out := &in.ServiceName, &out.ServiceName + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationSourceSelector. +func (in *GnsSegmentationSourceSelector) DeepCopy() *GnsSegmentationSourceSelector { + if in == nil { + return nil + } + out := new(GnsSegmentationSourceSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationSourceSelectorIpBlock) DeepCopyInto(out *GnsSegmentationSourceSelectorIpBlock) { + *out = *in + if in.Cidr != nil { + in, out := &in.Cidr, &out.Cidr + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Except != nil { + in, out := &in.Except, &out.Except + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationSourceSelectorIpBlock. +func (in *GnsSegmentationSourceSelectorIpBlock) DeepCopy() *GnsSegmentationSourceSelectorIpBlock { + if in == nil { + return nil + } + out := new(GnsSegmentationSourceSelectorIpBlock) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationSubPolicy) DeepCopyInto(out *GnsSegmentationSubPolicy) { + *out = *in + if in.Extra != nil { + in, out := &in.Extra, &out.Extra + *out = new(GnsSegmentationPolicyActionType) + (*in).DeepCopyInto(*out) + } + if in.Missing != nil { + in, out := &in.Missing, &out.Missing + *out = new(GnsSegmentationPolicyActionType) + (*in).DeepCopyInto(*out) + } + if in.SchemaViolation != nil { + in, out := &in.SchemaViolation, &out.SchemaViolation + *out = new(GnsSegmentationPolicyActionType) + (*in).DeepCopyInto(*out) + } + if in.MissingSchema != nil { + in, out := &in.MissingSchema, &out.MissingSchema + *out = new(GnsSegmentationPolicyActionType) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationSubPolicy. +func (in *GnsSegmentationSubPolicy) DeepCopy() *GnsSegmentationSubPolicy { + if in == nil { + return nil + } + out := new(GnsSegmentationSubPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsServiceGroupSpec) DeepCopyInto(out *GnsServiceGroupSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsServiceGroupSpec. +func (in *GnsServiceGroupSpec) DeepCopy() *GnsServiceGroupSpec { + if in == nil { + return nil + } + out := new(GnsServiceGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsServiceSelector) DeepCopyInto(out *GnsServiceSelector) { + *out = *in + if in.Services != nil { + in, out := &in.Services, &out.Services + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ServiceGroup != nil { + in, out := &in.ServiceGroup, &out.ServiceGroup + *out = make([]GnsServiceGroupSpec, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsServiceSelector. +func (in *GnsServiceSelector) DeepCopy() *GnsServiceSelector { + if in == nil { + return nil + } + out := new(GnsServiceSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPRouteMatch) DeepCopyInto(out *HTTPRouteMatch) { + *out = *in + out.Path = in.Path + in.Headers.DeepCopyInto(&out.Headers) + in.QueryParams.DeepCopyInto(&out.QueryParams) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRouteMatch. +func (in *HTTPRouteMatch) DeepCopy() *HTTPRouteMatch { + if in == nil { + return nil + } + out := new(HTTPRouteMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPRoutingRule) DeepCopyInto(out *HTTPRoutingRule) { + *out = *in + if in.Matches != nil { + in, out := &in.Matches, &out.Matches + *out = make([]HTTPRouteMatch, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Targets != nil { + in, out := &in.Targets, &out.Targets + *out = make([]TargetRoute, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRoutingRule. +func (in *HTTPRoutingRule) DeepCopy() *HTTPRoutingRule { + if in == nil { + return nil + } + out := new(HTTPRoutingRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in HTTPRoutingRules) DeepCopyInto(out *HTTPRoutingRules) { + { + in := &in + *out = make(HTTPRoutingRules, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRoutingRules. +func (in HTTPRoutingRules) DeepCopy() HTTPRoutingRules { + if in == nil { + return nil + } + out := new(HTTPRoutingRules) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HealthCheckConfig) DeepCopyInto(out *HealthCheckConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckConfig. +func (in *HealthCheckConfig) DeepCopy() *HealthCheckConfig { + if in == nil { + return nil + } + out := new(HealthCheckConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HealthCheckStatus) DeepCopyInto(out *HealthCheckStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckStatus. +func (in *HealthCheckStatus) DeepCopy() *HealthCheckStatus { + if in == nil { + return nil + } + out := new(HealthCheckStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HealthCheckType) DeepCopyInto(out *HealthCheckType) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckType. +func (in *HealthCheckType) DeepCopy() *HealthCheckType { + if in == nil { + return nil + } + out := new(HealthCheckType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IdentityFormat) DeepCopyInto(out *IdentityFormat) { + *out = *in + if in.Jwt != nil { + in, out := &in.Jwt, &out.Jwt + *out = new(IdentityFormat_Jwt) + **out = **in + } + if in.Json != nil { + in, out := &in.Json, &out.Json + *out = new(IdentityFormat_Json) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityFormat. +func (in *IdentityFormat) DeepCopy() *IdentityFormat { + if in == nil { + return nil + } + out := new(IdentityFormat) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IdentityFormat_Json) DeepCopyInto(out *IdentityFormat_Json) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityFormat_Json. +func (in *IdentityFormat_Json) DeepCopy() *IdentityFormat_Json { + if in == nil { + return nil + } + out := new(IdentityFormat_Json) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IdentityFormat_Jwt) DeepCopyInto(out *IdentityFormat_Jwt) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityFormat_Jwt. +func (in *IdentityFormat_Jwt) DeepCopy() *IdentityFormat_Jwt { + if in == nil { + return nil + } + out := new(IdentityFormat_Jwt) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IdentityProvider) DeepCopyInto(out *IdentityProvider) { + *out = *in + if in.Format != nil { + in, out := &in.Format, &out.Format + *out = new(IdentityFormat) + (*in).DeepCopyInto(*out) + } + if in.From != nil { + in, out := &in.From, &out.From + *out = new(TokenLocation) + (*in).DeepCopyInto(*out) + } + if in.Route != nil { + in, out := &in.Route, &out.Route + *out = new(RouteMatch) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityProvider. +func (in *IdentityProvider) DeepCopy() *IdentityProvider { + if in == nil { + return nil + } + out := new(IdentityProvider) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IntOrString) DeepCopyInto(out *IntOrString) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntOrString. +func (in *IntOrString) DeepCopy() *IntOrString { + if in == nil { + return nil + } + out := new(IntOrString) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IssuerStatus) DeepCopyInto(out *IssuerStatus) { + *out = *in + if in.conditions != nil { + in, out := &in.conditions, &out.conditions + *out = make(StatusConditions, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IssuerStatus. +func (in *IssuerStatus) DeepCopy() *IssuerStatus { + if in == nil { + return nil + } + out := new(IssuerStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobID) DeepCopyInto(out *JobID) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobID. +func (in *JobID) DeepCopy() *JobID { + if in == nil { + return nil + } + out := new(JobID) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobIDs) DeepCopyInto(out *JobIDs) { + *out = *in + if in.Ids != nil { + in, out := &in.Ids, &out.Ids + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobIDs. +func (in *JobIDs) DeepCopy() *JobIDs { + if in == nil { + return nil + } + out := new(JobIDs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobInfo) DeepCopyInto(out *JobInfo) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobInfo. +func (in *JobInfo) DeepCopy() *JobInfo { + if in == nil { + return nil + } + out := new(JobInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobSpec) DeepCopyInto(out *JobSpec) { + *out = *in + if in.Parallelism != nil { + in, out := &in.Parallelism, &out.Parallelism + *out = new(int32) + **out = **in + } + if in.Completions != nil { + in, out := &in.Completions, &out.Completions + *out = new(int32) + **out = **in + } + if in.ActiveDeadlineSeconds != nil { + in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds + *out = new(int64) + **out = **in + } + if in.BackoffLimit != nil { + in, out := &in.BackoffLimit, &out.BackoffLimit + *out = new(int32) + **out = **in + } + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.ManualSelector != nil { + in, out := &in.ManualSelector, &out.ManualSelector + *out = new(bool) + **out = **in + } + in.Template.DeepCopyInto(&out.Template) + if in.TTLSecondsAfterFinished != nil { + in, out := &in.TTLSecondsAfterFinished, &out.TTLSecondsAfterFinished + *out = new(int32) + **out = **in + } + if in.CompletionMode != nil { + in, out := &in.CompletionMode, &out.CompletionMode + *out = new(batchv1.CompletionMode) + **out = **in + } + if in.Suspend != nil { + in, out := &in.Suspend, &out.Suspend + *out = new(bool) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSpec. +func (in *JobSpec) DeepCopy() *JobSpec { + if in == nil { + return nil + } + out := new(JobSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobStatus) DeepCopyInto(out *JobStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]batchv1.JobCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.StartTime != nil { + in, out := &in.StartTime, &out.StartTime + *out = (*in).DeepCopy() + } + if in.CompletionTime != nil { + in, out := &in.CompletionTime, &out.CompletionTime + *out = (*in).DeepCopy() + } + if in.UncountedTerminatedPods != nil { + in, out := &in.UncountedTerminatedPods, &out.UncountedTerminatedPods + *out = new(batchv1.UncountedTerminatedPods) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobStatus. +func (in *JobStatus) DeepCopy() *JobStatus { + if in == nil { + return nil + } + out := new(JobStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobStatusInfo) DeepCopyInto(out *JobStatusInfo) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobStatusInfo. +func (in *JobStatusInfo) DeepCopy() *JobStatusInfo { + if in == nil { + return nil + } + out := new(JobStatusInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KNodeStatus) DeepCopyInto(out *KNodeStatus) { + *out = *in + if in.Capacity != nil { + in, out := &in.Capacity, &out.Capacity + *out = make(corev1.ResourceList, len(*in)) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } + } + if in.Allocatable != nil { + in, out := &in.Allocatable, &out.Allocatable + *out = make(corev1.ResourceList, len(*in)) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]corev1.NodeCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]corev1.NodeAddress, len(*in)) + copy(*out, *in) + } + out.DaemonEndpoints = in.DaemonEndpoints + out.NodeInfo = in.NodeInfo + if in.Images != nil { + in, out := &in.Images, &out.Images + *out = make([]corev1.ContainerImage, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.VolumesInUse != nil { + in, out := &in.VolumesInUse, &out.VolumesInUse + *out = make([]corev1.UniqueVolumeName, len(*in)) + copy(*out, *in) + } + if in.VolumesAttached != nil { + in, out := &in.VolumesAttached, &out.VolumesAttached + *out = make([]corev1.AttachedVolume, len(*in)) + copy(*out, *in) + } + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = new(corev1.NodeConfigStatus) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KNodeStatus. +func (in *KNodeStatus) DeepCopy() *KNodeStatus { + if in == nil { + return nil + } + out := new(KNodeStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Label) DeepCopyInto(out *Label) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Label. +func (in *Label) DeepCopy() *Label { + if in == nil { + return nil + } + out := new(Label) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Labels) DeepCopyInto(out *Labels) { + { + in := &in + *out = make(Labels, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Labels. +func (in Labels) DeepCopy() Labels { + if in == nil { + return nil + } + out := new(Labels) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in LabelsList) DeepCopyInto(out *LabelsList) { + { + in := &in + *out = make(LabelsList, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LabelsList. +func (in LabelsList) DeepCopy() LabelsList { + if in == nil { + return nil + } + out := new(LabelsList) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Link) DeepCopyInto(out *Link) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Link. +func (in *Link) DeepCopy() *Link { + if in == nil { + return nil + } + out := new(Link) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocationHeader) DeepCopyInto(out *LocationHeader) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocationHeader. +func (in *LocationHeader) DeepCopy() *LocationHeader { + if in == nil { + return nil + } + out := new(LocationHeader) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogRequest) DeepCopyInto(out *LogRequest) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogRequest. +func (in *LogRequest) DeepCopy() *LogRequest { + if in == nil { + return nil + } + out := new(LogRequest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedCertificateConfig) DeepCopyInto(out *ManagedCertificateConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedCertificateConfig. +func (in *ManagedCertificateConfig) DeepCopy() *ManagedCertificateConfig { + if in == nil { + return nil + } + out := new(ManagedCertificateConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MatchCondition) DeepCopyInto(out *MatchCondition) { + *out = *in + out.Namespace = in.Namespace + out.Cluster = in.Cluster + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MatchCondition. +func (in *MatchCondition) DeepCopy() *MatchCondition { + if in == nil { + return nil + } + out := new(MatchCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in MatchConditions) DeepCopyInto(out *MatchConditions) { + { + in := &in + *out = make(MatchConditions, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MatchConditions. +func (in MatchConditions) DeepCopy() MatchConditions { + if in == nil { + return nil + } + out := new(MatchConditions) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Metadata) DeepCopyInto(out *Metadata) { + *out = *in + in.CreationTimestamp.DeepCopyInto(&out.CreationTimestamp) + if in.DeletionTimestamp != nil { + in, out := &in.DeletionTimestamp, &out.DeletionTimestamp + *out = (*in).DeepCopy() + } + if in.DeletionGracePeriodSeconds != nil { + in, out := &in.DeletionGracePeriodSeconds, &out.DeletionGracePeriodSeconds + *out = new(int64) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.OwnerReferences != nil { + in, out := &in.OwnerReferences, &out.OwnerReferences + *out = make([]metav1.OwnerReference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Finalizers != nil { + in, out := &in.Finalizers, &out.Finalizers + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ManagedFields != nil { + in, out := &in.ManagedFields, &out.ManagedFields + *out = make([]metav1.ManagedFieldsEntry, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Metadata. +func (in *Metadata) DeepCopy() *Metadata { + if in == nil { + return nil + } + out := new(Metadata) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MtlsException) DeepCopyInto(out *MtlsException) { + *out = *in + if in.Services != nil { + in, out := &in.Services, &out.Services + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Service_groups != nil { + in, out := &in.Service_groups, &out.Service_groups + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MtlsException. +func (in *MtlsException) DeepCopy() *MtlsException { + if in == nil { + return nil + } + out := new(MtlsException) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in MtlsExceptions) DeepCopyInto(out *MtlsExceptions) { + { + in := &in + *out = make(MtlsExceptions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MtlsExceptions. +func (in MtlsExceptions) DeepCopy() MtlsExceptions { + if in == nil { + return nil + } + out := new(MtlsExceptions) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NexusStatus) DeepCopyInto(out *NexusStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NexusStatus. +func (in *NexusStatus) DeepCopy() *NexusStatus { + if in == nil { + return nil + } + out := new(NexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeSpec) DeepCopyInto(out *NodeSpec) { + *out = *in + if in.PodCIDRs != nil { + in, out := &in.PodCIDRs, &out.PodCIDRs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Taints != nil { + in, out := &in.Taints, &out.Taints + *out = make([]corev1.Taint, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ConfigSource != nil { + in, out := &in.ConfigSource, &out.ConfigSource + *out = new(corev1.NodeConfigSource) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeSpec. +func (in *NodeSpec) DeepCopy() *NodeSpec { + if in == nil { + return nil + } + out := new(NodeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenAPI) DeepCopyInto(out *OpenAPI) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenAPI. +func (in *OpenAPI) DeepCopy() *OpenAPI { + if in == nil { + return nil + } + out := new(OpenAPI) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PIIAsyncWorkerLimits) DeepCopyInto(out *PIIAsyncWorkerLimits) { + *out = *in + if in.TotalMemory != nil { + in, out := &in.TotalMemory, &out.TotalMemory + *out = new(uint64) + **out = **in + } + if in.ThroughputLimitingWindow != nil { + in, out := &in.ThroughputLimitingWindow, &out.ThroughputLimitingWindow + *out = new(uint64) + **out = **in + } + if in.TransactionsPerWindow != nil { + in, out := &in.TransactionsPerWindow, &out.TransactionsPerWindow + *out = new(uint64) + **out = **in + } + if in.BytesPerWindow != nil { + in, out := &in.BytesPerWindow, &out.BytesPerWindow + *out = new(uint64) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PIIAsyncWorkerLimits. +func (in *PIIAsyncWorkerLimits) DeepCopy() *PIIAsyncWorkerLimits { + if in == nil { + return nil + } + out := new(PIIAsyncWorkerLimits) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PIIMimeConfig) DeepCopyInto(out *PIIMimeConfig) { + *out = *in + if in.IgnoredMime != nil { + in, out := &in.IgnoredMime, &out.IgnoredMime + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PIIMimeConfig. +func (in *PIIMimeConfig) DeepCopy() *PIIMimeConfig { + if in == nil { + return nil + } + out := new(PIIMimeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Pattern) DeepCopyInto(out *Pattern) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Exceptions != nil { + in, out := &in.Exceptions, &out.Exceptions + *out = make([]*Check, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(Check) + (*in).DeepCopyInto(*out) + } + } + } + if in.AdditionalChecks != nil { + in, out := &in.AdditionalChecks, &out.AdditionalChecks + *out = make([]*Check, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(Check) + (*in).DeepCopyInto(*out) + } + } + } + if in.BaseCheck != nil { + in, out := &in.BaseCheck, &out.BaseCheck + *out = new(BaseCheck) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pattern. +func (in *Pattern) DeepCopy() *Pattern { + if in == nil { + return nil + } + out := new(Pattern) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PatternDatabase) DeepCopyInto(out *PatternDatabase) { + *out = *in + if in.DatabaseFile != nil { + in, out := &in.DatabaseFile, &out.DatabaseFile + *out = new(string) + **out = **in + } + if in.UseDefault != nil { + in, out := &in.UseDefault, &out.UseDefault + *out = new(bool) + **out = **in + } + if in.Queries != nil { + in, out := &in.Queries, &out.Queries + *out = make([]*Query, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(Query) + (*in).DeepCopyInto(*out) + } + } + } + if in.Patterns != nil { + in, out := &in.Patterns, &out.Patterns + *out = make([]*Pattern, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(Pattern) + (*in).DeepCopyInto(*out) + } + } + } + if in.PatternGroups != nil { + in, out := &in.PatternGroups, &out.PatternGroups + *out = make([]*PatternGroup, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(PatternGroup) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PatternDatabase. +func (in *PatternDatabase) DeepCopy() *PatternDatabase { + if in == nil { + return nil + } + out := new(PatternDatabase) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PatternGroup) DeepCopyInto(out *PatternGroup) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Patterns != nil { + in, out := &in.Patterns, &out.Patterns + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PatternGroup. +func (in *PatternGroup) DeepCopy() *PatternGroup { + if in == nil { + return nil + } + out := new(PatternGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PeerAuthenticationPolicy) DeepCopyInto(out *PeerAuthenticationPolicy) { + *out = *in + if in.Mtls != nil { + in, out := &in.Mtls, &out.Mtls + *out = new(PeerAuthentication_MutualTLS) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeerAuthenticationPolicy. +func (in *PeerAuthenticationPolicy) DeepCopy() *PeerAuthenticationPolicy { + if in == nil { + return nil + } + out := new(PeerAuthenticationPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PeerAuthenticationSpec) DeepCopyInto(out *PeerAuthenticationSpec) { + *out = *in + if in.Mtls != nil { + in, out := &in.Mtls, &out.Mtls + *out = new(PeerAuthentication_MutualTLS) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeerAuthenticationSpec. +func (in *PeerAuthenticationSpec) DeepCopy() *PeerAuthenticationSpec { + if in == nil { + return nil + } + out := new(PeerAuthenticationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PeerAuthentication_MutualTLS) DeepCopyInto(out *PeerAuthentication_MutualTLS) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeerAuthentication_MutualTLS. +func (in *PeerAuthentication_MutualTLS) DeepCopy() *PeerAuthentication_MutualTLS { + if in == nil { + return nil + } + out := new(PeerAuthentication_MutualTLS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PiiDiscoveryAppConfig) DeepCopyInto(out *PiiDiscoveryAppConfig) { + *out = *in + if in.Rule != nil { + in, out := &in.Rule, &out.Rule + *out = new(RuleConfig) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PiiDiscoveryAppConfig. +func (in *PiiDiscoveryAppConfig) DeepCopy() *PiiDiscoveryAppConfig { + if in == nil { + return nil + } + out := new(PiiDiscoveryAppConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in PiiDiscoveryApplicationConfigList) DeepCopyInto(out *PiiDiscoveryApplicationConfigList) { + { + in := &in + *out = make(PiiDiscoveryApplicationConfigList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PiiDiscoveryApplicationConfigList. +func (in PiiDiscoveryApplicationConfigList) DeepCopy() PiiDiscoveryApplicationConfigList { + if in == nil { + return nil + } + out := new(PiiDiscoveryApplicationConfigList) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PiiDiscoveryClusterResourceSelectorRT) DeepCopyInto(out *PiiDiscoveryClusterResourceSelectorRT) { + *out = *in + if in.Services != nil { + in, out := &in.Services, &out.Services + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ServiceGroup != nil { + in, out := &in.ServiceGroup, &out.ServiceGroup + *out = make([]GnsServiceGroupSpec, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PiiDiscoveryClusterResourceSelectorRT. +func (in *PiiDiscoveryClusterResourceSelectorRT) DeepCopy() *PiiDiscoveryClusterResourceSelectorRT { + if in == nil { + return nil + } + out := new(PiiDiscoveryClusterResourceSelectorRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PiiDiscoveryConfig) DeepCopyInto(out *PiiDiscoveryConfig) { + *out = *in + in.Selectors.DeepCopyInto(&out.Selectors) + if in.Application != nil { + in, out := &in.Application, &out.Application + *out = make(PiiDiscoveryApplicationConfigList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PiiDiscoveryConfig. +func (in *PiiDiscoveryConfig) DeepCopy() *PiiDiscoveryConfig { + if in == nil { + return nil + } + out := new(PiiDiscoveryConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyCfgAction) DeepCopyInto(out *PolicyCfgAction) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyCfgAction. +func (in *PolicyCfgAction) DeepCopy() *PolicyCfgAction { + if in == nil { + return nil + } + out := new(PolicyCfgAction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in PolicyCfgActions) DeepCopyInto(out *PolicyCfgActions) { + { + in := &in + *out = make(PolicyCfgActions, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyCfgActions. +func (in PolicyCfgActions) DeepCopy() PolicyCfgActions { + if in == nil { + return nil + } + out := new(PolicyCfgActions) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicySpec) DeepCopyInto(out *PolicySpec) { + *out = *in + in.state.DeepCopyInto(&out.state) + if in.unknownFields != nil { + in, out := &in.unknownFields, &out.unknownFields + *out = make([]byte, len(*in)) + copy(*out, *in) + } + if in.Targets != nil { + in, out := &in.Targets, &out.Targets + *out = make([]*v1alpha1.TargetSelector, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = (*in).DeepCopy() + } + } + } + if in.Peers != nil { + in, out := &in.Peers, &out.Peers + *out = make([]*v1alpha1.PeerAuthenticationMethod, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = (*in).DeepCopy() + } + } + } + if in.Origins != nil { + in, out := &in.Origins, &out.Origins + *out = make([]*v1alpha1.OriginAuthenticationMethod, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = (*in).DeepCopy() + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicySpec. +func (in *PolicySpec) DeepCopy() *PolicySpec { + if in == nil { + return nil + } + out := new(PolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PortLevelAuthenticationMap) DeepCopyInto(out *PortLevelAuthenticationMap) { + *out = *in + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make(map[string]int32, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PortLevelAuthenticationMap. +func (in *PortLevelAuthenticationMap) DeepCopy() *PortLevelAuthenticationMap { + if in == nil { + return nil + } + out := new(PortLevelAuthenticationMap) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProcessingToggles) DeepCopyInto(out *ProcessingToggles) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProcessingToggles. +func (in *ProcessingToggles) DeepCopy() *ProcessingToggles { + if in == nil { + return nil + } + out := new(ProcessingToggles) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeStatus) DeepCopyInto(out *ProgressiveUpgradeStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeStatus. +func (in *ProgressiveUpgradeStatus) DeepCopy() *ProgressiveUpgradeStatus { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeStep) DeepCopyInto(out *ProgressiveUpgradeStep) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeStep. +func (in *ProgressiveUpgradeStep) DeepCopy() *ProgressiveUpgradeStep { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeStep) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeStrategy) DeepCopyInto(out *ProgressiveUpgradeStrategy) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeStrategy. +func (in *ProgressiveUpgradeStrategy) DeepCopy() *ProgressiveUpgradeStrategy { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeStrategy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyConfigRequest) DeepCopyInto(out *ProxyConfigRequest) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyConfigRequest. +func (in *ProxyConfigRequest) DeepCopy() *ProxyConfigRequest { + if in == nil { + return nil + } + out := new(ProxyConfigRequest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Query) DeepCopyInto(out *Query) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Regex != nil { + in, out := &in.Regex, &out.Regex + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Query. +func (in *Query) DeepCopy() *Query { + if in == nil { + return nil + } + out := new(Query) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryParam) DeepCopyInto(out *QueryParam) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryParam. +func (in *QueryParam) DeepCopy() *QueryParam { + if in == nil { + return nil + } + out := new(QueryParam) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryParamMatchValue) DeepCopyInto(out *QueryParamMatchValue) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryParamMatchValue. +func (in *QueryParamMatchValue) DeepCopy() *QueryParamMatchValue { + if in == nil { + return nil + } + out := new(QueryParamMatchValue) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryParamsMatch) DeepCopyInto(out *QueryParamsMatch) { + *out = *in + out.Param = in.Param + out.Value = in.Value + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryParamsMatch. +func (in *QueryParamsMatch) DeepCopy() *QueryParamsMatch { + if in == nil { + return nil + } + out := new(QueryParamsMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReplicaSetSpec) DeepCopyInto(out *ReplicaSetSpec) { + *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } + in.Template.DeepCopyInto(&out.Template) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaSetSpec. +func (in *ReplicaSetSpec) DeepCopy() *ReplicaSetSpec { + if in == nil { + return nil + } + out := new(ReplicaSetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReplicaSetStatus) DeepCopyInto(out *ReplicaSetStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]appsv1.ReplicaSetCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaSetStatus. +func (in *ReplicaSetStatus) DeepCopy() *ReplicaSetStatus { + if in == nil { + return nil + } + out := new(ReplicaSetStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceGroupID) DeepCopyInto(out *ResourceGroupID) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceGroupID. +func (in *ResourceGroupID) DeepCopy() *ResourceGroupID { + if in == nil { + return nil + } + out := new(ResourceGroupID) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ResourceGroupIDs) DeepCopyInto(out *ResourceGroupIDs) { + { + in := &in + *out = make(ResourceGroupIDs, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceGroupIDs. +func (in ResourceGroupIDs) DeepCopy() ResourceGroupIDs { + if in == nil { + return nil + } + out := new(ResourceGroupIDs) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RouteMapMatch) DeepCopyInto(out *RouteMapMatch) { + *out = *in + if in.Values != nil { + in, out := &in.Values, &out.Values + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteMapMatch. +func (in *RouteMapMatch) DeepCopy() *RouteMapMatch { + if in == nil { + return nil + } + out := new(RouteMapMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RouteMatch) DeepCopyInto(out *RouteMatch) { + *out = *in + if in.CaseSensitive != nil { + in, out := &in.CaseSensitive, &out.CaseSensitive + *out = new(bool) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteMatch. +func (in *RouteMatch) DeepCopy() *RouteMatch { + if in == nil { + return nil + } + out := new(RouteMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RouteStringMatch) DeepCopyInto(out *RouteStringMatch) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteStringMatch. +func (in *RouteStringMatch) DeepCopy() *RouteStringMatch { + if in == nil { + return nil + } + out := new(RouteStringMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Routing) DeepCopyInto(out *Routing) { + *out = *in + if in.Clusters != nil { + in, out := &in.Clusters, &out.Clusters + *out = make(map[string]ClusterList, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Routing. +func (in *Routing) DeepCopy() *Routing { + if in == nil { + return nil + } + out := new(Routing) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RoutingPolicyType) DeepCopyInto(out *RoutingPolicyType) { + *out = *in + in.Policy.DeepCopyInto(&out.Policy) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoutingPolicyType. +func (in *RoutingPolicyType) DeepCopy() *RoutingPolicyType { + if in == nil { + return nil + } + out := new(RoutingPolicyType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RoutingRuleConfigHeaderOperations) DeepCopyInto(out *RoutingRuleConfigHeaderOperations) { + *out = *in + if in.Set != nil { + in, out := &in.Set, &out.Set + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Add != nil { + in, out := &in.Add, &out.Add + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Remove != nil { + in, out := &in.Remove, &out.Remove + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoutingRuleConfigHeaderOperations. +func (in *RoutingRuleConfigHeaderOperations) DeepCopy() *RoutingRuleConfigHeaderOperations { + if in == nil { + return nil + } + out := new(RoutingRuleConfigHeaderOperations) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RoutingRuleConfigHeaders) DeepCopyInto(out *RoutingRuleConfigHeaders) { + *out = *in + in.Request.DeepCopyInto(&out.Request) + in.Response.DeepCopyInto(&out.Response) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoutingRuleConfigHeaders. +func (in *RoutingRuleConfigHeaders) DeepCopy() *RoutingRuleConfigHeaders { + if in == nil { + return nil + } + out := new(RoutingRuleConfigHeaders) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RoutingRuleConfigStringMatch) DeepCopyInto(out *RoutingRuleConfigStringMatch) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoutingRuleConfigStringMatch. +func (in *RoutingRuleConfigStringMatch) DeepCopy() *RoutingRuleConfigStringMatch { + if in == nil { + return nil + } + out := new(RoutingRuleConfigStringMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RuleConfig) DeepCopyInto(out *RuleConfig) { + *out = *in + if in.OnlineBufferSize != nil { + in, out := &in.OnlineBufferSize, &out.OnlineBufferSize + *out = new(uint32) + **out = **in + } + if in.DLPConfig != nil { + in, out := &in.DLPConfig, &out.DLPConfig + *out = new(DLPConfig) + (*in).DeepCopyInto(*out) + } + if in.EnableDetailedLogging != nil { + in, out := &in.EnableDetailedLogging, &out.EnableDetailedLogging + *out = new(bool) + **out = **in + } + if in.PIIMimeConfig != nil { + in, out := &in.PIIMimeConfig, &out.PIIMimeConfig + *out = new(PIIMimeConfig) + (*in).DeepCopyInto(*out) + } + if in.Limits != nil { + in, out := &in.Limits, &out.Limits + *out = new(PIIAsyncWorkerLimits) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleConfig. +func (in *RuleConfig) DeepCopy() *RuleConfig { + if in == nil { + return nil + } + out := new(RuleConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RuleRange) DeepCopyInto(out *RuleRange) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleRange. +func (in *RuleRange) DeepCopy() *RuleRange { + if in == nil { + return nil + } + out := new(RuleRange) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RulesGroup) DeepCopyInto(out *RulesGroup) { + *out = *in + if in.CustomRules != nil { + in, out := &in.CustomRules, &out.CustomRules + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.RulesRanges != nil { + in, out := &in.RulesRanges, &out.RulesRanges + *out = make([]*RuleRange, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(RuleRange) + **out = **in + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RulesGroup. +func (in *RulesGroup) DeepCopy() *RulesGroup { + if in == nil { + return nil + } + out := new(RulesGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Selector) DeepCopyInto(out *Selector) { + { + in := &in + *out = make(Selector, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Selector. +func (in Selector) DeepCopy() Selector { + if in == nil { + return nil + } + out := new(Selector) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEndpoint) DeepCopyInto(out *ServiceEndpoint) { + *out = *in + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make(map[string]int32, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEndpoint. +func (in *ServiceEndpoint) DeepCopy() *ServiceEndpoint { + if in == nil { + return nil + } + out := new(ServiceEndpoint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEndpointList) DeepCopyInto(out *ServiceEndpointList) { + *out = *in + if in.List != nil { + in, out := &in.List, &out.List + *out = make([]ServiceEndpoint, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEndpointList. +func (in *ServiceEndpointList) DeepCopy() *ServiceEndpointList { + if in == nil { + return nil + } + out := new(ServiceEndpointList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceInstanceSpec) DeepCopyInto(out *ServiceInstanceSpec) { + *out = *in + if in.Volumes != nil { + in, out := &in.Volumes, &out.Volumes + *out = make([]corev1.Volume, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InitContainers != nil { + in, out := &in.InitContainers, &out.InitContainers + *out = make([]corev1.Container, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Containers != nil { + in, out := &in.Containers, &out.Containers + *out = make([]corev1.Container, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.EphemeralContainers != nil { + in, out := &in.EphemeralContainers, &out.EphemeralContainers + *out = make([]corev1.EphemeralContainer, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TerminationGracePeriodSeconds != nil { + in, out := &in.TerminationGracePeriodSeconds, &out.TerminationGracePeriodSeconds + *out = new(int64) + **out = **in + } + if in.ActiveDeadlineSeconds != nil { + in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds + *out = new(int64) + **out = **in + } + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AutomountServiceAccountToken != nil { + in, out := &in.AutomountServiceAccountToken, &out.AutomountServiceAccountToken + *out = new(bool) + **out = **in + } + if in.ShareProcessNamespace != nil { + in, out := &in.ShareProcessNamespace, &out.ShareProcessNamespace + *out = new(bool) + **out = **in + } + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(corev1.PodSecurityContext) + (*in).DeepCopyInto(*out) + } + if in.ImagePullSecrets != nil { + in, out := &in.ImagePullSecrets, &out.ImagePullSecrets + *out = make([]corev1.LocalObjectReference, len(*in)) + copy(*out, *in) + } + if in.Affinity != nil { + in, out := &in.Affinity, &out.Affinity + *out = new(corev1.Affinity) + (*in).DeepCopyInto(*out) + } + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]corev1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.HostAliases != nil { + in, out := &in.HostAliases, &out.HostAliases + *out = make([]corev1.HostAlias, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int32) + **out = **in + } + if in.DNSConfig != nil { + in, out := &in.DNSConfig, &out.DNSConfig + *out = new(corev1.PodDNSConfig) + (*in).DeepCopyInto(*out) + } + if in.ReadinessGates != nil { + in, out := &in.ReadinessGates, &out.ReadinessGates + *out = make([]corev1.PodReadinessGate, len(*in)) + copy(*out, *in) + } + if in.RuntimeClassName != nil { + in, out := &in.RuntimeClassName, &out.RuntimeClassName + *out = new(string) + **out = **in + } + if in.EnableServiceLinks != nil { + in, out := &in.EnableServiceLinks, &out.EnableServiceLinks + *out = new(bool) + **out = **in + } + if in.PreemptionPolicy != nil { + in, out := &in.PreemptionPolicy, &out.PreemptionPolicy + *out = new(corev1.PreemptionPolicy) + **out = **in + } + if in.Overhead != nil { + in, out := &in.Overhead, &out.Overhead + *out = make(corev1.ResourceList, len(*in)) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } + } + if in.TopologySpreadConstraints != nil { + in, out := &in.TopologySpreadConstraints, &out.TopologySpreadConstraints + *out = make([]corev1.TopologySpreadConstraint, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SetHostnameAsFQDN != nil { + in, out := &in.SetHostnameAsFQDN, &out.SetHostnameAsFQDN + *out = new(bool) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceInstanceSpec. +func (in *ServiceInstanceSpec) DeepCopy() *ServiceInstanceSpec { + if in == nil { + return nil + } + out := new(ServiceInstanceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceInstanceStatus) DeepCopyInto(out *ServiceInstanceStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]corev1.PodCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PodIPs != nil { + in, out := &in.PodIPs, &out.PodIPs + *out = make([]corev1.PodIP, len(*in)) + copy(*out, *in) + } + if in.StartTime != nil { + in, out := &in.StartTime, &out.StartTime + *out = (*in).DeepCopy() + } + if in.InitContainerStatuses != nil { + in, out := &in.InitContainerStatuses, &out.InitContainerStatuses + *out = make([]corev1.ContainerStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ContainerStatuses != nil { + in, out := &in.ContainerStatuses, &out.ContainerStatuses + *out = make([]corev1.ContainerStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.EphemeralContainerStatuses != nil { + in, out := &in.EphemeralContainerStatuses, &out.EphemeralContainerStatuses + *out = make([]corev1.ContainerStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceInstanceStatus. +func (in *ServiceInstanceStatus) DeepCopy() *ServiceInstanceStatus { + if in == nil { + return nil + } + out := new(ServiceInstanceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceLevelIndication) DeepCopyInto(out *ServiceLevelIndication) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceLevelIndication. +func (in *ServiceLevelIndication) DeepCopy() *ServiceLevelIndication { + if in == nil { + return nil + } + out := new(ServiceLevelIndication) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ServiceLevelIndicationGroup) DeepCopyInto(out *ServiceLevelIndicationGroup) { + { + in := &in + *out = make(ServiceLevelIndicationGroup, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceLevelIndicationGroup. +func (in ServiceLevelIndicationGroup) DeepCopy() ServiceLevelIndicationGroup { + if in == nil { + return nil + } + out := new(ServiceLevelIndicationGroup) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServicePort) DeepCopyInto(out *ServicePort) { + *out = *in + out.TargetPort = in.TargetPort + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServicePort. +func (in *ServicePort) DeepCopy() *ServicePort { + if in == nil { + return nil + } + out := new(ServicePort) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ServicePortList) DeepCopyInto(out *ServicePortList) { + { + in := &in + *out = make(ServicePortList, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServicePortList. +func (in ServicePortList) DeepCopy() ServicePortList { + if in == nil { + return nil + } + out := new(ServicePortList) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceSelector) DeepCopyInto(out *ServiceSelector) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceSelector. +func (in *ServiceSelector) DeepCopy() *ServiceSelector { + if in == nil { + return nil + } + out := new(ServiceSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceSpec) DeepCopyInto(out *ServiceSpec) { + *out = *in + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make([]corev1.ServicePort, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ClusterIPs != nil { + in, out := &in.ClusterIPs, &out.ClusterIPs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ExternalIPs != nil { + in, out := &in.ExternalIPs, &out.ExternalIPs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.LoadBalancerSourceRanges != nil { + in, out := &in.LoadBalancerSourceRanges, &out.LoadBalancerSourceRanges + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SessionAffinityConfig != nil { + in, out := &in.SessionAffinityConfig, &out.SessionAffinityConfig + *out = new(corev1.SessionAffinityConfig) + (*in).DeepCopyInto(*out) + } + if in.IPFamilies != nil { + in, out := &in.IPFamilies, &out.IPFamilies + *out = make([]corev1.IPFamily, len(*in)) + copy(*out, *in) + } + if in.IPFamilyPolicy != nil { + in, out := &in.IPFamilyPolicy, &out.IPFamilyPolicy + *out = new(corev1.IPFamilyPolicyType) + **out = **in + } + if in.AllocateLoadBalancerNodePorts != nil { + in, out := &in.AllocateLoadBalancerNodePorts, &out.AllocateLoadBalancerNodePorts + *out = new(bool) + **out = **in + } + if in.LoadBalancerClass != nil { + in, out := &in.LoadBalancerClass, &out.LoadBalancerClass + *out = new(string) + **out = **in + } + if in.InternalTrafficPolicy != nil { + in, out := &in.InternalTrafficPolicy, &out.InternalTrafficPolicy + *out = new(corev1.ServiceInternalTrafficPolicyType) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceSpec. +func (in *ServiceSpec) DeepCopy() *ServiceSpec { + if in == nil { + return nil + } + out := new(ServiceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceStatus) DeepCopyInto(out *ServiceStatus) { + *out = *in + in.LoadBalancer.DeepCopyInto(&out.LoadBalancer) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceStatus. +func (in *ServiceStatus) DeepCopy() *ServiceStatus { + if in == nil { + return nil + } + out := new(ServiceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceVersionList) DeepCopyInto(out *ServiceVersionList) { + *out = *in + if in.List != nil { + in, out := &in.List, &out.List + *out = make([]SvcVersion, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceVersionList. +func (in *ServiceVersionList) DeepCopy() *ServiceVersionList { + if in == nil { + return nil + } + out := new(ServiceVersionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SloService) DeepCopyInto(out *SloService) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SloService. +func (in *SloService) DeepCopy() *SloService { + if in == nil { + return nil + } + out := new(SloService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SloServices) DeepCopyInto(out *SloServices) { + *out = *in + if in.Services != nil { + in, out := &in.Services, &out.Services + *out = make([]SloService, len(*in)) + copy(*out, *in) + } + if in.ServiceGroups != nil { + in, out := &in.ServiceGroups, &out.ServiceGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SloServices. +func (in *SloServices) DeepCopy() *SloServices { + if in == nil { + return nil + } + out := new(SloServices) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SloTargetValue) DeepCopyInto(out *SloTargetValue) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SloTargetValue. +func (in *SloTargetValue) DeepCopy() *SloTargetValue { + if in == nil { + return nil + } + out := new(SloTargetValue) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StatefulSetSpec) DeepCopyInto(out *StatefulSetSpec) { + *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } + in.Template.DeepCopyInto(&out.Template) + if in.VolumeClaimTemplates != nil { + in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates + *out = make([]corev1.PersistentVolumeClaim, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.UpdateStrategy.DeepCopyInto(&out.UpdateStrategy) + if in.RevisionHistoryLimit != nil { + in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatefulSetSpec. +func (in *StatefulSetSpec) DeepCopy() *StatefulSetSpec { + if in == nil { + return nil + } + out := new(StatefulSetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StatefulSetStatus) DeepCopyInto(out *StatefulSetStatus) { + *out = *in + if in.CollisionCount != nil { + in, out := &in.CollisionCount, &out.CollisionCount + *out = new(int32) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]appsv1.StatefulSetCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatefulSetStatus. +func (in *StatefulSetStatus) DeepCopy() *StatefulSetStatus { + if in == nil { + return nil + } + out := new(StatefulSetStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Status) DeepCopyInto(out *Status) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Status. +func (in *Status) DeepCopy() *Status { + if in == nil { + return nil + } + out := new(Status) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StatusCondition) DeepCopyInto(out *StatusCondition) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatusCondition. +func (in *StatusCondition) DeepCopy() *StatusCondition { + if in == nil { + return nil + } + out := new(StatusCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in StatusConditions) DeepCopyInto(out *StatusConditions) { + { + in := &in + *out = make(StatusConditions, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatusConditions. +func (in StatusConditions) DeepCopy() StatusConditions { + if in == nil { + return nil + } + out := new(StatusConditions) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in StringList) DeepCopyInto(out *StringList) { + { + in := &in + *out = make(StringList, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StringList. +func (in StringList) DeepCopy() StringList { + if in == nil { + return nil + } + out := new(StringList) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubToggles) DeepCopyInto(out *SubToggles) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubToggles. +func (in *SubToggles) DeepCopy() *SubToggles { + if in == nil { + return nil + } + out := new(SubToggles) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SvcVersion) DeepCopyInto(out *SvcVersion) { + *out = *in + if in.RemoteEndpoints != nil { + in, out := &in.RemoteEndpoints, &out.RemoteEndpoints + *out = make([]ServiceEndpoint, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcVersion. +func (in *SvcVersion) DeepCopy() *SvcVersion { + if in == nil { + return nil + } + out := new(SvcVersion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetRoute) DeepCopyInto(out *TargetRoute) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetRoute. +func (in *TargetRoute) DeepCopy() *TargetRoute { + if in == nil { + return nil + } + out := new(TargetRoute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetVersion) DeepCopyInto(out *TargetVersion) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetVersion. +func (in *TargetVersion) DeepCopy() *TargetVersion { + if in == nil { + return nil + } + out := new(TargetVersion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Toggles) DeepCopyInto(out *Toggles) { + *out = *in + if in.QueryParameters != nil { + in, out := &in.QueryParameters, &out.QueryParameters + *out = new(SubToggles) + **out = **in + } + if in.RequestHeaders != nil { + in, out := &in.RequestHeaders, &out.RequestHeaders + *out = new(SubToggles) + **out = **in + } + if in.ResponseHeaders != nil { + in, out := &in.ResponseHeaders, &out.ResponseHeaders + *out = new(SubToggles) + **out = **in + } + if in.RequestPayload != nil { + in, out := &in.RequestPayload, &out.RequestPayload + *out = new(SubToggles) + **out = **in + } + if in.ResponsePayload != nil { + in, out := &in.ResponsePayload, &out.ResponsePayload + *out = new(SubToggles) + **out = **in + } + if in.RequestCookies != nil { + in, out := &in.RequestCookies, &out.RequestCookies + *out = new(SubToggles) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Toggles. +func (in *Toggles) DeepCopy() *Toggles { + if in == nil { + return nil + } + out := new(Toggles) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Token) DeepCopyInto(out *Token) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Token. +func (in *Token) DeepCopy() *Token { + if in == nil { + return nil + } + out := new(Token) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TokenLocation) DeepCopyInto(out *TokenLocation) { + *out = *in + if in.Headers != nil { + in, out := &in.Headers, &out.Headers + *out = make([]*LocationHeader, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(LocationHeader) + **out = **in + } + } + } + if in.UrlParams != nil { + in, out := &in.UrlParams, &out.UrlParams + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Cookies != nil { + in, out := &in.Cookies, &out.Cookies + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Body != nil { + in, out := &in.Body, &out.Body + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenLocation. +func (in *TokenLocation) DeepCopy() *TokenLocation { + if in == nil { + return nil + } + out := new(TokenLocation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TrafficPolicy) DeepCopyInto(out *TrafficPolicy) { + *out = *in + if in.Http != nil { + in, out := &in.Http, &out.Http + *out = make([]HTTPRoutingRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrafficPolicy. +func (in *TrafficPolicy) DeepCopy() *TrafficPolicy { + if in == nil { + return nil + } + out := new(TrafficPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TrafficRoutingPolicy) DeepCopyInto(out *TrafficRoutingPolicy) { + *out = *in + in.TrafficPolicy.DeepCopyInto(&out.TrafficPolicy) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrafficRoutingPolicy. +func (in *TrafficRoutingPolicy) DeepCopy() *TrafficRoutingPolicy { + if in == nil { + return nil + } + out := new(TrafficRoutingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UnManagedCertificateConfig) DeepCopyInto(out *UnManagedCertificateConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UnManagedCertificateConfig. +func (in *UnManagedCertificateConfig) DeepCopy() *UnManagedCertificateConfig { + if in == nil { + return nil + } + out := new(UnManagedCertificateConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UpgradeService) DeepCopyInto(out *UpgradeService) { + *out = *in + out.CurrentVersion = in.CurrentVersion + out.TargetVersion = in.TargetVersion + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpgradeService. +func (in *UpgradeService) DeepCopy() *UpgradeService { + if in == nil { + return nil + } + out := new(UpgradeService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in UpgradeServices) DeepCopyInto(out *UpgradeServices) { + { + in := &in + *out = make(UpgradeServices, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpgradeServices. +func (in UpgradeServices) DeepCopy() UpgradeServices { + if in == nil { + return nil + } + out := new(UpgradeServices) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UpgradeTargetVersion) DeepCopyInto(out *UpgradeTargetVersion) { + *out = *in + out.Version = in.Version + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpgradeTargetVersion. +func (in *UpgradeTargetVersion) DeepCopy() *UpgradeTargetVersion { + if in == nil { + return nil + } + out := new(UpgradeTargetVersion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UpgradeableVersion) DeepCopyInto(out *UpgradeableVersion) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpgradeableVersion. +func (in *UpgradeableVersion) DeepCopy() *UpgradeableVersion { + if in == nil { + return nil + } + out := new(UpgradeableVersion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserDiscoveryAppConfig) DeepCopyInto(out *UserDiscoveryAppConfig) { + *out = *in + if in.Providers != nil { + in, out := &in.Providers, &out.Providers + *out = make([]UserIdentityProviderItem, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RequestBufferSize != nil { + in, out := &in.RequestBufferSize, &out.RequestBufferSize + *out = new(uint64) + **out = **in + } + if in.ResponseBufferSize != nil { + in, out := &in.ResponseBufferSize, &out.ResponseBufferSize + *out = new(uint64) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserDiscoveryAppConfig. +func (in *UserDiscoveryAppConfig) DeepCopy() *UserDiscoveryAppConfig { + if in == nil { + return nil + } + out := new(UserDiscoveryAppConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in UserDiscoveryApplicationConfigList) DeepCopyInto(out *UserDiscoveryApplicationConfigList) { + { + in := &in + *out = make(UserDiscoveryApplicationConfigList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserDiscoveryApplicationConfigList. +func (in UserDiscoveryApplicationConfigList) DeepCopy() UserDiscoveryApplicationConfigList { + if in == nil { + return nil + } + out := new(UserDiscoveryApplicationConfigList) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserDiscoveryClusterResourceSelectorRT) DeepCopyInto(out *UserDiscoveryClusterResourceSelectorRT) { + *out = *in + if in.Services != nil { + in, out := &in.Services, &out.Services + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ServiceGroup != nil { + in, out := &in.ServiceGroup, &out.ServiceGroup + *out = make([]GnsServiceGroupSpec, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserDiscoveryClusterResourceSelectorRT. +func (in *UserDiscoveryClusterResourceSelectorRT) DeepCopy() *UserDiscoveryClusterResourceSelectorRT { + if in == nil { + return nil + } + out := new(UserDiscoveryClusterResourceSelectorRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserDiscoveryConfig) DeepCopyInto(out *UserDiscoveryConfig) { + *out = *in + in.Selectors.DeepCopyInto(&out.Selectors) + if in.Application != nil { + in, out := &in.Application, &out.Application + *out = make(UserDiscoveryApplicationConfigList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserDiscoveryConfig. +func (in *UserDiscoveryConfig) DeepCopy() *UserDiscoveryConfig { + if in == nil { + return nil + } + out := new(UserDiscoveryConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserIdentityProviderItem) DeepCopyInto(out *UserIdentityProviderItem) { + *out = *in + if in.Provider != nil { + in, out := &in.Provider, &out.Provider + *out = new(IdentityProvider) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserIdentityProviderItem. +func (in *UserIdentityProviderItem) DeepCopy() *UserIdentityProviderItem { + if in == nil { + return nil + } + out := new(UserIdentityProviderItem) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VenafiConfig) DeepCopyInto(out *VenafiConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VenafiConfig. +func (in *VenafiConfig) DeepCopy() *VenafiConfig { + if in == nil { + return nil + } + out := new(VenafiConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Version) DeepCopyInto(out *Version) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Version. +func (in *Version) DeepCopy() *Version { + if in == nil { + return nil + } + out := new(Version) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Versions) DeepCopyInto(out *Versions) { + { + in := &in + *out = make(Versions, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Versions. +func (in Versions) DeepCopy() Versions { + if in == nil { + return nil + } + out := new(Versions) + in.DeepCopyInto(out) + return *out +} diff --git a/compiler/example/output/generated/apis/global.tsm.tanzu.vmware.com/register.go b/compiler/example/output/generated/apis/global.tsm.tanzu.vmware.com/register.go new file mode 100644 index 000000000..dbec80c32 --- /dev/null +++ b/compiler/example/output/generated/apis/global.tsm.tanzu.vmware.com/register.go @@ -0,0 +1,7 @@ +// Code generated by nexus. DO NOT EDIT. + +package global_tsm_tanzu_vmware_com + +const ( + GroupName = "global.tsm.tanzu.vmware.com" +) diff --git a/compiler/example/output/generated/apis/global.tsm.tanzu.vmware.com/v1/doc.go b/compiler/example/output/generated/apis/global.tsm.tanzu.vmware.com/v1/doc.go new file mode 100644 index 000000000..a58f595fb --- /dev/null +++ b/compiler/example/output/generated/apis/global.tsm.tanzu.vmware.com/v1/doc.go @@ -0,0 +1,7 @@ +// Code generated by nexus. DO NOT EDIT. + +// +k8s:deepcopy-gen=package +// +groupName=global.tsm.tanzu.vmware.com +// +groupGoName=GlobalTsm + +package v1 diff --git a/compiler/example/output/generated/apis/global.tsm.tanzu.vmware.com/v1/register.go b/compiler/example/output/generated/apis/global.tsm.tanzu.vmware.com/v1/register.go new file mode 100644 index 000000000..e0d2e36e8 --- /dev/null +++ b/compiler/example/output/generated/apis/global.tsm.tanzu.vmware.com/v1/register.go @@ -0,0 +1,461 @@ +// Code generated by nexus. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + global_tsm_tanzu_vmware_com "nexustempmodule/apis/global.tsm.tanzu.vmware.com" +) + +const ResourceVersion = "v1" + +// GroupVersion is the identifier for the API which includes +// the name of the group and the version of the API +var SchemeGroupVersion = schema.GroupVersion{ + Group: global_tsm_tanzu_vmware_com.GroupName, + Version: ResourceVersion, +} + +// Kind takes an unqualified kind and returns back a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +// addKnownTypes adds our types to the API scheme by registering +// MyResource and MyResourceList +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes( + SchemeGroupVersion, + &AccessToken{}, + &AccessTokenList{}, + &ACPConfig{}, + &ACPConfigList{}, + &AdditionalAttributes{}, + &AdditionalAttributesList{}, + &AllSparkServices{}, + &AllSparkServicesList{}, + &Annotation{}, + &AnnotationList{}, + &ApiDiscoveryRT{}, + &ApiDiscoveryRTList{}, + &ApiDiscovery{}, + &ApiDiscoveryList{}, + &AppFolder{}, + &AppFolderList{}, + &AppGroup{}, + &AppGroupList{}, + &AppTemplateServiceDefinition{}, + &AppTemplateServiceDefinitionList{}, + &AppTemplate{}, + &AppTemplateList{}, + &AppUser{}, + &AppUserList{}, + &AppVersion{}, + &AppVersionList{}, + &App{}, + &AppList{}, + &ApplicationInfo{}, + &ApplicationInfoList{}, + &AttackDiscoveryRT{}, + &AttackDiscoveryRTList{}, + &AttackDiscovery{}, + &AttackDiscoveryList{}, + &AuthenticationPolicy{}, + &AuthenticationPolicyList{}, + &AutoscalerFolder{}, + &AutoscalerFolderList{}, + &AutoscalerConfig{}, + &AutoscalerConfigList{}, + &Autoscaler{}, + &AutoscalerList{}, + &AutoscalerCR{}, + &AutoscalerCRList{}, + &AutoscalingPolicy{}, + &AutoscalingPolicyList{}, + &AwsConnector{}, + &AwsConnectorList{}, + &Bucket{}, + &BucketList{}, + &CertificateAuthorityRT{}, + &CertificateAuthorityRTList{}, + &CertificateAuthorityConfigN{}, + &CertificateAuthorityConfigNList{}, + &CertificateConfigN{}, + &CertificateConfigNList{}, + &CertificateRequest{}, + &CertificateRequestList{}, + &Certificate{}, + &CertificateList{}, + &ClusterConfigFolder{}, + &ClusterConfigFolderList{}, + &ClusterConfig{}, + &ClusterConfigList{}, + &ClusterFolder{}, + &ClusterFolderList{}, + &ClusterSettings{}, + &ClusterSettingsList{}, + &Cluster{}, + &ClusterList{}, + &ConfigMap{}, + &ConfigMapList{}, + &Config{}, + &ConfigList{}, + &ConnectionStatus{}, + &ConnectionStatusList{}, + &DataFolderDomainCluster{}, + &DataFolderDomainClusterList{}, + &DataFolderDomainServiceVersion{}, + &DataFolderDomainServiceVersionList{}, + &DataFolderDomainService{}, + &DataFolderDomainServiceList{}, + &DataFolderDomain{}, + &DataFolderDomainList{}, + &DataFolder{}, + &DataFolderList{}, + &DataGroup{}, + &DataGroupList{}, + &DataTemplate{}, + &DataTemplateList{}, + &Database{}, + &DatabaseList{}, + &DCRegion{}, + &DCRegionList{}, + &DCZone{}, + &DCZoneList{}, + &DestinationRule{}, + &DestinationRuleList{}, + &Directory{}, + &DirectoryList{}, + &DNSConfigFolder{}, + &DNSConfigFolderList{}, + &DNSConfig{}, + &DNSConfigList{}, + &DNSProbeConfig{}, + &DNSProbeConfigList{}, + &DNSProbeStatus{}, + &DNSProbeStatusList{}, + &DNSProbesConfigFolder{}, + &DNSProbesConfigFolderList{}, + &DomainConfig{}, + &DomainConfigList{}, + &Domain{}, + &DomainList{}, + &Endpoints{}, + &EndpointsList{}, + &EnvoyFilter{}, + &EnvoyFilterList{}, + &ExternalAccountConfigN{}, + &ExternalAccountConfigNList{}, + &ExternalAuditStorage{}, + &ExternalAuditStorageList{}, + &ExternalDNSConfigN{}, + &ExternalDNSConfigNList{}, + &ExternalDNSInventoryHealthCheck{}, + &ExternalDNSInventoryHealthCheckList{}, + &ExternalDNSInventoryPrimaryDomain{}, + &ExternalDNSInventoryPrimaryDomainList{}, + &ExternalDNSInventoryRecord{}, + &ExternalDNSInventoryRecordList{}, + &ExternalDNSInventoryZone{}, + &ExternalDNSInventoryZoneList{}, + &ExternalDNSInventory{}, + &ExternalDNSInventoryList{}, + &ExternalDNSRuntimeEndpoint{}, + &ExternalDNSRuntimeEndpointList{}, + &ExternalDNSRuntimePrimaryDomain{}, + &ExternalDNSRuntimePrimaryDomainList{}, + &ExternalDNSRuntime{}, + &ExternalDNSRuntimeList{}, + &ExternalDNSRuntimeSubdomain{}, + &ExternalDNSRuntimeSubdomainList{}, + &ExternalLBConfigN{}, + &ExternalLBConfigNList{}, + &ExternalPluginCapability{}, + &ExternalPluginCapabilityList{}, + &ExternalPluginConfigFolder{}, + &ExternalPluginConfigFolderList{}, + &ExternalPluginConfig{}, + &ExternalPluginConfigList{}, + &ExternalPluginInstanceConfig{}, + &ExternalPluginInstanceConfigList{}, + &ExternalPluginMonitor{}, + &ExternalPluginMonitorList{}, + &ExternalServicesRT{}, + &ExternalServicesRTList{}, + &FeatureFlag{}, + &FeatureFlagList{}, + &GatewayConfigListenerCertificate{}, + &GatewayConfigListenerCertificateList{}, + &GatewayConfigAdditionalListeners{}, + &GatewayConfigAdditionalListenersList{}, + &GatewayConfigListenerDestinationRoute{}, + &GatewayConfigListenerDestinationRouteList{}, + &GatewayConfig{}, + &GatewayConfigList{}, + &Gateway{}, + &GatewayList{}, + &GeoDiscoveryRT{}, + &GeoDiscoveryRTList{}, + &GeoDiscovery{}, + &GeoDiscoveryList{}, + &GlobalNs{}, + &GlobalNsList{}, + &GlobalRegistrationService{}, + &GlobalRegistrationServiceList{}, + &GlobalNamespace{}, + &GlobalNamespaceList{}, + &GnsAccessControlPolicyRT{}, + &GnsAccessControlPolicyRTList{}, + &GnsAccessControlPolicy{}, + &GnsAccessControlPolicyList{}, + &GnsBindingRT{}, + &GnsBindingRTList{}, + &GnsEndpointsConfig{}, + &GnsEndpointsConfigList{}, + &ExternalServiceConfig{}, + &ExternalServiceConfigList{}, + &PublicServiceRouteConfig{}, + &PublicServiceRouteConfigList{}, + &PublicServiceConfig{}, + &PublicServiceConfigList{}, + &GNSRoutingConfig{}, + &GNSRoutingConfigList{}, + &GnsRoutingRuleConfig{}, + &GnsRoutingRuleConfigList{}, + &GnsSegmentationPolicyRT{}, + &GnsSegmentationPolicyRTList{}, + &GnsSegmentationPolicy{}, + &GnsSegmentationPolicyList{}, + &GnsServiceEntryConfig{}, + &GnsServiceEntryConfigList{}, + &GnsSvcGroupRT{}, + &GnsSvcGroupRTList{}, + &GNSSvcGroup{}, + &GNSSvcGroupList{}, + &SharedServiceConfig{}, + &SharedServiceConfigList{}, + &GNS{}, + &GNSList{}, + &HaConfigV2{}, + &HaConfigV2List{}, + &HaConfig{}, + &HaConfigList{}, + &HealthCheckConfigN{}, + &HealthCheckConfigNList{}, + &HostConfigV2{}, + &HostConfigV2List{}, + &HostConfig{}, + &HostConfigList{}, + &InboundAuthenticationConfig{}, + &InboundAuthenticationConfigList{}, + &Inventory{}, + &InventoryList{}, + &Issuer{}, + &IssuerList{}, + &JobConfigFolder{}, + &JobConfigFolderList{}, + &JobConfig{}, + &JobConfigList{}, + &JobFolder{}, + &JobFolderList{}, + &Job{}, + &JobList{}, + &KnativeIngress{}, + &KnativeIngressList{}, + &LabelConfig{}, + &LabelConfigList{}, + &LocalRegistrationServiceCluster{}, + &LocalRegistrationServiceClusterList{}, + &LocalRegistrationServiceResource{}, + &LocalRegistrationServiceResourceList{}, + &LocalRegistrationService{}, + &LocalRegistrationServiceList{}, + &LogFolder{}, + &LogFolderList{}, + &Log{}, + &LogList{}, + &NetworkAttachmentDefinitionConfig{}, + &NetworkAttachmentDefinitionConfigList{}, + &NetworkAttachmentDefinition{}, + &NetworkAttachmentDefinitionList{}, + &NodeDefinition{}, + &NodeDefinitionList{}, + &NodeFolderCluster{}, + &NodeFolderClusterList{}, + &NodeFolder{}, + &NodeFolderList{}, + &NodeGroup{}, + &NodeGroupList{}, + &NodeStatus{}, + &NodeStatusList{}, + &NodeTemplate{}, + &NodeTemplateList{}, + &Node{}, + &NodeList{}, + &OutboundAuthenticationMode{}, + &OutboundAuthenticationModeList{}, + &PeerAuthentication{}, + &PeerAuthenticationList{}, + &PiiDiscoveryRT{}, + &PiiDiscoveryRTList{}, + &PiiDiscovery{}, + &PiiDiscoveryList{}, + &PolicyConfig{}, + &PolicyConfigList{}, + &PolicyTemplate{}, + &PolicyTemplateList{}, + &AccessControlPolicy{}, + &AccessControlPolicyList{}, + &ProgressiveUpgrade{}, + &ProgressiveUpgradeList{}, + &ProgressiveUpgradeConfig{}, + &ProgressiveUpgradeConfigList{}, + &ProgressiveUpgradeFolder{}, + &ProgressiveUpgradeFolderList{}, + &ProgressiveUpgradeRuntime{}, + &ProgressiveUpgradeRuntimeList{}, + &ProjectConfig{}, + &ProjectConfigList{}, + &ProjectInventory{}, + &ProjectInventoryList{}, + &ProjectQuery{}, + &ProjectQueryList{}, + &Project{}, + &ProjectList{}, + &PublicServiceRT{}, + &PublicServiceRTList{}, + &RemoteGatewayServiceConfig{}, + &RemoteGatewayServiceConfigList{}, + &ResourceGroupRT{}, + &ResourceGroupRTList{}, + &ResourceGroup{}, + &ResourceGroupList{}, + &Root{}, + &RootList{}, + &RPolicy{}, + &RPolicyList{}, + &Runtime{}, + &RuntimeList{}, + &SchemaViolationDiscoveryRT{}, + &SchemaViolationDiscoveryRTList{}, + &GnsSchemaViolationDiscovery{}, + &GnsSchemaViolationDiscoveryList{}, + &SecretRTConfig{}, + &SecretRTConfigList{}, + &SecretHash{}, + &SecretHashList{}, + &SecurityContextConstraintsConfig{}, + &SecurityContextConstraintsConfigList{}, + &SecurityContextConstraints{}, + &SecurityContextConstraintsList{}, + &ServiceConfig{}, + &ServiceConfigList{}, + &ServiceCronJob{}, + &ServiceCronJobList{}, + &ServiceDaemonSet{}, + &ServiceDaemonSetList{}, + &ServiceDeploymentContainer{}, + &ServiceDeploymentContainerList{}, + &ServiceDeployment{}, + &ServiceDeploymentList{}, + &ServiceDirectoryEntryConfig{}, + &ServiceDirectoryEntryConfigList{}, + &ServiceDirectoryRTFolderEntry{}, + &ServiceDirectoryRTFolderEntryList{}, + &ServiceDirectoryRTFolder{}, + &ServiceDirectoryRTFolderList{}, + &ServiceDirectoryRT{}, + &ServiceDirectoryRTList{}, + &ServiceDirectoryN{}, + &ServiceDirectoryNList{}, + &ServiceEntryConfig{}, + &ServiceEntryConfigList{}, + &ServiceEntry{}, + &ServiceEntryList{}, + &SvcGroupRT{}, + &SvcGroupRTList{}, + &ServiceInstanceContainer{}, + &ServiceInstanceContainerList{}, + &ServiceInstance{}, + &ServiceInstanceList{}, + &ServiceJob{}, + &ServiceJobList{}, + &ServiceLevelObjectiveFolder{}, + &ServiceLevelObjectiveFolderList{}, + &ServiceLevelObjective{}, + &ServiceLevelObjectiveList{}, + &ServiceReplicaSet{}, + &ServiceReplicaSetList{}, + &ServiceStatefulSet{}, + &ServiceStatefulSetList{}, + &ServiceTemplateServiceDefinition{}, + &ServiceTemplateServiceDefinitionList{}, + &ServiceTemplate{}, + &ServiceTemplateList{}, + &ServiceVersionConfig{}, + &ServiceVersionConfigList{}, + &MetricMonitor{}, + &MetricMonitorList{}, + &ServiceVersion{}, + &ServiceVersionList{}, + &Service{}, + &ServiceList{}, + &SloConfig{}, + &SloConfigList{}, + &SloServiceConfig{}, + &SloServiceConfigList{}, + &SLOFolder{}, + &SLOFolderList{}, + &FederatedSloConfig{}, + &FederatedSloConfigList{}, + &FederatedSloServiceConfig{}, + &FederatedSloServiceConfigList{}, + &SLOPolicy{}, + &SLOPolicyList{}, + &SvcGroup{}, + &SvcGroupList{}, + &Table{}, + &TableList{}, + &TemplateGroup{}, + &TemplateGroupList{}, + &Template{}, + &TemplateList{}, + &TenantResource{}, + &TenantResourceList{}, + &TenantToken{}, + &TenantTokenList{}, + &Tenant{}, + &TenantList{}, + &UserDiscoveryRT{}, + &UserDiscoveryRTList{}, + &UserDiscovery{}, + &UserDiscoveryList{}, + &UserFolder{}, + &UserFolderList{}, + &UserGroup{}, + &UserGroupList{}, + &UserPreference{}, + &UserPreferenceList{}, + &User{}, + &UserList{}, + &VirtualService{}, + &VirtualServiceList{}, + &WorkloadEntry{}, + &WorkloadEntryList{}, + ) + + // register the type in the scheme + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/compiler/example/output/generated/apis/global.tsm.tanzu.vmware.com/v1/types.go b/compiler/example/output/generated/apis/global.tsm.tanzu.vmware.com/v1/types.go new file mode 100644 index 000000000..c1486bc0b --- /dev/null +++ b/compiler/example/output/generated/apis/global.tsm.tanzu.vmware.com/v1/types.go @@ -0,0 +1,9531 @@ +// Code generated by nexus. DO NOT EDIT. + +package v1 + +import ( + customtsmtanzuvmwarecomv1 "nexustempmodule/apis/custom.tsm.tanzu.vmware.com/v1" + + "github.com/vmware-tanzu/graph-framework-for-microservices/nexus/nexus" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "nexustempmodule/common" +) + +// +k8s:openapi-gen=true +type Child struct { + Group string `json:"group" yaml:"group"` + Kind string `json:"kind" yaml:"kind"` + Name string `json:"name" yaml:"name"` +} + +// +k8s:openapi-gen=true +type Link struct { + Group string `json:"group" yaml:"group"` + Kind string `json:"kind" yaml:"kind"` + Name string `json:"name" yaml:"name"` +} + +// +k8s:openapi-gen=true +type NexusStatus struct { + SourceGeneration int64 `json:"sourceGeneration" yaml:"sourceGeneration"` + RemoteGeneration int64 `json:"remoteGeneration" yaml:"remoteGeneration"` +} + +/* ------------------- CRDs definitions ------------------- */ + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AccessToken struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AccessTokenSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AccessTokenNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AccessTokenNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AccessToken) CRDName() string { + return "accesstokens.global.tsm.tanzu.vmware.com" +} + +func (c *AccessToken) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AccessTokenSpec struct { + Ttl int `json:"ttl" yaml:"ttl"` + Created string `json:"created" yaml:"created"` + UserId string `json:"userId" yaml:"userId"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AccessTokenList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AccessToken `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ACPConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ACPConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ACPConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ACPConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ACPConfig) CRDName() string { + return "acpconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *ACPConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ACPConfigSpec struct { + DisplayName string `json:"displayName" yaml:"displayName"` + Gns string `json:"gns" yaml:"gns"` + Description string `json:"description" yaml:"description"` + Tags []string `json:"tags" yaml:"tags"` + ProjectId string `json:"projectId" yaml:"projectId"` + DestGroups customtsmtanzuvmwarecomv1.ResourceGroupIDs `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/config/policy/policy-config/policy-config.ts\", gofile:\"policy-config.go\", name: \"ResourceGroupIDs\")"` + SourceGroups customtsmtanzuvmwarecomv1.ResourceGroupIDs `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/config/policy/policy-config/policy-config.ts\", gofile:\"policy-config.go\", name: \"ResourceGroupIDs\")"` + Conditions []string `json:"conditions" yaml:"conditions"` + Actions customtsmtanzuvmwarecomv1.PolicyCfgActions `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/config/policy/policy-config/policy-config.ts\", gofile:\"policy-config.go\", name: \"PolicyCfgActions\")"` + DestSvcGroupsGvk map[string]Link `json:"destSvcGroupsGvk,omitempty" yaml:"destSvcGroupsGvk,omitempty" nexus:"links"` + SourceSvcGroupsGvk map[string]Link `json:"sourceSvcGroupsGvk,omitempty" yaml:"sourceSvcGroupsGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ACPConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ACPConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AdditionalAttributes struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AdditionalAttributesSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AdditionalAttributesNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AdditionalAttributesNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AdditionalAttributes) CRDName() string { + return "additionalattributeses.global.tsm.tanzu.vmware.com" +} + +func (c *AdditionalAttributes) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AdditionalAttributesSpec struct { + Name string `json:"name" yaml:"name"` + Value customtsmtanzuvmwarecomv1.AttributeValue `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"AttributeValue\")"` + Context string `json:"context" yaml:"context"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AdditionalAttributesList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AdditionalAttributes `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AllSparkServices struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AllSparkServicesSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AllSparkServicesNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AllSparkServicesNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AllSparkServices) CRDName() string { + return "allsparkserviceses.global.tsm.tanzu.vmware.com" +} + +func (c *AllSparkServices) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AllSparkServicesSpec struct { + GlobalRegistrationServiceGvk *Child `json:"globalRegistrationServiceGvk,omitempty" yaml:"globalRegistrationServiceGvk,omitempty" nexus:"child"` + LocalRegistrationServiceGvk *Child `json:"localRegistrationServiceGvk,omitempty" yaml:"localRegistrationServiceGvk,omitempty" nexus:"child"` + AwsConnectorGvk *Child `json:"awsConnectorGvk,omitempty" yaml:"awsConnectorGvk,omitempty" nexus:"child"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AllSparkServicesList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AllSparkServices `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Annotation struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AnnotationSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AnnotationNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AnnotationNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Annotation) CRDName() string { + return "annotations.global.tsm.tanzu.vmware.com" +} + +func (c *Annotation) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AnnotationSpec struct { + Name string `nexus-graphql-nullable:"false"` + Data string `nexus-graphql-tsm-directive:"@jsonencoded"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AnnotationList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Annotation `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ApiDiscoveryRT struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ApiDiscoveryRTSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ApiDiscoveryRTNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ApiDiscoveryRTNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ApiDiscoveryRT) CRDName() string { + return "apidiscoveryrts.global.tsm.tanzu.vmware.com" +} + +func (c *ApiDiscoveryRT) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ApiDiscoveryRTSpec struct { + Gnsid string `json:"gnsid" yaml:"gnsid"` + Selectors customtsmtanzuvmwarecomv1.ApiDiscoveryClusterResourceSelectorRT `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/common\", gofile:\"gns_api_discovery.go\", name:\"ApiDiscoveryClusterResourceSelectorRT\")"` + Spec customtsmtanzuvmwarecomv1.ApiDiscoveryApplicationConfigList `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsApiDiscovery\", gofile:\"gns_api_discovery.go\", name:\"ApiDiscoveryApplicationConfigList\")"` + CompressionEnabled bool `json:"compressionEnabled" yaml:"compressionEnabled"` + IsEndpointApiPrechecks customtsmtanzuvmwarecomv1.APIDiscoveryIsEndpointApiPrechecks `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsApiDiscovery\", gofile:\"gns_api_discovery.go\", name:\"APIDiscoveryIsEndpointApiPrechecks\")"` + ProcessingToggles customtsmtanzuvmwarecomv1.APIDiscoveryProcessingToggles `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsApiDiscovery\", gofile:\"gns_api_discovery.go\", name:\"APIDiscoveryProcessingToggles\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ApiDiscoveryRTList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ApiDiscoveryRT `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ApiDiscovery struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ApiDiscoverySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ApiDiscoveryNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ApiDiscoveryNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ApiDiscovery) CRDName() string { + return "apidiscoveries.global.tsm.tanzu.vmware.com" +} + +func (c *ApiDiscovery) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ApiDiscoverySpec struct { + Description string `json:"description" yaml:"description"` + Labels customtsmtanzuvmwarecomv1.LabelsList `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/common\", gofile:\"common.go\", name:\"LabelsList\")"` + Spec customtsmtanzuvmwarecomv1.ApiDiscoveryConfig `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsApiDiscovery\", name:\"ApiDiscoveryConfig\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ApiDiscoveryList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ApiDiscovery `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AppFolder struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AppFolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AppFolderNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AppFolderNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AppFolder) CRDName() string { + return "appfolders.global.tsm.tanzu.vmware.com" +} + +func (c *AppFolder) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AppFolderSpec struct { + AppGvk map[string]Child `json:"appGvk,omitempty" yaml:"appGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AppFolderList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AppFolder `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AppGroup struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AppGroupSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AppGroupNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AppGroupNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AppGroup) CRDName() string { + return "appgroups.global.tsm.tanzu.vmware.com" +} + +func (c *AppGroup) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AppGroupSpec struct { + Rules string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/resourceGroup\", gofile:\"resource_group.go\", name:\"Rules\")"` + ServicesGvk map[string]Link `json:"servicesGvk,omitempty" yaml:"servicesGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AppGroupList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AppGroup `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AppTemplateServiceDefinition struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AppTemplateServiceDefinitionSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AppTemplateServiceDefinitionNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AppTemplateServiceDefinitionNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AppTemplateServiceDefinition) CRDName() string { + return "apptemplateservicedefinitions.global.tsm.tanzu.vmware.com" +} + +func (c *AppTemplateServiceDefinition) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AppTemplateServiceDefinitionSpec struct { + Type string `nexus-graphql-nullable:"false"` + Version string `nexus-graphql-nullable:"false"` + Template string `nexus-graphql-nullable:"false"` + TemplateArgs []string `nexus-graphql-nullable:"false"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AppTemplateServiceDefinitionList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AppTemplateServiceDefinition `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AppTemplate struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AppTemplateSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AppTemplateNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AppTemplateNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AppTemplate) CRDName() string { + return "apptemplates.global.tsm.tanzu.vmware.com" +} + +func (c *AppTemplate) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AppTemplateSpec struct { + Version string `json:"version" yaml:"version"` + ServiceDefinitionsGvk map[string]Child `json:"serviceDefinitionsGvk,omitempty" yaml:"serviceDefinitionsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AppTemplateList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AppTemplate `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AppUser struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + + Status AppUserNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AppUserNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AppUser) CRDName() string { + return "appusers.global.tsm.tanzu.vmware.com" +} + +func (c *AppUser) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AppUserList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AppUser `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AppVersion struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AppVersionSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AppVersionNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AppVersionNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AppVersion) CRDName() string { + return "appversions.global.tsm.tanzu.vmware.com" +} + +func (c *AppVersion) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AppVersionSpec struct { + TemplateGvk *Link `json:"templateGvk,omitempty" yaml:"templateGvk,omitempty" nexus:"link"` + InventoryGvk *Link `json:"inventoryGvk,omitempty" yaml:"inventoryGvk,omitempty" nexus:"link"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AppVersionList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AppVersion `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type App struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AppSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AppNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AppNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *App) CRDName() string { + return "apps.global.tsm.tanzu.vmware.com" +} + +func (c *App) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AppSpec struct { + VersionGvk *Child `json:"versionGvk,omitempty" yaml:"versionGvk,omitempty" nexus:"child"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AppList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []App `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ApplicationInfo struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ApplicationInfoSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ApplicationInfoNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ApplicationInfoNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ApplicationInfo) CRDName() string { + return "applicationinfos.global.tsm.tanzu.vmware.com" +} + +func (c *ApplicationInfo) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ApplicationInfoSpec struct { + App string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/clusterLifecycle.ts\", gofile:\"cluster_lifecycle.go\", name:\"ApplicationInstance\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ApplicationInfoList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ApplicationInfo `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AttackDiscoveryRT struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AttackDiscoveryRTSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AttackDiscoveryRTNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AttackDiscoveryRTNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AttackDiscoveryRT) CRDName() string { + return "attackdiscoveryrts.global.tsm.tanzu.vmware.com" +} + +func (c *AttackDiscoveryRT) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AttackDiscoveryRTSpec struct { + Gnsid string `json:"gnsid" yaml:"gnsid"` + Selectors string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/common\", gofile:\"gns_attack_discovery.go\", name:\"AttackDiscoveryClusterResourceSelectorRT\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsAttackDiscovery\", gofile:\"gns_attack_discovery.go\", name:\"AttackDiscoveryApplicationConfigList\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AttackDiscoveryRTList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AttackDiscoveryRT `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AttackDiscovery struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AttackDiscoverySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AttackDiscoveryNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AttackDiscoveryNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AttackDiscovery) CRDName() string { + return "attackdiscoveries.global.tsm.tanzu.vmware.com" +} + +func (c *AttackDiscovery) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AttackDiscoverySpec struct { + Description string `json:"description" yaml:"description"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/common\", gofile:\"common.go\", name:\"LabelsList\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsAttackDiscovery\", gofile:\"gns_attack_discovery.go\", name:\"AttackDiscoveryConfig\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AttackDiscoveryList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AttackDiscovery `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AuthenticationPolicy struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AuthenticationPolicySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AuthenticationPolicyNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AuthenticationPolicyNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AuthenticationPolicy) CRDName() string { + return "authenticationpolicies.global.tsm.tanzu.vmware.com" +} + +func (c *AuthenticationPolicy) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AuthenticationPolicySpec struct { + Name string `json:"name" yaml:"name"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"Labels\")"` + Annotations string `nexus-graphql-tsm-directive:"@jsonencoded"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/inventory/cluster/domain/authentication-policy/istio.d.ts\", gofile:\"istio.go\", name:\"PolicySpec\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AuthenticationPolicyList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AuthenticationPolicy `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AutoscalerFolder struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AutoscalerFolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AutoscalerFolderNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AutoscalerFolderNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AutoscalerFolder) CRDName() string { + return "autoscalerfolders.global.tsm.tanzu.vmware.com" +} + +func (c *AutoscalerFolder) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AutoscalerFolderSpec struct { + AutoscalersGvk map[string]Child `json:"autoscalersGvk,omitempty" yaml:"autoscalersGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AutoscalerFolderList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AutoscalerFolder `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AutoscalerConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AutoscalerConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AutoscalerConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AutoscalerConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AutoscalerConfig) CRDName() string { + return "autoscalerconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *AutoscalerConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AutoscalerConfigSpec struct { + Name string `json:"name" yaml:"name"` + ConfigSource string `json:"configSource" yaml:"configSource"` + DesiredState string `nexus-graphql-tsm-directive:"@protobuf(file:\"./common-apis/protos/autoscaling/autoscaling.proto\", name:\"AutoscalingDefinition\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AutoscalerConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AutoscalerConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Autoscaler struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AutoscalerSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AutoscalerNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AutoscalerNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Autoscaler) CRDName() string { + return "autoscalers.global.tsm.tanzu.vmware.com" +} + +func (c *Autoscaler) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AutoscalerSpec struct { + Name string `json:"name" yaml:"name"` + ProjectId string `json:"projectId" yaml:"projectId"` + AutoscalerGvk *Link `json:"autoscalerGvk,omitempty" yaml:"autoscalerGvk,omitempty" nexus:"link"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AutoscalerList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Autoscaler `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AutoscalerCR struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AutoscalerCRSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AutoscalerCRNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AutoscalerCRNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AutoscalerCR) CRDName() string { + return "autoscalercrs.global.tsm.tanzu.vmware.com" +} + +func (c *AutoscalerCR) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AutoscalerCRSpec struct { + Name string `json:"name" yaml:"name"` + AutoscalingDefinition string `nexus-graphql-tsm-directive:"@protobuf(file:\"./common-apis/protos/autoscaling/autoscaling.proto\", name:\"AutoscalingDefinition\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AutoscalerCRList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AutoscalerCR `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AutoscalingPolicy struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AutoscalingPolicySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AutoscalingPolicyNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AutoscalingPolicyNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AutoscalingPolicy) CRDName() string { + return "autoscalingpolicies.global.tsm.tanzu.vmware.com" +} + +func (c *AutoscalingPolicy) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AutoscalingPolicySpec struct { + Name string `json:"name" yaml:"name"` + Description string `json:"description" yaml:"description"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"Labels\")"` + ServiceName string `json:"serviceName" yaml:"serviceName"` + AutoscalerSpec string `nexus-graphql-tsm-directive:"@protobuf(file:\"./common-apis/protos/autoscaling/autoscaling.proto\" name:\"AutoscalingDefinition\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AutoscalingPolicyList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AutoscalingPolicy `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AwsConnector struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AwsConnectorSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AwsConnectorNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AwsConnectorNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AwsConnector) CRDName() string { + return "awsconnectors.global.tsm.tanzu.vmware.com" +} + +func (c *AwsConnector) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AwsConnectorSpec struct { + GnsGvk map[string]Child `json:"gnsGvk,omitempty" yaml:"gnsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AwsConnectorList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AwsConnector `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Bucket struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec BucketSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status BucketNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type BucketNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Bucket) CRDName() string { + return "buckets.global.tsm.tanzu.vmware.com" +} + +func (c *Bucket) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type BucketSpec struct { + TemplateGvk *Link `json:"templateGvk,omitempty" yaml:"templateGvk,omitempty" nexus:"link"` + InventoryGvk *Link `json:"inventoryGvk,omitempty" yaml:"inventoryGvk,omitempty" nexus:"link"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type BucketList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Bucket `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type CertificateAuthorityRT struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec CertificateAuthorityRTSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status CertificateAuthorityRTNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type CertificateAuthorityRTNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *CertificateAuthorityRT) CRDName() string { + return "certificateauthorityrts.global.tsm.tanzu.vmware.com" +} + +func (c *CertificateAuthorityRT) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type CertificateAuthorityRTSpec struct { + Url string `json:"url" yaml:"url"` + Type string `json:"type" yaml:"type"` + TemplatePath string `json:"templatePath" yaml:"templatePath"` + SecretRef string `json:"secretRef" yaml:"secretRef"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type CertificateAuthorityRTList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []CertificateAuthorityRT `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type CertificateAuthorityConfigN struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec CertificateAuthorityConfigNSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status CertificateAuthorityConfigNNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type CertificateAuthorityConfigNNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *CertificateAuthorityConfigN) CRDName() string { + return "certificateauthorityconfigns.global.tsm.tanzu.vmware.com" +} + +func (c *CertificateAuthorityConfigN) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type CertificateAuthorityConfigNSpec struct { + Config string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/certificateAuthority\", gofile:\"certificate_authority.go\", name: \"CertificateAuthorityConfig\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type CertificateAuthorityConfigNList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []CertificateAuthorityConfigN `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type CertificateConfigN struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec CertificateConfigNSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status CertificateConfigNNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type CertificateConfigNNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *CertificateConfigN) CRDName() string { + return "certificateconfigns.global.tsm.tanzu.vmware.com" +} + +func (c *CertificateConfigN) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type CertificateConfigNSpec struct { + ProjectId string `json:"projectId" yaml:"projectId"` + BeginsOn string `json:"beginsOn" yaml:"beginsOn"` + ExpiresOn string `json:"expiresOn" yaml:"expiresOn"` + IssuedToCN string `json:"issuedToCN" yaml:"issuedToCN"` + Config string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/certificate\", gofile:\"certificate.go\", name: \"CertificateConfig\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type CertificateConfigNList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []CertificateConfigN `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type CertificateRequest struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec CertificateRequestSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status CertificateRequestNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type CertificateRequestNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *CertificateRequest) CRDName() string { + return "certificaterequests.global.tsm.tanzu.vmware.com" +} + +func (c *CertificateRequest) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type CertificateRequestSpec struct { + Name string `json:"name" yaml:"name"` + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + IssuerRef string `nexus-graphql-tsm-directive:"@jsonencoded"` + Request string `json:"request" yaml:"request"` + Duration string `json:"duration" yaml:"duration"` + Uid string `json:"uid" yaml:"uid"` + IsCA bool `json:"isCA" yaml:"isCA"` + Username string `json:"username" yaml:"username"` + Usages string `nexus-graphql-tsm-directive:"@jsonencoded"` + Groups string `nexus-graphql-tsm-directive:"@jsonencoded"` + Extra string `nexus-graphql-tsm-directive:"@jsonencoded"` + Status string `nexus-graphql-tsm-directive:"@jsonencoded"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type CertificateRequestList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []CertificateRequest `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Certificate struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec CertificateSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status CertificateNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type CertificateNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Certificate) CRDName() string { + return "certificates.global.tsm.tanzu.vmware.com" +} + +func (c *Certificate) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type CertificateSpec struct { + Name string `json:"name" yaml:"name"` + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + IssuerRef string `nexus-graphql-tsm-directive:"@jsonencoded"` + PrivateKey string `nexus-graphql-tsm-directive:"@jsonencoded"` + Subject string `nexus-graphql-tsm-directive:"@jsonencoded"` + CommonName string `json:"commonName" yaml:"commonName"` + Duration string `json:"duration" yaml:"duration"` + DnsNames []string `json:"dnsNames" yaml:"dnsNames"` + IpAddresses []string `json:"ipAddresses" yaml:"ipAddresses"` + SecretName string `json:"secretName" yaml:"secretName"` + RenewBefore string `json:"renewBefore" yaml:"renewBefore"` + EmailAddresses []string `json:"emailAddresses" yaml:"emailAddresses"` + Uris []string `json:"uris" yaml:"uris"` + SecretTemplate string `nexus-graphql-tsm-directive:"@jsonencoded"` + KeyStores string `nexus-graphql-tsm-directive:"@jsonencoded"` + IsCA bool `json:"isCA" yaml:"isCA"` + EncodeUsagesInRequest string `nexus-graphql-tsm-directive:"@jsonencoded"` + Usages string `nexus-graphql-tsm-directive:"@jsonencoded"` + RevisionHistoryLimit int `json:"revisionHistoryLimit" yaml:"revisionHistoryLimit"` + AdditionalOutputFormats string `nexus-graphql-tsm-directive:"@jsonencoded"` + Status string `nexus-graphql-tsm-directive:"@jsonencoded"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type CertificateList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Certificate `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ClusterConfigFolder struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ClusterConfigFolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ClusterConfigFolderNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ClusterConfigFolderNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ClusterConfigFolder) CRDName() string { + return "clusterconfigfolders.global.tsm.tanzu.vmware.com" +} + +func (c *ClusterConfigFolder) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ClusterConfigFolderSpec struct { + ClustersGvk map[string]Child `json:"clustersGvk,omitempty" yaml:"clustersGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ClusterConfigFolderList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ClusterConfigFolder `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ClusterConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ClusterConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ClusterConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ClusterConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ClusterConfig) CRDName() string { + return "clusterconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *ClusterConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ClusterConfigSpec struct { + Name string `json:"name" yaml:"name"` + DomainsGvk map[string]Child `json:"domainsGvk,omitempty" yaml:"domainsGvk,omitempty" nexus:"children"` + HostConfigGvk map[string]Child `json:"hostConfigGvk,omitempty" yaml:"hostConfigGvk,omitempty" nexus:"children"` + DnsConfigFolderGvk *Child `json:"dnsConfigFolderGvk,omitempty" yaml:"dnsConfigFolderGvk,omitempty" nexus:"child"` + DnsProbesConfigFolderGvk *Child `json:"dnsProbesConfigFolderGvk,omitempty" yaml:"dnsProbesConfigFolderGvk,omitempty" nexus:"child"` + LogFolderGvk *Child `json:"logFolderGvk,omitempty" yaml:"logFolderGvk,omitempty" nexus:"child"` + GnsBindingGvk map[string]Child `json:"gnsBindingGvk,omitempty" yaml:"gnsBindingGvk,omitempty" nexus:"children"` + SecurityContextConstraintsGvk map[string]Child `json:"securityContextConstraintsGvk,omitempty" yaml:"securityContextConstraintsGvk,omitempty" nexus:"children"` + ResourceGroupGvk *Child `json:"resourceGroupGvk,omitempty" yaml:"resourceGroupGvk,omitempty" nexus:"child"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ClusterConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ClusterConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ClusterFolder struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ClusterFolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ClusterFolderNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ClusterFolderNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ClusterFolder) CRDName() string { + return "clusterfolders.global.tsm.tanzu.vmware.com" +} + +func (c *ClusterFolder) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ClusterFolderSpec struct { + Name string `json:"name" yaml:"name"` + ClustersGvk map[string]Child `json:"clustersGvk,omitempty" yaml:"clustersGvk,omitempty" nexus:"children"` + RemoteGatewayServiceConfigsGvk map[string]Child `json:"remoteGatewayServiceConfigsGvk,omitempty" yaml:"remoteGatewayServiceConfigsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ClusterFolderList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ClusterFolder `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ClusterSettings struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ClusterSettingsSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ClusterSettingsNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ClusterSettingsNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ClusterSettings) CRDName() string { + return "clustersettingses.global.tsm.tanzu.vmware.com" +} + +func (c *ClusterSettings) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ClusterSettingsSpec struct { + ProjectId string `json:"projectId" yaml:"projectId"` + DisplayName string `json:"displayName" yaml:"displayName"` + Description string `json:"description" yaml:"description"` + Tags string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name: \"StringList\")"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"Labels\")"` + AutoInstallServiceMesh bool `json:"autoInstallServiceMesh" yaml:"autoInstallServiceMesh"` + EnableNamespaceExclusions bool `json:"enableNamespaceExclusions" yaml:"enableNamespaceExclusions"` + NamespaceExclusions string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/common\", gofile:\"common.go\", name:\"Conditions\")"` + SystemNamespaceExclusions string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/common\", gofile:\"common.go\", name:\"Conditions\")"` + AgentDomain string `json:"agentDomain" yaml:"agentDomain"` + ProxyConfig string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/clusterLifecycle\", gofile:\"cluster_lifecycle.go\", name: \"ProxyConfigRequest\")"` + AutoInstallServiceMeshConfig string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/clusterLifecycle\", gofile:\"cluster_lifecycle.go\", name: \"AutoInstallServiceMeshConfig\")"` + RegistryAccount string `json:"registryAccount" yaml:"registryAccount"` + CaLabels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"CaLabels\")"` + EnableInternalGateway bool `json:"enableInternalGateway" yaml:"enableInternalGateway"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ClusterSettingsList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ClusterSettings `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Cluster struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ClusterSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ClusterNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ClusterNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Cluster) CRDName() string { + return "clusters.global.tsm.tanzu.vmware.com" +} + +func (c *Cluster) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ClusterSpec struct { + Name string `json:"name" yaml:"name"` + Uuid string `json:"uuid" yaml:"uuid"` + Connected bool `json:"connected" yaml:"connected"` + IstioState string `json:"istioState" yaml:"istioState"` + Status string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/clusterLifecycle.ts\", gofile:\"cluster_lifecycle.go\", name:\"ClusterStatus\")"` + StatusHistory string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/clusterLifecycle.ts\", gofile:\"cluster_lifecycle.go\", name:\"ClusterStatusHistory\")"` + Castatus string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/clusterLifecycle.ts\", gofile:\"cluster_lifecycle.go\", name:\"CaStatus\")"` + CaStatusHistory string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/clusterLifecycle.ts\", gofile:\"cluster_lifecycle.go\", name:\"CaStatusHistory\")"` + ComponentStatuses string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/clusterLifecycle.ts\", gofile:\"cluster_lifecycle.go\", name:\"ComponentStatuses\")"` + ComponentStatusesHistory string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/clusterLifecycle.ts\", gofile:\"cluster_lifecycle.go\", name:\"ComponentStatusesHistory\")"` + Type string `json:"type" yaml:"type"` + ProjectId string `json:"projectId" yaml:"projectId"` + ConnectionStatusGvk *Child `json:"connectionStatusGvk,omitempty" yaml:"connectionStatusGvk,omitempty" nexus:"child"` + AppsGvk map[string]Child `json:"appsGvk,omitempty" yaml:"appsGvk,omitempty" nexus:"children"` + DnsProbeStatusGvk map[string]Child `json:"dnsProbeStatusGvk,omitempty" yaml:"dnsProbeStatusGvk,omitempty" nexus:"children"` + SecurityContextConstraintsGvk map[string]Child `json:"securityContextConstraintsGvk,omitempty" yaml:"securityContextConstraintsGvk,omitempty" nexus:"children"` + DomainsGvk map[string]Child `json:"domainsGvk,omitempty" yaml:"domainsGvk,omitempty" nexus:"children"` + NodesGvk map[string]Child `json:"nodesGvk,omitempty" yaml:"nodesGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ClusterList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Cluster `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ConfigMap struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ConfigMapSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ConfigMapNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ConfigMapNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ConfigMap) CRDName() string { + return "configmaps.global.tsm.tanzu.vmware.com" +} + +func (c *ConfigMap) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ConfigMapSpec struct { + Name string `json:"name" yaml:"name"` + Annotations string `nexus-graphql-tsm-directive:"@jsonencoded"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"Labels\")"` + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + Data string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/inventory/cluster/domain/config-map/configmap.d.ts\", gofile:\"configmap.go\", name:\"ConfigMapData\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ConfigMapList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ConfigMap `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Config struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Config) CRDName() string { + return "configs.global.tsm.tanzu.vmware.com" +} + +func (c *Config) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ConfigSpec struct { + ResourceGroupsGvk *Child `json:"resourceGroupsGvk,omitempty" yaml:"resourceGroupsGvk,omitempty" nexus:"child"` + GlobalNamespaceGvk *Child `json:"globalNamespaceGvk,omitempty" yaml:"globalNamespaceGvk,omitempty" nexus:"child"` + PolicyGvk *Child `json:"policyGvk,omitempty" yaml:"policyGvk,omitempty" nexus:"child"` + TemplatesGvk *Child `json:"templatesGvk,omitempty" yaml:"templatesGvk,omitempty" nexus:"child"` + ProgressiveUpgradeGvk *Child `json:"progressiveUpgradeGvk,omitempty" yaml:"progressiveUpgradeGvk,omitempty" nexus:"child"` + ExternalPluginsGvk *Child `json:"externalPluginsGvk,omitempty" yaml:"externalPluginsGvk,omitempty" nexus:"child"` + CertificatesGvk map[string]Child `json:"certificatesGvk,omitempty" yaml:"certificatesGvk,omitempty" nexus:"children"` + ExternalAccountsGvk map[string]Child `json:"externalAccountsGvk,omitempty" yaml:"externalAccountsGvk,omitempty" nexus:"children"` + ExternalAuditStorageGvk *Child `json:"externalAuditStorageGvk,omitempty" yaml:"externalAuditStorageGvk,omitempty" nexus:"child"` + ExternalDNSGvk map[string]Child `json:"externalDNSGvk,omitempty" yaml:"externalDNSGvk,omitempty" nexus:"children"` + ExternalLBGvk map[string]Child `json:"externalLBGvk,omitempty" yaml:"externalLBGvk,omitempty" nexus:"children"` + AutoscalerFolderGvk *Child `json:"autoscalerFolderGvk,omitempty" yaml:"autoscalerFolderGvk,omitempty" nexus:"child"` + ClustersGvk *Child `json:"clustersGvk,omitempty" yaml:"clustersGvk,omitempty" nexus:"child"` + ServiceLevelObjectiveGvk *Child `json:"serviceLevelObjectiveGvk,omitempty" yaml:"serviceLevelObjectiveGvk,omitempty" nexus:"child"` + FeatureFlagsGvk map[string]Child `json:"featureFlagsGvk,omitempty" yaml:"featureFlagsGvk,omitempty" nexus:"children"` + ProjectsGvk map[string]Child `json:"projectsGvk,omitempty" yaml:"projectsGvk,omitempty" nexus:"children"` + ServiceDirectoryGvk map[string]Child `json:"serviceDirectoryGvk,omitempty" yaml:"serviceDirectoryGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Config `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ConnectionStatus struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ConnectionStatusSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ConnectionStatusNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ConnectionStatusNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ConnectionStatus) CRDName() string { + return "connectionstatuses.global.tsm.tanzu.vmware.com" +} + +func (c *ConnectionStatus) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ConnectionStatusSpec struct { + Connected bool `json:"connected" yaml:"connected"` + Message string `json:"message" yaml:"message"` + Code int `json:"code" yaml:"code"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ConnectionStatusList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ConnectionStatus `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type DataFolderDomainCluster struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + + Status DataFolderDomainClusterNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DataFolderDomainClusterNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *DataFolderDomainCluster) CRDName() string { + return "datafolderdomainclusters.global.tsm.tanzu.vmware.com" +} + +func (c *DataFolderDomainCluster) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DataFolderDomainClusterList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []DataFolderDomainCluster `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type DataFolderDomainServiceVersion struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + + Status DataFolderDomainServiceVersionNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DataFolderDomainServiceVersionNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *DataFolderDomainServiceVersion) CRDName() string { + return "datafolderdomainserviceversions.global.tsm.tanzu.vmware.com" +} + +func (c *DataFolderDomainServiceVersion) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DataFolderDomainServiceVersionList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []DataFolderDomainServiceVersion `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type DataFolderDomainService struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec DataFolderDomainServiceSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status DataFolderDomainServiceNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DataFolderDomainServiceNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *DataFolderDomainService) CRDName() string { + return "datafolderdomainservices.global.tsm.tanzu.vmware.com" +} + +func (c *DataFolderDomainService) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type DataFolderDomainServiceSpec struct { + VersionsGvk map[string]Child `json:"versionsGvk,omitempty" yaml:"versionsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DataFolderDomainServiceList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []DataFolderDomainService `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type DataFolderDomain struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec DataFolderDomainSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status DataFolderDomainNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DataFolderDomainNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *DataFolderDomain) CRDName() string { + return "datafolderdomains.global.tsm.tanzu.vmware.com" +} + +func (c *DataFolderDomain) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type DataFolderDomainSpec struct { + ClusterGvk *Child `json:"clusterGvk,omitempty" yaml:"clusterGvk,omitempty" nexus:"child"` + ServiceGvk map[string]Child `json:"serviceGvk,omitempty" yaml:"serviceGvk,omitempty" nexus:"children"` + DatabaseGvk *Child `json:"databaseGvk,omitempty" yaml:"databaseGvk,omitempty" nexus:"child"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DataFolderDomainList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []DataFolderDomain `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type DataFolder struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec DataFolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status DataFolderNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DataFolderNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *DataFolder) CRDName() string { + return "datafolders.global.tsm.tanzu.vmware.com" +} + +func (c *DataFolder) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type DataFolderSpec struct { + DomainGvk *Child `json:"domainGvk,omitempty" yaml:"domainGvk,omitempty" nexus:"child"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DataFolderList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []DataFolder `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type DataGroup struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec DataGroupSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status DataGroupNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DataGroupNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *DataGroup) CRDName() string { + return "datagroups.global.tsm.tanzu.vmware.com" +} + +func (c *DataGroup) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type DataGroupSpec struct { + DisplayName string `json:"displayName" yaml:"displayName"` + Description string `json:"description" yaml:"description"` + Scope string `json:"scope" yaml:"scope"` + Color string `json:"color" yaml:"color"` + Rules string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/resourceGroup\", gofile:\"resource_group.go\", name:\"Rules\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DataGroupList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []DataGroup `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type DataTemplate struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + + Status DataTemplateNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DataTemplateNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *DataTemplate) CRDName() string { + return "datatemplates.global.tsm.tanzu.vmware.com" +} + +func (c *DataTemplate) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DataTemplateList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []DataTemplate `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Database struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec DatabaseSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status DatabaseNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DatabaseNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Database) CRDName() string { + return "databases.global.tsm.tanzu.vmware.com" +} + +func (c *Database) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type DatabaseSpec struct { + TablesGvk map[string]Child `json:"tablesGvk,omitempty" yaml:"tablesGvk,omitempty" nexus:"children"` + DirectoriesGvk map[string]Child `json:"directoriesGvk,omitempty" yaml:"directoriesGvk,omitempty" nexus:"children"` + BucketsGvk map[string]Child `json:"bucketsGvk,omitempty" yaml:"bucketsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DatabaseList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Database `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type DCRegion struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec DCRegionSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status DCRegionNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DCRegionNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *DCRegion) CRDName() string { + return "dcregions.global.tsm.tanzu.vmware.com" +} + +func (c *DCRegion) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type DCRegionSpec struct { + Name string `json:"name" yaml:"name"` + ZonesGvk map[string]Child `json:"zonesGvk,omitempty" yaml:"zonesGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DCRegionList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []DCRegion `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type DCZone struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec DCZoneSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status DCZoneNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DCZoneNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *DCZone) CRDName() string { + return "dczones.global.tsm.tanzu.vmware.com" +} + +func (c *DCZone) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type DCZoneSpec struct { + Name string `json:"name" yaml:"name"` + ClustersGvk map[string]Link `json:"clustersGvk,omitempty" yaml:"clustersGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DCZoneList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []DCZone `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type DestinationRule struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec DestinationRuleSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status DestinationRuleNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DestinationRuleNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *DestinationRule) CRDName() string { + return "destinationrules.global.tsm.tanzu.vmware.com" +} + +func (c *DestinationRule) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type DestinationRuleSpec struct { + Name string `json:"name" yaml:"name"` + Annotations string `nexus-graphql-tsm-directive:"@jsonencoded"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded"` + CreationTimestamp string `json:"creationTimestamp" yaml:"creationTimestamp"` + ApiLink string `json:"apiLink" yaml:"apiLink"` + Uid string `json:"uid" yaml:"uid"` + Host string `json:"host" yaml:"host"` + TrafficPolicy string `nexus-graphql-tsm-directive:"@jsonencoded"` + Subsets string `nexus-graphql-tsm-directive:"@jsonencoded"` + ExportTo []string `nexus-graphql-nullable:"false"` + ServiceGvk *Link `json:"serviceGvk,omitempty" yaml:"serviceGvk,omitempty" nexus:"link"` + ServiceDeploymentsGvk map[string]Link `json:"serviceDeploymentsGvk,omitempty" yaml:"serviceDeploymentsGvk,omitempty" nexus:"links"` + ServiceReplicaSetsGvk map[string]Link `json:"serviceReplicaSetsGvk,omitempty" yaml:"serviceReplicaSetsGvk,omitempty" nexus:"links"` + ServiceStatefulSetsGvk map[string]Link `json:"serviceStatefulSetsGvk,omitempty" yaml:"serviceStatefulSetsGvk,omitempty" nexus:"links"` + ServiceDaemonSetsGvk map[string]Link `json:"serviceDaemonSetsGvk,omitempty" yaml:"serviceDaemonSetsGvk,omitempty" nexus:"links"` + ServiceJobsGvk map[string]Link `json:"serviceJobsGvk,omitempty" yaml:"serviceJobsGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DestinationRuleList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []DestinationRule `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Directory struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec DirectorySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status DirectoryNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DirectoryNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Directory) CRDName() string { + return "directories.global.tsm.tanzu.vmware.com" +} + +func (c *Directory) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type DirectorySpec struct { + TemplateGvk *Link `json:"templateGvk,omitempty" yaml:"templateGvk,omitempty" nexus:"link"` + InventoryGvk *Link `json:"inventoryGvk,omitempty" yaml:"inventoryGvk,omitempty" nexus:"link"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DirectoryList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Directory `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type DNSConfigFolder struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec DNSConfigFolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status DNSConfigFolderNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DNSConfigFolderNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *DNSConfigFolder) CRDName() string { + return "dnsconfigfolders.global.tsm.tanzu.vmware.com" +} + +func (c *DNSConfigFolder) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type DNSConfigFolderSpec struct { + DnsConfigGvk map[string]Child `json:"dnsConfigGvk,omitempty" yaml:"dnsConfigGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DNSConfigFolderList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []DNSConfigFolder `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type DNSConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec DNSConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status DNSConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DNSConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *DNSConfig) CRDName() string { + return "dnsconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *DNSConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type DNSConfigSpec struct { + OwnedBy string `json:"ownedBy" yaml:"ownedBy"` + DnsSuffix string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/runtime/runtime.ts\", gofile:\"runtime.go\", name:\"DNSList\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DNSConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []DNSConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type DNSProbeConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec DNSProbeConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status DNSProbeConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DNSProbeConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *DNSProbeConfig) CRDName() string { + return "dnsprobeconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *DNSProbeConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type DNSProbeConfigSpec struct { + Domain string `json:"domain" yaml:"domain"` + CreateTimestamp string `json:"createTimestamp" yaml:"createTimestamp"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DNSProbeConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []DNSProbeConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type DNSProbeStatus struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec DNSProbeStatusSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status DNSProbeStatusNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DNSProbeStatusNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *DNSProbeStatus) CRDName() string { + return "dnsprobestatuses.global.tsm.tanzu.vmware.com" +} + +func (c *DNSProbeStatus) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type DNSProbeStatusSpec struct { + Name string `json:"name" yaml:"name"` + Domain string `json:"domain" yaml:"domain"` + Success bool `json:"success" yaml:"success"` + UpdateTimestamp string `json:"updateTimestamp" yaml:"updateTimestamp"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DNSProbeStatusList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []DNSProbeStatus `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type DNSProbesConfigFolder struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec DNSProbesConfigFolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status DNSProbesConfigFolderNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DNSProbesConfigFolderNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *DNSProbesConfigFolder) CRDName() string { + return "dnsprobesconfigfolders.global.tsm.tanzu.vmware.com" +} + +func (c *DNSProbesConfigFolder) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type DNSProbesConfigFolderSpec struct { + DnsProbeConfigsGvk map[string]Child `json:"dnsProbeConfigsGvk,omitempty" yaml:"dnsProbeConfigsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DNSProbesConfigFolderList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []DNSProbesConfigFolder `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type DomainConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec DomainConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status DomainConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DomainConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *DomainConfig) CRDName() string { + return "domainconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *DomainConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type DomainConfigSpec struct { + Name string `json:"name" yaml:"name"` + OwnedBy string `json:"ownedBy" yaml:"ownedBy"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"Labels\")"` + PolicyGvk map[string]Child `json:"policyGvk,omitempty" yaml:"policyGvk,omitempty" nexus:"children"` + LabelConfigGvk *Child `json:"labelConfigGvk,omitempty" yaml:"labelConfigGvk,omitempty" nexus:"child"` + NetworkAttachmentDefinitionGvk map[string]Child `json:"networkAttachmentDefinitionGvk,omitempty" yaml:"networkAttachmentDefinitionGvk,omitempty" nexus:"children"` + ServicesGvk map[string]Child `json:"servicesGvk,omitempty" yaml:"servicesGvk,omitempty" nexus:"children"` + ServiceEntriesGvk map[string]Child `json:"serviceEntriesGvk,omitempty" yaml:"serviceEntriesGvk,omitempty" nexus:"children"` + GatewayConfigGvk map[string]Child `json:"gatewayConfigGvk,omitempty" yaml:"gatewayConfigGvk,omitempty" nexus:"children"` + AutoscalersGvk map[string]Child `json:"autoscalersGvk,omitempty" yaml:"autoscalersGvk,omitempty" nexus:"children"` + HostConfigV2Gvk map[string]Child `json:"hostConfigV2Gvk,omitempty" yaml:"hostConfigV2Gvk,omitempty" nexus:"children"` + InboundAuthenticationConfigGvk map[string]Child `json:"inboundAuthenticationConfigGvk,omitempty" yaml:"inboundAuthenticationConfigGvk,omitempty" nexus:"children"` + SlosGvk map[string]Child `json:"slosGvk,omitempty" yaml:"slosGvk,omitempty" nexus:"children"` + SecretsGvk map[string]Child `json:"secretsGvk,omitempty" yaml:"secretsGvk,omitempty" nexus:"children"` + ExternalServicesGvk map[string]Child `json:"externalServicesGvk,omitempty" yaml:"externalServicesGvk,omitempty" nexus:"children"` + ApiDiscoveryGvk map[string]Child `json:"apiDiscoveryGvk,omitempty" yaml:"apiDiscoveryGvk,omitempty" nexus:"children"` + GeoDiscoveryGvk map[string]Child `json:"geoDiscoveryGvk,omitempty" yaml:"geoDiscoveryGvk,omitempty" nexus:"children"` + PiiDiscoveryGvk map[string]Child `json:"piiDiscoveryGvk,omitempty" yaml:"piiDiscoveryGvk,omitempty" nexus:"children"` + AttackDiscoveryGvk map[string]Child `json:"attackDiscoveryGvk,omitempty" yaml:"attackDiscoveryGvk,omitempty" nexus:"children"` + UserDiscoveryGvk map[string]Child `json:"userDiscoveryGvk,omitempty" yaml:"userDiscoveryGvk,omitempty" nexus:"children"` + PublicServiceGvk map[string]Child `json:"publicServiceGvk,omitempty" yaml:"publicServiceGvk,omitempty" nexus:"children"` + GnsAccessControlPolicyGvk map[string]Child `json:"gnsAccessControlPolicyGvk,omitempty" yaml:"gnsAccessControlPolicyGvk,omitempty" nexus:"children"` + GnsSchemaViolationDiscoveryGvk map[string]Child `json:"gnsSchemaViolationDiscoveryGvk,omitempty" yaml:"gnsSchemaViolationDiscoveryGvk,omitempty" nexus:"children"` + GnsSegmentationPolicyGvk map[string]Child `json:"gnsSegmentationPolicyGvk,omitempty" yaml:"gnsSegmentationPolicyGvk,omitempty" nexus:"children"` + CertificateAuthorityGvk map[string]Child `json:"certificateAuthorityGvk,omitempty" yaml:"certificateAuthorityGvk,omitempty" nexus:"children"` + GnsEndpointsConfigGvk map[string]Child `json:"gnsEndpointsConfigGvk,omitempty" yaml:"gnsEndpointsConfigGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DomainConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []DomainConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Domain struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec DomainSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status DomainNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type DomainNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Domain) CRDName() string { + return "domains.global.tsm.tanzu.vmware.com" +} + +func (c *Domain) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type DomainSpec struct { + Name string `json:"name" yaml:"name"` + EnviornmentType string `nexus-graphql-nullable:"false"` + ApiLink string `json:"apiLink" yaml:"apiLink"` + Annotations string `nexus-graphql-tsm-directive:"@jsonencoded"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded"` + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + SecretHashesGvk map[string]Child `json:"secretHashesGvk,omitempty" yaml:"secretHashesGvk,omitempty" nexus:"children"` + ServiceInstancesGvk map[string]Child `json:"serviceInstancesGvk,omitempty" yaml:"serviceInstancesGvk,omitempty" nexus:"children"` + ServiceDeploymentsGvk map[string]Child `json:"serviceDeploymentsGvk,omitempty" yaml:"serviceDeploymentsGvk,omitempty" nexus:"children"` + ServiceStatefulSetsGvk map[string]Child `json:"serviceStatefulSetsGvk,omitempty" yaml:"serviceStatefulSetsGvk,omitempty" nexus:"children"` + ServiceDaemonSetsGvk map[string]Child `json:"serviceDaemonSetsGvk,omitempty" yaml:"serviceDaemonSetsGvk,omitempty" nexus:"children"` + ServiceReplicaSetsGvk map[string]Child `json:"serviceReplicaSetsGvk,omitempty" yaml:"serviceReplicaSetsGvk,omitempty" nexus:"children"` + ServiceCronJobsGvk map[string]Child `json:"serviceCronJobsGvk,omitempty" yaml:"serviceCronJobsGvk,omitempty" nexus:"children"` + ServiceJobsGvk map[string]Child `json:"serviceJobsGvk,omitempty" yaml:"serviceJobsGvk,omitempty" nexus:"children"` + VirtualServicesGvk map[string]Child `json:"virtualServicesGvk,omitempty" yaml:"virtualServicesGvk,omitempty" nexus:"children"` + ServiceEntryGvk map[string]Child `json:"serviceEntryGvk,omitempty" yaml:"serviceEntryGvk,omitempty" nexus:"children"` + WorkloadEntryGvk map[string]Child `json:"workloadEntryGvk,omitempty" yaml:"workloadEntryGvk,omitempty" nexus:"children"` + DestinationRulesGvk map[string]Child `json:"destinationRulesGvk,omitempty" yaml:"destinationRulesGvk,omitempty" nexus:"children"` + ServicesGvk map[string]Child `json:"servicesGvk,omitempty" yaml:"servicesGvk,omitempty" nexus:"children"` + EndpointsGvk map[string]Child `json:"endpointsGvk,omitempty" yaml:"endpointsGvk,omitempty" nexus:"children"` + GatewaysGvk map[string]Child `json:"gatewaysGvk,omitempty" yaml:"gatewaysGvk,omitempty" nexus:"children"` + AuthenticationPoliciesGvk map[string]Child `json:"authenticationPoliciesGvk,omitempty" yaml:"authenticationPoliciesGvk,omitempty" nexus:"children"` + ConfigmapGvk map[string]Child `json:"configmapGvk,omitempty" yaml:"configmapGvk,omitempty" nexus:"children"` + EnvoyfilterGvk map[string]Child `json:"envoyfilterGvk,omitempty" yaml:"envoyfilterGvk,omitempty" nexus:"children"` + AutoscalersGvk map[string]Child `json:"autoscalersGvk,omitempty" yaml:"autoscalersGvk,omitempty" nexus:"children"` + PeerAuthenticationGvk map[string]Child `json:"peerAuthenticationGvk,omitempty" yaml:"peerAuthenticationGvk,omitempty" nexus:"children"` + KnativeIngressesGvk map[string]Child `json:"knativeIngressesGvk,omitempty" yaml:"knativeIngressesGvk,omitempty" nexus:"children"` + NetworkAttachmentDefinitionGvk map[string]Child `json:"networkAttachmentDefinitionGvk,omitempty" yaml:"networkAttachmentDefinitionGvk,omitempty" nexus:"children"` + IssuersGvk map[string]Child `json:"issuersGvk,omitempty" yaml:"issuersGvk,omitempty" nexus:"children"` + CertificatesGvk map[string]Child `json:"certificatesGvk,omitempty" yaml:"certificatesGvk,omitempty" nexus:"children"` + CertificateRequestsGvk map[string]Child `json:"certificateRequestsGvk,omitempty" yaml:"certificateRequestsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DomainList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Domain `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Endpoints struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec EndpointsSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status EndpointsNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type EndpointsNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Endpoints) CRDName() string { + return "endpointses.global.tsm.tanzu.vmware.com" +} + +func (c *Endpoints) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type EndpointsSpec struct { + Name string `json:"name" yaml:"name"` + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + Subsets string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"EndpointSubsets\")"` + GnsId string `json:"gnsId" yaml:"gnsId"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type EndpointsList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Endpoints `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type EnvoyFilter struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec EnvoyFilterSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status EnvoyFilterNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type EnvoyFilterNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *EnvoyFilter) CRDName() string { + return "envoyfilters.global.tsm.tanzu.vmware.com" +} + +func (c *EnvoyFilter) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type EnvoyFilterSpec struct { + Name string `json:"name" yaml:"name"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"Labels\")"` + Annotations string `nexus-graphql-tsm-directive:"@jsonencoded"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/inventory/cluster/domain/envoy-filter/envoyfilter.d.ts\", gofile:\"envoyfilter.go\", name:\"EnvoyFilterSpec\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type EnvoyFilterList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []EnvoyFilter `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalAccountConfigN struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalAccountConfigNSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalAccountConfigNNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalAccountConfigNNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalAccountConfigN) CRDName() string { + return "externalaccountconfigns.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalAccountConfigN) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalAccountConfigNSpec struct { + Config string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/externalAccount\", gofile:\"external_account.go\", name: \"ExternalAccountConfig\")"` + ProxyConfig string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/externalAccount\", gofile:\"external_account.go\", name: \"ExternalAccountProxyConfig\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalAccountConfigNList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalAccountConfigN `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalAuditStorage struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalAuditStorageSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalAuditStorageNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalAuditStorageNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalAuditStorage) CRDName() string { + return "externalauditstorages.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalAuditStorage) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalAuditStorageSpec struct { + Config string `nexus-graphql-nullable:"false" nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/externalAuditStorage\", gofile:\"external-audit-storage.go\", name: \"ExternalAuditStorageConfig\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalAuditStorageList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalAuditStorage `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalDNSConfigN struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalDNSConfigNSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalDNSConfigNNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalDNSConfigNNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalDNSConfigN) CRDName() string { + return "externaldnsconfigns.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalDNSConfigN) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalDNSConfigNSpec struct { + Config string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/externalDNS\", gofile:\"external_dns.go\", name: \"ExternalDNSConfig\")"` + AccountGvk *Link `json:"accountGvk,omitempty" yaml:"accountGvk,omitempty" nexus:"link"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalDNSConfigNList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalDNSConfigN `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalDNSInventoryHealthCheck struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalDNSInventoryHealthCheckSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalDNSInventoryHealthCheckNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalDNSInventoryHealthCheckNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalDNSInventoryHealthCheck) CRDName() string { + return "externaldnsinventoryhealthchecks.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalDNSInventoryHealthCheck) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalDNSInventoryHealthCheckSpec struct { + Name string `json:"name" yaml:"name"` + Protocol string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/template.ts\", gofile:\"health_check_config.go\", name:\"HealthCheckConfigProtocol\")"` + Port int `json:"port" yaml:"port"` + Path string `json:"path" yaml:"path"` + HealthThreshold int `json:"healthThreshold" yaml:"healthThreshold"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalDNSInventoryHealthCheckList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalDNSInventoryHealthCheck `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalDNSInventoryPrimaryDomain struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalDNSInventoryPrimaryDomainSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalDNSInventoryPrimaryDomainNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalDNSInventoryPrimaryDomainNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalDNSInventoryPrimaryDomain) CRDName() string { + return "externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalDNSInventoryPrimaryDomain) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalDNSInventoryPrimaryDomainSpec struct { + Region string `json:"region" yaml:"region"` + DnsRecordsGvk map[string]Child `json:"dnsRecordsGvk,omitempty" yaml:"dnsRecordsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalDNSInventoryPrimaryDomainList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalDNSInventoryPrimaryDomain `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalDNSInventoryRecord struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalDNSInventoryRecordSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalDNSInventoryRecordNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalDNSInventoryRecordNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalDNSInventoryRecord) CRDName() string { + return "externaldnsinventoryrecords.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalDNSInventoryRecord) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalDNSInventoryRecordSpec struct { + DnsRecordType string `nexus-alias-type:"ExternalDNSRecordType"` + Ttl int `json:"ttl" yaml:"ttl"` + Value string `json:"value" yaml:"value"` + Weight int `json:"weight" yaml:"weight"` + HealthCheckGvk *Link `json:"healthCheckGvk,omitempty" yaml:"healthCheckGvk,omitempty" nexus:"link"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalDNSInventoryRecordList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalDNSInventoryRecord `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalDNSInventoryZone struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalDNSInventoryZoneSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalDNSInventoryZoneNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalDNSInventoryZoneNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalDNSInventoryZone) CRDName() string { + return "externaldnsinventoryzones.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalDNSInventoryZone) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalDNSInventoryZoneSpec struct { + Records int `json:"records" yaml:"records"` + PrimaryDomainsGvk map[string]Link `json:"primaryDomainsGvk,omitempty" yaml:"primaryDomainsGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalDNSInventoryZoneList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalDNSInventoryZone `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalDNSInventory struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalDNSInventorySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalDNSInventoryNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalDNSInventoryNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalDNSInventory) CRDName() string { + return "externaldnsinventories.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalDNSInventory) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalDNSInventorySpec struct { + EnabledForProjects []string `json:"enabledForProjects" yaml:"enabledForProjects"` + ZonesGvk map[string]Child `json:"zonesGvk,omitempty" yaml:"zonesGvk,omitempty" nexus:"children"` + PrimaryDomainsGvk map[string]Child `json:"primaryDomainsGvk,omitempty" yaml:"primaryDomainsGvk,omitempty" nexus:"children"` + HealthChecksGvk map[string]Child `json:"healthChecksGvk,omitempty" yaml:"healthChecksGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalDNSInventoryList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalDNSInventory `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalDNSRuntimeEndpoint struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalDNSRuntimeEndpointSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalDNSRuntimeEndpointNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalDNSRuntimeEndpointNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalDNSRuntimeEndpoint) CRDName() string { + return "externaldnsruntimeendpoints.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalDNSRuntimeEndpoint) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalDNSRuntimeEndpointSpec struct { + Weight int `json:"weight" yaml:"weight"` + Active bool `json:"active" yaml:"active"` + GnsVersion string `json:"gnsVersion" yaml:"gnsVersion"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalDNSRuntimeEndpointList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalDNSRuntimeEndpoint `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalDNSRuntimePrimaryDomain struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalDNSRuntimePrimaryDomainSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalDNSRuntimePrimaryDomainNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalDNSRuntimePrimaryDomainNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalDNSRuntimePrimaryDomain) CRDName() string { + return "externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalDNSRuntimePrimaryDomain) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalDNSRuntimePrimaryDomainSpec struct { + PrimaryDomain string `json:"primaryDomain" yaml:"primaryDomain"` + DnsServerID string `nexus-alias-type:"ID"` + SubdomainsGvk map[string]Child `json:"subdomainsGvk,omitempty" yaml:"subdomainsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalDNSRuntimePrimaryDomainList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalDNSRuntimePrimaryDomain `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalDNSRuntime struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalDNSRuntimeSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalDNSRuntimeNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalDNSRuntimeNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalDNSRuntime) CRDName() string { + return "externaldnsruntimes.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalDNSRuntime) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalDNSRuntimeSpec struct { + PrimaryDomainsGvk map[string]Child `json:"primaryDomainsGvk,omitempty" yaml:"primaryDomainsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalDNSRuntimeList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalDNSRuntime `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalDNSRuntimeSubdomain struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalDNSRuntimeSubdomainSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalDNSRuntimeSubdomainNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalDNSRuntimeSubdomainNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalDNSRuntimeSubdomain) CRDName() string { + return "externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalDNSRuntimeSubdomain) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalDNSRuntimeSubdomainSpec struct { + RecordType string `nexus-alias-type:"ExternalDNSRecordType"` + Ttl int `json:"ttl" yaml:"ttl"` + HealthCheckDomain string `json:"healthCheckDomain" yaml:"healthCheckDomain"` + HealthCheckExternalPort int `json:"healthCheckExternalPort" yaml:"healthCheckExternalPort"` + HealthCheckPort int `json:"healthCheckPort" yaml:"healthCheckPort"` + HealthCheckPath string `json:"healthCheckPath" yaml:"healthCheckPath"` + HealthCheckThreshold int `json:"healthCheckThreshold" yaml:"healthCheckThreshold"` + HealthCheckInterval int `json:"healthCheckInterval" yaml:"healthCheckInterval"` + HealthCheckProtocol string `json:"healthCheckProtocol" yaml:"healthCheckProtocol"` + GnsVersion string `json:"gnsVersion" yaml:"gnsVersion"` + EndpointsGvk map[string]Child `json:"endpointsGvk,omitempty" yaml:"endpointsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalDNSRuntimeSubdomainList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalDNSRuntimeSubdomain `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalLBConfigN struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalLBConfigNSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalLBConfigNNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalLBConfigNNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalLBConfigN) CRDName() string { + return "externallbconfigns.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalLBConfigN) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalLBConfigNSpec struct { + Config string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/externalLB\", gofile:\"external_lb.go\", name: \"ExternalLBConfig\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalLBConfigNList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalLBConfigN `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalPluginCapability struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalPluginCapabilitySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalPluginCapabilityNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalPluginCapabilityNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalPluginCapability) CRDName() string { + return "externalplugincapabilities.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalPluginCapability) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalPluginCapabilitySpec struct { + Capability string `nexus-graphql-tsm-directive:"@protobuf(file:\"./common-apis/protos/external-plugin/ep-server.proto\", name:\"RegisterCapabilityArguments\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalPluginCapabilityList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalPluginCapability `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalPluginConfigFolder struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalPluginConfigFolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalPluginConfigFolderNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalPluginConfigFolderNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalPluginConfigFolder) CRDName() string { + return "externalpluginconfigfolders.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalPluginConfigFolder) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalPluginConfigFolderSpec struct { + PluginsGvk map[string]Child `json:"pluginsGvk,omitempty" yaml:"pluginsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalPluginConfigFolderList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalPluginConfigFolder `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalPluginConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalPluginConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalPluginConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalPluginConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalPluginConfig) CRDName() string { + return "externalpluginconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalPluginConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalPluginConfigSpec struct { + Name string `json:"name" yaml:"name"` + ProviderName string `json:"providerName" yaml:"providerName"` + InstallConfig string `json:"installConfig" yaml:"installConfig"` + Type string `json:"type" yaml:"type"` + PluginInstancesGvk map[string]Child `json:"pluginInstancesGvk,omitempty" yaml:"pluginInstancesGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalPluginConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalPluginConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalPluginInstanceConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalPluginInstanceConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalPluginInstanceConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalPluginInstanceConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalPluginInstanceConfig) CRDName() string { + return "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalPluginInstanceConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalPluginInstanceConfigSpec struct { + Name string `json:"name" yaml:"name"` + SecurityToken string `nexus-graphql-tsm-directive:"@jsonencoded(file: \"./root/config/external-plugin-config-folder/external-plugin-config/external-plugin-instance-config/external-plugins.ts\", gofile:\"external_plugins.go\", name: \"ExternalPluginSecurityToken\")"` + CapabilitiyGvk *Child `json:"capabilitiyGvk,omitempty" yaml:"capabilitiyGvk,omitempty" nexus:"child"` + MonitorsGvk map[string]Child `json:"monitorsGvk,omitempty" yaml:"monitorsGvk,omitempty" nexus:"children"` + ClustersGvk map[string]Link `json:"clustersGvk,omitempty" yaml:"clustersGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalPluginInstanceConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalPluginInstanceConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalPluginMonitor struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalPluginMonitorSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalPluginMonitorNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalPluginMonitorNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalPluginMonitor) CRDName() string { + return "externalpluginmonitors.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalPluginMonitor) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalPluginMonitorSpec struct { + ObjType string `nexus-graphql-tsm-directive:"@protobuf(file:\"./common-apis/protos/external-plugin/ep-server.proto\", name:\"ObjectTypes\")"` + PluginCapability string `nexus-graphql-tsm-directive:"@protobuf(file:\"./common-apis/protos/external-plugin/ep-server.proto\", name:\"PluginCapability\")"` + Fn string `nexus-graphql-tsm-directive:"@jsonencoded(file: \"./root/config/external-plugin-config-folder/external-plugin-config/external-plugin-instance-config/external-plugins.ts\", gofile:\"external_plugins.go\", name: \"ExternalPluginFn\")"` + Arg1 string `nexus-graphql-tsm-directive:"@jsonencoded(file: \"./root/config/external-plugin-config-folder/external-plugin-config/external-plugin-instance-config/external-plugins.ts\", gofile:\"external_plugins.go\", name: \"ExternalPluginFnArg\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalPluginMonitorList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalPluginMonitor `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalServicesRT struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalServicesRTSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalServicesRTNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalServicesRTNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalServicesRT) CRDName() string { + return "externalservicesrts.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalServicesRT) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalServicesRTSpec struct { + OwnedBy string `json:"ownedBy" yaml:"ownedBy"` + CreatedByGNS string `json:"createdByGNS" yaml:"createdByGNS"` + CreatedByESName string `json:"createdByESName" yaml:"createdByESName"` + CreatedBySDFolder string `json:"createdBySDFolder" yaml:"createdBySDFolder"` + CreatedBySDEntry string `json:"createdBySDEntry" yaml:"createdBySDEntry"` + ServicePort int `json:"servicePort" yaml:"servicePort"` + Protocol string `nexus-alias-type:"ExternalServicesRTProtocols"` + Hostname string `json:"hostname" yaml:"hostname"` + Port int `json:"port" yaml:"port"` + ServerCertificate string `json:"serverCertificate" yaml:"serverCertificate"` + HostnameAlias string `json:"hostnameAlias" yaml:"hostnameAlias"` + EndpointList []string `nexus-graphql-nullable:"false"` + EgressGateways []string `nexus-graphql-nullable:"false"` + ClientCertificate string `json:"clientCertificate" yaml:"clientCertificate"` + ClientKey string `json:"clientKey" yaml:"clientKey"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalServicesRTList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalServicesRT `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type FeatureFlag struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec FeatureFlagSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status FeatureFlagNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type FeatureFlagNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *FeatureFlag) CRDName() string { + return "featureflags.global.tsm.tanzu.vmware.com" +} + +func (c *FeatureFlag) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type FeatureFlagSpec struct { + Name string `json:"name" yaml:"name"` + Description string `json:"description" yaml:"description"` + Enable bool `json:"enable" yaml:"enable"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type FeatureFlagList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []FeatureFlag `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GatewayConfigListenerCertificate struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GatewayConfigListenerCertificateSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GatewayConfigListenerCertificateNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GatewayConfigListenerCertificateNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GatewayConfigListenerCertificate) CRDName() string { + return "gatewayconfiglistenercertificates.global.tsm.tanzu.vmware.com" +} + +func (c *GatewayConfigListenerCertificate) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GatewayConfigListenerCertificateSpec struct { + EncryptedCertificate string `json:"encryptedCertificate" yaml:"encryptedCertificate"` + EncryptedPrivateKey string `json:"encryptedPrivateKey" yaml:"encryptedPrivateKey"` + EncryptedCertChain string `json:"encryptedCertChain" yaml:"encryptedCertChain"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GatewayConfigListenerCertificateList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GatewayConfigListenerCertificate `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GatewayConfigAdditionalListeners struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GatewayConfigAdditionalListenersSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GatewayConfigAdditionalListenersNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GatewayConfigAdditionalListenersNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GatewayConfigAdditionalListeners) CRDName() string { + return "gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com" +} + +func (c *GatewayConfigAdditionalListeners) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GatewayConfigAdditionalListenersSpec struct { + Name string `json:"name" yaml:"name"` + Port int `json:"port" yaml:"port"` + Protocol string `json:"protocol" yaml:"protocol"` + TlsMode string `json:"tlsMode" yaml:"tlsMode"` + OwnedBy string `json:"ownedBy" yaml:"ownedBy"` + Hosts []string `json:"hosts" yaml:"hosts"` + CertificateGvk *Child `json:"certificateGvk,omitempty" yaml:"certificateGvk,omitempty" nexus:"child"` + ListenerRoutesGvk map[string]Child `json:"listenerRoutesGvk,omitempty" yaml:"listenerRoutesGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GatewayConfigAdditionalListenersList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GatewayConfigAdditionalListeners `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GatewayConfigListenerDestinationRoute struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GatewayConfigListenerDestinationRouteSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GatewayConfigListenerDestinationRouteNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GatewayConfigListenerDestinationRouteNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GatewayConfigListenerDestinationRoute) CRDName() string { + return "gatewayconfiglistenerdestinationroutes.global.tsm.tanzu.vmware.com" +} + +func (c *GatewayConfigListenerDestinationRoute) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GatewayConfigListenerDestinationRouteSpec struct { + Host string `json:"host" yaml:"host"` + Target string `json:"target" yaml:"target"` + Paths []string `json:"paths" yaml:"paths"` + Port int `json:"port" yaml:"port"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GatewayConfigListenerDestinationRouteList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GatewayConfigListenerDestinationRoute `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GatewayConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GatewayConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GatewayConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GatewayConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GatewayConfig) CRDName() string { + return "gatewayconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *GatewayConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GatewayConfigSpec struct { + Name string `json:"name" yaml:"name"` + OwnedBy string `json:"ownedBy" yaml:"ownedBy"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"Labels\")"` + Listeners string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/gateway.d.ts\", gofile:\"gateway.go\", name:\"GatewayConfigListeners\")"` + AdditionalListenersGvk map[string]Child `json:"additionalListenersGvk,omitempty" yaml:"additionalListenersGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GatewayConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GatewayConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Gateway struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GatewaySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GatewayNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GatewayNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Gateway) CRDName() string { + return "gateways.global.tsm.tanzu.vmware.com" +} + +func (c *Gateway) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GatewaySpec struct { + Name string `json:"name" yaml:"name"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"Labels\")"` + Annotations string `nexus-graphql-tsm-directive:"@jsonencoded"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/gateway.d.ts\", gofile:\"gateway.go\", name:\"GatewaySpec\")"` + ServicesGvk map[string]Link `json:"servicesGvk,omitempty" yaml:"servicesGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GatewayList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Gateway `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GeoDiscoveryRT struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GeoDiscoveryRTSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GeoDiscoveryRTNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GeoDiscoveryRTNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GeoDiscoveryRT) CRDName() string { + return "geodiscoveryrts.global.tsm.tanzu.vmware.com" +} + +func (c *GeoDiscoveryRT) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GeoDiscoveryRTSpec struct { + Gnsid string `json:"gnsid" yaml:"gnsid"` + Selectors string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/common\", gofile:\"gns_geo_discovery.go\", name:\"GeoDiscoveryClusterResourceSelectorRT\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsGeoDiscovery\", gofile:\"gns_geo_discovery.go\", name:\"GeoDiscoveryGeoFencesConfigList\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GeoDiscoveryRTList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GeoDiscoveryRT `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GeoDiscovery struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GeoDiscoverySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GeoDiscoveryNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GeoDiscoveryNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GeoDiscovery) CRDName() string { + return "geodiscoveries.global.tsm.tanzu.vmware.com" +} + +func (c *GeoDiscovery) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GeoDiscoverySpec struct { + Description string `json:"description" yaml:"description"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/common\", gofile:\"common.go\", name:\"LabelsList\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsGeoDiscovery\", gofile:\"gns_geo_discovery.go\", name:\"GeoDiscoveryConfig\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GeoDiscoveryList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GeoDiscovery `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GlobalNs struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GlobalNsSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GlobalNsNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GlobalNsNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GlobalNs) CRDName() string { + return "globalnses.global.tsm.tanzu.vmware.com" +} + +func (c *GlobalNs) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GlobalNsSpec struct { + GnsName string `nexus-graphql-nullable:"false"` + RoutingPoliciesGvk map[string]Child `json:"routingPoliciesGvk,omitempty" yaml:"routingPoliciesGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GlobalNsList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GlobalNs `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GlobalRegistrationService struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GlobalRegistrationServiceSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GlobalRegistrationServiceNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GlobalRegistrationServiceNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GlobalRegistrationService) CRDName() string { + return "globalregistrationservices.global.tsm.tanzu.vmware.com" +} + +func (c *GlobalRegistrationService) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GlobalRegistrationServiceSpec struct { + BuildID string `nexus-graphql-nullable:"false"` + Version string `nexus-graphql-nullable:"false"` + ErrorCount int `json:"errorCount" yaml:"errorCount"` + TenantsGvk map[string]Child `json:"tenantsGvk,omitempty" yaml:"tenantsGvk,omitempty" nexus:"children"` + TenantTokenGvk map[string]Child `json:"tenantTokenGvk,omitempty" yaml:"tenantTokenGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GlobalRegistrationServiceList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GlobalRegistrationService `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GlobalNamespace struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GlobalNamespaceSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GlobalNamespaceNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GlobalNamespaceNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GlobalNamespace) CRDName() string { + return "globalnamespaces.global.tsm.tanzu.vmware.com" +} + +func (c *GlobalNamespace) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GlobalNamespaceSpec struct { + GnsGvk map[string]Child `json:"gnsGvk,omitempty" yaml:"gnsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GlobalNamespaceList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GlobalNamespace `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GnsAccessControlPolicyRT struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GnsAccessControlPolicyRTSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GnsAccessControlPolicyRTNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GnsAccessControlPolicyRTNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GnsAccessControlPolicyRT) CRDName() string { + return "gnsaccesscontrolpolicyrts.global.tsm.tanzu.vmware.com" +} + +func (c *GnsAccessControlPolicyRT) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GnsAccessControlPolicyRTSpec struct { + Gnsid string `json:"gnsid" yaml:"gnsid"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsAccessControlPolicy\", gofile:\"gns_access_control_policy.go\", name:\"GnsAccessControlPolicySpec\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GnsAccessControlPolicyRTList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GnsAccessControlPolicyRT `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GnsAccessControlPolicy struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GnsAccessControlPolicySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GnsAccessControlPolicyNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GnsAccessControlPolicyNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GnsAccessControlPolicy) CRDName() string { + return "gnsaccesscontrolpolicies.global.tsm.tanzu.vmware.com" +} + +func (c *GnsAccessControlPolicy) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GnsAccessControlPolicySpec struct { + Description string `json:"description" yaml:"description"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/common\", gofile:\"common.go\", name:\"LabelsList\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsAccessControlPolicy\", gofile:\"gns_access_control_policy.go\", name:\"GnsAccessControlPolicySpec\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GnsAccessControlPolicyList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GnsAccessControlPolicy `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GnsBindingRT struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GnsBindingRTSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GnsBindingRTNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GnsBindingRTNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GnsBindingRT) CRDName() string { + return "gnsbindingrts.global.tsm.tanzu.vmware.com" +} + +func (c *GnsBindingRT) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GnsBindingRTSpec struct { + Name string `json:"name" yaml:"name"` + Domain string `json:"domain" yaml:"domain"` + Namespaces []string `json:"namespaces" yaml:"namespaces"` + ApiDiscoveryEnabled bool `json:"apiDiscoveryEnabled" yaml:"apiDiscoveryEnabled"` + GnsSvcGroupRTGvk map[string]Child `json:"gnsSvcGroupRTGvk,omitempty" yaml:"gnsSvcGroupRTGvk,omitempty" nexus:"children"` + GnsRoutingRulesGvk map[string]Child `json:"gnsRoutingRulesGvk,omitempty" yaml:"gnsRoutingRulesGvk,omitempty" nexus:"children"` + GnsServiceEntryConfigGvk map[string]Child `json:"gnsServiceEntryConfigGvk,omitempty" yaml:"gnsServiceEntryConfigGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GnsBindingRTList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GnsBindingRT `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GnsEndpointsConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GnsEndpointsConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GnsEndpointsConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GnsEndpointsConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GnsEndpointsConfig) CRDName() string { + return "gnsendpointsconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *GnsEndpointsConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GnsEndpointsConfigSpec struct { + Endpoints string `nexus-graphql-nullable:"false"` + GnsId string `nexus-graphql-nullable:"false"` + EndpointServices []string `json:"endpointServices" yaml:"endpointServices"` + ServicePortList string `nexus-graphql-nullable:"false" nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/runtime/runtime.ts\", gofile:\"runtime.go\", name:\"ServicePortList\")"` + Selector string `nexus-graphql-nullable:"false" nexus-graphql-tsm-directive:"@jsonencoded"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GnsEndpointsConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GnsEndpointsConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ExternalServiceConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ExternalServiceConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ExternalServiceConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ExternalServiceConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ExternalServiceConfig) CRDName() string { + return "externalserviceconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *ExternalServiceConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ExternalServiceConfigSpec struct { + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsExternalService\", gofile:\"gns_external_service.go\", name:\"GnsExternalServiceConfig\")"` + System bool `json:"system" yaml:"system"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ExternalServiceConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ExternalServiceConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type PublicServiceRouteConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec PublicServiceRouteConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status PublicServiceRouteConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type PublicServiceRouteConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *PublicServiceRouteConfig) CRDName() string { + return "publicservicerouteconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *PublicServiceRouteConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type PublicServiceRouteConfigSpec struct { + Type string `json:"type" yaml:"type"` + Routes string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsPublicService\", gofile:\"gns_public_service_route_config.go\", name: \"GnsPublicServiceRouteConfig\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type PublicServiceRouteConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []PublicServiceRouteConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type PublicServiceConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec PublicServiceConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status PublicServiceConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type PublicServiceConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *PublicServiceConfig) CRDName() string { + return "publicserviceconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *PublicServiceConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type PublicServiceConfigSpec struct { + Fqdn string `json:"fqdn" yaml:"fqdn"` + Config string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsPublicService\", gofile:\"gns_public_service.go\", name: \"GnsPublicServiceConfig\")"` + RoutingConfigsGvk map[string]Child `json:"routingConfigsGvk,omitempty" yaml:"routingConfigsGvk,omitempty" nexus:"children"` + ExternalDNSGvk map[string]Link `json:"externalDNSGvk,omitempty" yaml:"externalDNSGvk,omitempty" nexus:"links"` + CertificatesGvk map[string]Link `json:"certificatesGvk,omitempty" yaml:"certificatesGvk,omitempty" nexus:"links"` + HealthChecksGvk map[string]Link `json:"healthChecksGvk,omitempty" yaml:"healthChecksGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type PublicServiceConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []PublicServiceConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GNSRoutingConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GNSRoutingConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GNSRoutingConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GNSRoutingConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GNSRoutingConfig) CRDName() string { + return "gnsroutingconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *GNSRoutingConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GNSRoutingConfigSpec struct { + Name string `nexus-graphql-nullable:"false"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsTrafficManagement\", gofile:\"common.go\", name:\"TrafficRoutingPolicy\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GNSRoutingConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GNSRoutingConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GnsRoutingRuleConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GnsRoutingRuleConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GnsRoutingRuleConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GnsRoutingRuleConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GnsRoutingRuleConfig) CRDName() string { + return "gnsroutingruleconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *GnsRoutingRuleConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GnsRoutingRuleConfigSpec struct { + Name string `nexus-graphql-nullable:"false"` + OwnedBy string `json:"ownedBy" yaml:"ownedBy"` + ServiceFQDN string `nexus-graphql-nullable:"false"` + PortName string `json:"portName" yaml:"portName"` + Port int `json:"port" yaml:"port"` + HttpRouteRules string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsTrafficManagement\", gofile:\"common.go\", name:\"HTTPRoutingRules\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GnsRoutingRuleConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GnsRoutingRuleConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GnsSegmentationPolicyRT struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GnsSegmentationPolicyRTSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GnsSegmentationPolicyRTNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationPolicyRTNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GnsSegmentationPolicyRT) CRDName() string { + return "gnssegmentationpolicyrts.global.tsm.tanzu.vmware.com" +} + +func (c *GnsSegmentationPolicyRT) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GnsSegmentationPolicyRTSpec struct { + Gnsid string `json:"gnsid" yaml:"gnsid"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file: \"../common-apis/api/tenant/models/gnsSegmentationPolicy\", gofile:\"gns_segmentation_policy.go\", name:\"GnsSegmentationPolicySpec\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GnsSegmentationPolicyRTList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GnsSegmentationPolicyRT `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GnsSegmentationPolicy struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GnsSegmentationPolicySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GnsSegmentationPolicyNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GnsSegmentationPolicyNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GnsSegmentationPolicy) CRDName() string { + return "gnssegmentationpolicies.global.tsm.tanzu.vmware.com" +} + +func (c *GnsSegmentationPolicy) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GnsSegmentationPolicySpec struct { + Description string `json:"description" yaml:"description"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/common\", gofile:\"common.go\", name:\"LabelsList\")"` + Spec customtsmtanzuvmwarecomv1.GnsSegmentationPolicySpec `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsSegmentationPolicy\", gofile: \"gns_segmentation_policy.go\", name:\"GnsSegmentationPolicySpec\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GnsSegmentationPolicyList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GnsSegmentationPolicy `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GnsServiceEntryConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GnsServiceEntryConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GnsServiceEntryConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GnsServiceEntryConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GnsServiceEntryConfig) CRDName() string { + return "gnsserviceentryconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *GnsServiceEntryConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GnsServiceEntryConfigSpec struct { + Service string `nexus-graphql-nullable:"false"` + Ports string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/runtime/runtime.ts\", gofile:\"runtime.go\", name:\"ServicePortList\")"` + Versions string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/runtime/runtime.ts\", gofile:\"runtime.go\", name:\"ServiceVersionList\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GnsServiceEntryConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GnsServiceEntryConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GnsSvcGroupRT struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GnsSvcGroupRTSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GnsSvcGroupRTNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GnsSvcGroupRTNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GnsSvcGroupRT) CRDName() string { + return "gnssvcgrouprts.global.tsm.tanzu.vmware.com" +} + +func (c *GnsSvcGroupRT) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GnsSvcGroupRTSpec struct { + Name string `json:"name" yaml:"name"` + DisplayName string `json:"displayName" yaml:"displayName"` + Description string `json:"description" yaml:"description"` + Services string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsServiceGroup\", gofile:\"gns_service_group.go\", name:\"ServiceGroupServiceList\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GnsSvcGroupRTList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GnsSvcGroupRT `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GNSSvcGroup struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GNSSvcGroupSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GNSSvcGroupNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GNSSvcGroupNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GNSSvcGroup) CRDName() string { + return "gnssvcgroups.global.tsm.tanzu.vmware.com" +} + +func (c *GNSSvcGroup) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GNSSvcGroupSpec struct { + DisplayName string `json:"displayName" yaml:"displayName"` + Description string `json:"description" yaml:"description"` + Color string `json:"color" yaml:"color"` + Rules string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/resourceGroup\", gofile:\"resource_group.go\", name:\"Rules\")"` + ServicesGvk map[string]Link `json:"servicesGvk,omitempty" yaml:"servicesGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GNSSvcGroupList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GNSSvcGroup `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type SharedServiceConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec SharedServiceConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status SharedServiceConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type SharedServiceConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *SharedServiceConfig) CRDName() string { + return "sharedserviceconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *SharedServiceConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type SharedServiceConfigSpec struct { + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsPublicService\", gofile:\"gns_shared_service.go\", name: \"GnsSharedServiceConfig\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type SharedServiceConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []SharedServiceConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GNS struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GNSSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GNSNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GNSNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GNS) CRDName() string { + return "gnses.global.tsm.tanzu.vmware.com" +} + +func (c *GNS) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GNSSpec struct { + Domain string `json:"domain" yaml:"domain"` + UseSharedGateway bool `json:"useSharedGateway" yaml:"useSharedGateway"` + MTLSEnforced bool `json:"mTLSEnforced" yaml:"mTLSEnforced"` + MTLSPermissive bool `json:"mTLSPermissive" yaml:"mTLSPermissive"` + ApiDiscoveryEnabled bool `json:"apiDiscoveryEnabled" yaml:"apiDiscoveryEnabled"` + MTLSExceptions string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"MtlsExceptions\")"` + CaType string `json:"caType" yaml:"caType"` + Ca string `json:"ca" yaml:"ca"` + Description string `json:"description" yaml:"description"` + Color string `json:"color" yaml:"color"` + Version string `json:"version" yaml:"version"` + ProjectId string `json:"projectId" yaml:"projectId"` + MemberDomains string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name: \"StringList\") # to be deprecated"` + MatchingConditions string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/globalNamespace\", gofile:\"global_namespace.go\", name:\"MatchConditions\")"` + RoutingConfigGvk *Child `json:"routingConfigGvk,omitempty" yaml:"routingConfigGvk,omitempty" nexus:"child"` + GnsServiceGroupsGvk map[string]Child `json:"gnsServiceGroupsGvk,omitempty" yaml:"gnsServiceGroupsGvk,omitempty" nexus:"children"` + PublicServicesGvk map[string]Child `json:"publicServicesGvk,omitempty" yaml:"publicServicesGvk,omitempty" nexus:"children"` + SharedServicesGvk map[string]Child `json:"sharedServicesGvk,omitempty" yaml:"sharedServicesGvk,omitempty" nexus:"children"` + SloPoliciesGvk map[string]Child `json:"sloPoliciesGvk,omitempty" yaml:"sloPoliciesGvk,omitempty" nexus:"children"` + ExternalServicesGvk map[string]Child `json:"externalServicesGvk,omitempty" yaml:"externalServicesGvk,omitempty" nexus:"children"` + AutoscalingPoliciesGvk map[string]Child `json:"autoscalingPoliciesGvk,omitempty" yaml:"autoscalingPoliciesGvk,omitempty" nexus:"children"` + RoutingPoliciesGvk map[string]Child `json:"routingPoliciesGvk,omitempty" yaml:"routingPoliciesGvk,omitempty" nexus:"children"` + ApiDiscoveryGvk map[string]Child `json:"apiDiscoveryGvk,omitempty" yaml:"apiDiscoveryGvk,omitempty" nexus:"children"` + GeoDiscoveryGvk map[string]Child `json:"geoDiscoveryGvk,omitempty" yaml:"geoDiscoveryGvk,omitempty" nexus:"children"` + PiiDiscoveryGvk map[string]Child `json:"piiDiscoveryGvk,omitempty" yaml:"piiDiscoveryGvk,omitempty" nexus:"children"` + AttackDiscoveryGvk map[string]Child `json:"attackDiscoveryGvk,omitempty" yaml:"attackDiscoveryGvk,omitempty" nexus:"children"` + UserDiscoveryGvk map[string]Child `json:"userDiscoveryGvk,omitempty" yaml:"userDiscoveryGvk,omitempty" nexus:"children"` + GnsAccessControlPolicyGvk map[string]Child `json:"gnsAccessControlPolicyGvk,omitempty" yaml:"gnsAccessControlPolicyGvk,omitempty" nexus:"children"` + GnsSchemaViolationDiscoveryGvk map[string]Child `json:"gnsSchemaViolationDiscoveryGvk,omitempty" yaml:"gnsSchemaViolationDiscoveryGvk,omitempty" nexus:"children"` + GnsSegmentationPolicyGvk map[string]Child `json:"gnsSegmentationPolicyGvk,omitempty" yaml:"gnsSegmentationPolicyGvk,omitempty" nexus:"children"` + MemberGroupsGvk map[string]Link `json:"memberGroupsGvk,omitempty" yaml:"memberGroupsGvk,omitempty" nexus:"links"` + MembersGvk map[string]Link `json:"membersGvk,omitempty" yaml:"membersGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GNSList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GNS `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type HaConfigV2 struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec HaConfigV2Spec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status HaConfigV2NexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type HaConfigV2NexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *HaConfigV2) CRDName() string { + return "haconfigv2s.global.tsm.tanzu.vmware.com" +} + +func (c *HaConfigV2) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type HaConfigV2Spec struct { + ConfigType string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/runtime/runtime.ts\", gofile:\"runtime.go\", name:\"HAType\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type HaConfigV2List struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []HaConfigV2 `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type HaConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec HaConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status HaConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type HaConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *HaConfig) CRDName() string { + return "haconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *HaConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type HaConfigSpec struct { + ConfigType string `nexus-alias-type:"HaType"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type HaConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []HaConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type HealthCheckConfigN struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec HealthCheckConfigNSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status HealthCheckConfigNNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type HealthCheckConfigNNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *HealthCheckConfigN) CRDName() string { + return "healthcheckconfigns.global.tsm.tanzu.vmware.com" +} + +func (c *HealthCheckConfigN) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type HealthCheckConfigNSpec struct { + ProjectId string `json:"projectId" yaml:"projectId"` + Config string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/template.ts\", gofile:\"health_check_config.go\", name: \"HealthCheckConfig\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type HealthCheckConfigNList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []HealthCheckConfigN `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type HostConfigV2 struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec HostConfigV2Spec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status HostConfigV2NexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type HostConfigV2NexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *HostConfigV2) CRDName() string { + return "hostconfigv2s.global.tsm.tanzu.vmware.com" +} + +func (c *HostConfigV2) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type HostConfigV2Spec struct { + Name string `nexus-graphql-nullable:"false"` + Host string `nexus-graphql-nullable:"false"` + HaConfigV2Gvk *Child `json:"haConfigV2Gvk,omitempty" yaml:"haConfigV2Gvk,omitempty" nexus:"child"` + OutboundAuthenticationModeGvk *Child `json:"outboundAuthenticationModeGvk,omitempty" yaml:"outboundAuthenticationModeGvk,omitempty" nexus:"child"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type HostConfigV2List struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []HostConfigV2 `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type HostConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec HostConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status HostConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type HostConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *HostConfig) CRDName() string { + return "hostconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *HostConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type HostConfigSpec struct { + Name string `nexus-graphql-nullable:"false"` + Host string `nexus-graphql-nullable:"false"` + OwnedBy string `json:"ownedBy" yaml:"ownedBy"` + HaConfigGvk *Child `json:"haConfigGvk,omitempty" yaml:"haConfigGvk,omitempty" nexus:"child"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type HostConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []HostConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type InboundAuthenticationConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec InboundAuthenticationConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status InboundAuthenticationConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type InboundAuthenticationConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *InboundAuthenticationConfig) CRDName() string { + return "inboundauthenticationconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *InboundAuthenticationConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type InboundAuthenticationConfigSpec struct { + Name string `json:"name" yaml:"name"` + OwnedBy string `json:"ownedBy" yaml:"ownedBy"` + Mode string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/runtime/runtime.ts\", gofile:\"runtime.go\", name:\"InboundMode\")"` + Ports string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/runtime/runtime.ts\", gofile:\"runtime.go\", name:\"PortLevelAuthenticationMap\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type InboundAuthenticationConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []InboundAuthenticationConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Inventory struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec InventorySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status InventoryNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type InventoryNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Inventory) CRDName() string { + return "inventories.global.tsm.tanzu.vmware.com" +} + +func (c *Inventory) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type InventorySpec struct { + RegionsGvk map[string]Child `json:"regionsGvk,omitempty" yaml:"regionsGvk,omitempty" nexus:"children"` + ClustersGvk map[string]Child `json:"clustersGvk,omitempty" yaml:"clustersGvk,omitempty" nexus:"children"` + JobFolderGvk *Child `json:"jobFolderGvk,omitempty" yaml:"jobFolderGvk,omitempty" nexus:"child"` + ExternalDNSGvk map[string]Child `json:"externalDNSGvk,omitempty" yaml:"externalDNSGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type InventoryList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Inventory `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Issuer struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec IssuerSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status IssuerNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type IssuerNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Issuer) CRDName() string { + return "issuers.global.tsm.tanzu.vmware.com" +} + +func (c *Issuer) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type IssuerSpec struct { + Name string `json:"name" yaml:"name"` + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + Venafi string `nexus-graphql-tsm-directive:"@jsonencoded"` + Status string `nexus-graphql-tsm-directive:"@jsonencoded"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type IssuerList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Issuer `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type JobConfigFolder struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec JobConfigFolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status JobConfigFolderNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type JobConfigFolderNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *JobConfigFolder) CRDName() string { + return "jobconfigfolders.global.tsm.tanzu.vmware.com" +} + +func (c *JobConfigFolder) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type JobConfigFolderSpec struct { + JobConfigGvk map[string]Child `json:"jobConfigGvk,omitempty" yaml:"jobConfigGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type JobConfigFolderList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []JobConfigFolder `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type JobConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec JobConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status JobConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type JobConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *JobConfig) CRDName() string { + return "jobconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *JobConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type JobConfigSpec struct { + Config string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/job.ts\", gofile:\"job.go\", name:\"JobInfo\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type JobConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []JobConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type JobFolder struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec JobFolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status JobFolderNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type JobFolderNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *JobFolder) CRDName() string { + return "jobfolders.global.tsm.tanzu.vmware.com" +} + +func (c *JobFolder) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type JobFolderSpec struct { + JobsGvk map[string]Child `json:"jobsGvk,omitempty" yaml:"jobsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type JobFolderList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []JobFolder `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Job struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec JobSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status JobNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type JobNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Job) CRDName() string { + return "jobs.global.tsm.tanzu.vmware.com" +} + +func (c *Job) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type JobSpec struct { + Status string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/job.ts\", gofile:\"job.go\", name:\"JobStatusInfo\")"` + ProjectId string `json:"projectId" yaml:"projectId"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type JobList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Job `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type KnativeIngress struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec KnativeIngressSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status KnativeIngressNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type KnativeIngressNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *KnativeIngress) CRDName() string { + return "knativeingresses.global.tsm.tanzu.vmware.com" +} + +func (c *KnativeIngress) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type KnativeIngressSpec struct { + Name string `json:"name" yaml:"name"` + CreationTimestamp string `json:"creationTimestamp" yaml:"creationTimestamp"` + ApiLink string `json:"apiLink" yaml:"apiLink"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"Labels\")"` + Annotations string `nexus-graphql-tsm-directive:"@jsonencoded"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type KnativeIngressList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []KnativeIngress `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type LabelConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec LabelConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status LabelConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type LabelConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *LabelConfig) CRDName() string { + return "labelconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *LabelConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type LabelConfigSpec struct { + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"Labels\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type LabelConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []LabelConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type LocalRegistrationServiceCluster struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec LocalRegistrationServiceClusterSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status LocalRegistrationServiceClusterNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type LocalRegistrationServiceClusterNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *LocalRegistrationServiceCluster) CRDName() string { + return "localregistrationserviceclusters.global.tsm.tanzu.vmware.com" +} + +func (c *LocalRegistrationServiceCluster) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type LocalRegistrationServiceClusterSpec struct { + Tenant string `nexus-graphql-nullable:"false"` + Type string `json:"type" yaml:"type"` + Version string `nexus-graphql-nullable:"false"` + ErrorCount int `json:"errorCount" yaml:"errorCount"` + RestartCount int `json:"restartCount" yaml:"restartCount"` + ResourcesGvk map[string]Child `json:"resourcesGvk,omitempty" yaml:"resourcesGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type LocalRegistrationServiceClusterList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []LocalRegistrationServiceCluster `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type LocalRegistrationServiceResource struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec LocalRegistrationServiceResourceSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status LocalRegistrationServiceResourceNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type LocalRegistrationServiceResourceNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *LocalRegistrationServiceResource) CRDName() string { + return "localregistrationserviceresources.global.tsm.tanzu.vmware.com" +} + +func (c *LocalRegistrationServiceResource) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type LocalRegistrationServiceResourceSpec struct { + Type string `json:"type" yaml:"type"` + Location string `json:"location" yaml:"location"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type LocalRegistrationServiceResourceList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []LocalRegistrationServiceResource `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type LocalRegistrationService struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec LocalRegistrationServiceSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status LocalRegistrationServiceNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type LocalRegistrationServiceNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *LocalRegistrationService) CRDName() string { + return "localregistrationservices.global.tsm.tanzu.vmware.com" +} + +func (c *LocalRegistrationService) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type LocalRegistrationServiceSpec struct { + BuildID string `nexus-graphql-nullable:"false"` + Version string `nexus-graphql-nullable:"false"` + ErrorCount int `json:"errorCount" yaml:"errorCount"` + ClustersGvk map[string]Child `json:"clustersGvk,omitempty" yaml:"clustersGvk,omitempty" nexus:"children"` + TemplateGvk *Link `json:"templateGvk,omitempty" yaml:"templateGvk,omitempty" nexus:"link"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type LocalRegistrationServiceList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []LocalRegistrationService `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type LogFolder struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec LogFolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status LogFolderNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type LogFolderNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *LogFolder) CRDName() string { + return "logfolders.global.tsm.tanzu.vmware.com" +} + +func (c *LogFolder) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type LogFolderSpec struct { + LogGvk map[string]Child `json:"logGvk,omitempty" yaml:"logGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type LogFolderList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []LogFolder `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Log struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec LogSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status LogNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type LogNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Log) CRDName() string { + return "logs.global.tsm.tanzu.vmware.com" +} + +func (c *Log) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type LogSpec struct { + Request string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/clusterLifecycle.ts\", gofile:\"cluster_lifecycle.go\", name:\"LogRequest\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type LogList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Log `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type NetworkAttachmentDefinitionConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec NetworkAttachmentDefinitionConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status NetworkAttachmentDefinitionConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type NetworkAttachmentDefinitionConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *NetworkAttachmentDefinitionConfig) CRDName() string { + return "networkattachmentdefinitionconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *NetworkAttachmentDefinitionConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type NetworkAttachmentDefinitionConfigSpec struct { + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + Name string `nexus-graphql-nullable:"false"` + Namespace string `json:"namespace" yaml:"namespace"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type NetworkAttachmentDefinitionConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []NetworkAttachmentDefinitionConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type NetworkAttachmentDefinition struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec NetworkAttachmentDefinitionSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status NetworkAttachmentDefinitionNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type NetworkAttachmentDefinitionNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *NetworkAttachmentDefinition) CRDName() string { + return "networkattachmentdefinitions.global.tsm.tanzu.vmware.com" +} + +func (c *NetworkAttachmentDefinition) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type NetworkAttachmentDefinitionSpec struct { + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + Name string `nexus-graphql-nullable:"false"` + Namespace string `json:"namespace" yaml:"namespace"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type NetworkAttachmentDefinitionList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []NetworkAttachmentDefinition `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type NodeDefinition struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec NodeDefinitionSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status NodeDefinitionNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type NodeDefinitionNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *NodeDefinition) CRDName() string { + return "nodedefinitions.global.tsm.tanzu.vmware.com" +} + +func (c *NodeDefinition) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type NodeDefinitionSpec struct { + Type string `nexus-graphql-nullable:"false"` + Version string `nexus-graphql-nullable:"false"` + Provider string `json:"provider" yaml:"provider"` + ImageInfo string `json:"imageInfo" yaml:"imageInfo"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type NodeDefinitionList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []NodeDefinition `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type NodeFolderCluster struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + + Status NodeFolderClusterNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type NodeFolderClusterNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *NodeFolderCluster) CRDName() string { + return "nodefolderclusters.global.tsm.tanzu.vmware.com" +} + +func (c *NodeFolderCluster) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type NodeFolderClusterList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []NodeFolderCluster `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type NodeFolder struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec NodeFolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status NodeFolderNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type NodeFolderNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *NodeFolder) CRDName() string { + return "nodefolders.global.tsm.tanzu.vmware.com" +} + +func (c *NodeFolder) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type NodeFolderSpec struct { + ClustersGvk map[string]Child `json:"clustersGvk,omitempty" yaml:"clustersGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type NodeFolderList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []NodeFolder `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type NodeGroup struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec NodeGroupSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status NodeGroupNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type NodeGroupNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *NodeGroup) CRDName() string { + return "nodegroups.global.tsm.tanzu.vmware.com" +} + +func (c *NodeGroup) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type NodeGroupSpec struct { + DisplayName string `json:"displayName" yaml:"displayName"` + Description string `json:"description" yaml:"description"` + Scope string `json:"scope" yaml:"scope"` + Color string `json:"color" yaml:"color"` + Rules string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/resourceGroup\", gofile:\"resource_group.go\", name:\"Rules\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type NodeGroupList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []NodeGroup `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type NodeStatus struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec NodeStatusSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status NodeStatusNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type NodeStatusNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *NodeStatus) CRDName() string { + return "nodestatuses.global.tsm.tanzu.vmware.com" +} + +func (c *NodeStatus) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type NodeStatusSpec struct { + Addresses string `nexus-graphql-tsm-directive:"@jsonencoded"` + Allocatable string `nexus-graphql-tsm-directive:"@jsonencoded"` + Capacity string `nexus-graphql-tsm-directive:"@jsonencoded"` + DaemonEndpoints string `nexus-graphql-tsm-directive:"@jsonencoded"` + Conditions string `nexus-graphql-tsm-directive:"@jsonencoded"` + Images string `nexus-graphql-tsm-directive:"@jsonencoded"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type NodeStatusList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []NodeStatus `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type NodeTemplate struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec NodeTemplateSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status NodeTemplateNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type NodeTemplateNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *NodeTemplate) CRDName() string { + return "nodetemplates.global.tsm.tanzu.vmware.com" +} + +func (c *NodeTemplate) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type NodeTemplateSpec struct { + DefinitionVersionsGvk map[string]Child `json:"definitionVersionsGvk,omitempty" yaml:"definitionVersionsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type NodeTemplateList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []NodeTemplate `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Node struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec NodeSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status NodeNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type NodeNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Node) CRDName() string { + return "nodes.global.tsm.tanzu.vmware.com" +} + +func (c *Node) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type NodeSpec struct { + Name string `json:"name" yaml:"name"` + ExternalID string `json:"externalID" yaml:"externalID"` + ProviderID string `json:"providerID" yaml:"providerID"` + Architecture string `json:"architecture" yaml:"architecture"` + ContainerRuntimeVersion string `json:"containerRuntimeVersion" yaml:"containerRuntimeVersion"` + KernelVersion string `json:"kernelVersion" yaml:"kernelVersion"` + OperatingSystem string `json:"operatingSystem" yaml:"operatingSystem"` + OsImage string `json:"osImage" yaml:"osImage"` + SystemUUID string `json:"systemUUID" yaml:"systemUUID"` + HostName string `json:"hostName" yaml:"hostName"` + ApiLink string `json:"apiLink" yaml:"apiLink"` + BootID string `json:"bootID" yaml:"bootID"` + KubeletVersion string `json:"kubeletVersion" yaml:"kubeletVersion"` + MachineID string `json:"machineID" yaml:"machineID"` + CreationTimestamp string `json:"creationTimestamp" yaml:"creationTimestamp"` + Annotations string `nexus-graphql-tsm-directive:"@jsonencoded"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded"` + Uid string `json:"uid" yaml:"uid"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"NodeSpec\")"` + KStatus string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"KNodeStatus\")"` + StatusGvk *Child `json:"statusGvk,omitempty" yaml:"statusGvk,omitempty" nexus:"child"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type NodeList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Node `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type OutboundAuthenticationMode struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec OutboundAuthenticationModeSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status OutboundAuthenticationModeNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type OutboundAuthenticationModeNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *OutboundAuthenticationMode) CRDName() string { + return "outboundauthenticationmodes.global.tsm.tanzu.vmware.com" +} + +func (c *OutboundAuthenticationMode) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type OutboundAuthenticationModeSpec struct { + Mode string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/runtime/runtime.ts\", gofile:\"runtime.go\", name:\"OutboundMode\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type OutboundAuthenticationModeList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []OutboundAuthenticationMode `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type PeerAuthentication struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec PeerAuthenticationSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status PeerAuthenticationNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type PeerAuthenticationNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *PeerAuthentication) CRDName() string { + return "peerauthentications.global.tsm.tanzu.vmware.com" +} + +func (c *PeerAuthentication) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type PeerAuthenticationSpec struct { + Name string `json:"name" yaml:"name"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"Labels\")"` + Annotations string `nexus-graphql-tsm-directive:"@jsonencoded"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/inventory/inventory.d.ts\", gofile:\"inventory.go\", name:\"PeerAuthenticationSpec\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type PeerAuthenticationList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []PeerAuthentication `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type PiiDiscoveryRT struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec PiiDiscoveryRTSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status PiiDiscoveryRTNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type PiiDiscoveryRTNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *PiiDiscoveryRT) CRDName() string { + return "piidiscoveryrts.global.tsm.tanzu.vmware.com" +} + +func (c *PiiDiscoveryRT) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type PiiDiscoveryRTSpec struct { + Gnsid string `json:"gnsid" yaml:"gnsid"` + Selectors string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/common\", gofile:\"gns_pii_discovery.go\", name:\"PiiDiscoveryClusterResourceSelectorRT\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsPiiDiscovery\", gofile:\"gns_pii_discovery.go\", name:\"PiiDiscoveryApplicationConfigList\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type PiiDiscoveryRTList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []PiiDiscoveryRT `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type PiiDiscovery struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec PiiDiscoverySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status PiiDiscoveryNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type PiiDiscoveryNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *PiiDiscovery) CRDName() string { + return "piidiscoveries.global.tsm.tanzu.vmware.com" +} + +func (c *PiiDiscovery) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type PiiDiscoverySpec struct { + Description string `json:"description" yaml:"description"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/common\", gofile:\"common.go\", name:\"LabelsList\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsPiiDiscovery\", gofile:\"gns_pii_discovery.go\", name:\"PiiDiscoveryConfig\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type PiiDiscoveryList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []PiiDiscovery `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type PolicyConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec PolicyConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status PolicyConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type PolicyConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *PolicyConfig) CRDName() string { + return "policyconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *PolicyConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type PolicyConfigSpec struct { + Src string `json:"src" yaml:"src"` + Dst string `json:"dst" yaml:"dst"` + Action string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/runtime/cluster-folder/cluster-config/domain-config/policy-config/runtime-policy.ts\", gofile:\"runtime-policy.go\", name:\"PolicyActions\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type PolicyConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []PolicyConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type PolicyTemplate struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + + Status PolicyTemplateNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type PolicyTemplateNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *PolicyTemplate) CRDName() string { + return "policytemplates.global.tsm.tanzu.vmware.com" +} + +func (c *PolicyTemplate) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type PolicyTemplateList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []PolicyTemplate `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type AccessControlPolicy struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec AccessControlPolicySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status AccessControlPolicyNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type AccessControlPolicyNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *AccessControlPolicy) CRDName() string { + return "accesscontrolpolicies.global.tsm.tanzu.vmware.com" +} + +func (c *AccessControlPolicy) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type AccessControlPolicySpec struct { + PolicyConfigsGvk map[string]Child `json:"policyConfigsGvk,omitempty" yaml:"policyConfigsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AccessControlPolicyList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []AccessControlPolicy `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ProgressiveUpgrade struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ProgressiveUpgradeSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ProgressiveUpgradeNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ProgressiveUpgradeNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ProgressiveUpgrade) CRDName() string { + return "progressiveupgrades.global.tsm.tanzu.vmware.com" +} + +func (c *ProgressiveUpgrade) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ProgressiveUpgradeSpec struct { + UpgradeGvk map[string]Child `json:"upgradeGvk,omitempty" yaml:"upgradeGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ProgressiveUpgradeList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ProgressiveUpgrade `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ProgressiveUpgradeConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ProgressiveUpgradeConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ProgressiveUpgradeConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ProgressiveUpgradeConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ProgressiveUpgradeConfig) CRDName() string { + return "progressiveupgradeconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *ProgressiveUpgradeConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ProgressiveUpgradeConfigSpec struct { + Name string `json:"name" yaml:"name"` + Services string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/config/progressive-upgrade/progressive-upgrade-config/progressive-upgrade.ts\", gofile:\"progressive_upgrade.go\", name: \"UpgradeServices\")"` + UpgradeStrategy string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/config/progressive-upgrade/progressive-upgrade-config/progressive-upgrade.ts\", gofile:\"progressive_upgrade.go\", name:\"ProgressiveUpgradeStrategy\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ProgressiveUpgradeConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ProgressiveUpgradeConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ProgressiveUpgradeFolder struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ProgressiveUpgradeFolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ProgressiveUpgradeFolderNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ProgressiveUpgradeFolderNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ProgressiveUpgradeFolder) CRDName() string { + return "progressiveupgradefolders.global.tsm.tanzu.vmware.com" +} + +func (c *ProgressiveUpgradeFolder) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ProgressiveUpgradeFolderSpec struct { + UpgradesGvk map[string]Child `json:"upgradesGvk,omitempty" yaml:"upgradesGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ProgressiveUpgradeFolderList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ProgressiveUpgradeFolder `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ProgressiveUpgradeRuntime struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ProgressiveUpgradeRuntimeSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ProgressiveUpgradeRuntimeNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ProgressiveUpgradeRuntimeNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ProgressiveUpgradeRuntime) CRDName() string { + return "progressiveupgraderuntimes.global.tsm.tanzu.vmware.com" +} + +func (c *ProgressiveUpgradeRuntime) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ProgressiveUpgradeRuntimeSpec struct { + UpgradeName string `json:"upgradeName" yaml:"upgradeName"` + Status string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/config/progressive-upgrade/progressive-upgrade-config/progressive-upgrade.ts\", gofile:\"progressive_upgrade.go\", name:\"ProgressiveUpgradeStatus\")"` + Step string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/config/progressive-upgrade/progressive-upgrade-config/progressive-upgrade.ts\", gofile:\"progressive_upgrade.go\", name:\"ProgressiveUpgradeStep\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ProgressiveUpgradeRuntimeList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ProgressiveUpgradeRuntime `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ProjectConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ProjectConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ProjectConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ProjectConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ProjectConfig) CRDName() string { + return "projectconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *ProjectConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ProjectConfigSpec struct { + Name string `json:"name" yaml:"name"` + CertificateAuthoritiesGvk map[string]Child `json:"certificateAuthoritiesGvk,omitempty" yaml:"certificateAuthoritiesGvk,omitempty" nexus:"children"` + SvcGroupsGvk map[string]Link `json:"svcGroupsGvk,omitempty" yaml:"svcGroupsGvk,omitempty" nexus:"links"` + GnsGvk map[string]Link `json:"gnsGvk,omitempty" yaml:"gnsGvk,omitempty" nexus:"links"` + PolicyConfigsGvk map[string]Link `json:"policyConfigsGvk,omitempty" yaml:"policyConfigsGvk,omitempty" nexus:"links"` + TemplateGroupsGvk map[string]Link `json:"templateGroupsGvk,omitempty" yaml:"templateGroupsGvk,omitempty" nexus:"links"` + CertificatesGvk map[string]Link `json:"certificatesGvk,omitempty" yaml:"certificatesGvk,omitempty" nexus:"links"` + ExternalAccountsGvk map[string]Link `json:"externalAccountsGvk,omitempty" yaml:"externalAccountsGvk,omitempty" nexus:"links"` + ExternalDNSGvk map[string]Link `json:"externalDNSGvk,omitempty" yaml:"externalDNSGvk,omitempty" nexus:"links"` + AutoscalersGvk map[string]Link `json:"autoscalersGvk,omitempty" yaml:"autoscalersGvk,omitempty" nexus:"links"` + ClustersGvk map[string]Link `json:"clustersGvk,omitempty" yaml:"clustersGvk,omitempty" nexus:"links"` + ServiceLevelObjectivesGvk map[string]Link `json:"serviceLevelObjectivesGvk,omitempty" yaml:"serviceLevelObjectivesGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ProjectConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ProjectConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ProjectInventory struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ProjectInventorySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ProjectInventoryNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ProjectInventoryNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ProjectInventory) CRDName() string { + return "projectinventories.global.tsm.tanzu.vmware.com" +} + +func (c *ProjectInventory) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ProjectInventorySpec struct { + ClustersGvk map[string]Link `json:"clustersGvk,omitempty" yaml:"clustersGvk,omitempty" nexus:"links"` + ExternalDNSGvk map[string]Link `json:"externalDNSGvk,omitempty" yaml:"externalDNSGvk,omitempty" nexus:"links"` + JobsGvk map[string]Link `json:"jobsGvk,omitempty" yaml:"jobsGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ProjectInventoryList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ProjectInventory `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ProjectQuery struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + + Status ProjectQueryNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ProjectQueryNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ProjectQuery) CRDName() string { + return "projectqueries.global.tsm.tanzu.vmware.com" +} + +func (c *ProjectQuery) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ProjectQueryList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ProjectQuery `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Project struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ProjectSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ProjectNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ProjectNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Project) CRDName() string { + return "projects.global.tsm.tanzu.vmware.com" +} + +func (c *Project) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ProjectSpec struct { + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file: \"../common-apis/api/tenant/models/project\", gofile: \"project.go\", name: \"ProjectSpec\")"` + ConfigGvk *Child `json:"configGvk,omitempty" yaml:"configGvk,omitempty" nexus:"child"` + InventoryGvk *Child `json:"inventoryGvk,omitempty" yaml:"inventoryGvk,omitempty" nexus:"child"` + QueryGvk *Child `json:"queryGvk,omitempty" yaml:"queryGvk,omitempty" nexus:"child"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ProjectList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Project `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type PublicServiceRT struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec PublicServiceRTSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status PublicServiceRTNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type PublicServiceRTNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *PublicServiceRT) CRDName() string { + return "publicservicerts.global.tsm.tanzu.vmware.com" +} + +func (c *PublicServiceRT) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type PublicServiceRTSpec struct { + OwnedBy string `json:"ownedBy" yaml:"ownedBy"` + FqdnList []string `json:"fqdnList" yaml:"fqdnList"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type PublicServiceRTList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []PublicServiceRT `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type RemoteGatewayServiceConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec RemoteGatewayServiceConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status RemoteGatewayServiceConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type RemoteGatewayServiceConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *RemoteGatewayServiceConfig) CRDName() string { + return "remotegatewayserviceconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *RemoteGatewayServiceConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type RemoteGatewayServiceConfigSpec struct { + OwnedBy string `json:"ownedBy" yaml:"ownedBy"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"Labels\")"` + NodeIPs string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"DMSet\")"` + Ports string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/runtime/runtime.ts\", gofile:\"runtime.go\", name:\"ServicePortList\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type RemoteGatewayServiceConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []RemoteGatewayServiceConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ResourceGroupRT struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ResourceGroupRTSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ResourceGroupRTNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ResourceGroupRTNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ResourceGroupRT) CRDName() string { + return "resourcegrouprts.global.tsm.tanzu.vmware.com" +} + +func (c *ResourceGroupRT) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ResourceGroupRTSpec struct { + SvcGroupRTGvk map[string]Child `json:"svcGroupRTGvk,omitempty" yaml:"svcGroupRTGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ResourceGroupRTList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ResourceGroupRT `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ResourceGroup struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ResourceGroupSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ResourceGroupNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ResourceGroupNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ResourceGroup) CRDName() string { + return "resourcegroups.global.tsm.tanzu.vmware.com" +} + +func (c *ResourceGroup) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ResourceGroupSpec struct { + AppGroupsGvk map[string]Child `json:"appGroupsGvk,omitempty" yaml:"appGroupsGvk,omitempty" nexus:"children"` + SvcGroupsGvk map[string]Child `json:"svcGroupsGvk,omitempty" yaml:"svcGroupsGvk,omitempty" nexus:"children"` + NodeGroupsGvk map[string]Child `json:"nodeGroupsGvk,omitempty" yaml:"nodeGroupsGvk,omitempty" nexus:"children"` + DataGroupsGvk map[string]Child `json:"dataGroupsGvk,omitempty" yaml:"dataGroupsGvk,omitempty" nexus:"children"` + UserGroupsGvk map[string]Child `json:"userGroupsGvk,omitempty" yaml:"userGroupsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ResourceGroupList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ResourceGroup `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Root struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec RootSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status RootNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type RootNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Root) CRDName() string { + return "roots.global.tsm.tanzu.vmware.com" +} + +func (c *Root) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type RootSpec struct { + Name string `nexus-graphql-nullable:"false"` + ConfigGvk *Child `json:"configGvk,omitempty" yaml:"configGvk,omitempty" nexus:"child"` + InventoryGvk *Child `json:"inventoryGvk,omitempty" yaml:"inventoryGvk,omitempty" nexus:"child"` + RuntimeGvk *Child `json:"runtimeGvk,omitempty" yaml:"runtimeGvk,omitempty" nexus:"child"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type RootList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Root `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type RPolicy struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec RPolicySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status RPolicyNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type RPolicyNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *RPolicy) CRDName() string { + return "rpolicies.global.tsm.tanzu.vmware.com" +} + +func (c *RPolicy) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type RPolicySpec struct { + HealthCheckId string `json:"healthCheckId" yaml:"healthCheckId"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type RPolicyList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []RPolicy `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Runtime struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec RuntimeSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status RuntimeNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type RuntimeNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Runtime) CRDName() string { + return "runtimes.global.tsm.tanzu.vmware.com" +} + +func (c *Runtime) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type RuntimeSpec struct { + AllsparkServicesGvk *Child `json:"allsparkServicesGvk,omitempty" yaml:"allsparkServicesGvk,omitempty" nexus:"child"` + UserFolderGvk *Child `json:"userFolderGvk,omitempty" yaml:"userFolderGvk,omitempty" nexus:"child"` + DataFolderGvk *Child `json:"dataFolderGvk,omitempty" yaml:"dataFolderGvk,omitempty" nexus:"child"` + AppFolderGvk *Child `json:"appFolderGvk,omitempty" yaml:"appFolderGvk,omitempty" nexus:"child"` + NodeFolderGvk *Child `json:"nodeFolderGvk,omitempty" yaml:"nodeFolderGvk,omitempty" nexus:"child"` + ClusterFolderGvk *Child `json:"clusterFolderGvk,omitempty" yaml:"clusterFolderGvk,omitempty" nexus:"child"` + ProgressiveUpgradeGvk *Child `json:"progressiveUpgradeGvk,omitempty" yaml:"progressiveUpgradeGvk,omitempty" nexus:"child"` + JobConfigFolderGvk *Child `json:"jobConfigFolderGvk,omitempty" yaml:"jobConfigFolderGvk,omitempty" nexus:"child"` + ExternalDNSGvk *Child `json:"externalDNSGvk,omitempty" yaml:"externalDNSGvk,omitempty" nexus:"child"` + SloFolderGvk *Child `json:"sloFolderGvk,omitempty" yaml:"sloFolderGvk,omitempty" nexus:"child"` + ServiceDirectoryRTGvk *Child `json:"serviceDirectoryRTGvk,omitempty" yaml:"serviceDirectoryRTGvk,omitempty" nexus:"child"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type RuntimeList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Runtime `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type SchemaViolationDiscoveryRT struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec SchemaViolationDiscoveryRTSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status SchemaViolationDiscoveryRTNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type SchemaViolationDiscoveryRTNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *SchemaViolationDiscoveryRT) CRDName() string { + return "schemaviolationdiscoveryrts.global.tsm.tanzu.vmware.com" +} + +func (c *SchemaViolationDiscoveryRT) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type SchemaViolationDiscoveryRTSpec struct { + Gnsid string `json:"gnsid" yaml:"gnsid"` + Selectors string `nexus-graphql-tsm-directive:"@jsonencoded(file: \"../common-apis/api/tenant/models/common\", gofile:\"gns_schema_violation_discovery.go\", name:\"GnsSchemaViolationDiscoveryClusterResourceSelectorRT\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file: \"../common-apis/api/tenant/models/gnsSchemaViolationDiscovery\", gofile:\"gns_schema_violation_discovery.go\", name:\"GnsSchemaViolationDiscoveryConfig\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type SchemaViolationDiscoveryRTList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []SchemaViolationDiscoveryRT `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type GnsSchemaViolationDiscovery struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec GnsSchemaViolationDiscoverySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status GnsSchemaViolationDiscoveryNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type GnsSchemaViolationDiscoveryNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *GnsSchemaViolationDiscovery) CRDName() string { + return "gnsschemaviolationdiscoveries.global.tsm.tanzu.vmware.com" +} + +func (c *GnsSchemaViolationDiscovery) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type GnsSchemaViolationDiscoverySpec struct { + Description string `json:"description" yaml:"description"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/common\", gofile:\"common.go\", name:\"LabelsList\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsSchemaViolationDiscovery\", gofile:\"gns_schema_violation_discovery.go\", name:\"GnsSchemaViolationDiscoveryConfig\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type GnsSchemaViolationDiscoveryList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []GnsSchemaViolationDiscovery `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type SecretRTConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec SecretRTConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status SecretRTConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type SecretRTConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *SecretRTConfig) CRDName() string { + return "secretrtconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *SecretRTConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type SecretRTConfigSpec struct { + Type string `json:"type" yaml:"type"` + Data string `json:"data" yaml:"data"` + IsBase64Encoded bool `json:"isBase64Encoded" yaml:"isBase64Encoded"` + OwnedBy string `json:"ownedBy" yaml:"ownedBy"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type SecretRTConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []SecretRTConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type SecretHash struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec SecretHashSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status SecretHashNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type SecretHashNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *SecretHash) CRDName() string { + return "secrethashes.global.tsm.tanzu.vmware.com" +} + +func (c *SecretHash) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type SecretHashSpec struct { + Name string `json:"name" yaml:"name"` + Type string `json:"type" yaml:"type"` + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + DataHash string `json:"dataHash" yaml:"dataHash"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type SecretHashList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []SecretHash `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type SecurityContextConstraintsConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec SecurityContextConstraintsConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status SecurityContextConstraintsConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type SecurityContextConstraintsConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *SecurityContextConstraintsConfig) CRDName() string { + return "securitycontextconstraintsconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *SecurityContextConstraintsConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type SecurityContextConstraintsConfigSpec struct { + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + Name string `nexus-graphql-nullable:"false"` + Groups []string `json:"groups" yaml:"groups"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type SecurityContextConstraintsConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []SecurityContextConstraintsConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type SecurityContextConstraints struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec SecurityContextConstraintsSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status SecurityContextConstraintsNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type SecurityContextConstraintsNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *SecurityContextConstraints) CRDName() string { + return "securitycontextconstraintses.global.tsm.tanzu.vmware.com" +} + +func (c *SecurityContextConstraints) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type SecurityContextConstraintsSpec struct { + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + Name string `nexus-graphql-nullable:"false"` + Groups []string `json:"groups" yaml:"groups"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type SecurityContextConstraintsList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []SecurityContextConstraints `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceConfig) CRDName() string { + return "serviceconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceConfigSpec struct { + Name string `json:"name" yaml:"name"` + OwnedBy string `json:"ownedBy" yaml:"ownedBy"` + ServiceVersionGvk map[string]Child `json:"serviceVersionGvk,omitempty" yaml:"serviceVersionGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceCronJob struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceCronJobSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceCronJobNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceCronJobNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceCronJob) CRDName() string { + return "servicecronjobs.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceCronJob) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceCronJobSpec struct { + Name string `json:"name" yaml:"name"` + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"CronJobSpec\")"` + Status string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"CronJobStatus\")"` + ServiceInstancesGvk map[string]Link `json:"serviceInstancesGvk,omitempty" yaml:"serviceInstancesGvk,omitempty" nexus:"links"` + ServiceJobsGvk map[string]Link `json:"serviceJobsGvk,omitempty" yaml:"serviceJobsGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceCronJobList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceCronJob `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceDaemonSet struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceDaemonSetSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceDaemonSetNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceDaemonSetNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceDaemonSet) CRDName() string { + return "servicedaemonsets.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceDaemonSet) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceDaemonSetSpec struct { + Name string `json:"name" yaml:"name"` + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"DaemonSetSpec\")"` + Status string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"DaemonSetStatus\")"` + ServiceInstancesGvk map[string]Link `json:"serviceInstancesGvk,omitempty" yaml:"serviceInstancesGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceDaemonSetList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceDaemonSet `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceDeploymentContainer struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceDeploymentContainerSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceDeploymentContainerNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceDeploymentContainerNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceDeploymentContainer) CRDName() string { + return "servicedeploymentcontainers.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceDeploymentContainer) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceDeploymentContainerSpec struct { + Name string `json:"name" yaml:"name"` + Image string `json:"image" yaml:"image"` + ImagePullPolicy string `json:"imagePullPolicy" yaml:"imagePullPolicy"` + TerminationMessagePath string `json:"terminationMessagePath" yaml:"terminationMessagePath"` + TerminationMessagePolicy string `json:"terminationMessagePolicy" yaml:"terminationMessagePolicy"` + Args string `nexus-graphql-tsm-directive:"@jsonencoded"` + Env string `nexus-graphql-tsm-directive:"@jsonencoded"` + LivenessProbe string `nexus-graphql-tsm-directive:"@jsonencoded"` + ReadinessProbe string `nexus-graphql-tsm-directive:"@jsonencoded"` + Ports string `nexus-graphql-tsm-directive:"@jsonencoded"` + Resources string `nexus-graphql-tsm-directive:"@jsonencoded"` + VolumeMounts string `nexus-graphql-tsm-directive:"@jsonencoded"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceDeploymentContainerList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceDeploymentContainer `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceDeployment struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceDeploymentSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceDeploymentNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceDeploymentNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceDeployment) CRDName() string { + return "servicedeployments.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceDeployment) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceDeploymentSpec struct { + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"DeploymentSpec\")"` + Status string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"DeploymentStatus\")"` + Namespace string `json:"namespace" yaml:"namespace"` + Annotations string `nexus-graphql-tsm-directive:"@jsonencoded"` + CreationTimestamp string `json:"creationTimestamp" yaml:"creationTimestamp"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded"` + Name string `json:"name" yaml:"name"` + ApiLink string `json:"apiLink" yaml:"apiLink"` + Uid string `json:"uid" yaml:"uid"` + Generation int `json:"generation" yaml:"generation"` + Selector string `nexus-graphql-tsm-directive:"@jsonencoded"` + Replicas int `json:"replicas" yaml:"replicas"` + DnsPolicy string `json:"dnsPolicy" yaml:"dnsPolicy"` + RestartPolicy string `json:"restartPolicy" yaml:"restartPolicy"` + SchedulerName string `json:"schedulerName" yaml:"schedulerName"` + SecurityContext string `nexus-graphql-tsm-directive:"@jsonencoded"` + ServiceAccount string `json:"serviceAccount" yaml:"serviceAccount"` + ServiceAccountName string `json:"serviceAccountName" yaml:"serviceAccountName"` + TerminationGracePeriodSeconds int `json:"terminationGracePeriodSeconds" yaml:"terminationGracePeriodSeconds"` + Volumes string `nexus-graphql-tsm-directive:"@jsonencoded"` + TemplateLabels string `nexus-graphql-tsm-directive:"@jsonencoded"` + StatusReplicas int `json:"statusReplicas" yaml:"statusReplicas"` + AvailableReplicas int `json:"availableReplicas" yaml:"availableReplicas"` + UpdatedReplicas int `json:"updatedReplicas" yaml:"updatedReplicas"` + ReadyReplicas int `json:"readyReplicas" yaml:"readyReplicas"` + ObservedGeneration int `json:"observedGeneration" yaml:"observedGeneration"` + Conditions string `nexus-graphql-tsm-directive:"@jsonencoded"` + ContainersGvk map[string]Child `json:"containersGvk,omitempty" yaml:"containersGvk,omitempty" nexus:"children"` + ServiceInstancesGvk map[string]Link `json:"serviceInstancesGvk,omitempty" yaml:"serviceInstancesGvk,omitempty" nexus:"links"` + ServiceReplicaSetGvk map[string]Link `json:"serviceReplicaSetGvk,omitempty" yaml:"serviceReplicaSetGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceDeploymentList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceDeployment `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceDirectoryEntryConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceDirectoryEntryConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceDirectoryEntryConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceDirectoryEntryConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceDirectoryEntryConfig) CRDName() string { + return "servicedirectoryentryconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceDirectoryEntryConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceDirectoryEntryConfigSpec struct { + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/serviceDirectory\", gofile:\"service_directory_entry.go\", name:\"ServiceDirectoryEntry\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceDirectoryEntryConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceDirectoryEntryConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceDirectoryRTFolderEntry struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceDirectoryRTFolderEntrySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceDirectoryRTFolderEntryNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceDirectoryRTFolderEntryNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceDirectoryRTFolderEntry) CRDName() string { + return "servicedirectoryrtfolderentries.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceDirectoryRTFolderEntry) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceDirectoryRTFolderEntrySpec struct { + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/serviceDirectory\", gofile:\"service_directory_entry.go\", name:\"ServiceDirectoryEntry\")"` + Spec_type string `nexus-alias-type:"ServiceDirectoryRTFolderEntryType"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceDirectoryRTFolderEntryList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceDirectoryRTFolderEntry `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceDirectoryRTFolder struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceDirectoryRTFolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceDirectoryRTFolderNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceDirectoryRTFolderNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceDirectoryRTFolder) CRDName() string { + return "servicedirectoryrtfolders.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceDirectoryRTFolder) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceDirectoryRTFolderSpec struct { + Name string `json:"name" yaml:"name"` + ServiceDirectoryRTFolderEntryGvk map[string]Child `json:"serviceDirectoryRTFolderEntryGvk,omitempty" yaml:"serviceDirectoryRTFolderEntryGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceDirectoryRTFolderList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceDirectoryRTFolder `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceDirectoryRT struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceDirectoryRTSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceDirectoryRTNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceDirectoryRTNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceDirectoryRT) CRDName() string { + return "servicedirectoryrts.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceDirectoryRT) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceDirectoryRTSpec struct { + ServiceDirectoryRTFolderGvk map[string]Child `json:"serviceDirectoryRTFolderGvk,omitempty" yaml:"serviceDirectoryRTFolderGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceDirectoryRTList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceDirectoryRT `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceDirectoryN struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceDirectoryNSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceDirectoryNNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceDirectoryNNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceDirectoryN) CRDName() string { + return "servicedirectoryns.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceDirectoryN) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceDirectoryNSpec struct { + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/serviceDirectory\", gofile:\"service_directory.go\", name:\"ServiceDirectorySpec\")"` + EntriesGvk map[string]Child `json:"entriesGvk,omitempty" yaml:"entriesGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceDirectoryNList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceDirectoryN `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceEntryConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceEntryConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceEntryConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceEntryConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceEntryConfig) CRDName() string { + return "serviceentryconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceEntryConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceEntryConfigSpec struct { + Name string `json:"name" yaml:"name"` + OwnedBy string `json:"ownedBy" yaml:"ownedBy"` + Service string `json:"service" yaml:"service"` + ServiceFQDN string `json:"serviceFQDN" yaml:"serviceFQDN"` + Description string `json:"description" yaml:"description"` + ServicePortList string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/runtime/runtime.ts\", gofile:\"runtime.go\", name:\"ServicePortList\")"` + Tags []string `json:"tags" yaml:"tags"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"Labels\")"` + Endpoints []string `json:"endpoints" yaml:"endpoints"` + EndpointList string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/runtime/runtime.ts\", gofile:\"runtime.go\", name:\"ServiceEndpointList\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceEntryConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceEntryConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceEntry struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceEntrySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceEntryNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceEntryNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceEntry) CRDName() string { + return "serviceentries.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceEntry) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceEntrySpec struct { + Name string `json:"name" yaml:"name"` + Annotations string `nexus-graphql-tsm-directive:"@jsonencoded"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded"` + CreationTimestamp string `json:"creationTimestamp" yaml:"creationTimestamp"` + ApiLink string `json:"apiLink" yaml:"apiLink"` + Uid string `json:"uid" yaml:"uid"` + Hosts string `nexus-graphql-tsm-directive:"@jsonencoded"` + Addresses string `nexus-graphql-tsm-directive:"@jsonencoded"` + Ports string `nexus-graphql-tsm-directive:"@jsonencoded"` + Location string `json:"location" yaml:"location"` + Resolution string `json:"resolution" yaml:"resolution"` + Endpoints string `nexus-graphql-tsm-directive:"@jsonencoded"` + ExportTo []string `nexus-graphql-nullable:"false"` + WorkloadSelectorLabels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"Labels\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceEntryList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceEntry `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type SvcGroupRT struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec SvcGroupRTSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status SvcGroupRTNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type SvcGroupRTNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *SvcGroupRT) CRDName() string { + return "svcgrouprts.global.tsm.tanzu.vmware.com" +} + +func (c *SvcGroupRT) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type SvcGroupRTSpec struct { + Name string `json:"name" yaml:"name"` + DisplayName string `json:"displayName" yaml:"displayName"` + Description string `json:"description" yaml:"description"` + Services string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/serviceGroup\", gofile:\"service_group.go\", name:\"ServiceGroupSvcList\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type SvcGroupRTList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []SvcGroupRT `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceInstanceContainer struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceInstanceContainerSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceInstanceContainerNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceInstanceContainerNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceInstanceContainer) CRDName() string { + return "serviceinstancecontainers.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceInstanceContainer) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceInstanceContainerSpec struct { + Name string `json:"name" yaml:"name"` + Image string `json:"image" yaml:"image"` + ImagePullPolicy string `json:"imagePullPolicy" yaml:"imagePullPolicy"` + TerminationMessagePath string `json:"terminationMessagePath" yaml:"terminationMessagePath"` + TerminationMessagePolicy string `json:"terminationMessagePolicy" yaml:"terminationMessagePolicy"` + Resources string `nexus-graphql-tsm-directive:"@jsonencoded"` + VolumeMounts string `nexus-graphql-tsm-directive:"@jsonencoded"` + Command string `nexus-graphql-tsm-directive:"@jsonencoded"` + SecurityContext string `nexus-graphql-tsm-directive:"@jsonencoded"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceInstanceContainerList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceInstanceContainer `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceInstance struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceInstanceSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceInstanceNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceInstanceNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceInstance) CRDName() string { + return "serviceinstances.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceInstance) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceInstanceSpec struct { + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"ServiceInstanceSpec\")"` + Status string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"ServiceInstanceStatus\")"` + Name string `json:"name" yaml:"name"` + Namespace string `json:"namespace" yaml:"namespace"` + Annotations string `nexus-graphql-tsm-directive:"@jsonencoded"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded"` + ApiLink string `json:"apiLink" yaml:"apiLink"` + Uid string `json:"uid" yaml:"uid"` + RestartPolicy string `json:"restartPolicy" yaml:"restartPolicy"` + DnsPolicy string `json:"dnsPolicy" yaml:"dnsPolicy"` + HostNetwork bool `json:"hostNetwork" yaml:"hostNetwork"` + SecurityContext string `nexus-graphql-tsm-directive:"@jsonencoded"` + TerminationGracePeriodSeconds int `json:"terminationGracePeriodSeconds" yaml:"terminationGracePeriodSeconds"` + Tolerations string `nexus-graphql-tsm-directive:"@jsonencoded"` + StatusConditions string `nexus-graphql-tsm-directive:"@jsonencoded"` + StatusContainer string `nexus-graphql-tsm-directive:"@jsonencoded"` + PodIP string `json:"podIP" yaml:"podIP"` + QosClass string `json:"qosClass" yaml:"qosClass"` + Phase string `json:"phase" yaml:"phase"` + StartTime string `json:"startTime" yaml:"startTime"` + NodeName string `json:"nodeName" yaml:"nodeName"` + ContainersGvk map[string]Child `json:"containersGvk,omitempty" yaml:"containersGvk,omitempty" nexus:"children"` + NodeGvk *Link `json:"nodeGvk,omitempty" yaml:"nodeGvk,omitempty" nexus:"link"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceInstanceList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceInstance `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceJob struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceJobSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceJobNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceJobNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceJob) CRDName() string { + return "servicejobs.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceJob) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceJobSpec struct { + Name string `json:"name" yaml:"name"` + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"JobSpec\")"` + Status string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"JobStatus\")"` + ServiceInstancesGvk map[string]Link `json:"serviceInstancesGvk,omitempty" yaml:"serviceInstancesGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceJobList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceJob `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceLevelObjectiveFolder struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceLevelObjectiveFolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceLevelObjectiveFolderNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceLevelObjectiveFolderNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceLevelObjectiveFolder) CRDName() string { + return "servicelevelobjectivefolders.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceLevelObjectiveFolder) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceLevelObjectiveFolderSpec struct { + ServiceLevelObjectivesGvk map[string]Child `json:"serviceLevelObjectivesGvk,omitempty" yaml:"serviceLevelObjectivesGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceLevelObjectiveFolderList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceLevelObjectiveFolder `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceLevelObjective struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceLevelObjectiveSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceLevelObjectiveNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceLevelObjectiveNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceLevelObjective) CRDName() string { + return "servicelevelobjectives.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceLevelObjective) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceLevelObjectiveSpec struct { + ProjectId string `json:"projectId" yaml:"projectId"` + Disabled bool `json:"disabled" yaml:"disabled"` + Description string `json:"description" yaml:"description"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"Labels\")"` + Slis string `nexus-graphql-nullable:"false" nexus-graphql-tsm-directive:"@jsonencoded(file: \"./root/config/service-level-objective/slo.ts\" gofile: \"slo.go\" name: \"ServiceLevelIndicationGroup\")"` + SloServices string `nexus-graphql-nullable:"false" nexus-graphql-tsm-directive:"@jsonencoded(file: \"./root/config/service-level-objective/slo.ts\" gofile: \"slo.go\" name: \"SloServices\")"` + SloTargetValue string `nexus-graphql-nullable:"false" nexus-graphql-tsm-directive:"@jsonencoded(file: \"./root/config/service-level-objective/slo.ts\" gofile: \"slo.go\" name: \"SloTargetValue\")"` + SloPeriod string `nexus-alias-type:"SloPeriodFrequency"` + SloCreationTime string `nexus-graphql-nullable:"false"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceLevelObjectiveList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceLevelObjective `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceReplicaSet struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceReplicaSetSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceReplicaSetNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceReplicaSetNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceReplicaSet) CRDName() string { + return "servicereplicasets.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceReplicaSet) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceReplicaSetSpec struct { + Name string `json:"name" yaml:"name"` + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"ReplicaSetSpec\")"` + Status string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"ReplicaSetStatus\")"` + ServiceInstancesGvk map[string]Link `json:"serviceInstancesGvk,omitempty" yaml:"serviceInstancesGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceReplicaSetList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceReplicaSet `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceStatefulSet struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceStatefulSetSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceStatefulSetNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceStatefulSetNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceStatefulSet) CRDName() string { + return "servicestatefulsets.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceStatefulSet) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceStatefulSetSpec struct { + Name string `json:"name" yaml:"name"` + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"StatefulSetSpec\")"` + Status string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"StatefulSetStatus\")"` + ServiceInstancesGvk map[string]Link `json:"serviceInstancesGvk,omitempty" yaml:"serviceInstancesGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceStatefulSetList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceStatefulSet `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceTemplateServiceDefinition struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceTemplateServiceDefinitionSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceTemplateServiceDefinitionNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceTemplateServiceDefinitionNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceTemplateServiceDefinition) CRDName() string { + return "servicetemplateservicedefinitions.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceTemplateServiceDefinition) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceTemplateServiceDefinitionSpec struct { + Type string `nexus-graphql-nullable:"false"` + Version string `nexus-graphql-nullable:"false"` + Template string `nexus-graphql-nullable:"false"` + TemplateArgs []string `nexus-graphql-nullable:"false"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceTemplateServiceDefinitionList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceTemplateServiceDefinition `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceTemplate struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceTemplateSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceTemplateNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceTemplateNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceTemplate) CRDName() string { + return "servicetemplates.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceTemplate) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceTemplateSpec struct { + Version string `json:"version" yaml:"version"` + ServiceDefinitionsGvk map[string]Child `json:"serviceDefinitionsGvk,omitempty" yaml:"serviceDefinitionsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceTemplateList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceTemplate `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceVersionConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceVersionConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceVersionConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceVersionConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceVersionConfig) CRDName() string { + return "serviceversionconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceVersionConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceVersionConfigSpec struct { + Name string `json:"name" yaml:"name"` + Version string `json:"version" yaml:"version"` + MetricMonitorsGvk map[string]Child `json:"metricMonitorsGvk,omitempty" yaml:"metricMonitorsGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceVersionConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceVersionConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type MetricMonitor struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec MetricMonitorSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status MetricMonitorNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type MetricMonitorNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *MetricMonitor) CRDName() string { + return "metricmonitors.global.tsm.tanzu.vmware.com" +} + +func (c *MetricMonitor) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type MetricMonitorSpec struct { + OwnedBy string `json:"ownedBy" yaml:"ownedBy"` + SvcMetric string `nexus-alias-type:"ServiceMetricTypeEnum"` + FunctionType string `nexus-alias-type:"MetricMonitorFunction"` + FunctionArgs string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/runtime/cluster-folder/cluster-config/domain-config/service-config/service-version-config/metric-monitor.ts\", gofile:\"metric-monitor.go\", name:\"FnArgs\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type MetricMonitorList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []MetricMonitor `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type ServiceVersion struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceVersionSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceVersionNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceVersionNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *ServiceVersion) CRDName() string { + return "serviceversions.global.tsm.tanzu.vmware.com" +} + +func (c *ServiceVersion) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceVersionSpec struct { + Name string `nexus-graphql-nullable:"false"` + ServiceDeploymentsGvk map[string]Link `json:"serviceDeploymentsGvk,omitempty" yaml:"serviceDeploymentsGvk,omitempty" nexus:"links"` + ServiceDaemonSetsGvk map[string]Link `json:"serviceDaemonSetsGvk,omitempty" yaml:"serviceDaemonSetsGvk,omitempty" nexus:"links"` + ServiceStatefulSetsGvk map[string]Link `json:"serviceStatefulSetsGvk,omitempty" yaml:"serviceStatefulSetsGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceVersionList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []ServiceVersion `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Service struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec ServiceSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status ServiceNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type ServiceNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Service) CRDName() string { + return "services.global.tsm.tanzu.vmware.com" +} + +func (c *Service) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type ServiceSpec struct { + Metadata string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"Metadata\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/kubernetes.d.ts\", gofile:\"kubernetes.go\", name:\"ServiceSpec\")"` + Name string `json:"name" yaml:"name"` + Namespace string `json:"namespace" yaml:"namespace"` + ApiLink string `json:"apiLink" yaml:"apiLink"` + IpAddress string `json:"ipAddress" yaml:"ipAddress"` + Annotations string `nexus-graphql-tsm-directive:"@jsonencoded"` + CreationTimestamp string `json:"creationTimestamp" yaml:"creationTimestamp"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded"` + Uid string `json:"uid" yaml:"uid"` + Ports string `nexus-graphql-tsm-directive:"@jsonencoded"` + Selector string `nexus-graphql-tsm-directive:"@jsonencoded"` + Type string `json:"type" yaml:"type"` + Status string `nexus-graphql-tsm-directive:"@jsonencoded"` + AdditionalAttributesGvk map[string]Child `json:"additionalAttributesGvk,omitempty" yaml:"additionalAttributesGvk,omitempty" nexus:"children"` + ServiceVersionsGvk map[string]Child `json:"serviceVersionsGvk,omitempty" yaml:"serviceVersionsGvk,omitempty" nexus:"children"` + ServiceDeploymentsGvk map[string]Link `json:"serviceDeploymentsGvk,omitempty" yaml:"serviceDeploymentsGvk,omitempty" nexus:"links"` + ServiceStatefulSetsGvk map[string]Link `json:"serviceStatefulSetsGvk,omitempty" yaml:"serviceStatefulSetsGvk,omitempty" nexus:"links"` + ServiceDaemonSetsGvk map[string]Link `json:"serviceDaemonSetsGvk,omitempty" yaml:"serviceDaemonSetsGvk,omitempty" nexus:"links"` + EndpointsGvk map[string]Link `json:"endpointsGvk,omitempty" yaml:"endpointsGvk,omitempty" nexus:"links"` + ServiceReplicaSetsGvk map[string]Link `json:"serviceReplicaSetsGvk,omitempty" yaml:"serviceReplicaSetsGvk,omitempty" nexus:"links"` + ServiceJobsGvk map[string]Link `json:"serviceJobsGvk,omitempty" yaml:"serviceJobsGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Service `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type SloConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec SloConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status SloConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type SloConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *SloConfig) CRDName() string { + return "sloconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *SloConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type SloConfigSpec struct { + Name string `json:"name" yaml:"name"` + SloServicesGvk map[string]Child `json:"sloServicesGvk,omitempty" yaml:"sloServicesGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type SloConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []SloConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type SloServiceConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec SloServiceConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status SloServiceConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type SloServiceConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *SloServiceConfig) CRDName() string { + return "sloserviceconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *SloServiceConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type SloServiceConfigSpec struct { + Name string `json:"name" yaml:"name"` + RemainingBudget int `json:"remainingBudget" yaml:"remainingBudget"` + LastUpdateTime string `json:"lastUpdateTime" yaml:"lastUpdateTime"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type SloServiceConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []SloServiceConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type SLOFolder struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec SLOFolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status SLOFolderNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type SLOFolderNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *SLOFolder) CRDName() string { + return "slofolders.global.tsm.tanzu.vmware.com" +} + +func (c *SLOFolder) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type SLOFolderSpec struct { + SlosGvk map[string]Child `json:"slosGvk,omitempty" yaml:"slosGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type SLOFolderList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []SLOFolder `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type FederatedSloConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec FederatedSloConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status FederatedSloConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type FederatedSloConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *FederatedSloConfig) CRDName() string { + return "federatedsloconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *FederatedSloConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type FederatedSloConfigSpec struct { + Name string `json:"name" yaml:"name"` + SloServicesGvk map[string]Child `json:"sloServicesGvk,omitempty" yaml:"sloServicesGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type FederatedSloConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []FederatedSloConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type FederatedSloServiceConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec FederatedSloServiceConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status FederatedSloServiceConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type FederatedSloServiceConfigNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *FederatedSloServiceConfig) CRDName() string { + return "federatedsloserviceconfigs.global.tsm.tanzu.vmware.com" +} + +func (c *FederatedSloServiceConfig) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type FederatedSloServiceConfigSpec struct { + Name string `json:"name" yaml:"name"` + RemainingBudget int `json:"remainingBudget" yaml:"remainingBudget"` + LastUpdateTime string `json:"lastUpdateTime" yaml:"lastUpdateTime"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type FederatedSloServiceConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []FederatedSloServiceConfig `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type SLOPolicy struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec SLOPolicySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status SLOPolicyNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type SLOPolicyNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *SLOPolicy) CRDName() string { + return "slopolicies.global.tsm.tanzu.vmware.com" +} + +func (c *SLOPolicy) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type SLOPolicySpec struct { + Name string `nexus-graphql-nullable:"false"` + Disabled bool `json:"disabled" yaml:"disabled"` + Description string `json:"description" yaml:"description"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"./common/ts/common.d.ts\", gofile:\"common.go\", name:\"Labels\")"` + Slis string `nexus-graphql-nullable:"false" nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/config/service-level-objective/slo.ts\", gofile:\"slo.go\", name:\"ServiceLevelIndicationGroup\")"` + ServiceNames []string `nexus-graphql-nullable:"false"` + SloTargetValue string `nexus-graphql-nullable:"false" nexus-graphql-tsm-directive:"@jsonencoded(file:\"./root/config/service-level-objective/slo.ts\", gofile:\"slo.go\", name:\"SloTargetValue\")"` + SloPeriod string `nexus-alias-type:"SloPeriodFrequency!"` + SloKind string `nexus-alias-type:"SLOKind!"` + Actions []string `json:"actions" yaml:"actions"` + SloCreationTime string `nexus-graphql-nullable:"false"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type SLOPolicyList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []SLOPolicy `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type SvcGroup struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec SvcGroupSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status SvcGroupNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type SvcGroupNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *SvcGroup) CRDName() string { + return "svcgroups.global.tsm.tanzu.vmware.com" +} + +func (c *SvcGroup) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type SvcGroupSpec struct { + DisplayName string `json:"displayName" yaml:"displayName"` + InternalPredefinedGroup bool `json:"internalPredefinedGroup" yaml:"internalPredefinedGroup"` + Description string `json:"description" yaml:"description"` + Color string `json:"color" yaml:"color"` + ProjectId string `json:"projectId" yaml:"projectId"` + Rules string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/resourceGroup\", gofile:\"resource_group.go\", name:\"Rules\")"` + ServicesGvk map[string]Link `json:"servicesGvk,omitempty" yaml:"servicesGvk,omitempty" nexus:"links"` + DeploymentsGvk map[string]Link `json:"deploymentsGvk,omitempty" yaml:"deploymentsGvk,omitempty" nexus:"links"` + DaemonsetsGvk map[string]Link `json:"daemonsetsGvk,omitempty" yaml:"daemonsetsGvk,omitempty" nexus:"links"` + StatefulsetsGvk map[string]Link `json:"statefulsetsGvk,omitempty" yaml:"statefulsetsGvk,omitempty" nexus:"links"` + JobsGvk map[string]Link `json:"jobsGvk,omitempty" yaml:"jobsGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type SvcGroupList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []SvcGroup `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Table struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec TableSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status TableNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type TableNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Table) CRDName() string { + return "tables.global.tsm.tanzu.vmware.com" +} + +func (c *Table) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type TableSpec struct { + TemplateGvk *Link `json:"templateGvk,omitempty" yaml:"templateGvk,omitempty" nexus:"link"` + InventoryGvk *Link `json:"inventoryGvk,omitempty" yaml:"inventoryGvk,omitempty" nexus:"link"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type TableList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Table `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type TemplateGroup struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec TemplateGroupSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status TemplateGroupNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type TemplateGroupNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *TemplateGroup) CRDName() string { + return "templategroups.global.tsm.tanzu.vmware.com" +} + +func (c *TemplateGroup) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type TemplateGroupSpec struct { + ProjectId string `json:"projectId" yaml:"projectId"` + DataTemplatesGvk map[string]Child `json:"dataTemplatesGvk,omitempty" yaml:"dataTemplatesGvk,omitempty" nexus:"children"` + NodeTemplatesGvk map[string]Child `json:"nodeTemplatesGvk,omitempty" yaml:"nodeTemplatesGvk,omitempty" nexus:"children"` + AppTemplatesGvk map[string]Child `json:"appTemplatesGvk,omitempty" yaml:"appTemplatesGvk,omitempty" nexus:"children"` + ServiceTemplatesGvk map[string]Child `json:"serviceTemplatesGvk,omitempty" yaml:"serviceTemplatesGvk,omitempty" nexus:"children"` + PolicyTemplatesGvk map[string]Child `json:"policyTemplatesGvk,omitempty" yaml:"policyTemplatesGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type TemplateGroupList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []TemplateGroup `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Template struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec TemplateSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status TemplateNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type TemplateNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Template) CRDName() string { + return "templates.global.tsm.tanzu.vmware.com" +} + +func (c *Template) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type TemplateSpec struct { + TemplateGroupsGvk map[string]Child `json:"templateGroupsGvk,omitempty" yaml:"templateGroupsGvk,omitempty" nexus:"children"` + HealthChecksGvk map[string]Child `json:"healthChecksGvk,omitempty" yaml:"healthChecksGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type TemplateList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Template `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type TenantResource struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec TenantResourceSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status TenantResourceNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type TenantResourceNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *TenantResource) CRDName() string { + return "tenantresources.global.tsm.tanzu.vmware.com" +} + +func (c *TenantResource) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type TenantResourceSpec struct { + Type string `json:"type" yaml:"type"` + Location string `json:"location" yaml:"location"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type TenantResourceList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []TenantResource `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type TenantToken struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec TenantTokenSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status TenantTokenNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type TenantTokenNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *TenantToken) CRDName() string { + return "tenanttokens.global.tsm.tanzu.vmware.com" +} + +func (c *TenantToken) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type TenantTokenSpec struct { + Ttl int `json:"ttl" yaml:"ttl"` + Created string `json:"created" yaml:"created"` + TenantId string `json:"tenantId" yaml:"tenantId"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type TenantTokenList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []TenantToken `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type Tenant struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec TenantSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status TenantNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type TenantNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *Tenant) CRDName() string { + return "tenants.global.tsm.tanzu.vmware.com" +} + +func (c *Tenant) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type TenantSpec struct { + Name string `nexus-graphql-nullable:"false"` + TenantName string `nexus-graphql-nullable:"false"` + ContactEmail string `nexus-graphql-nullable:"false"` + Yaml string `json:"yaml" yaml:"yaml"` + Lb string `json:"lb" yaml:"lb"` + CompanySize string `json:"companySize" yaml:"companySize"` + Address string `json:"address" yaml:"address"` + ResourcesGvk map[string]Child `json:"resourcesGvk,omitempty" yaml:"resourcesGvk,omitempty" nexus:"children"` + AnnotationsGvk map[string]Child `json:"annotationsGvk,omitempty" yaml:"annotationsGvk,omitempty" nexus:"children"` + TemplateGvk *Link `json:"templateGvk,omitempty" yaml:"templateGvk,omitempty" nexus:"link"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type TenantList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []Tenant `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type UserDiscoveryRT struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec UserDiscoveryRTSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status UserDiscoveryRTNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type UserDiscoveryRTNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *UserDiscoveryRT) CRDName() string { + return "userdiscoveryrts.global.tsm.tanzu.vmware.com" +} + +func (c *UserDiscoveryRT) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type UserDiscoveryRTSpec struct { + Gnsid string `json:"gnsid" yaml:"gnsid"` + Selectors string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/common\", gofile:\"gns_user_discovery.go\", name:\"UserDiscoveryClusterResourceSelectorRT\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsUserDiscovery\", gofile:\"gns_user_discovery.go\", name:\"UserDiscoveryApplicationConfigList\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type UserDiscoveryRTList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []UserDiscoveryRT `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type UserDiscovery struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec UserDiscoverySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status UserDiscoveryNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type UserDiscoveryNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *UserDiscovery) CRDName() string { + return "userdiscoveries.global.tsm.tanzu.vmware.com" +} + +func (c *UserDiscovery) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type UserDiscoverySpec struct { + Description string `json:"description" yaml:"description"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/common\", gofile:\"common.go\", name:\"LabelsList\")"` + Spec string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsUserDiscovery\", gofile:\"gns_user_discovery.go\", name:\"UserDiscoveryConfig\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type UserDiscoveryList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []UserDiscovery `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type UserFolder struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec UserFolderSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status UserFolderNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type UserFolderNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *UserFolder) CRDName() string { + return "userfolders.global.tsm.tanzu.vmware.com" +} + +func (c *UserFolder) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type UserFolderSpec struct { + UsersGvk map[string]Child `json:"usersGvk,omitempty" yaml:"usersGvk,omitempty" nexus:"children"` + AppUsersGvk map[string]Child `json:"appUsersGvk,omitempty" yaml:"appUsersGvk,omitempty" nexus:"children"` + AccessTokenGvk map[string]Child `json:"accessTokenGvk,omitempty" yaml:"accessTokenGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type UserFolderList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []UserFolder `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type UserGroup struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec UserGroupSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status UserGroupNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type UserGroupNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *UserGroup) CRDName() string { + return "usergroups.global.tsm.tanzu.vmware.com" +} + +func (c *UserGroup) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type UserGroupSpec struct { + DisplayName string `json:"displayName" yaml:"displayName"` + Description string `json:"description" yaml:"description"` + Scope string `json:"scope" yaml:"scope"` + Color string `json:"color" yaml:"color"` + Rules string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/resourceGroup\", gofile:\"resource_group.go\", name:\"Rules\")"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type UserGroupList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []UserGroup `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type UserPreference struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec UserPreferenceSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status UserPreferenceNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type UserPreferenceNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *UserPreference) CRDName() string { + return "userpreferences.global.tsm.tanzu.vmware.com" +} + +func (c *UserPreference) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type UserPreferenceSpec struct { + Name string `json:"name" yaml:"name"` + Data string `json:"data" yaml:"data"` + UserId string `nexus-alias-type:"ID"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type UserPreferenceList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []UserPreference `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type User struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec UserSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status UserNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type UserNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *User) CRDName() string { + return "users.global.tsm.tanzu.vmware.com" +} + +func (c *User) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type UserSpec struct { + Username string `json:"username" yaml:"username"` + Password string `json:"password" yaml:"password"` + Email string `json:"email" yaml:"email"` + AccessTokens []string `json:"accessTokens" yaml:"accessTokens"` + LastActionDate string `json:"lastActionDate" yaml:"lastActionDate"` + PreferencesGvk map[string]Child `json:"preferencesGvk,omitempty" yaml:"preferencesGvk,omitempty" nexus:"children"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type UserList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []User `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type VirtualService struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec VirtualServiceSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status VirtualServiceNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type VirtualServiceNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *VirtualService) CRDName() string { + return "virtualservices.global.tsm.tanzu.vmware.com" +} + +func (c *VirtualService) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type VirtualServiceSpec struct { + Name string `json:"name" yaml:"name"` + CreationTimestamp string `json:"creationTimestamp" yaml:"creationTimestamp"` + ApiLink string `json:"apiLink" yaml:"apiLink"` + Uid string `json:"uid" yaml:"uid"` + Annotations string `nexus-graphql-tsm-directive:"@jsonencoded"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded"` + Hosts string `nexus-graphql-tsm-directive:"@jsonencoded"` + Http string `nexus-graphql-tsm-directive:"@jsonencoded"` + Tls string `nexus-graphql-tsm-directive:"@jsonencoded"` + Tcp string `nexus-graphql-tsm-directive:"@jsonencoded"` + GatewayNames string `nexus-graphql-tsm-directive:"@jsonencoded"` + ExportTo []string `nexus-graphql-nullable:"false"` + DestinationRulesGvk map[string]Link `json:"destinationRulesGvk,omitempty" yaml:"destinationRulesGvk,omitempty" nexus:"links"` + ServicesGvk map[string]Link `json:"servicesGvk,omitempty" yaml:"servicesGvk,omitempty" nexus:"links"` + GatewaysGvk map[string]Link `json:"gatewaysGvk,omitempty" yaml:"gatewaysGvk,omitempty" nexus:"links"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type VirtualServiceList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []VirtualService `json:"items" yaml:"items"` +} + +// +genclient +// +genclient:noStatus +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true +type WorkloadEntry struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec WorkloadEntrySpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status WorkloadEntryNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +// +k8s:openapi-gen=true +type WorkloadEntryNexusStatus struct { + Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` +} + +func (c *WorkloadEntry) CRDName() string { + return "workloadentries.global.tsm.tanzu.vmware.com" +} + +func (c *WorkloadEntry) DisplayName() string { + if c.GetLabels() != nil { + return c.GetLabels()[common.DISPLAY_NAME_LABEL] + } + return "" +} + +// +k8s:openapi-gen=true +type WorkloadEntrySpec struct { + Name string `json:"name" yaml:"name"` + Annotations string `nexus-graphql-tsm-directive:"@jsonencoded"` + Labels string `nexus-graphql-tsm-directive:"@jsonencoded"` + CreationTimestamp string `json:"creationTimestamp" yaml:"creationTimestamp"` + ApiLink string `json:"apiLink" yaml:"apiLink"` + Uid string `json:"uid" yaml:"uid"` + Address string `json:"address" yaml:"address"` + WorkloadLabels string `nexus-graphql-tsm-directive:"@jsonencoded"` + Ports string `nexus-graphql-tsm-directive:"@jsonencoded"` + Locality string `json:"locality" yaml:"locality"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type WorkloadEntryList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []WorkloadEntry `json:"items" yaml:"items"` +} + +// +k8s:openapi-gen=true +type QueryServiceInstanceTableArgs struct { +} + +// +k8s:openapi-gen=true +type QueryServiceTSArgs struct { +} + +// +k8s:openapi-gen=true +type QueryServiceTableArgs struct { + SystemServices bool `json:"systemServices" yaml:"systemServices"` + ExternalServices bool `json:"externalServices" yaml:"externalServices"` + ShowGateways bool `json:"showGateways" yaml:"showGateways"` + Groupby string `nexus-alias-type:"ServiceGroupByEnum" json:"groupby" yaml:"groupby"` +} + +// +k8s:openapi-gen=true +type QueryServiceVersionTableArgs struct { + SystemServices bool `json:"systemServices" yaml:"systemServices"` + ExternalServices bool `json:"externalServices" yaml:"externalServices"` + ShowGateways bool `json:"showGateways" yaml:"showGateways"` +} + +// +k8s:openapi-gen=true +type QueryServiceTopologyArgs struct { +} + +// +k8s:openapi-gen=true +type QueryClusterTableArgs struct { +} + +// +k8s:openapi-gen=true +type QueryStartEndTimeArgs struct { +} + +// +k8s:openapi-gen=true +type QueryAccessControlPolicyStatsArgs struct { +} + +// +k8s:openapi-gen=true +type QueryGNSServiceAPIArgs struct { +} + +// +k8s:openapi-gen=true +type QueryStatsArgs struct { +} + +// +k8s:openapi-gen=true +type QueryLogsArgs struct { +} + +// +k8s:openapi-gen=true +type QueryListArgs struct { +} + +// +k8s:openapi-gen=true +type QueryLinechartArgs struct { +} + +// +k8s:openapi-gen=true +type QueryTopNArgs struct { +} + +// +k8s:openapi-gen=true +type QueryDetailArgs struct { +} + +// +k8s:openapi-gen=true +type QueryIncomingAPIsArgs struct { +} + +// +k8s:openapi-gen=true +type QueryOutgoingAPIsArgs struct { +} + +// +k8s:openapi-gen=true +type QueryIncomingTCPArgs struct { +} + +// +k8s:openapi-gen=true +type QueryOutgoingTCPArgs struct { +} + +// +k8s:openapi-gen=true +type ProjectQueryNodeTSArgs struct { +} + +// +k8s:openapi-gen=true +type ProjectClusterInventoryCountArgs struct { +} + +// +k8s:openapi-gen=true +type ProjectQueryStatsArgs struct { +} + +// +k8s:openapi-gen=true +type ProjectQueryLogsArgs struct { +} + +// +k8s:openapi-gen=true +type ProjectQueryListArgs struct { +} + +// +k8s:openapi-gen=true +type ProjectQueryLinechartArgs struct { +} + +// +k8s:openapi-gen=true +type ProjectQueryTopNArgs struct { +} + +// +k8s:openapi-gen=true +type ProjectQueryDetailArgs struct { +} + +// +k8s:openapi-gen=true +type ProjectRiskTrackerArgs struct { +} + +// +k8s:openapi-gen=true +type ProjectRiskTrackerDetailArgs struct { +} + +// +k8s:openapi-gen=true +type QueryWorkloadVersionAPIArgs struct { +} + +// +k8s:openapi-gen=true +type ClusterQueryServiceVersionTableArgs struct { + SystemServices bool `json:"systemServices" yaml:"systemServices"` + ShowGateways bool `json:"showGateways" yaml:"showGateways"` +} + +// +k8s:openapi-gen=true +type ClusterQueryServiceTableArgs struct { + SystemServices bool `json:"systemServices" yaml:"systemServices"` + ShowGateways bool `json:"showGateways" yaml:"showGateways"` + Groupby string `nexus-alias-type:"ServiceGroupByEnum" json:"groupby" yaml:"groupby"` +} + +// +k8s:openapi-gen=true +type DomainQueryLogsArgs struct { +} + +// +k8s:openapi-gen=true +type DomainQueryServiceTableArgs struct { + SystemServices bool `json:"systemServices" yaml:"systemServices"` + ShowGateways bool `json:"showGateways" yaml:"showGateways"` + Groupby string `nexus-alias-type:"ServiceGroupByEnum" json:"groupby" yaml:"groupby"` +} + +// +k8s:openapi-gen=true +type DomainQueryServiceVersionTableArgs struct { + SystemServices bool `json:"systemServices" yaml:"systemServices"` + ShowGateways bool `json:"showGateways" yaml:"showGateways"` +} + +// +k8s:openapi-gen=true +type QuerySloArgs struct { +} + +// +k8s:openapi-gen=true +type QueryClusterInventoryCountArgs struct { +} + +// +k8s:openapi-gen=true +type QueryServiceAPIArgs struct { +} + +// +k8s:openapi-gen=true +type InventoryQueryServiceAPIArgs struct { + Continue string `nexus-alias-name:"Continue" json:"continue" yaml:"continue"` +} + +// +k8s:openapi-gen=true +type SvcQueryDetailArgs struct { +} + +// +k8s:openapi-gen=true +type SvcQueryIncomingAPIsArgs struct { +} + +// +k8s:openapi-gen=true +type SvcQueryOutgoingAPIsArgs struct { +} + +// +k8s:openapi-gen=true +type SvcQueryIncomingTCPArgs struct { +} + +// +k8s:openapi-gen=true +type SvcQueryOutgoingTCPArgs struct { +} + +// +k8s:openapi-gen=true +type SvcQueryTopNArgs struct { +} + +// +k8s:openapi-gen=true +type SvcQueryServiceVersionTableArgs struct { + ShowGateways bool `json:"showGateways" yaml:"showGateways"` +} + +// +k8s:openapi-gen=true +type ConfigChangeStatusError struct { + Message string `json:"message" mapstructure:"message" yaml:"message"` + Timestamp int `json:"timestamp" mapstructure:"timestamp" yaml:"timestamp"` +} + +// +k8s:openapi-gen=true +type ConfigChangeStatusWarning struct { + Message string `json:"message" mapstructure:"message" yaml:"message"` + Timestamp int `json:"timestamp" mapstructure:"timestamp" yaml:"timestamp"` +} + +// +k8s:openapi-gen=true +type ConfigChangeStatus struct { + CurrentChangeId string `json:"currentChangeId" mapstructure:"currentChangeId" yaml:"currentChangeId"` + CurrentState RuntimeConfigChangeState `json:"currentState" mapstructure:"currentState" yaml:"currentState"` + LastUpdateTime int `json:"lastUpdateTime" mapstructure:"lastUpdateTime" yaml:"lastUpdateTime"` + RetryCnt int `json:"retryCnt" mapstructure:"retryCnt" yaml:"retryCnt"` + Errors ConfigChangeStatusErrors `json:"errors" mapstructure:"errors" yaml:"errors"` + Warnings ConfigChangeStatusWarnings `json:"warnings" mapstructure:"warnings" yaml:"warnings"` +} + +// +k8s:openapi-gen=true +type PublicServiceRouteConfigStatus struct { + Status string `nexus-graphql-tsm-directive:"@jsonencoded(file:\"../common-apis/api/tenant/models/gnsPublicService.ts\", gofile:\"gns_public_service.go\", name: \"GnsPublicServiceRouteStatus\")" json:"status" yaml:"status"` +} + +// +k8s:openapi-gen=true +type GNSConfigStatusError struct { + Message string `json:"message" mapstructure:"message" yaml:"message"` + Count int `json:"count" mapstructure:"count" yaml:"count"` +} + +// +k8s:openapi-gen=true +type GNSConfigStatusWarning struct { + Message string `json:"message" mapstructure:"message" yaml:"message"` + Count int `json:"count" mapstructure:"count" yaml:"count"` +} + +// +k8s:openapi-gen=true +type GNSConfigStatus struct { + State GNSConfigStatusPluginState `json:"state" mapstructure:"state" yaml:"state"` + ConfigsSynced int `json:"configsSynced" mapstructure:"configsSynced" yaml:"configsSynced"` + Timestamp int `json:"timestamp" mapstructure:"timestamp" yaml:"timestamp"` + Errors GNSConfigStatusErrors `json:"errors" mapstructure:"errors" yaml:"errors"` + Warnings GNSConfigStatusWarnings `json:"warnings" mapstructure:"warnings" yaml:"warnings"` +} + +// +k8s:openapi-gen=true +type GnsExternalServiceConfig struct { + Name string `json:"Name" mapstructure:"Name" yaml:"name"` + Description string `json:"description" mapstructure:"description" yaml:"description"` + Labels ESLabels `json:"labels" mapstructure:"labels" yaml:"labels"` + Tags []string `json:"tags" mapstructure:"tags" yaml:"tags"` + Active bool `json:"active" mapstructure:"active" yaml:"active"` + Type string `json:"type" mapstructure:"type" yaml:"type"` + ConfigRemote GnsExternalServiceRemoteConfig `json:"configRemote" mapstructure:"configRemote" yaml:"configRemote"` + ConfigServiceDirectory GnsExternalServiceSDConfig `json:"config_service_directory" mapstructure:"config_service_directory" yaml:"configServiceDirectory"` +} + +// +k8s:openapi-gen=true +type GnsExternalServiceRemoteConfig struct { + ServicePort int32 `json:"service_port" mapstructure:"service_port" yaml:"servicePort"` + Protocol string `json:"protocol" mapstructure:"protocol" yaml:"protocol"` + Hostname string `json:"hostname" mapstructure:"hostname" yaml:"hostname"` + Port int32 `json:"port" mapstructure:"port" yaml:"port"` + Certificate string `json:"certificate" mapstructure:"certificate" yaml:"certificate"` + HostnameAlias string `json:"hostname_alias" mapstructure:"hostname_alias" yaml:"hostnameAlias"` + Endpoints []string `json:"endpoints" mapstructure:"endpoints" yaml:"endpoints"` +} + +// +k8s:openapi-gen=true +type GnsExternalServiceSDConfig struct { + SdName string `json:"sd_name" mapstructure:"sd_name" yaml:"sdName"` + ExactNameRules []string `json:"exact_name_rules" mapstructure:"exact_name_rules" yaml:"exactNameRules"` + RegexNameRules []string `json:"regex_name_rules" mapstructure:"regex_name_rules" yaml:"regexNameRules"` + LabelRules []string `json:"label_rules" mapstructure:"label_rules" yaml:"labelRules"` +} + +// +k8s:openapi-gen=true +type ESLabel struct { + Key string `json:"key" mapstructure:"key" yaml:"key"` + Value string `json:"value" mapstructure:"value" yaml:"value"` +} + +// +k8s:openapi-gen=true +type GnsPublicServiceConfig struct { + Name string `json:"name" mapstructure:"name" yaml:"name"` + PublicDomain GnspsPublicDomain `json:"public_domains,omitempty" mapstructure:"public_domains" yaml:"publicDomain"` + DnsHaPolicy GnspsdnshaPolicy `json:"dns_ha_policy,omitempty" mapstructure:"dns_ha_policy" yaml:"dnsHaPolicy"` + WildcardCertificateId string `json:"wildcard_certificate_id,omitempty" mapstructure:"wildcard_certificate_id" yaml:"wildcardCertificateId"` +} + +// +k8s:openapi-gen=true +type GnsPublicServiceConfigWithId struct { + Name string `json:"name" mapstructure:"name" yaml:"name"` + PublicDomain GnspsPublicDomain `json:"public_domains,omitempty" mapstructure:"public_domains" yaml:"publicDomain"` + DnsHaPolicy GnspsdnshaPolicy `json:"dns_ha_policy,omitempty" mapstructure:"dns_ha_policy" yaml:"dnsHaPolicy"` + WildcardCertificateId string `json:"wildcard_certificate_id,omitempty" mapstructure:"wildcard_certificate_id" yaml:"wildcardCertificateId"` + Id string `json:"id,omitempty" mapstructure:"id" yaml:"id"` +} + +// +k8s:openapi-gen=true +type GnsPublicServiceDomain struct { + DnsId string `json:"dns_id,omitempty" mapstructure:"dns_id" yaml:"dnsId"` + Domain string `json:"domain,omitempty" mapstructure:"domain" yaml:"domain"` +} + +// +k8s:openapi-gen=true +type GnsPublicServiceDomainList struct { + Domains []GnsPublicServiceDomain `json:"domains,omitempty" mapstructure:"domains" yaml:"domains"` +} + +// +k8s:openapi-gen=true +type GnsPublicServiceRouteStatus struct { + State string `json:"state" mapstructure:"state" yaml:"state"` + Message string `json:"message,omitempty" mapstructure:"message" yaml:"message"` +} + +// +k8s:openapi-gen=true +type GnsPublicServiceStatus struct { + State string `json:"state" mapstructure:"state" yaml:"state"` + Message string `json:"message,omitempty" mapstructure:"message" yaml:"message"` +} + +// +k8s:openapi-gen=true +type GnspsPublicDomain struct { + ExternalDnsId string `json:"external_dns_id,omitempty" mapstructure:"external_dns_id" yaml:"externalDnsId"` + PrimaryDomain string `json:"primary_domain,omitempty" mapstructure:"primary_domain" yaml:"primaryDomain"` + SubDomain string `json:"sub_domain,omitempty" mapstructure:"sub_domain" yaml:"subDomain"` + CertificateId string `json:"certificate_id,omitempty" mapstructure:"certificate_id" yaml:"certificateId"` +} + +// +k8s:openapi-gen=true +type GnspsdnshaPolicy struct { + PolicyType string `json:"policyType" mapstructure:"policyType" yaml:"policyType"` +} + +// +k8s:openapi-gen=true +type GnsPublicServiceRouteConfig struct { + Paths []string `json:"path,omitempty" mapstructure:"path" yaml:"paths"` + Target string `json:"target,omitempty" mapstructure:"target" yaml:"target"` + TargetPort int32 `json:"target_port,omitempty" mapstructure:"target_port" yaml:"targetPort"` +} + +// +k8s:openapi-gen=true +type GnsPublicServiceRouteConfigWithID struct { + Path string `json:"path,omitempty" mapstructure:"path" yaml:"path"` + Target string `json:"target,omitempty" mapstructure:"target" yaml:"target"` + TargetPort int32 `json:"target_port,omitempty" mapstructure:"target_port" yaml:"targetPort"` + Id string `json:"id,omitempty" mapstructure:"id" yaml:"id"` +} + +// +k8s:openapi-gen=true +type FnArgs struct { + WindowSeconds int32 `json:"windowSeconds" mapstructure:"windowSeconds" yaml:"windowSeconds"` + Threshold int32 `json:"threshold" mapstructure:"threshold" yaml:"threshold"` +} + +// +k8s:openapi-gen=true +type queryNodeTSArgs struct { + nodeMetric string `nexus-alias-type:"NodeMetricTypeEnum" json:"nodeMetric" yaml:"nodeMetric"` + startTime string `json:"startTime" yaml:"startTime"` + endTime string `json:"endTime" yaml:"endTime"` + timeInterval string `json:"timeInterval" yaml:"timeInterval"` +} + +// +k8s:openapi-gen=true +type queryNodeTableArgs struct { + startTime string `json:"startTime" yaml:"startTime"` + endTime string `json:"endTime" yaml:"endTime"` +} + +// +k8s:openapi-gen=true +type PolicyAction struct { + Mtls MtlsState `json:"mtls" mapstructure:"mtls" yaml:"mtls"` +} + +// Some of these types can't be named the same as what we have in the graphql file, +// even though we want to emulate a recursive structure. If the names here aren't +// unique they will collide with what gets generated from the graphql file. +type RuntimeConfigChangeState int +type ConfigChangeStatusErrors []ConfigChangeStatusError +type ConfigChangeStatusWarnings []ConfigChangeStatusWarning +type ConfigChangeStatusHistory []ConfigChangeStatus + +// TODO How to support ConfigMapDataStub? +type ConfigMapData map[string]string + +// Some of these types can't be named the same as what we have in the graphql file, +// even though we want to emulate a recursive structure. If the names here aren't +// unique they will collide with what gets generated from the graphql file. +type GNSConfigStatusPluginState int +type GNSConfigStatusErrors []GNSConfigStatusError +type GNSConfigStatusWarnings []GNSConfigStatusWarning +type GNSConfigStatusHistory []GNSConfigStatus +type ESLabels []ESLabel +type ServiceGroupServiceList []struct { + Type string `json:"type,omitempty" mapstructure:"type"` + Domain string `json:"domain,omitempty" mapstructure:"domain"` + Name string `json:"name,omitempty" mapstructure:"name"` + MatchPriority int32 `json:"matchPriority,omitempty" mapstructure:"matchPriority"` +} +type MtlsState int +type PolicyActions PolicyAction +type NexusNode nexus.Node +type ServiceGroupSvcList []struct { + Type string `json:"type,omitempty" mapstructure:"type"` + Domain string `json:"domain,omitempty" mapstructure:"domain"` + Name string `json:"name,omitempty" mapstructure:"name"` +} + +const ( + RuntimeConfigChangeState_APPLIED RuntimeConfigChangeState = iota + RuntimeConfigChangeState_INSYNC + RuntimeConfigChangeState_INERROR + GNSConfigStatusPluginState_IDLE GNSConfigStatusPluginState = iota + GNSConfigStatusPluginState_PROCESSING + GNSConfigStatusPluginState_SYNCING + GNSConfigStatusPluginState_SYNCED + GNSConfigStatusPluginState_ERROR + GnsExternalServiceConfig_FromExternal = "FromExternal" + GnsExternalServiceConfig_FromServiceDirectory = "FromServiceDirectory" + GnsExternalServiceConfig_TCP = "TCP" + GnsExternalServiceConfig_TLS = "TLS" + GnsExternalServiceConfig_HTTP = "HTTP" + GnsExternalServiceConfig_HTTPS = "HTTPS" + INHERIT MtlsState = iota + ENFORCING + PERMISSIVE + DISABLED + UNDEFINED +) diff --git a/compiler/example/output/generated/apis/global.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go b/compiler/example/output/generated/apis/global.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go new file mode 100644 index 000000000..752c3156f --- /dev/null +++ b/compiler/example/output/generated/apis/global.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go @@ -0,0 +1,22908 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +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 deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + customtsmtanzuvmwarecomv1 "nexustempmodule/apis/custom.tsm.tanzu.vmware.com/v1" + + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACPConfig) DeepCopyInto(out *ACPConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACPConfig. +func (in *ACPConfig) DeepCopy() *ACPConfig { + if in == nil { + return nil + } + out := new(ACPConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ACPConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACPConfigList) DeepCopyInto(out *ACPConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ACPConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACPConfigList. +func (in *ACPConfigList) DeepCopy() *ACPConfigList { + if in == nil { + return nil + } + out := new(ACPConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ACPConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACPConfigNexusStatus) DeepCopyInto(out *ACPConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACPConfigNexusStatus. +func (in *ACPConfigNexusStatus) DeepCopy() *ACPConfigNexusStatus { + if in == nil { + return nil + } + out := new(ACPConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACPConfigSpec) DeepCopyInto(out *ACPConfigSpec) { + *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.DestGroups != nil { + in, out := &in.DestGroups, &out.DestGroups + *out = make(customtsmtanzuvmwarecomv1.ResourceGroupIDs, len(*in)) + copy(*out, *in) + } + if in.SourceGroups != nil { + in, out := &in.SourceGroups, &out.SourceGroups + *out = make(customtsmtanzuvmwarecomv1.ResourceGroupIDs, len(*in)) + copy(*out, *in) + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Actions != nil { + in, out := &in.Actions, &out.Actions + *out = make(customtsmtanzuvmwarecomv1.PolicyCfgActions, len(*in)) + copy(*out, *in) + } + if in.DestSvcGroupsGvk != nil { + in, out := &in.DestSvcGroupsGvk, &out.DestSvcGroupsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SourceSvcGroupsGvk != nil { + in, out := &in.SourceSvcGroupsGvk, &out.SourceSvcGroupsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACPConfigSpec. +func (in *ACPConfigSpec) DeepCopy() *ACPConfigSpec { + if in == nil { + return nil + } + out := new(ACPConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AccessControlPolicy) DeepCopyInto(out *AccessControlPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessControlPolicy. +func (in *AccessControlPolicy) DeepCopy() *AccessControlPolicy { + if in == nil { + return nil + } + out := new(AccessControlPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AccessControlPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AccessControlPolicyList) DeepCopyInto(out *AccessControlPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AccessControlPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessControlPolicyList. +func (in *AccessControlPolicyList) DeepCopy() *AccessControlPolicyList { + if in == nil { + return nil + } + out := new(AccessControlPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AccessControlPolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AccessControlPolicyNexusStatus) DeepCopyInto(out *AccessControlPolicyNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessControlPolicyNexusStatus. +func (in *AccessControlPolicyNexusStatus) DeepCopy() *AccessControlPolicyNexusStatus { + if in == nil { + return nil + } + out := new(AccessControlPolicyNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AccessControlPolicySpec) DeepCopyInto(out *AccessControlPolicySpec) { + *out = *in + if in.PolicyConfigsGvk != nil { + in, out := &in.PolicyConfigsGvk, &out.PolicyConfigsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessControlPolicySpec. +func (in *AccessControlPolicySpec) DeepCopy() *AccessControlPolicySpec { + if in == nil { + return nil + } + out := new(AccessControlPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AccessToken) DeepCopyInto(out *AccessToken) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessToken. +func (in *AccessToken) DeepCopy() *AccessToken { + if in == nil { + return nil + } + out := new(AccessToken) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AccessToken) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AccessTokenList) DeepCopyInto(out *AccessTokenList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AccessToken, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessTokenList. +func (in *AccessTokenList) DeepCopy() *AccessTokenList { + if in == nil { + return nil + } + out := new(AccessTokenList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AccessTokenList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AccessTokenNexusStatus) DeepCopyInto(out *AccessTokenNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessTokenNexusStatus. +func (in *AccessTokenNexusStatus) DeepCopy() *AccessTokenNexusStatus { + if in == nil { + return nil + } + out := new(AccessTokenNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AccessTokenSpec) DeepCopyInto(out *AccessTokenSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessTokenSpec. +func (in *AccessTokenSpec) DeepCopy() *AccessTokenSpec { + if in == nil { + return nil + } + out := new(AccessTokenSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AdditionalAttributes) DeepCopyInto(out *AdditionalAttributes) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalAttributes. +func (in *AdditionalAttributes) DeepCopy() *AdditionalAttributes { + if in == nil { + return nil + } + out := new(AdditionalAttributes) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AdditionalAttributes) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AdditionalAttributesList) DeepCopyInto(out *AdditionalAttributesList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AdditionalAttributes, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalAttributesList. +func (in *AdditionalAttributesList) DeepCopy() *AdditionalAttributesList { + if in == nil { + return nil + } + out := new(AdditionalAttributesList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AdditionalAttributesList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AdditionalAttributesNexusStatus) DeepCopyInto(out *AdditionalAttributesNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalAttributesNexusStatus. +func (in *AdditionalAttributesNexusStatus) DeepCopy() *AdditionalAttributesNexusStatus { + if in == nil { + return nil + } + out := new(AdditionalAttributesNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AdditionalAttributesSpec) DeepCopyInto(out *AdditionalAttributesSpec) { + *out = *in + out.Value = in.Value + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalAttributesSpec. +func (in *AdditionalAttributesSpec) DeepCopy() *AdditionalAttributesSpec { + if in == nil { + return nil + } + out := new(AdditionalAttributesSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllSparkServices) DeepCopyInto(out *AllSparkServices) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllSparkServices. +func (in *AllSparkServices) DeepCopy() *AllSparkServices { + if in == nil { + return nil + } + out := new(AllSparkServices) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AllSparkServices) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllSparkServicesList) DeepCopyInto(out *AllSparkServicesList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AllSparkServices, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllSparkServicesList. +func (in *AllSparkServicesList) DeepCopy() *AllSparkServicesList { + if in == nil { + return nil + } + out := new(AllSparkServicesList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AllSparkServicesList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllSparkServicesNexusStatus) DeepCopyInto(out *AllSparkServicesNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllSparkServicesNexusStatus. +func (in *AllSparkServicesNexusStatus) DeepCopy() *AllSparkServicesNexusStatus { + if in == nil { + return nil + } + out := new(AllSparkServicesNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllSparkServicesSpec) DeepCopyInto(out *AllSparkServicesSpec) { + *out = *in + if in.GlobalRegistrationServiceGvk != nil { + in, out := &in.GlobalRegistrationServiceGvk, &out.GlobalRegistrationServiceGvk + *out = new(Child) + **out = **in + } + if in.LocalRegistrationServiceGvk != nil { + in, out := &in.LocalRegistrationServiceGvk, &out.LocalRegistrationServiceGvk + *out = new(Child) + **out = **in + } + if in.AwsConnectorGvk != nil { + in, out := &in.AwsConnectorGvk, &out.AwsConnectorGvk + *out = new(Child) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllSparkServicesSpec. +func (in *AllSparkServicesSpec) DeepCopy() *AllSparkServicesSpec { + if in == nil { + return nil + } + out := new(AllSparkServicesSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Annotation) DeepCopyInto(out *Annotation) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Annotation. +func (in *Annotation) DeepCopy() *Annotation { + if in == nil { + return nil + } + out := new(Annotation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Annotation) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AnnotationList) DeepCopyInto(out *AnnotationList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Annotation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnnotationList. +func (in *AnnotationList) DeepCopy() *AnnotationList { + if in == nil { + return nil + } + out := new(AnnotationList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AnnotationList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AnnotationNexusStatus) DeepCopyInto(out *AnnotationNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnnotationNexusStatus. +func (in *AnnotationNexusStatus) DeepCopy() *AnnotationNexusStatus { + if in == nil { + return nil + } + out := new(AnnotationNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AnnotationSpec) DeepCopyInto(out *AnnotationSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnnotationSpec. +func (in *AnnotationSpec) DeepCopy() *AnnotationSpec { + if in == nil { + return nil + } + out := new(AnnotationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApiDiscovery) DeepCopyInto(out *ApiDiscovery) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApiDiscovery. +func (in *ApiDiscovery) DeepCopy() *ApiDiscovery { + if in == nil { + return nil + } + out := new(ApiDiscovery) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ApiDiscovery) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApiDiscoveryList) DeepCopyInto(out *ApiDiscoveryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ApiDiscovery, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApiDiscoveryList. +func (in *ApiDiscoveryList) DeepCopy() *ApiDiscoveryList { + if in == nil { + return nil + } + out := new(ApiDiscoveryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ApiDiscoveryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApiDiscoveryNexusStatus) DeepCopyInto(out *ApiDiscoveryNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApiDiscoveryNexusStatus. +func (in *ApiDiscoveryNexusStatus) DeepCopy() *ApiDiscoveryNexusStatus { + if in == nil { + return nil + } + out := new(ApiDiscoveryNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApiDiscoveryRT) DeepCopyInto(out *ApiDiscoveryRT) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApiDiscoveryRT. +func (in *ApiDiscoveryRT) DeepCopy() *ApiDiscoveryRT { + if in == nil { + return nil + } + out := new(ApiDiscoveryRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ApiDiscoveryRT) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApiDiscoveryRTList) DeepCopyInto(out *ApiDiscoveryRTList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ApiDiscoveryRT, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApiDiscoveryRTList. +func (in *ApiDiscoveryRTList) DeepCopy() *ApiDiscoveryRTList { + if in == nil { + return nil + } + out := new(ApiDiscoveryRTList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ApiDiscoveryRTList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApiDiscoveryRTNexusStatus) DeepCopyInto(out *ApiDiscoveryRTNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApiDiscoveryRTNexusStatus. +func (in *ApiDiscoveryRTNexusStatus) DeepCopy() *ApiDiscoveryRTNexusStatus { + if in == nil { + return nil + } + out := new(ApiDiscoveryRTNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApiDiscoveryRTSpec) DeepCopyInto(out *ApiDiscoveryRTSpec) { + *out = *in + in.Selectors.DeepCopyInto(&out.Selectors) + if in.Spec != nil { + in, out := &in.Spec, &out.Spec + *out = make(customtsmtanzuvmwarecomv1.ApiDiscoveryApplicationConfigList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.IsEndpointApiPrechecks.DeepCopyInto(&out.IsEndpointApiPrechecks) + in.ProcessingToggles.DeepCopyInto(&out.ProcessingToggles) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApiDiscoveryRTSpec. +func (in *ApiDiscoveryRTSpec) DeepCopy() *ApiDiscoveryRTSpec { + if in == nil { + return nil + } + out := new(ApiDiscoveryRTSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApiDiscoverySpec) DeepCopyInto(out *ApiDiscoverySpec) { + *out = *in + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(customtsmtanzuvmwarecomv1.LabelsList, len(*in)) + copy(*out, *in) + } + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApiDiscoverySpec. +func (in *ApiDiscoverySpec) DeepCopy() *ApiDiscoverySpec { + if in == nil { + return nil + } + out := new(ApiDiscoverySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *App) DeepCopyInto(out *App) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new App. +func (in *App) DeepCopy() *App { + if in == nil { + return nil + } + out := new(App) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *App) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppFolder) DeepCopyInto(out *AppFolder) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppFolder. +func (in *AppFolder) DeepCopy() *AppFolder { + if in == nil { + return nil + } + out := new(AppFolder) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AppFolder) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppFolderList) DeepCopyInto(out *AppFolderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AppFolder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppFolderList. +func (in *AppFolderList) DeepCopy() *AppFolderList { + if in == nil { + return nil + } + out := new(AppFolderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AppFolderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppFolderNexusStatus) DeepCopyInto(out *AppFolderNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppFolderNexusStatus. +func (in *AppFolderNexusStatus) DeepCopy() *AppFolderNexusStatus { + if in == nil { + return nil + } + out := new(AppFolderNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppFolderSpec) DeepCopyInto(out *AppFolderSpec) { + *out = *in + if in.AppGvk != nil { + in, out := &in.AppGvk, &out.AppGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppFolderSpec. +func (in *AppFolderSpec) DeepCopy() *AppFolderSpec { + if in == nil { + return nil + } + out := new(AppFolderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppGroup) DeepCopyInto(out *AppGroup) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppGroup. +func (in *AppGroup) DeepCopy() *AppGroup { + if in == nil { + return nil + } + out := new(AppGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AppGroup) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppGroupList) DeepCopyInto(out *AppGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AppGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppGroupList. +func (in *AppGroupList) DeepCopy() *AppGroupList { + if in == nil { + return nil + } + out := new(AppGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AppGroupList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppGroupNexusStatus) DeepCopyInto(out *AppGroupNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppGroupNexusStatus. +func (in *AppGroupNexusStatus) DeepCopy() *AppGroupNexusStatus { + if in == nil { + return nil + } + out := new(AppGroupNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppGroupSpec) DeepCopyInto(out *AppGroupSpec) { + *out = *in + if in.ServicesGvk != nil { + in, out := &in.ServicesGvk, &out.ServicesGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppGroupSpec. +func (in *AppGroupSpec) DeepCopy() *AppGroupSpec { + if in == nil { + return nil + } + out := new(AppGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppList) DeepCopyInto(out *AppList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]App, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppList. +func (in *AppList) DeepCopy() *AppList { + if in == nil { + return nil + } + out := new(AppList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AppList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppNexusStatus) DeepCopyInto(out *AppNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppNexusStatus. +func (in *AppNexusStatus) DeepCopy() *AppNexusStatus { + if in == nil { + return nil + } + out := new(AppNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppSpec) DeepCopyInto(out *AppSpec) { + *out = *in + if in.VersionGvk != nil { + in, out := &in.VersionGvk, &out.VersionGvk + *out = new(Child) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppSpec. +func (in *AppSpec) DeepCopy() *AppSpec { + if in == nil { + return nil + } + out := new(AppSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppTemplate) DeepCopyInto(out *AppTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppTemplate. +func (in *AppTemplate) DeepCopy() *AppTemplate { + if in == nil { + return nil + } + out := new(AppTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AppTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppTemplateList) DeepCopyInto(out *AppTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AppTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppTemplateList. +func (in *AppTemplateList) DeepCopy() *AppTemplateList { + if in == nil { + return nil + } + out := new(AppTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AppTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppTemplateNexusStatus) DeepCopyInto(out *AppTemplateNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppTemplateNexusStatus. +func (in *AppTemplateNexusStatus) DeepCopy() *AppTemplateNexusStatus { + if in == nil { + return nil + } + out := new(AppTemplateNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppTemplateServiceDefinition) DeepCopyInto(out *AppTemplateServiceDefinition) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppTemplateServiceDefinition. +func (in *AppTemplateServiceDefinition) DeepCopy() *AppTemplateServiceDefinition { + if in == nil { + return nil + } + out := new(AppTemplateServiceDefinition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AppTemplateServiceDefinition) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppTemplateServiceDefinitionList) DeepCopyInto(out *AppTemplateServiceDefinitionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AppTemplateServiceDefinition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppTemplateServiceDefinitionList. +func (in *AppTemplateServiceDefinitionList) DeepCopy() *AppTemplateServiceDefinitionList { + if in == nil { + return nil + } + out := new(AppTemplateServiceDefinitionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AppTemplateServiceDefinitionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppTemplateServiceDefinitionNexusStatus) DeepCopyInto(out *AppTemplateServiceDefinitionNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppTemplateServiceDefinitionNexusStatus. +func (in *AppTemplateServiceDefinitionNexusStatus) DeepCopy() *AppTemplateServiceDefinitionNexusStatus { + if in == nil { + return nil + } + out := new(AppTemplateServiceDefinitionNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppTemplateServiceDefinitionSpec) DeepCopyInto(out *AppTemplateServiceDefinitionSpec) { + *out = *in + if in.TemplateArgs != nil { + in, out := &in.TemplateArgs, &out.TemplateArgs + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppTemplateServiceDefinitionSpec. +func (in *AppTemplateServiceDefinitionSpec) DeepCopy() *AppTemplateServiceDefinitionSpec { + if in == nil { + return nil + } + out := new(AppTemplateServiceDefinitionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppTemplateSpec) DeepCopyInto(out *AppTemplateSpec) { + *out = *in + if in.ServiceDefinitionsGvk != nil { + in, out := &in.ServiceDefinitionsGvk, &out.ServiceDefinitionsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppTemplateSpec. +func (in *AppTemplateSpec) DeepCopy() *AppTemplateSpec { + if in == nil { + return nil + } + out := new(AppTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppUser) DeepCopyInto(out *AppUser) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppUser. +func (in *AppUser) DeepCopy() *AppUser { + if in == nil { + return nil + } + out := new(AppUser) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AppUser) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppUserList) DeepCopyInto(out *AppUserList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AppUser, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppUserList. +func (in *AppUserList) DeepCopy() *AppUserList { + if in == nil { + return nil + } + out := new(AppUserList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AppUserList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppUserNexusStatus) DeepCopyInto(out *AppUserNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppUserNexusStatus. +func (in *AppUserNexusStatus) DeepCopy() *AppUserNexusStatus { + if in == nil { + return nil + } + out := new(AppUserNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppVersion) DeepCopyInto(out *AppVersion) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppVersion. +func (in *AppVersion) DeepCopy() *AppVersion { + if in == nil { + return nil + } + out := new(AppVersion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AppVersion) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppVersionList) DeepCopyInto(out *AppVersionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AppVersion, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppVersionList. +func (in *AppVersionList) DeepCopy() *AppVersionList { + if in == nil { + return nil + } + out := new(AppVersionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AppVersionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppVersionNexusStatus) DeepCopyInto(out *AppVersionNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppVersionNexusStatus. +func (in *AppVersionNexusStatus) DeepCopy() *AppVersionNexusStatus { + if in == nil { + return nil + } + out := new(AppVersionNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppVersionSpec) DeepCopyInto(out *AppVersionSpec) { + *out = *in + if in.TemplateGvk != nil { + in, out := &in.TemplateGvk, &out.TemplateGvk + *out = new(Link) + **out = **in + } + if in.InventoryGvk != nil { + in, out := &in.InventoryGvk, &out.InventoryGvk + *out = new(Link) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppVersionSpec. +func (in *AppVersionSpec) DeepCopy() *AppVersionSpec { + if in == nil { + return nil + } + out := new(AppVersionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApplicationInfo) DeepCopyInto(out *ApplicationInfo) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationInfo. +func (in *ApplicationInfo) DeepCopy() *ApplicationInfo { + if in == nil { + return nil + } + out := new(ApplicationInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ApplicationInfo) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApplicationInfoList) DeepCopyInto(out *ApplicationInfoList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ApplicationInfo, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationInfoList. +func (in *ApplicationInfoList) DeepCopy() *ApplicationInfoList { + if in == nil { + return nil + } + out := new(ApplicationInfoList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ApplicationInfoList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApplicationInfoNexusStatus) DeepCopyInto(out *ApplicationInfoNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationInfoNexusStatus. +func (in *ApplicationInfoNexusStatus) DeepCopy() *ApplicationInfoNexusStatus { + if in == nil { + return nil + } + out := new(ApplicationInfoNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApplicationInfoSpec) DeepCopyInto(out *ApplicationInfoSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationInfoSpec. +func (in *ApplicationInfoSpec) DeepCopy() *ApplicationInfoSpec { + if in == nil { + return nil + } + out := new(ApplicationInfoSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttackDiscovery) DeepCopyInto(out *AttackDiscovery) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttackDiscovery. +func (in *AttackDiscovery) DeepCopy() *AttackDiscovery { + if in == nil { + return nil + } + out := new(AttackDiscovery) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AttackDiscovery) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttackDiscoveryList) DeepCopyInto(out *AttackDiscoveryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AttackDiscovery, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttackDiscoveryList. +func (in *AttackDiscoveryList) DeepCopy() *AttackDiscoveryList { + if in == nil { + return nil + } + out := new(AttackDiscoveryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AttackDiscoveryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttackDiscoveryNexusStatus) DeepCopyInto(out *AttackDiscoveryNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttackDiscoveryNexusStatus. +func (in *AttackDiscoveryNexusStatus) DeepCopy() *AttackDiscoveryNexusStatus { + if in == nil { + return nil + } + out := new(AttackDiscoveryNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttackDiscoveryRT) DeepCopyInto(out *AttackDiscoveryRT) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttackDiscoveryRT. +func (in *AttackDiscoveryRT) DeepCopy() *AttackDiscoveryRT { + if in == nil { + return nil + } + out := new(AttackDiscoveryRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AttackDiscoveryRT) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttackDiscoveryRTList) DeepCopyInto(out *AttackDiscoveryRTList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AttackDiscoveryRT, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttackDiscoveryRTList. +func (in *AttackDiscoveryRTList) DeepCopy() *AttackDiscoveryRTList { + if in == nil { + return nil + } + out := new(AttackDiscoveryRTList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AttackDiscoveryRTList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttackDiscoveryRTNexusStatus) DeepCopyInto(out *AttackDiscoveryRTNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttackDiscoveryRTNexusStatus. +func (in *AttackDiscoveryRTNexusStatus) DeepCopy() *AttackDiscoveryRTNexusStatus { + if in == nil { + return nil + } + out := new(AttackDiscoveryRTNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttackDiscoveryRTSpec) DeepCopyInto(out *AttackDiscoveryRTSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttackDiscoveryRTSpec. +func (in *AttackDiscoveryRTSpec) DeepCopy() *AttackDiscoveryRTSpec { + if in == nil { + return nil + } + out := new(AttackDiscoveryRTSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttackDiscoverySpec) DeepCopyInto(out *AttackDiscoverySpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttackDiscoverySpec. +func (in *AttackDiscoverySpec) DeepCopy() *AttackDiscoverySpec { + if in == nil { + return nil + } + out := new(AttackDiscoverySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthenticationPolicy) DeepCopyInto(out *AuthenticationPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthenticationPolicy. +func (in *AuthenticationPolicy) DeepCopy() *AuthenticationPolicy { + if in == nil { + return nil + } + out := new(AuthenticationPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AuthenticationPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthenticationPolicyList) DeepCopyInto(out *AuthenticationPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AuthenticationPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthenticationPolicyList. +func (in *AuthenticationPolicyList) DeepCopy() *AuthenticationPolicyList { + if in == nil { + return nil + } + out := new(AuthenticationPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AuthenticationPolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthenticationPolicyNexusStatus) DeepCopyInto(out *AuthenticationPolicyNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthenticationPolicyNexusStatus. +func (in *AuthenticationPolicyNexusStatus) DeepCopy() *AuthenticationPolicyNexusStatus { + if in == nil { + return nil + } + out := new(AuthenticationPolicyNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthenticationPolicySpec) DeepCopyInto(out *AuthenticationPolicySpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthenticationPolicySpec. +func (in *AuthenticationPolicySpec) DeepCopy() *AuthenticationPolicySpec { + if in == nil { + return nil + } + out := new(AuthenticationPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Autoscaler) DeepCopyInto(out *Autoscaler) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Autoscaler. +func (in *Autoscaler) DeepCopy() *Autoscaler { + if in == nil { + return nil + } + out := new(Autoscaler) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Autoscaler) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalerCR) DeepCopyInto(out *AutoscalerCR) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerCR. +func (in *AutoscalerCR) DeepCopy() *AutoscalerCR { + if in == nil { + return nil + } + out := new(AutoscalerCR) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AutoscalerCR) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalerCRList) DeepCopyInto(out *AutoscalerCRList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AutoscalerCR, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerCRList. +func (in *AutoscalerCRList) DeepCopy() *AutoscalerCRList { + if in == nil { + return nil + } + out := new(AutoscalerCRList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AutoscalerCRList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalerCRNexusStatus) DeepCopyInto(out *AutoscalerCRNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerCRNexusStatus. +func (in *AutoscalerCRNexusStatus) DeepCopy() *AutoscalerCRNexusStatus { + if in == nil { + return nil + } + out := new(AutoscalerCRNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalerCRSpec) DeepCopyInto(out *AutoscalerCRSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerCRSpec. +func (in *AutoscalerCRSpec) DeepCopy() *AutoscalerCRSpec { + if in == nil { + return nil + } + out := new(AutoscalerCRSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalerConfig) DeepCopyInto(out *AutoscalerConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerConfig. +func (in *AutoscalerConfig) DeepCopy() *AutoscalerConfig { + if in == nil { + return nil + } + out := new(AutoscalerConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AutoscalerConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalerConfigList) DeepCopyInto(out *AutoscalerConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AutoscalerConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerConfigList. +func (in *AutoscalerConfigList) DeepCopy() *AutoscalerConfigList { + if in == nil { + return nil + } + out := new(AutoscalerConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AutoscalerConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalerConfigNexusStatus) DeepCopyInto(out *AutoscalerConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerConfigNexusStatus. +func (in *AutoscalerConfigNexusStatus) DeepCopy() *AutoscalerConfigNexusStatus { + if in == nil { + return nil + } + out := new(AutoscalerConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalerConfigSpec) DeepCopyInto(out *AutoscalerConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerConfigSpec. +func (in *AutoscalerConfigSpec) DeepCopy() *AutoscalerConfigSpec { + if in == nil { + return nil + } + out := new(AutoscalerConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalerFolder) DeepCopyInto(out *AutoscalerFolder) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerFolder. +func (in *AutoscalerFolder) DeepCopy() *AutoscalerFolder { + if in == nil { + return nil + } + out := new(AutoscalerFolder) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AutoscalerFolder) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalerFolderList) DeepCopyInto(out *AutoscalerFolderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AutoscalerFolder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerFolderList. +func (in *AutoscalerFolderList) DeepCopy() *AutoscalerFolderList { + if in == nil { + return nil + } + out := new(AutoscalerFolderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AutoscalerFolderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalerFolderNexusStatus) DeepCopyInto(out *AutoscalerFolderNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerFolderNexusStatus. +func (in *AutoscalerFolderNexusStatus) DeepCopy() *AutoscalerFolderNexusStatus { + if in == nil { + return nil + } + out := new(AutoscalerFolderNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalerFolderSpec) DeepCopyInto(out *AutoscalerFolderSpec) { + *out = *in + if in.AutoscalersGvk != nil { + in, out := &in.AutoscalersGvk, &out.AutoscalersGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerFolderSpec. +func (in *AutoscalerFolderSpec) DeepCopy() *AutoscalerFolderSpec { + if in == nil { + return nil + } + out := new(AutoscalerFolderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalerList) DeepCopyInto(out *AutoscalerList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Autoscaler, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerList. +func (in *AutoscalerList) DeepCopy() *AutoscalerList { + if in == nil { + return nil + } + out := new(AutoscalerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AutoscalerList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalerNexusStatus) DeepCopyInto(out *AutoscalerNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerNexusStatus. +func (in *AutoscalerNexusStatus) DeepCopy() *AutoscalerNexusStatus { + if in == nil { + return nil + } + out := new(AutoscalerNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalerSpec) DeepCopyInto(out *AutoscalerSpec) { + *out = *in + if in.AutoscalerGvk != nil { + in, out := &in.AutoscalerGvk, &out.AutoscalerGvk + *out = new(Link) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerSpec. +func (in *AutoscalerSpec) DeepCopy() *AutoscalerSpec { + if in == nil { + return nil + } + out := new(AutoscalerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalingPolicy) DeepCopyInto(out *AutoscalingPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalingPolicy. +func (in *AutoscalingPolicy) DeepCopy() *AutoscalingPolicy { + if in == nil { + return nil + } + out := new(AutoscalingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AutoscalingPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalingPolicyList) DeepCopyInto(out *AutoscalingPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AutoscalingPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalingPolicyList. +func (in *AutoscalingPolicyList) DeepCopy() *AutoscalingPolicyList { + if in == nil { + return nil + } + out := new(AutoscalingPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AutoscalingPolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalingPolicyNexusStatus) DeepCopyInto(out *AutoscalingPolicyNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalingPolicyNexusStatus. +func (in *AutoscalingPolicyNexusStatus) DeepCopy() *AutoscalingPolicyNexusStatus { + if in == nil { + return nil + } + out := new(AutoscalingPolicyNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoscalingPolicySpec) DeepCopyInto(out *AutoscalingPolicySpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalingPolicySpec. +func (in *AutoscalingPolicySpec) DeepCopy() *AutoscalingPolicySpec { + if in == nil { + return nil + } + out := new(AutoscalingPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AwsConnector) DeepCopyInto(out *AwsConnector) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AwsConnector. +func (in *AwsConnector) DeepCopy() *AwsConnector { + if in == nil { + return nil + } + out := new(AwsConnector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AwsConnector) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AwsConnectorList) DeepCopyInto(out *AwsConnectorList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AwsConnector, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AwsConnectorList. +func (in *AwsConnectorList) DeepCopy() *AwsConnectorList { + if in == nil { + return nil + } + out := new(AwsConnectorList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AwsConnectorList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AwsConnectorNexusStatus) DeepCopyInto(out *AwsConnectorNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AwsConnectorNexusStatus. +func (in *AwsConnectorNexusStatus) DeepCopy() *AwsConnectorNexusStatus { + if in == nil { + return nil + } + out := new(AwsConnectorNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AwsConnectorSpec) DeepCopyInto(out *AwsConnectorSpec) { + *out = *in + if in.GnsGvk != nil { + in, out := &in.GnsGvk, &out.GnsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AwsConnectorSpec. +func (in *AwsConnectorSpec) DeepCopy() *AwsConnectorSpec { + if in == nil { + return nil + } + out := new(AwsConnectorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Bucket) DeepCopyInto(out *Bucket) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Bucket. +func (in *Bucket) DeepCopy() *Bucket { + if in == nil { + return nil + } + out := new(Bucket) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Bucket) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BucketList) DeepCopyInto(out *BucketList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Bucket, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketList. +func (in *BucketList) DeepCopy() *BucketList { + if in == nil { + return nil + } + out := new(BucketList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BucketList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BucketNexusStatus) DeepCopyInto(out *BucketNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketNexusStatus. +func (in *BucketNexusStatus) DeepCopy() *BucketNexusStatus { + if in == nil { + return nil + } + out := new(BucketNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BucketSpec) DeepCopyInto(out *BucketSpec) { + *out = *in + if in.TemplateGvk != nil { + in, out := &in.TemplateGvk, &out.TemplateGvk + *out = new(Link) + **out = **in + } + if in.InventoryGvk != nil { + in, out := &in.InventoryGvk, &out.InventoryGvk + *out = new(Link) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketSpec. +func (in *BucketSpec) DeepCopy() *BucketSpec { + if in == nil { + return nil + } + out := new(BucketSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Certificate) DeepCopyInto(out *Certificate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Certificate. +func (in *Certificate) DeepCopy() *Certificate { + if in == nil { + return nil + } + out := new(Certificate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Certificate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateAuthorityConfigN) DeepCopyInto(out *CertificateAuthorityConfigN) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateAuthorityConfigN. +func (in *CertificateAuthorityConfigN) DeepCopy() *CertificateAuthorityConfigN { + if in == nil { + return nil + } + out := new(CertificateAuthorityConfigN) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CertificateAuthorityConfigN) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateAuthorityConfigNList) DeepCopyInto(out *CertificateAuthorityConfigNList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CertificateAuthorityConfigN, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateAuthorityConfigNList. +func (in *CertificateAuthorityConfigNList) DeepCopy() *CertificateAuthorityConfigNList { + if in == nil { + return nil + } + out := new(CertificateAuthorityConfigNList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CertificateAuthorityConfigNList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateAuthorityConfigNNexusStatus) DeepCopyInto(out *CertificateAuthorityConfigNNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateAuthorityConfigNNexusStatus. +func (in *CertificateAuthorityConfigNNexusStatus) DeepCopy() *CertificateAuthorityConfigNNexusStatus { + if in == nil { + return nil + } + out := new(CertificateAuthorityConfigNNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateAuthorityConfigNSpec) DeepCopyInto(out *CertificateAuthorityConfigNSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateAuthorityConfigNSpec. +func (in *CertificateAuthorityConfigNSpec) DeepCopy() *CertificateAuthorityConfigNSpec { + if in == nil { + return nil + } + out := new(CertificateAuthorityConfigNSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateAuthorityRT) DeepCopyInto(out *CertificateAuthorityRT) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateAuthorityRT. +func (in *CertificateAuthorityRT) DeepCopy() *CertificateAuthorityRT { + if in == nil { + return nil + } + out := new(CertificateAuthorityRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CertificateAuthorityRT) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateAuthorityRTList) DeepCopyInto(out *CertificateAuthorityRTList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CertificateAuthorityRT, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateAuthorityRTList. +func (in *CertificateAuthorityRTList) DeepCopy() *CertificateAuthorityRTList { + if in == nil { + return nil + } + out := new(CertificateAuthorityRTList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CertificateAuthorityRTList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateAuthorityRTNexusStatus) DeepCopyInto(out *CertificateAuthorityRTNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateAuthorityRTNexusStatus. +func (in *CertificateAuthorityRTNexusStatus) DeepCopy() *CertificateAuthorityRTNexusStatus { + if in == nil { + return nil + } + out := new(CertificateAuthorityRTNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateAuthorityRTSpec) DeepCopyInto(out *CertificateAuthorityRTSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateAuthorityRTSpec. +func (in *CertificateAuthorityRTSpec) DeepCopy() *CertificateAuthorityRTSpec { + if in == nil { + return nil + } + out := new(CertificateAuthorityRTSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateConfigN) DeepCopyInto(out *CertificateConfigN) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateConfigN. +func (in *CertificateConfigN) DeepCopy() *CertificateConfigN { + if in == nil { + return nil + } + out := new(CertificateConfigN) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CertificateConfigN) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateConfigNList) DeepCopyInto(out *CertificateConfigNList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CertificateConfigN, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateConfigNList. +func (in *CertificateConfigNList) DeepCopy() *CertificateConfigNList { + if in == nil { + return nil + } + out := new(CertificateConfigNList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CertificateConfigNList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateConfigNNexusStatus) DeepCopyInto(out *CertificateConfigNNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateConfigNNexusStatus. +func (in *CertificateConfigNNexusStatus) DeepCopy() *CertificateConfigNNexusStatus { + if in == nil { + return nil + } + out := new(CertificateConfigNNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateConfigNSpec) DeepCopyInto(out *CertificateConfigNSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateConfigNSpec. +func (in *CertificateConfigNSpec) DeepCopy() *CertificateConfigNSpec { + if in == nil { + return nil + } + out := new(CertificateConfigNSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateList) DeepCopyInto(out *CertificateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Certificate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateList. +func (in *CertificateList) DeepCopy() *CertificateList { + if in == nil { + return nil + } + out := new(CertificateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CertificateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateNexusStatus) DeepCopyInto(out *CertificateNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateNexusStatus. +func (in *CertificateNexusStatus) DeepCopy() *CertificateNexusStatus { + if in == nil { + return nil + } + out := new(CertificateNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateRequest) DeepCopyInto(out *CertificateRequest) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateRequest. +func (in *CertificateRequest) DeepCopy() *CertificateRequest { + if in == nil { + return nil + } + out := new(CertificateRequest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CertificateRequest) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateRequestList) DeepCopyInto(out *CertificateRequestList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CertificateRequest, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateRequestList. +func (in *CertificateRequestList) DeepCopy() *CertificateRequestList { + if in == nil { + return nil + } + out := new(CertificateRequestList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CertificateRequestList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateRequestNexusStatus) DeepCopyInto(out *CertificateRequestNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateRequestNexusStatus. +func (in *CertificateRequestNexusStatus) DeepCopy() *CertificateRequestNexusStatus { + if in == nil { + return nil + } + out := new(CertificateRequestNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateRequestSpec) DeepCopyInto(out *CertificateRequestSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateRequestSpec. +func (in *CertificateRequestSpec) DeepCopy() *CertificateRequestSpec { + if in == nil { + return nil + } + out := new(CertificateRequestSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateSpec) DeepCopyInto(out *CertificateSpec) { + *out = *in + if in.DnsNames != nil { + in, out := &in.DnsNames, &out.DnsNames + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.IpAddresses != nil { + in, out := &in.IpAddresses, &out.IpAddresses + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.EmailAddresses != nil { + in, out := &in.EmailAddresses, &out.EmailAddresses + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Uris != nil { + in, out := &in.Uris, &out.Uris + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSpec. +func (in *CertificateSpec) DeepCopy() *CertificateSpec { + if in == nil { + return nil + } + out := new(CertificateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Child) DeepCopyInto(out *Child) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Child. +func (in *Child) DeepCopy() *Child { + if in == nil { + return nil + } + out := new(Child) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Cluster) DeepCopyInto(out *Cluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. +func (in *Cluster) DeepCopy() *Cluster { + if in == nil { + return nil + } + out := new(Cluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Cluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterConfig) DeepCopyInto(out *ClusterConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfig. +func (in *ClusterConfig) DeepCopy() *ClusterConfig { + if in == nil { + return nil + } + out := new(ClusterConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterConfigFolder) DeepCopyInto(out *ClusterConfigFolder) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfigFolder. +func (in *ClusterConfigFolder) DeepCopy() *ClusterConfigFolder { + if in == nil { + return nil + } + out := new(ClusterConfigFolder) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterConfigFolder) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterConfigFolderList) DeepCopyInto(out *ClusterConfigFolderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterConfigFolder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfigFolderList. +func (in *ClusterConfigFolderList) DeepCopy() *ClusterConfigFolderList { + if in == nil { + return nil + } + out := new(ClusterConfigFolderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterConfigFolderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterConfigFolderNexusStatus) DeepCopyInto(out *ClusterConfigFolderNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfigFolderNexusStatus. +func (in *ClusterConfigFolderNexusStatus) DeepCopy() *ClusterConfigFolderNexusStatus { + if in == nil { + return nil + } + out := new(ClusterConfigFolderNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterConfigFolderSpec) DeepCopyInto(out *ClusterConfigFolderSpec) { + *out = *in + if in.ClustersGvk != nil { + in, out := &in.ClustersGvk, &out.ClustersGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfigFolderSpec. +func (in *ClusterConfigFolderSpec) DeepCopy() *ClusterConfigFolderSpec { + if in == nil { + return nil + } + out := new(ClusterConfigFolderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterConfigList) DeepCopyInto(out *ClusterConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfigList. +func (in *ClusterConfigList) DeepCopy() *ClusterConfigList { + if in == nil { + return nil + } + out := new(ClusterConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterConfigNexusStatus) DeepCopyInto(out *ClusterConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfigNexusStatus. +func (in *ClusterConfigNexusStatus) DeepCopy() *ClusterConfigNexusStatus { + if in == nil { + return nil + } + out := new(ClusterConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterConfigSpec) DeepCopyInto(out *ClusterConfigSpec) { + *out = *in + if in.DomainsGvk != nil { + in, out := &in.DomainsGvk, &out.DomainsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.HostConfigGvk != nil { + in, out := &in.HostConfigGvk, &out.HostConfigGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.DnsConfigFolderGvk != nil { + in, out := &in.DnsConfigFolderGvk, &out.DnsConfigFolderGvk + *out = new(Child) + **out = **in + } + if in.DnsProbesConfigFolderGvk != nil { + in, out := &in.DnsProbesConfigFolderGvk, &out.DnsProbesConfigFolderGvk + *out = new(Child) + **out = **in + } + if in.LogFolderGvk != nil { + in, out := &in.LogFolderGvk, &out.LogFolderGvk + *out = new(Child) + **out = **in + } + if in.GnsBindingGvk != nil { + in, out := &in.GnsBindingGvk, &out.GnsBindingGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SecurityContextConstraintsGvk != nil { + in, out := &in.SecurityContextConstraintsGvk, &out.SecurityContextConstraintsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ResourceGroupGvk != nil { + in, out := &in.ResourceGroupGvk, &out.ResourceGroupGvk + *out = new(Child) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfigSpec. +func (in *ClusterConfigSpec) DeepCopy() *ClusterConfigSpec { + if in == nil { + return nil + } + out := new(ClusterConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterFolder) DeepCopyInto(out *ClusterFolder) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterFolder. +func (in *ClusterFolder) DeepCopy() *ClusterFolder { + if in == nil { + return nil + } + out := new(ClusterFolder) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterFolder) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterFolderList) DeepCopyInto(out *ClusterFolderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterFolder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterFolderList. +func (in *ClusterFolderList) DeepCopy() *ClusterFolderList { + if in == nil { + return nil + } + out := new(ClusterFolderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterFolderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterFolderNexusStatus) DeepCopyInto(out *ClusterFolderNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterFolderNexusStatus. +func (in *ClusterFolderNexusStatus) DeepCopy() *ClusterFolderNexusStatus { + if in == nil { + return nil + } + out := new(ClusterFolderNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterFolderSpec) DeepCopyInto(out *ClusterFolderSpec) { + *out = *in + if in.ClustersGvk != nil { + in, out := &in.ClustersGvk, &out.ClustersGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.RemoteGatewayServiceConfigsGvk != nil { + in, out := &in.RemoteGatewayServiceConfigsGvk, &out.RemoteGatewayServiceConfigsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterFolderSpec. +func (in *ClusterFolderSpec) DeepCopy() *ClusterFolderSpec { + if in == nil { + return nil + } + out := new(ClusterFolderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterList) DeepCopyInto(out *ClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Cluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. +func (in *ClusterList) DeepCopy() *ClusterList { + if in == nil { + return nil + } + out := new(ClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterNexusStatus) DeepCopyInto(out *ClusterNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterNexusStatus. +func (in *ClusterNexusStatus) DeepCopy() *ClusterNexusStatus { + if in == nil { + return nil + } + out := new(ClusterNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterQueryServiceTableArgs) DeepCopyInto(out *ClusterQueryServiceTableArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterQueryServiceTableArgs. +func (in *ClusterQueryServiceTableArgs) DeepCopy() *ClusterQueryServiceTableArgs { + if in == nil { + return nil + } + out := new(ClusterQueryServiceTableArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterQueryServiceVersionTableArgs) DeepCopyInto(out *ClusterQueryServiceVersionTableArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterQueryServiceVersionTableArgs. +func (in *ClusterQueryServiceVersionTableArgs) DeepCopy() *ClusterQueryServiceVersionTableArgs { + if in == nil { + return nil + } + out := new(ClusterQueryServiceVersionTableArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterSettings) DeepCopyInto(out *ClusterSettings) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSettings. +func (in *ClusterSettings) DeepCopy() *ClusterSettings { + if in == nil { + return nil + } + out := new(ClusterSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterSettings) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterSettingsList) DeepCopyInto(out *ClusterSettingsList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterSettings, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSettingsList. +func (in *ClusterSettingsList) DeepCopy() *ClusterSettingsList { + if in == nil { + return nil + } + out := new(ClusterSettingsList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterSettingsList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterSettingsNexusStatus) DeepCopyInto(out *ClusterSettingsNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSettingsNexusStatus. +func (in *ClusterSettingsNexusStatus) DeepCopy() *ClusterSettingsNexusStatus { + if in == nil { + return nil + } + out := new(ClusterSettingsNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterSettingsSpec) DeepCopyInto(out *ClusterSettingsSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSettingsSpec. +func (in *ClusterSettingsSpec) DeepCopy() *ClusterSettingsSpec { + if in == nil { + return nil + } + out := new(ClusterSettingsSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { + *out = *in + if in.ConnectionStatusGvk != nil { + in, out := &in.ConnectionStatusGvk, &out.ConnectionStatusGvk + *out = new(Child) + **out = **in + } + if in.AppsGvk != nil { + in, out := &in.AppsGvk, &out.AppsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.DnsProbeStatusGvk != nil { + in, out := &in.DnsProbeStatusGvk, &out.DnsProbeStatusGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SecurityContextConstraintsGvk != nil { + in, out := &in.SecurityContextConstraintsGvk, &out.SecurityContextConstraintsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.DomainsGvk != nil { + in, out := &in.DomainsGvk, &out.DomainsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.NodesGvk != nil { + in, out := &in.NodesGvk, &out.NodesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec. +func (in *ClusterSpec) DeepCopy() *ClusterSpec { + if in == nil { + return nil + } + out := new(ClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Config) DeepCopyInto(out *Config) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config. +func (in *Config) DeepCopy() *Config { + if in == nil { + return nil + } + out := new(Config) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Config) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigChangeStatus) DeepCopyInto(out *ConfigChangeStatus) { + *out = *in + if in.Errors != nil { + in, out := &in.Errors, &out.Errors + *out = make(ConfigChangeStatusErrors, len(*in)) + copy(*out, *in) + } + if in.Warnings != nil { + in, out := &in.Warnings, &out.Warnings + *out = make(ConfigChangeStatusWarnings, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigChangeStatus. +func (in *ConfigChangeStatus) DeepCopy() *ConfigChangeStatus { + if in == nil { + return nil + } + out := new(ConfigChangeStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigChangeStatusError) DeepCopyInto(out *ConfigChangeStatusError) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigChangeStatusError. +func (in *ConfigChangeStatusError) DeepCopy() *ConfigChangeStatusError { + if in == nil { + return nil + } + out := new(ConfigChangeStatusError) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ConfigChangeStatusErrors) DeepCopyInto(out *ConfigChangeStatusErrors) { + { + in := &in + *out = make(ConfigChangeStatusErrors, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigChangeStatusErrors. +func (in ConfigChangeStatusErrors) DeepCopy() ConfigChangeStatusErrors { + if in == nil { + return nil + } + out := new(ConfigChangeStatusErrors) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ConfigChangeStatusHistory) DeepCopyInto(out *ConfigChangeStatusHistory) { + { + in := &in + *out = make(ConfigChangeStatusHistory, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigChangeStatusHistory. +func (in ConfigChangeStatusHistory) DeepCopy() ConfigChangeStatusHistory { + if in == nil { + return nil + } + out := new(ConfigChangeStatusHistory) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigChangeStatusWarning) DeepCopyInto(out *ConfigChangeStatusWarning) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigChangeStatusWarning. +func (in *ConfigChangeStatusWarning) DeepCopy() *ConfigChangeStatusWarning { + if in == nil { + return nil + } + out := new(ConfigChangeStatusWarning) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ConfigChangeStatusWarnings) DeepCopyInto(out *ConfigChangeStatusWarnings) { + { + in := &in + *out = make(ConfigChangeStatusWarnings, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigChangeStatusWarnings. +func (in ConfigChangeStatusWarnings) DeepCopy() ConfigChangeStatusWarnings { + if in == nil { + return nil + } + out := new(ConfigChangeStatusWarnings) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigList) DeepCopyInto(out *ConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Config, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigList. +func (in *ConfigList) DeepCopy() *ConfigList { + if in == nil { + return nil + } + out := new(ConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigMap) DeepCopyInto(out *ConfigMap) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMap. +func (in *ConfigMap) DeepCopy() *ConfigMap { + if in == nil { + return nil + } + out := new(ConfigMap) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ConfigMap) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ConfigMapData) DeepCopyInto(out *ConfigMapData) { + { + in := &in + *out = make(ConfigMapData, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapData. +func (in ConfigMapData) DeepCopy() ConfigMapData { + if in == nil { + return nil + } + out := new(ConfigMapData) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigMapList) DeepCopyInto(out *ConfigMapList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ConfigMap, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapList. +func (in *ConfigMapList) DeepCopy() *ConfigMapList { + if in == nil { + return nil + } + out := new(ConfigMapList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ConfigMapList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigMapNexusStatus) DeepCopyInto(out *ConfigMapNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapNexusStatus. +func (in *ConfigMapNexusStatus) DeepCopy() *ConfigMapNexusStatus { + if in == nil { + return nil + } + out := new(ConfigMapNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigMapSpec) DeepCopyInto(out *ConfigMapSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapSpec. +func (in *ConfigMapSpec) DeepCopy() *ConfigMapSpec { + if in == nil { + return nil + } + out := new(ConfigMapSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigNexusStatus) DeepCopyInto(out *ConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigNexusStatus. +func (in *ConfigNexusStatus) DeepCopy() *ConfigNexusStatus { + if in == nil { + return nil + } + out := new(ConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigSpec) DeepCopyInto(out *ConfigSpec) { + *out = *in + if in.ResourceGroupsGvk != nil { + in, out := &in.ResourceGroupsGvk, &out.ResourceGroupsGvk + *out = new(Child) + **out = **in + } + if in.GlobalNamespaceGvk != nil { + in, out := &in.GlobalNamespaceGvk, &out.GlobalNamespaceGvk + *out = new(Child) + **out = **in + } + if in.PolicyGvk != nil { + in, out := &in.PolicyGvk, &out.PolicyGvk + *out = new(Child) + **out = **in + } + if in.TemplatesGvk != nil { + in, out := &in.TemplatesGvk, &out.TemplatesGvk + *out = new(Child) + **out = **in + } + if in.ProgressiveUpgradeGvk != nil { + in, out := &in.ProgressiveUpgradeGvk, &out.ProgressiveUpgradeGvk + *out = new(Child) + **out = **in + } + if in.ExternalPluginsGvk != nil { + in, out := &in.ExternalPluginsGvk, &out.ExternalPluginsGvk + *out = new(Child) + **out = **in + } + if in.CertificatesGvk != nil { + in, out := &in.CertificatesGvk, &out.CertificatesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ExternalAccountsGvk != nil { + in, out := &in.ExternalAccountsGvk, &out.ExternalAccountsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ExternalAuditStorageGvk != nil { + in, out := &in.ExternalAuditStorageGvk, &out.ExternalAuditStorageGvk + *out = new(Child) + **out = **in + } + if in.ExternalDNSGvk != nil { + in, out := &in.ExternalDNSGvk, &out.ExternalDNSGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ExternalLBGvk != nil { + in, out := &in.ExternalLBGvk, &out.ExternalLBGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AutoscalerFolderGvk != nil { + in, out := &in.AutoscalerFolderGvk, &out.AutoscalerFolderGvk + *out = new(Child) + **out = **in + } + if in.ClustersGvk != nil { + in, out := &in.ClustersGvk, &out.ClustersGvk + *out = new(Child) + **out = **in + } + if in.ServiceLevelObjectiveGvk != nil { + in, out := &in.ServiceLevelObjectiveGvk, &out.ServiceLevelObjectiveGvk + *out = new(Child) + **out = **in + } + if in.FeatureFlagsGvk != nil { + in, out := &in.FeatureFlagsGvk, &out.FeatureFlagsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ProjectsGvk != nil { + in, out := &in.ProjectsGvk, &out.ProjectsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceDirectoryGvk != nil { + in, out := &in.ServiceDirectoryGvk, &out.ServiceDirectoryGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigSpec. +func (in *ConfigSpec) DeepCopy() *ConfigSpec { + if in == nil { + return nil + } + out := new(ConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConnectionStatus) DeepCopyInto(out *ConnectionStatus) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionStatus. +func (in *ConnectionStatus) DeepCopy() *ConnectionStatus { + if in == nil { + return nil + } + out := new(ConnectionStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ConnectionStatus) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConnectionStatusList) DeepCopyInto(out *ConnectionStatusList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ConnectionStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionStatusList. +func (in *ConnectionStatusList) DeepCopy() *ConnectionStatusList { + if in == nil { + return nil + } + out := new(ConnectionStatusList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ConnectionStatusList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConnectionStatusNexusStatus) DeepCopyInto(out *ConnectionStatusNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionStatusNexusStatus. +func (in *ConnectionStatusNexusStatus) DeepCopy() *ConnectionStatusNexusStatus { + if in == nil { + return nil + } + out := new(ConnectionStatusNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConnectionStatusSpec) DeepCopyInto(out *ConnectionStatusSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionStatusSpec. +func (in *ConnectionStatusSpec) DeepCopy() *ConnectionStatusSpec { + if in == nil { + return nil + } + out := new(ConnectionStatusSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DCRegion) DeepCopyInto(out *DCRegion) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DCRegion. +func (in *DCRegion) DeepCopy() *DCRegion { + if in == nil { + return nil + } + out := new(DCRegion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DCRegion) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DCRegionList) DeepCopyInto(out *DCRegionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DCRegion, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DCRegionList. +func (in *DCRegionList) DeepCopy() *DCRegionList { + if in == nil { + return nil + } + out := new(DCRegionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DCRegionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DCRegionNexusStatus) DeepCopyInto(out *DCRegionNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DCRegionNexusStatus. +func (in *DCRegionNexusStatus) DeepCopy() *DCRegionNexusStatus { + if in == nil { + return nil + } + out := new(DCRegionNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DCRegionSpec) DeepCopyInto(out *DCRegionSpec) { + *out = *in + if in.ZonesGvk != nil { + in, out := &in.ZonesGvk, &out.ZonesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DCRegionSpec. +func (in *DCRegionSpec) DeepCopy() *DCRegionSpec { + if in == nil { + return nil + } + out := new(DCRegionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DCZone) DeepCopyInto(out *DCZone) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DCZone. +func (in *DCZone) DeepCopy() *DCZone { + if in == nil { + return nil + } + out := new(DCZone) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DCZone) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DCZoneList) DeepCopyInto(out *DCZoneList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DCZone, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DCZoneList. +func (in *DCZoneList) DeepCopy() *DCZoneList { + if in == nil { + return nil + } + out := new(DCZoneList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DCZoneList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DCZoneNexusStatus) DeepCopyInto(out *DCZoneNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DCZoneNexusStatus. +func (in *DCZoneNexusStatus) DeepCopy() *DCZoneNexusStatus { + if in == nil { + return nil + } + out := new(DCZoneNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DCZoneSpec) DeepCopyInto(out *DCZoneSpec) { + *out = *in + if in.ClustersGvk != nil { + in, out := &in.ClustersGvk, &out.ClustersGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DCZoneSpec. +func (in *DCZoneSpec) DeepCopy() *DCZoneSpec { + if in == nil { + return nil + } + out := new(DCZoneSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSConfig) DeepCopyInto(out *DNSConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSConfig. +func (in *DNSConfig) DeepCopy() *DNSConfig { + if in == nil { + return nil + } + out := new(DNSConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DNSConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSConfigFolder) DeepCopyInto(out *DNSConfigFolder) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSConfigFolder. +func (in *DNSConfigFolder) DeepCopy() *DNSConfigFolder { + if in == nil { + return nil + } + out := new(DNSConfigFolder) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DNSConfigFolder) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSConfigFolderList) DeepCopyInto(out *DNSConfigFolderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DNSConfigFolder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSConfigFolderList. +func (in *DNSConfigFolderList) DeepCopy() *DNSConfigFolderList { + if in == nil { + return nil + } + out := new(DNSConfigFolderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DNSConfigFolderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSConfigFolderNexusStatus) DeepCopyInto(out *DNSConfigFolderNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSConfigFolderNexusStatus. +func (in *DNSConfigFolderNexusStatus) DeepCopy() *DNSConfigFolderNexusStatus { + if in == nil { + return nil + } + out := new(DNSConfigFolderNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSConfigFolderSpec) DeepCopyInto(out *DNSConfigFolderSpec) { + *out = *in + if in.DnsConfigGvk != nil { + in, out := &in.DnsConfigGvk, &out.DnsConfigGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSConfigFolderSpec. +func (in *DNSConfigFolderSpec) DeepCopy() *DNSConfigFolderSpec { + if in == nil { + return nil + } + out := new(DNSConfigFolderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSConfigList) DeepCopyInto(out *DNSConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DNSConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSConfigList. +func (in *DNSConfigList) DeepCopy() *DNSConfigList { + if in == nil { + return nil + } + out := new(DNSConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DNSConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSConfigNexusStatus) DeepCopyInto(out *DNSConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSConfigNexusStatus. +func (in *DNSConfigNexusStatus) DeepCopy() *DNSConfigNexusStatus { + if in == nil { + return nil + } + out := new(DNSConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSConfigSpec) DeepCopyInto(out *DNSConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSConfigSpec. +func (in *DNSConfigSpec) DeepCopy() *DNSConfigSpec { + if in == nil { + return nil + } + out := new(DNSConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSProbeConfig) DeepCopyInto(out *DNSProbeConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSProbeConfig. +func (in *DNSProbeConfig) DeepCopy() *DNSProbeConfig { + if in == nil { + return nil + } + out := new(DNSProbeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DNSProbeConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSProbeConfigList) DeepCopyInto(out *DNSProbeConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DNSProbeConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSProbeConfigList. +func (in *DNSProbeConfigList) DeepCopy() *DNSProbeConfigList { + if in == nil { + return nil + } + out := new(DNSProbeConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DNSProbeConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSProbeConfigNexusStatus) DeepCopyInto(out *DNSProbeConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSProbeConfigNexusStatus. +func (in *DNSProbeConfigNexusStatus) DeepCopy() *DNSProbeConfigNexusStatus { + if in == nil { + return nil + } + out := new(DNSProbeConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSProbeConfigSpec) DeepCopyInto(out *DNSProbeConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSProbeConfigSpec. +func (in *DNSProbeConfigSpec) DeepCopy() *DNSProbeConfigSpec { + if in == nil { + return nil + } + out := new(DNSProbeConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSProbeStatus) DeepCopyInto(out *DNSProbeStatus) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSProbeStatus. +func (in *DNSProbeStatus) DeepCopy() *DNSProbeStatus { + if in == nil { + return nil + } + out := new(DNSProbeStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DNSProbeStatus) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSProbeStatusList) DeepCopyInto(out *DNSProbeStatusList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DNSProbeStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSProbeStatusList. +func (in *DNSProbeStatusList) DeepCopy() *DNSProbeStatusList { + if in == nil { + return nil + } + out := new(DNSProbeStatusList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DNSProbeStatusList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSProbeStatusNexusStatus) DeepCopyInto(out *DNSProbeStatusNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSProbeStatusNexusStatus. +func (in *DNSProbeStatusNexusStatus) DeepCopy() *DNSProbeStatusNexusStatus { + if in == nil { + return nil + } + out := new(DNSProbeStatusNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSProbeStatusSpec) DeepCopyInto(out *DNSProbeStatusSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSProbeStatusSpec. +func (in *DNSProbeStatusSpec) DeepCopy() *DNSProbeStatusSpec { + if in == nil { + return nil + } + out := new(DNSProbeStatusSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSProbesConfigFolder) DeepCopyInto(out *DNSProbesConfigFolder) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSProbesConfigFolder. +func (in *DNSProbesConfigFolder) DeepCopy() *DNSProbesConfigFolder { + if in == nil { + return nil + } + out := new(DNSProbesConfigFolder) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DNSProbesConfigFolder) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSProbesConfigFolderList) DeepCopyInto(out *DNSProbesConfigFolderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DNSProbesConfigFolder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSProbesConfigFolderList. +func (in *DNSProbesConfigFolderList) DeepCopy() *DNSProbesConfigFolderList { + if in == nil { + return nil + } + out := new(DNSProbesConfigFolderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DNSProbesConfigFolderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSProbesConfigFolderNexusStatus) DeepCopyInto(out *DNSProbesConfigFolderNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSProbesConfigFolderNexusStatus. +func (in *DNSProbesConfigFolderNexusStatus) DeepCopy() *DNSProbesConfigFolderNexusStatus { + if in == nil { + return nil + } + out := new(DNSProbesConfigFolderNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSProbesConfigFolderSpec) DeepCopyInto(out *DNSProbesConfigFolderSpec) { + *out = *in + if in.DnsProbeConfigsGvk != nil { + in, out := &in.DnsProbeConfigsGvk, &out.DnsProbeConfigsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSProbesConfigFolderSpec. +func (in *DNSProbesConfigFolderSpec) DeepCopy() *DNSProbesConfigFolderSpec { + if in == nil { + return nil + } + out := new(DNSProbesConfigFolderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolder) DeepCopyInto(out *DataFolder) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolder. +func (in *DataFolder) DeepCopy() *DataFolder { + if in == nil { + return nil + } + out := new(DataFolder) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DataFolder) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolderDomain) DeepCopyInto(out *DataFolderDomain) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolderDomain. +func (in *DataFolderDomain) DeepCopy() *DataFolderDomain { + if in == nil { + return nil + } + out := new(DataFolderDomain) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DataFolderDomain) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolderDomainCluster) DeepCopyInto(out *DataFolderDomainCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolderDomainCluster. +func (in *DataFolderDomainCluster) DeepCopy() *DataFolderDomainCluster { + if in == nil { + return nil + } + out := new(DataFolderDomainCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DataFolderDomainCluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolderDomainClusterList) DeepCopyInto(out *DataFolderDomainClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DataFolderDomainCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolderDomainClusterList. +func (in *DataFolderDomainClusterList) DeepCopy() *DataFolderDomainClusterList { + if in == nil { + return nil + } + out := new(DataFolderDomainClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DataFolderDomainClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolderDomainClusterNexusStatus) DeepCopyInto(out *DataFolderDomainClusterNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolderDomainClusterNexusStatus. +func (in *DataFolderDomainClusterNexusStatus) DeepCopy() *DataFolderDomainClusterNexusStatus { + if in == nil { + return nil + } + out := new(DataFolderDomainClusterNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolderDomainList) DeepCopyInto(out *DataFolderDomainList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DataFolderDomain, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolderDomainList. +func (in *DataFolderDomainList) DeepCopy() *DataFolderDomainList { + if in == nil { + return nil + } + out := new(DataFolderDomainList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DataFolderDomainList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolderDomainNexusStatus) DeepCopyInto(out *DataFolderDomainNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolderDomainNexusStatus. +func (in *DataFolderDomainNexusStatus) DeepCopy() *DataFolderDomainNexusStatus { + if in == nil { + return nil + } + out := new(DataFolderDomainNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolderDomainService) DeepCopyInto(out *DataFolderDomainService) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolderDomainService. +func (in *DataFolderDomainService) DeepCopy() *DataFolderDomainService { + if in == nil { + return nil + } + out := new(DataFolderDomainService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DataFolderDomainService) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolderDomainServiceList) DeepCopyInto(out *DataFolderDomainServiceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DataFolderDomainService, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolderDomainServiceList. +func (in *DataFolderDomainServiceList) DeepCopy() *DataFolderDomainServiceList { + if in == nil { + return nil + } + out := new(DataFolderDomainServiceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DataFolderDomainServiceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolderDomainServiceNexusStatus) DeepCopyInto(out *DataFolderDomainServiceNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolderDomainServiceNexusStatus. +func (in *DataFolderDomainServiceNexusStatus) DeepCopy() *DataFolderDomainServiceNexusStatus { + if in == nil { + return nil + } + out := new(DataFolderDomainServiceNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolderDomainServiceSpec) DeepCopyInto(out *DataFolderDomainServiceSpec) { + *out = *in + if in.VersionsGvk != nil { + in, out := &in.VersionsGvk, &out.VersionsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolderDomainServiceSpec. +func (in *DataFolderDomainServiceSpec) DeepCopy() *DataFolderDomainServiceSpec { + if in == nil { + return nil + } + out := new(DataFolderDomainServiceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolderDomainServiceVersion) DeepCopyInto(out *DataFolderDomainServiceVersion) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolderDomainServiceVersion. +func (in *DataFolderDomainServiceVersion) DeepCopy() *DataFolderDomainServiceVersion { + if in == nil { + return nil + } + out := new(DataFolderDomainServiceVersion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DataFolderDomainServiceVersion) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolderDomainServiceVersionList) DeepCopyInto(out *DataFolderDomainServiceVersionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DataFolderDomainServiceVersion, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolderDomainServiceVersionList. +func (in *DataFolderDomainServiceVersionList) DeepCopy() *DataFolderDomainServiceVersionList { + if in == nil { + return nil + } + out := new(DataFolderDomainServiceVersionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DataFolderDomainServiceVersionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolderDomainServiceVersionNexusStatus) DeepCopyInto(out *DataFolderDomainServiceVersionNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolderDomainServiceVersionNexusStatus. +func (in *DataFolderDomainServiceVersionNexusStatus) DeepCopy() *DataFolderDomainServiceVersionNexusStatus { + if in == nil { + return nil + } + out := new(DataFolderDomainServiceVersionNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolderDomainSpec) DeepCopyInto(out *DataFolderDomainSpec) { + *out = *in + if in.ClusterGvk != nil { + in, out := &in.ClusterGvk, &out.ClusterGvk + *out = new(Child) + **out = **in + } + if in.ServiceGvk != nil { + in, out := &in.ServiceGvk, &out.ServiceGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.DatabaseGvk != nil { + in, out := &in.DatabaseGvk, &out.DatabaseGvk + *out = new(Child) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolderDomainSpec. +func (in *DataFolderDomainSpec) DeepCopy() *DataFolderDomainSpec { + if in == nil { + return nil + } + out := new(DataFolderDomainSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolderList) DeepCopyInto(out *DataFolderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DataFolder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolderList. +func (in *DataFolderList) DeepCopy() *DataFolderList { + if in == nil { + return nil + } + out := new(DataFolderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DataFolderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolderNexusStatus) DeepCopyInto(out *DataFolderNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolderNexusStatus. +func (in *DataFolderNexusStatus) DeepCopy() *DataFolderNexusStatus { + if in == nil { + return nil + } + out := new(DataFolderNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFolderSpec) DeepCopyInto(out *DataFolderSpec) { + *out = *in + if in.DomainGvk != nil { + in, out := &in.DomainGvk, &out.DomainGvk + *out = new(Child) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFolderSpec. +func (in *DataFolderSpec) DeepCopy() *DataFolderSpec { + if in == nil { + return nil + } + out := new(DataFolderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataGroup) DeepCopyInto(out *DataGroup) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataGroup. +func (in *DataGroup) DeepCopy() *DataGroup { + if in == nil { + return nil + } + out := new(DataGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DataGroup) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataGroupList) DeepCopyInto(out *DataGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DataGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataGroupList. +func (in *DataGroupList) DeepCopy() *DataGroupList { + if in == nil { + return nil + } + out := new(DataGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DataGroupList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataGroupNexusStatus) DeepCopyInto(out *DataGroupNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataGroupNexusStatus. +func (in *DataGroupNexusStatus) DeepCopy() *DataGroupNexusStatus { + if in == nil { + return nil + } + out := new(DataGroupNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataGroupSpec) DeepCopyInto(out *DataGroupSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataGroupSpec. +func (in *DataGroupSpec) DeepCopy() *DataGroupSpec { + if in == nil { + return nil + } + out := new(DataGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataTemplate) DeepCopyInto(out *DataTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataTemplate. +func (in *DataTemplate) DeepCopy() *DataTemplate { + if in == nil { + return nil + } + out := new(DataTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DataTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataTemplateList) DeepCopyInto(out *DataTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DataTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataTemplateList. +func (in *DataTemplateList) DeepCopy() *DataTemplateList { + if in == nil { + return nil + } + out := new(DataTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DataTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataTemplateNexusStatus) DeepCopyInto(out *DataTemplateNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataTemplateNexusStatus. +func (in *DataTemplateNexusStatus) DeepCopy() *DataTemplateNexusStatus { + if in == nil { + return nil + } + out := new(DataTemplateNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Database) DeepCopyInto(out *Database) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Database. +func (in *Database) DeepCopy() *Database { + if in == nil { + return nil + } + out := new(Database) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Database) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DatabaseList) DeepCopyInto(out *DatabaseList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Database, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseList. +func (in *DatabaseList) DeepCopy() *DatabaseList { + if in == nil { + return nil + } + out := new(DatabaseList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DatabaseList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DatabaseNexusStatus) DeepCopyInto(out *DatabaseNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseNexusStatus. +func (in *DatabaseNexusStatus) DeepCopy() *DatabaseNexusStatus { + if in == nil { + return nil + } + out := new(DatabaseNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DatabaseSpec) DeepCopyInto(out *DatabaseSpec) { + *out = *in + if in.TablesGvk != nil { + in, out := &in.TablesGvk, &out.TablesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.DirectoriesGvk != nil { + in, out := &in.DirectoriesGvk, &out.DirectoriesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.BucketsGvk != nil { + in, out := &in.BucketsGvk, &out.BucketsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseSpec. +func (in *DatabaseSpec) DeepCopy() *DatabaseSpec { + if in == nil { + return nil + } + out := new(DatabaseSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DestinationRule) DeepCopyInto(out *DestinationRule) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestinationRule. +func (in *DestinationRule) DeepCopy() *DestinationRule { + if in == nil { + return nil + } + out := new(DestinationRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DestinationRule) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DestinationRuleList) DeepCopyInto(out *DestinationRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DestinationRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestinationRuleList. +func (in *DestinationRuleList) DeepCopy() *DestinationRuleList { + if in == nil { + return nil + } + out := new(DestinationRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DestinationRuleList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DestinationRuleNexusStatus) DeepCopyInto(out *DestinationRuleNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestinationRuleNexusStatus. +func (in *DestinationRuleNexusStatus) DeepCopy() *DestinationRuleNexusStatus { + if in == nil { + return nil + } + out := new(DestinationRuleNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DestinationRuleSpec) DeepCopyInto(out *DestinationRuleSpec) { + *out = *in + if in.ExportTo != nil { + in, out := &in.ExportTo, &out.ExportTo + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ServiceGvk != nil { + in, out := &in.ServiceGvk, &out.ServiceGvk + *out = new(Link) + **out = **in + } + if in.ServiceDeploymentsGvk != nil { + in, out := &in.ServiceDeploymentsGvk, &out.ServiceDeploymentsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceReplicaSetsGvk != nil { + in, out := &in.ServiceReplicaSetsGvk, &out.ServiceReplicaSetsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceStatefulSetsGvk != nil { + in, out := &in.ServiceStatefulSetsGvk, &out.ServiceStatefulSetsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceDaemonSetsGvk != nil { + in, out := &in.ServiceDaemonSetsGvk, &out.ServiceDaemonSetsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceJobsGvk != nil { + in, out := &in.ServiceJobsGvk, &out.ServiceJobsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestinationRuleSpec. +func (in *DestinationRuleSpec) DeepCopy() *DestinationRuleSpec { + if in == nil { + return nil + } + out := new(DestinationRuleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Directory) DeepCopyInto(out *Directory) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Directory. +func (in *Directory) DeepCopy() *Directory { + if in == nil { + return nil + } + out := new(Directory) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Directory) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DirectoryList) DeepCopyInto(out *DirectoryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Directory, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DirectoryList. +func (in *DirectoryList) DeepCopy() *DirectoryList { + if in == nil { + return nil + } + out := new(DirectoryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DirectoryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DirectoryNexusStatus) DeepCopyInto(out *DirectoryNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DirectoryNexusStatus. +func (in *DirectoryNexusStatus) DeepCopy() *DirectoryNexusStatus { + if in == nil { + return nil + } + out := new(DirectoryNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DirectorySpec) DeepCopyInto(out *DirectorySpec) { + *out = *in + if in.TemplateGvk != nil { + in, out := &in.TemplateGvk, &out.TemplateGvk + *out = new(Link) + **out = **in + } + if in.InventoryGvk != nil { + in, out := &in.InventoryGvk, &out.InventoryGvk + *out = new(Link) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DirectorySpec. +func (in *DirectorySpec) DeepCopy() *DirectorySpec { + if in == nil { + return nil + } + out := new(DirectorySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Domain) DeepCopyInto(out *Domain) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Domain. +func (in *Domain) DeepCopy() *Domain { + if in == nil { + return nil + } + out := new(Domain) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Domain) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DomainConfig) DeepCopyInto(out *DomainConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainConfig. +func (in *DomainConfig) DeepCopy() *DomainConfig { + if in == nil { + return nil + } + out := new(DomainConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DomainConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DomainConfigList) DeepCopyInto(out *DomainConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DomainConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainConfigList. +func (in *DomainConfigList) DeepCopy() *DomainConfigList { + if in == nil { + return nil + } + out := new(DomainConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DomainConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DomainConfigNexusStatus) DeepCopyInto(out *DomainConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainConfigNexusStatus. +func (in *DomainConfigNexusStatus) DeepCopy() *DomainConfigNexusStatus { + if in == nil { + return nil + } + out := new(DomainConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DomainConfigSpec) DeepCopyInto(out *DomainConfigSpec) { + *out = *in + if in.PolicyGvk != nil { + in, out := &in.PolicyGvk, &out.PolicyGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.LabelConfigGvk != nil { + in, out := &in.LabelConfigGvk, &out.LabelConfigGvk + *out = new(Child) + **out = **in + } + if in.NetworkAttachmentDefinitionGvk != nil { + in, out := &in.NetworkAttachmentDefinitionGvk, &out.NetworkAttachmentDefinitionGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServicesGvk != nil { + in, out := &in.ServicesGvk, &out.ServicesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceEntriesGvk != nil { + in, out := &in.ServiceEntriesGvk, &out.ServiceEntriesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.GatewayConfigGvk != nil { + in, out := &in.GatewayConfigGvk, &out.GatewayConfigGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AutoscalersGvk != nil { + in, out := &in.AutoscalersGvk, &out.AutoscalersGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.HostConfigV2Gvk != nil { + in, out := &in.HostConfigV2Gvk, &out.HostConfigV2Gvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.InboundAuthenticationConfigGvk != nil { + in, out := &in.InboundAuthenticationConfigGvk, &out.InboundAuthenticationConfigGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SlosGvk != nil { + in, out := &in.SlosGvk, &out.SlosGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SecretsGvk != nil { + in, out := &in.SecretsGvk, &out.SecretsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ExternalServicesGvk != nil { + in, out := &in.ExternalServicesGvk, &out.ExternalServicesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ApiDiscoveryGvk != nil { + in, out := &in.ApiDiscoveryGvk, &out.ApiDiscoveryGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.GeoDiscoveryGvk != nil { + in, out := &in.GeoDiscoveryGvk, &out.GeoDiscoveryGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PiiDiscoveryGvk != nil { + in, out := &in.PiiDiscoveryGvk, &out.PiiDiscoveryGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AttackDiscoveryGvk != nil { + in, out := &in.AttackDiscoveryGvk, &out.AttackDiscoveryGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.UserDiscoveryGvk != nil { + in, out := &in.UserDiscoveryGvk, &out.UserDiscoveryGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PublicServiceGvk != nil { + in, out := &in.PublicServiceGvk, &out.PublicServiceGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.GnsAccessControlPolicyGvk != nil { + in, out := &in.GnsAccessControlPolicyGvk, &out.GnsAccessControlPolicyGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.GnsSchemaViolationDiscoveryGvk != nil { + in, out := &in.GnsSchemaViolationDiscoveryGvk, &out.GnsSchemaViolationDiscoveryGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.GnsSegmentationPolicyGvk != nil { + in, out := &in.GnsSegmentationPolicyGvk, &out.GnsSegmentationPolicyGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.CertificateAuthorityGvk != nil { + in, out := &in.CertificateAuthorityGvk, &out.CertificateAuthorityGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.GnsEndpointsConfigGvk != nil { + in, out := &in.GnsEndpointsConfigGvk, &out.GnsEndpointsConfigGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainConfigSpec. +func (in *DomainConfigSpec) DeepCopy() *DomainConfigSpec { + if in == nil { + return nil + } + out := new(DomainConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DomainList) DeepCopyInto(out *DomainList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Domain, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainList. +func (in *DomainList) DeepCopy() *DomainList { + if in == nil { + return nil + } + out := new(DomainList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DomainList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DomainNexusStatus) DeepCopyInto(out *DomainNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainNexusStatus. +func (in *DomainNexusStatus) DeepCopy() *DomainNexusStatus { + if in == nil { + return nil + } + out := new(DomainNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DomainQueryLogsArgs) DeepCopyInto(out *DomainQueryLogsArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainQueryLogsArgs. +func (in *DomainQueryLogsArgs) DeepCopy() *DomainQueryLogsArgs { + if in == nil { + return nil + } + out := new(DomainQueryLogsArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DomainQueryServiceTableArgs) DeepCopyInto(out *DomainQueryServiceTableArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainQueryServiceTableArgs. +func (in *DomainQueryServiceTableArgs) DeepCopy() *DomainQueryServiceTableArgs { + if in == nil { + return nil + } + out := new(DomainQueryServiceTableArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DomainQueryServiceVersionTableArgs) DeepCopyInto(out *DomainQueryServiceVersionTableArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainQueryServiceVersionTableArgs. +func (in *DomainQueryServiceVersionTableArgs) DeepCopy() *DomainQueryServiceVersionTableArgs { + if in == nil { + return nil + } + out := new(DomainQueryServiceVersionTableArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DomainSpec) DeepCopyInto(out *DomainSpec) { + *out = *in + if in.SecretHashesGvk != nil { + in, out := &in.SecretHashesGvk, &out.SecretHashesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceInstancesGvk != nil { + in, out := &in.ServiceInstancesGvk, &out.ServiceInstancesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceDeploymentsGvk != nil { + in, out := &in.ServiceDeploymentsGvk, &out.ServiceDeploymentsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceStatefulSetsGvk != nil { + in, out := &in.ServiceStatefulSetsGvk, &out.ServiceStatefulSetsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceDaemonSetsGvk != nil { + in, out := &in.ServiceDaemonSetsGvk, &out.ServiceDaemonSetsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceReplicaSetsGvk != nil { + in, out := &in.ServiceReplicaSetsGvk, &out.ServiceReplicaSetsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceCronJobsGvk != nil { + in, out := &in.ServiceCronJobsGvk, &out.ServiceCronJobsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceJobsGvk != nil { + in, out := &in.ServiceJobsGvk, &out.ServiceJobsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.VirtualServicesGvk != nil { + in, out := &in.VirtualServicesGvk, &out.VirtualServicesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceEntryGvk != nil { + in, out := &in.ServiceEntryGvk, &out.ServiceEntryGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.WorkloadEntryGvk != nil { + in, out := &in.WorkloadEntryGvk, &out.WorkloadEntryGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.DestinationRulesGvk != nil { + in, out := &in.DestinationRulesGvk, &out.DestinationRulesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServicesGvk != nil { + in, out := &in.ServicesGvk, &out.ServicesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.EndpointsGvk != nil { + in, out := &in.EndpointsGvk, &out.EndpointsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.GatewaysGvk != nil { + in, out := &in.GatewaysGvk, &out.GatewaysGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AuthenticationPoliciesGvk != nil { + in, out := &in.AuthenticationPoliciesGvk, &out.AuthenticationPoliciesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ConfigmapGvk != nil { + in, out := &in.ConfigmapGvk, &out.ConfigmapGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.EnvoyfilterGvk != nil { + in, out := &in.EnvoyfilterGvk, &out.EnvoyfilterGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AutoscalersGvk != nil { + in, out := &in.AutoscalersGvk, &out.AutoscalersGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PeerAuthenticationGvk != nil { + in, out := &in.PeerAuthenticationGvk, &out.PeerAuthenticationGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.KnativeIngressesGvk != nil { + in, out := &in.KnativeIngressesGvk, &out.KnativeIngressesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.NetworkAttachmentDefinitionGvk != nil { + in, out := &in.NetworkAttachmentDefinitionGvk, &out.NetworkAttachmentDefinitionGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.IssuersGvk != nil { + in, out := &in.IssuersGvk, &out.IssuersGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.CertificatesGvk != nil { + in, out := &in.CertificatesGvk, &out.CertificatesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.CertificateRequestsGvk != nil { + in, out := &in.CertificateRequestsGvk, &out.CertificateRequestsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainSpec. +func (in *DomainSpec) DeepCopy() *DomainSpec { + if in == nil { + return nil + } + out := new(DomainSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ESLabel) DeepCopyInto(out *ESLabel) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ESLabel. +func (in *ESLabel) DeepCopy() *ESLabel { + if in == nil { + return nil + } + out := new(ESLabel) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ESLabels) DeepCopyInto(out *ESLabels) { + { + in := &in + *out = make(ESLabels, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ESLabels. +func (in ESLabels) DeepCopy() ESLabels { + if in == nil { + return nil + } + out := new(ESLabels) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Endpoints) DeepCopyInto(out *Endpoints) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Endpoints. +func (in *Endpoints) DeepCopy() *Endpoints { + if in == nil { + return nil + } + out := new(Endpoints) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Endpoints) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EndpointsList) DeepCopyInto(out *EndpointsList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Endpoints, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointsList. +func (in *EndpointsList) DeepCopy() *EndpointsList { + if in == nil { + return nil + } + out := new(EndpointsList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EndpointsList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EndpointsNexusStatus) DeepCopyInto(out *EndpointsNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointsNexusStatus. +func (in *EndpointsNexusStatus) DeepCopy() *EndpointsNexusStatus { + if in == nil { + return nil + } + out := new(EndpointsNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EndpointsSpec) DeepCopyInto(out *EndpointsSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointsSpec. +func (in *EndpointsSpec) DeepCopy() *EndpointsSpec { + if in == nil { + return nil + } + out := new(EndpointsSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EnvoyFilter) DeepCopyInto(out *EnvoyFilter) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilter. +func (in *EnvoyFilter) DeepCopy() *EnvoyFilter { + if in == nil { + return nil + } + out := new(EnvoyFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EnvoyFilter) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EnvoyFilterList) DeepCopyInto(out *EnvoyFilterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]EnvoyFilter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilterList. +func (in *EnvoyFilterList) DeepCopy() *EnvoyFilterList { + if in == nil { + return nil + } + out := new(EnvoyFilterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EnvoyFilterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EnvoyFilterNexusStatus) DeepCopyInto(out *EnvoyFilterNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilterNexusStatus. +func (in *EnvoyFilterNexusStatus) DeepCopy() *EnvoyFilterNexusStatus { + if in == nil { + return nil + } + out := new(EnvoyFilterNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EnvoyFilterSpec) DeepCopyInto(out *EnvoyFilterSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilterSpec. +func (in *EnvoyFilterSpec) DeepCopy() *EnvoyFilterSpec { + if in == nil { + return nil + } + out := new(EnvoyFilterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalAccountConfigN) DeepCopyInto(out *ExternalAccountConfigN) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalAccountConfigN. +func (in *ExternalAccountConfigN) DeepCopy() *ExternalAccountConfigN { + if in == nil { + return nil + } + out := new(ExternalAccountConfigN) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalAccountConfigN) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalAccountConfigNList) DeepCopyInto(out *ExternalAccountConfigNList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalAccountConfigN, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalAccountConfigNList. +func (in *ExternalAccountConfigNList) DeepCopy() *ExternalAccountConfigNList { + if in == nil { + return nil + } + out := new(ExternalAccountConfigNList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalAccountConfigNList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalAccountConfigNNexusStatus) DeepCopyInto(out *ExternalAccountConfigNNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalAccountConfigNNexusStatus. +func (in *ExternalAccountConfigNNexusStatus) DeepCopy() *ExternalAccountConfigNNexusStatus { + if in == nil { + return nil + } + out := new(ExternalAccountConfigNNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalAccountConfigNSpec) DeepCopyInto(out *ExternalAccountConfigNSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalAccountConfigNSpec. +func (in *ExternalAccountConfigNSpec) DeepCopy() *ExternalAccountConfigNSpec { + if in == nil { + return nil + } + out := new(ExternalAccountConfigNSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalAuditStorage) DeepCopyInto(out *ExternalAuditStorage) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalAuditStorage. +func (in *ExternalAuditStorage) DeepCopy() *ExternalAuditStorage { + if in == nil { + return nil + } + out := new(ExternalAuditStorage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalAuditStorage) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalAuditStorageList) DeepCopyInto(out *ExternalAuditStorageList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalAuditStorage, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalAuditStorageList. +func (in *ExternalAuditStorageList) DeepCopy() *ExternalAuditStorageList { + if in == nil { + return nil + } + out := new(ExternalAuditStorageList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalAuditStorageList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalAuditStorageNexusStatus) DeepCopyInto(out *ExternalAuditStorageNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalAuditStorageNexusStatus. +func (in *ExternalAuditStorageNexusStatus) DeepCopy() *ExternalAuditStorageNexusStatus { + if in == nil { + return nil + } + out := new(ExternalAuditStorageNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalAuditStorageSpec) DeepCopyInto(out *ExternalAuditStorageSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalAuditStorageSpec. +func (in *ExternalAuditStorageSpec) DeepCopy() *ExternalAuditStorageSpec { + if in == nil { + return nil + } + out := new(ExternalAuditStorageSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSConfigN) DeepCopyInto(out *ExternalDNSConfigN) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSConfigN. +func (in *ExternalDNSConfigN) DeepCopy() *ExternalDNSConfigN { + if in == nil { + return nil + } + out := new(ExternalDNSConfigN) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSConfigN) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSConfigNList) DeepCopyInto(out *ExternalDNSConfigNList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalDNSConfigN, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSConfigNList. +func (in *ExternalDNSConfigNList) DeepCopy() *ExternalDNSConfigNList { + if in == nil { + return nil + } + out := new(ExternalDNSConfigNList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSConfigNList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSConfigNNexusStatus) DeepCopyInto(out *ExternalDNSConfigNNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSConfigNNexusStatus. +func (in *ExternalDNSConfigNNexusStatus) DeepCopy() *ExternalDNSConfigNNexusStatus { + if in == nil { + return nil + } + out := new(ExternalDNSConfigNNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSConfigNSpec) DeepCopyInto(out *ExternalDNSConfigNSpec) { + *out = *in + if in.AccountGvk != nil { + in, out := &in.AccountGvk, &out.AccountGvk + *out = new(Link) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSConfigNSpec. +func (in *ExternalDNSConfigNSpec) DeepCopy() *ExternalDNSConfigNSpec { + if in == nil { + return nil + } + out := new(ExternalDNSConfigNSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventory) DeepCopyInto(out *ExternalDNSInventory) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventory. +func (in *ExternalDNSInventory) DeepCopy() *ExternalDNSInventory { + if in == nil { + return nil + } + out := new(ExternalDNSInventory) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSInventory) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryHealthCheck) DeepCopyInto(out *ExternalDNSInventoryHealthCheck) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryHealthCheck. +func (in *ExternalDNSInventoryHealthCheck) DeepCopy() *ExternalDNSInventoryHealthCheck { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryHealthCheck) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSInventoryHealthCheck) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryHealthCheckList) DeepCopyInto(out *ExternalDNSInventoryHealthCheckList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalDNSInventoryHealthCheck, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryHealthCheckList. +func (in *ExternalDNSInventoryHealthCheckList) DeepCopy() *ExternalDNSInventoryHealthCheckList { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryHealthCheckList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSInventoryHealthCheckList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryHealthCheckNexusStatus) DeepCopyInto(out *ExternalDNSInventoryHealthCheckNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryHealthCheckNexusStatus. +func (in *ExternalDNSInventoryHealthCheckNexusStatus) DeepCopy() *ExternalDNSInventoryHealthCheckNexusStatus { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryHealthCheckNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryHealthCheckSpec) DeepCopyInto(out *ExternalDNSInventoryHealthCheckSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryHealthCheckSpec. +func (in *ExternalDNSInventoryHealthCheckSpec) DeepCopy() *ExternalDNSInventoryHealthCheckSpec { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryHealthCheckSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryList) DeepCopyInto(out *ExternalDNSInventoryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalDNSInventory, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryList. +func (in *ExternalDNSInventoryList) DeepCopy() *ExternalDNSInventoryList { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSInventoryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryNexusStatus) DeepCopyInto(out *ExternalDNSInventoryNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryNexusStatus. +func (in *ExternalDNSInventoryNexusStatus) DeepCopy() *ExternalDNSInventoryNexusStatus { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryPrimaryDomain) DeepCopyInto(out *ExternalDNSInventoryPrimaryDomain) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryPrimaryDomain. +func (in *ExternalDNSInventoryPrimaryDomain) DeepCopy() *ExternalDNSInventoryPrimaryDomain { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryPrimaryDomain) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSInventoryPrimaryDomain) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryPrimaryDomainList) DeepCopyInto(out *ExternalDNSInventoryPrimaryDomainList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalDNSInventoryPrimaryDomain, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryPrimaryDomainList. +func (in *ExternalDNSInventoryPrimaryDomainList) DeepCopy() *ExternalDNSInventoryPrimaryDomainList { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryPrimaryDomainList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSInventoryPrimaryDomainList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryPrimaryDomainNexusStatus) DeepCopyInto(out *ExternalDNSInventoryPrimaryDomainNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryPrimaryDomainNexusStatus. +func (in *ExternalDNSInventoryPrimaryDomainNexusStatus) DeepCopy() *ExternalDNSInventoryPrimaryDomainNexusStatus { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryPrimaryDomainNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryPrimaryDomainSpec) DeepCopyInto(out *ExternalDNSInventoryPrimaryDomainSpec) { + *out = *in + if in.DnsRecordsGvk != nil { + in, out := &in.DnsRecordsGvk, &out.DnsRecordsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryPrimaryDomainSpec. +func (in *ExternalDNSInventoryPrimaryDomainSpec) DeepCopy() *ExternalDNSInventoryPrimaryDomainSpec { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryPrimaryDomainSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryRecord) DeepCopyInto(out *ExternalDNSInventoryRecord) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryRecord. +func (in *ExternalDNSInventoryRecord) DeepCopy() *ExternalDNSInventoryRecord { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryRecord) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSInventoryRecord) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryRecordList) DeepCopyInto(out *ExternalDNSInventoryRecordList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalDNSInventoryRecord, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryRecordList. +func (in *ExternalDNSInventoryRecordList) DeepCopy() *ExternalDNSInventoryRecordList { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryRecordList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSInventoryRecordList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryRecordNexusStatus) DeepCopyInto(out *ExternalDNSInventoryRecordNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryRecordNexusStatus. +func (in *ExternalDNSInventoryRecordNexusStatus) DeepCopy() *ExternalDNSInventoryRecordNexusStatus { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryRecordNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryRecordSpec) DeepCopyInto(out *ExternalDNSInventoryRecordSpec) { + *out = *in + if in.HealthCheckGvk != nil { + in, out := &in.HealthCheckGvk, &out.HealthCheckGvk + *out = new(Link) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryRecordSpec. +func (in *ExternalDNSInventoryRecordSpec) DeepCopy() *ExternalDNSInventoryRecordSpec { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryRecordSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventorySpec) DeepCopyInto(out *ExternalDNSInventorySpec) { + *out = *in + if in.EnabledForProjects != nil { + in, out := &in.EnabledForProjects, &out.EnabledForProjects + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ZonesGvk != nil { + in, out := &in.ZonesGvk, &out.ZonesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PrimaryDomainsGvk != nil { + in, out := &in.PrimaryDomainsGvk, &out.PrimaryDomainsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.HealthChecksGvk != nil { + in, out := &in.HealthChecksGvk, &out.HealthChecksGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventorySpec. +func (in *ExternalDNSInventorySpec) DeepCopy() *ExternalDNSInventorySpec { + if in == nil { + return nil + } + out := new(ExternalDNSInventorySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryZone) DeepCopyInto(out *ExternalDNSInventoryZone) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryZone. +func (in *ExternalDNSInventoryZone) DeepCopy() *ExternalDNSInventoryZone { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryZone) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSInventoryZone) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryZoneList) DeepCopyInto(out *ExternalDNSInventoryZoneList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalDNSInventoryZone, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryZoneList. +func (in *ExternalDNSInventoryZoneList) DeepCopy() *ExternalDNSInventoryZoneList { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryZoneList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSInventoryZoneList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryZoneNexusStatus) DeepCopyInto(out *ExternalDNSInventoryZoneNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryZoneNexusStatus. +func (in *ExternalDNSInventoryZoneNexusStatus) DeepCopy() *ExternalDNSInventoryZoneNexusStatus { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryZoneNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSInventoryZoneSpec) DeepCopyInto(out *ExternalDNSInventoryZoneSpec) { + *out = *in + if in.PrimaryDomainsGvk != nil { + in, out := &in.PrimaryDomainsGvk, &out.PrimaryDomainsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSInventoryZoneSpec. +func (in *ExternalDNSInventoryZoneSpec) DeepCopy() *ExternalDNSInventoryZoneSpec { + if in == nil { + return nil + } + out := new(ExternalDNSInventoryZoneSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSRuntime) DeepCopyInto(out *ExternalDNSRuntime) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSRuntime. +func (in *ExternalDNSRuntime) DeepCopy() *ExternalDNSRuntime { + if in == nil { + return nil + } + out := new(ExternalDNSRuntime) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSRuntime) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSRuntimeEndpoint) DeepCopyInto(out *ExternalDNSRuntimeEndpoint) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSRuntimeEndpoint. +func (in *ExternalDNSRuntimeEndpoint) DeepCopy() *ExternalDNSRuntimeEndpoint { + if in == nil { + return nil + } + out := new(ExternalDNSRuntimeEndpoint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSRuntimeEndpoint) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSRuntimeEndpointList) DeepCopyInto(out *ExternalDNSRuntimeEndpointList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalDNSRuntimeEndpoint, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSRuntimeEndpointList. +func (in *ExternalDNSRuntimeEndpointList) DeepCopy() *ExternalDNSRuntimeEndpointList { + if in == nil { + return nil + } + out := new(ExternalDNSRuntimeEndpointList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSRuntimeEndpointList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSRuntimeEndpointNexusStatus) DeepCopyInto(out *ExternalDNSRuntimeEndpointNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSRuntimeEndpointNexusStatus. +func (in *ExternalDNSRuntimeEndpointNexusStatus) DeepCopy() *ExternalDNSRuntimeEndpointNexusStatus { + if in == nil { + return nil + } + out := new(ExternalDNSRuntimeEndpointNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSRuntimeEndpointSpec) DeepCopyInto(out *ExternalDNSRuntimeEndpointSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSRuntimeEndpointSpec. +func (in *ExternalDNSRuntimeEndpointSpec) DeepCopy() *ExternalDNSRuntimeEndpointSpec { + if in == nil { + return nil + } + out := new(ExternalDNSRuntimeEndpointSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSRuntimeList) DeepCopyInto(out *ExternalDNSRuntimeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalDNSRuntime, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSRuntimeList. +func (in *ExternalDNSRuntimeList) DeepCopy() *ExternalDNSRuntimeList { + if in == nil { + return nil + } + out := new(ExternalDNSRuntimeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSRuntimeList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSRuntimeNexusStatus) DeepCopyInto(out *ExternalDNSRuntimeNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSRuntimeNexusStatus. +func (in *ExternalDNSRuntimeNexusStatus) DeepCopy() *ExternalDNSRuntimeNexusStatus { + if in == nil { + return nil + } + out := new(ExternalDNSRuntimeNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSRuntimePrimaryDomain) DeepCopyInto(out *ExternalDNSRuntimePrimaryDomain) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSRuntimePrimaryDomain. +func (in *ExternalDNSRuntimePrimaryDomain) DeepCopy() *ExternalDNSRuntimePrimaryDomain { + if in == nil { + return nil + } + out := new(ExternalDNSRuntimePrimaryDomain) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSRuntimePrimaryDomain) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSRuntimePrimaryDomainList) DeepCopyInto(out *ExternalDNSRuntimePrimaryDomainList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalDNSRuntimePrimaryDomain, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSRuntimePrimaryDomainList. +func (in *ExternalDNSRuntimePrimaryDomainList) DeepCopy() *ExternalDNSRuntimePrimaryDomainList { + if in == nil { + return nil + } + out := new(ExternalDNSRuntimePrimaryDomainList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSRuntimePrimaryDomainList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSRuntimePrimaryDomainNexusStatus) DeepCopyInto(out *ExternalDNSRuntimePrimaryDomainNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSRuntimePrimaryDomainNexusStatus. +func (in *ExternalDNSRuntimePrimaryDomainNexusStatus) DeepCopy() *ExternalDNSRuntimePrimaryDomainNexusStatus { + if in == nil { + return nil + } + out := new(ExternalDNSRuntimePrimaryDomainNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSRuntimePrimaryDomainSpec) DeepCopyInto(out *ExternalDNSRuntimePrimaryDomainSpec) { + *out = *in + if in.SubdomainsGvk != nil { + in, out := &in.SubdomainsGvk, &out.SubdomainsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSRuntimePrimaryDomainSpec. +func (in *ExternalDNSRuntimePrimaryDomainSpec) DeepCopy() *ExternalDNSRuntimePrimaryDomainSpec { + if in == nil { + return nil + } + out := new(ExternalDNSRuntimePrimaryDomainSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSRuntimeSpec) DeepCopyInto(out *ExternalDNSRuntimeSpec) { + *out = *in + if in.PrimaryDomainsGvk != nil { + in, out := &in.PrimaryDomainsGvk, &out.PrimaryDomainsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSRuntimeSpec. +func (in *ExternalDNSRuntimeSpec) DeepCopy() *ExternalDNSRuntimeSpec { + if in == nil { + return nil + } + out := new(ExternalDNSRuntimeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSRuntimeSubdomain) DeepCopyInto(out *ExternalDNSRuntimeSubdomain) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSRuntimeSubdomain. +func (in *ExternalDNSRuntimeSubdomain) DeepCopy() *ExternalDNSRuntimeSubdomain { + if in == nil { + return nil + } + out := new(ExternalDNSRuntimeSubdomain) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSRuntimeSubdomain) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSRuntimeSubdomainList) DeepCopyInto(out *ExternalDNSRuntimeSubdomainList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalDNSRuntimeSubdomain, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSRuntimeSubdomainList. +func (in *ExternalDNSRuntimeSubdomainList) DeepCopy() *ExternalDNSRuntimeSubdomainList { + if in == nil { + return nil + } + out := new(ExternalDNSRuntimeSubdomainList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalDNSRuntimeSubdomainList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSRuntimeSubdomainNexusStatus) DeepCopyInto(out *ExternalDNSRuntimeSubdomainNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSRuntimeSubdomainNexusStatus. +func (in *ExternalDNSRuntimeSubdomainNexusStatus) DeepCopy() *ExternalDNSRuntimeSubdomainNexusStatus { + if in == nil { + return nil + } + out := new(ExternalDNSRuntimeSubdomainNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalDNSRuntimeSubdomainSpec) DeepCopyInto(out *ExternalDNSRuntimeSubdomainSpec) { + *out = *in + if in.EndpointsGvk != nil { + in, out := &in.EndpointsGvk, &out.EndpointsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDNSRuntimeSubdomainSpec. +func (in *ExternalDNSRuntimeSubdomainSpec) DeepCopy() *ExternalDNSRuntimeSubdomainSpec { + if in == nil { + return nil + } + out := new(ExternalDNSRuntimeSubdomainSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalLBConfigN) DeepCopyInto(out *ExternalLBConfigN) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalLBConfigN. +func (in *ExternalLBConfigN) DeepCopy() *ExternalLBConfigN { + if in == nil { + return nil + } + out := new(ExternalLBConfigN) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalLBConfigN) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalLBConfigNList) DeepCopyInto(out *ExternalLBConfigNList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalLBConfigN, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalLBConfigNList. +func (in *ExternalLBConfigNList) DeepCopy() *ExternalLBConfigNList { + if in == nil { + return nil + } + out := new(ExternalLBConfigNList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalLBConfigNList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalLBConfigNNexusStatus) DeepCopyInto(out *ExternalLBConfigNNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalLBConfigNNexusStatus. +func (in *ExternalLBConfigNNexusStatus) DeepCopy() *ExternalLBConfigNNexusStatus { + if in == nil { + return nil + } + out := new(ExternalLBConfigNNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalLBConfigNSpec) DeepCopyInto(out *ExternalLBConfigNSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalLBConfigNSpec. +func (in *ExternalLBConfigNSpec) DeepCopy() *ExternalLBConfigNSpec { + if in == nil { + return nil + } + out := new(ExternalLBConfigNSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginCapability) DeepCopyInto(out *ExternalPluginCapability) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginCapability. +func (in *ExternalPluginCapability) DeepCopy() *ExternalPluginCapability { + if in == nil { + return nil + } + out := new(ExternalPluginCapability) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalPluginCapability) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginCapabilityList) DeepCopyInto(out *ExternalPluginCapabilityList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalPluginCapability, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginCapabilityList. +func (in *ExternalPluginCapabilityList) DeepCopy() *ExternalPluginCapabilityList { + if in == nil { + return nil + } + out := new(ExternalPluginCapabilityList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalPluginCapabilityList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginCapabilityNexusStatus) DeepCopyInto(out *ExternalPluginCapabilityNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginCapabilityNexusStatus. +func (in *ExternalPluginCapabilityNexusStatus) DeepCopy() *ExternalPluginCapabilityNexusStatus { + if in == nil { + return nil + } + out := new(ExternalPluginCapabilityNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginCapabilitySpec) DeepCopyInto(out *ExternalPluginCapabilitySpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginCapabilitySpec. +func (in *ExternalPluginCapabilitySpec) DeepCopy() *ExternalPluginCapabilitySpec { + if in == nil { + return nil + } + out := new(ExternalPluginCapabilitySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginConfig) DeepCopyInto(out *ExternalPluginConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginConfig. +func (in *ExternalPluginConfig) DeepCopy() *ExternalPluginConfig { + if in == nil { + return nil + } + out := new(ExternalPluginConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalPluginConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginConfigFolder) DeepCopyInto(out *ExternalPluginConfigFolder) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginConfigFolder. +func (in *ExternalPluginConfigFolder) DeepCopy() *ExternalPluginConfigFolder { + if in == nil { + return nil + } + out := new(ExternalPluginConfigFolder) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalPluginConfigFolder) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginConfigFolderList) DeepCopyInto(out *ExternalPluginConfigFolderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalPluginConfigFolder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginConfigFolderList. +func (in *ExternalPluginConfigFolderList) DeepCopy() *ExternalPluginConfigFolderList { + if in == nil { + return nil + } + out := new(ExternalPluginConfigFolderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalPluginConfigFolderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginConfigFolderNexusStatus) DeepCopyInto(out *ExternalPluginConfigFolderNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginConfigFolderNexusStatus. +func (in *ExternalPluginConfigFolderNexusStatus) DeepCopy() *ExternalPluginConfigFolderNexusStatus { + if in == nil { + return nil + } + out := new(ExternalPluginConfigFolderNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginConfigFolderSpec) DeepCopyInto(out *ExternalPluginConfigFolderSpec) { + *out = *in + if in.PluginsGvk != nil { + in, out := &in.PluginsGvk, &out.PluginsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginConfigFolderSpec. +func (in *ExternalPluginConfigFolderSpec) DeepCopy() *ExternalPluginConfigFolderSpec { + if in == nil { + return nil + } + out := new(ExternalPluginConfigFolderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginConfigList) DeepCopyInto(out *ExternalPluginConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalPluginConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginConfigList. +func (in *ExternalPluginConfigList) DeepCopy() *ExternalPluginConfigList { + if in == nil { + return nil + } + out := new(ExternalPluginConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalPluginConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginConfigNexusStatus) DeepCopyInto(out *ExternalPluginConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginConfigNexusStatus. +func (in *ExternalPluginConfigNexusStatus) DeepCopy() *ExternalPluginConfigNexusStatus { + if in == nil { + return nil + } + out := new(ExternalPluginConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginConfigSpec) DeepCopyInto(out *ExternalPluginConfigSpec) { + *out = *in + if in.PluginInstancesGvk != nil { + in, out := &in.PluginInstancesGvk, &out.PluginInstancesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginConfigSpec. +func (in *ExternalPluginConfigSpec) DeepCopy() *ExternalPluginConfigSpec { + if in == nil { + return nil + } + out := new(ExternalPluginConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginInstanceConfig) DeepCopyInto(out *ExternalPluginInstanceConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginInstanceConfig. +func (in *ExternalPluginInstanceConfig) DeepCopy() *ExternalPluginInstanceConfig { + if in == nil { + return nil + } + out := new(ExternalPluginInstanceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalPluginInstanceConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginInstanceConfigList) DeepCopyInto(out *ExternalPluginInstanceConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalPluginInstanceConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginInstanceConfigList. +func (in *ExternalPluginInstanceConfigList) DeepCopy() *ExternalPluginInstanceConfigList { + if in == nil { + return nil + } + out := new(ExternalPluginInstanceConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalPluginInstanceConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginInstanceConfigNexusStatus) DeepCopyInto(out *ExternalPluginInstanceConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginInstanceConfigNexusStatus. +func (in *ExternalPluginInstanceConfigNexusStatus) DeepCopy() *ExternalPluginInstanceConfigNexusStatus { + if in == nil { + return nil + } + out := new(ExternalPluginInstanceConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginInstanceConfigSpec) DeepCopyInto(out *ExternalPluginInstanceConfigSpec) { + *out = *in + if in.CapabilitiyGvk != nil { + in, out := &in.CapabilitiyGvk, &out.CapabilitiyGvk + *out = new(Child) + **out = **in + } + if in.MonitorsGvk != nil { + in, out := &in.MonitorsGvk, &out.MonitorsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ClustersGvk != nil { + in, out := &in.ClustersGvk, &out.ClustersGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginInstanceConfigSpec. +func (in *ExternalPluginInstanceConfigSpec) DeepCopy() *ExternalPluginInstanceConfigSpec { + if in == nil { + return nil + } + out := new(ExternalPluginInstanceConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginMonitor) DeepCopyInto(out *ExternalPluginMonitor) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginMonitor. +func (in *ExternalPluginMonitor) DeepCopy() *ExternalPluginMonitor { + if in == nil { + return nil + } + out := new(ExternalPluginMonitor) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalPluginMonitor) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginMonitorList) DeepCopyInto(out *ExternalPluginMonitorList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalPluginMonitor, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginMonitorList. +func (in *ExternalPluginMonitorList) DeepCopy() *ExternalPluginMonitorList { + if in == nil { + return nil + } + out := new(ExternalPluginMonitorList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalPluginMonitorList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginMonitorNexusStatus) DeepCopyInto(out *ExternalPluginMonitorNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginMonitorNexusStatus. +func (in *ExternalPluginMonitorNexusStatus) DeepCopy() *ExternalPluginMonitorNexusStatus { + if in == nil { + return nil + } + out := new(ExternalPluginMonitorNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPluginMonitorSpec) DeepCopyInto(out *ExternalPluginMonitorSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPluginMonitorSpec. +func (in *ExternalPluginMonitorSpec) DeepCopy() *ExternalPluginMonitorSpec { + if in == nil { + return nil + } + out := new(ExternalPluginMonitorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalServiceConfig) DeepCopyInto(out *ExternalServiceConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalServiceConfig. +func (in *ExternalServiceConfig) DeepCopy() *ExternalServiceConfig { + if in == nil { + return nil + } + out := new(ExternalServiceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalServiceConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalServiceConfigList) DeepCopyInto(out *ExternalServiceConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalServiceConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalServiceConfigList. +func (in *ExternalServiceConfigList) DeepCopy() *ExternalServiceConfigList { + if in == nil { + return nil + } + out := new(ExternalServiceConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalServiceConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalServiceConfigNexusStatus) DeepCopyInto(out *ExternalServiceConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalServiceConfigNexusStatus. +func (in *ExternalServiceConfigNexusStatus) DeepCopy() *ExternalServiceConfigNexusStatus { + if in == nil { + return nil + } + out := new(ExternalServiceConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalServiceConfigSpec) DeepCopyInto(out *ExternalServiceConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalServiceConfigSpec. +func (in *ExternalServiceConfigSpec) DeepCopy() *ExternalServiceConfigSpec { + if in == nil { + return nil + } + out := new(ExternalServiceConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalServicesRT) DeepCopyInto(out *ExternalServicesRT) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalServicesRT. +func (in *ExternalServicesRT) DeepCopy() *ExternalServicesRT { + if in == nil { + return nil + } + out := new(ExternalServicesRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalServicesRT) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalServicesRTList) DeepCopyInto(out *ExternalServicesRTList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExternalServicesRT, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalServicesRTList. +func (in *ExternalServicesRTList) DeepCopy() *ExternalServicesRTList { + if in == nil { + return nil + } + out := new(ExternalServicesRTList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExternalServicesRTList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalServicesRTNexusStatus) DeepCopyInto(out *ExternalServicesRTNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalServicesRTNexusStatus. +func (in *ExternalServicesRTNexusStatus) DeepCopy() *ExternalServicesRTNexusStatus { + if in == nil { + return nil + } + out := new(ExternalServicesRTNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalServicesRTSpec) DeepCopyInto(out *ExternalServicesRTSpec) { + *out = *in + if in.EndpointList != nil { + in, out := &in.EndpointList, &out.EndpointList + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.EgressGateways != nil { + in, out := &in.EgressGateways, &out.EgressGateways + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalServicesRTSpec. +func (in *ExternalServicesRTSpec) DeepCopy() *ExternalServicesRTSpec { + if in == nil { + return nil + } + out := new(ExternalServicesRTSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeatureFlag) DeepCopyInto(out *FeatureFlag) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlag. +func (in *FeatureFlag) DeepCopy() *FeatureFlag { + if in == nil { + return nil + } + out := new(FeatureFlag) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FeatureFlag) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeatureFlagList) DeepCopyInto(out *FeatureFlagList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]FeatureFlag, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlagList. +func (in *FeatureFlagList) DeepCopy() *FeatureFlagList { + if in == nil { + return nil + } + out := new(FeatureFlagList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FeatureFlagList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeatureFlagNexusStatus) DeepCopyInto(out *FeatureFlagNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlagNexusStatus. +func (in *FeatureFlagNexusStatus) DeepCopy() *FeatureFlagNexusStatus { + if in == nil { + return nil + } + out := new(FeatureFlagNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeatureFlagSpec) DeepCopyInto(out *FeatureFlagSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlagSpec. +func (in *FeatureFlagSpec) DeepCopy() *FeatureFlagSpec { + if in == nil { + return nil + } + out := new(FeatureFlagSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FederatedSloConfig) DeepCopyInto(out *FederatedSloConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedSloConfig. +func (in *FederatedSloConfig) DeepCopy() *FederatedSloConfig { + if in == nil { + return nil + } + out := new(FederatedSloConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FederatedSloConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FederatedSloConfigList) DeepCopyInto(out *FederatedSloConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]FederatedSloConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedSloConfigList. +func (in *FederatedSloConfigList) DeepCopy() *FederatedSloConfigList { + if in == nil { + return nil + } + out := new(FederatedSloConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FederatedSloConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FederatedSloConfigNexusStatus) DeepCopyInto(out *FederatedSloConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedSloConfigNexusStatus. +func (in *FederatedSloConfigNexusStatus) DeepCopy() *FederatedSloConfigNexusStatus { + if in == nil { + return nil + } + out := new(FederatedSloConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FederatedSloConfigSpec) DeepCopyInto(out *FederatedSloConfigSpec) { + *out = *in + if in.SloServicesGvk != nil { + in, out := &in.SloServicesGvk, &out.SloServicesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedSloConfigSpec. +func (in *FederatedSloConfigSpec) DeepCopy() *FederatedSloConfigSpec { + if in == nil { + return nil + } + out := new(FederatedSloConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FederatedSloServiceConfig) DeepCopyInto(out *FederatedSloServiceConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedSloServiceConfig. +func (in *FederatedSloServiceConfig) DeepCopy() *FederatedSloServiceConfig { + if in == nil { + return nil + } + out := new(FederatedSloServiceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FederatedSloServiceConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FederatedSloServiceConfigList) DeepCopyInto(out *FederatedSloServiceConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]FederatedSloServiceConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedSloServiceConfigList. +func (in *FederatedSloServiceConfigList) DeepCopy() *FederatedSloServiceConfigList { + if in == nil { + return nil + } + out := new(FederatedSloServiceConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FederatedSloServiceConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FederatedSloServiceConfigNexusStatus) DeepCopyInto(out *FederatedSloServiceConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedSloServiceConfigNexusStatus. +func (in *FederatedSloServiceConfigNexusStatus) DeepCopy() *FederatedSloServiceConfigNexusStatus { + if in == nil { + return nil + } + out := new(FederatedSloServiceConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FederatedSloServiceConfigSpec) DeepCopyInto(out *FederatedSloServiceConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedSloServiceConfigSpec. +func (in *FederatedSloServiceConfigSpec) DeepCopy() *FederatedSloServiceConfigSpec { + if in == nil { + return nil + } + out := new(FederatedSloServiceConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FnArgs) DeepCopyInto(out *FnArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FnArgs. +func (in *FnArgs) DeepCopy() *FnArgs { + if in == nil { + return nil + } + out := new(FnArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GNS) DeepCopyInto(out *GNS) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNS. +func (in *GNS) DeepCopy() *GNS { + if in == nil { + return nil + } + out := new(GNS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GNS) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GNSConfigStatus) DeepCopyInto(out *GNSConfigStatus) { + *out = *in + if in.Errors != nil { + in, out := &in.Errors, &out.Errors + *out = make(GNSConfigStatusErrors, len(*in)) + copy(*out, *in) + } + if in.Warnings != nil { + in, out := &in.Warnings, &out.Warnings + *out = make(GNSConfigStatusWarnings, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNSConfigStatus. +func (in *GNSConfigStatus) DeepCopy() *GNSConfigStatus { + if in == nil { + return nil + } + out := new(GNSConfigStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GNSConfigStatusError) DeepCopyInto(out *GNSConfigStatusError) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNSConfigStatusError. +func (in *GNSConfigStatusError) DeepCopy() *GNSConfigStatusError { + if in == nil { + return nil + } + out := new(GNSConfigStatusError) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in GNSConfigStatusErrors) DeepCopyInto(out *GNSConfigStatusErrors) { + { + in := &in + *out = make(GNSConfigStatusErrors, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNSConfigStatusErrors. +func (in GNSConfigStatusErrors) DeepCopy() GNSConfigStatusErrors { + if in == nil { + return nil + } + out := new(GNSConfigStatusErrors) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in GNSConfigStatusHistory) DeepCopyInto(out *GNSConfigStatusHistory) { + { + in := &in + *out = make(GNSConfigStatusHistory, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNSConfigStatusHistory. +func (in GNSConfigStatusHistory) DeepCopy() GNSConfigStatusHistory { + if in == nil { + return nil + } + out := new(GNSConfigStatusHistory) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GNSConfigStatusWarning) DeepCopyInto(out *GNSConfigStatusWarning) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNSConfigStatusWarning. +func (in *GNSConfigStatusWarning) DeepCopy() *GNSConfigStatusWarning { + if in == nil { + return nil + } + out := new(GNSConfigStatusWarning) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in GNSConfigStatusWarnings) DeepCopyInto(out *GNSConfigStatusWarnings) { + { + in := &in + *out = make(GNSConfigStatusWarnings, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNSConfigStatusWarnings. +func (in GNSConfigStatusWarnings) DeepCopy() GNSConfigStatusWarnings { + if in == nil { + return nil + } + out := new(GNSConfigStatusWarnings) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GNSList) DeepCopyInto(out *GNSList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GNS, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNSList. +func (in *GNSList) DeepCopy() *GNSList { + if in == nil { + return nil + } + out := new(GNSList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GNSList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GNSNexusStatus) DeepCopyInto(out *GNSNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNSNexusStatus. +func (in *GNSNexusStatus) DeepCopy() *GNSNexusStatus { + if in == nil { + return nil + } + out := new(GNSNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GNSRoutingConfig) DeepCopyInto(out *GNSRoutingConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNSRoutingConfig. +func (in *GNSRoutingConfig) DeepCopy() *GNSRoutingConfig { + if in == nil { + return nil + } + out := new(GNSRoutingConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GNSRoutingConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GNSRoutingConfigList) DeepCopyInto(out *GNSRoutingConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GNSRoutingConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNSRoutingConfigList. +func (in *GNSRoutingConfigList) DeepCopy() *GNSRoutingConfigList { + if in == nil { + return nil + } + out := new(GNSRoutingConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GNSRoutingConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GNSRoutingConfigNexusStatus) DeepCopyInto(out *GNSRoutingConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNSRoutingConfigNexusStatus. +func (in *GNSRoutingConfigNexusStatus) DeepCopy() *GNSRoutingConfigNexusStatus { + if in == nil { + return nil + } + out := new(GNSRoutingConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GNSRoutingConfigSpec) DeepCopyInto(out *GNSRoutingConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNSRoutingConfigSpec. +func (in *GNSRoutingConfigSpec) DeepCopy() *GNSRoutingConfigSpec { + if in == nil { + return nil + } + out := new(GNSRoutingConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GNSSpec) DeepCopyInto(out *GNSSpec) { + *out = *in + if in.RoutingConfigGvk != nil { + in, out := &in.RoutingConfigGvk, &out.RoutingConfigGvk + *out = new(Child) + **out = **in + } + if in.GnsServiceGroupsGvk != nil { + in, out := &in.GnsServiceGroupsGvk, &out.GnsServiceGroupsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PublicServicesGvk != nil { + in, out := &in.PublicServicesGvk, &out.PublicServicesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SharedServicesGvk != nil { + in, out := &in.SharedServicesGvk, &out.SharedServicesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SloPoliciesGvk != nil { + in, out := &in.SloPoliciesGvk, &out.SloPoliciesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ExternalServicesGvk != nil { + in, out := &in.ExternalServicesGvk, &out.ExternalServicesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AutoscalingPoliciesGvk != nil { + in, out := &in.AutoscalingPoliciesGvk, &out.AutoscalingPoliciesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.RoutingPoliciesGvk != nil { + in, out := &in.RoutingPoliciesGvk, &out.RoutingPoliciesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ApiDiscoveryGvk != nil { + in, out := &in.ApiDiscoveryGvk, &out.ApiDiscoveryGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.GeoDiscoveryGvk != nil { + in, out := &in.GeoDiscoveryGvk, &out.GeoDiscoveryGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PiiDiscoveryGvk != nil { + in, out := &in.PiiDiscoveryGvk, &out.PiiDiscoveryGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AttackDiscoveryGvk != nil { + in, out := &in.AttackDiscoveryGvk, &out.AttackDiscoveryGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.UserDiscoveryGvk != nil { + in, out := &in.UserDiscoveryGvk, &out.UserDiscoveryGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.GnsAccessControlPolicyGvk != nil { + in, out := &in.GnsAccessControlPolicyGvk, &out.GnsAccessControlPolicyGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.GnsSchemaViolationDiscoveryGvk != nil { + in, out := &in.GnsSchemaViolationDiscoveryGvk, &out.GnsSchemaViolationDiscoveryGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.GnsSegmentationPolicyGvk != nil { + in, out := &in.GnsSegmentationPolicyGvk, &out.GnsSegmentationPolicyGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.MemberGroupsGvk != nil { + in, out := &in.MemberGroupsGvk, &out.MemberGroupsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.MembersGvk != nil { + in, out := &in.MembersGvk, &out.MembersGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNSSpec. +func (in *GNSSpec) DeepCopy() *GNSSpec { + if in == nil { + return nil + } + out := new(GNSSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GNSSvcGroup) DeepCopyInto(out *GNSSvcGroup) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNSSvcGroup. +func (in *GNSSvcGroup) DeepCopy() *GNSSvcGroup { + if in == nil { + return nil + } + out := new(GNSSvcGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GNSSvcGroup) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GNSSvcGroupList) DeepCopyInto(out *GNSSvcGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GNSSvcGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNSSvcGroupList. +func (in *GNSSvcGroupList) DeepCopy() *GNSSvcGroupList { + if in == nil { + return nil + } + out := new(GNSSvcGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GNSSvcGroupList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GNSSvcGroupNexusStatus) DeepCopyInto(out *GNSSvcGroupNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNSSvcGroupNexusStatus. +func (in *GNSSvcGroupNexusStatus) DeepCopy() *GNSSvcGroupNexusStatus { + if in == nil { + return nil + } + out := new(GNSSvcGroupNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GNSSvcGroupSpec) DeepCopyInto(out *GNSSvcGroupSpec) { + *out = *in + if in.ServicesGvk != nil { + in, out := &in.ServicesGvk, &out.ServicesGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GNSSvcGroupSpec. +func (in *GNSSvcGroupSpec) DeepCopy() *GNSSvcGroupSpec { + if in == nil { + return nil + } + out := new(GNSSvcGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Gateway) DeepCopyInto(out *Gateway) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Gateway. +func (in *Gateway) DeepCopy() *Gateway { + if in == nil { + return nil + } + out := new(Gateway) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Gateway) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfig) DeepCopyInto(out *GatewayConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfig. +func (in *GatewayConfig) DeepCopy() *GatewayConfig { + if in == nil { + return nil + } + out := new(GatewayConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GatewayConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfigAdditionalListeners) DeepCopyInto(out *GatewayConfigAdditionalListeners) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfigAdditionalListeners. +func (in *GatewayConfigAdditionalListeners) DeepCopy() *GatewayConfigAdditionalListeners { + if in == nil { + return nil + } + out := new(GatewayConfigAdditionalListeners) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GatewayConfigAdditionalListeners) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfigAdditionalListenersList) DeepCopyInto(out *GatewayConfigAdditionalListenersList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GatewayConfigAdditionalListeners, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfigAdditionalListenersList. +func (in *GatewayConfigAdditionalListenersList) DeepCopy() *GatewayConfigAdditionalListenersList { + if in == nil { + return nil + } + out := new(GatewayConfigAdditionalListenersList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GatewayConfigAdditionalListenersList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfigAdditionalListenersNexusStatus) DeepCopyInto(out *GatewayConfigAdditionalListenersNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfigAdditionalListenersNexusStatus. +func (in *GatewayConfigAdditionalListenersNexusStatus) DeepCopy() *GatewayConfigAdditionalListenersNexusStatus { + if in == nil { + return nil + } + out := new(GatewayConfigAdditionalListenersNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfigAdditionalListenersSpec) DeepCopyInto(out *GatewayConfigAdditionalListenersSpec) { + *out = *in + if in.Hosts != nil { + in, out := &in.Hosts, &out.Hosts + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.CertificateGvk != nil { + in, out := &in.CertificateGvk, &out.CertificateGvk + *out = new(Child) + **out = **in + } + if in.ListenerRoutesGvk != nil { + in, out := &in.ListenerRoutesGvk, &out.ListenerRoutesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfigAdditionalListenersSpec. +func (in *GatewayConfigAdditionalListenersSpec) DeepCopy() *GatewayConfigAdditionalListenersSpec { + if in == nil { + return nil + } + out := new(GatewayConfigAdditionalListenersSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfigList) DeepCopyInto(out *GatewayConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GatewayConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfigList. +func (in *GatewayConfigList) DeepCopy() *GatewayConfigList { + if in == nil { + return nil + } + out := new(GatewayConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GatewayConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfigListenerCertificate) DeepCopyInto(out *GatewayConfigListenerCertificate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfigListenerCertificate. +func (in *GatewayConfigListenerCertificate) DeepCopy() *GatewayConfigListenerCertificate { + if in == nil { + return nil + } + out := new(GatewayConfigListenerCertificate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GatewayConfigListenerCertificate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfigListenerCertificateList) DeepCopyInto(out *GatewayConfigListenerCertificateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GatewayConfigListenerCertificate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfigListenerCertificateList. +func (in *GatewayConfigListenerCertificateList) DeepCopy() *GatewayConfigListenerCertificateList { + if in == nil { + return nil + } + out := new(GatewayConfigListenerCertificateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GatewayConfigListenerCertificateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfigListenerCertificateNexusStatus) DeepCopyInto(out *GatewayConfigListenerCertificateNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfigListenerCertificateNexusStatus. +func (in *GatewayConfigListenerCertificateNexusStatus) DeepCopy() *GatewayConfigListenerCertificateNexusStatus { + if in == nil { + return nil + } + out := new(GatewayConfigListenerCertificateNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfigListenerCertificateSpec) DeepCopyInto(out *GatewayConfigListenerCertificateSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfigListenerCertificateSpec. +func (in *GatewayConfigListenerCertificateSpec) DeepCopy() *GatewayConfigListenerCertificateSpec { + if in == nil { + return nil + } + out := new(GatewayConfigListenerCertificateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfigListenerDestinationRoute) DeepCopyInto(out *GatewayConfigListenerDestinationRoute) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfigListenerDestinationRoute. +func (in *GatewayConfigListenerDestinationRoute) DeepCopy() *GatewayConfigListenerDestinationRoute { + if in == nil { + return nil + } + out := new(GatewayConfigListenerDestinationRoute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GatewayConfigListenerDestinationRoute) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfigListenerDestinationRouteList) DeepCopyInto(out *GatewayConfigListenerDestinationRouteList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GatewayConfigListenerDestinationRoute, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfigListenerDestinationRouteList. +func (in *GatewayConfigListenerDestinationRouteList) DeepCopy() *GatewayConfigListenerDestinationRouteList { + if in == nil { + return nil + } + out := new(GatewayConfigListenerDestinationRouteList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GatewayConfigListenerDestinationRouteList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfigListenerDestinationRouteNexusStatus) DeepCopyInto(out *GatewayConfigListenerDestinationRouteNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfigListenerDestinationRouteNexusStatus. +func (in *GatewayConfigListenerDestinationRouteNexusStatus) DeepCopy() *GatewayConfigListenerDestinationRouteNexusStatus { + if in == nil { + return nil + } + out := new(GatewayConfigListenerDestinationRouteNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfigListenerDestinationRouteSpec) DeepCopyInto(out *GatewayConfigListenerDestinationRouteSpec) { + *out = *in + if in.Paths != nil { + in, out := &in.Paths, &out.Paths + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfigListenerDestinationRouteSpec. +func (in *GatewayConfigListenerDestinationRouteSpec) DeepCopy() *GatewayConfigListenerDestinationRouteSpec { + if in == nil { + return nil + } + out := new(GatewayConfigListenerDestinationRouteSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfigNexusStatus) DeepCopyInto(out *GatewayConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfigNexusStatus. +func (in *GatewayConfigNexusStatus) DeepCopy() *GatewayConfigNexusStatus { + if in == nil { + return nil + } + out := new(GatewayConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayConfigSpec) DeepCopyInto(out *GatewayConfigSpec) { + *out = *in + if in.AdditionalListenersGvk != nil { + in, out := &in.AdditionalListenersGvk, &out.AdditionalListenersGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayConfigSpec. +func (in *GatewayConfigSpec) DeepCopy() *GatewayConfigSpec { + if in == nil { + return nil + } + out := new(GatewayConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayList) DeepCopyInto(out *GatewayList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Gateway, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayList. +func (in *GatewayList) DeepCopy() *GatewayList { + if in == nil { + return nil + } + out := new(GatewayList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GatewayList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayNexusStatus) DeepCopyInto(out *GatewayNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayNexusStatus. +func (in *GatewayNexusStatus) DeepCopy() *GatewayNexusStatus { + if in == nil { + return nil + } + out := new(GatewayNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewaySpec) DeepCopyInto(out *GatewaySpec) { + *out = *in + if in.ServicesGvk != nil { + in, out := &in.ServicesGvk, &out.ServicesGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewaySpec. +func (in *GatewaySpec) DeepCopy() *GatewaySpec { + if in == nil { + return nil + } + out := new(GatewaySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GeoDiscovery) DeepCopyInto(out *GeoDiscovery) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GeoDiscovery. +func (in *GeoDiscovery) DeepCopy() *GeoDiscovery { + if in == nil { + return nil + } + out := new(GeoDiscovery) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GeoDiscovery) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GeoDiscoveryList) DeepCopyInto(out *GeoDiscoveryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GeoDiscovery, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GeoDiscoveryList. +func (in *GeoDiscoveryList) DeepCopy() *GeoDiscoveryList { + if in == nil { + return nil + } + out := new(GeoDiscoveryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GeoDiscoveryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GeoDiscoveryNexusStatus) DeepCopyInto(out *GeoDiscoveryNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GeoDiscoveryNexusStatus. +func (in *GeoDiscoveryNexusStatus) DeepCopy() *GeoDiscoveryNexusStatus { + if in == nil { + return nil + } + out := new(GeoDiscoveryNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GeoDiscoveryRT) DeepCopyInto(out *GeoDiscoveryRT) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GeoDiscoveryRT. +func (in *GeoDiscoveryRT) DeepCopy() *GeoDiscoveryRT { + if in == nil { + return nil + } + out := new(GeoDiscoveryRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GeoDiscoveryRT) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GeoDiscoveryRTList) DeepCopyInto(out *GeoDiscoveryRTList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GeoDiscoveryRT, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GeoDiscoveryRTList. +func (in *GeoDiscoveryRTList) DeepCopy() *GeoDiscoveryRTList { + if in == nil { + return nil + } + out := new(GeoDiscoveryRTList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GeoDiscoveryRTList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GeoDiscoveryRTNexusStatus) DeepCopyInto(out *GeoDiscoveryRTNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GeoDiscoveryRTNexusStatus. +func (in *GeoDiscoveryRTNexusStatus) DeepCopy() *GeoDiscoveryRTNexusStatus { + if in == nil { + return nil + } + out := new(GeoDiscoveryRTNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GeoDiscoveryRTSpec) DeepCopyInto(out *GeoDiscoveryRTSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GeoDiscoveryRTSpec. +func (in *GeoDiscoveryRTSpec) DeepCopy() *GeoDiscoveryRTSpec { + if in == nil { + return nil + } + out := new(GeoDiscoveryRTSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GeoDiscoverySpec) DeepCopyInto(out *GeoDiscoverySpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GeoDiscoverySpec. +func (in *GeoDiscoverySpec) DeepCopy() *GeoDiscoverySpec { + if in == nil { + return nil + } + out := new(GeoDiscoverySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalNamespace) DeepCopyInto(out *GlobalNamespace) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalNamespace. +func (in *GlobalNamespace) DeepCopy() *GlobalNamespace { + if in == nil { + return nil + } + out := new(GlobalNamespace) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GlobalNamespace) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalNamespaceList) DeepCopyInto(out *GlobalNamespaceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GlobalNamespace, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalNamespaceList. +func (in *GlobalNamespaceList) DeepCopy() *GlobalNamespaceList { + if in == nil { + return nil + } + out := new(GlobalNamespaceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GlobalNamespaceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalNamespaceNexusStatus) DeepCopyInto(out *GlobalNamespaceNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalNamespaceNexusStatus. +func (in *GlobalNamespaceNexusStatus) DeepCopy() *GlobalNamespaceNexusStatus { + if in == nil { + return nil + } + out := new(GlobalNamespaceNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalNamespaceSpec) DeepCopyInto(out *GlobalNamespaceSpec) { + *out = *in + if in.GnsGvk != nil { + in, out := &in.GnsGvk, &out.GnsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalNamespaceSpec. +func (in *GlobalNamespaceSpec) DeepCopy() *GlobalNamespaceSpec { + if in == nil { + return nil + } + out := new(GlobalNamespaceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalNs) DeepCopyInto(out *GlobalNs) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalNs. +func (in *GlobalNs) DeepCopy() *GlobalNs { + if in == nil { + return nil + } + out := new(GlobalNs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GlobalNs) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalNsList) DeepCopyInto(out *GlobalNsList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GlobalNs, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalNsList. +func (in *GlobalNsList) DeepCopy() *GlobalNsList { + if in == nil { + return nil + } + out := new(GlobalNsList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GlobalNsList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalNsNexusStatus) DeepCopyInto(out *GlobalNsNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalNsNexusStatus. +func (in *GlobalNsNexusStatus) DeepCopy() *GlobalNsNexusStatus { + if in == nil { + return nil + } + out := new(GlobalNsNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalNsSpec) DeepCopyInto(out *GlobalNsSpec) { + *out = *in + if in.RoutingPoliciesGvk != nil { + in, out := &in.RoutingPoliciesGvk, &out.RoutingPoliciesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalNsSpec. +func (in *GlobalNsSpec) DeepCopy() *GlobalNsSpec { + if in == nil { + return nil + } + out := new(GlobalNsSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalRegistrationService) DeepCopyInto(out *GlobalRegistrationService) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRegistrationService. +func (in *GlobalRegistrationService) DeepCopy() *GlobalRegistrationService { + if in == nil { + return nil + } + out := new(GlobalRegistrationService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GlobalRegistrationService) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalRegistrationServiceList) DeepCopyInto(out *GlobalRegistrationServiceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GlobalRegistrationService, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRegistrationServiceList. +func (in *GlobalRegistrationServiceList) DeepCopy() *GlobalRegistrationServiceList { + if in == nil { + return nil + } + out := new(GlobalRegistrationServiceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GlobalRegistrationServiceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalRegistrationServiceNexusStatus) DeepCopyInto(out *GlobalRegistrationServiceNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRegistrationServiceNexusStatus. +func (in *GlobalRegistrationServiceNexusStatus) DeepCopy() *GlobalRegistrationServiceNexusStatus { + if in == nil { + return nil + } + out := new(GlobalRegistrationServiceNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalRegistrationServiceSpec) DeepCopyInto(out *GlobalRegistrationServiceSpec) { + *out = *in + if in.TenantsGvk != nil { + in, out := &in.TenantsGvk, &out.TenantsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.TenantTokenGvk != nil { + in, out := &in.TenantTokenGvk, &out.TenantTokenGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRegistrationServiceSpec. +func (in *GlobalRegistrationServiceSpec) DeepCopy() *GlobalRegistrationServiceSpec { + if in == nil { + return nil + } + out := new(GlobalRegistrationServiceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsAccessControlPolicy) DeepCopyInto(out *GnsAccessControlPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsAccessControlPolicy. +func (in *GnsAccessControlPolicy) DeepCopy() *GnsAccessControlPolicy { + if in == nil { + return nil + } + out := new(GnsAccessControlPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsAccessControlPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsAccessControlPolicyList) DeepCopyInto(out *GnsAccessControlPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GnsAccessControlPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsAccessControlPolicyList. +func (in *GnsAccessControlPolicyList) DeepCopy() *GnsAccessControlPolicyList { + if in == nil { + return nil + } + out := new(GnsAccessControlPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsAccessControlPolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsAccessControlPolicyNexusStatus) DeepCopyInto(out *GnsAccessControlPolicyNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsAccessControlPolicyNexusStatus. +func (in *GnsAccessControlPolicyNexusStatus) DeepCopy() *GnsAccessControlPolicyNexusStatus { + if in == nil { + return nil + } + out := new(GnsAccessControlPolicyNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsAccessControlPolicyRT) DeepCopyInto(out *GnsAccessControlPolicyRT) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsAccessControlPolicyRT. +func (in *GnsAccessControlPolicyRT) DeepCopy() *GnsAccessControlPolicyRT { + if in == nil { + return nil + } + out := new(GnsAccessControlPolicyRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsAccessControlPolicyRT) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsAccessControlPolicyRTList) DeepCopyInto(out *GnsAccessControlPolicyRTList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GnsAccessControlPolicyRT, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsAccessControlPolicyRTList. +func (in *GnsAccessControlPolicyRTList) DeepCopy() *GnsAccessControlPolicyRTList { + if in == nil { + return nil + } + out := new(GnsAccessControlPolicyRTList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsAccessControlPolicyRTList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsAccessControlPolicyRTNexusStatus) DeepCopyInto(out *GnsAccessControlPolicyRTNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsAccessControlPolicyRTNexusStatus. +func (in *GnsAccessControlPolicyRTNexusStatus) DeepCopy() *GnsAccessControlPolicyRTNexusStatus { + if in == nil { + return nil + } + out := new(GnsAccessControlPolicyRTNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsAccessControlPolicyRTSpec) DeepCopyInto(out *GnsAccessControlPolicyRTSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsAccessControlPolicyRTSpec. +func (in *GnsAccessControlPolicyRTSpec) DeepCopy() *GnsAccessControlPolicyRTSpec { + if in == nil { + return nil + } + out := new(GnsAccessControlPolicyRTSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsAccessControlPolicySpec) DeepCopyInto(out *GnsAccessControlPolicySpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsAccessControlPolicySpec. +func (in *GnsAccessControlPolicySpec) DeepCopy() *GnsAccessControlPolicySpec { + if in == nil { + return nil + } + out := new(GnsAccessControlPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsBindingRT) DeepCopyInto(out *GnsBindingRT) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsBindingRT. +func (in *GnsBindingRT) DeepCopy() *GnsBindingRT { + if in == nil { + return nil + } + out := new(GnsBindingRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsBindingRT) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsBindingRTList) DeepCopyInto(out *GnsBindingRTList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GnsBindingRT, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsBindingRTList. +func (in *GnsBindingRTList) DeepCopy() *GnsBindingRTList { + if in == nil { + return nil + } + out := new(GnsBindingRTList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsBindingRTList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsBindingRTNexusStatus) DeepCopyInto(out *GnsBindingRTNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsBindingRTNexusStatus. +func (in *GnsBindingRTNexusStatus) DeepCopy() *GnsBindingRTNexusStatus { + if in == nil { + return nil + } + out := new(GnsBindingRTNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsBindingRTSpec) DeepCopyInto(out *GnsBindingRTSpec) { + *out = *in + if in.Namespaces != nil { + in, out := &in.Namespaces, &out.Namespaces + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.GnsSvcGroupRTGvk != nil { + in, out := &in.GnsSvcGroupRTGvk, &out.GnsSvcGroupRTGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.GnsRoutingRulesGvk != nil { + in, out := &in.GnsRoutingRulesGvk, &out.GnsRoutingRulesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.GnsServiceEntryConfigGvk != nil { + in, out := &in.GnsServiceEntryConfigGvk, &out.GnsServiceEntryConfigGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsBindingRTSpec. +func (in *GnsBindingRTSpec) DeepCopy() *GnsBindingRTSpec { + if in == nil { + return nil + } + out := new(GnsBindingRTSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsEndpointsConfig) DeepCopyInto(out *GnsEndpointsConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsEndpointsConfig. +func (in *GnsEndpointsConfig) DeepCopy() *GnsEndpointsConfig { + if in == nil { + return nil + } + out := new(GnsEndpointsConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsEndpointsConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsEndpointsConfigList) DeepCopyInto(out *GnsEndpointsConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GnsEndpointsConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsEndpointsConfigList. +func (in *GnsEndpointsConfigList) DeepCopy() *GnsEndpointsConfigList { + if in == nil { + return nil + } + out := new(GnsEndpointsConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsEndpointsConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsEndpointsConfigNexusStatus) DeepCopyInto(out *GnsEndpointsConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsEndpointsConfigNexusStatus. +func (in *GnsEndpointsConfigNexusStatus) DeepCopy() *GnsEndpointsConfigNexusStatus { + if in == nil { + return nil + } + out := new(GnsEndpointsConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsEndpointsConfigSpec) DeepCopyInto(out *GnsEndpointsConfigSpec) { + *out = *in + if in.EndpointServices != nil { + in, out := &in.EndpointServices, &out.EndpointServices + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsEndpointsConfigSpec. +func (in *GnsEndpointsConfigSpec) DeepCopy() *GnsEndpointsConfigSpec { + if in == nil { + return nil + } + out := new(GnsEndpointsConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsExternalServiceConfig) DeepCopyInto(out *GnsExternalServiceConfig) { + *out = *in + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(ESLabels, len(*in)) + copy(*out, *in) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.ConfigRemote.DeepCopyInto(&out.ConfigRemote) + in.ConfigServiceDirectory.DeepCopyInto(&out.ConfigServiceDirectory) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsExternalServiceConfig. +func (in *GnsExternalServiceConfig) DeepCopy() *GnsExternalServiceConfig { + if in == nil { + return nil + } + out := new(GnsExternalServiceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsExternalServiceRemoteConfig) DeepCopyInto(out *GnsExternalServiceRemoteConfig) { + *out = *in + if in.Endpoints != nil { + in, out := &in.Endpoints, &out.Endpoints + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsExternalServiceRemoteConfig. +func (in *GnsExternalServiceRemoteConfig) DeepCopy() *GnsExternalServiceRemoteConfig { + if in == nil { + return nil + } + out := new(GnsExternalServiceRemoteConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsExternalServiceSDConfig) DeepCopyInto(out *GnsExternalServiceSDConfig) { + *out = *in + if in.ExactNameRules != nil { + in, out := &in.ExactNameRules, &out.ExactNameRules + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.RegexNameRules != nil { + in, out := &in.RegexNameRules, &out.RegexNameRules + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.LabelRules != nil { + in, out := &in.LabelRules, &out.LabelRules + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsExternalServiceSDConfig. +func (in *GnsExternalServiceSDConfig) DeepCopy() *GnsExternalServiceSDConfig { + if in == nil { + return nil + } + out := new(GnsExternalServiceSDConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsPublicServiceConfig) DeepCopyInto(out *GnsPublicServiceConfig) { + *out = *in + out.PublicDomain = in.PublicDomain + out.DnsHaPolicy = in.DnsHaPolicy + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsPublicServiceConfig. +func (in *GnsPublicServiceConfig) DeepCopy() *GnsPublicServiceConfig { + if in == nil { + return nil + } + out := new(GnsPublicServiceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsPublicServiceConfigWithId) DeepCopyInto(out *GnsPublicServiceConfigWithId) { + *out = *in + out.PublicDomain = in.PublicDomain + out.DnsHaPolicy = in.DnsHaPolicy + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsPublicServiceConfigWithId. +func (in *GnsPublicServiceConfigWithId) DeepCopy() *GnsPublicServiceConfigWithId { + if in == nil { + return nil + } + out := new(GnsPublicServiceConfigWithId) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsPublicServiceDomain) DeepCopyInto(out *GnsPublicServiceDomain) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsPublicServiceDomain. +func (in *GnsPublicServiceDomain) DeepCopy() *GnsPublicServiceDomain { + if in == nil { + return nil + } + out := new(GnsPublicServiceDomain) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsPublicServiceDomainList) DeepCopyInto(out *GnsPublicServiceDomainList) { + *out = *in + if in.Domains != nil { + in, out := &in.Domains, &out.Domains + *out = make([]GnsPublicServiceDomain, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsPublicServiceDomainList. +func (in *GnsPublicServiceDomainList) DeepCopy() *GnsPublicServiceDomainList { + if in == nil { + return nil + } + out := new(GnsPublicServiceDomainList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsPublicServiceRouteConfig) DeepCopyInto(out *GnsPublicServiceRouteConfig) { + *out = *in + if in.Paths != nil { + in, out := &in.Paths, &out.Paths + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsPublicServiceRouteConfig. +func (in *GnsPublicServiceRouteConfig) DeepCopy() *GnsPublicServiceRouteConfig { + if in == nil { + return nil + } + out := new(GnsPublicServiceRouteConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsPublicServiceRouteConfigWithID) DeepCopyInto(out *GnsPublicServiceRouteConfigWithID) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsPublicServiceRouteConfigWithID. +func (in *GnsPublicServiceRouteConfigWithID) DeepCopy() *GnsPublicServiceRouteConfigWithID { + if in == nil { + return nil + } + out := new(GnsPublicServiceRouteConfigWithID) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsPublicServiceRouteStatus) DeepCopyInto(out *GnsPublicServiceRouteStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsPublicServiceRouteStatus. +func (in *GnsPublicServiceRouteStatus) DeepCopy() *GnsPublicServiceRouteStatus { + if in == nil { + return nil + } + out := new(GnsPublicServiceRouteStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsPublicServiceStatus) DeepCopyInto(out *GnsPublicServiceStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsPublicServiceStatus. +func (in *GnsPublicServiceStatus) DeepCopy() *GnsPublicServiceStatus { + if in == nil { + return nil + } + out := new(GnsPublicServiceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsRoutingRuleConfig) DeepCopyInto(out *GnsRoutingRuleConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsRoutingRuleConfig. +func (in *GnsRoutingRuleConfig) DeepCopy() *GnsRoutingRuleConfig { + if in == nil { + return nil + } + out := new(GnsRoutingRuleConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsRoutingRuleConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsRoutingRuleConfigList) DeepCopyInto(out *GnsRoutingRuleConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GnsRoutingRuleConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsRoutingRuleConfigList. +func (in *GnsRoutingRuleConfigList) DeepCopy() *GnsRoutingRuleConfigList { + if in == nil { + return nil + } + out := new(GnsRoutingRuleConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsRoutingRuleConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsRoutingRuleConfigNexusStatus) DeepCopyInto(out *GnsRoutingRuleConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsRoutingRuleConfigNexusStatus. +func (in *GnsRoutingRuleConfigNexusStatus) DeepCopy() *GnsRoutingRuleConfigNexusStatus { + if in == nil { + return nil + } + out := new(GnsRoutingRuleConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsRoutingRuleConfigSpec) DeepCopyInto(out *GnsRoutingRuleConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsRoutingRuleConfigSpec. +func (in *GnsRoutingRuleConfigSpec) DeepCopy() *GnsRoutingRuleConfigSpec { + if in == nil { + return nil + } + out := new(GnsRoutingRuleConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSchemaViolationDiscovery) DeepCopyInto(out *GnsSchemaViolationDiscovery) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSchemaViolationDiscovery. +func (in *GnsSchemaViolationDiscovery) DeepCopy() *GnsSchemaViolationDiscovery { + if in == nil { + return nil + } + out := new(GnsSchemaViolationDiscovery) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsSchemaViolationDiscovery) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSchemaViolationDiscoveryList) DeepCopyInto(out *GnsSchemaViolationDiscoveryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GnsSchemaViolationDiscovery, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSchemaViolationDiscoveryList. +func (in *GnsSchemaViolationDiscoveryList) DeepCopy() *GnsSchemaViolationDiscoveryList { + if in == nil { + return nil + } + out := new(GnsSchemaViolationDiscoveryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsSchemaViolationDiscoveryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSchemaViolationDiscoveryNexusStatus) DeepCopyInto(out *GnsSchemaViolationDiscoveryNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSchemaViolationDiscoveryNexusStatus. +func (in *GnsSchemaViolationDiscoveryNexusStatus) DeepCopy() *GnsSchemaViolationDiscoveryNexusStatus { + if in == nil { + return nil + } + out := new(GnsSchemaViolationDiscoveryNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSchemaViolationDiscoverySpec) DeepCopyInto(out *GnsSchemaViolationDiscoverySpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSchemaViolationDiscoverySpec. +func (in *GnsSchemaViolationDiscoverySpec) DeepCopy() *GnsSchemaViolationDiscoverySpec { + if in == nil { + return nil + } + out := new(GnsSchemaViolationDiscoverySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicy) DeepCopyInto(out *GnsSegmentationPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicy. +func (in *GnsSegmentationPolicy) DeepCopy() *GnsSegmentationPolicy { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsSegmentationPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicyList) DeepCopyInto(out *GnsSegmentationPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GnsSegmentationPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicyList. +func (in *GnsSegmentationPolicyList) DeepCopy() *GnsSegmentationPolicyList { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsSegmentationPolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicyNexusStatus) DeepCopyInto(out *GnsSegmentationPolicyNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicyNexusStatus. +func (in *GnsSegmentationPolicyNexusStatus) DeepCopy() *GnsSegmentationPolicyNexusStatus { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicyNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicyRT) DeepCopyInto(out *GnsSegmentationPolicyRT) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicyRT. +func (in *GnsSegmentationPolicyRT) DeepCopy() *GnsSegmentationPolicyRT { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicyRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsSegmentationPolicyRT) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicyRTList) DeepCopyInto(out *GnsSegmentationPolicyRTList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GnsSegmentationPolicyRT, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicyRTList. +func (in *GnsSegmentationPolicyRTList) DeepCopy() *GnsSegmentationPolicyRTList { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicyRTList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsSegmentationPolicyRTList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicyRTNexusStatus) DeepCopyInto(out *GnsSegmentationPolicyRTNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicyRTNexusStatus. +func (in *GnsSegmentationPolicyRTNexusStatus) DeepCopy() *GnsSegmentationPolicyRTNexusStatus { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicyRTNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicyRTSpec) DeepCopyInto(out *GnsSegmentationPolicyRTSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicyRTSpec. +func (in *GnsSegmentationPolicyRTSpec) DeepCopy() *GnsSegmentationPolicyRTSpec { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicyRTSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSegmentationPolicySpec) DeepCopyInto(out *GnsSegmentationPolicySpec) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSegmentationPolicySpec. +func (in *GnsSegmentationPolicySpec) DeepCopy() *GnsSegmentationPolicySpec { + if in == nil { + return nil + } + out := new(GnsSegmentationPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsServiceEntryConfig) DeepCopyInto(out *GnsServiceEntryConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsServiceEntryConfig. +func (in *GnsServiceEntryConfig) DeepCopy() *GnsServiceEntryConfig { + if in == nil { + return nil + } + out := new(GnsServiceEntryConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsServiceEntryConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsServiceEntryConfigList) DeepCopyInto(out *GnsServiceEntryConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GnsServiceEntryConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsServiceEntryConfigList. +func (in *GnsServiceEntryConfigList) DeepCopy() *GnsServiceEntryConfigList { + if in == nil { + return nil + } + out := new(GnsServiceEntryConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsServiceEntryConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsServiceEntryConfigNexusStatus) DeepCopyInto(out *GnsServiceEntryConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsServiceEntryConfigNexusStatus. +func (in *GnsServiceEntryConfigNexusStatus) DeepCopy() *GnsServiceEntryConfigNexusStatus { + if in == nil { + return nil + } + out := new(GnsServiceEntryConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsServiceEntryConfigSpec) DeepCopyInto(out *GnsServiceEntryConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsServiceEntryConfigSpec. +func (in *GnsServiceEntryConfigSpec) DeepCopy() *GnsServiceEntryConfigSpec { + if in == nil { + return nil + } + out := new(GnsServiceEntryConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSvcGroupRT) DeepCopyInto(out *GnsSvcGroupRT) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSvcGroupRT. +func (in *GnsSvcGroupRT) DeepCopy() *GnsSvcGroupRT { + if in == nil { + return nil + } + out := new(GnsSvcGroupRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsSvcGroupRT) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSvcGroupRTList) DeepCopyInto(out *GnsSvcGroupRTList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GnsSvcGroupRT, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSvcGroupRTList. +func (in *GnsSvcGroupRTList) DeepCopy() *GnsSvcGroupRTList { + if in == nil { + return nil + } + out := new(GnsSvcGroupRTList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GnsSvcGroupRTList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSvcGroupRTNexusStatus) DeepCopyInto(out *GnsSvcGroupRTNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSvcGroupRTNexusStatus. +func (in *GnsSvcGroupRTNexusStatus) DeepCopy() *GnsSvcGroupRTNexusStatus { + if in == nil { + return nil + } + out := new(GnsSvcGroupRTNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnsSvcGroupRTSpec) DeepCopyInto(out *GnsSvcGroupRTSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSvcGroupRTSpec. +func (in *GnsSvcGroupRTSpec) DeepCopy() *GnsSvcGroupRTSpec { + if in == nil { + return nil + } + out := new(GnsSvcGroupRTSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnspsPublicDomain) DeepCopyInto(out *GnspsPublicDomain) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnspsPublicDomain. +func (in *GnspsPublicDomain) DeepCopy() *GnspsPublicDomain { + if in == nil { + return nil + } + out := new(GnspsPublicDomain) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GnspsdnshaPolicy) DeepCopyInto(out *GnspsdnshaPolicy) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnspsdnshaPolicy. +func (in *GnspsdnshaPolicy) DeepCopy() *GnspsdnshaPolicy { + if in == nil { + return nil + } + out := new(GnspsdnshaPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HaConfig) DeepCopyInto(out *HaConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HaConfig. +func (in *HaConfig) DeepCopy() *HaConfig { + if in == nil { + return nil + } + out := new(HaConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *HaConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HaConfigList) DeepCopyInto(out *HaConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]HaConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HaConfigList. +func (in *HaConfigList) DeepCopy() *HaConfigList { + if in == nil { + return nil + } + out := new(HaConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *HaConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HaConfigNexusStatus) DeepCopyInto(out *HaConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HaConfigNexusStatus. +func (in *HaConfigNexusStatus) DeepCopy() *HaConfigNexusStatus { + if in == nil { + return nil + } + out := new(HaConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HaConfigSpec) DeepCopyInto(out *HaConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HaConfigSpec. +func (in *HaConfigSpec) DeepCopy() *HaConfigSpec { + if in == nil { + return nil + } + out := new(HaConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HaConfigV2) DeepCopyInto(out *HaConfigV2) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HaConfigV2. +func (in *HaConfigV2) DeepCopy() *HaConfigV2 { + if in == nil { + return nil + } + out := new(HaConfigV2) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *HaConfigV2) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HaConfigV2List) DeepCopyInto(out *HaConfigV2List) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]HaConfigV2, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HaConfigV2List. +func (in *HaConfigV2List) DeepCopy() *HaConfigV2List { + if in == nil { + return nil + } + out := new(HaConfigV2List) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *HaConfigV2List) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HaConfigV2NexusStatus) DeepCopyInto(out *HaConfigV2NexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HaConfigV2NexusStatus. +func (in *HaConfigV2NexusStatus) DeepCopy() *HaConfigV2NexusStatus { + if in == nil { + return nil + } + out := new(HaConfigV2NexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HaConfigV2Spec) DeepCopyInto(out *HaConfigV2Spec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HaConfigV2Spec. +func (in *HaConfigV2Spec) DeepCopy() *HaConfigV2Spec { + if in == nil { + return nil + } + out := new(HaConfigV2Spec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HealthCheckConfigN) DeepCopyInto(out *HealthCheckConfigN) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckConfigN. +func (in *HealthCheckConfigN) DeepCopy() *HealthCheckConfigN { + if in == nil { + return nil + } + out := new(HealthCheckConfigN) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *HealthCheckConfigN) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HealthCheckConfigNList) DeepCopyInto(out *HealthCheckConfigNList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]HealthCheckConfigN, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckConfigNList. +func (in *HealthCheckConfigNList) DeepCopy() *HealthCheckConfigNList { + if in == nil { + return nil + } + out := new(HealthCheckConfigNList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *HealthCheckConfigNList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HealthCheckConfigNNexusStatus) DeepCopyInto(out *HealthCheckConfigNNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckConfigNNexusStatus. +func (in *HealthCheckConfigNNexusStatus) DeepCopy() *HealthCheckConfigNNexusStatus { + if in == nil { + return nil + } + out := new(HealthCheckConfigNNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HealthCheckConfigNSpec) DeepCopyInto(out *HealthCheckConfigNSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckConfigNSpec. +func (in *HealthCheckConfigNSpec) DeepCopy() *HealthCheckConfigNSpec { + if in == nil { + return nil + } + out := new(HealthCheckConfigNSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HostConfig) DeepCopyInto(out *HostConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostConfig. +func (in *HostConfig) DeepCopy() *HostConfig { + if in == nil { + return nil + } + out := new(HostConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *HostConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HostConfigList) DeepCopyInto(out *HostConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]HostConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostConfigList. +func (in *HostConfigList) DeepCopy() *HostConfigList { + if in == nil { + return nil + } + out := new(HostConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *HostConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HostConfigNexusStatus) DeepCopyInto(out *HostConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostConfigNexusStatus. +func (in *HostConfigNexusStatus) DeepCopy() *HostConfigNexusStatus { + if in == nil { + return nil + } + out := new(HostConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HostConfigSpec) DeepCopyInto(out *HostConfigSpec) { + *out = *in + if in.HaConfigGvk != nil { + in, out := &in.HaConfigGvk, &out.HaConfigGvk + *out = new(Child) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostConfigSpec. +func (in *HostConfigSpec) DeepCopy() *HostConfigSpec { + if in == nil { + return nil + } + out := new(HostConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HostConfigV2) DeepCopyInto(out *HostConfigV2) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostConfigV2. +func (in *HostConfigV2) DeepCopy() *HostConfigV2 { + if in == nil { + return nil + } + out := new(HostConfigV2) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *HostConfigV2) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HostConfigV2List) DeepCopyInto(out *HostConfigV2List) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]HostConfigV2, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostConfigV2List. +func (in *HostConfigV2List) DeepCopy() *HostConfigV2List { + if in == nil { + return nil + } + out := new(HostConfigV2List) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *HostConfigV2List) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HostConfigV2NexusStatus) DeepCopyInto(out *HostConfigV2NexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostConfigV2NexusStatus. +func (in *HostConfigV2NexusStatus) DeepCopy() *HostConfigV2NexusStatus { + if in == nil { + return nil + } + out := new(HostConfigV2NexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HostConfigV2Spec) DeepCopyInto(out *HostConfigV2Spec) { + *out = *in + if in.HaConfigV2Gvk != nil { + in, out := &in.HaConfigV2Gvk, &out.HaConfigV2Gvk + *out = new(Child) + **out = **in + } + if in.OutboundAuthenticationModeGvk != nil { + in, out := &in.OutboundAuthenticationModeGvk, &out.OutboundAuthenticationModeGvk + *out = new(Child) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostConfigV2Spec. +func (in *HostConfigV2Spec) DeepCopy() *HostConfigV2Spec { + if in == nil { + return nil + } + out := new(HostConfigV2Spec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InboundAuthenticationConfig) DeepCopyInto(out *InboundAuthenticationConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InboundAuthenticationConfig. +func (in *InboundAuthenticationConfig) DeepCopy() *InboundAuthenticationConfig { + if in == nil { + return nil + } + out := new(InboundAuthenticationConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InboundAuthenticationConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InboundAuthenticationConfigList) DeepCopyInto(out *InboundAuthenticationConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]InboundAuthenticationConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InboundAuthenticationConfigList. +func (in *InboundAuthenticationConfigList) DeepCopy() *InboundAuthenticationConfigList { + if in == nil { + return nil + } + out := new(InboundAuthenticationConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InboundAuthenticationConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InboundAuthenticationConfigNexusStatus) DeepCopyInto(out *InboundAuthenticationConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InboundAuthenticationConfigNexusStatus. +func (in *InboundAuthenticationConfigNexusStatus) DeepCopy() *InboundAuthenticationConfigNexusStatus { + if in == nil { + return nil + } + out := new(InboundAuthenticationConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InboundAuthenticationConfigSpec) DeepCopyInto(out *InboundAuthenticationConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InboundAuthenticationConfigSpec. +func (in *InboundAuthenticationConfigSpec) DeepCopy() *InboundAuthenticationConfigSpec { + if in == nil { + return nil + } + out := new(InboundAuthenticationConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Inventory) DeepCopyInto(out *Inventory) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Inventory. +func (in *Inventory) DeepCopy() *Inventory { + if in == nil { + return nil + } + out := new(Inventory) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Inventory) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InventoryList) DeepCopyInto(out *InventoryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Inventory, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InventoryList. +func (in *InventoryList) DeepCopy() *InventoryList { + if in == nil { + return nil + } + out := new(InventoryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InventoryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InventoryNexusStatus) DeepCopyInto(out *InventoryNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InventoryNexusStatus. +func (in *InventoryNexusStatus) DeepCopy() *InventoryNexusStatus { + if in == nil { + return nil + } + out := new(InventoryNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InventoryQueryServiceAPIArgs) DeepCopyInto(out *InventoryQueryServiceAPIArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InventoryQueryServiceAPIArgs. +func (in *InventoryQueryServiceAPIArgs) DeepCopy() *InventoryQueryServiceAPIArgs { + if in == nil { + return nil + } + out := new(InventoryQueryServiceAPIArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InventorySpec) DeepCopyInto(out *InventorySpec) { + *out = *in + if in.RegionsGvk != nil { + in, out := &in.RegionsGvk, &out.RegionsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ClustersGvk != nil { + in, out := &in.ClustersGvk, &out.ClustersGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.JobFolderGvk != nil { + in, out := &in.JobFolderGvk, &out.JobFolderGvk + *out = new(Child) + **out = **in + } + if in.ExternalDNSGvk != nil { + in, out := &in.ExternalDNSGvk, &out.ExternalDNSGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InventorySpec. +func (in *InventorySpec) DeepCopy() *InventorySpec { + if in == nil { + return nil + } + out := new(InventorySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Issuer) DeepCopyInto(out *Issuer) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Issuer. +func (in *Issuer) DeepCopy() *Issuer { + if in == nil { + return nil + } + out := new(Issuer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Issuer) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IssuerList) DeepCopyInto(out *IssuerList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Issuer, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IssuerList. +func (in *IssuerList) DeepCopy() *IssuerList { + if in == nil { + return nil + } + out := new(IssuerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IssuerList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IssuerNexusStatus) DeepCopyInto(out *IssuerNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IssuerNexusStatus. +func (in *IssuerNexusStatus) DeepCopy() *IssuerNexusStatus { + if in == nil { + return nil + } + out := new(IssuerNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IssuerSpec) DeepCopyInto(out *IssuerSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IssuerSpec. +func (in *IssuerSpec) DeepCopy() *IssuerSpec { + if in == nil { + return nil + } + out := new(IssuerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Job) DeepCopyInto(out *Job) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Job. +func (in *Job) DeepCopy() *Job { + if in == nil { + return nil + } + out := new(Job) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Job) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobConfig) DeepCopyInto(out *JobConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobConfig. +func (in *JobConfig) DeepCopy() *JobConfig { + if in == nil { + return nil + } + out := new(JobConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *JobConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobConfigFolder) DeepCopyInto(out *JobConfigFolder) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobConfigFolder. +func (in *JobConfigFolder) DeepCopy() *JobConfigFolder { + if in == nil { + return nil + } + out := new(JobConfigFolder) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *JobConfigFolder) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobConfigFolderList) DeepCopyInto(out *JobConfigFolderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]JobConfigFolder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobConfigFolderList. +func (in *JobConfigFolderList) DeepCopy() *JobConfigFolderList { + if in == nil { + return nil + } + out := new(JobConfigFolderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *JobConfigFolderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobConfigFolderNexusStatus) DeepCopyInto(out *JobConfigFolderNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobConfigFolderNexusStatus. +func (in *JobConfigFolderNexusStatus) DeepCopy() *JobConfigFolderNexusStatus { + if in == nil { + return nil + } + out := new(JobConfigFolderNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobConfigFolderSpec) DeepCopyInto(out *JobConfigFolderSpec) { + *out = *in + if in.JobConfigGvk != nil { + in, out := &in.JobConfigGvk, &out.JobConfigGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobConfigFolderSpec. +func (in *JobConfigFolderSpec) DeepCopy() *JobConfigFolderSpec { + if in == nil { + return nil + } + out := new(JobConfigFolderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobConfigList) DeepCopyInto(out *JobConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]JobConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobConfigList. +func (in *JobConfigList) DeepCopy() *JobConfigList { + if in == nil { + return nil + } + out := new(JobConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *JobConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobConfigNexusStatus) DeepCopyInto(out *JobConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobConfigNexusStatus. +func (in *JobConfigNexusStatus) DeepCopy() *JobConfigNexusStatus { + if in == nil { + return nil + } + out := new(JobConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobConfigSpec) DeepCopyInto(out *JobConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobConfigSpec. +func (in *JobConfigSpec) DeepCopy() *JobConfigSpec { + if in == nil { + return nil + } + out := new(JobConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobFolder) DeepCopyInto(out *JobFolder) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobFolder. +func (in *JobFolder) DeepCopy() *JobFolder { + if in == nil { + return nil + } + out := new(JobFolder) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *JobFolder) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobFolderList) DeepCopyInto(out *JobFolderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]JobFolder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobFolderList. +func (in *JobFolderList) DeepCopy() *JobFolderList { + if in == nil { + return nil + } + out := new(JobFolderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *JobFolderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobFolderNexusStatus) DeepCopyInto(out *JobFolderNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobFolderNexusStatus. +func (in *JobFolderNexusStatus) DeepCopy() *JobFolderNexusStatus { + if in == nil { + return nil + } + out := new(JobFolderNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobFolderSpec) DeepCopyInto(out *JobFolderSpec) { + *out = *in + if in.JobsGvk != nil { + in, out := &in.JobsGvk, &out.JobsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobFolderSpec. +func (in *JobFolderSpec) DeepCopy() *JobFolderSpec { + if in == nil { + return nil + } + out := new(JobFolderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobList) DeepCopyInto(out *JobList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Job, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobList. +func (in *JobList) DeepCopy() *JobList { + if in == nil { + return nil + } + out := new(JobList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *JobList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobNexusStatus) DeepCopyInto(out *JobNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobNexusStatus. +func (in *JobNexusStatus) DeepCopy() *JobNexusStatus { + if in == nil { + return nil + } + out := new(JobNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobSpec) DeepCopyInto(out *JobSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSpec. +func (in *JobSpec) DeepCopy() *JobSpec { + if in == nil { + return nil + } + out := new(JobSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KnativeIngress) DeepCopyInto(out *KnativeIngress) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KnativeIngress. +func (in *KnativeIngress) DeepCopy() *KnativeIngress { + if in == nil { + return nil + } + out := new(KnativeIngress) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *KnativeIngress) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KnativeIngressList) DeepCopyInto(out *KnativeIngressList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]KnativeIngress, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KnativeIngressList. +func (in *KnativeIngressList) DeepCopy() *KnativeIngressList { + if in == nil { + return nil + } + out := new(KnativeIngressList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *KnativeIngressList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KnativeIngressNexusStatus) DeepCopyInto(out *KnativeIngressNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KnativeIngressNexusStatus. +func (in *KnativeIngressNexusStatus) DeepCopy() *KnativeIngressNexusStatus { + if in == nil { + return nil + } + out := new(KnativeIngressNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KnativeIngressSpec) DeepCopyInto(out *KnativeIngressSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KnativeIngressSpec. +func (in *KnativeIngressSpec) DeepCopy() *KnativeIngressSpec { + if in == nil { + return nil + } + out := new(KnativeIngressSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LabelConfig) DeepCopyInto(out *LabelConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LabelConfig. +func (in *LabelConfig) DeepCopy() *LabelConfig { + if in == nil { + return nil + } + out := new(LabelConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LabelConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LabelConfigList) DeepCopyInto(out *LabelConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]LabelConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LabelConfigList. +func (in *LabelConfigList) DeepCopy() *LabelConfigList { + if in == nil { + return nil + } + out := new(LabelConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LabelConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LabelConfigNexusStatus) DeepCopyInto(out *LabelConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LabelConfigNexusStatus. +func (in *LabelConfigNexusStatus) DeepCopy() *LabelConfigNexusStatus { + if in == nil { + return nil + } + out := new(LabelConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LabelConfigSpec) DeepCopyInto(out *LabelConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LabelConfigSpec. +func (in *LabelConfigSpec) DeepCopy() *LabelConfigSpec { + if in == nil { + return nil + } + out := new(LabelConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Link) DeepCopyInto(out *Link) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Link. +func (in *Link) DeepCopy() *Link { + if in == nil { + return nil + } + out := new(Link) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalRegistrationService) DeepCopyInto(out *LocalRegistrationService) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalRegistrationService. +func (in *LocalRegistrationService) DeepCopy() *LocalRegistrationService { + if in == nil { + return nil + } + out := new(LocalRegistrationService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LocalRegistrationService) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalRegistrationServiceCluster) DeepCopyInto(out *LocalRegistrationServiceCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalRegistrationServiceCluster. +func (in *LocalRegistrationServiceCluster) DeepCopy() *LocalRegistrationServiceCluster { + if in == nil { + return nil + } + out := new(LocalRegistrationServiceCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LocalRegistrationServiceCluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalRegistrationServiceClusterList) DeepCopyInto(out *LocalRegistrationServiceClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]LocalRegistrationServiceCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalRegistrationServiceClusterList. +func (in *LocalRegistrationServiceClusterList) DeepCopy() *LocalRegistrationServiceClusterList { + if in == nil { + return nil + } + out := new(LocalRegistrationServiceClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LocalRegistrationServiceClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalRegistrationServiceClusterNexusStatus) DeepCopyInto(out *LocalRegistrationServiceClusterNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalRegistrationServiceClusterNexusStatus. +func (in *LocalRegistrationServiceClusterNexusStatus) DeepCopy() *LocalRegistrationServiceClusterNexusStatus { + if in == nil { + return nil + } + out := new(LocalRegistrationServiceClusterNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalRegistrationServiceClusterSpec) DeepCopyInto(out *LocalRegistrationServiceClusterSpec) { + *out = *in + if in.ResourcesGvk != nil { + in, out := &in.ResourcesGvk, &out.ResourcesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalRegistrationServiceClusterSpec. +func (in *LocalRegistrationServiceClusterSpec) DeepCopy() *LocalRegistrationServiceClusterSpec { + if in == nil { + return nil + } + out := new(LocalRegistrationServiceClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalRegistrationServiceList) DeepCopyInto(out *LocalRegistrationServiceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]LocalRegistrationService, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalRegistrationServiceList. +func (in *LocalRegistrationServiceList) DeepCopy() *LocalRegistrationServiceList { + if in == nil { + return nil + } + out := new(LocalRegistrationServiceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LocalRegistrationServiceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalRegistrationServiceNexusStatus) DeepCopyInto(out *LocalRegistrationServiceNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalRegistrationServiceNexusStatus. +func (in *LocalRegistrationServiceNexusStatus) DeepCopy() *LocalRegistrationServiceNexusStatus { + if in == nil { + return nil + } + out := new(LocalRegistrationServiceNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalRegistrationServiceResource) DeepCopyInto(out *LocalRegistrationServiceResource) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalRegistrationServiceResource. +func (in *LocalRegistrationServiceResource) DeepCopy() *LocalRegistrationServiceResource { + if in == nil { + return nil + } + out := new(LocalRegistrationServiceResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LocalRegistrationServiceResource) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalRegistrationServiceResourceList) DeepCopyInto(out *LocalRegistrationServiceResourceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]LocalRegistrationServiceResource, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalRegistrationServiceResourceList. +func (in *LocalRegistrationServiceResourceList) DeepCopy() *LocalRegistrationServiceResourceList { + if in == nil { + return nil + } + out := new(LocalRegistrationServiceResourceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LocalRegistrationServiceResourceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalRegistrationServiceResourceNexusStatus) DeepCopyInto(out *LocalRegistrationServiceResourceNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalRegistrationServiceResourceNexusStatus. +func (in *LocalRegistrationServiceResourceNexusStatus) DeepCopy() *LocalRegistrationServiceResourceNexusStatus { + if in == nil { + return nil + } + out := new(LocalRegistrationServiceResourceNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalRegistrationServiceResourceSpec) DeepCopyInto(out *LocalRegistrationServiceResourceSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalRegistrationServiceResourceSpec. +func (in *LocalRegistrationServiceResourceSpec) DeepCopy() *LocalRegistrationServiceResourceSpec { + if in == nil { + return nil + } + out := new(LocalRegistrationServiceResourceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalRegistrationServiceSpec) DeepCopyInto(out *LocalRegistrationServiceSpec) { + *out = *in + if in.ClustersGvk != nil { + in, out := &in.ClustersGvk, &out.ClustersGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.TemplateGvk != nil { + in, out := &in.TemplateGvk, &out.TemplateGvk + *out = new(Link) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalRegistrationServiceSpec. +func (in *LocalRegistrationServiceSpec) DeepCopy() *LocalRegistrationServiceSpec { + if in == nil { + return nil + } + out := new(LocalRegistrationServiceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Log) DeepCopyInto(out *Log) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Log. +func (in *Log) DeepCopy() *Log { + if in == nil { + return nil + } + out := new(Log) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Log) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogFolder) DeepCopyInto(out *LogFolder) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogFolder. +func (in *LogFolder) DeepCopy() *LogFolder { + if in == nil { + return nil + } + out := new(LogFolder) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LogFolder) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogFolderList) DeepCopyInto(out *LogFolderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]LogFolder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogFolderList. +func (in *LogFolderList) DeepCopy() *LogFolderList { + if in == nil { + return nil + } + out := new(LogFolderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LogFolderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogFolderNexusStatus) DeepCopyInto(out *LogFolderNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogFolderNexusStatus. +func (in *LogFolderNexusStatus) DeepCopy() *LogFolderNexusStatus { + if in == nil { + return nil + } + out := new(LogFolderNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogFolderSpec) DeepCopyInto(out *LogFolderSpec) { + *out = *in + if in.LogGvk != nil { + in, out := &in.LogGvk, &out.LogGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogFolderSpec. +func (in *LogFolderSpec) DeepCopy() *LogFolderSpec { + if in == nil { + return nil + } + out := new(LogFolderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogList) DeepCopyInto(out *LogList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Log, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogList. +func (in *LogList) DeepCopy() *LogList { + if in == nil { + return nil + } + out := new(LogList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LogList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogNexusStatus) DeepCopyInto(out *LogNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogNexusStatus. +func (in *LogNexusStatus) DeepCopy() *LogNexusStatus { + if in == nil { + return nil + } + out := new(LogNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogSpec) DeepCopyInto(out *LogSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogSpec. +func (in *LogSpec) DeepCopy() *LogSpec { + if in == nil { + return nil + } + out := new(LogSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MetricMonitor) DeepCopyInto(out *MetricMonitor) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricMonitor. +func (in *MetricMonitor) DeepCopy() *MetricMonitor { + if in == nil { + return nil + } + out := new(MetricMonitor) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MetricMonitor) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MetricMonitorList) DeepCopyInto(out *MetricMonitorList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MetricMonitor, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricMonitorList. +func (in *MetricMonitorList) DeepCopy() *MetricMonitorList { + if in == nil { + return nil + } + out := new(MetricMonitorList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MetricMonitorList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MetricMonitorNexusStatus) DeepCopyInto(out *MetricMonitorNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricMonitorNexusStatus. +func (in *MetricMonitorNexusStatus) DeepCopy() *MetricMonitorNexusStatus { + if in == nil { + return nil + } + out := new(MetricMonitorNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MetricMonitorSpec) DeepCopyInto(out *MetricMonitorSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricMonitorSpec. +func (in *MetricMonitorSpec) DeepCopy() *MetricMonitorSpec { + if in == nil { + return nil + } + out := new(MetricMonitorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkAttachmentDefinition) DeepCopyInto(out *NetworkAttachmentDefinition) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkAttachmentDefinition. +func (in *NetworkAttachmentDefinition) DeepCopy() *NetworkAttachmentDefinition { + if in == nil { + return nil + } + out := new(NetworkAttachmentDefinition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkAttachmentDefinition) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkAttachmentDefinitionConfig) DeepCopyInto(out *NetworkAttachmentDefinitionConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkAttachmentDefinitionConfig. +func (in *NetworkAttachmentDefinitionConfig) DeepCopy() *NetworkAttachmentDefinitionConfig { + if in == nil { + return nil + } + out := new(NetworkAttachmentDefinitionConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkAttachmentDefinitionConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkAttachmentDefinitionConfigList) DeepCopyInto(out *NetworkAttachmentDefinitionConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NetworkAttachmentDefinitionConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkAttachmentDefinitionConfigList. +func (in *NetworkAttachmentDefinitionConfigList) DeepCopy() *NetworkAttachmentDefinitionConfigList { + if in == nil { + return nil + } + out := new(NetworkAttachmentDefinitionConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkAttachmentDefinitionConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkAttachmentDefinitionConfigNexusStatus) DeepCopyInto(out *NetworkAttachmentDefinitionConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkAttachmentDefinitionConfigNexusStatus. +func (in *NetworkAttachmentDefinitionConfigNexusStatus) DeepCopy() *NetworkAttachmentDefinitionConfigNexusStatus { + if in == nil { + return nil + } + out := new(NetworkAttachmentDefinitionConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkAttachmentDefinitionConfigSpec) DeepCopyInto(out *NetworkAttachmentDefinitionConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkAttachmentDefinitionConfigSpec. +func (in *NetworkAttachmentDefinitionConfigSpec) DeepCopy() *NetworkAttachmentDefinitionConfigSpec { + if in == nil { + return nil + } + out := new(NetworkAttachmentDefinitionConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkAttachmentDefinitionList) DeepCopyInto(out *NetworkAttachmentDefinitionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NetworkAttachmentDefinition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkAttachmentDefinitionList. +func (in *NetworkAttachmentDefinitionList) DeepCopy() *NetworkAttachmentDefinitionList { + if in == nil { + return nil + } + out := new(NetworkAttachmentDefinitionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkAttachmentDefinitionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkAttachmentDefinitionNexusStatus) DeepCopyInto(out *NetworkAttachmentDefinitionNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkAttachmentDefinitionNexusStatus. +func (in *NetworkAttachmentDefinitionNexusStatus) DeepCopy() *NetworkAttachmentDefinitionNexusStatus { + if in == nil { + return nil + } + out := new(NetworkAttachmentDefinitionNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkAttachmentDefinitionSpec) DeepCopyInto(out *NetworkAttachmentDefinitionSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkAttachmentDefinitionSpec. +func (in *NetworkAttachmentDefinitionSpec) DeepCopy() *NetworkAttachmentDefinitionSpec { + if in == nil { + return nil + } + out := new(NetworkAttachmentDefinitionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NexusNode) DeepCopyInto(out *NexusNode) { + *out = *in + out.ID = in.ID + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NexusNode. +func (in *NexusNode) DeepCopy() *NexusNode { + if in == nil { + return nil + } + out := new(NexusNode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NexusStatus) DeepCopyInto(out *NexusStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NexusStatus. +func (in *NexusStatus) DeepCopy() *NexusStatus { + if in == nil { + return nil + } + out := new(NexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Node) DeepCopyInto(out *Node) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Node. +func (in *Node) DeepCopy() *Node { + if in == nil { + return nil + } + out := new(Node) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Node) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeDefinition) DeepCopyInto(out *NodeDefinition) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDefinition. +func (in *NodeDefinition) DeepCopy() *NodeDefinition { + if in == nil { + return nil + } + out := new(NodeDefinition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NodeDefinition) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeDefinitionList) DeepCopyInto(out *NodeDefinitionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NodeDefinition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDefinitionList. +func (in *NodeDefinitionList) DeepCopy() *NodeDefinitionList { + if in == nil { + return nil + } + out := new(NodeDefinitionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NodeDefinitionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeDefinitionNexusStatus) DeepCopyInto(out *NodeDefinitionNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDefinitionNexusStatus. +func (in *NodeDefinitionNexusStatus) DeepCopy() *NodeDefinitionNexusStatus { + if in == nil { + return nil + } + out := new(NodeDefinitionNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeDefinitionSpec) DeepCopyInto(out *NodeDefinitionSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDefinitionSpec. +func (in *NodeDefinitionSpec) DeepCopy() *NodeDefinitionSpec { + if in == nil { + return nil + } + out := new(NodeDefinitionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeFolder) DeepCopyInto(out *NodeFolder) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeFolder. +func (in *NodeFolder) DeepCopy() *NodeFolder { + if in == nil { + return nil + } + out := new(NodeFolder) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NodeFolder) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeFolderCluster) DeepCopyInto(out *NodeFolderCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeFolderCluster. +func (in *NodeFolderCluster) DeepCopy() *NodeFolderCluster { + if in == nil { + return nil + } + out := new(NodeFolderCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NodeFolderCluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeFolderClusterList) DeepCopyInto(out *NodeFolderClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NodeFolderCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeFolderClusterList. +func (in *NodeFolderClusterList) DeepCopy() *NodeFolderClusterList { + if in == nil { + return nil + } + out := new(NodeFolderClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NodeFolderClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeFolderClusterNexusStatus) DeepCopyInto(out *NodeFolderClusterNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeFolderClusterNexusStatus. +func (in *NodeFolderClusterNexusStatus) DeepCopy() *NodeFolderClusterNexusStatus { + if in == nil { + return nil + } + out := new(NodeFolderClusterNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeFolderList) DeepCopyInto(out *NodeFolderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NodeFolder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeFolderList. +func (in *NodeFolderList) DeepCopy() *NodeFolderList { + if in == nil { + return nil + } + out := new(NodeFolderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NodeFolderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeFolderNexusStatus) DeepCopyInto(out *NodeFolderNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeFolderNexusStatus. +func (in *NodeFolderNexusStatus) DeepCopy() *NodeFolderNexusStatus { + if in == nil { + return nil + } + out := new(NodeFolderNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeFolderSpec) DeepCopyInto(out *NodeFolderSpec) { + *out = *in + if in.ClustersGvk != nil { + in, out := &in.ClustersGvk, &out.ClustersGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeFolderSpec. +func (in *NodeFolderSpec) DeepCopy() *NodeFolderSpec { + if in == nil { + return nil + } + out := new(NodeFolderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeGroup) DeepCopyInto(out *NodeGroup) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeGroup. +func (in *NodeGroup) DeepCopy() *NodeGroup { + if in == nil { + return nil + } + out := new(NodeGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NodeGroup) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeGroupList) DeepCopyInto(out *NodeGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NodeGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeGroupList. +func (in *NodeGroupList) DeepCopy() *NodeGroupList { + if in == nil { + return nil + } + out := new(NodeGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NodeGroupList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeGroupNexusStatus) DeepCopyInto(out *NodeGroupNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeGroupNexusStatus. +func (in *NodeGroupNexusStatus) DeepCopy() *NodeGroupNexusStatus { + if in == nil { + return nil + } + out := new(NodeGroupNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeGroupSpec) DeepCopyInto(out *NodeGroupSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeGroupSpec. +func (in *NodeGroupSpec) DeepCopy() *NodeGroupSpec { + if in == nil { + return nil + } + out := new(NodeGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeList) DeepCopyInto(out *NodeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Node, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeList. +func (in *NodeList) DeepCopy() *NodeList { + if in == nil { + return nil + } + out := new(NodeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NodeList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeNexusStatus) DeepCopyInto(out *NodeNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeNexusStatus. +func (in *NodeNexusStatus) DeepCopy() *NodeNexusStatus { + if in == nil { + return nil + } + out := new(NodeNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeSpec) DeepCopyInto(out *NodeSpec) { + *out = *in + if in.StatusGvk != nil { + in, out := &in.StatusGvk, &out.StatusGvk + *out = new(Child) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeSpec. +func (in *NodeSpec) DeepCopy() *NodeSpec { + if in == nil { + return nil + } + out := new(NodeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeStatus) DeepCopyInto(out *NodeStatus) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeStatus. +func (in *NodeStatus) DeepCopy() *NodeStatus { + if in == nil { + return nil + } + out := new(NodeStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NodeStatus) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeStatusList) DeepCopyInto(out *NodeStatusList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NodeStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeStatusList. +func (in *NodeStatusList) DeepCopy() *NodeStatusList { + if in == nil { + return nil + } + out := new(NodeStatusList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NodeStatusList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeStatusNexusStatus) DeepCopyInto(out *NodeStatusNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeStatusNexusStatus. +func (in *NodeStatusNexusStatus) DeepCopy() *NodeStatusNexusStatus { + if in == nil { + return nil + } + out := new(NodeStatusNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeStatusSpec) DeepCopyInto(out *NodeStatusSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeStatusSpec. +func (in *NodeStatusSpec) DeepCopy() *NodeStatusSpec { + if in == nil { + return nil + } + out := new(NodeStatusSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeTemplate) DeepCopyInto(out *NodeTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeTemplate. +func (in *NodeTemplate) DeepCopy() *NodeTemplate { + if in == nil { + return nil + } + out := new(NodeTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NodeTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeTemplateList) DeepCopyInto(out *NodeTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NodeTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeTemplateList. +func (in *NodeTemplateList) DeepCopy() *NodeTemplateList { + if in == nil { + return nil + } + out := new(NodeTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NodeTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeTemplateNexusStatus) DeepCopyInto(out *NodeTemplateNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeTemplateNexusStatus. +func (in *NodeTemplateNexusStatus) DeepCopy() *NodeTemplateNexusStatus { + if in == nil { + return nil + } + out := new(NodeTemplateNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeTemplateSpec) DeepCopyInto(out *NodeTemplateSpec) { + *out = *in + if in.DefinitionVersionsGvk != nil { + in, out := &in.DefinitionVersionsGvk, &out.DefinitionVersionsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeTemplateSpec. +func (in *NodeTemplateSpec) DeepCopy() *NodeTemplateSpec { + if in == nil { + return nil + } + out := new(NodeTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OutboundAuthenticationMode) DeepCopyInto(out *OutboundAuthenticationMode) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OutboundAuthenticationMode. +func (in *OutboundAuthenticationMode) DeepCopy() *OutboundAuthenticationMode { + if in == nil { + return nil + } + out := new(OutboundAuthenticationMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OutboundAuthenticationMode) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OutboundAuthenticationModeList) DeepCopyInto(out *OutboundAuthenticationModeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]OutboundAuthenticationMode, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OutboundAuthenticationModeList. +func (in *OutboundAuthenticationModeList) DeepCopy() *OutboundAuthenticationModeList { + if in == nil { + return nil + } + out := new(OutboundAuthenticationModeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OutboundAuthenticationModeList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OutboundAuthenticationModeNexusStatus) DeepCopyInto(out *OutboundAuthenticationModeNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OutboundAuthenticationModeNexusStatus. +func (in *OutboundAuthenticationModeNexusStatus) DeepCopy() *OutboundAuthenticationModeNexusStatus { + if in == nil { + return nil + } + out := new(OutboundAuthenticationModeNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OutboundAuthenticationModeSpec) DeepCopyInto(out *OutboundAuthenticationModeSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OutboundAuthenticationModeSpec. +func (in *OutboundAuthenticationModeSpec) DeepCopy() *OutboundAuthenticationModeSpec { + if in == nil { + return nil + } + out := new(OutboundAuthenticationModeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PeerAuthentication) DeepCopyInto(out *PeerAuthentication) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeerAuthentication. +func (in *PeerAuthentication) DeepCopy() *PeerAuthentication { + if in == nil { + return nil + } + out := new(PeerAuthentication) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PeerAuthentication) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PeerAuthenticationList) DeepCopyInto(out *PeerAuthenticationList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PeerAuthentication, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeerAuthenticationList. +func (in *PeerAuthenticationList) DeepCopy() *PeerAuthenticationList { + if in == nil { + return nil + } + out := new(PeerAuthenticationList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PeerAuthenticationList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PeerAuthenticationNexusStatus) DeepCopyInto(out *PeerAuthenticationNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeerAuthenticationNexusStatus. +func (in *PeerAuthenticationNexusStatus) DeepCopy() *PeerAuthenticationNexusStatus { + if in == nil { + return nil + } + out := new(PeerAuthenticationNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PeerAuthenticationSpec) DeepCopyInto(out *PeerAuthenticationSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeerAuthenticationSpec. +func (in *PeerAuthenticationSpec) DeepCopy() *PeerAuthenticationSpec { + if in == nil { + return nil + } + out := new(PeerAuthenticationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PiiDiscovery) DeepCopyInto(out *PiiDiscovery) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PiiDiscovery. +func (in *PiiDiscovery) DeepCopy() *PiiDiscovery { + if in == nil { + return nil + } + out := new(PiiDiscovery) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PiiDiscovery) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PiiDiscoveryList) DeepCopyInto(out *PiiDiscoveryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PiiDiscovery, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PiiDiscoveryList. +func (in *PiiDiscoveryList) DeepCopy() *PiiDiscoveryList { + if in == nil { + return nil + } + out := new(PiiDiscoveryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PiiDiscoveryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PiiDiscoveryNexusStatus) DeepCopyInto(out *PiiDiscoveryNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PiiDiscoveryNexusStatus. +func (in *PiiDiscoveryNexusStatus) DeepCopy() *PiiDiscoveryNexusStatus { + if in == nil { + return nil + } + out := new(PiiDiscoveryNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PiiDiscoveryRT) DeepCopyInto(out *PiiDiscoveryRT) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PiiDiscoveryRT. +func (in *PiiDiscoveryRT) DeepCopy() *PiiDiscoveryRT { + if in == nil { + return nil + } + out := new(PiiDiscoveryRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PiiDiscoveryRT) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PiiDiscoveryRTList) DeepCopyInto(out *PiiDiscoveryRTList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PiiDiscoveryRT, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PiiDiscoveryRTList. +func (in *PiiDiscoveryRTList) DeepCopy() *PiiDiscoveryRTList { + if in == nil { + return nil + } + out := new(PiiDiscoveryRTList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PiiDiscoveryRTList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PiiDiscoveryRTNexusStatus) DeepCopyInto(out *PiiDiscoveryRTNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PiiDiscoveryRTNexusStatus. +func (in *PiiDiscoveryRTNexusStatus) DeepCopy() *PiiDiscoveryRTNexusStatus { + if in == nil { + return nil + } + out := new(PiiDiscoveryRTNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PiiDiscoveryRTSpec) DeepCopyInto(out *PiiDiscoveryRTSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PiiDiscoveryRTSpec. +func (in *PiiDiscoveryRTSpec) DeepCopy() *PiiDiscoveryRTSpec { + if in == nil { + return nil + } + out := new(PiiDiscoveryRTSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PiiDiscoverySpec) DeepCopyInto(out *PiiDiscoverySpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PiiDiscoverySpec. +func (in *PiiDiscoverySpec) DeepCopy() *PiiDiscoverySpec { + if in == nil { + return nil + } + out := new(PiiDiscoverySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyAction) DeepCopyInto(out *PolicyAction) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyAction. +func (in *PolicyAction) DeepCopy() *PolicyAction { + if in == nil { + return nil + } + out := new(PolicyAction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyActions) DeepCopyInto(out *PolicyActions) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyActions. +func (in *PolicyActions) DeepCopy() *PolicyActions { + if in == nil { + return nil + } + out := new(PolicyActions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyConfig) DeepCopyInto(out *PolicyConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyConfig. +func (in *PolicyConfig) DeepCopy() *PolicyConfig { + if in == nil { + return nil + } + out := new(PolicyConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PolicyConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyConfigList) DeepCopyInto(out *PolicyConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PolicyConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyConfigList. +func (in *PolicyConfigList) DeepCopy() *PolicyConfigList { + if in == nil { + return nil + } + out := new(PolicyConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PolicyConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyConfigNexusStatus) DeepCopyInto(out *PolicyConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyConfigNexusStatus. +func (in *PolicyConfigNexusStatus) DeepCopy() *PolicyConfigNexusStatus { + if in == nil { + return nil + } + out := new(PolicyConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyConfigSpec) DeepCopyInto(out *PolicyConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyConfigSpec. +func (in *PolicyConfigSpec) DeepCopy() *PolicyConfigSpec { + if in == nil { + return nil + } + out := new(PolicyConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyTemplate) DeepCopyInto(out *PolicyTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyTemplate. +func (in *PolicyTemplate) DeepCopy() *PolicyTemplate { + if in == nil { + return nil + } + out := new(PolicyTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PolicyTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyTemplateList) DeepCopyInto(out *PolicyTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PolicyTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyTemplateList. +func (in *PolicyTemplateList) DeepCopy() *PolicyTemplateList { + if in == nil { + return nil + } + out := new(PolicyTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PolicyTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyTemplateNexusStatus) DeepCopyInto(out *PolicyTemplateNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyTemplateNexusStatus. +func (in *PolicyTemplateNexusStatus) DeepCopy() *PolicyTemplateNexusStatus { + if in == nil { + return nil + } + out := new(PolicyTemplateNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgrade) DeepCopyInto(out *ProgressiveUpgrade) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgrade. +func (in *ProgressiveUpgrade) DeepCopy() *ProgressiveUpgrade { + if in == nil { + return nil + } + out := new(ProgressiveUpgrade) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProgressiveUpgrade) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeConfig) DeepCopyInto(out *ProgressiveUpgradeConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeConfig. +func (in *ProgressiveUpgradeConfig) DeepCopy() *ProgressiveUpgradeConfig { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProgressiveUpgradeConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeConfigList) DeepCopyInto(out *ProgressiveUpgradeConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ProgressiveUpgradeConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeConfigList. +func (in *ProgressiveUpgradeConfigList) DeepCopy() *ProgressiveUpgradeConfigList { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProgressiveUpgradeConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeConfigNexusStatus) DeepCopyInto(out *ProgressiveUpgradeConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeConfigNexusStatus. +func (in *ProgressiveUpgradeConfigNexusStatus) DeepCopy() *ProgressiveUpgradeConfigNexusStatus { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeConfigSpec) DeepCopyInto(out *ProgressiveUpgradeConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeConfigSpec. +func (in *ProgressiveUpgradeConfigSpec) DeepCopy() *ProgressiveUpgradeConfigSpec { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeFolder) DeepCopyInto(out *ProgressiveUpgradeFolder) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeFolder. +func (in *ProgressiveUpgradeFolder) DeepCopy() *ProgressiveUpgradeFolder { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeFolder) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProgressiveUpgradeFolder) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeFolderList) DeepCopyInto(out *ProgressiveUpgradeFolderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ProgressiveUpgradeFolder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeFolderList. +func (in *ProgressiveUpgradeFolderList) DeepCopy() *ProgressiveUpgradeFolderList { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeFolderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProgressiveUpgradeFolderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeFolderNexusStatus) DeepCopyInto(out *ProgressiveUpgradeFolderNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeFolderNexusStatus. +func (in *ProgressiveUpgradeFolderNexusStatus) DeepCopy() *ProgressiveUpgradeFolderNexusStatus { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeFolderNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeFolderSpec) DeepCopyInto(out *ProgressiveUpgradeFolderSpec) { + *out = *in + if in.UpgradesGvk != nil { + in, out := &in.UpgradesGvk, &out.UpgradesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeFolderSpec. +func (in *ProgressiveUpgradeFolderSpec) DeepCopy() *ProgressiveUpgradeFolderSpec { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeFolderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeList) DeepCopyInto(out *ProgressiveUpgradeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ProgressiveUpgrade, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeList. +func (in *ProgressiveUpgradeList) DeepCopy() *ProgressiveUpgradeList { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProgressiveUpgradeList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeNexusStatus) DeepCopyInto(out *ProgressiveUpgradeNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeNexusStatus. +func (in *ProgressiveUpgradeNexusStatus) DeepCopy() *ProgressiveUpgradeNexusStatus { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeRuntime) DeepCopyInto(out *ProgressiveUpgradeRuntime) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeRuntime. +func (in *ProgressiveUpgradeRuntime) DeepCopy() *ProgressiveUpgradeRuntime { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeRuntime) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProgressiveUpgradeRuntime) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeRuntimeList) DeepCopyInto(out *ProgressiveUpgradeRuntimeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ProgressiveUpgradeRuntime, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeRuntimeList. +func (in *ProgressiveUpgradeRuntimeList) DeepCopy() *ProgressiveUpgradeRuntimeList { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeRuntimeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProgressiveUpgradeRuntimeList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeRuntimeNexusStatus) DeepCopyInto(out *ProgressiveUpgradeRuntimeNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeRuntimeNexusStatus. +func (in *ProgressiveUpgradeRuntimeNexusStatus) DeepCopy() *ProgressiveUpgradeRuntimeNexusStatus { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeRuntimeNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeRuntimeSpec) DeepCopyInto(out *ProgressiveUpgradeRuntimeSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeRuntimeSpec. +func (in *ProgressiveUpgradeRuntimeSpec) DeepCopy() *ProgressiveUpgradeRuntimeSpec { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeRuntimeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProgressiveUpgradeSpec) DeepCopyInto(out *ProgressiveUpgradeSpec) { + *out = *in + if in.UpgradeGvk != nil { + in, out := &in.UpgradeGvk, &out.UpgradeGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProgressiveUpgradeSpec. +func (in *ProgressiveUpgradeSpec) DeepCopy() *ProgressiveUpgradeSpec { + if in == nil { + return nil + } + out := new(ProgressiveUpgradeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Project) DeepCopyInto(out *Project) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Project. +func (in *Project) DeepCopy() *Project { + if in == nil { + return nil + } + out := new(Project) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Project) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectClusterInventoryCountArgs) DeepCopyInto(out *ProjectClusterInventoryCountArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectClusterInventoryCountArgs. +func (in *ProjectClusterInventoryCountArgs) DeepCopy() *ProjectClusterInventoryCountArgs { + if in == nil { + return nil + } + out := new(ProjectClusterInventoryCountArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectConfig) DeepCopyInto(out *ProjectConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectConfig. +func (in *ProjectConfig) DeepCopy() *ProjectConfig { + if in == nil { + return nil + } + out := new(ProjectConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProjectConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectConfigList) DeepCopyInto(out *ProjectConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ProjectConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectConfigList. +func (in *ProjectConfigList) DeepCopy() *ProjectConfigList { + if in == nil { + return nil + } + out := new(ProjectConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProjectConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectConfigNexusStatus) DeepCopyInto(out *ProjectConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectConfigNexusStatus. +func (in *ProjectConfigNexusStatus) DeepCopy() *ProjectConfigNexusStatus { + if in == nil { + return nil + } + out := new(ProjectConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectConfigSpec) DeepCopyInto(out *ProjectConfigSpec) { + *out = *in + if in.CertificateAuthoritiesGvk != nil { + in, out := &in.CertificateAuthoritiesGvk, &out.CertificateAuthoritiesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SvcGroupsGvk != nil { + in, out := &in.SvcGroupsGvk, &out.SvcGroupsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.GnsGvk != nil { + in, out := &in.GnsGvk, &out.GnsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PolicyConfigsGvk != nil { + in, out := &in.PolicyConfigsGvk, &out.PolicyConfigsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.TemplateGroupsGvk != nil { + in, out := &in.TemplateGroupsGvk, &out.TemplateGroupsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.CertificatesGvk != nil { + in, out := &in.CertificatesGvk, &out.CertificatesGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ExternalAccountsGvk != nil { + in, out := &in.ExternalAccountsGvk, &out.ExternalAccountsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ExternalDNSGvk != nil { + in, out := &in.ExternalDNSGvk, &out.ExternalDNSGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AutoscalersGvk != nil { + in, out := &in.AutoscalersGvk, &out.AutoscalersGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ClustersGvk != nil { + in, out := &in.ClustersGvk, &out.ClustersGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceLevelObjectivesGvk != nil { + in, out := &in.ServiceLevelObjectivesGvk, &out.ServiceLevelObjectivesGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectConfigSpec. +func (in *ProjectConfigSpec) DeepCopy() *ProjectConfigSpec { + if in == nil { + return nil + } + out := new(ProjectConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectInventory) DeepCopyInto(out *ProjectInventory) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectInventory. +func (in *ProjectInventory) DeepCopy() *ProjectInventory { + if in == nil { + return nil + } + out := new(ProjectInventory) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProjectInventory) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectInventoryList) DeepCopyInto(out *ProjectInventoryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ProjectInventory, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectInventoryList. +func (in *ProjectInventoryList) DeepCopy() *ProjectInventoryList { + if in == nil { + return nil + } + out := new(ProjectInventoryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProjectInventoryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectInventoryNexusStatus) DeepCopyInto(out *ProjectInventoryNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectInventoryNexusStatus. +func (in *ProjectInventoryNexusStatus) DeepCopy() *ProjectInventoryNexusStatus { + if in == nil { + return nil + } + out := new(ProjectInventoryNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectInventorySpec) DeepCopyInto(out *ProjectInventorySpec) { + *out = *in + if in.ClustersGvk != nil { + in, out := &in.ClustersGvk, &out.ClustersGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ExternalDNSGvk != nil { + in, out := &in.ExternalDNSGvk, &out.ExternalDNSGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.JobsGvk != nil { + in, out := &in.JobsGvk, &out.JobsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectInventorySpec. +func (in *ProjectInventorySpec) DeepCopy() *ProjectInventorySpec { + if in == nil { + return nil + } + out := new(ProjectInventorySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectList) DeepCopyInto(out *ProjectList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Project, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectList. +func (in *ProjectList) DeepCopy() *ProjectList { + if in == nil { + return nil + } + out := new(ProjectList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProjectList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectNexusStatus) DeepCopyInto(out *ProjectNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNexusStatus. +func (in *ProjectNexusStatus) DeepCopy() *ProjectNexusStatus { + if in == nil { + return nil + } + out := new(ProjectNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectQuery) DeepCopyInto(out *ProjectQuery) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectQuery. +func (in *ProjectQuery) DeepCopy() *ProjectQuery { + if in == nil { + return nil + } + out := new(ProjectQuery) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProjectQuery) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectQueryDetailArgs) DeepCopyInto(out *ProjectQueryDetailArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectQueryDetailArgs. +func (in *ProjectQueryDetailArgs) DeepCopy() *ProjectQueryDetailArgs { + if in == nil { + return nil + } + out := new(ProjectQueryDetailArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectQueryLinechartArgs) DeepCopyInto(out *ProjectQueryLinechartArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectQueryLinechartArgs. +func (in *ProjectQueryLinechartArgs) DeepCopy() *ProjectQueryLinechartArgs { + if in == nil { + return nil + } + out := new(ProjectQueryLinechartArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectQueryList) DeepCopyInto(out *ProjectQueryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ProjectQuery, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectQueryList. +func (in *ProjectQueryList) DeepCopy() *ProjectQueryList { + if in == nil { + return nil + } + out := new(ProjectQueryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProjectQueryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectQueryListArgs) DeepCopyInto(out *ProjectQueryListArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectQueryListArgs. +func (in *ProjectQueryListArgs) DeepCopy() *ProjectQueryListArgs { + if in == nil { + return nil + } + out := new(ProjectQueryListArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectQueryLogsArgs) DeepCopyInto(out *ProjectQueryLogsArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectQueryLogsArgs. +func (in *ProjectQueryLogsArgs) DeepCopy() *ProjectQueryLogsArgs { + if in == nil { + return nil + } + out := new(ProjectQueryLogsArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectQueryNexusStatus) DeepCopyInto(out *ProjectQueryNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectQueryNexusStatus. +func (in *ProjectQueryNexusStatus) DeepCopy() *ProjectQueryNexusStatus { + if in == nil { + return nil + } + out := new(ProjectQueryNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectQueryNodeTSArgs) DeepCopyInto(out *ProjectQueryNodeTSArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectQueryNodeTSArgs. +func (in *ProjectQueryNodeTSArgs) DeepCopy() *ProjectQueryNodeTSArgs { + if in == nil { + return nil + } + out := new(ProjectQueryNodeTSArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectQueryStatsArgs) DeepCopyInto(out *ProjectQueryStatsArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectQueryStatsArgs. +func (in *ProjectQueryStatsArgs) DeepCopy() *ProjectQueryStatsArgs { + if in == nil { + return nil + } + out := new(ProjectQueryStatsArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectQueryTopNArgs) DeepCopyInto(out *ProjectQueryTopNArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectQueryTopNArgs. +func (in *ProjectQueryTopNArgs) DeepCopy() *ProjectQueryTopNArgs { + if in == nil { + return nil + } + out := new(ProjectQueryTopNArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectRiskTrackerArgs) DeepCopyInto(out *ProjectRiskTrackerArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectRiskTrackerArgs. +func (in *ProjectRiskTrackerArgs) DeepCopy() *ProjectRiskTrackerArgs { + if in == nil { + return nil + } + out := new(ProjectRiskTrackerArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectRiskTrackerDetailArgs) DeepCopyInto(out *ProjectRiskTrackerDetailArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectRiskTrackerDetailArgs. +func (in *ProjectRiskTrackerDetailArgs) DeepCopy() *ProjectRiskTrackerDetailArgs { + if in == nil { + return nil + } + out := new(ProjectRiskTrackerDetailArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectSpec) DeepCopyInto(out *ProjectSpec) { + *out = *in + if in.ConfigGvk != nil { + in, out := &in.ConfigGvk, &out.ConfigGvk + *out = new(Child) + **out = **in + } + if in.InventoryGvk != nil { + in, out := &in.InventoryGvk, &out.InventoryGvk + *out = new(Child) + **out = **in + } + if in.QueryGvk != nil { + in, out := &in.QueryGvk, &out.QueryGvk + *out = new(Child) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectSpec. +func (in *ProjectSpec) DeepCopy() *ProjectSpec { + if in == nil { + return nil + } + out := new(ProjectSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicServiceConfig) DeepCopyInto(out *PublicServiceConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicServiceConfig. +func (in *PublicServiceConfig) DeepCopy() *PublicServiceConfig { + if in == nil { + return nil + } + out := new(PublicServiceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PublicServiceConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicServiceConfigList) DeepCopyInto(out *PublicServiceConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PublicServiceConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicServiceConfigList. +func (in *PublicServiceConfigList) DeepCopy() *PublicServiceConfigList { + if in == nil { + return nil + } + out := new(PublicServiceConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PublicServiceConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicServiceConfigNexusStatus) DeepCopyInto(out *PublicServiceConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicServiceConfigNexusStatus. +func (in *PublicServiceConfigNexusStatus) DeepCopy() *PublicServiceConfigNexusStatus { + if in == nil { + return nil + } + out := new(PublicServiceConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicServiceConfigSpec) DeepCopyInto(out *PublicServiceConfigSpec) { + *out = *in + if in.RoutingConfigsGvk != nil { + in, out := &in.RoutingConfigsGvk, &out.RoutingConfigsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ExternalDNSGvk != nil { + in, out := &in.ExternalDNSGvk, &out.ExternalDNSGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.CertificatesGvk != nil { + in, out := &in.CertificatesGvk, &out.CertificatesGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.HealthChecksGvk != nil { + in, out := &in.HealthChecksGvk, &out.HealthChecksGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicServiceConfigSpec. +func (in *PublicServiceConfigSpec) DeepCopy() *PublicServiceConfigSpec { + if in == nil { + return nil + } + out := new(PublicServiceConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicServiceRT) DeepCopyInto(out *PublicServiceRT) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicServiceRT. +func (in *PublicServiceRT) DeepCopy() *PublicServiceRT { + if in == nil { + return nil + } + out := new(PublicServiceRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PublicServiceRT) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicServiceRTList) DeepCopyInto(out *PublicServiceRTList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PublicServiceRT, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicServiceRTList. +func (in *PublicServiceRTList) DeepCopy() *PublicServiceRTList { + if in == nil { + return nil + } + out := new(PublicServiceRTList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PublicServiceRTList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicServiceRTNexusStatus) DeepCopyInto(out *PublicServiceRTNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicServiceRTNexusStatus. +func (in *PublicServiceRTNexusStatus) DeepCopy() *PublicServiceRTNexusStatus { + if in == nil { + return nil + } + out := new(PublicServiceRTNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicServiceRTSpec) DeepCopyInto(out *PublicServiceRTSpec) { + *out = *in + if in.FqdnList != nil { + in, out := &in.FqdnList, &out.FqdnList + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicServiceRTSpec. +func (in *PublicServiceRTSpec) DeepCopy() *PublicServiceRTSpec { + if in == nil { + return nil + } + out := new(PublicServiceRTSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicServiceRouteConfig) DeepCopyInto(out *PublicServiceRouteConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicServiceRouteConfig. +func (in *PublicServiceRouteConfig) DeepCopy() *PublicServiceRouteConfig { + if in == nil { + return nil + } + out := new(PublicServiceRouteConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PublicServiceRouteConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicServiceRouteConfigList) DeepCopyInto(out *PublicServiceRouteConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PublicServiceRouteConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicServiceRouteConfigList. +func (in *PublicServiceRouteConfigList) DeepCopy() *PublicServiceRouteConfigList { + if in == nil { + return nil + } + out := new(PublicServiceRouteConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PublicServiceRouteConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicServiceRouteConfigNexusStatus) DeepCopyInto(out *PublicServiceRouteConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicServiceRouteConfigNexusStatus. +func (in *PublicServiceRouteConfigNexusStatus) DeepCopy() *PublicServiceRouteConfigNexusStatus { + if in == nil { + return nil + } + out := new(PublicServiceRouteConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicServiceRouteConfigSpec) DeepCopyInto(out *PublicServiceRouteConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicServiceRouteConfigSpec. +func (in *PublicServiceRouteConfigSpec) DeepCopy() *PublicServiceRouteConfigSpec { + if in == nil { + return nil + } + out := new(PublicServiceRouteConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicServiceRouteConfigStatus) DeepCopyInto(out *PublicServiceRouteConfigStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicServiceRouteConfigStatus. +func (in *PublicServiceRouteConfigStatus) DeepCopy() *PublicServiceRouteConfigStatus { + if in == nil { + return nil + } + out := new(PublicServiceRouteConfigStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryAccessControlPolicyStatsArgs) DeepCopyInto(out *QueryAccessControlPolicyStatsArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryAccessControlPolicyStatsArgs. +func (in *QueryAccessControlPolicyStatsArgs) DeepCopy() *QueryAccessControlPolicyStatsArgs { + if in == nil { + return nil + } + out := new(QueryAccessControlPolicyStatsArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryClusterInventoryCountArgs) DeepCopyInto(out *QueryClusterInventoryCountArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryClusterInventoryCountArgs. +func (in *QueryClusterInventoryCountArgs) DeepCopy() *QueryClusterInventoryCountArgs { + if in == nil { + return nil + } + out := new(QueryClusterInventoryCountArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryClusterTableArgs) DeepCopyInto(out *QueryClusterTableArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryClusterTableArgs. +func (in *QueryClusterTableArgs) DeepCopy() *QueryClusterTableArgs { + if in == nil { + return nil + } + out := new(QueryClusterTableArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryDetailArgs) DeepCopyInto(out *QueryDetailArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryDetailArgs. +func (in *QueryDetailArgs) DeepCopy() *QueryDetailArgs { + if in == nil { + return nil + } + out := new(QueryDetailArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryGNSServiceAPIArgs) DeepCopyInto(out *QueryGNSServiceAPIArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryGNSServiceAPIArgs. +func (in *QueryGNSServiceAPIArgs) DeepCopy() *QueryGNSServiceAPIArgs { + if in == nil { + return nil + } + out := new(QueryGNSServiceAPIArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryIncomingAPIsArgs) DeepCopyInto(out *QueryIncomingAPIsArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryIncomingAPIsArgs. +func (in *QueryIncomingAPIsArgs) DeepCopy() *QueryIncomingAPIsArgs { + if in == nil { + return nil + } + out := new(QueryIncomingAPIsArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryIncomingTCPArgs) DeepCopyInto(out *QueryIncomingTCPArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryIncomingTCPArgs. +func (in *QueryIncomingTCPArgs) DeepCopy() *QueryIncomingTCPArgs { + if in == nil { + return nil + } + out := new(QueryIncomingTCPArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryLinechartArgs) DeepCopyInto(out *QueryLinechartArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryLinechartArgs. +func (in *QueryLinechartArgs) DeepCopy() *QueryLinechartArgs { + if in == nil { + return nil + } + out := new(QueryLinechartArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryListArgs) DeepCopyInto(out *QueryListArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryListArgs. +func (in *QueryListArgs) DeepCopy() *QueryListArgs { + if in == nil { + return nil + } + out := new(QueryListArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryLogsArgs) DeepCopyInto(out *QueryLogsArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryLogsArgs. +func (in *QueryLogsArgs) DeepCopy() *QueryLogsArgs { + if in == nil { + return nil + } + out := new(QueryLogsArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryOutgoingAPIsArgs) DeepCopyInto(out *QueryOutgoingAPIsArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryOutgoingAPIsArgs. +func (in *QueryOutgoingAPIsArgs) DeepCopy() *QueryOutgoingAPIsArgs { + if in == nil { + return nil + } + out := new(QueryOutgoingAPIsArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryOutgoingTCPArgs) DeepCopyInto(out *QueryOutgoingTCPArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryOutgoingTCPArgs. +func (in *QueryOutgoingTCPArgs) DeepCopy() *QueryOutgoingTCPArgs { + if in == nil { + return nil + } + out := new(QueryOutgoingTCPArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryServiceAPIArgs) DeepCopyInto(out *QueryServiceAPIArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryServiceAPIArgs. +func (in *QueryServiceAPIArgs) DeepCopy() *QueryServiceAPIArgs { + if in == nil { + return nil + } + out := new(QueryServiceAPIArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryServiceInstanceTableArgs) DeepCopyInto(out *QueryServiceInstanceTableArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryServiceInstanceTableArgs. +func (in *QueryServiceInstanceTableArgs) DeepCopy() *QueryServiceInstanceTableArgs { + if in == nil { + return nil + } + out := new(QueryServiceInstanceTableArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryServiceTSArgs) DeepCopyInto(out *QueryServiceTSArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryServiceTSArgs. +func (in *QueryServiceTSArgs) DeepCopy() *QueryServiceTSArgs { + if in == nil { + return nil + } + out := new(QueryServiceTSArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryServiceTableArgs) DeepCopyInto(out *QueryServiceTableArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryServiceTableArgs. +func (in *QueryServiceTableArgs) DeepCopy() *QueryServiceTableArgs { + if in == nil { + return nil + } + out := new(QueryServiceTableArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryServiceTopologyArgs) DeepCopyInto(out *QueryServiceTopologyArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryServiceTopologyArgs. +func (in *QueryServiceTopologyArgs) DeepCopy() *QueryServiceTopologyArgs { + if in == nil { + return nil + } + out := new(QueryServiceTopologyArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryServiceVersionTableArgs) DeepCopyInto(out *QueryServiceVersionTableArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryServiceVersionTableArgs. +func (in *QueryServiceVersionTableArgs) DeepCopy() *QueryServiceVersionTableArgs { + if in == nil { + return nil + } + out := new(QueryServiceVersionTableArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QuerySloArgs) DeepCopyInto(out *QuerySloArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QuerySloArgs. +func (in *QuerySloArgs) DeepCopy() *QuerySloArgs { + if in == nil { + return nil + } + out := new(QuerySloArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryStartEndTimeArgs) DeepCopyInto(out *QueryStartEndTimeArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryStartEndTimeArgs. +func (in *QueryStartEndTimeArgs) DeepCopy() *QueryStartEndTimeArgs { + if in == nil { + return nil + } + out := new(QueryStartEndTimeArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryStatsArgs) DeepCopyInto(out *QueryStatsArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryStatsArgs. +func (in *QueryStatsArgs) DeepCopy() *QueryStatsArgs { + if in == nil { + return nil + } + out := new(QueryStatsArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryTopNArgs) DeepCopyInto(out *QueryTopNArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryTopNArgs. +func (in *QueryTopNArgs) DeepCopy() *QueryTopNArgs { + if in == nil { + return nil + } + out := new(QueryTopNArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueryWorkloadVersionAPIArgs) DeepCopyInto(out *QueryWorkloadVersionAPIArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryWorkloadVersionAPIArgs. +func (in *QueryWorkloadVersionAPIArgs) DeepCopy() *QueryWorkloadVersionAPIArgs { + if in == nil { + return nil + } + out := new(QueryWorkloadVersionAPIArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RPolicy) DeepCopyInto(out *RPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RPolicy. +func (in *RPolicy) DeepCopy() *RPolicy { + if in == nil { + return nil + } + out := new(RPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RPolicyList) DeepCopyInto(out *RPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]RPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RPolicyList. +func (in *RPolicyList) DeepCopy() *RPolicyList { + if in == nil { + return nil + } + out := new(RPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RPolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RPolicyNexusStatus) DeepCopyInto(out *RPolicyNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RPolicyNexusStatus. +func (in *RPolicyNexusStatus) DeepCopy() *RPolicyNexusStatus { + if in == nil { + return nil + } + out := new(RPolicyNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RPolicySpec) DeepCopyInto(out *RPolicySpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RPolicySpec. +func (in *RPolicySpec) DeepCopy() *RPolicySpec { + if in == nil { + return nil + } + out := new(RPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RemoteGatewayServiceConfig) DeepCopyInto(out *RemoteGatewayServiceConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteGatewayServiceConfig. +func (in *RemoteGatewayServiceConfig) DeepCopy() *RemoteGatewayServiceConfig { + if in == nil { + return nil + } + out := new(RemoteGatewayServiceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RemoteGatewayServiceConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RemoteGatewayServiceConfigList) DeepCopyInto(out *RemoteGatewayServiceConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]RemoteGatewayServiceConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteGatewayServiceConfigList. +func (in *RemoteGatewayServiceConfigList) DeepCopy() *RemoteGatewayServiceConfigList { + if in == nil { + return nil + } + out := new(RemoteGatewayServiceConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RemoteGatewayServiceConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RemoteGatewayServiceConfigNexusStatus) DeepCopyInto(out *RemoteGatewayServiceConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteGatewayServiceConfigNexusStatus. +func (in *RemoteGatewayServiceConfigNexusStatus) DeepCopy() *RemoteGatewayServiceConfigNexusStatus { + if in == nil { + return nil + } + out := new(RemoteGatewayServiceConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RemoteGatewayServiceConfigSpec) DeepCopyInto(out *RemoteGatewayServiceConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteGatewayServiceConfigSpec. +func (in *RemoteGatewayServiceConfigSpec) DeepCopy() *RemoteGatewayServiceConfigSpec { + if in == nil { + return nil + } + out := new(RemoteGatewayServiceConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceGroup) DeepCopyInto(out *ResourceGroup) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceGroup. +func (in *ResourceGroup) DeepCopy() *ResourceGroup { + if in == nil { + return nil + } + out := new(ResourceGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ResourceGroup) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceGroupList) DeepCopyInto(out *ResourceGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ResourceGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceGroupList. +func (in *ResourceGroupList) DeepCopy() *ResourceGroupList { + if in == nil { + return nil + } + out := new(ResourceGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ResourceGroupList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceGroupNexusStatus) DeepCopyInto(out *ResourceGroupNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceGroupNexusStatus. +func (in *ResourceGroupNexusStatus) DeepCopy() *ResourceGroupNexusStatus { + if in == nil { + return nil + } + out := new(ResourceGroupNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceGroupRT) DeepCopyInto(out *ResourceGroupRT) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceGroupRT. +func (in *ResourceGroupRT) DeepCopy() *ResourceGroupRT { + if in == nil { + return nil + } + out := new(ResourceGroupRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ResourceGroupRT) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceGroupRTList) DeepCopyInto(out *ResourceGroupRTList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ResourceGroupRT, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceGroupRTList. +func (in *ResourceGroupRTList) DeepCopy() *ResourceGroupRTList { + if in == nil { + return nil + } + out := new(ResourceGroupRTList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ResourceGroupRTList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceGroupRTNexusStatus) DeepCopyInto(out *ResourceGroupRTNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceGroupRTNexusStatus. +func (in *ResourceGroupRTNexusStatus) DeepCopy() *ResourceGroupRTNexusStatus { + if in == nil { + return nil + } + out := new(ResourceGroupRTNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceGroupRTSpec) DeepCopyInto(out *ResourceGroupRTSpec) { + *out = *in + if in.SvcGroupRTGvk != nil { + in, out := &in.SvcGroupRTGvk, &out.SvcGroupRTGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceGroupRTSpec. +func (in *ResourceGroupRTSpec) DeepCopy() *ResourceGroupRTSpec { + if in == nil { + return nil + } + out := new(ResourceGroupRTSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceGroupSpec) DeepCopyInto(out *ResourceGroupSpec) { + *out = *in + if in.AppGroupsGvk != nil { + in, out := &in.AppGroupsGvk, &out.AppGroupsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SvcGroupsGvk != nil { + in, out := &in.SvcGroupsGvk, &out.SvcGroupsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.NodeGroupsGvk != nil { + in, out := &in.NodeGroupsGvk, &out.NodeGroupsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.DataGroupsGvk != nil { + in, out := &in.DataGroupsGvk, &out.DataGroupsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.UserGroupsGvk != nil { + in, out := &in.UserGroupsGvk, &out.UserGroupsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceGroupSpec. +func (in *ResourceGroupSpec) DeepCopy() *ResourceGroupSpec { + if in == nil { + return nil + } + out := new(ResourceGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Root) DeepCopyInto(out *Root) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Root. +func (in *Root) DeepCopy() *Root { + if in == nil { + return nil + } + out := new(Root) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Root) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RootList) DeepCopyInto(out *RootList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Root, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RootList. +func (in *RootList) DeepCopy() *RootList { + if in == nil { + return nil + } + out := new(RootList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RootList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RootNexusStatus) DeepCopyInto(out *RootNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RootNexusStatus. +func (in *RootNexusStatus) DeepCopy() *RootNexusStatus { + if in == nil { + return nil + } + out := new(RootNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RootSpec) DeepCopyInto(out *RootSpec) { + *out = *in + if in.ConfigGvk != nil { + in, out := &in.ConfigGvk, &out.ConfigGvk + *out = new(Child) + **out = **in + } + if in.InventoryGvk != nil { + in, out := &in.InventoryGvk, &out.InventoryGvk + *out = new(Child) + **out = **in + } + if in.RuntimeGvk != nil { + in, out := &in.RuntimeGvk, &out.RuntimeGvk + *out = new(Child) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RootSpec. +func (in *RootSpec) DeepCopy() *RootSpec { + if in == nil { + return nil + } + out := new(RootSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Runtime) DeepCopyInto(out *Runtime) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Runtime. +func (in *Runtime) DeepCopy() *Runtime { + if in == nil { + return nil + } + out := new(Runtime) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Runtime) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RuntimeList) DeepCopyInto(out *RuntimeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Runtime, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeList. +func (in *RuntimeList) DeepCopy() *RuntimeList { + if in == nil { + return nil + } + out := new(RuntimeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RuntimeList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RuntimeNexusStatus) DeepCopyInto(out *RuntimeNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeNexusStatus. +func (in *RuntimeNexusStatus) DeepCopy() *RuntimeNexusStatus { + if in == nil { + return nil + } + out := new(RuntimeNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RuntimeSpec) DeepCopyInto(out *RuntimeSpec) { + *out = *in + if in.AllsparkServicesGvk != nil { + in, out := &in.AllsparkServicesGvk, &out.AllsparkServicesGvk + *out = new(Child) + **out = **in + } + if in.UserFolderGvk != nil { + in, out := &in.UserFolderGvk, &out.UserFolderGvk + *out = new(Child) + **out = **in + } + if in.DataFolderGvk != nil { + in, out := &in.DataFolderGvk, &out.DataFolderGvk + *out = new(Child) + **out = **in + } + if in.AppFolderGvk != nil { + in, out := &in.AppFolderGvk, &out.AppFolderGvk + *out = new(Child) + **out = **in + } + if in.NodeFolderGvk != nil { + in, out := &in.NodeFolderGvk, &out.NodeFolderGvk + *out = new(Child) + **out = **in + } + if in.ClusterFolderGvk != nil { + in, out := &in.ClusterFolderGvk, &out.ClusterFolderGvk + *out = new(Child) + **out = **in + } + if in.ProgressiveUpgradeGvk != nil { + in, out := &in.ProgressiveUpgradeGvk, &out.ProgressiveUpgradeGvk + *out = new(Child) + **out = **in + } + if in.JobConfigFolderGvk != nil { + in, out := &in.JobConfigFolderGvk, &out.JobConfigFolderGvk + *out = new(Child) + **out = **in + } + if in.ExternalDNSGvk != nil { + in, out := &in.ExternalDNSGvk, &out.ExternalDNSGvk + *out = new(Child) + **out = **in + } + if in.SloFolderGvk != nil { + in, out := &in.SloFolderGvk, &out.SloFolderGvk + *out = new(Child) + **out = **in + } + if in.ServiceDirectoryRTGvk != nil { + in, out := &in.ServiceDirectoryRTGvk, &out.ServiceDirectoryRTGvk + *out = new(Child) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeSpec. +func (in *RuntimeSpec) DeepCopy() *RuntimeSpec { + if in == nil { + return nil + } + out := new(RuntimeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SLOFolder) DeepCopyInto(out *SLOFolder) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOFolder. +func (in *SLOFolder) DeepCopy() *SLOFolder { + if in == nil { + return nil + } + out := new(SLOFolder) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SLOFolder) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SLOFolderList) DeepCopyInto(out *SLOFolderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SLOFolder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOFolderList. +func (in *SLOFolderList) DeepCopy() *SLOFolderList { + if in == nil { + return nil + } + out := new(SLOFolderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SLOFolderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SLOFolderNexusStatus) DeepCopyInto(out *SLOFolderNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOFolderNexusStatus. +func (in *SLOFolderNexusStatus) DeepCopy() *SLOFolderNexusStatus { + if in == nil { + return nil + } + out := new(SLOFolderNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SLOFolderSpec) DeepCopyInto(out *SLOFolderSpec) { + *out = *in + if in.SlosGvk != nil { + in, out := &in.SlosGvk, &out.SlosGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOFolderSpec. +func (in *SLOFolderSpec) DeepCopy() *SLOFolderSpec { + if in == nil { + return nil + } + out := new(SLOFolderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SLOPolicy) DeepCopyInto(out *SLOPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOPolicy. +func (in *SLOPolicy) DeepCopy() *SLOPolicy { + if in == nil { + return nil + } + out := new(SLOPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SLOPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SLOPolicyList) DeepCopyInto(out *SLOPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SLOPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOPolicyList. +func (in *SLOPolicyList) DeepCopy() *SLOPolicyList { + if in == nil { + return nil + } + out := new(SLOPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SLOPolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SLOPolicyNexusStatus) DeepCopyInto(out *SLOPolicyNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOPolicyNexusStatus. +func (in *SLOPolicyNexusStatus) DeepCopy() *SLOPolicyNexusStatus { + if in == nil { + return nil + } + out := new(SLOPolicyNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SLOPolicySpec) DeepCopyInto(out *SLOPolicySpec) { + *out = *in + if in.ServiceNames != nil { + in, out := &in.ServiceNames, &out.ServiceNames + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Actions != nil { + in, out := &in.Actions, &out.Actions + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOPolicySpec. +func (in *SLOPolicySpec) DeepCopy() *SLOPolicySpec { + if in == nil { + return nil + } + out := new(SLOPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SchemaViolationDiscoveryRT) DeepCopyInto(out *SchemaViolationDiscoveryRT) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchemaViolationDiscoveryRT. +func (in *SchemaViolationDiscoveryRT) DeepCopy() *SchemaViolationDiscoveryRT { + if in == nil { + return nil + } + out := new(SchemaViolationDiscoveryRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SchemaViolationDiscoveryRT) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SchemaViolationDiscoveryRTList) DeepCopyInto(out *SchemaViolationDiscoveryRTList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SchemaViolationDiscoveryRT, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchemaViolationDiscoveryRTList. +func (in *SchemaViolationDiscoveryRTList) DeepCopy() *SchemaViolationDiscoveryRTList { + if in == nil { + return nil + } + out := new(SchemaViolationDiscoveryRTList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SchemaViolationDiscoveryRTList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SchemaViolationDiscoveryRTNexusStatus) DeepCopyInto(out *SchemaViolationDiscoveryRTNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchemaViolationDiscoveryRTNexusStatus. +func (in *SchemaViolationDiscoveryRTNexusStatus) DeepCopy() *SchemaViolationDiscoveryRTNexusStatus { + if in == nil { + return nil + } + out := new(SchemaViolationDiscoveryRTNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SchemaViolationDiscoveryRTSpec) DeepCopyInto(out *SchemaViolationDiscoveryRTSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchemaViolationDiscoveryRTSpec. +func (in *SchemaViolationDiscoveryRTSpec) DeepCopy() *SchemaViolationDiscoveryRTSpec { + if in == nil { + return nil + } + out := new(SchemaViolationDiscoveryRTSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecretHash) DeepCopyInto(out *SecretHash) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretHash. +func (in *SecretHash) DeepCopy() *SecretHash { + if in == nil { + return nil + } + out := new(SecretHash) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SecretHash) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecretHashList) DeepCopyInto(out *SecretHashList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SecretHash, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretHashList. +func (in *SecretHashList) DeepCopy() *SecretHashList { + if in == nil { + return nil + } + out := new(SecretHashList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SecretHashList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecretHashNexusStatus) DeepCopyInto(out *SecretHashNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretHashNexusStatus. +func (in *SecretHashNexusStatus) DeepCopy() *SecretHashNexusStatus { + if in == nil { + return nil + } + out := new(SecretHashNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecretHashSpec) DeepCopyInto(out *SecretHashSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretHashSpec. +func (in *SecretHashSpec) DeepCopy() *SecretHashSpec { + if in == nil { + return nil + } + out := new(SecretHashSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecretRTConfig) DeepCopyInto(out *SecretRTConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretRTConfig. +func (in *SecretRTConfig) DeepCopy() *SecretRTConfig { + if in == nil { + return nil + } + out := new(SecretRTConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SecretRTConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecretRTConfigList) DeepCopyInto(out *SecretRTConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SecretRTConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretRTConfigList. +func (in *SecretRTConfigList) DeepCopy() *SecretRTConfigList { + if in == nil { + return nil + } + out := new(SecretRTConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SecretRTConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecretRTConfigNexusStatus) DeepCopyInto(out *SecretRTConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretRTConfigNexusStatus. +func (in *SecretRTConfigNexusStatus) DeepCopy() *SecretRTConfigNexusStatus { + if in == nil { + return nil + } + out := new(SecretRTConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecretRTConfigSpec) DeepCopyInto(out *SecretRTConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretRTConfigSpec. +func (in *SecretRTConfigSpec) DeepCopy() *SecretRTConfigSpec { + if in == nil { + return nil + } + out := new(SecretRTConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityContextConstraints) DeepCopyInto(out *SecurityContextConstraints) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityContextConstraints. +func (in *SecurityContextConstraints) DeepCopy() *SecurityContextConstraints { + if in == nil { + return nil + } + out := new(SecurityContextConstraints) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SecurityContextConstraints) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityContextConstraintsConfig) DeepCopyInto(out *SecurityContextConstraintsConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityContextConstraintsConfig. +func (in *SecurityContextConstraintsConfig) DeepCopy() *SecurityContextConstraintsConfig { + if in == nil { + return nil + } + out := new(SecurityContextConstraintsConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SecurityContextConstraintsConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityContextConstraintsConfigList) DeepCopyInto(out *SecurityContextConstraintsConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SecurityContextConstraintsConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityContextConstraintsConfigList. +func (in *SecurityContextConstraintsConfigList) DeepCopy() *SecurityContextConstraintsConfigList { + if in == nil { + return nil + } + out := new(SecurityContextConstraintsConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SecurityContextConstraintsConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityContextConstraintsConfigNexusStatus) DeepCopyInto(out *SecurityContextConstraintsConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityContextConstraintsConfigNexusStatus. +func (in *SecurityContextConstraintsConfigNexusStatus) DeepCopy() *SecurityContextConstraintsConfigNexusStatus { + if in == nil { + return nil + } + out := new(SecurityContextConstraintsConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityContextConstraintsConfigSpec) DeepCopyInto(out *SecurityContextConstraintsConfigSpec) { + *out = *in + if in.Groups != nil { + in, out := &in.Groups, &out.Groups + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityContextConstraintsConfigSpec. +func (in *SecurityContextConstraintsConfigSpec) DeepCopy() *SecurityContextConstraintsConfigSpec { + if in == nil { + return nil + } + out := new(SecurityContextConstraintsConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityContextConstraintsList) DeepCopyInto(out *SecurityContextConstraintsList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SecurityContextConstraints, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityContextConstraintsList. +func (in *SecurityContextConstraintsList) DeepCopy() *SecurityContextConstraintsList { + if in == nil { + return nil + } + out := new(SecurityContextConstraintsList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SecurityContextConstraintsList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityContextConstraintsNexusStatus) DeepCopyInto(out *SecurityContextConstraintsNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityContextConstraintsNexusStatus. +func (in *SecurityContextConstraintsNexusStatus) DeepCopy() *SecurityContextConstraintsNexusStatus { + if in == nil { + return nil + } + out := new(SecurityContextConstraintsNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityContextConstraintsSpec) DeepCopyInto(out *SecurityContextConstraintsSpec) { + *out = *in + if in.Groups != nil { + in, out := &in.Groups, &out.Groups + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityContextConstraintsSpec. +func (in *SecurityContextConstraintsSpec) DeepCopy() *SecurityContextConstraintsSpec { + if in == nil { + return nil + } + out := new(SecurityContextConstraintsSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Service) DeepCopyInto(out *Service) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service. +func (in *Service) DeepCopy() *Service { + if in == nil { + return nil + } + out := new(Service) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Service) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConfig) DeepCopyInto(out *ServiceConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConfig. +func (in *ServiceConfig) DeepCopy() *ServiceConfig { + if in == nil { + return nil + } + out := new(ServiceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConfigList) DeepCopyInto(out *ServiceConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConfigList. +func (in *ServiceConfigList) DeepCopy() *ServiceConfigList { + if in == nil { + return nil + } + out := new(ServiceConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConfigNexusStatus) DeepCopyInto(out *ServiceConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConfigNexusStatus. +func (in *ServiceConfigNexusStatus) DeepCopy() *ServiceConfigNexusStatus { + if in == nil { + return nil + } + out := new(ServiceConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConfigSpec) DeepCopyInto(out *ServiceConfigSpec) { + *out = *in + if in.ServiceVersionGvk != nil { + in, out := &in.ServiceVersionGvk, &out.ServiceVersionGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConfigSpec. +func (in *ServiceConfigSpec) DeepCopy() *ServiceConfigSpec { + if in == nil { + return nil + } + out := new(ServiceConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceCronJob) DeepCopyInto(out *ServiceCronJob) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCronJob. +func (in *ServiceCronJob) DeepCopy() *ServiceCronJob { + if in == nil { + return nil + } + out := new(ServiceCronJob) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceCronJob) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceCronJobList) DeepCopyInto(out *ServiceCronJobList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceCronJob, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCronJobList. +func (in *ServiceCronJobList) DeepCopy() *ServiceCronJobList { + if in == nil { + return nil + } + out := new(ServiceCronJobList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceCronJobList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceCronJobNexusStatus) DeepCopyInto(out *ServiceCronJobNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCronJobNexusStatus. +func (in *ServiceCronJobNexusStatus) DeepCopy() *ServiceCronJobNexusStatus { + if in == nil { + return nil + } + out := new(ServiceCronJobNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceCronJobSpec) DeepCopyInto(out *ServiceCronJobSpec) { + *out = *in + if in.ServiceInstancesGvk != nil { + in, out := &in.ServiceInstancesGvk, &out.ServiceInstancesGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceJobsGvk != nil { + in, out := &in.ServiceJobsGvk, &out.ServiceJobsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCronJobSpec. +func (in *ServiceCronJobSpec) DeepCopy() *ServiceCronJobSpec { + if in == nil { + return nil + } + out := new(ServiceCronJobSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDaemonSet) DeepCopyInto(out *ServiceDaemonSet) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDaemonSet. +func (in *ServiceDaemonSet) DeepCopy() *ServiceDaemonSet { + if in == nil { + return nil + } + out := new(ServiceDaemonSet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceDaemonSet) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDaemonSetList) DeepCopyInto(out *ServiceDaemonSetList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceDaemonSet, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDaemonSetList. +func (in *ServiceDaemonSetList) DeepCopy() *ServiceDaemonSetList { + if in == nil { + return nil + } + out := new(ServiceDaemonSetList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceDaemonSetList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDaemonSetNexusStatus) DeepCopyInto(out *ServiceDaemonSetNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDaemonSetNexusStatus. +func (in *ServiceDaemonSetNexusStatus) DeepCopy() *ServiceDaemonSetNexusStatus { + if in == nil { + return nil + } + out := new(ServiceDaemonSetNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDaemonSetSpec) DeepCopyInto(out *ServiceDaemonSetSpec) { + *out = *in + if in.ServiceInstancesGvk != nil { + in, out := &in.ServiceInstancesGvk, &out.ServiceInstancesGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDaemonSetSpec. +func (in *ServiceDaemonSetSpec) DeepCopy() *ServiceDaemonSetSpec { + if in == nil { + return nil + } + out := new(ServiceDaemonSetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDeployment) DeepCopyInto(out *ServiceDeployment) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDeployment. +func (in *ServiceDeployment) DeepCopy() *ServiceDeployment { + if in == nil { + return nil + } + out := new(ServiceDeployment) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceDeployment) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDeploymentContainer) DeepCopyInto(out *ServiceDeploymentContainer) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDeploymentContainer. +func (in *ServiceDeploymentContainer) DeepCopy() *ServiceDeploymentContainer { + if in == nil { + return nil + } + out := new(ServiceDeploymentContainer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceDeploymentContainer) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDeploymentContainerList) DeepCopyInto(out *ServiceDeploymentContainerList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceDeploymentContainer, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDeploymentContainerList. +func (in *ServiceDeploymentContainerList) DeepCopy() *ServiceDeploymentContainerList { + if in == nil { + return nil + } + out := new(ServiceDeploymentContainerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceDeploymentContainerList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDeploymentContainerNexusStatus) DeepCopyInto(out *ServiceDeploymentContainerNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDeploymentContainerNexusStatus. +func (in *ServiceDeploymentContainerNexusStatus) DeepCopy() *ServiceDeploymentContainerNexusStatus { + if in == nil { + return nil + } + out := new(ServiceDeploymentContainerNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDeploymentContainerSpec) DeepCopyInto(out *ServiceDeploymentContainerSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDeploymentContainerSpec. +func (in *ServiceDeploymentContainerSpec) DeepCopy() *ServiceDeploymentContainerSpec { + if in == nil { + return nil + } + out := new(ServiceDeploymentContainerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDeploymentList) DeepCopyInto(out *ServiceDeploymentList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceDeployment, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDeploymentList. +func (in *ServiceDeploymentList) DeepCopy() *ServiceDeploymentList { + if in == nil { + return nil + } + out := new(ServiceDeploymentList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceDeploymentList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDeploymentNexusStatus) DeepCopyInto(out *ServiceDeploymentNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDeploymentNexusStatus. +func (in *ServiceDeploymentNexusStatus) DeepCopy() *ServiceDeploymentNexusStatus { + if in == nil { + return nil + } + out := new(ServiceDeploymentNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDeploymentSpec) DeepCopyInto(out *ServiceDeploymentSpec) { + *out = *in + if in.ContainersGvk != nil { + in, out := &in.ContainersGvk, &out.ContainersGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceInstancesGvk != nil { + in, out := &in.ServiceInstancesGvk, &out.ServiceInstancesGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceReplicaSetGvk != nil { + in, out := &in.ServiceReplicaSetGvk, &out.ServiceReplicaSetGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDeploymentSpec. +func (in *ServiceDeploymentSpec) DeepCopy() *ServiceDeploymentSpec { + if in == nil { + return nil + } + out := new(ServiceDeploymentSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryEntryConfig) DeepCopyInto(out *ServiceDirectoryEntryConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryEntryConfig. +func (in *ServiceDirectoryEntryConfig) DeepCopy() *ServiceDirectoryEntryConfig { + if in == nil { + return nil + } + out := new(ServiceDirectoryEntryConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceDirectoryEntryConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryEntryConfigList) DeepCopyInto(out *ServiceDirectoryEntryConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceDirectoryEntryConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryEntryConfigList. +func (in *ServiceDirectoryEntryConfigList) DeepCopy() *ServiceDirectoryEntryConfigList { + if in == nil { + return nil + } + out := new(ServiceDirectoryEntryConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceDirectoryEntryConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryEntryConfigNexusStatus) DeepCopyInto(out *ServiceDirectoryEntryConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryEntryConfigNexusStatus. +func (in *ServiceDirectoryEntryConfigNexusStatus) DeepCopy() *ServiceDirectoryEntryConfigNexusStatus { + if in == nil { + return nil + } + out := new(ServiceDirectoryEntryConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryEntryConfigSpec) DeepCopyInto(out *ServiceDirectoryEntryConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryEntryConfigSpec. +func (in *ServiceDirectoryEntryConfigSpec) DeepCopy() *ServiceDirectoryEntryConfigSpec { + if in == nil { + return nil + } + out := new(ServiceDirectoryEntryConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryN) DeepCopyInto(out *ServiceDirectoryN) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryN. +func (in *ServiceDirectoryN) DeepCopy() *ServiceDirectoryN { + if in == nil { + return nil + } + out := new(ServiceDirectoryN) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceDirectoryN) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryNList) DeepCopyInto(out *ServiceDirectoryNList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceDirectoryN, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryNList. +func (in *ServiceDirectoryNList) DeepCopy() *ServiceDirectoryNList { + if in == nil { + return nil + } + out := new(ServiceDirectoryNList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceDirectoryNList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryNNexusStatus) DeepCopyInto(out *ServiceDirectoryNNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryNNexusStatus. +func (in *ServiceDirectoryNNexusStatus) DeepCopy() *ServiceDirectoryNNexusStatus { + if in == nil { + return nil + } + out := new(ServiceDirectoryNNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryNSpec) DeepCopyInto(out *ServiceDirectoryNSpec) { + *out = *in + if in.EntriesGvk != nil { + in, out := &in.EntriesGvk, &out.EntriesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryNSpec. +func (in *ServiceDirectoryNSpec) DeepCopy() *ServiceDirectoryNSpec { + if in == nil { + return nil + } + out := new(ServiceDirectoryNSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryRT) DeepCopyInto(out *ServiceDirectoryRT) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryRT. +func (in *ServiceDirectoryRT) DeepCopy() *ServiceDirectoryRT { + if in == nil { + return nil + } + out := new(ServiceDirectoryRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceDirectoryRT) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryRTFolder) DeepCopyInto(out *ServiceDirectoryRTFolder) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryRTFolder. +func (in *ServiceDirectoryRTFolder) DeepCopy() *ServiceDirectoryRTFolder { + if in == nil { + return nil + } + out := new(ServiceDirectoryRTFolder) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceDirectoryRTFolder) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryRTFolderEntry) DeepCopyInto(out *ServiceDirectoryRTFolderEntry) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryRTFolderEntry. +func (in *ServiceDirectoryRTFolderEntry) DeepCopy() *ServiceDirectoryRTFolderEntry { + if in == nil { + return nil + } + out := new(ServiceDirectoryRTFolderEntry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceDirectoryRTFolderEntry) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryRTFolderEntryList) DeepCopyInto(out *ServiceDirectoryRTFolderEntryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceDirectoryRTFolderEntry, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryRTFolderEntryList. +func (in *ServiceDirectoryRTFolderEntryList) DeepCopy() *ServiceDirectoryRTFolderEntryList { + if in == nil { + return nil + } + out := new(ServiceDirectoryRTFolderEntryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceDirectoryRTFolderEntryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryRTFolderEntryNexusStatus) DeepCopyInto(out *ServiceDirectoryRTFolderEntryNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryRTFolderEntryNexusStatus. +func (in *ServiceDirectoryRTFolderEntryNexusStatus) DeepCopy() *ServiceDirectoryRTFolderEntryNexusStatus { + if in == nil { + return nil + } + out := new(ServiceDirectoryRTFolderEntryNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryRTFolderEntrySpec) DeepCopyInto(out *ServiceDirectoryRTFolderEntrySpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryRTFolderEntrySpec. +func (in *ServiceDirectoryRTFolderEntrySpec) DeepCopy() *ServiceDirectoryRTFolderEntrySpec { + if in == nil { + return nil + } + out := new(ServiceDirectoryRTFolderEntrySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryRTFolderList) DeepCopyInto(out *ServiceDirectoryRTFolderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceDirectoryRTFolder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryRTFolderList. +func (in *ServiceDirectoryRTFolderList) DeepCopy() *ServiceDirectoryRTFolderList { + if in == nil { + return nil + } + out := new(ServiceDirectoryRTFolderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceDirectoryRTFolderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryRTFolderNexusStatus) DeepCopyInto(out *ServiceDirectoryRTFolderNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryRTFolderNexusStatus. +func (in *ServiceDirectoryRTFolderNexusStatus) DeepCopy() *ServiceDirectoryRTFolderNexusStatus { + if in == nil { + return nil + } + out := new(ServiceDirectoryRTFolderNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryRTFolderSpec) DeepCopyInto(out *ServiceDirectoryRTFolderSpec) { + *out = *in + if in.ServiceDirectoryRTFolderEntryGvk != nil { + in, out := &in.ServiceDirectoryRTFolderEntryGvk, &out.ServiceDirectoryRTFolderEntryGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryRTFolderSpec. +func (in *ServiceDirectoryRTFolderSpec) DeepCopy() *ServiceDirectoryRTFolderSpec { + if in == nil { + return nil + } + out := new(ServiceDirectoryRTFolderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryRTList) DeepCopyInto(out *ServiceDirectoryRTList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceDirectoryRT, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryRTList. +func (in *ServiceDirectoryRTList) DeepCopy() *ServiceDirectoryRTList { + if in == nil { + return nil + } + out := new(ServiceDirectoryRTList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceDirectoryRTList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryRTNexusStatus) DeepCopyInto(out *ServiceDirectoryRTNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryRTNexusStatus. +func (in *ServiceDirectoryRTNexusStatus) DeepCopy() *ServiceDirectoryRTNexusStatus { + if in == nil { + return nil + } + out := new(ServiceDirectoryRTNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDirectoryRTSpec) DeepCopyInto(out *ServiceDirectoryRTSpec) { + *out = *in + if in.ServiceDirectoryRTFolderGvk != nil { + in, out := &in.ServiceDirectoryRTFolderGvk, &out.ServiceDirectoryRTFolderGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDirectoryRTSpec. +func (in *ServiceDirectoryRTSpec) DeepCopy() *ServiceDirectoryRTSpec { + if in == nil { + return nil + } + out := new(ServiceDirectoryRTSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEntry) DeepCopyInto(out *ServiceEntry) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEntry. +func (in *ServiceEntry) DeepCopy() *ServiceEntry { + if in == nil { + return nil + } + out := new(ServiceEntry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceEntry) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEntryConfig) DeepCopyInto(out *ServiceEntryConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEntryConfig. +func (in *ServiceEntryConfig) DeepCopy() *ServiceEntryConfig { + if in == nil { + return nil + } + out := new(ServiceEntryConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceEntryConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEntryConfigList) DeepCopyInto(out *ServiceEntryConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceEntryConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEntryConfigList. +func (in *ServiceEntryConfigList) DeepCopy() *ServiceEntryConfigList { + if in == nil { + return nil + } + out := new(ServiceEntryConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceEntryConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEntryConfigNexusStatus) DeepCopyInto(out *ServiceEntryConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEntryConfigNexusStatus. +func (in *ServiceEntryConfigNexusStatus) DeepCopy() *ServiceEntryConfigNexusStatus { + if in == nil { + return nil + } + out := new(ServiceEntryConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEntryConfigSpec) DeepCopyInto(out *ServiceEntryConfigSpec) { + *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Endpoints != nil { + in, out := &in.Endpoints, &out.Endpoints + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEntryConfigSpec. +func (in *ServiceEntryConfigSpec) DeepCopy() *ServiceEntryConfigSpec { + if in == nil { + return nil + } + out := new(ServiceEntryConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEntryList) DeepCopyInto(out *ServiceEntryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceEntry, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEntryList. +func (in *ServiceEntryList) DeepCopy() *ServiceEntryList { + if in == nil { + return nil + } + out := new(ServiceEntryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceEntryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEntryNexusStatus) DeepCopyInto(out *ServiceEntryNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEntryNexusStatus. +func (in *ServiceEntryNexusStatus) DeepCopy() *ServiceEntryNexusStatus { + if in == nil { + return nil + } + out := new(ServiceEntryNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEntrySpec) DeepCopyInto(out *ServiceEntrySpec) { + *out = *in + if in.ExportTo != nil { + in, out := &in.ExportTo, &out.ExportTo + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEntrySpec. +func (in *ServiceEntrySpec) DeepCopy() *ServiceEntrySpec { + if in == nil { + return nil + } + out := new(ServiceEntrySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ServiceGroupServiceList) DeepCopyInto(out *ServiceGroupServiceList) { + { + in := &in + *out = make(ServiceGroupServiceList, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceGroupServiceList. +func (in ServiceGroupServiceList) DeepCopy() ServiceGroupServiceList { + if in == nil { + return nil + } + out := new(ServiceGroupServiceList) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ServiceGroupSvcList) DeepCopyInto(out *ServiceGroupSvcList) { + { + in := &in + *out = make(ServiceGroupSvcList, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceGroupSvcList. +func (in ServiceGroupSvcList) DeepCopy() ServiceGroupSvcList { + if in == nil { + return nil + } + out := new(ServiceGroupSvcList) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceInstance) DeepCopyInto(out *ServiceInstance) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceInstance. +func (in *ServiceInstance) DeepCopy() *ServiceInstance { + if in == nil { + return nil + } + out := new(ServiceInstance) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceInstance) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceInstanceContainer) DeepCopyInto(out *ServiceInstanceContainer) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceInstanceContainer. +func (in *ServiceInstanceContainer) DeepCopy() *ServiceInstanceContainer { + if in == nil { + return nil + } + out := new(ServiceInstanceContainer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceInstanceContainer) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceInstanceContainerList) DeepCopyInto(out *ServiceInstanceContainerList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceInstanceContainer, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceInstanceContainerList. +func (in *ServiceInstanceContainerList) DeepCopy() *ServiceInstanceContainerList { + if in == nil { + return nil + } + out := new(ServiceInstanceContainerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceInstanceContainerList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceInstanceContainerNexusStatus) DeepCopyInto(out *ServiceInstanceContainerNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceInstanceContainerNexusStatus. +func (in *ServiceInstanceContainerNexusStatus) DeepCopy() *ServiceInstanceContainerNexusStatus { + if in == nil { + return nil + } + out := new(ServiceInstanceContainerNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceInstanceContainerSpec) DeepCopyInto(out *ServiceInstanceContainerSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceInstanceContainerSpec. +func (in *ServiceInstanceContainerSpec) DeepCopy() *ServiceInstanceContainerSpec { + if in == nil { + return nil + } + out := new(ServiceInstanceContainerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceInstanceList) DeepCopyInto(out *ServiceInstanceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceInstance, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceInstanceList. +func (in *ServiceInstanceList) DeepCopy() *ServiceInstanceList { + if in == nil { + return nil + } + out := new(ServiceInstanceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceInstanceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceInstanceNexusStatus) DeepCopyInto(out *ServiceInstanceNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceInstanceNexusStatus. +func (in *ServiceInstanceNexusStatus) DeepCopy() *ServiceInstanceNexusStatus { + if in == nil { + return nil + } + out := new(ServiceInstanceNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceInstanceSpec) DeepCopyInto(out *ServiceInstanceSpec) { + *out = *in + if in.ContainersGvk != nil { + in, out := &in.ContainersGvk, &out.ContainersGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.NodeGvk != nil { + in, out := &in.NodeGvk, &out.NodeGvk + *out = new(Link) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceInstanceSpec. +func (in *ServiceInstanceSpec) DeepCopy() *ServiceInstanceSpec { + if in == nil { + return nil + } + out := new(ServiceInstanceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceJob) DeepCopyInto(out *ServiceJob) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceJob. +func (in *ServiceJob) DeepCopy() *ServiceJob { + if in == nil { + return nil + } + out := new(ServiceJob) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceJob) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceJobList) DeepCopyInto(out *ServiceJobList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceJob, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceJobList. +func (in *ServiceJobList) DeepCopy() *ServiceJobList { + if in == nil { + return nil + } + out := new(ServiceJobList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceJobList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceJobNexusStatus) DeepCopyInto(out *ServiceJobNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceJobNexusStatus. +func (in *ServiceJobNexusStatus) DeepCopy() *ServiceJobNexusStatus { + if in == nil { + return nil + } + out := new(ServiceJobNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceJobSpec) DeepCopyInto(out *ServiceJobSpec) { + *out = *in + if in.ServiceInstancesGvk != nil { + in, out := &in.ServiceInstancesGvk, &out.ServiceInstancesGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceJobSpec. +func (in *ServiceJobSpec) DeepCopy() *ServiceJobSpec { + if in == nil { + return nil + } + out := new(ServiceJobSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceLevelObjective) DeepCopyInto(out *ServiceLevelObjective) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceLevelObjective. +func (in *ServiceLevelObjective) DeepCopy() *ServiceLevelObjective { + if in == nil { + return nil + } + out := new(ServiceLevelObjective) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceLevelObjective) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceLevelObjectiveFolder) DeepCopyInto(out *ServiceLevelObjectiveFolder) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceLevelObjectiveFolder. +func (in *ServiceLevelObjectiveFolder) DeepCopy() *ServiceLevelObjectiveFolder { + if in == nil { + return nil + } + out := new(ServiceLevelObjectiveFolder) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceLevelObjectiveFolder) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceLevelObjectiveFolderList) DeepCopyInto(out *ServiceLevelObjectiveFolderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceLevelObjectiveFolder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceLevelObjectiveFolderList. +func (in *ServiceLevelObjectiveFolderList) DeepCopy() *ServiceLevelObjectiveFolderList { + if in == nil { + return nil + } + out := new(ServiceLevelObjectiveFolderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceLevelObjectiveFolderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceLevelObjectiveFolderNexusStatus) DeepCopyInto(out *ServiceLevelObjectiveFolderNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceLevelObjectiveFolderNexusStatus. +func (in *ServiceLevelObjectiveFolderNexusStatus) DeepCopy() *ServiceLevelObjectiveFolderNexusStatus { + if in == nil { + return nil + } + out := new(ServiceLevelObjectiveFolderNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceLevelObjectiveFolderSpec) DeepCopyInto(out *ServiceLevelObjectiveFolderSpec) { + *out = *in + if in.ServiceLevelObjectivesGvk != nil { + in, out := &in.ServiceLevelObjectivesGvk, &out.ServiceLevelObjectivesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceLevelObjectiveFolderSpec. +func (in *ServiceLevelObjectiveFolderSpec) DeepCopy() *ServiceLevelObjectiveFolderSpec { + if in == nil { + return nil + } + out := new(ServiceLevelObjectiveFolderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceLevelObjectiveList) DeepCopyInto(out *ServiceLevelObjectiveList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceLevelObjective, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceLevelObjectiveList. +func (in *ServiceLevelObjectiveList) DeepCopy() *ServiceLevelObjectiveList { + if in == nil { + return nil + } + out := new(ServiceLevelObjectiveList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceLevelObjectiveList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceLevelObjectiveNexusStatus) DeepCopyInto(out *ServiceLevelObjectiveNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceLevelObjectiveNexusStatus. +func (in *ServiceLevelObjectiveNexusStatus) DeepCopy() *ServiceLevelObjectiveNexusStatus { + if in == nil { + return nil + } + out := new(ServiceLevelObjectiveNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceLevelObjectiveSpec) DeepCopyInto(out *ServiceLevelObjectiveSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceLevelObjectiveSpec. +func (in *ServiceLevelObjectiveSpec) DeepCopy() *ServiceLevelObjectiveSpec { + if in == nil { + return nil + } + out := new(ServiceLevelObjectiveSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceList) DeepCopyInto(out *ServiceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Service, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceList. +func (in *ServiceList) DeepCopy() *ServiceList { + if in == nil { + return nil + } + out := new(ServiceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceNexusStatus) DeepCopyInto(out *ServiceNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceNexusStatus. +func (in *ServiceNexusStatus) DeepCopy() *ServiceNexusStatus { + if in == nil { + return nil + } + out := new(ServiceNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceReplicaSet) DeepCopyInto(out *ServiceReplicaSet) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceReplicaSet. +func (in *ServiceReplicaSet) DeepCopy() *ServiceReplicaSet { + if in == nil { + return nil + } + out := new(ServiceReplicaSet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceReplicaSet) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceReplicaSetList) DeepCopyInto(out *ServiceReplicaSetList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceReplicaSet, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceReplicaSetList. +func (in *ServiceReplicaSetList) DeepCopy() *ServiceReplicaSetList { + if in == nil { + return nil + } + out := new(ServiceReplicaSetList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceReplicaSetList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceReplicaSetNexusStatus) DeepCopyInto(out *ServiceReplicaSetNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceReplicaSetNexusStatus. +func (in *ServiceReplicaSetNexusStatus) DeepCopy() *ServiceReplicaSetNexusStatus { + if in == nil { + return nil + } + out := new(ServiceReplicaSetNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceReplicaSetSpec) DeepCopyInto(out *ServiceReplicaSetSpec) { + *out = *in + if in.ServiceInstancesGvk != nil { + in, out := &in.ServiceInstancesGvk, &out.ServiceInstancesGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceReplicaSetSpec. +func (in *ServiceReplicaSetSpec) DeepCopy() *ServiceReplicaSetSpec { + if in == nil { + return nil + } + out := new(ServiceReplicaSetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceSpec) DeepCopyInto(out *ServiceSpec) { + *out = *in + if in.AdditionalAttributesGvk != nil { + in, out := &in.AdditionalAttributesGvk, &out.AdditionalAttributesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceVersionsGvk != nil { + in, out := &in.ServiceVersionsGvk, &out.ServiceVersionsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceDeploymentsGvk != nil { + in, out := &in.ServiceDeploymentsGvk, &out.ServiceDeploymentsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceStatefulSetsGvk != nil { + in, out := &in.ServiceStatefulSetsGvk, &out.ServiceStatefulSetsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceDaemonSetsGvk != nil { + in, out := &in.ServiceDaemonSetsGvk, &out.ServiceDaemonSetsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.EndpointsGvk != nil { + in, out := &in.EndpointsGvk, &out.EndpointsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceReplicaSetsGvk != nil { + in, out := &in.ServiceReplicaSetsGvk, &out.ServiceReplicaSetsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceJobsGvk != nil { + in, out := &in.ServiceJobsGvk, &out.ServiceJobsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceSpec. +func (in *ServiceSpec) DeepCopy() *ServiceSpec { + if in == nil { + return nil + } + out := new(ServiceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceStatefulSet) DeepCopyInto(out *ServiceStatefulSet) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceStatefulSet. +func (in *ServiceStatefulSet) DeepCopy() *ServiceStatefulSet { + if in == nil { + return nil + } + out := new(ServiceStatefulSet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceStatefulSet) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceStatefulSetList) DeepCopyInto(out *ServiceStatefulSetList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceStatefulSet, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceStatefulSetList. +func (in *ServiceStatefulSetList) DeepCopy() *ServiceStatefulSetList { + if in == nil { + return nil + } + out := new(ServiceStatefulSetList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceStatefulSetList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceStatefulSetNexusStatus) DeepCopyInto(out *ServiceStatefulSetNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceStatefulSetNexusStatus. +func (in *ServiceStatefulSetNexusStatus) DeepCopy() *ServiceStatefulSetNexusStatus { + if in == nil { + return nil + } + out := new(ServiceStatefulSetNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceStatefulSetSpec) DeepCopyInto(out *ServiceStatefulSetSpec) { + *out = *in + if in.ServiceInstancesGvk != nil { + in, out := &in.ServiceInstancesGvk, &out.ServiceInstancesGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceStatefulSetSpec. +func (in *ServiceStatefulSetSpec) DeepCopy() *ServiceStatefulSetSpec { + if in == nil { + return nil + } + out := new(ServiceStatefulSetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceTemplate) DeepCopyInto(out *ServiceTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceTemplate. +func (in *ServiceTemplate) DeepCopy() *ServiceTemplate { + if in == nil { + return nil + } + out := new(ServiceTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceTemplateList) DeepCopyInto(out *ServiceTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceTemplateList. +func (in *ServiceTemplateList) DeepCopy() *ServiceTemplateList { + if in == nil { + return nil + } + out := new(ServiceTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceTemplateNexusStatus) DeepCopyInto(out *ServiceTemplateNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceTemplateNexusStatus. +func (in *ServiceTemplateNexusStatus) DeepCopy() *ServiceTemplateNexusStatus { + if in == nil { + return nil + } + out := new(ServiceTemplateNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceTemplateServiceDefinition) DeepCopyInto(out *ServiceTemplateServiceDefinition) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceTemplateServiceDefinition. +func (in *ServiceTemplateServiceDefinition) DeepCopy() *ServiceTemplateServiceDefinition { + if in == nil { + return nil + } + out := new(ServiceTemplateServiceDefinition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceTemplateServiceDefinition) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceTemplateServiceDefinitionList) DeepCopyInto(out *ServiceTemplateServiceDefinitionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceTemplateServiceDefinition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceTemplateServiceDefinitionList. +func (in *ServiceTemplateServiceDefinitionList) DeepCopy() *ServiceTemplateServiceDefinitionList { + if in == nil { + return nil + } + out := new(ServiceTemplateServiceDefinitionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceTemplateServiceDefinitionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceTemplateServiceDefinitionNexusStatus) DeepCopyInto(out *ServiceTemplateServiceDefinitionNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceTemplateServiceDefinitionNexusStatus. +func (in *ServiceTemplateServiceDefinitionNexusStatus) DeepCopy() *ServiceTemplateServiceDefinitionNexusStatus { + if in == nil { + return nil + } + out := new(ServiceTemplateServiceDefinitionNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceTemplateServiceDefinitionSpec) DeepCopyInto(out *ServiceTemplateServiceDefinitionSpec) { + *out = *in + if in.TemplateArgs != nil { + in, out := &in.TemplateArgs, &out.TemplateArgs + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceTemplateServiceDefinitionSpec. +func (in *ServiceTemplateServiceDefinitionSpec) DeepCopy() *ServiceTemplateServiceDefinitionSpec { + if in == nil { + return nil + } + out := new(ServiceTemplateServiceDefinitionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceTemplateSpec) DeepCopyInto(out *ServiceTemplateSpec) { + *out = *in + if in.ServiceDefinitionsGvk != nil { + in, out := &in.ServiceDefinitionsGvk, &out.ServiceDefinitionsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceTemplateSpec. +func (in *ServiceTemplateSpec) DeepCopy() *ServiceTemplateSpec { + if in == nil { + return nil + } + out := new(ServiceTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceVersion) DeepCopyInto(out *ServiceVersion) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceVersion. +func (in *ServiceVersion) DeepCopy() *ServiceVersion { + if in == nil { + return nil + } + out := new(ServiceVersion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceVersion) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceVersionConfig) DeepCopyInto(out *ServiceVersionConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceVersionConfig. +func (in *ServiceVersionConfig) DeepCopy() *ServiceVersionConfig { + if in == nil { + return nil + } + out := new(ServiceVersionConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceVersionConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceVersionConfigList) DeepCopyInto(out *ServiceVersionConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceVersionConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceVersionConfigList. +func (in *ServiceVersionConfigList) DeepCopy() *ServiceVersionConfigList { + if in == nil { + return nil + } + out := new(ServiceVersionConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceVersionConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceVersionConfigNexusStatus) DeepCopyInto(out *ServiceVersionConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceVersionConfigNexusStatus. +func (in *ServiceVersionConfigNexusStatus) DeepCopy() *ServiceVersionConfigNexusStatus { + if in == nil { + return nil + } + out := new(ServiceVersionConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceVersionConfigSpec) DeepCopyInto(out *ServiceVersionConfigSpec) { + *out = *in + if in.MetricMonitorsGvk != nil { + in, out := &in.MetricMonitorsGvk, &out.MetricMonitorsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceVersionConfigSpec. +func (in *ServiceVersionConfigSpec) DeepCopy() *ServiceVersionConfigSpec { + if in == nil { + return nil + } + out := new(ServiceVersionConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceVersionList) DeepCopyInto(out *ServiceVersionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceVersion, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceVersionList. +func (in *ServiceVersionList) DeepCopy() *ServiceVersionList { + if in == nil { + return nil + } + out := new(ServiceVersionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceVersionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceVersionNexusStatus) DeepCopyInto(out *ServiceVersionNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceVersionNexusStatus. +func (in *ServiceVersionNexusStatus) DeepCopy() *ServiceVersionNexusStatus { + if in == nil { + return nil + } + out := new(ServiceVersionNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceVersionSpec) DeepCopyInto(out *ServiceVersionSpec) { + *out = *in + if in.ServiceDeploymentsGvk != nil { + in, out := &in.ServiceDeploymentsGvk, &out.ServiceDeploymentsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceDaemonSetsGvk != nil { + in, out := &in.ServiceDaemonSetsGvk, &out.ServiceDaemonSetsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceStatefulSetsGvk != nil { + in, out := &in.ServiceStatefulSetsGvk, &out.ServiceStatefulSetsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceVersionSpec. +func (in *ServiceVersionSpec) DeepCopy() *ServiceVersionSpec { + if in == nil { + return nil + } + out := new(ServiceVersionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SharedServiceConfig) DeepCopyInto(out *SharedServiceConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedServiceConfig. +func (in *SharedServiceConfig) DeepCopy() *SharedServiceConfig { + if in == nil { + return nil + } + out := new(SharedServiceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SharedServiceConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SharedServiceConfigList) DeepCopyInto(out *SharedServiceConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SharedServiceConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedServiceConfigList. +func (in *SharedServiceConfigList) DeepCopy() *SharedServiceConfigList { + if in == nil { + return nil + } + out := new(SharedServiceConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SharedServiceConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SharedServiceConfigNexusStatus) DeepCopyInto(out *SharedServiceConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedServiceConfigNexusStatus. +func (in *SharedServiceConfigNexusStatus) DeepCopy() *SharedServiceConfigNexusStatus { + if in == nil { + return nil + } + out := new(SharedServiceConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SharedServiceConfigSpec) DeepCopyInto(out *SharedServiceConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedServiceConfigSpec. +func (in *SharedServiceConfigSpec) DeepCopy() *SharedServiceConfigSpec { + if in == nil { + return nil + } + out := new(SharedServiceConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SloConfig) DeepCopyInto(out *SloConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SloConfig. +func (in *SloConfig) DeepCopy() *SloConfig { + if in == nil { + return nil + } + out := new(SloConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SloConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SloConfigList) DeepCopyInto(out *SloConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SloConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SloConfigList. +func (in *SloConfigList) DeepCopy() *SloConfigList { + if in == nil { + return nil + } + out := new(SloConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SloConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SloConfigNexusStatus) DeepCopyInto(out *SloConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SloConfigNexusStatus. +func (in *SloConfigNexusStatus) DeepCopy() *SloConfigNexusStatus { + if in == nil { + return nil + } + out := new(SloConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SloConfigSpec) DeepCopyInto(out *SloConfigSpec) { + *out = *in + if in.SloServicesGvk != nil { + in, out := &in.SloServicesGvk, &out.SloServicesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SloConfigSpec. +func (in *SloConfigSpec) DeepCopy() *SloConfigSpec { + if in == nil { + return nil + } + out := new(SloConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SloServiceConfig) DeepCopyInto(out *SloServiceConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SloServiceConfig. +func (in *SloServiceConfig) DeepCopy() *SloServiceConfig { + if in == nil { + return nil + } + out := new(SloServiceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SloServiceConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SloServiceConfigList) DeepCopyInto(out *SloServiceConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SloServiceConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SloServiceConfigList. +func (in *SloServiceConfigList) DeepCopy() *SloServiceConfigList { + if in == nil { + return nil + } + out := new(SloServiceConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SloServiceConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SloServiceConfigNexusStatus) DeepCopyInto(out *SloServiceConfigNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SloServiceConfigNexusStatus. +func (in *SloServiceConfigNexusStatus) DeepCopy() *SloServiceConfigNexusStatus { + if in == nil { + return nil + } + out := new(SloServiceConfigNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SloServiceConfigSpec) DeepCopyInto(out *SloServiceConfigSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SloServiceConfigSpec. +func (in *SloServiceConfigSpec) DeepCopy() *SloServiceConfigSpec { + if in == nil { + return nil + } + out := new(SloServiceConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SvcGroup) DeepCopyInto(out *SvcGroup) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcGroup. +func (in *SvcGroup) DeepCopy() *SvcGroup { + if in == nil { + return nil + } + out := new(SvcGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SvcGroup) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SvcGroupList) DeepCopyInto(out *SvcGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SvcGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcGroupList. +func (in *SvcGroupList) DeepCopy() *SvcGroupList { + if in == nil { + return nil + } + out := new(SvcGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SvcGroupList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SvcGroupNexusStatus) DeepCopyInto(out *SvcGroupNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcGroupNexusStatus. +func (in *SvcGroupNexusStatus) DeepCopy() *SvcGroupNexusStatus { + if in == nil { + return nil + } + out := new(SvcGroupNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SvcGroupRT) DeepCopyInto(out *SvcGroupRT) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcGroupRT. +func (in *SvcGroupRT) DeepCopy() *SvcGroupRT { + if in == nil { + return nil + } + out := new(SvcGroupRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SvcGroupRT) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SvcGroupRTList) DeepCopyInto(out *SvcGroupRTList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SvcGroupRT, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcGroupRTList. +func (in *SvcGroupRTList) DeepCopy() *SvcGroupRTList { + if in == nil { + return nil + } + out := new(SvcGroupRTList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SvcGroupRTList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SvcGroupRTNexusStatus) DeepCopyInto(out *SvcGroupRTNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcGroupRTNexusStatus. +func (in *SvcGroupRTNexusStatus) DeepCopy() *SvcGroupRTNexusStatus { + if in == nil { + return nil + } + out := new(SvcGroupRTNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SvcGroupRTSpec) DeepCopyInto(out *SvcGroupRTSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcGroupRTSpec. +func (in *SvcGroupRTSpec) DeepCopy() *SvcGroupRTSpec { + if in == nil { + return nil + } + out := new(SvcGroupRTSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SvcGroupSpec) DeepCopyInto(out *SvcGroupSpec) { + *out = *in + if in.ServicesGvk != nil { + in, out := &in.ServicesGvk, &out.ServicesGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.DeploymentsGvk != nil { + in, out := &in.DeploymentsGvk, &out.DeploymentsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.DaemonsetsGvk != nil { + in, out := &in.DaemonsetsGvk, &out.DaemonsetsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.StatefulsetsGvk != nil { + in, out := &in.StatefulsetsGvk, &out.StatefulsetsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.JobsGvk != nil { + in, out := &in.JobsGvk, &out.JobsGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcGroupSpec. +func (in *SvcGroupSpec) DeepCopy() *SvcGroupSpec { + if in == nil { + return nil + } + out := new(SvcGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SvcQueryDetailArgs) DeepCopyInto(out *SvcQueryDetailArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcQueryDetailArgs. +func (in *SvcQueryDetailArgs) DeepCopy() *SvcQueryDetailArgs { + if in == nil { + return nil + } + out := new(SvcQueryDetailArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SvcQueryIncomingAPIsArgs) DeepCopyInto(out *SvcQueryIncomingAPIsArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcQueryIncomingAPIsArgs. +func (in *SvcQueryIncomingAPIsArgs) DeepCopy() *SvcQueryIncomingAPIsArgs { + if in == nil { + return nil + } + out := new(SvcQueryIncomingAPIsArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SvcQueryIncomingTCPArgs) DeepCopyInto(out *SvcQueryIncomingTCPArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcQueryIncomingTCPArgs. +func (in *SvcQueryIncomingTCPArgs) DeepCopy() *SvcQueryIncomingTCPArgs { + if in == nil { + return nil + } + out := new(SvcQueryIncomingTCPArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SvcQueryOutgoingAPIsArgs) DeepCopyInto(out *SvcQueryOutgoingAPIsArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcQueryOutgoingAPIsArgs. +func (in *SvcQueryOutgoingAPIsArgs) DeepCopy() *SvcQueryOutgoingAPIsArgs { + if in == nil { + return nil + } + out := new(SvcQueryOutgoingAPIsArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SvcQueryOutgoingTCPArgs) DeepCopyInto(out *SvcQueryOutgoingTCPArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcQueryOutgoingTCPArgs. +func (in *SvcQueryOutgoingTCPArgs) DeepCopy() *SvcQueryOutgoingTCPArgs { + if in == nil { + return nil + } + out := new(SvcQueryOutgoingTCPArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SvcQueryServiceVersionTableArgs) DeepCopyInto(out *SvcQueryServiceVersionTableArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcQueryServiceVersionTableArgs. +func (in *SvcQueryServiceVersionTableArgs) DeepCopy() *SvcQueryServiceVersionTableArgs { + if in == nil { + return nil + } + out := new(SvcQueryServiceVersionTableArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SvcQueryTopNArgs) DeepCopyInto(out *SvcQueryTopNArgs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcQueryTopNArgs. +func (in *SvcQueryTopNArgs) DeepCopy() *SvcQueryTopNArgs { + if in == nil { + return nil + } + out := new(SvcQueryTopNArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Table) DeepCopyInto(out *Table) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Table. +func (in *Table) DeepCopy() *Table { + if in == nil { + return nil + } + out := new(Table) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Table) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TableList) DeepCopyInto(out *TableList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Table, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TableList. +func (in *TableList) DeepCopy() *TableList { + if in == nil { + return nil + } + out := new(TableList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TableList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TableNexusStatus) DeepCopyInto(out *TableNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TableNexusStatus. +func (in *TableNexusStatus) DeepCopy() *TableNexusStatus { + if in == nil { + return nil + } + out := new(TableNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TableSpec) DeepCopyInto(out *TableSpec) { + *out = *in + if in.TemplateGvk != nil { + in, out := &in.TemplateGvk, &out.TemplateGvk + *out = new(Link) + **out = **in + } + if in.InventoryGvk != nil { + in, out := &in.InventoryGvk, &out.InventoryGvk + *out = new(Link) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TableSpec. +func (in *TableSpec) DeepCopy() *TableSpec { + if in == nil { + return nil + } + out := new(TableSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Template) DeepCopyInto(out *Template) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Template. +func (in *Template) DeepCopy() *Template { + if in == nil { + return nil + } + out := new(Template) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Template) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TemplateGroup) DeepCopyInto(out *TemplateGroup) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateGroup. +func (in *TemplateGroup) DeepCopy() *TemplateGroup { + if in == nil { + return nil + } + out := new(TemplateGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TemplateGroup) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TemplateGroupList) DeepCopyInto(out *TemplateGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]TemplateGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateGroupList. +func (in *TemplateGroupList) DeepCopy() *TemplateGroupList { + if in == nil { + return nil + } + out := new(TemplateGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TemplateGroupList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TemplateGroupNexusStatus) DeepCopyInto(out *TemplateGroupNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateGroupNexusStatus. +func (in *TemplateGroupNexusStatus) DeepCopy() *TemplateGroupNexusStatus { + if in == nil { + return nil + } + out := new(TemplateGroupNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TemplateGroupSpec) DeepCopyInto(out *TemplateGroupSpec) { + *out = *in + if in.DataTemplatesGvk != nil { + in, out := &in.DataTemplatesGvk, &out.DataTemplatesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.NodeTemplatesGvk != nil { + in, out := &in.NodeTemplatesGvk, &out.NodeTemplatesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AppTemplatesGvk != nil { + in, out := &in.AppTemplatesGvk, &out.AppTemplatesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServiceTemplatesGvk != nil { + in, out := &in.ServiceTemplatesGvk, &out.ServiceTemplatesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PolicyTemplatesGvk != nil { + in, out := &in.PolicyTemplatesGvk, &out.PolicyTemplatesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateGroupSpec. +func (in *TemplateGroupSpec) DeepCopy() *TemplateGroupSpec { + if in == nil { + return nil + } + out := new(TemplateGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TemplateList) DeepCopyInto(out *TemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Template, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateList. +func (in *TemplateList) DeepCopy() *TemplateList { + if in == nil { + return nil + } + out := new(TemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TemplateNexusStatus) DeepCopyInto(out *TemplateNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateNexusStatus. +func (in *TemplateNexusStatus) DeepCopy() *TemplateNexusStatus { + if in == nil { + return nil + } + out := new(TemplateNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TemplateSpec) DeepCopyInto(out *TemplateSpec) { + *out = *in + if in.TemplateGroupsGvk != nil { + in, out := &in.TemplateGroupsGvk, &out.TemplateGroupsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.HealthChecksGvk != nil { + in, out := &in.HealthChecksGvk, &out.HealthChecksGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateSpec. +func (in *TemplateSpec) DeepCopy() *TemplateSpec { + if in == nil { + return nil + } + out := new(TemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Tenant) DeepCopyInto(out *Tenant) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Tenant. +func (in *Tenant) DeepCopy() *Tenant { + if in == nil { + return nil + } + out := new(Tenant) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Tenant) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TenantList) DeepCopyInto(out *TenantList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Tenant, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantList. +func (in *TenantList) DeepCopy() *TenantList { + if in == nil { + return nil + } + out := new(TenantList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TenantList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TenantNexusStatus) DeepCopyInto(out *TenantNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantNexusStatus. +func (in *TenantNexusStatus) DeepCopy() *TenantNexusStatus { + if in == nil { + return nil + } + out := new(TenantNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TenantResource) DeepCopyInto(out *TenantResource) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantResource. +func (in *TenantResource) DeepCopy() *TenantResource { + if in == nil { + return nil + } + out := new(TenantResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TenantResource) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TenantResourceList) DeepCopyInto(out *TenantResourceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]TenantResource, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantResourceList. +func (in *TenantResourceList) DeepCopy() *TenantResourceList { + if in == nil { + return nil + } + out := new(TenantResourceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TenantResourceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TenantResourceNexusStatus) DeepCopyInto(out *TenantResourceNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantResourceNexusStatus. +func (in *TenantResourceNexusStatus) DeepCopy() *TenantResourceNexusStatus { + if in == nil { + return nil + } + out := new(TenantResourceNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TenantResourceSpec) DeepCopyInto(out *TenantResourceSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantResourceSpec. +func (in *TenantResourceSpec) DeepCopy() *TenantResourceSpec { + if in == nil { + return nil + } + out := new(TenantResourceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TenantSpec) DeepCopyInto(out *TenantSpec) { + *out = *in + if in.ResourcesGvk != nil { + in, out := &in.ResourcesGvk, &out.ResourcesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AnnotationsGvk != nil { + in, out := &in.AnnotationsGvk, &out.AnnotationsGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.TemplateGvk != nil { + in, out := &in.TemplateGvk, &out.TemplateGvk + *out = new(Link) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantSpec. +func (in *TenantSpec) DeepCopy() *TenantSpec { + if in == nil { + return nil + } + out := new(TenantSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TenantToken) DeepCopyInto(out *TenantToken) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantToken. +func (in *TenantToken) DeepCopy() *TenantToken { + if in == nil { + return nil + } + out := new(TenantToken) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TenantToken) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TenantTokenList) DeepCopyInto(out *TenantTokenList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]TenantToken, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantTokenList. +func (in *TenantTokenList) DeepCopy() *TenantTokenList { + if in == nil { + return nil + } + out := new(TenantTokenList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TenantTokenList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TenantTokenNexusStatus) DeepCopyInto(out *TenantTokenNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantTokenNexusStatus. +func (in *TenantTokenNexusStatus) DeepCopy() *TenantTokenNexusStatus { + if in == nil { + return nil + } + out := new(TenantTokenNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TenantTokenSpec) DeepCopyInto(out *TenantTokenSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantTokenSpec. +func (in *TenantTokenSpec) DeepCopy() *TenantTokenSpec { + if in == nil { + return nil + } + out := new(TenantTokenSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *User) DeepCopyInto(out *User) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new User. +func (in *User) DeepCopy() *User { + if in == nil { + return nil + } + out := new(User) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *User) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserDiscovery) DeepCopyInto(out *UserDiscovery) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserDiscovery. +func (in *UserDiscovery) DeepCopy() *UserDiscovery { + if in == nil { + return nil + } + out := new(UserDiscovery) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *UserDiscovery) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserDiscoveryList) DeepCopyInto(out *UserDiscoveryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]UserDiscovery, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserDiscoveryList. +func (in *UserDiscoveryList) DeepCopy() *UserDiscoveryList { + if in == nil { + return nil + } + out := new(UserDiscoveryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *UserDiscoveryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserDiscoveryNexusStatus) DeepCopyInto(out *UserDiscoveryNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserDiscoveryNexusStatus. +func (in *UserDiscoveryNexusStatus) DeepCopy() *UserDiscoveryNexusStatus { + if in == nil { + return nil + } + out := new(UserDiscoveryNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserDiscoveryRT) DeepCopyInto(out *UserDiscoveryRT) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserDiscoveryRT. +func (in *UserDiscoveryRT) DeepCopy() *UserDiscoveryRT { + if in == nil { + return nil + } + out := new(UserDiscoveryRT) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *UserDiscoveryRT) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserDiscoveryRTList) DeepCopyInto(out *UserDiscoveryRTList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]UserDiscoveryRT, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserDiscoveryRTList. +func (in *UserDiscoveryRTList) DeepCopy() *UserDiscoveryRTList { + if in == nil { + return nil + } + out := new(UserDiscoveryRTList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *UserDiscoveryRTList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserDiscoveryRTNexusStatus) DeepCopyInto(out *UserDiscoveryRTNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserDiscoveryRTNexusStatus. +func (in *UserDiscoveryRTNexusStatus) DeepCopy() *UserDiscoveryRTNexusStatus { + if in == nil { + return nil + } + out := new(UserDiscoveryRTNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserDiscoveryRTSpec) DeepCopyInto(out *UserDiscoveryRTSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserDiscoveryRTSpec. +func (in *UserDiscoveryRTSpec) DeepCopy() *UserDiscoveryRTSpec { + if in == nil { + return nil + } + out := new(UserDiscoveryRTSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserDiscoverySpec) DeepCopyInto(out *UserDiscoverySpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserDiscoverySpec. +func (in *UserDiscoverySpec) DeepCopy() *UserDiscoverySpec { + if in == nil { + return nil + } + out := new(UserDiscoverySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserFolder) DeepCopyInto(out *UserFolder) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserFolder. +func (in *UserFolder) DeepCopy() *UserFolder { + if in == nil { + return nil + } + out := new(UserFolder) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *UserFolder) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserFolderList) DeepCopyInto(out *UserFolderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]UserFolder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserFolderList. +func (in *UserFolderList) DeepCopy() *UserFolderList { + if in == nil { + return nil + } + out := new(UserFolderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *UserFolderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserFolderNexusStatus) DeepCopyInto(out *UserFolderNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserFolderNexusStatus. +func (in *UserFolderNexusStatus) DeepCopy() *UserFolderNexusStatus { + if in == nil { + return nil + } + out := new(UserFolderNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserFolderSpec) DeepCopyInto(out *UserFolderSpec) { + *out = *in + if in.UsersGvk != nil { + in, out := &in.UsersGvk, &out.UsersGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AppUsersGvk != nil { + in, out := &in.AppUsersGvk, &out.AppUsersGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AccessTokenGvk != nil { + in, out := &in.AccessTokenGvk, &out.AccessTokenGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserFolderSpec. +func (in *UserFolderSpec) DeepCopy() *UserFolderSpec { + if in == nil { + return nil + } + out := new(UserFolderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserGroup) DeepCopyInto(out *UserGroup) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserGroup. +func (in *UserGroup) DeepCopy() *UserGroup { + if in == nil { + return nil + } + out := new(UserGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *UserGroup) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserGroupList) DeepCopyInto(out *UserGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]UserGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserGroupList. +func (in *UserGroupList) DeepCopy() *UserGroupList { + if in == nil { + return nil + } + out := new(UserGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *UserGroupList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserGroupNexusStatus) DeepCopyInto(out *UserGroupNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserGroupNexusStatus. +func (in *UserGroupNexusStatus) DeepCopy() *UserGroupNexusStatus { + if in == nil { + return nil + } + out := new(UserGroupNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserGroupSpec) DeepCopyInto(out *UserGroupSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserGroupSpec. +func (in *UserGroupSpec) DeepCopy() *UserGroupSpec { + if in == nil { + return nil + } + out := new(UserGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserList) DeepCopyInto(out *UserList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]User, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserList. +func (in *UserList) DeepCopy() *UserList { + if in == nil { + return nil + } + out := new(UserList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *UserList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserNexusStatus) DeepCopyInto(out *UserNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserNexusStatus. +func (in *UserNexusStatus) DeepCopy() *UserNexusStatus { + if in == nil { + return nil + } + out := new(UserNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserPreference) DeepCopyInto(out *UserPreference) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserPreference. +func (in *UserPreference) DeepCopy() *UserPreference { + if in == nil { + return nil + } + out := new(UserPreference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *UserPreference) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserPreferenceList) DeepCopyInto(out *UserPreferenceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]UserPreference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserPreferenceList. +func (in *UserPreferenceList) DeepCopy() *UserPreferenceList { + if in == nil { + return nil + } + out := new(UserPreferenceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *UserPreferenceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserPreferenceNexusStatus) DeepCopyInto(out *UserPreferenceNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserPreferenceNexusStatus. +func (in *UserPreferenceNexusStatus) DeepCopy() *UserPreferenceNexusStatus { + if in == nil { + return nil + } + out := new(UserPreferenceNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserPreferenceSpec) DeepCopyInto(out *UserPreferenceSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserPreferenceSpec. +func (in *UserPreferenceSpec) DeepCopy() *UserPreferenceSpec { + if in == nil { + return nil + } + out := new(UserPreferenceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserSpec) DeepCopyInto(out *UserSpec) { + *out = *in + if in.AccessTokens != nil { + in, out := &in.AccessTokens, &out.AccessTokens + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.PreferencesGvk != nil { + in, out := &in.PreferencesGvk, &out.PreferencesGvk + *out = make(map[string]Child, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserSpec. +func (in *UserSpec) DeepCopy() *UserSpec { + if in == nil { + return nil + } + out := new(UserSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualService) DeepCopyInto(out *VirtualService) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualService. +func (in *VirtualService) DeepCopy() *VirtualService { + if in == nil { + return nil + } + out := new(VirtualService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualService) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualServiceList) DeepCopyInto(out *VirtualServiceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VirtualService, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualServiceList. +func (in *VirtualServiceList) DeepCopy() *VirtualServiceList { + if in == nil { + return nil + } + out := new(VirtualServiceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualServiceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualServiceNexusStatus) DeepCopyInto(out *VirtualServiceNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualServiceNexusStatus. +func (in *VirtualServiceNexusStatus) DeepCopy() *VirtualServiceNexusStatus { + if in == nil { + return nil + } + out := new(VirtualServiceNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualServiceSpec) DeepCopyInto(out *VirtualServiceSpec) { + *out = *in + if in.ExportTo != nil { + in, out := &in.ExportTo, &out.ExportTo + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.DestinationRulesGvk != nil { + in, out := &in.DestinationRulesGvk, &out.DestinationRulesGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ServicesGvk != nil { + in, out := &in.ServicesGvk, &out.ServicesGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.GatewaysGvk != nil { + in, out := &in.GatewaysGvk, &out.GatewaysGvk + *out = make(map[string]Link, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualServiceSpec. +func (in *VirtualServiceSpec) DeepCopy() *VirtualServiceSpec { + if in == nil { + return nil + } + out := new(VirtualServiceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadEntry) DeepCopyInto(out *WorkloadEntry) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadEntry. +func (in *WorkloadEntry) DeepCopy() *WorkloadEntry { + if in == nil { + return nil + } + out := new(WorkloadEntry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkloadEntry) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadEntryList) DeepCopyInto(out *WorkloadEntryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]WorkloadEntry, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadEntryList. +func (in *WorkloadEntryList) DeepCopy() *WorkloadEntryList { + if in == nil { + return nil + } + out := new(WorkloadEntryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkloadEntryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadEntryNexusStatus) DeepCopyInto(out *WorkloadEntryNexusStatus) { + *out = *in + out.Nexus = in.Nexus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadEntryNexusStatus. +func (in *WorkloadEntryNexusStatus) DeepCopy() *WorkloadEntryNexusStatus { + if in == nil { + return nil + } + out := new(WorkloadEntryNexusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadEntrySpec) DeepCopyInto(out *WorkloadEntrySpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadEntrySpec. +func (in *WorkloadEntrySpec) DeepCopy() *WorkloadEntrySpec { + if in == nil { + return nil + } + out := new(WorkloadEntrySpec) + in.DeepCopyInto(out) + return out +} diff --git a/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/register.go b/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/register.go deleted file mode 100644 index 7d4a09db8..000000000 --- a/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/register.go +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -package gns_tsm_tanzu_vmware_com - -const ( - GroupName = "gns.tsm.tanzu.vmware.com" -) diff --git a/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1/doc.go b/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1/doc.go deleted file mode 100644 index fc7074cd2..000000000 --- a/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -// +k8s:deepcopy-gen=package -// +groupName=gns.tsm.tanzu.vmware.com -// +groupGoName=GnsTsm - -package v1 diff --git a/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1/register.go b/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1/register.go deleted file mode 100644 index fed8a8565..000000000 --- a/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1/register.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -package v1 - -import ( - gns_tsm_tanzu_vmware_com "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -const ResourceVersion = "v1" - -// GroupVersion is the identifier for the API which includes -// the name of the group and the version of the API -var SchemeGroupVersion = schema.GroupVersion{ - Group: gns_tsm_tanzu_vmware_com.GroupName, - Version: ResourceVersion, -} - -// Kind takes an unqualified kind and returns back a Group qualified GroupKind -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -// addKnownTypes adds our types to the API scheme by registering -// MyResource and MyResourceList -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes( - SchemeGroupVersion, - &RandomGnsData{}, - &RandomGnsDataList{}, - &Foo{}, - &FooList{}, - &Gns{}, - &GnsList{}, - &BarChild{}, - &BarChildList{}, - &IgnoreChild{}, - &IgnoreChildList{}, - &Dns{}, - &DnsList{}, - &AdditionalGnsData{}, - &AdditionalGnsDataList{}, - ) - - // register the type in the scheme - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1/types.go b/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1/types.go deleted file mode 100644 index a7035b092..000000000 --- a/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1/types.go +++ /dev/null @@ -1,442 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -package v1 - -import ( - cartv1 "github.com/vmware-tanzu/cartographer/pkg/apis/v1alpha1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/common" -) - -// +k8s:openapi-gen=true -type Child struct { - Group string `json:"group" yaml:"group"` - Kind string `json:"kind" yaml:"kind"` - Name string `json:"name" yaml:"name"` -} - -// +k8s:openapi-gen=true -type Link struct { - Group string `json:"group" yaml:"group"` - Kind string `json:"kind" yaml:"kind"` - Name string `json:"name" yaml:"name"` -} - -// +k8s:openapi-gen=true -type NexusStatus struct { - SourceGeneration int64 `json:"sourceGeneration" yaml:"sourceGeneration"` - RemoteGeneration int64 `json:"remoteGeneration" yaml:"remoteGeneration"` -} - -/* ------------------- CRDs definitions ------------------- */ - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type RandomGnsData struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - Spec RandomGnsDataSpec `json:"spec,omitempty" yaml:"spec,omitempty"` - Status RandomGnsDataNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type RandomGnsDataNexusStatus struct { - Status RandomStatus `json:"status,omitempty" yaml:"status,omitempty"` - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *RandomGnsData) CRDName() string { - return "randomgnsdatas.gns.tsm.tanzu.vmware.com" -} - -func (c *RandomGnsData) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:openapi-gen=true -type RandomGnsDataSpec struct { - Description RandomDescription `json:"description" yaml:"description"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type RandomGnsDataList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []RandomGnsData `json:"items" yaml:"items"` -} - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type Foo struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - Spec FooSpec `json:"spec,omitempty" yaml:"spec,omitempty"` - Status FooNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type FooNexusStatus struct { - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *Foo) CRDName() string { - return "foos.gns.tsm.tanzu.vmware.com" -} - -func (c *Foo) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:openapi-gen=true -type FooSpec struct { - Password string `json:"password" yaml:"password"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type FooList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []Foo `json:"items" yaml:"items"` -} - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type Gns struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - Spec GnsSpec `json:"spec,omitempty" yaml:"spec,omitempty"` - Status GnsNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type GnsNexusStatus struct { - State GnsState `json:"state,omitempty" yaml:"state,omitempty"` - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *Gns) CRDName() string { - return "gnses.gns.tsm.tanzu.vmware.com" -} - -func (c *Gns) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:openapi-gen=true -type GnsSpec struct { - //nexus-validation: MaxLength=8, MinLength=2 - //nexus-validation: Pattern=abc - Domain string `json:"domain" yaml:"domain"` - UseSharedGateway bool `json:"useSharedGateway" yaml:"useSharedGateway"` - Description Description `json:"description" yaml:"description"` - Meta string `json:"meta" yaml:"meta"` - Port *int `json:"port" yaml:"port"` - OtherDescription *Description `json:"otherDescription" yaml:"otherDescription"` - MapPointer *map[string]string `json:"mapPointer" yaml:"mapPointer"` - SlicePointer *[]string `json:"slicePointer" yaml:"slicePointer"` - WorkloadSpec cartv1.WorkloadSpec `json:"workloadSpec" yaml:"workloadSpec"` - DifferentSpec *cartv1.WorkloadSpec `json:"differentSpec" yaml:"differentSpec"` - ServiceSegmentRef ServiceSegmentRef `json:"serviceSegmentRef,omitempty"` - ServiceSegmentRefPointer *ServiceSegmentRef `json:"serviceSegmentRefPointer,omitempty"` - ServiceSegmentRefs []ServiceSegmentRef `json:"serviceSegmentRefs,omitempty"` - ServiceSegmentRefMap map[string]ServiceSegmentRef `json:"serviceSegmentRefMap,omitempty"` - GnsServiceGroupsGvk map[string]Child `json:"gnsServiceGroupsGvk,omitempty" yaml:"gnsServiceGroupsGvk,omitempty" nexus:"children"` - GnsAccessControlPolicyGvk *Child `json:"gnsAccessControlPolicyGvk,omitempty" yaml:"gnsAccessControlPolicyGvk,omitempty" nexus:"child"` - FooChildGvk *Child `json:"fooChildGvk,omitempty" yaml:"fooChildGvk,omitempty" nexus:"child"` - IgnoreChildGvk *Child `json:"ignoreChildGvk,omitempty" yaml:"ignoreChildGvk,omitempty" nexus:"child"` - FooGvk *Child `json:"fooGvk,omitempty" yaml:"fooGvk,omitempty" nexus:"child"` - DnsGvk *Link `json:"dnsGvk,omitempty" yaml:"dnsGvk,omitempty" nexus:"link"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type GnsList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []Gns `json:"items" yaml:"items"` -} - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type BarChild struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - Spec BarChildSpec `json:"spec,omitempty" yaml:"spec,omitempty"` - Status BarChildNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type BarChildNexusStatus struct { - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *BarChild) CRDName() string { - return "barchilds.gns.tsm.tanzu.vmware.com" -} - -func (c *BarChild) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:openapi-gen=true -type BarChildSpec struct { - Name string `json:"name" yaml:"name"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type BarChildList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []BarChild `json:"items" yaml:"items"` -} - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type IgnoreChild struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - Spec IgnoreChildSpec `json:"spec,omitempty" yaml:"spec,omitempty"` - Status IgnoreChildNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type IgnoreChildNexusStatus struct { - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *IgnoreChild) CRDName() string { - return "ignorechilds.gns.tsm.tanzu.vmware.com" -} - -func (c *IgnoreChild) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:openapi-gen=true -type IgnoreChildSpec struct { - Name string `json:"name" yaml:"name"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type IgnoreChildList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []IgnoreChild `json:"items" yaml:"items"` -} - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type Dns struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - - Status DnsNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type DnsNexusStatus struct { - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *Dns) CRDName() string { - return "dnses.gns.tsm.tanzu.vmware.com" -} - -func (c *Dns) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type DnsList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []Dns `json:"items" yaml:"items"` -} - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type AdditionalGnsData struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - Spec AdditionalGnsDataSpec `json:"spec,omitempty" yaml:"spec,omitempty"` - Status AdditionalGnsDataNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type AdditionalGnsDataNexusStatus struct { - Status AdditionalStatus `json:"status,omitempty" yaml:"status,omitempty"` - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *AdditionalGnsData) CRDName() string { - return "additionalgnsdatas.gns.tsm.tanzu.vmware.com" -} - -func (c *AdditionalGnsData) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:openapi-gen=true -type AdditionalGnsDataSpec struct { - Description AdditionalDescription `json:"description" yaml:"description"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type AdditionalGnsDataList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []AdditionalGnsData `json:"items" yaml:"items"` -} - -// +k8s:openapi-gen=true -type RandomDescription struct { - DiscriptionA string `json:"discriptionA" yaml:"discriptionA"` - DiscriptionB string `json:"discriptionB" yaml:"discriptionB"` - DiscriptionC string `json:"discriptionC" yaml:"discriptionC"` - DiscriptionD string `json:"discriptionD" yaml:"discriptionD"` -} - -// +k8s:openapi-gen=true -type RandomStatus struct { - StatusX int `json:"statusX" yaml:"statusX"` - StatusY int `json:"statusY" yaml:"statusY"` -} - -// +k8s:openapi-gen=true -type HostPort struct { - Host Host `json:"host" yaml:"host"` - Port Port `json:"port" yaml:"port"` -} - -// +k8s:openapi-gen=true -type ReplicationSource struct { - Kind SourceKind `json:"kind" yaml:"kind"` -} - -// +k8s:openapi-gen=true -type gnsQueryFilters struct { - StartTime string `json:"startTime" yaml:"startTime"` - EndTime string `json:"endTime" yaml:"endTime"` - Interval string `json:"interval" yaml:"interval"` - IsServiceDeployment bool `json:"isServiceDeployment" yaml:"isServiceDeployment"` - StartVal int `json:"startVal" yaml:"startVal"` -} - -// +k8s:openapi-gen=true -type metricsFilers struct { - StartTime string `json:"startTime" yaml:"startTime"` - EndTime string `json:"endTime" yaml:"endTime"` - TimeInterval string `json:"timeInterval" yaml:"timeInterval"` - SomeUserArg1 string `json:"someUserArg1" yaml:"someUserArg1"` - SomeUserArg2 int `json:"someUserArg2" yaml:"someUserArg2"` - SomeUserArg3 bool `json:"someUserArg3" yaml:"someUserArg3"` -} - -// +k8s:openapi-gen=true -type ServiceSegmentRef struct { - Field1 string `json:"field1" yaml:"field1"` - Field2 string `json:"field2" yaml:"field2"` -} - -// +k8s:openapi-gen=true -type Description struct { - Color string `json:"color" yaml:"color"` - Version string `json:"version" yaml:"version"` - ProjectId string `json:"projectId" yaml:"projectId"` - TestAns []Answer `json:"testAns" yaml:"testAns"` - Instance Instance `json:"instance" yaml:"instance"` - HostPort HostPort `json:"hostPort" yaml:"hostPort"` -} - -// +k8s:openapi-gen=true -type Answer struct { - Name string `json:"name" yaml:"name"` -} - -// +k8s:openapi-gen=true -type GnsState struct { - Working bool `json:"working" yaml:"working"` - Temperature int `json:"temperature" yaml:"temperature"` -} - -// +k8s:openapi-gen=true -type AdditionalDescription struct { - DiscriptionA string `json:"discriptionA" yaml:"discriptionA"` - DiscriptionB string `json:"discriptionB" yaml:"discriptionB"` - DiscriptionC string `json:"discriptionC" yaml:"discriptionC"` - DiscriptionD string `json:"discriptionD" yaml:"discriptionD"` -} - -// +k8s:openapi-gen=true -type AdditionalStatus struct { - StatusX int `json:"statusX" yaml:"statusX"` - StatusY int `json:"statusY" yaml:"statusY"` -} - -type RandomConst1 string -type RandomConst2 string -type RandomConst3 string -type MyConst string -type SourceKind string -type Port uint16 -type Host string -type Instance float32 -type AliasArr []int -type MyStr string -type TempConst1 string -type TempConst2 string -type TempConst3 string - -const ( - MyConst3 RandomConst3 = "Const3" - MyConst2 RandomConst2 = "Const2" - MyConst1 RandomConst1 = "Const1" - Object SourceKind = "Object" - Type SourceKind = "Type" - XYZ MyConst = "xyz" - Const3 TempConst3 = "Const3" - Const2 TempConst2 = "Const2" - Const1 TempConst1 = "Const1" -) diff --git a/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go b/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go deleted file mode 100644 index 64ae51a77..000000000 --- a/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,994 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -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 deepcopy-gen. DO NOT EDIT. - -package v1 - -import ( - v1alpha1 "github.com/vmware-tanzu/cartographer/pkg/apis/v1alpha1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdditionalDescription) DeepCopyInto(out *AdditionalDescription) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalDescription. -func (in *AdditionalDescription) DeepCopy() *AdditionalDescription { - if in == nil { - return nil - } - out := new(AdditionalDescription) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdditionalGnsData) DeepCopyInto(out *AdditionalGnsData) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalGnsData. -func (in *AdditionalGnsData) DeepCopy() *AdditionalGnsData { - if in == nil { - return nil - } - out := new(AdditionalGnsData) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AdditionalGnsData) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdditionalGnsDataList) DeepCopyInto(out *AdditionalGnsDataList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AdditionalGnsData, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalGnsDataList. -func (in *AdditionalGnsDataList) DeepCopy() *AdditionalGnsDataList { - if in == nil { - return nil - } - out := new(AdditionalGnsDataList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AdditionalGnsDataList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdditionalGnsDataNexusStatus) DeepCopyInto(out *AdditionalGnsDataNexusStatus) { - *out = *in - out.Status = in.Status - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalGnsDataNexusStatus. -func (in *AdditionalGnsDataNexusStatus) DeepCopy() *AdditionalGnsDataNexusStatus { - if in == nil { - return nil - } - out := new(AdditionalGnsDataNexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdditionalGnsDataSpec) DeepCopyInto(out *AdditionalGnsDataSpec) { - *out = *in - out.Description = in.Description - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalGnsDataSpec. -func (in *AdditionalGnsDataSpec) DeepCopy() *AdditionalGnsDataSpec { - if in == nil { - return nil - } - out := new(AdditionalGnsDataSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdditionalStatus) DeepCopyInto(out *AdditionalStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalStatus. -func (in *AdditionalStatus) DeepCopy() *AdditionalStatus { - if in == nil { - return nil - } - out := new(AdditionalStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in AliasArr) DeepCopyInto(out *AliasArr) { - { - in := &in - *out = make(AliasArr, len(*in)) - copy(*out, *in) - return - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AliasArr. -func (in AliasArr) DeepCopy() AliasArr { - if in == nil { - return nil - } - out := new(AliasArr) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Answer) DeepCopyInto(out *Answer) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Answer. -func (in *Answer) DeepCopy() *Answer { - if in == nil { - return nil - } - out := new(Answer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BarChild) DeepCopyInto(out *BarChild) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BarChild. -func (in *BarChild) DeepCopy() *BarChild { - if in == nil { - return nil - } - out := new(BarChild) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BarChild) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BarChildList) DeepCopyInto(out *BarChildList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]BarChild, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BarChildList. -func (in *BarChildList) DeepCopy() *BarChildList { - if in == nil { - return nil - } - out := new(BarChildList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BarChildList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BarChildNexusStatus) DeepCopyInto(out *BarChildNexusStatus) { - *out = *in - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BarChildNexusStatus. -func (in *BarChildNexusStatus) DeepCopy() *BarChildNexusStatus { - if in == nil { - return nil - } - out := new(BarChildNexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BarChildSpec) DeepCopyInto(out *BarChildSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BarChildSpec. -func (in *BarChildSpec) DeepCopy() *BarChildSpec { - if in == nil { - return nil - } - out := new(BarChildSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Child) DeepCopyInto(out *Child) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Child. -func (in *Child) DeepCopy() *Child { - if in == nil { - return nil - } - out := new(Child) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Description) DeepCopyInto(out *Description) { - *out = *in - if in.TestAns != nil { - in, out := &in.TestAns, &out.TestAns - *out = make([]Answer, len(*in)) - copy(*out, *in) - } - out.HostPort = in.HostPort - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Description. -func (in *Description) DeepCopy() *Description { - if in == nil { - return nil - } - out := new(Description) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Dns) DeepCopyInto(out *Dns) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Dns. -func (in *Dns) DeepCopy() *Dns { - if in == nil { - return nil - } - out := new(Dns) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Dns) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DnsList) DeepCopyInto(out *DnsList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Dns, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DnsList. -func (in *DnsList) DeepCopy() *DnsList { - if in == nil { - return nil - } - out := new(DnsList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DnsList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DnsNexusStatus) DeepCopyInto(out *DnsNexusStatus) { - *out = *in - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DnsNexusStatus. -func (in *DnsNexusStatus) DeepCopy() *DnsNexusStatus { - if in == nil { - return nil - } - out := new(DnsNexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Foo) DeepCopyInto(out *Foo) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Foo. -func (in *Foo) DeepCopy() *Foo { - if in == nil { - return nil - } - out := new(Foo) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Foo) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FooList) DeepCopyInto(out *FooList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Foo, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FooList. -func (in *FooList) DeepCopy() *FooList { - if in == nil { - return nil - } - out := new(FooList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *FooList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FooNexusStatus) DeepCopyInto(out *FooNexusStatus) { - *out = *in - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FooNexusStatus. -func (in *FooNexusStatus) DeepCopy() *FooNexusStatus { - if in == nil { - return nil - } - out := new(FooNexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FooSpec) DeepCopyInto(out *FooSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FooSpec. -func (in *FooSpec) DeepCopy() *FooSpec { - if in == nil { - return nil - } - out := new(FooSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Gns) DeepCopyInto(out *Gns) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Gns. -func (in *Gns) DeepCopy() *Gns { - if in == nil { - return nil - } - out := new(Gns) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Gns) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GnsList) DeepCopyInto(out *GnsList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Gns, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsList. -func (in *GnsList) DeepCopy() *GnsList { - if in == nil { - return nil - } - out := new(GnsList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GnsList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GnsNexusStatus) DeepCopyInto(out *GnsNexusStatus) { - *out = *in - out.State = in.State - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsNexusStatus. -func (in *GnsNexusStatus) DeepCopy() *GnsNexusStatus { - if in == nil { - return nil - } - out := new(GnsNexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GnsSpec) DeepCopyInto(out *GnsSpec) { - *out = *in - in.Description.DeepCopyInto(&out.Description) - if in.Port != nil { - in, out := &in.Port, &out.Port - *out = new(int) - **out = **in - } - if in.OtherDescription != nil { - in, out := &in.OtherDescription, &out.OtherDescription - *out = new(Description) - (*in).DeepCopyInto(*out) - } - if in.MapPointer != nil { - in, out := &in.MapPointer, &out.MapPointer - *out = new(map[string]string) - if **in != nil { - in, out := *in, *out - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - } - if in.SlicePointer != nil { - in, out := &in.SlicePointer, &out.SlicePointer - *out = new([]string) - if **in != nil { - in, out := *in, *out - *out = make([]string, len(*in)) - copy(*out, *in) - } - } - in.WorkloadSpec.DeepCopyInto(&out.WorkloadSpec) - if in.DifferentSpec != nil { - in, out := &in.DifferentSpec, &out.DifferentSpec - *out = new(v1alpha1.WorkloadSpec) - (*in).DeepCopyInto(*out) - } - out.ServiceSegmentRef = in.ServiceSegmentRef - if in.ServiceSegmentRefPointer != nil { - in, out := &in.ServiceSegmentRefPointer, &out.ServiceSegmentRefPointer - *out = new(ServiceSegmentRef) - **out = **in - } - if in.ServiceSegmentRefs != nil { - in, out := &in.ServiceSegmentRefs, &out.ServiceSegmentRefs - *out = make([]ServiceSegmentRef, len(*in)) - copy(*out, *in) - } - if in.ServiceSegmentRefMap != nil { - in, out := &in.ServiceSegmentRefMap, &out.ServiceSegmentRefMap - *out = make(map[string]ServiceSegmentRef, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.GnsServiceGroupsGvk != nil { - in, out := &in.GnsServiceGroupsGvk, &out.GnsServiceGroupsGvk - *out = make(map[string]Child, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.GnsAccessControlPolicyGvk != nil { - in, out := &in.GnsAccessControlPolicyGvk, &out.GnsAccessControlPolicyGvk - *out = new(Child) - **out = **in - } - if in.FooChildGvk != nil { - in, out := &in.FooChildGvk, &out.FooChildGvk - *out = new(Child) - **out = **in - } - if in.IgnoreChildGvk != nil { - in, out := &in.IgnoreChildGvk, &out.IgnoreChildGvk - *out = new(Child) - **out = **in - } - if in.FooGvk != nil { - in, out := &in.FooGvk, &out.FooGvk - *out = new(Child) - **out = **in - } - if in.DnsGvk != nil { - in, out := &in.DnsGvk, &out.DnsGvk - *out = new(Link) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsSpec. -func (in *GnsSpec) DeepCopy() *GnsSpec { - if in == nil { - return nil - } - out := new(GnsSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GnsState) DeepCopyInto(out *GnsState) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GnsState. -func (in *GnsState) DeepCopy() *GnsState { - if in == nil { - return nil - } - out := new(GnsState) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HostPort) DeepCopyInto(out *HostPort) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostPort. -func (in *HostPort) DeepCopy() *HostPort { - if in == nil { - return nil - } - out := new(HostPort) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IgnoreChild) DeepCopyInto(out *IgnoreChild) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IgnoreChild. -func (in *IgnoreChild) DeepCopy() *IgnoreChild { - if in == nil { - return nil - } - out := new(IgnoreChild) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *IgnoreChild) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IgnoreChildList) DeepCopyInto(out *IgnoreChildList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]IgnoreChild, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IgnoreChildList. -func (in *IgnoreChildList) DeepCopy() *IgnoreChildList { - if in == nil { - return nil - } - out := new(IgnoreChildList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *IgnoreChildList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IgnoreChildNexusStatus) DeepCopyInto(out *IgnoreChildNexusStatus) { - *out = *in - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IgnoreChildNexusStatus. -func (in *IgnoreChildNexusStatus) DeepCopy() *IgnoreChildNexusStatus { - if in == nil { - return nil - } - out := new(IgnoreChildNexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IgnoreChildSpec) DeepCopyInto(out *IgnoreChildSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IgnoreChildSpec. -func (in *IgnoreChildSpec) DeepCopy() *IgnoreChildSpec { - if in == nil { - return nil - } - out := new(IgnoreChildSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Link) DeepCopyInto(out *Link) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Link. -func (in *Link) DeepCopy() *Link { - if in == nil { - return nil - } - out := new(Link) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NexusStatus) DeepCopyInto(out *NexusStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NexusStatus. -func (in *NexusStatus) DeepCopy() *NexusStatus { - if in == nil { - return nil - } - out := new(NexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RandomDescription) DeepCopyInto(out *RandomDescription) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RandomDescription. -func (in *RandomDescription) DeepCopy() *RandomDescription { - if in == nil { - return nil - } - out := new(RandomDescription) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RandomGnsData) DeepCopyInto(out *RandomGnsData) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RandomGnsData. -func (in *RandomGnsData) DeepCopy() *RandomGnsData { - if in == nil { - return nil - } - out := new(RandomGnsData) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RandomGnsData) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RandomGnsDataList) DeepCopyInto(out *RandomGnsDataList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]RandomGnsData, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RandomGnsDataList. -func (in *RandomGnsDataList) DeepCopy() *RandomGnsDataList { - if in == nil { - return nil - } - out := new(RandomGnsDataList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RandomGnsDataList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RandomGnsDataNexusStatus) DeepCopyInto(out *RandomGnsDataNexusStatus) { - *out = *in - out.Status = in.Status - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RandomGnsDataNexusStatus. -func (in *RandomGnsDataNexusStatus) DeepCopy() *RandomGnsDataNexusStatus { - if in == nil { - return nil - } - out := new(RandomGnsDataNexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RandomGnsDataSpec) DeepCopyInto(out *RandomGnsDataSpec) { - *out = *in - out.Description = in.Description - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RandomGnsDataSpec. -func (in *RandomGnsDataSpec) DeepCopy() *RandomGnsDataSpec { - if in == nil { - return nil - } - out := new(RandomGnsDataSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RandomStatus) DeepCopyInto(out *RandomStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RandomStatus. -func (in *RandomStatus) DeepCopy() *RandomStatus { - if in == nil { - return nil - } - out := new(RandomStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReplicationSource) DeepCopyInto(out *ReplicationSource) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicationSource. -func (in *ReplicationSource) DeepCopy() *ReplicationSource { - if in == nil { - return nil - } - out := new(ReplicationSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceSegmentRef) DeepCopyInto(out *ServiceSegmentRef) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceSegmentRef. -func (in *ServiceSegmentRef) DeepCopy() *ServiceSegmentRef { - if in == nil { - return nil - } - out := new(ServiceSegmentRef) - in.DeepCopyInto(out) - return out -} diff --git a/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/register.go b/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/register.go deleted file mode 100644 index e02096e2c..000000000 --- a/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/register.go +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -package policypkg_tsm_tanzu_vmware_com - -const ( - GroupName = "policypkg.tsm.tanzu.vmware.com" -) diff --git a/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1/doc.go b/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1/doc.go deleted file mode 100644 index f9d08510d..000000000 --- a/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -// +k8s:deepcopy-gen=package -// +groupName=policypkg.tsm.tanzu.vmware.com -// +groupGoName=PolicypkgTsm - -package v1 diff --git a/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1/register.go b/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1/register.go deleted file mode 100644 index 938445fc9..000000000 --- a/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1/register.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -package v1 - -import ( - policypkg_tsm_tanzu_vmware_com "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -const ResourceVersion = "v1" - -// GroupVersion is the identifier for the API which includes -// the name of the group and the version of the API -var SchemeGroupVersion = schema.GroupVersion{ - Group: policypkg_tsm_tanzu_vmware_com.GroupName, - Version: ResourceVersion, -} - -// Kind takes an unqualified kind and returns back a Group qualified GroupKind -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -// addKnownTypes adds our types to the API scheme by registering -// MyResource and MyResourceList -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes( - SchemeGroupVersion, - &AdditionalPolicyData{}, - &AdditionalPolicyDataList{}, - &AccessControlPolicy{}, - &AccessControlPolicyList{}, - &ACPConfig{}, - &ACPConfigList{}, - &VMpolicy{}, - &VMpolicyList{}, - &RandomPolicyData{}, - &RandomPolicyDataList{}, - ) - - // register the type in the scheme - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1/types.go b/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1/types.go deleted file mode 100644 index 925f915a7..000000000 --- a/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1/types.go +++ /dev/null @@ -1,316 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/common" -) - -// +k8s:openapi-gen=true -type Child struct { - Group string `json:"group" yaml:"group"` - Kind string `json:"kind" yaml:"kind"` - Name string `json:"name" yaml:"name"` -} - -// +k8s:openapi-gen=true -type Link struct { - Group string `json:"group" yaml:"group"` - Kind string `json:"kind" yaml:"kind"` - Name string `json:"name" yaml:"name"` -} - -// +k8s:openapi-gen=true -type NexusStatus struct { - SourceGeneration int64 `json:"sourceGeneration" yaml:"sourceGeneration"` - RemoteGeneration int64 `json:"remoteGeneration" yaml:"remoteGeneration"` -} - -/* ------------------- CRDs definitions ------------------- */ - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type AdditionalPolicyData struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - Spec AdditionalPolicyDataSpec `json:"spec,omitempty" yaml:"spec,omitempty"` - Status AdditionalPolicyDataNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type AdditionalPolicyDataNexusStatus struct { - Status AdditionalStatus `json:"status,omitempty" yaml:"status,omitempty"` - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *AdditionalPolicyData) CRDName() string { - return "additionalpolicydatas.policypkg.tsm.tanzu.vmware.com" -} - -func (c *AdditionalPolicyData) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:openapi-gen=true -type AdditionalPolicyDataSpec struct { - Description AdditionalDescription `json:"description" yaml:"description"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type AdditionalPolicyDataList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []AdditionalPolicyData `json:"items" yaml:"items"` -} - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type AccessControlPolicy struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - Spec AccessControlPolicySpec `json:"spec,omitempty" yaml:"spec,omitempty"` - Status AccessControlPolicyNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type AccessControlPolicyNexusStatus struct { - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *AccessControlPolicy) CRDName() string { - return "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com" -} - -func (c *AccessControlPolicy) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:openapi-gen=true -type AccessControlPolicySpec struct { - PolicyConfigsGvk map[string]Child `json:"policyConfigsGvk,omitempty" yaml:"policyConfigsGvk,omitempty" nexus:"children"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type AccessControlPolicyList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []AccessControlPolicy `json:"items" yaml:"items"` -} - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type ACPConfig struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - Spec ACPConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` - Status ACPConfigNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type ACPConfigNexusStatus struct { - Status ACPStatus `json:"status,omitempty" yaml:"status,omitempty"` - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *ACPConfig) CRDName() string { - return "acpconfigs.policypkg.tsm.tanzu.vmware.com" -} - -func (c *ACPConfig) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:openapi-gen=true -type ACPConfigSpec struct { - DisplayName string `json:"displayName" yaml:"displayName"` - Gns string `json:"gns" yaml:"gns"` - Description string `json:"description" yaml:"description"` - Tags []string `json:"tags" yaml:"tags"` - ProjectId string `json:"projectId" yaml:"projectId"` - Conditions []string `json:"conditions" yaml:"conditions"` - DestSvcGroupsGvk map[string]Link `json:"destSvcGroupsGvk,omitempty" yaml:"destSvcGroupsGvk,omitempty" nexus:"links"` - SourceSvcGroupsGvk map[string]Link `json:"sourceSvcGroupsGvk,omitempty" yaml:"sourceSvcGroupsGvk,omitempty" nexus:"links"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type ACPConfigList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []ACPConfig `json:"items" yaml:"items"` -} - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type VMpolicy struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - - Status VMpolicyNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type VMpolicyNexusStatus struct { - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *VMpolicy) CRDName() string { - return "vmpolicies.policypkg.tsm.tanzu.vmware.com" -} - -func (c *VMpolicy) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type VMpolicyList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []VMpolicy `json:"items" yaml:"items"` -} - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type RandomPolicyData struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - Spec RandomPolicyDataSpec `json:"spec,omitempty" yaml:"spec,omitempty"` - Status RandomPolicyDataNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type RandomPolicyDataNexusStatus struct { - Status RandomStatus `json:"status,omitempty" yaml:"status,omitempty"` - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *RandomPolicyData) CRDName() string { - return "randompolicydatas.policypkg.tsm.tanzu.vmware.com" -} - -func (c *RandomPolicyData) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:openapi-gen=true -type RandomPolicyDataSpec struct { - Description RandomDescription `json:"description" yaml:"description"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type RandomPolicyDataList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []RandomPolicyData `json:"items" yaml:"items"` -} - -// +k8s:openapi-gen=true -type AdditionalDescription struct { - DiscriptionA string `json:"discriptionA" yaml:"discriptionA"` - DiscriptionB string `json:"discriptionB" yaml:"discriptionB"` - DiscriptionC string `json:"discriptionC" yaml:"discriptionC"` - DiscriptionD string `json:"discriptionD" yaml:"discriptionD"` -} - -// +k8s:openapi-gen=true -type AdditionalStatus struct { - StatusX int `json:"statusX" yaml:"statusX"` - StatusY int `json:"statusY" yaml:"statusY"` -} - -// +k8s:openapi-gen=true -type ACPStatus struct { - StatusABC int `json:"statusABC" yaml:"statusABC"` - StatusXYZ int `json:"statusXYZ" yaml:"statusXYZ"` -} - -// +k8s:openapi-gen=true -type ResourceGroupRef struct { - Name string `json:"name" yaml:"name"` - Type string `json:"type" yaml:"type"` -} - -// +k8s:openapi-gen=true -type ACPSvcGroupLinkInfo struct { - ServiceName string `json:"serviceName" yaml:"serviceName"` - ServiceType string `json:"serviceType" yaml:"serviceType"` -} - -// +k8s:openapi-gen=true -type PolicyCfgAction struct { - Action PolicyActionType `json:"action" mapstructure:"action" yaml:"action"` -} - -// +k8s:openapi-gen=true -type ResourceGroupID struct { - Name string `json:"name" mapstruction:"name" yaml:"name"` - Type string `json:"type" mapstruction:"type" yaml:"type"` -} - -// +k8s:openapi-gen=true -type RandomDescription struct { - DiscriptionA string `json:"discriptionA" yaml:"discriptionA"` - DiscriptionB string `json:"discriptionB" yaml:"discriptionB"` - DiscriptionC string `json:"discriptionC" yaml:"discriptionC"` - DiscriptionD string `json:"discriptionD" yaml:"discriptionD"` -} - -// +k8s:openapi-gen=true -type RandomStatus struct { - StatusX int `json:"statusX" yaml:"statusX"` - StatusY int `json:"statusY" yaml:"statusY"` -} - -type TempConst1 string -type TempConst2 string -type TempConst3 string -type PolicyActionType string -type PolicyCfgActions []PolicyCfgAction -type ResourceGroupIDs []ResourceGroupID -type RandomConst1 string -type RandomConst2 string -type RandomConst3 string - -const ( - Const3 TempConst3 = "Const3" - Const2 TempConst2 = "Const2" - Const1 TempConst1 = "Const1" - PolicyActionType_Allow PolicyActionType = "ALLOW" - PolicyActionType_Deny PolicyActionType = "DENY" - PolicyActionType_Log PolicyActionType = "LOG" - PolicyActionType_Mirror PolicyActionType = "MIRROR" - MyConst3 RandomConst3 = "Const3" - MyConst2 RandomConst2 = "Const2" - MyConst1 RandomConst1 = "Const1" -) diff --git a/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go b/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go deleted file mode 100644 index 063b6a74d..000000000 --- a/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,747 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -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 deepcopy-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACPConfig) DeepCopyInto(out *ACPConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACPConfig. -func (in *ACPConfig) DeepCopy() *ACPConfig { - if in == nil { - return nil - } - out := new(ACPConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ACPConfig) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACPConfigList) DeepCopyInto(out *ACPConfigList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ACPConfig, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACPConfigList. -func (in *ACPConfigList) DeepCopy() *ACPConfigList { - if in == nil { - return nil - } - out := new(ACPConfigList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ACPConfigList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACPConfigNexusStatus) DeepCopyInto(out *ACPConfigNexusStatus) { - *out = *in - out.Status = in.Status - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACPConfigNexusStatus. -func (in *ACPConfigNexusStatus) DeepCopy() *ACPConfigNexusStatus { - if in == nil { - return nil - } - out := new(ACPConfigNexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACPConfigSpec) DeepCopyInto(out *ACPConfigSpec) { - *out = *in - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.DestSvcGroupsGvk != nil { - in, out := &in.DestSvcGroupsGvk, &out.DestSvcGroupsGvk - *out = make(map[string]Link, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.SourceSvcGroupsGvk != nil { - in, out := &in.SourceSvcGroupsGvk, &out.SourceSvcGroupsGvk - *out = make(map[string]Link, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACPConfigSpec. -func (in *ACPConfigSpec) DeepCopy() *ACPConfigSpec { - if in == nil { - return nil - } - out := new(ACPConfigSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACPStatus) DeepCopyInto(out *ACPStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACPStatus. -func (in *ACPStatus) DeepCopy() *ACPStatus { - if in == nil { - return nil - } - out := new(ACPStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACPSvcGroupLinkInfo) DeepCopyInto(out *ACPSvcGroupLinkInfo) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACPSvcGroupLinkInfo. -func (in *ACPSvcGroupLinkInfo) DeepCopy() *ACPSvcGroupLinkInfo { - if in == nil { - return nil - } - out := new(ACPSvcGroupLinkInfo) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AccessControlPolicy) DeepCopyInto(out *AccessControlPolicy) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessControlPolicy. -func (in *AccessControlPolicy) DeepCopy() *AccessControlPolicy { - if in == nil { - return nil - } - out := new(AccessControlPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AccessControlPolicy) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AccessControlPolicyList) DeepCopyInto(out *AccessControlPolicyList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AccessControlPolicy, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessControlPolicyList. -func (in *AccessControlPolicyList) DeepCopy() *AccessControlPolicyList { - if in == nil { - return nil - } - out := new(AccessControlPolicyList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AccessControlPolicyList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AccessControlPolicyNexusStatus) DeepCopyInto(out *AccessControlPolicyNexusStatus) { - *out = *in - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessControlPolicyNexusStatus. -func (in *AccessControlPolicyNexusStatus) DeepCopy() *AccessControlPolicyNexusStatus { - if in == nil { - return nil - } - out := new(AccessControlPolicyNexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AccessControlPolicySpec) DeepCopyInto(out *AccessControlPolicySpec) { - *out = *in - if in.PolicyConfigsGvk != nil { - in, out := &in.PolicyConfigsGvk, &out.PolicyConfigsGvk - *out = make(map[string]Child, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessControlPolicySpec. -func (in *AccessControlPolicySpec) DeepCopy() *AccessControlPolicySpec { - if in == nil { - return nil - } - out := new(AccessControlPolicySpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdditionalDescription) DeepCopyInto(out *AdditionalDescription) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalDescription. -func (in *AdditionalDescription) DeepCopy() *AdditionalDescription { - if in == nil { - return nil - } - out := new(AdditionalDescription) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdditionalPolicyData) DeepCopyInto(out *AdditionalPolicyData) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalPolicyData. -func (in *AdditionalPolicyData) DeepCopy() *AdditionalPolicyData { - if in == nil { - return nil - } - out := new(AdditionalPolicyData) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AdditionalPolicyData) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdditionalPolicyDataList) DeepCopyInto(out *AdditionalPolicyDataList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AdditionalPolicyData, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalPolicyDataList. -func (in *AdditionalPolicyDataList) DeepCopy() *AdditionalPolicyDataList { - if in == nil { - return nil - } - out := new(AdditionalPolicyDataList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AdditionalPolicyDataList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdditionalPolicyDataNexusStatus) DeepCopyInto(out *AdditionalPolicyDataNexusStatus) { - *out = *in - out.Status = in.Status - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalPolicyDataNexusStatus. -func (in *AdditionalPolicyDataNexusStatus) DeepCopy() *AdditionalPolicyDataNexusStatus { - if in == nil { - return nil - } - out := new(AdditionalPolicyDataNexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdditionalPolicyDataSpec) DeepCopyInto(out *AdditionalPolicyDataSpec) { - *out = *in - out.Description = in.Description - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalPolicyDataSpec. -func (in *AdditionalPolicyDataSpec) DeepCopy() *AdditionalPolicyDataSpec { - if in == nil { - return nil - } - out := new(AdditionalPolicyDataSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdditionalStatus) DeepCopyInto(out *AdditionalStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalStatus. -func (in *AdditionalStatus) DeepCopy() *AdditionalStatus { - if in == nil { - return nil - } - out := new(AdditionalStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Child) DeepCopyInto(out *Child) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Child. -func (in *Child) DeepCopy() *Child { - if in == nil { - return nil - } - out := new(Child) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Link) DeepCopyInto(out *Link) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Link. -func (in *Link) DeepCopy() *Link { - if in == nil { - return nil - } - out := new(Link) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NexusStatus) DeepCopyInto(out *NexusStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NexusStatus. -func (in *NexusStatus) DeepCopy() *NexusStatus { - if in == nil { - return nil - } - out := new(NexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PolicyCfgAction) DeepCopyInto(out *PolicyCfgAction) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyCfgAction. -func (in *PolicyCfgAction) DeepCopy() *PolicyCfgAction { - if in == nil { - return nil - } - out := new(PolicyCfgAction) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in PolicyCfgActions) DeepCopyInto(out *PolicyCfgActions) { - { - in := &in - *out = make(PolicyCfgActions, len(*in)) - copy(*out, *in) - return - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyCfgActions. -func (in PolicyCfgActions) DeepCopy() PolicyCfgActions { - if in == nil { - return nil - } - out := new(PolicyCfgActions) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RandomDescription) DeepCopyInto(out *RandomDescription) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RandomDescription. -func (in *RandomDescription) DeepCopy() *RandomDescription { - if in == nil { - return nil - } - out := new(RandomDescription) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RandomPolicyData) DeepCopyInto(out *RandomPolicyData) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RandomPolicyData. -func (in *RandomPolicyData) DeepCopy() *RandomPolicyData { - if in == nil { - return nil - } - out := new(RandomPolicyData) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RandomPolicyData) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RandomPolicyDataList) DeepCopyInto(out *RandomPolicyDataList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]RandomPolicyData, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RandomPolicyDataList. -func (in *RandomPolicyDataList) DeepCopy() *RandomPolicyDataList { - if in == nil { - return nil - } - out := new(RandomPolicyDataList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RandomPolicyDataList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RandomPolicyDataNexusStatus) DeepCopyInto(out *RandomPolicyDataNexusStatus) { - *out = *in - out.Status = in.Status - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RandomPolicyDataNexusStatus. -func (in *RandomPolicyDataNexusStatus) DeepCopy() *RandomPolicyDataNexusStatus { - if in == nil { - return nil - } - out := new(RandomPolicyDataNexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RandomPolicyDataSpec) DeepCopyInto(out *RandomPolicyDataSpec) { - *out = *in - out.Description = in.Description - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RandomPolicyDataSpec. -func (in *RandomPolicyDataSpec) DeepCopy() *RandomPolicyDataSpec { - if in == nil { - return nil - } - out := new(RandomPolicyDataSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RandomStatus) DeepCopyInto(out *RandomStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RandomStatus. -func (in *RandomStatus) DeepCopy() *RandomStatus { - if in == nil { - return nil - } - out := new(RandomStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceGroupID) DeepCopyInto(out *ResourceGroupID) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceGroupID. -func (in *ResourceGroupID) DeepCopy() *ResourceGroupID { - if in == nil { - return nil - } - out := new(ResourceGroupID) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in ResourceGroupIDs) DeepCopyInto(out *ResourceGroupIDs) { - { - in := &in - *out = make(ResourceGroupIDs, len(*in)) - copy(*out, *in) - return - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceGroupIDs. -func (in ResourceGroupIDs) DeepCopy() ResourceGroupIDs { - if in == nil { - return nil - } - out := new(ResourceGroupIDs) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceGroupRef) DeepCopyInto(out *ResourceGroupRef) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceGroupRef. -func (in *ResourceGroupRef) DeepCopy() *ResourceGroupRef { - if in == nil { - return nil - } - out := new(ResourceGroupRef) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VMpolicy) DeepCopyInto(out *VMpolicy) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMpolicy. -func (in *VMpolicy) DeepCopy() *VMpolicy { - if in == nil { - return nil - } - out := new(VMpolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *VMpolicy) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VMpolicyList) DeepCopyInto(out *VMpolicyList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]VMpolicy, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMpolicyList. -func (in *VMpolicyList) DeepCopy() *VMpolicyList { - if in == nil { - return nil - } - out := new(VMpolicyList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *VMpolicyList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VMpolicyNexusStatus) DeepCopyInto(out *VMpolicyNexusStatus) { - *out = *in - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMpolicyNexusStatus. -func (in *VMpolicyNexusStatus) DeepCopy() *VMpolicyNexusStatus { - if in == nil { - return nil - } - out := new(VMpolicyNexusStatus) - in.DeepCopyInto(out) - return out -} diff --git a/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/register.go b/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/register.go deleted file mode 100644 index 97bbf43d6..000000000 --- a/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/register.go +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -package root_tsm_tanzu_vmware_com - -const ( - GroupName = "root.tsm.tanzu.vmware.com" -) diff --git a/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1/doc.go b/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1/doc.go deleted file mode 100644 index e212b1c7e..000000000 --- a/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -// +k8s:deepcopy-gen=package -// +groupName=root.tsm.tanzu.vmware.com -// +groupGoName=RootTsm - -package v1 diff --git a/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1/register.go b/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1/register.go deleted file mode 100644 index 372e29e10..000000000 --- a/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1/register.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -package v1 - -import ( - root_tsm_tanzu_vmware_com "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -const ResourceVersion = "v1" - -// GroupVersion is the identifier for the API which includes -// the name of the group and the version of the API -var SchemeGroupVersion = schema.GroupVersion{ - Group: root_tsm_tanzu_vmware_com.GroupName, - Version: ResourceVersion, -} - -// Kind takes an unqualified kind and returns back a Group qualified GroupKind -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -// addKnownTypes adds our types to the API scheme by registering -// MyResource and MyResourceList -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes( - SchemeGroupVersion, - &Root{}, - &RootList{}, - ) - - // register the type in the scheme - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1/types.go b/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1/types.go deleted file mode 100644 index dd1c6fa55..000000000 --- a/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1/types.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/common" -) - -// +k8s:openapi-gen=true -type Child struct { - Group string `json:"group" yaml:"group"` - Kind string `json:"kind" yaml:"kind"` - Name string `json:"name" yaml:"name"` -} - -// +k8s:openapi-gen=true -type Link struct { - Group string `json:"group" yaml:"group"` - Kind string `json:"kind" yaml:"kind"` - Name string `json:"name" yaml:"name"` -} - -// +k8s:openapi-gen=true -type NexusStatus struct { - SourceGeneration int64 `json:"sourceGeneration" yaml:"sourceGeneration"` - RemoteGeneration int64 `json:"remoteGeneration" yaml:"remoteGeneration"` -} - -/* ------------------- CRDs definitions ------------------- */ - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type Root struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - Spec RootSpec `json:"spec,omitempty" yaml:"spec,omitempty"` - Status RootNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type RootNexusStatus struct { - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *Root) CRDName() string { - return "roots.root.tsm.tanzu.vmware.com" -} - -func (c *Root) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:openapi-gen=true -type RootSpec struct { - ConfigGvk *Child `json:"configGvk,omitempty" yaml:"configGvk,omitempty" nexus:"child"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type RootList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []Root `json:"items" yaml:"items"` -} - -// +k8s:openapi-gen=true -type NonNexusType struct { - Test int `json:"test" yaml:"test"` -} - -// +k8s:openapi-gen=true -type queryFilters struct { - StartTime string `json:"startTime" yaml:"startTime"` - EndTime string `json:"endTime" yaml:"endTime"` - Interval string `json:"interval" yaml:"interval"` - IsServiceDeployment bool `json:"isServiceDeployment" yaml:"isServiceDeployment"` - StartVal int `json:"startVal" yaml:"startVal"` -} diff --git a/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go b/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go deleted file mode 100644 index a373caf16..000000000 --- a/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,189 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -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 deepcopy-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Child) DeepCopyInto(out *Child) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Child. -func (in *Child) DeepCopy() *Child { - if in == nil { - return nil - } - out := new(Child) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Link) DeepCopyInto(out *Link) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Link. -func (in *Link) DeepCopy() *Link { - if in == nil { - return nil - } - out := new(Link) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NexusStatus) DeepCopyInto(out *NexusStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NexusStatus. -func (in *NexusStatus) DeepCopy() *NexusStatus { - if in == nil { - return nil - } - out := new(NexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NonNexusType) DeepCopyInto(out *NonNexusType) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NonNexusType. -func (in *NonNexusType) DeepCopy() *NonNexusType { - if in == nil { - return nil - } - out := new(NonNexusType) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Root) DeepCopyInto(out *Root) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Root. -func (in *Root) DeepCopy() *Root { - if in == nil { - return nil - } - out := new(Root) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Root) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RootList) DeepCopyInto(out *RootList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Root, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RootList. -func (in *RootList) DeepCopy() *RootList { - if in == nil { - return nil - } - out := new(RootList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RootList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RootNexusStatus) DeepCopyInto(out *RootNexusStatus) { - *out = *in - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RootNexusStatus. -func (in *RootNexusStatus) DeepCopy() *RootNexusStatus { - if in == nil { - return nil - } - out := new(RootNexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RootSpec) DeepCopyInto(out *RootSpec) { - *out = *in - if in.ConfigGvk != nil { - in, out := &in.ConfigGvk, &out.ConfigGvk - *out = new(Child) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RootSpec. -func (in *RootSpec) DeepCopy() *RootSpec { - if in == nil { - return nil - } - out := new(RootSpec) - in.DeepCopyInto(out) - return out -} diff --git a/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/register.go b/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/register.go deleted file mode 100644 index 6095d513f..000000000 --- a/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/register.go +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -package servicegroup_tsm_tanzu_vmware_com - -const ( - GroupName = "servicegroup.tsm.tanzu.vmware.com" -) diff --git a/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1/doc.go b/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1/doc.go deleted file mode 100644 index cfb7f2733..000000000 --- a/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -// +k8s:deepcopy-gen=package -// +groupName=servicegroup.tsm.tanzu.vmware.com -// +groupGoName=ServicegroupTsm - -package v1 diff --git a/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1/register.go b/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1/register.go deleted file mode 100644 index 6f835d746..000000000 --- a/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1/register.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -package v1 - -import ( - servicegroup_tsm_tanzu_vmware_com "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -const ResourceVersion = "v1" - -// GroupVersion is the identifier for the API which includes -// the name of the group and the version of the API -var SchemeGroupVersion = schema.GroupVersion{ - Group: servicegroup_tsm_tanzu_vmware_com.GroupName, - Version: ResourceVersion, -} - -// Kind takes an unqualified kind and returns back a Group qualified GroupKind -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -// addKnownTypes adds our types to the API scheme by registering -// MyResource and MyResourceList -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes( - SchemeGroupVersion, - &SvcGroup{}, - &SvcGroupList{}, - &SvcGroupLinkInfo{}, - &SvcGroupLinkInfoList{}, - ) - - // register the type in the scheme - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1/types.go b/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1/types.go deleted file mode 100644 index 76a9c57d8..000000000 --- a/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1/types.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by nexus. DO NOT EDIT. - -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/common" -) - -// +k8s:openapi-gen=true -type Child struct { - Group string `json:"group" yaml:"group"` - Kind string `json:"kind" yaml:"kind"` - Name string `json:"name" yaml:"name"` -} - -// +k8s:openapi-gen=true -type Link struct { - Group string `json:"group" yaml:"group"` - Kind string `json:"kind" yaml:"kind"` - Name string `json:"name" yaml:"name"` -} - -// +k8s:openapi-gen=true -type NexusStatus struct { - SourceGeneration int64 `json:"sourceGeneration" yaml:"sourceGeneration"` - RemoteGeneration int64 `json:"remoteGeneration" yaml:"remoteGeneration"` -} - -/* ------------------- CRDs definitions ------------------- */ - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type SvcGroup struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - Spec SvcGroupSpec `json:"spec,omitempty" yaml:"spec,omitempty"` - Status SvcGroupNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type SvcGroupNexusStatus struct { - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *SvcGroup) CRDName() string { - return "svcgroups.servicegroup.tsm.tanzu.vmware.com" -} - -func (c *SvcGroup) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:openapi-gen=true -type SvcGroupSpec struct { - DisplayName string `json:"displayName" yaml:"displayName"` - Description string `json:"description" yaml:"description"` - Color string `json:"color" yaml:"color"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type SvcGroupList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []SvcGroup `json:"items" yaml:"items"` -} - -// +genclient -// +genclient:noStatus -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type SvcGroupLinkInfo struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ObjectMeta `json:"metadata" yaml:"metadata"` - Spec SvcGroupLinkInfoSpec `json:"spec,omitempty" yaml:"spec,omitempty"` - Status SvcGroupLinkInfoNexusStatus `json:"status,omitempty" yaml:"status,omitempty"` -} - -// +k8s:openapi-gen=true -type SvcGroupLinkInfoNexusStatus struct { - Nexus NexusStatus `json:"nexus,omitempty" yaml:"nexus,omitempty"` -} - -func (c *SvcGroupLinkInfo) CRDName() string { - return "svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com" -} - -func (c *SvcGroupLinkInfo) DisplayName() string { - if c.GetLabels() != nil { - return c.GetLabels()[common.DISPLAY_NAME_LABEL] - } - return "" -} - -// +k8s:openapi-gen=true -type SvcGroupLinkInfoSpec struct { - ClusterName string `json:"clusterName" yaml:"clusterName"` - DomainName string `json:"domainName" yaml:"domainName"` - ServiceName string `json:"serviceName" yaml:"serviceName"` - ServiceType string `json:"serviceType" yaml:"serviceType"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type SvcGroupLinkInfoList struct { - metav1.TypeMeta `json:",inline" yaml:",inline"` - metav1.ListMeta `json:"metadata" yaml:"metadata"` - Items []SvcGroupLinkInfo `json:"items" yaml:"items"` -} diff --git a/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go b/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go deleted file mode 100644 index b047c9206..000000000 --- a/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,262 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -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 deepcopy-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Child) DeepCopyInto(out *Child) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Child. -func (in *Child) DeepCopy() *Child { - if in == nil { - return nil - } - out := new(Child) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Link) DeepCopyInto(out *Link) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Link. -func (in *Link) DeepCopy() *Link { - if in == nil { - return nil - } - out := new(Link) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NexusStatus) DeepCopyInto(out *NexusStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NexusStatus. -func (in *NexusStatus) DeepCopy() *NexusStatus { - if in == nil { - return nil - } - out := new(NexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SvcGroup) DeepCopyInto(out *SvcGroup) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcGroup. -func (in *SvcGroup) DeepCopy() *SvcGroup { - if in == nil { - return nil - } - out := new(SvcGroup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SvcGroup) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SvcGroupLinkInfo) DeepCopyInto(out *SvcGroupLinkInfo) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcGroupLinkInfo. -func (in *SvcGroupLinkInfo) DeepCopy() *SvcGroupLinkInfo { - if in == nil { - return nil - } - out := new(SvcGroupLinkInfo) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SvcGroupLinkInfo) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SvcGroupLinkInfoList) DeepCopyInto(out *SvcGroupLinkInfoList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]SvcGroupLinkInfo, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcGroupLinkInfoList. -func (in *SvcGroupLinkInfoList) DeepCopy() *SvcGroupLinkInfoList { - if in == nil { - return nil - } - out := new(SvcGroupLinkInfoList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SvcGroupLinkInfoList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SvcGroupLinkInfoNexusStatus) DeepCopyInto(out *SvcGroupLinkInfoNexusStatus) { - *out = *in - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcGroupLinkInfoNexusStatus. -func (in *SvcGroupLinkInfoNexusStatus) DeepCopy() *SvcGroupLinkInfoNexusStatus { - if in == nil { - return nil - } - out := new(SvcGroupLinkInfoNexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SvcGroupLinkInfoSpec) DeepCopyInto(out *SvcGroupLinkInfoSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcGroupLinkInfoSpec. -func (in *SvcGroupLinkInfoSpec) DeepCopy() *SvcGroupLinkInfoSpec { - if in == nil { - return nil - } - out := new(SvcGroupLinkInfoSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SvcGroupList) DeepCopyInto(out *SvcGroupList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]SvcGroup, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcGroupList. -func (in *SvcGroupList) DeepCopy() *SvcGroupList { - if in == nil { - return nil - } - out := new(SvcGroupList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SvcGroupList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SvcGroupNexusStatus) DeepCopyInto(out *SvcGroupNexusStatus) { - *out = *in - out.Nexus = in.Nexus - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcGroupNexusStatus. -func (in *SvcGroupNexusStatus) DeepCopy() *SvcGroupNexusStatus { - if in == nil { - return nil - } - out := new(SvcGroupNexusStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SvcGroupSpec) DeepCopyInto(out *SvcGroupSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvcGroupSpec. -func (in *SvcGroupSpec) DeepCopy() *SvcGroupSpec { - if in == nil { - return nil - } - out := new(SvcGroupSpec) - in.DeepCopyInto(out) - return out -} diff --git a/compiler/example/output/generated/client/clientset/versioned/clientset.go b/compiler/example/output/generated/client/clientset/versioned/clientset.go index 12a673cff..4fca1415f 100644 --- a/compiler/example/output/generated/client/clientset/versioned/clientset.go +++ b/compiler/example/output/generated/client/clientset/versioned/clientset.go @@ -20,12 +20,8 @@ package versioned import ( "fmt" - - configtsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1" - gnstsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1" - policypkgtsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1" - roottsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1" - servicegrouptsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1" + customtsmv1 "nexustempmodule/client/clientset/versioned/typed/custom.tsm.tanzu.vmware.com/v1" + globaltsmv1 "nexustempmodule/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" @@ -34,47 +30,26 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface - ConfigTsmV1() configtsmv1.ConfigTsmV1Interface - GnsTsmV1() gnstsmv1.GnsTsmV1Interface - PolicypkgTsmV1() policypkgtsmv1.PolicypkgTsmV1Interface - RootTsmV1() roottsmv1.RootTsmV1Interface - ServicegroupTsmV1() servicegrouptsmv1.ServicegroupTsmV1Interface + CustomTsmV1() customtsmv1.CustomTsmV1Interface + GlobalTsmV1() globaltsmv1.GlobalTsmV1Interface } // Clientset contains the clients for groups. Each group has exactly one // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - configTsmV1 *configtsmv1.ConfigTsmV1Client - gnsTsmV1 *gnstsmv1.GnsTsmV1Client - policypkgTsmV1 *policypkgtsmv1.PolicypkgTsmV1Client - rootTsmV1 *roottsmv1.RootTsmV1Client - servicegroupTsmV1 *servicegrouptsmv1.ServicegroupTsmV1Client -} - -// ConfigTsmV1 retrieves the ConfigTsmV1Client -func (c *Clientset) ConfigTsmV1() configtsmv1.ConfigTsmV1Interface { - return c.configTsmV1 -} - -// GnsTsmV1 retrieves the GnsTsmV1Client -func (c *Clientset) GnsTsmV1() gnstsmv1.GnsTsmV1Interface { - return c.gnsTsmV1 -} - -// PolicypkgTsmV1 retrieves the PolicypkgTsmV1Client -func (c *Clientset) PolicypkgTsmV1() policypkgtsmv1.PolicypkgTsmV1Interface { - return c.policypkgTsmV1 + customTsmV1 *customtsmv1.CustomTsmV1Client + globalTsmV1 *globaltsmv1.GlobalTsmV1Client } -// RootTsmV1 retrieves the RootTsmV1Client -func (c *Clientset) RootTsmV1() roottsmv1.RootTsmV1Interface { - return c.rootTsmV1 +// CustomTsmV1 retrieves the CustomTsmV1Client +func (c *Clientset) CustomTsmV1() customtsmv1.CustomTsmV1Interface { + return c.customTsmV1 } -// ServicegroupTsmV1 retrieves the ServicegroupTsmV1Client -func (c *Clientset) ServicegroupTsmV1() servicegrouptsmv1.ServicegroupTsmV1Interface { - return c.servicegroupTsmV1 +// GlobalTsmV1 retrieves the GlobalTsmV1Client +func (c *Clientset) GlobalTsmV1() globaltsmv1.GlobalTsmV1Interface { + return c.globalTsmV1 } // Discovery retrieves the DiscoveryClient @@ -98,23 +73,11 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var cs Clientset var err error - cs.configTsmV1, err = configtsmv1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - cs.gnsTsmV1, err = gnstsmv1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - cs.policypkgTsmV1, err = policypkgtsmv1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - cs.rootTsmV1, err = roottsmv1.NewForConfig(&configShallowCopy) + cs.customTsmV1, err = customtsmv1.NewForConfig(&configShallowCopy) if err != nil { return nil, err } - cs.servicegroupTsmV1, err = servicegrouptsmv1.NewForConfig(&configShallowCopy) + cs.globalTsmV1, err = globaltsmv1.NewForConfig(&configShallowCopy) if err != nil { return nil, err } @@ -130,11 +93,8 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset - cs.configTsmV1 = configtsmv1.NewForConfigOrDie(c) - cs.gnsTsmV1 = gnstsmv1.NewForConfigOrDie(c) - cs.policypkgTsmV1 = policypkgtsmv1.NewForConfigOrDie(c) - cs.rootTsmV1 = roottsmv1.NewForConfigOrDie(c) - cs.servicegroupTsmV1 = servicegrouptsmv1.NewForConfigOrDie(c) + cs.customTsmV1 = customtsmv1.NewForConfigOrDie(c) + cs.globalTsmV1 = globaltsmv1.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &cs @@ -143,11 +103,8 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset - cs.configTsmV1 = configtsmv1.New(c) - cs.gnsTsmV1 = gnstsmv1.New(c) - cs.policypkgTsmV1 = policypkgtsmv1.New(c) - cs.rootTsmV1 = roottsmv1.New(c) - cs.servicegroupTsmV1 = servicegrouptsmv1.New(c) + cs.customTsmV1 = customtsmv1.New(c) + cs.globalTsmV1 = globaltsmv1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/compiler/example/output/generated/client/clientset/versioned/fake/clientset_generated.go b/compiler/example/output/generated/client/clientset/versioned/fake/clientset_generated.go index daa2fff5b..9aa5ca721 100644 --- a/compiler/example/output/generated/client/clientset/versioned/fake/clientset_generated.go +++ b/compiler/example/output/generated/client/clientset/versioned/fake/clientset_generated.go @@ -19,17 +19,11 @@ limitations under the License. package fake import ( - clientset "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - configtsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1" - fakeconfigtsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/fake" - gnstsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1" - fakegnstsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake" - policypkgtsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1" - fakepolicypkgtsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake" - roottsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1" - fakeroottsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/fake" - servicegrouptsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1" - fakeservicegrouptsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/fake" + clientset "nexustempmodule/client/clientset/versioned" + customtsmv1 "nexustempmodule/client/clientset/versioned/typed/custom.tsm.tanzu.vmware.com/v1" + fakecustomtsmv1 "nexustempmodule/client/clientset/versioned/typed/custom.tsm.tanzu.vmware.com/v1/fake" + globaltsmv1 "nexustempmodule/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1" + fakeglobaltsmv1 "nexustempmodule/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" @@ -88,27 +82,12 @@ var ( _ testing.FakeClient = &Clientset{} ) -// ConfigTsmV1 retrieves the ConfigTsmV1Client -func (c *Clientset) ConfigTsmV1() configtsmv1.ConfigTsmV1Interface { - return &fakeconfigtsmv1.FakeConfigTsmV1{Fake: &c.Fake} +// CustomTsmV1 retrieves the CustomTsmV1Client +func (c *Clientset) CustomTsmV1() customtsmv1.CustomTsmV1Interface { + return &fakecustomtsmv1.FakeCustomTsmV1{Fake: &c.Fake} } -// GnsTsmV1 retrieves the GnsTsmV1Client -func (c *Clientset) GnsTsmV1() gnstsmv1.GnsTsmV1Interface { - return &fakegnstsmv1.FakeGnsTsmV1{Fake: &c.Fake} -} - -// PolicypkgTsmV1 retrieves the PolicypkgTsmV1Client -func (c *Clientset) PolicypkgTsmV1() policypkgtsmv1.PolicypkgTsmV1Interface { - return &fakepolicypkgtsmv1.FakePolicypkgTsmV1{Fake: &c.Fake} -} - -// RootTsmV1 retrieves the RootTsmV1Client -func (c *Clientset) RootTsmV1() roottsmv1.RootTsmV1Interface { - return &fakeroottsmv1.FakeRootTsmV1{Fake: &c.Fake} -} - -// ServicegroupTsmV1 retrieves the ServicegroupTsmV1Client -func (c *Clientset) ServicegroupTsmV1() servicegrouptsmv1.ServicegroupTsmV1Interface { - return &fakeservicegrouptsmv1.FakeServicegroupTsmV1{Fake: &c.Fake} +// GlobalTsmV1 retrieves the GlobalTsmV1Client +func (c *Clientset) GlobalTsmV1() globaltsmv1.GlobalTsmV1Interface { + return &fakeglobaltsmv1.FakeGlobalTsmV1{Fake: &c.Fake} } diff --git a/compiler/example/output/generated/client/clientset/versioned/fake/register.go b/compiler/example/output/generated/client/clientset/versioned/fake/register.go index 2f88252b5..0414d398a 100644 --- a/compiler/example/output/generated/client/clientset/versioned/fake/register.go +++ b/compiler/example/output/generated/client/clientset/versioned/fake/register.go @@ -19,11 +19,8 @@ limitations under the License. package fake import ( - configtsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1" - gnstsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - policypkgtsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - roottsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1" - servicegrouptsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1" + customtsmv1 "nexustempmodule/apis/custom.tsm.tanzu.vmware.com/v1" + globaltsmv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -36,24 +33,21 @@ var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - configtsmv1.AddToScheme, - gnstsmv1.AddToScheme, - policypkgtsmv1.AddToScheme, - roottsmv1.AddToScheme, - servicegrouptsmv1.AddToScheme, + customtsmv1.AddToScheme, + globaltsmv1.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" -// ) +// 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) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/compiler/example/output/generated/client/clientset/versioned/scheme/register.go b/compiler/example/output/generated/client/clientset/versioned/scheme/register.go index 74fff015b..c65ebf6b6 100644 --- a/compiler/example/output/generated/client/clientset/versioned/scheme/register.go +++ b/compiler/example/output/generated/client/clientset/versioned/scheme/register.go @@ -19,11 +19,8 @@ limitations under the License. package scheme import ( - configtsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1" - gnstsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - policypkgtsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - roottsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1" - servicegrouptsmv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1" + customtsmv1 "nexustempmodule/apis/custom.tsm.tanzu.vmware.com/v1" + globaltsmv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -36,24 +33,21 @@ var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - configtsmv1.AddToScheme, - gnstsmv1.AddToScheme, - policypkgtsmv1.AddToScheme, - roottsmv1.AddToScheme, - servicegrouptsmv1.AddToScheme, + customtsmv1.AddToScheme, + globaltsmv1.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" -// ) +// 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) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/config.go b/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/config.go deleted file mode 100644 index f499ac579..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/config.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// ConfigsGetter has a method to return a ConfigInterface. -// A group's client should implement this interface. -type ConfigsGetter interface { - Configs() ConfigInterface -} - -// ConfigInterface has methods to work with Config resources. -type ConfigInterface interface { - Create(ctx context.Context, config *v1.Config, opts metav1.CreateOptions) (*v1.Config, error) - Update(ctx context.Context, config *v1.Config, opts metav1.UpdateOptions) (*v1.Config, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Config, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.ConfigList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Config, err error) - ConfigExpansion -} - -// configs implements ConfigInterface -type configs struct { - client rest.Interface -} - -// newConfigs returns a Configs -func newConfigs(c *ConfigTsmV1Client) *configs { - return &configs{ - client: c.RESTClient(), - } -} - -// Get takes name of the config, and returns the corresponding config object, and an error if there is any. -func (c *configs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Config, err error) { - result = &v1.Config{} - err = c.client.Get(). - Resource("configs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Configs that match those selectors. -func (c *configs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ConfigList{} - err = c.client.Get(). - Resource("configs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested configs. -func (c *configs) Watch(ctx context.Context, opts metav1.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(). - Resource("configs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a config and creates it. Returns the server's representation of the config, and an error, if there is any. -func (c *configs) Create(ctx context.Context, config *v1.Config, opts metav1.CreateOptions) (result *v1.Config, err error) { - result = &v1.Config{} - err = c.client.Post(). - Resource("configs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(config). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a config and updates it. Returns the server's representation of the config, and an error, if there is any. -func (c *configs) Update(ctx context.Context, config *v1.Config, opts metav1.UpdateOptions) (result *v1.Config, err error) { - result = &v1.Config{} - err = c.client.Put(). - Resource("configs"). - Name(config.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(config). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the config and deletes it. Returns an error if one occurs. -func (c *configs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("configs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *configs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("configs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched config. -func (c *configs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Config, err error) { - result = &v1.Config{} - err = c.client.Patch(pt). - Resource("configs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/config.tsm.tanzu.vmware.com_client.go b/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/config.tsm.tanzu.vmware.com_client.go deleted file mode 100644 index 734b37d4c..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/config.tsm.tanzu.vmware.com_client.go +++ /dev/null @@ -1,100 +0,0 @@ -/* -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 v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1" - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - rest "k8s.io/client-go/rest" -) - -type ConfigTsmV1Interface interface { - RESTClient() rest.Interface - ConfigsGetter - DomainsGetter - FooTypeABCsGetter -} - -// ConfigTsmV1Client is used to interact with features provided by the config.tsm.tanzu.vmware.com group. -type ConfigTsmV1Client struct { - restClient rest.Interface -} - -func (c *ConfigTsmV1Client) Configs() ConfigInterface { - return newConfigs(c) -} - -func (c *ConfigTsmV1Client) Domains() DomainInterface { - return newDomains(c) -} - -func (c *ConfigTsmV1Client) FooTypeABCs() FooTypeABCInterface { - return newFooTypeABCs(c) -} - -// NewForConfig creates a new ConfigTsmV1Client for the given config. -func NewForConfig(c *rest.Config) (*ConfigTsmV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &ConfigTsmV1Client{client}, nil -} - -// NewForConfigOrDie creates a new ConfigTsmV1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ConfigTsmV1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new ConfigTsmV1Client for the given RESTClient. -func New(c rest.Interface) *ConfigTsmV1Client { - return &ConfigTsmV1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1.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 *ConfigTsmV1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/domain.go b/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/domain.go deleted file mode 100644 index 698632e05..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/domain.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// DomainsGetter has a method to return a DomainInterface. -// A group's client should implement this interface. -type DomainsGetter interface { - Domains() DomainInterface -} - -// DomainInterface has methods to work with Domain resources. -type DomainInterface interface { - Create(ctx context.Context, domain *v1.Domain, opts metav1.CreateOptions) (*v1.Domain, error) - Update(ctx context.Context, domain *v1.Domain, opts metav1.UpdateOptions) (*v1.Domain, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Domain, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.DomainList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Domain, err error) - DomainExpansion -} - -// domains implements DomainInterface -type domains struct { - client rest.Interface -} - -// newDomains returns a Domains -func newDomains(c *ConfigTsmV1Client) *domains { - return &domains{ - client: c.RESTClient(), - } -} - -// Get takes name of the domain, and returns the corresponding domain object, and an error if there is any. -func (c *domains) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Domain, err error) { - result = &v1.Domain{} - err = c.client.Get(). - Resource("domains"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Domains that match those selectors. -func (c *domains) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DomainList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.DomainList{} - err = c.client.Get(). - Resource("domains"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested domains. -func (c *domains) Watch(ctx context.Context, opts metav1.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(). - Resource("domains"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a domain and creates it. Returns the server's representation of the domain, and an error, if there is any. -func (c *domains) Create(ctx context.Context, domain *v1.Domain, opts metav1.CreateOptions) (result *v1.Domain, err error) { - result = &v1.Domain{} - err = c.client.Post(). - Resource("domains"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(domain). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a domain and updates it. Returns the server's representation of the domain, and an error, if there is any. -func (c *domains) Update(ctx context.Context, domain *v1.Domain, opts metav1.UpdateOptions) (result *v1.Domain, err error) { - result = &v1.Domain{} - err = c.client.Put(). - Resource("domains"). - Name(domain.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(domain). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the domain and deletes it. Returns an error if one occurs. -func (c *domains) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("domains"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *domains) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("domains"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched domain. -func (c *domains) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Domain, err error) { - result = &v1.Domain{} - err = c.client.Patch(pt). - Resource("domains"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/fake/fake_config.go b/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/fake/fake_config.go deleted file mode 100644 index 1fe5999e6..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/fake/fake_config.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - configtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeConfigs implements ConfigInterface -type FakeConfigs struct { - Fake *FakeConfigTsmV1 -} - -var configsResource = schema.GroupVersionResource{Group: "config.tsm.tanzu.vmware.com", Version: "v1", Resource: "configs"} - -var configsKind = schema.GroupVersionKind{Group: "config.tsm.tanzu.vmware.com", Version: "v1", Kind: "Config"} - -// Get takes name of the config, and returns the corresponding config object, and an error if there is any. -func (c *FakeConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *configtsmtanzuvmwarecomv1.Config, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(configsResource, name), &configtsmtanzuvmwarecomv1.Config{}) - if obj == nil { - return nil, err - } - return obj.(*configtsmtanzuvmwarecomv1.Config), err -} - -// List takes label and field selectors, and returns the list of Configs that match those selectors. -func (c *FakeConfigs) List(ctx context.Context, opts v1.ListOptions) (result *configtsmtanzuvmwarecomv1.ConfigList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(configsResource, configsKind, opts), &configtsmtanzuvmwarecomv1.ConfigList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &configtsmtanzuvmwarecomv1.ConfigList{ListMeta: obj.(*configtsmtanzuvmwarecomv1.ConfigList).ListMeta} - for _, item := range obj.(*configtsmtanzuvmwarecomv1.ConfigList).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 configs. -func (c *FakeConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(configsResource, opts)) -} - -// Create takes the representation of a config and creates it. Returns the server's representation of the config, and an error, if there is any. -func (c *FakeConfigs) Create(ctx context.Context, config *configtsmtanzuvmwarecomv1.Config, opts v1.CreateOptions) (result *configtsmtanzuvmwarecomv1.Config, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(configsResource, config), &configtsmtanzuvmwarecomv1.Config{}) - if obj == nil { - return nil, err - } - return obj.(*configtsmtanzuvmwarecomv1.Config), err -} - -// Update takes the representation of a config and updates it. Returns the server's representation of the config, and an error, if there is any. -func (c *FakeConfigs) Update(ctx context.Context, config *configtsmtanzuvmwarecomv1.Config, opts v1.UpdateOptions) (result *configtsmtanzuvmwarecomv1.Config, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(configsResource, config), &configtsmtanzuvmwarecomv1.Config{}) - if obj == nil { - return nil, err - } - return obj.(*configtsmtanzuvmwarecomv1.Config), err -} - -// Delete takes name of the config and deletes it. Returns an error if one occurs. -func (c *FakeConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(configsResource, name), &configtsmtanzuvmwarecomv1.Config{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(configsResource, listOpts) - - _, err := c.Fake.Invokes(action, &configtsmtanzuvmwarecomv1.ConfigList{}) - return err -} - -// Patch applies the patch and returns the patched config. -func (c *FakeConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configtsmtanzuvmwarecomv1.Config, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(configsResource, name, pt, data, subresources...), &configtsmtanzuvmwarecomv1.Config{}) - if obj == nil { - return nil, err - } - return obj.(*configtsmtanzuvmwarecomv1.Config), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/fake/fake_config.tsm.tanzu.vmware.com_client.go b/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/fake/fake_config.tsm.tanzu.vmware.com_client.go deleted file mode 100644 index b06382d00..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/fake/fake_config.tsm.tanzu.vmware.com_client.go +++ /dev/null @@ -1,49 +0,0 @@ -/* -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 ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1" - - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeConfigTsmV1 struct { - *testing.Fake -} - -func (c *FakeConfigTsmV1) Configs() v1.ConfigInterface { - return &FakeConfigs{c} -} - -func (c *FakeConfigTsmV1) Domains() v1.DomainInterface { - return &FakeDomains{c} -} - -func (c *FakeConfigTsmV1) FooTypeABCs() v1.FooTypeABCInterface { - return &FakeFooTypeABCs{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeConfigTsmV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/fake/fake_domain.go b/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/fake/fake_domain.go deleted file mode 100644 index b8cb0015b..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/fake/fake_domain.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - configtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeDomains implements DomainInterface -type FakeDomains struct { - Fake *FakeConfigTsmV1 -} - -var domainsResource = schema.GroupVersionResource{Group: "config.tsm.tanzu.vmware.com", Version: "v1", Resource: "domains"} - -var domainsKind = schema.GroupVersionKind{Group: "config.tsm.tanzu.vmware.com", Version: "v1", Kind: "Domain"} - -// Get takes name of the domain, and returns the corresponding domain object, and an error if there is any. -func (c *FakeDomains) Get(ctx context.Context, name string, options v1.GetOptions) (result *configtsmtanzuvmwarecomv1.Domain, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(domainsResource, name), &configtsmtanzuvmwarecomv1.Domain{}) - if obj == nil { - return nil, err - } - return obj.(*configtsmtanzuvmwarecomv1.Domain), err -} - -// List takes label and field selectors, and returns the list of Domains that match those selectors. -func (c *FakeDomains) List(ctx context.Context, opts v1.ListOptions) (result *configtsmtanzuvmwarecomv1.DomainList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(domainsResource, domainsKind, opts), &configtsmtanzuvmwarecomv1.DomainList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &configtsmtanzuvmwarecomv1.DomainList{ListMeta: obj.(*configtsmtanzuvmwarecomv1.DomainList).ListMeta} - for _, item := range obj.(*configtsmtanzuvmwarecomv1.DomainList).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 domains. -func (c *FakeDomains) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(domainsResource, opts)) -} - -// Create takes the representation of a domain and creates it. Returns the server's representation of the domain, and an error, if there is any. -func (c *FakeDomains) Create(ctx context.Context, domain *configtsmtanzuvmwarecomv1.Domain, opts v1.CreateOptions) (result *configtsmtanzuvmwarecomv1.Domain, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(domainsResource, domain), &configtsmtanzuvmwarecomv1.Domain{}) - if obj == nil { - return nil, err - } - return obj.(*configtsmtanzuvmwarecomv1.Domain), err -} - -// Update takes the representation of a domain and updates it. Returns the server's representation of the domain, and an error, if there is any. -func (c *FakeDomains) Update(ctx context.Context, domain *configtsmtanzuvmwarecomv1.Domain, opts v1.UpdateOptions) (result *configtsmtanzuvmwarecomv1.Domain, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(domainsResource, domain), &configtsmtanzuvmwarecomv1.Domain{}) - if obj == nil { - return nil, err - } - return obj.(*configtsmtanzuvmwarecomv1.Domain), err -} - -// Delete takes name of the domain and deletes it. Returns an error if one occurs. -func (c *FakeDomains) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(domainsResource, name), &configtsmtanzuvmwarecomv1.Domain{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeDomains) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(domainsResource, listOpts) - - _, err := c.Fake.Invokes(action, &configtsmtanzuvmwarecomv1.DomainList{}) - return err -} - -// Patch applies the patch and returns the patched domain. -func (c *FakeDomains) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configtsmtanzuvmwarecomv1.Domain, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(domainsResource, name, pt, data, subresources...), &configtsmtanzuvmwarecomv1.Domain{}) - if obj == nil { - return nil, err - } - return obj.(*configtsmtanzuvmwarecomv1.Domain), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/fake/fake_footypeabc.go b/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/fake/fake_footypeabc.go deleted file mode 100644 index 8f19311d8..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/fake/fake_footypeabc.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - configtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeFooTypeABCs implements FooTypeABCInterface -type FakeFooTypeABCs struct { - Fake *FakeConfigTsmV1 -} - -var footypeabcsResource = schema.GroupVersionResource{Group: "config.tsm.tanzu.vmware.com", Version: "v1", Resource: "footypeabcs"} - -var footypeabcsKind = schema.GroupVersionKind{Group: "config.tsm.tanzu.vmware.com", Version: "v1", Kind: "FooTypeABC"} - -// Get takes name of the fooTypeABC, and returns the corresponding fooTypeABC object, and an error if there is any. -func (c *FakeFooTypeABCs) Get(ctx context.Context, name string, options v1.GetOptions) (result *configtsmtanzuvmwarecomv1.FooTypeABC, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(footypeabcsResource, name), &configtsmtanzuvmwarecomv1.FooTypeABC{}) - if obj == nil { - return nil, err - } - return obj.(*configtsmtanzuvmwarecomv1.FooTypeABC), err -} - -// List takes label and field selectors, and returns the list of FooTypeABCs that match those selectors. -func (c *FakeFooTypeABCs) List(ctx context.Context, opts v1.ListOptions) (result *configtsmtanzuvmwarecomv1.FooTypeABCList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(footypeabcsResource, footypeabcsKind, opts), &configtsmtanzuvmwarecomv1.FooTypeABCList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &configtsmtanzuvmwarecomv1.FooTypeABCList{ListMeta: obj.(*configtsmtanzuvmwarecomv1.FooTypeABCList).ListMeta} - for _, item := range obj.(*configtsmtanzuvmwarecomv1.FooTypeABCList).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 fooTypeABCs. -func (c *FakeFooTypeABCs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(footypeabcsResource, opts)) -} - -// Create takes the representation of a fooTypeABC and creates it. Returns the server's representation of the fooTypeABC, and an error, if there is any. -func (c *FakeFooTypeABCs) Create(ctx context.Context, fooTypeABC *configtsmtanzuvmwarecomv1.FooTypeABC, opts v1.CreateOptions) (result *configtsmtanzuvmwarecomv1.FooTypeABC, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(footypeabcsResource, fooTypeABC), &configtsmtanzuvmwarecomv1.FooTypeABC{}) - if obj == nil { - return nil, err - } - return obj.(*configtsmtanzuvmwarecomv1.FooTypeABC), err -} - -// Update takes the representation of a fooTypeABC and updates it. Returns the server's representation of the fooTypeABC, and an error, if there is any. -func (c *FakeFooTypeABCs) Update(ctx context.Context, fooTypeABC *configtsmtanzuvmwarecomv1.FooTypeABC, opts v1.UpdateOptions) (result *configtsmtanzuvmwarecomv1.FooTypeABC, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(footypeabcsResource, fooTypeABC), &configtsmtanzuvmwarecomv1.FooTypeABC{}) - if obj == nil { - return nil, err - } - return obj.(*configtsmtanzuvmwarecomv1.FooTypeABC), err -} - -// Delete takes name of the fooTypeABC and deletes it. Returns an error if one occurs. -func (c *FakeFooTypeABCs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(footypeabcsResource, name), &configtsmtanzuvmwarecomv1.FooTypeABC{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeFooTypeABCs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(footypeabcsResource, listOpts) - - _, err := c.Fake.Invokes(action, &configtsmtanzuvmwarecomv1.FooTypeABCList{}) - return err -} - -// Patch applies the patch and returns the patched fooTypeABC. -func (c *FakeFooTypeABCs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configtsmtanzuvmwarecomv1.FooTypeABC, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(footypeabcsResource, name, pt, data, subresources...), &configtsmtanzuvmwarecomv1.FooTypeABC{}) - if obj == nil { - return nil, err - } - return obj.(*configtsmtanzuvmwarecomv1.FooTypeABC), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/footypeabc.go b/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/footypeabc.go deleted file mode 100644 index a55ba00da..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/footypeabc.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// FooTypeABCsGetter has a method to return a FooTypeABCInterface. -// A group's client should implement this interface. -type FooTypeABCsGetter interface { - FooTypeABCs() FooTypeABCInterface -} - -// FooTypeABCInterface has methods to work with FooTypeABC resources. -type FooTypeABCInterface interface { - Create(ctx context.Context, fooTypeABC *v1.FooTypeABC, opts metav1.CreateOptions) (*v1.FooTypeABC, error) - Update(ctx context.Context, fooTypeABC *v1.FooTypeABC, opts metav1.UpdateOptions) (*v1.FooTypeABC, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.FooTypeABC, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.FooTypeABCList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FooTypeABC, err error) - FooTypeABCExpansion -} - -// fooTypeABCs implements FooTypeABCInterface -type fooTypeABCs struct { - client rest.Interface -} - -// newFooTypeABCs returns a FooTypeABCs -func newFooTypeABCs(c *ConfigTsmV1Client) *fooTypeABCs { - return &fooTypeABCs{ - client: c.RESTClient(), - } -} - -// Get takes name of the fooTypeABC, and returns the corresponding fooTypeABC object, and an error if there is any. -func (c *fooTypeABCs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FooTypeABC, err error) { - result = &v1.FooTypeABC{} - err = c.client.Get(). - Resource("footypeabcs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of FooTypeABCs that match those selectors. -func (c *fooTypeABCs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FooTypeABCList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.FooTypeABCList{} - err = c.client.Get(). - Resource("footypeabcs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested fooTypeABCs. -func (c *fooTypeABCs) Watch(ctx context.Context, opts metav1.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(). - Resource("footypeabcs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a fooTypeABC and creates it. Returns the server's representation of the fooTypeABC, and an error, if there is any. -func (c *fooTypeABCs) Create(ctx context.Context, fooTypeABC *v1.FooTypeABC, opts metav1.CreateOptions) (result *v1.FooTypeABC, err error) { - result = &v1.FooTypeABC{} - err = c.client.Post(). - Resource("footypeabcs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(fooTypeABC). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a fooTypeABC and updates it. Returns the server's representation of the fooTypeABC, and an error, if there is any. -func (c *fooTypeABCs) Update(ctx context.Context, fooTypeABC *v1.FooTypeABC, opts metav1.UpdateOptions) (result *v1.FooTypeABC, err error) { - result = &v1.FooTypeABC{} - err = c.client.Put(). - Resource("footypeabcs"). - Name(fooTypeABC.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(fooTypeABC). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the fooTypeABC and deletes it. Returns an error if one occurs. -func (c *fooTypeABCs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("footypeabcs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *fooTypeABCs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("footypeabcs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched fooTypeABC. -func (c *fooTypeABCs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FooTypeABC, err error) { - result = &v1.FooTypeABC{} - err = c.client.Patch(pt). - Resource("footypeabcs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/generated_expansion.go b/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/generated_expansion.go deleted file mode 100644 index d4f1213fd..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/generated_expansion.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -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 v1 - -type ConfigExpansion interface{} - -type DomainExpansion interface{} - -type FooTypeABCExpansion interface{} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/custom.tsm.tanzu.vmware.com/v1/custom.tsm.tanzu.vmware.com_client.go b/compiler/example/output/generated/client/clientset/versioned/typed/custom.tsm.tanzu.vmware.com/v1/custom.tsm.tanzu.vmware.com_client.go new file mode 100644 index 000000000..54cab3b7f --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/custom.tsm.tanzu.vmware.com/v1/custom.tsm.tanzu.vmware.com_client.go @@ -0,0 +1,85 @@ +/* +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 v1 + +import ( + v1 "nexustempmodule/apis/custom.tsm.tanzu.vmware.com/v1" + "nexustempmodule/client/clientset/versioned/scheme" + + rest "k8s.io/client-go/rest" +) + +type CustomTsmV1Interface interface { + RESTClient() rest.Interface +} + +// CustomTsmV1Client is used to interact with features provided by the custom.tsm.tanzu.vmware.com group. +type CustomTsmV1Client struct { + restClient rest.Interface +} + +// NewForConfig creates a new CustomTsmV1Client for the given config. +func NewForConfig(c *rest.Config) (*CustomTsmV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &CustomTsmV1Client{client}, nil +} + +// NewForConfigOrDie creates a new CustomTsmV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *CustomTsmV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new CustomTsmV1Client for the given RESTClient. +func New(c rest.Interface) *CustomTsmV1Client { + return &CustomTsmV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.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 *CustomTsmV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/doc.go b/compiler/example/output/generated/client/clientset/versioned/typed/custom.tsm.tanzu.vmware.com/v1/doc.go similarity index 100% rename from compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/doc.go rename to compiler/example/output/generated/client/clientset/versioned/typed/custom.tsm.tanzu.vmware.com/v1/doc.go diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/fake/doc.go b/compiler/example/output/generated/client/clientset/versioned/typed/custom.tsm.tanzu.vmware.com/v1/fake/doc.go similarity index 100% rename from compiler/example/output/generated/client/clientset/versioned/typed/config.tsm.tanzu.vmware.com/v1/fake/doc.go rename to compiler/example/output/generated/client/clientset/versioned/typed/custom.tsm.tanzu.vmware.com/v1/fake/doc.go diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/custom.tsm.tanzu.vmware.com/v1/fake/fake_custom.tsm.tanzu.vmware.com_client.go b/compiler/example/output/generated/client/clientset/versioned/typed/custom.tsm.tanzu.vmware.com/v1/fake/fake_custom.tsm.tanzu.vmware.com_client.go new file mode 100644 index 000000000..d59d21224 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/custom.tsm.tanzu.vmware.com/v1/fake/fake_custom.tsm.tanzu.vmware.com_client.go @@ -0,0 +1,35 @@ +/* +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 ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeCustomTsmV1 struct { + *testing.Fake +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeCustomTsmV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/custom.tsm.tanzu.vmware.com/v1/generated_expansion.go b/compiler/example/output/generated/client/clientset/versioned/typed/custom.tsm.tanzu.vmware.com/v1/generated_expansion.go new file mode 100644 index 000000000..177209ec6 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/custom.tsm.tanzu.vmware.com/v1/generated_expansion.go @@ -0,0 +1,19 @@ +/* +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 v1 diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go new file mode 100644 index 000000000..c565868e7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AccessControlPoliciesGetter has a method to return a AccessControlPolicyInterface. +// A group's client should implement this interface. +type AccessControlPoliciesGetter interface { + AccessControlPolicies() AccessControlPolicyInterface +} + +// AccessControlPolicyInterface has methods to work with AccessControlPolicy resources. +type AccessControlPolicyInterface interface { + Create(ctx context.Context, accessControlPolicy *v1.AccessControlPolicy, opts metav1.CreateOptions) (*v1.AccessControlPolicy, error) + Update(ctx context.Context, accessControlPolicy *v1.AccessControlPolicy, opts metav1.UpdateOptions) (*v1.AccessControlPolicy, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AccessControlPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AccessControlPolicyList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AccessControlPolicy, err error) + AccessControlPolicyExpansion +} + +// accessControlPolicies implements AccessControlPolicyInterface +type accessControlPolicies struct { + client rest.Interface +} + +// newAccessControlPolicies returns a AccessControlPolicies +func newAccessControlPolicies(c *GlobalTsmV1Client) *accessControlPolicies { + return &accessControlPolicies{ + client: c.RESTClient(), + } +} + +// Get takes name of the accessControlPolicy, and returns the corresponding accessControlPolicy object, and an error if there is any. +func (c *accessControlPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AccessControlPolicy, err error) { + result = &v1.AccessControlPolicy{} + err = c.client.Get(). + Resource("accesscontrolpolicies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AccessControlPolicies that match those selectors. +func (c *accessControlPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AccessControlPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AccessControlPolicyList{} + err = c.client.Get(). + Resource("accesscontrolpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested accessControlPolicies. +func (c *accessControlPolicies) Watch(ctx context.Context, opts metav1.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(). + Resource("accesscontrolpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a accessControlPolicy and creates it. Returns the server's representation of the accessControlPolicy, and an error, if there is any. +func (c *accessControlPolicies) Create(ctx context.Context, accessControlPolicy *v1.AccessControlPolicy, opts metav1.CreateOptions) (result *v1.AccessControlPolicy, err error) { + result = &v1.AccessControlPolicy{} + err = c.client.Post(). + Resource("accesscontrolpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(accessControlPolicy). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a accessControlPolicy and updates it. Returns the server's representation of the accessControlPolicy, and an error, if there is any. +func (c *accessControlPolicies) Update(ctx context.Context, accessControlPolicy *v1.AccessControlPolicy, opts metav1.UpdateOptions) (result *v1.AccessControlPolicy, err error) { + result = &v1.AccessControlPolicy{} + err = c.client.Put(). + Resource("accesscontrolpolicies"). + Name(accessControlPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(accessControlPolicy). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the accessControlPolicy and deletes it. Returns an error if one occurs. +func (c *accessControlPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("accesscontrolpolicies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *accessControlPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("accesscontrolpolicies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched accessControlPolicy. +func (c *accessControlPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AccessControlPolicy, err error) { + result = &v1.AccessControlPolicy{} + err = c.client.Patch(pt). + Resource("accesscontrolpolicies"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/accesstoken.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/accesstoken.go new file mode 100644 index 000000000..a848256a1 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/accesstoken.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AccessTokensGetter has a method to return a AccessTokenInterface. +// A group's client should implement this interface. +type AccessTokensGetter interface { + AccessTokens() AccessTokenInterface +} + +// AccessTokenInterface has methods to work with AccessToken resources. +type AccessTokenInterface interface { + Create(ctx context.Context, accessToken *v1.AccessToken, opts metav1.CreateOptions) (*v1.AccessToken, error) + Update(ctx context.Context, accessToken *v1.AccessToken, opts metav1.UpdateOptions) (*v1.AccessToken, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AccessToken, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AccessTokenList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AccessToken, err error) + AccessTokenExpansion +} + +// accessTokens implements AccessTokenInterface +type accessTokens struct { + client rest.Interface +} + +// newAccessTokens returns a AccessTokens +func newAccessTokens(c *GlobalTsmV1Client) *accessTokens { + return &accessTokens{ + client: c.RESTClient(), + } +} + +// Get takes name of the accessToken, and returns the corresponding accessToken object, and an error if there is any. +func (c *accessTokens) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AccessToken, err error) { + result = &v1.AccessToken{} + err = c.client.Get(). + Resource("accesstokens"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AccessTokens that match those selectors. +func (c *accessTokens) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AccessTokenList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AccessTokenList{} + err = c.client.Get(). + Resource("accesstokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested accessTokens. +func (c *accessTokens) Watch(ctx context.Context, opts metav1.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(). + Resource("accesstokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a accessToken and creates it. Returns the server's representation of the accessToken, and an error, if there is any. +func (c *accessTokens) Create(ctx context.Context, accessToken *v1.AccessToken, opts metav1.CreateOptions) (result *v1.AccessToken, err error) { + result = &v1.AccessToken{} + err = c.client.Post(). + Resource("accesstokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(accessToken). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a accessToken and updates it. Returns the server's representation of the accessToken, and an error, if there is any. +func (c *accessTokens) Update(ctx context.Context, accessToken *v1.AccessToken, opts metav1.UpdateOptions) (result *v1.AccessToken, err error) { + result = &v1.AccessToken{} + err = c.client.Put(). + Resource("accesstokens"). + Name(accessToken.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(accessToken). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the accessToken and deletes it. Returns an error if one occurs. +func (c *accessTokens) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("accesstokens"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *accessTokens) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("accesstokens"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched accessToken. +func (c *accessTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AccessToken, err error) { + result = &v1.AccessToken{} + err = c.client.Patch(pt). + Resource("accesstokens"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/acpconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/acpconfig.go new file mode 100644 index 000000000..efdd10ee8 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/acpconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ACPConfigsGetter has a method to return a ACPConfigInterface. +// A group's client should implement this interface. +type ACPConfigsGetter interface { + ACPConfigs() ACPConfigInterface +} + +// ACPConfigInterface has methods to work with ACPConfig resources. +type ACPConfigInterface interface { + Create(ctx context.Context, aCPConfig *v1.ACPConfig, opts metav1.CreateOptions) (*v1.ACPConfig, error) + Update(ctx context.Context, aCPConfig *v1.ACPConfig, opts metav1.UpdateOptions) (*v1.ACPConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ACPConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ACPConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ACPConfig, err error) + ACPConfigExpansion +} + +// aCPConfigs implements ACPConfigInterface +type aCPConfigs struct { + client rest.Interface +} + +// newACPConfigs returns a ACPConfigs +func newACPConfigs(c *GlobalTsmV1Client) *aCPConfigs { + return &aCPConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the aCPConfig, and returns the corresponding aCPConfig object, and an error if there is any. +func (c *aCPConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ACPConfig, err error) { + result = &v1.ACPConfig{} + err = c.client.Get(). + Resource("acpconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ACPConfigs that match those selectors. +func (c *aCPConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ACPConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ACPConfigList{} + err = c.client.Get(). + Resource("acpconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested aCPConfigs. +func (c *aCPConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("acpconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a aCPConfig and creates it. Returns the server's representation of the aCPConfig, and an error, if there is any. +func (c *aCPConfigs) Create(ctx context.Context, aCPConfig *v1.ACPConfig, opts metav1.CreateOptions) (result *v1.ACPConfig, err error) { + result = &v1.ACPConfig{} + err = c.client.Post(). + Resource("acpconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(aCPConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a aCPConfig and updates it. Returns the server's representation of the aCPConfig, and an error, if there is any. +func (c *aCPConfigs) Update(ctx context.Context, aCPConfig *v1.ACPConfig, opts metav1.UpdateOptions) (result *v1.ACPConfig, err error) { + result = &v1.ACPConfig{} + err = c.client.Put(). + Resource("acpconfigs"). + Name(aCPConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(aCPConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the aCPConfig and deletes it. Returns an error if one occurs. +func (c *aCPConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("acpconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *aCPConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("acpconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched aCPConfig. +func (c *aCPConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ACPConfig, err error) { + result = &v1.ACPConfig{} + err = c.client.Patch(pt). + Resource("acpconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/additionalattributes.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/additionalattributes.go new file mode 100644 index 000000000..07beba3a7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/additionalattributes.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AdditionalAttributesesGetter has a method to return a AdditionalAttributesInterface. +// A group's client should implement this interface. +type AdditionalAttributesesGetter interface { + AdditionalAttributeses() AdditionalAttributesInterface +} + +// AdditionalAttributesInterface has methods to work with AdditionalAttributes resources. +type AdditionalAttributesInterface interface { + Create(ctx context.Context, additionalAttributes *v1.AdditionalAttributes, opts metav1.CreateOptions) (*v1.AdditionalAttributes, error) + Update(ctx context.Context, additionalAttributes *v1.AdditionalAttributes, opts metav1.UpdateOptions) (*v1.AdditionalAttributes, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AdditionalAttributes, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AdditionalAttributesList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AdditionalAttributes, err error) + AdditionalAttributesExpansion +} + +// additionalAttributeses implements AdditionalAttributesInterface +type additionalAttributeses struct { + client rest.Interface +} + +// newAdditionalAttributeses returns a AdditionalAttributeses +func newAdditionalAttributeses(c *GlobalTsmV1Client) *additionalAttributeses { + return &additionalAttributeses{ + client: c.RESTClient(), + } +} + +// Get takes name of the additionalAttributes, and returns the corresponding additionalAttributes object, and an error if there is any. +func (c *additionalAttributeses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AdditionalAttributes, err error) { + result = &v1.AdditionalAttributes{} + err = c.client.Get(). + Resource("additionalattributeses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AdditionalAttributeses that match those selectors. +func (c *additionalAttributeses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AdditionalAttributesList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AdditionalAttributesList{} + err = c.client.Get(). + Resource("additionalattributeses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested additionalAttributeses. +func (c *additionalAttributeses) Watch(ctx context.Context, opts metav1.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(). + Resource("additionalattributeses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a additionalAttributes and creates it. Returns the server's representation of the additionalAttributes, and an error, if there is any. +func (c *additionalAttributeses) Create(ctx context.Context, additionalAttributes *v1.AdditionalAttributes, opts metav1.CreateOptions) (result *v1.AdditionalAttributes, err error) { + result = &v1.AdditionalAttributes{} + err = c.client.Post(). + Resource("additionalattributeses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(additionalAttributes). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a additionalAttributes and updates it. Returns the server's representation of the additionalAttributes, and an error, if there is any. +func (c *additionalAttributeses) Update(ctx context.Context, additionalAttributes *v1.AdditionalAttributes, opts metav1.UpdateOptions) (result *v1.AdditionalAttributes, err error) { + result = &v1.AdditionalAttributes{} + err = c.client.Put(). + Resource("additionalattributeses"). + Name(additionalAttributes.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(additionalAttributes). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the additionalAttributes and deletes it. Returns an error if one occurs. +func (c *additionalAttributeses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("additionalattributeses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *additionalAttributeses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("additionalattributeses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched additionalAttributes. +func (c *additionalAttributeses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AdditionalAttributes, err error) { + result = &v1.AdditionalAttributes{} + err = c.client.Patch(pt). + Resource("additionalattributeses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/allsparkservices.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/allsparkservices.go new file mode 100644 index 000000000..f74ba646a --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/allsparkservices.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AllSparkServicesesGetter has a method to return a AllSparkServicesInterface. +// A group's client should implement this interface. +type AllSparkServicesesGetter interface { + AllSparkServiceses() AllSparkServicesInterface +} + +// AllSparkServicesInterface has methods to work with AllSparkServices resources. +type AllSparkServicesInterface interface { + Create(ctx context.Context, allSparkServices *v1.AllSparkServices, opts metav1.CreateOptions) (*v1.AllSparkServices, error) + Update(ctx context.Context, allSparkServices *v1.AllSparkServices, opts metav1.UpdateOptions) (*v1.AllSparkServices, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AllSparkServices, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AllSparkServicesList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AllSparkServices, err error) + AllSparkServicesExpansion +} + +// allSparkServiceses implements AllSparkServicesInterface +type allSparkServiceses struct { + client rest.Interface +} + +// newAllSparkServiceses returns a AllSparkServiceses +func newAllSparkServiceses(c *GlobalTsmV1Client) *allSparkServiceses { + return &allSparkServiceses{ + client: c.RESTClient(), + } +} + +// Get takes name of the allSparkServices, and returns the corresponding allSparkServices object, and an error if there is any. +func (c *allSparkServiceses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AllSparkServices, err error) { + result = &v1.AllSparkServices{} + err = c.client.Get(). + Resource("allsparkserviceses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AllSparkServiceses that match those selectors. +func (c *allSparkServiceses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AllSparkServicesList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AllSparkServicesList{} + err = c.client.Get(). + Resource("allsparkserviceses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested allSparkServiceses. +func (c *allSparkServiceses) Watch(ctx context.Context, opts metav1.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(). + Resource("allsparkserviceses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a allSparkServices and creates it. Returns the server's representation of the allSparkServices, and an error, if there is any. +func (c *allSparkServiceses) Create(ctx context.Context, allSparkServices *v1.AllSparkServices, opts metav1.CreateOptions) (result *v1.AllSparkServices, err error) { + result = &v1.AllSparkServices{} + err = c.client.Post(). + Resource("allsparkserviceses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(allSparkServices). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a allSparkServices and updates it. Returns the server's representation of the allSparkServices, and an error, if there is any. +func (c *allSparkServiceses) Update(ctx context.Context, allSparkServices *v1.AllSparkServices, opts metav1.UpdateOptions) (result *v1.AllSparkServices, err error) { + result = &v1.AllSparkServices{} + err = c.client.Put(). + Resource("allsparkserviceses"). + Name(allSparkServices.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(allSparkServices). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the allSparkServices and deletes it. Returns an error if one occurs. +func (c *allSparkServiceses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("allsparkserviceses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *allSparkServiceses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("allsparkserviceses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched allSparkServices. +func (c *allSparkServiceses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AllSparkServices, err error) { + result = &v1.AllSparkServices{} + err = c.client.Patch(pt). + Resource("allsparkserviceses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/annotation.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/annotation.go new file mode 100644 index 000000000..33fc77271 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/annotation.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AnnotationsGetter has a method to return a AnnotationInterface. +// A group's client should implement this interface. +type AnnotationsGetter interface { + Annotations() AnnotationInterface +} + +// AnnotationInterface has methods to work with Annotation resources. +type AnnotationInterface interface { + Create(ctx context.Context, annotation *v1.Annotation, opts metav1.CreateOptions) (*v1.Annotation, error) + Update(ctx context.Context, annotation *v1.Annotation, opts metav1.UpdateOptions) (*v1.Annotation, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Annotation, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AnnotationList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Annotation, err error) + AnnotationExpansion +} + +// annotations implements AnnotationInterface +type annotations struct { + client rest.Interface +} + +// newAnnotations returns a Annotations +func newAnnotations(c *GlobalTsmV1Client) *annotations { + return &annotations{ + client: c.RESTClient(), + } +} + +// Get takes name of the annotation, and returns the corresponding annotation object, and an error if there is any. +func (c *annotations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Annotation, err error) { + result = &v1.Annotation{} + err = c.client.Get(). + Resource("annotations"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Annotations that match those selectors. +func (c *annotations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AnnotationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AnnotationList{} + err = c.client.Get(). + Resource("annotations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested annotations. +func (c *annotations) Watch(ctx context.Context, opts metav1.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(). + Resource("annotations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a annotation and creates it. Returns the server's representation of the annotation, and an error, if there is any. +func (c *annotations) Create(ctx context.Context, annotation *v1.Annotation, opts metav1.CreateOptions) (result *v1.Annotation, err error) { + result = &v1.Annotation{} + err = c.client.Post(). + Resource("annotations"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(annotation). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a annotation and updates it. Returns the server's representation of the annotation, and an error, if there is any. +func (c *annotations) Update(ctx context.Context, annotation *v1.Annotation, opts metav1.UpdateOptions) (result *v1.Annotation, err error) { + result = &v1.Annotation{} + err = c.client.Put(). + Resource("annotations"). + Name(annotation.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(annotation). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the annotation and deletes it. Returns an error if one occurs. +func (c *annotations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("annotations"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *annotations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("annotations"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched annotation. +func (c *annotations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Annotation, err error) { + result = &v1.Annotation{} + err = c.client.Patch(pt). + Resource("annotations"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/apidiscovery.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/apidiscovery.go new file mode 100644 index 000000000..a55973327 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/apidiscovery.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ApiDiscoveriesGetter has a method to return a ApiDiscoveryInterface. +// A group's client should implement this interface. +type ApiDiscoveriesGetter interface { + ApiDiscoveries() ApiDiscoveryInterface +} + +// ApiDiscoveryInterface has methods to work with ApiDiscovery resources. +type ApiDiscoveryInterface interface { + Create(ctx context.Context, apiDiscovery *v1.ApiDiscovery, opts metav1.CreateOptions) (*v1.ApiDiscovery, error) + Update(ctx context.Context, apiDiscovery *v1.ApiDiscovery, opts metav1.UpdateOptions) (*v1.ApiDiscovery, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ApiDiscovery, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ApiDiscoveryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ApiDiscovery, err error) + ApiDiscoveryExpansion +} + +// apiDiscoveries implements ApiDiscoveryInterface +type apiDiscoveries struct { + client rest.Interface +} + +// newApiDiscoveries returns a ApiDiscoveries +func newApiDiscoveries(c *GlobalTsmV1Client) *apiDiscoveries { + return &apiDiscoveries{ + client: c.RESTClient(), + } +} + +// Get takes name of the apiDiscovery, and returns the corresponding apiDiscovery object, and an error if there is any. +func (c *apiDiscoveries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ApiDiscovery, err error) { + result = &v1.ApiDiscovery{} + err = c.client.Get(). + Resource("apidiscoveries"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ApiDiscoveries that match those selectors. +func (c *apiDiscoveries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ApiDiscoveryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ApiDiscoveryList{} + err = c.client.Get(). + Resource("apidiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested apiDiscoveries. +func (c *apiDiscoveries) Watch(ctx context.Context, opts metav1.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(). + Resource("apidiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a apiDiscovery and creates it. Returns the server's representation of the apiDiscovery, and an error, if there is any. +func (c *apiDiscoveries) Create(ctx context.Context, apiDiscovery *v1.ApiDiscovery, opts metav1.CreateOptions) (result *v1.ApiDiscovery, err error) { + result = &v1.ApiDiscovery{} + err = c.client.Post(). + Resource("apidiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(apiDiscovery). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a apiDiscovery and updates it. Returns the server's representation of the apiDiscovery, and an error, if there is any. +func (c *apiDiscoveries) Update(ctx context.Context, apiDiscovery *v1.ApiDiscovery, opts metav1.UpdateOptions) (result *v1.ApiDiscovery, err error) { + result = &v1.ApiDiscovery{} + err = c.client.Put(). + Resource("apidiscoveries"). + Name(apiDiscovery.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(apiDiscovery). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the apiDiscovery and deletes it. Returns an error if one occurs. +func (c *apiDiscoveries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("apidiscoveries"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *apiDiscoveries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("apidiscoveries"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched apiDiscovery. +func (c *apiDiscoveries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ApiDiscovery, err error) { + result = &v1.ApiDiscovery{} + err = c.client.Patch(pt). + Resource("apidiscoveries"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/apidiscoveryrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/apidiscoveryrt.go new file mode 100644 index 000000000..9825fb2b1 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/apidiscoveryrt.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ApiDiscoveryRTsGetter has a method to return a ApiDiscoveryRTInterface. +// A group's client should implement this interface. +type ApiDiscoveryRTsGetter interface { + ApiDiscoveryRTs() ApiDiscoveryRTInterface +} + +// ApiDiscoveryRTInterface has methods to work with ApiDiscoveryRT resources. +type ApiDiscoveryRTInterface interface { + Create(ctx context.Context, apiDiscoveryRT *v1.ApiDiscoveryRT, opts metav1.CreateOptions) (*v1.ApiDiscoveryRT, error) + Update(ctx context.Context, apiDiscoveryRT *v1.ApiDiscoveryRT, opts metav1.UpdateOptions) (*v1.ApiDiscoveryRT, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ApiDiscoveryRT, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ApiDiscoveryRTList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ApiDiscoveryRT, err error) + ApiDiscoveryRTExpansion +} + +// apiDiscoveryRTs implements ApiDiscoveryRTInterface +type apiDiscoveryRTs struct { + client rest.Interface +} + +// newApiDiscoveryRTs returns a ApiDiscoveryRTs +func newApiDiscoveryRTs(c *GlobalTsmV1Client) *apiDiscoveryRTs { + return &apiDiscoveryRTs{ + client: c.RESTClient(), + } +} + +// Get takes name of the apiDiscoveryRT, and returns the corresponding apiDiscoveryRT object, and an error if there is any. +func (c *apiDiscoveryRTs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ApiDiscoveryRT, err error) { + result = &v1.ApiDiscoveryRT{} + err = c.client.Get(). + Resource("apidiscoveryrts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ApiDiscoveryRTs that match those selectors. +func (c *apiDiscoveryRTs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ApiDiscoveryRTList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ApiDiscoveryRTList{} + err = c.client.Get(). + Resource("apidiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested apiDiscoveryRTs. +func (c *apiDiscoveryRTs) Watch(ctx context.Context, opts metav1.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(). + Resource("apidiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a apiDiscoveryRT and creates it. Returns the server's representation of the apiDiscoveryRT, and an error, if there is any. +func (c *apiDiscoveryRTs) Create(ctx context.Context, apiDiscoveryRT *v1.ApiDiscoveryRT, opts metav1.CreateOptions) (result *v1.ApiDiscoveryRT, err error) { + result = &v1.ApiDiscoveryRT{} + err = c.client.Post(). + Resource("apidiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(apiDiscoveryRT). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a apiDiscoveryRT and updates it. Returns the server's representation of the apiDiscoveryRT, and an error, if there is any. +func (c *apiDiscoveryRTs) Update(ctx context.Context, apiDiscoveryRT *v1.ApiDiscoveryRT, opts metav1.UpdateOptions) (result *v1.ApiDiscoveryRT, err error) { + result = &v1.ApiDiscoveryRT{} + err = c.client.Put(). + Resource("apidiscoveryrts"). + Name(apiDiscoveryRT.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(apiDiscoveryRT). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the apiDiscoveryRT and deletes it. Returns an error if one occurs. +func (c *apiDiscoveryRTs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("apidiscoveryrts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *apiDiscoveryRTs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("apidiscoveryrts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched apiDiscoveryRT. +func (c *apiDiscoveryRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ApiDiscoveryRT, err error) { + result = &v1.ApiDiscoveryRT{} + err = c.client.Patch(pt). + Resource("apidiscoveryrts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/app.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/app.go new file mode 100644 index 000000000..4415bdfb2 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/app.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AppsGetter has a method to return a AppInterface. +// A group's client should implement this interface. +type AppsGetter interface { + Apps() AppInterface +} + +// AppInterface has methods to work with App resources. +type AppInterface interface { + Create(ctx context.Context, app *v1.App, opts metav1.CreateOptions) (*v1.App, error) + Update(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (*v1.App, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.App, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AppList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.App, err error) + AppExpansion +} + +// apps implements AppInterface +type apps struct { + client rest.Interface +} + +// newApps returns a Apps +func newApps(c *GlobalTsmV1Client) *apps { + return &apps{ + client: c.RESTClient(), + } +} + +// Get takes name of the app, and returns the corresponding app object, and an error if there is any. +func (c *apps) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.App, err error) { + result = &v1.App{} + err = c.client.Get(). + Resource("apps"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Apps that match those selectors. +func (c *apps) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AppList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AppList{} + err = c.client.Get(). + Resource("apps"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested apps. +func (c *apps) Watch(ctx context.Context, opts metav1.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(). + Resource("apps"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a app and creates it. Returns the server's representation of the app, and an error, if there is any. +func (c *apps) Create(ctx context.Context, app *v1.App, opts metav1.CreateOptions) (result *v1.App, err error) { + result = &v1.App{} + err = c.client.Post(). + Resource("apps"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(app). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a app and updates it. Returns the server's representation of the app, and an error, if there is any. +func (c *apps) Update(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (result *v1.App, err error) { + result = &v1.App{} + err = c.client.Put(). + Resource("apps"). + Name(app.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(app). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the app and deletes it. Returns an error if one occurs. +func (c *apps) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("apps"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *apps) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("apps"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched app. +func (c *apps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.App, err error) { + result = &v1.App{} + err = c.client.Patch(pt). + Resource("apps"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/appfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/appfolder.go new file mode 100644 index 000000000..146a64ca7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/appfolder.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AppFoldersGetter has a method to return a AppFolderInterface. +// A group's client should implement this interface. +type AppFoldersGetter interface { + AppFolders() AppFolderInterface +} + +// AppFolderInterface has methods to work with AppFolder resources. +type AppFolderInterface interface { + Create(ctx context.Context, appFolder *v1.AppFolder, opts metav1.CreateOptions) (*v1.AppFolder, error) + Update(ctx context.Context, appFolder *v1.AppFolder, opts metav1.UpdateOptions) (*v1.AppFolder, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AppFolder, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AppFolderList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AppFolder, err error) + AppFolderExpansion +} + +// appFolders implements AppFolderInterface +type appFolders struct { + client rest.Interface +} + +// newAppFolders returns a AppFolders +func newAppFolders(c *GlobalTsmV1Client) *appFolders { + return &appFolders{ + client: c.RESTClient(), + } +} + +// Get takes name of the appFolder, and returns the corresponding appFolder object, and an error if there is any. +func (c *appFolders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AppFolder, err error) { + result = &v1.AppFolder{} + err = c.client.Get(). + Resource("appfolders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AppFolders that match those selectors. +func (c *appFolders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AppFolderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AppFolderList{} + err = c.client.Get(). + Resource("appfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested appFolders. +func (c *appFolders) Watch(ctx context.Context, opts metav1.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(). + Resource("appfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a appFolder and creates it. Returns the server's representation of the appFolder, and an error, if there is any. +func (c *appFolders) Create(ctx context.Context, appFolder *v1.AppFolder, opts metav1.CreateOptions) (result *v1.AppFolder, err error) { + result = &v1.AppFolder{} + err = c.client.Post(). + Resource("appfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(appFolder). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a appFolder and updates it. Returns the server's representation of the appFolder, and an error, if there is any. +func (c *appFolders) Update(ctx context.Context, appFolder *v1.AppFolder, opts metav1.UpdateOptions) (result *v1.AppFolder, err error) { + result = &v1.AppFolder{} + err = c.client.Put(). + Resource("appfolders"). + Name(appFolder.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(appFolder). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the appFolder and deletes it. Returns an error if one occurs. +func (c *appFolders) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("appfolders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *appFolders) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("appfolders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched appFolder. +func (c *appFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AppFolder, err error) { + result = &v1.AppFolder{} + err = c.client.Patch(pt). + Resource("appfolders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/appgroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/appgroup.go new file mode 100644 index 000000000..c4988052e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/appgroup.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AppGroupsGetter has a method to return a AppGroupInterface. +// A group's client should implement this interface. +type AppGroupsGetter interface { + AppGroups() AppGroupInterface +} + +// AppGroupInterface has methods to work with AppGroup resources. +type AppGroupInterface interface { + Create(ctx context.Context, appGroup *v1.AppGroup, opts metav1.CreateOptions) (*v1.AppGroup, error) + Update(ctx context.Context, appGroup *v1.AppGroup, opts metav1.UpdateOptions) (*v1.AppGroup, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AppGroup, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AppGroupList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AppGroup, err error) + AppGroupExpansion +} + +// appGroups implements AppGroupInterface +type appGroups struct { + client rest.Interface +} + +// newAppGroups returns a AppGroups +func newAppGroups(c *GlobalTsmV1Client) *appGroups { + return &appGroups{ + client: c.RESTClient(), + } +} + +// Get takes name of the appGroup, and returns the corresponding appGroup object, and an error if there is any. +func (c *appGroups) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AppGroup, err error) { + result = &v1.AppGroup{} + err = c.client.Get(). + Resource("appgroups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AppGroups that match those selectors. +func (c *appGroups) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AppGroupList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AppGroupList{} + err = c.client.Get(). + Resource("appgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested appGroups. +func (c *appGroups) Watch(ctx context.Context, opts metav1.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(). + Resource("appgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a appGroup and creates it. Returns the server's representation of the appGroup, and an error, if there is any. +func (c *appGroups) Create(ctx context.Context, appGroup *v1.AppGroup, opts metav1.CreateOptions) (result *v1.AppGroup, err error) { + result = &v1.AppGroup{} + err = c.client.Post(). + Resource("appgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(appGroup). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a appGroup and updates it. Returns the server's representation of the appGroup, and an error, if there is any. +func (c *appGroups) Update(ctx context.Context, appGroup *v1.AppGroup, opts metav1.UpdateOptions) (result *v1.AppGroup, err error) { + result = &v1.AppGroup{} + err = c.client.Put(). + Resource("appgroups"). + Name(appGroup.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(appGroup). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the appGroup and deletes it. Returns an error if one occurs. +func (c *appGroups) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("appgroups"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *appGroups) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("appgroups"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched appGroup. +func (c *appGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AppGroup, err error) { + result = &v1.AppGroup{} + err = c.client.Patch(pt). + Resource("appgroups"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/applicationinfo.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/applicationinfo.go new file mode 100644 index 000000000..f83cd0a8b --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/applicationinfo.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ApplicationInfosGetter has a method to return a ApplicationInfoInterface. +// A group's client should implement this interface. +type ApplicationInfosGetter interface { + ApplicationInfos() ApplicationInfoInterface +} + +// ApplicationInfoInterface has methods to work with ApplicationInfo resources. +type ApplicationInfoInterface interface { + Create(ctx context.Context, applicationInfo *v1.ApplicationInfo, opts metav1.CreateOptions) (*v1.ApplicationInfo, error) + Update(ctx context.Context, applicationInfo *v1.ApplicationInfo, opts metav1.UpdateOptions) (*v1.ApplicationInfo, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ApplicationInfo, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ApplicationInfoList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ApplicationInfo, err error) + ApplicationInfoExpansion +} + +// applicationInfos implements ApplicationInfoInterface +type applicationInfos struct { + client rest.Interface +} + +// newApplicationInfos returns a ApplicationInfos +func newApplicationInfos(c *GlobalTsmV1Client) *applicationInfos { + return &applicationInfos{ + client: c.RESTClient(), + } +} + +// Get takes name of the applicationInfo, and returns the corresponding applicationInfo object, and an error if there is any. +func (c *applicationInfos) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ApplicationInfo, err error) { + result = &v1.ApplicationInfo{} + err = c.client.Get(). + Resource("applicationinfos"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ApplicationInfos that match those selectors. +func (c *applicationInfos) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ApplicationInfoList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ApplicationInfoList{} + err = c.client.Get(). + Resource("applicationinfos"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested applicationInfos. +func (c *applicationInfos) Watch(ctx context.Context, opts metav1.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(). + Resource("applicationinfos"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a applicationInfo and creates it. Returns the server's representation of the applicationInfo, and an error, if there is any. +func (c *applicationInfos) Create(ctx context.Context, applicationInfo *v1.ApplicationInfo, opts metav1.CreateOptions) (result *v1.ApplicationInfo, err error) { + result = &v1.ApplicationInfo{} + err = c.client.Post(). + Resource("applicationinfos"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(applicationInfo). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a applicationInfo and updates it. Returns the server's representation of the applicationInfo, and an error, if there is any. +func (c *applicationInfos) Update(ctx context.Context, applicationInfo *v1.ApplicationInfo, opts metav1.UpdateOptions) (result *v1.ApplicationInfo, err error) { + result = &v1.ApplicationInfo{} + err = c.client.Put(). + Resource("applicationinfos"). + Name(applicationInfo.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(applicationInfo). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the applicationInfo and deletes it. Returns an error if one occurs. +func (c *applicationInfos) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("applicationinfos"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *applicationInfos) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("applicationinfos"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched applicationInfo. +func (c *applicationInfos) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ApplicationInfo, err error) { + result = &v1.ApplicationInfo{} + err = c.client.Patch(pt). + Resource("applicationinfos"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/apptemplate.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/apptemplate.go new file mode 100644 index 000000000..1469917a0 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/apptemplate.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AppTemplatesGetter has a method to return a AppTemplateInterface. +// A group's client should implement this interface. +type AppTemplatesGetter interface { + AppTemplates() AppTemplateInterface +} + +// AppTemplateInterface has methods to work with AppTemplate resources. +type AppTemplateInterface interface { + Create(ctx context.Context, appTemplate *v1.AppTemplate, opts metav1.CreateOptions) (*v1.AppTemplate, error) + Update(ctx context.Context, appTemplate *v1.AppTemplate, opts metav1.UpdateOptions) (*v1.AppTemplate, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AppTemplate, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AppTemplateList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AppTemplate, err error) + AppTemplateExpansion +} + +// appTemplates implements AppTemplateInterface +type appTemplates struct { + client rest.Interface +} + +// newAppTemplates returns a AppTemplates +func newAppTemplates(c *GlobalTsmV1Client) *appTemplates { + return &appTemplates{ + client: c.RESTClient(), + } +} + +// Get takes name of the appTemplate, and returns the corresponding appTemplate object, and an error if there is any. +func (c *appTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AppTemplate, err error) { + result = &v1.AppTemplate{} + err = c.client.Get(). + Resource("apptemplates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AppTemplates that match those selectors. +func (c *appTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AppTemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AppTemplateList{} + err = c.client.Get(). + Resource("apptemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested appTemplates. +func (c *appTemplates) Watch(ctx context.Context, opts metav1.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(). + Resource("apptemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a appTemplate and creates it. Returns the server's representation of the appTemplate, and an error, if there is any. +func (c *appTemplates) Create(ctx context.Context, appTemplate *v1.AppTemplate, opts metav1.CreateOptions) (result *v1.AppTemplate, err error) { + result = &v1.AppTemplate{} + err = c.client.Post(). + Resource("apptemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(appTemplate). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a appTemplate and updates it. Returns the server's representation of the appTemplate, and an error, if there is any. +func (c *appTemplates) Update(ctx context.Context, appTemplate *v1.AppTemplate, opts metav1.UpdateOptions) (result *v1.AppTemplate, err error) { + result = &v1.AppTemplate{} + err = c.client.Put(). + Resource("apptemplates"). + Name(appTemplate.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(appTemplate). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the appTemplate and deletes it. Returns an error if one occurs. +func (c *appTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("apptemplates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *appTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("apptemplates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched appTemplate. +func (c *appTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AppTemplate, err error) { + result = &v1.AppTemplate{} + err = c.client.Patch(pt). + Resource("apptemplates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/apptemplateservicedefinition.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/apptemplateservicedefinition.go new file mode 100644 index 000000000..e5d39e977 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/apptemplateservicedefinition.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AppTemplateServiceDefinitionsGetter has a method to return a AppTemplateServiceDefinitionInterface. +// A group's client should implement this interface. +type AppTemplateServiceDefinitionsGetter interface { + AppTemplateServiceDefinitions() AppTemplateServiceDefinitionInterface +} + +// AppTemplateServiceDefinitionInterface has methods to work with AppTemplateServiceDefinition resources. +type AppTemplateServiceDefinitionInterface interface { + Create(ctx context.Context, appTemplateServiceDefinition *v1.AppTemplateServiceDefinition, opts metav1.CreateOptions) (*v1.AppTemplateServiceDefinition, error) + Update(ctx context.Context, appTemplateServiceDefinition *v1.AppTemplateServiceDefinition, opts metav1.UpdateOptions) (*v1.AppTemplateServiceDefinition, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AppTemplateServiceDefinition, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AppTemplateServiceDefinitionList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AppTemplateServiceDefinition, err error) + AppTemplateServiceDefinitionExpansion +} + +// appTemplateServiceDefinitions implements AppTemplateServiceDefinitionInterface +type appTemplateServiceDefinitions struct { + client rest.Interface +} + +// newAppTemplateServiceDefinitions returns a AppTemplateServiceDefinitions +func newAppTemplateServiceDefinitions(c *GlobalTsmV1Client) *appTemplateServiceDefinitions { + return &appTemplateServiceDefinitions{ + client: c.RESTClient(), + } +} + +// Get takes name of the appTemplateServiceDefinition, and returns the corresponding appTemplateServiceDefinition object, and an error if there is any. +func (c *appTemplateServiceDefinitions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AppTemplateServiceDefinition, err error) { + result = &v1.AppTemplateServiceDefinition{} + err = c.client.Get(). + Resource("apptemplateservicedefinitions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AppTemplateServiceDefinitions that match those selectors. +func (c *appTemplateServiceDefinitions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AppTemplateServiceDefinitionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AppTemplateServiceDefinitionList{} + err = c.client.Get(). + Resource("apptemplateservicedefinitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested appTemplateServiceDefinitions. +func (c *appTemplateServiceDefinitions) Watch(ctx context.Context, opts metav1.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(). + Resource("apptemplateservicedefinitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a appTemplateServiceDefinition and creates it. Returns the server's representation of the appTemplateServiceDefinition, and an error, if there is any. +func (c *appTemplateServiceDefinitions) Create(ctx context.Context, appTemplateServiceDefinition *v1.AppTemplateServiceDefinition, opts metav1.CreateOptions) (result *v1.AppTemplateServiceDefinition, err error) { + result = &v1.AppTemplateServiceDefinition{} + err = c.client.Post(). + Resource("apptemplateservicedefinitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(appTemplateServiceDefinition). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a appTemplateServiceDefinition and updates it. Returns the server's representation of the appTemplateServiceDefinition, and an error, if there is any. +func (c *appTemplateServiceDefinitions) Update(ctx context.Context, appTemplateServiceDefinition *v1.AppTemplateServiceDefinition, opts metav1.UpdateOptions) (result *v1.AppTemplateServiceDefinition, err error) { + result = &v1.AppTemplateServiceDefinition{} + err = c.client.Put(). + Resource("apptemplateservicedefinitions"). + Name(appTemplateServiceDefinition.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(appTemplateServiceDefinition). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the appTemplateServiceDefinition and deletes it. Returns an error if one occurs. +func (c *appTemplateServiceDefinitions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("apptemplateservicedefinitions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *appTemplateServiceDefinitions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("apptemplateservicedefinitions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched appTemplateServiceDefinition. +func (c *appTemplateServiceDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AppTemplateServiceDefinition, err error) { + result = &v1.AppTemplateServiceDefinition{} + err = c.client.Patch(pt). + Resource("apptemplateservicedefinitions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/appuser.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/appuser.go new file mode 100644 index 000000000..46b9d6fa8 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/appuser.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AppUsersGetter has a method to return a AppUserInterface. +// A group's client should implement this interface. +type AppUsersGetter interface { + AppUsers() AppUserInterface +} + +// AppUserInterface has methods to work with AppUser resources. +type AppUserInterface interface { + Create(ctx context.Context, appUser *v1.AppUser, opts metav1.CreateOptions) (*v1.AppUser, error) + Update(ctx context.Context, appUser *v1.AppUser, opts metav1.UpdateOptions) (*v1.AppUser, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AppUser, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AppUserList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AppUser, err error) + AppUserExpansion +} + +// appUsers implements AppUserInterface +type appUsers struct { + client rest.Interface +} + +// newAppUsers returns a AppUsers +func newAppUsers(c *GlobalTsmV1Client) *appUsers { + return &appUsers{ + client: c.RESTClient(), + } +} + +// Get takes name of the appUser, and returns the corresponding appUser object, and an error if there is any. +func (c *appUsers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AppUser, err error) { + result = &v1.AppUser{} + err = c.client.Get(). + Resource("appusers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AppUsers that match those selectors. +func (c *appUsers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AppUserList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AppUserList{} + err = c.client.Get(). + Resource("appusers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested appUsers. +func (c *appUsers) Watch(ctx context.Context, opts metav1.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(). + Resource("appusers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a appUser and creates it. Returns the server's representation of the appUser, and an error, if there is any. +func (c *appUsers) Create(ctx context.Context, appUser *v1.AppUser, opts metav1.CreateOptions) (result *v1.AppUser, err error) { + result = &v1.AppUser{} + err = c.client.Post(). + Resource("appusers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(appUser). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a appUser and updates it. Returns the server's representation of the appUser, and an error, if there is any. +func (c *appUsers) Update(ctx context.Context, appUser *v1.AppUser, opts metav1.UpdateOptions) (result *v1.AppUser, err error) { + result = &v1.AppUser{} + err = c.client.Put(). + Resource("appusers"). + Name(appUser.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(appUser). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the appUser and deletes it. Returns an error if one occurs. +func (c *appUsers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("appusers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *appUsers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("appusers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched appUser. +func (c *appUsers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AppUser, err error) { + result = &v1.AppUser{} + err = c.client.Patch(pt). + Resource("appusers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/appversion.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/appversion.go new file mode 100644 index 000000000..4bb872f5a --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/appversion.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AppVersionsGetter has a method to return a AppVersionInterface. +// A group's client should implement this interface. +type AppVersionsGetter interface { + AppVersions() AppVersionInterface +} + +// AppVersionInterface has methods to work with AppVersion resources. +type AppVersionInterface interface { + Create(ctx context.Context, appVersion *v1.AppVersion, opts metav1.CreateOptions) (*v1.AppVersion, error) + Update(ctx context.Context, appVersion *v1.AppVersion, opts metav1.UpdateOptions) (*v1.AppVersion, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AppVersion, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AppVersionList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AppVersion, err error) + AppVersionExpansion +} + +// appVersions implements AppVersionInterface +type appVersions struct { + client rest.Interface +} + +// newAppVersions returns a AppVersions +func newAppVersions(c *GlobalTsmV1Client) *appVersions { + return &appVersions{ + client: c.RESTClient(), + } +} + +// Get takes name of the appVersion, and returns the corresponding appVersion object, and an error if there is any. +func (c *appVersions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AppVersion, err error) { + result = &v1.AppVersion{} + err = c.client.Get(). + Resource("appversions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AppVersions that match those selectors. +func (c *appVersions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AppVersionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AppVersionList{} + err = c.client.Get(). + Resource("appversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested appVersions. +func (c *appVersions) Watch(ctx context.Context, opts metav1.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(). + Resource("appversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a appVersion and creates it. Returns the server's representation of the appVersion, and an error, if there is any. +func (c *appVersions) Create(ctx context.Context, appVersion *v1.AppVersion, opts metav1.CreateOptions) (result *v1.AppVersion, err error) { + result = &v1.AppVersion{} + err = c.client.Post(). + Resource("appversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(appVersion). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a appVersion and updates it. Returns the server's representation of the appVersion, and an error, if there is any. +func (c *appVersions) Update(ctx context.Context, appVersion *v1.AppVersion, opts metav1.UpdateOptions) (result *v1.AppVersion, err error) { + result = &v1.AppVersion{} + err = c.client.Put(). + Resource("appversions"). + Name(appVersion.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(appVersion). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the appVersion and deletes it. Returns an error if one occurs. +func (c *appVersions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("appversions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *appVersions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("appversions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched appVersion. +func (c *appVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AppVersion, err error) { + result = &v1.AppVersion{} + err = c.client.Patch(pt). + Resource("appversions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/attackdiscovery.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/attackdiscovery.go new file mode 100644 index 000000000..f6806a7f2 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/attackdiscovery.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AttackDiscoveriesGetter has a method to return a AttackDiscoveryInterface. +// A group's client should implement this interface. +type AttackDiscoveriesGetter interface { + AttackDiscoveries() AttackDiscoveryInterface +} + +// AttackDiscoveryInterface has methods to work with AttackDiscovery resources. +type AttackDiscoveryInterface interface { + Create(ctx context.Context, attackDiscovery *v1.AttackDiscovery, opts metav1.CreateOptions) (*v1.AttackDiscovery, error) + Update(ctx context.Context, attackDiscovery *v1.AttackDiscovery, opts metav1.UpdateOptions) (*v1.AttackDiscovery, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AttackDiscovery, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AttackDiscoveryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AttackDiscovery, err error) + AttackDiscoveryExpansion +} + +// attackDiscoveries implements AttackDiscoveryInterface +type attackDiscoveries struct { + client rest.Interface +} + +// newAttackDiscoveries returns a AttackDiscoveries +func newAttackDiscoveries(c *GlobalTsmV1Client) *attackDiscoveries { + return &attackDiscoveries{ + client: c.RESTClient(), + } +} + +// Get takes name of the attackDiscovery, and returns the corresponding attackDiscovery object, and an error if there is any. +func (c *attackDiscoveries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AttackDiscovery, err error) { + result = &v1.AttackDiscovery{} + err = c.client.Get(). + Resource("attackdiscoveries"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AttackDiscoveries that match those selectors. +func (c *attackDiscoveries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AttackDiscoveryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AttackDiscoveryList{} + err = c.client.Get(). + Resource("attackdiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested attackDiscoveries. +func (c *attackDiscoveries) Watch(ctx context.Context, opts metav1.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(). + Resource("attackdiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a attackDiscovery and creates it. Returns the server's representation of the attackDiscovery, and an error, if there is any. +func (c *attackDiscoveries) Create(ctx context.Context, attackDiscovery *v1.AttackDiscovery, opts metav1.CreateOptions) (result *v1.AttackDiscovery, err error) { + result = &v1.AttackDiscovery{} + err = c.client.Post(). + Resource("attackdiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(attackDiscovery). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a attackDiscovery and updates it. Returns the server's representation of the attackDiscovery, and an error, if there is any. +func (c *attackDiscoveries) Update(ctx context.Context, attackDiscovery *v1.AttackDiscovery, opts metav1.UpdateOptions) (result *v1.AttackDiscovery, err error) { + result = &v1.AttackDiscovery{} + err = c.client.Put(). + Resource("attackdiscoveries"). + Name(attackDiscovery.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(attackDiscovery). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the attackDiscovery and deletes it. Returns an error if one occurs. +func (c *attackDiscoveries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("attackdiscoveries"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *attackDiscoveries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("attackdiscoveries"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched attackDiscovery. +func (c *attackDiscoveries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AttackDiscovery, err error) { + result = &v1.AttackDiscovery{} + err = c.client.Patch(pt). + Resource("attackdiscoveries"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/attackdiscoveryrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/attackdiscoveryrt.go new file mode 100644 index 000000000..83471ad1d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/attackdiscoveryrt.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AttackDiscoveryRTsGetter has a method to return a AttackDiscoveryRTInterface. +// A group's client should implement this interface. +type AttackDiscoveryRTsGetter interface { + AttackDiscoveryRTs() AttackDiscoveryRTInterface +} + +// AttackDiscoveryRTInterface has methods to work with AttackDiscoveryRT resources. +type AttackDiscoveryRTInterface interface { + Create(ctx context.Context, attackDiscoveryRT *v1.AttackDiscoveryRT, opts metav1.CreateOptions) (*v1.AttackDiscoveryRT, error) + Update(ctx context.Context, attackDiscoveryRT *v1.AttackDiscoveryRT, opts metav1.UpdateOptions) (*v1.AttackDiscoveryRT, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AttackDiscoveryRT, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AttackDiscoveryRTList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AttackDiscoveryRT, err error) + AttackDiscoveryRTExpansion +} + +// attackDiscoveryRTs implements AttackDiscoveryRTInterface +type attackDiscoveryRTs struct { + client rest.Interface +} + +// newAttackDiscoveryRTs returns a AttackDiscoveryRTs +func newAttackDiscoveryRTs(c *GlobalTsmV1Client) *attackDiscoveryRTs { + return &attackDiscoveryRTs{ + client: c.RESTClient(), + } +} + +// Get takes name of the attackDiscoveryRT, and returns the corresponding attackDiscoveryRT object, and an error if there is any. +func (c *attackDiscoveryRTs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AttackDiscoveryRT, err error) { + result = &v1.AttackDiscoveryRT{} + err = c.client.Get(). + Resource("attackdiscoveryrts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AttackDiscoveryRTs that match those selectors. +func (c *attackDiscoveryRTs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AttackDiscoveryRTList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AttackDiscoveryRTList{} + err = c.client.Get(). + Resource("attackdiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested attackDiscoveryRTs. +func (c *attackDiscoveryRTs) Watch(ctx context.Context, opts metav1.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(). + Resource("attackdiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a attackDiscoveryRT and creates it. Returns the server's representation of the attackDiscoveryRT, and an error, if there is any. +func (c *attackDiscoveryRTs) Create(ctx context.Context, attackDiscoveryRT *v1.AttackDiscoveryRT, opts metav1.CreateOptions) (result *v1.AttackDiscoveryRT, err error) { + result = &v1.AttackDiscoveryRT{} + err = c.client.Post(). + Resource("attackdiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(attackDiscoveryRT). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a attackDiscoveryRT and updates it. Returns the server's representation of the attackDiscoveryRT, and an error, if there is any. +func (c *attackDiscoveryRTs) Update(ctx context.Context, attackDiscoveryRT *v1.AttackDiscoveryRT, opts metav1.UpdateOptions) (result *v1.AttackDiscoveryRT, err error) { + result = &v1.AttackDiscoveryRT{} + err = c.client.Put(). + Resource("attackdiscoveryrts"). + Name(attackDiscoveryRT.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(attackDiscoveryRT). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the attackDiscoveryRT and deletes it. Returns an error if one occurs. +func (c *attackDiscoveryRTs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("attackdiscoveryrts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *attackDiscoveryRTs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("attackdiscoveryrts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched attackDiscoveryRT. +func (c *attackDiscoveryRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AttackDiscoveryRT, err error) { + result = &v1.AttackDiscoveryRT{} + err = c.client.Patch(pt). + Resource("attackdiscoveryrts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/authenticationpolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/authenticationpolicy.go new file mode 100644 index 000000000..bb24b82cf --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/authenticationpolicy.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AuthenticationPoliciesGetter has a method to return a AuthenticationPolicyInterface. +// A group's client should implement this interface. +type AuthenticationPoliciesGetter interface { + AuthenticationPolicies() AuthenticationPolicyInterface +} + +// AuthenticationPolicyInterface has methods to work with AuthenticationPolicy resources. +type AuthenticationPolicyInterface interface { + Create(ctx context.Context, authenticationPolicy *v1.AuthenticationPolicy, opts metav1.CreateOptions) (*v1.AuthenticationPolicy, error) + Update(ctx context.Context, authenticationPolicy *v1.AuthenticationPolicy, opts metav1.UpdateOptions) (*v1.AuthenticationPolicy, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AuthenticationPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AuthenticationPolicyList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AuthenticationPolicy, err error) + AuthenticationPolicyExpansion +} + +// authenticationPolicies implements AuthenticationPolicyInterface +type authenticationPolicies struct { + client rest.Interface +} + +// newAuthenticationPolicies returns a AuthenticationPolicies +func newAuthenticationPolicies(c *GlobalTsmV1Client) *authenticationPolicies { + return &authenticationPolicies{ + client: c.RESTClient(), + } +} + +// Get takes name of the authenticationPolicy, and returns the corresponding authenticationPolicy object, and an error if there is any. +func (c *authenticationPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AuthenticationPolicy, err error) { + result = &v1.AuthenticationPolicy{} + err = c.client.Get(). + Resource("authenticationpolicies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AuthenticationPolicies that match those selectors. +func (c *authenticationPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AuthenticationPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AuthenticationPolicyList{} + err = c.client.Get(). + Resource("authenticationpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested authenticationPolicies. +func (c *authenticationPolicies) Watch(ctx context.Context, opts metav1.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(). + Resource("authenticationpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a authenticationPolicy and creates it. Returns the server's representation of the authenticationPolicy, and an error, if there is any. +func (c *authenticationPolicies) Create(ctx context.Context, authenticationPolicy *v1.AuthenticationPolicy, opts metav1.CreateOptions) (result *v1.AuthenticationPolicy, err error) { + result = &v1.AuthenticationPolicy{} + err = c.client.Post(). + Resource("authenticationpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(authenticationPolicy). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a authenticationPolicy and updates it. Returns the server's representation of the authenticationPolicy, and an error, if there is any. +func (c *authenticationPolicies) Update(ctx context.Context, authenticationPolicy *v1.AuthenticationPolicy, opts metav1.UpdateOptions) (result *v1.AuthenticationPolicy, err error) { + result = &v1.AuthenticationPolicy{} + err = c.client.Put(). + Resource("authenticationpolicies"). + Name(authenticationPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(authenticationPolicy). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the authenticationPolicy and deletes it. Returns an error if one occurs. +func (c *authenticationPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("authenticationpolicies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *authenticationPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("authenticationpolicies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched authenticationPolicy. +func (c *authenticationPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AuthenticationPolicy, err error) { + result = &v1.AuthenticationPolicy{} + err = c.client.Patch(pt). + Resource("authenticationpolicies"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/autoscaler.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/autoscaler.go new file mode 100644 index 000000000..26c0b0b39 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/autoscaler.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AutoscalersGetter has a method to return a AutoscalerInterface. +// A group's client should implement this interface. +type AutoscalersGetter interface { + Autoscalers() AutoscalerInterface +} + +// AutoscalerInterface has methods to work with Autoscaler resources. +type AutoscalerInterface interface { + Create(ctx context.Context, autoscaler *v1.Autoscaler, opts metav1.CreateOptions) (*v1.Autoscaler, error) + Update(ctx context.Context, autoscaler *v1.Autoscaler, opts metav1.UpdateOptions) (*v1.Autoscaler, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Autoscaler, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AutoscalerList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Autoscaler, err error) + AutoscalerExpansion +} + +// autoscalers implements AutoscalerInterface +type autoscalers struct { + client rest.Interface +} + +// newAutoscalers returns a Autoscalers +func newAutoscalers(c *GlobalTsmV1Client) *autoscalers { + return &autoscalers{ + client: c.RESTClient(), + } +} + +// Get takes name of the autoscaler, and returns the corresponding autoscaler object, and an error if there is any. +func (c *autoscalers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Autoscaler, err error) { + result = &v1.Autoscaler{} + err = c.client.Get(). + Resource("autoscalers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Autoscalers that match those selectors. +func (c *autoscalers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AutoscalerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AutoscalerList{} + err = c.client.Get(). + Resource("autoscalers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested autoscalers. +func (c *autoscalers) Watch(ctx context.Context, opts metav1.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(). + Resource("autoscalers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a autoscaler and creates it. Returns the server's representation of the autoscaler, and an error, if there is any. +func (c *autoscalers) Create(ctx context.Context, autoscaler *v1.Autoscaler, opts metav1.CreateOptions) (result *v1.Autoscaler, err error) { + result = &v1.Autoscaler{} + err = c.client.Post(). + Resource("autoscalers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(autoscaler). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a autoscaler and updates it. Returns the server's representation of the autoscaler, and an error, if there is any. +func (c *autoscalers) Update(ctx context.Context, autoscaler *v1.Autoscaler, opts metav1.UpdateOptions) (result *v1.Autoscaler, err error) { + result = &v1.Autoscaler{} + err = c.client.Put(). + Resource("autoscalers"). + Name(autoscaler.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(autoscaler). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the autoscaler and deletes it. Returns an error if one occurs. +func (c *autoscalers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("autoscalers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *autoscalers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("autoscalers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched autoscaler. +func (c *autoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Autoscaler, err error) { + result = &v1.Autoscaler{} + err = c.client.Patch(pt). + Resource("autoscalers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/autoscalerconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/autoscalerconfig.go new file mode 100644 index 000000000..cab630826 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/autoscalerconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AutoscalerConfigsGetter has a method to return a AutoscalerConfigInterface. +// A group's client should implement this interface. +type AutoscalerConfigsGetter interface { + AutoscalerConfigs() AutoscalerConfigInterface +} + +// AutoscalerConfigInterface has methods to work with AutoscalerConfig resources. +type AutoscalerConfigInterface interface { + Create(ctx context.Context, autoscalerConfig *v1.AutoscalerConfig, opts metav1.CreateOptions) (*v1.AutoscalerConfig, error) + Update(ctx context.Context, autoscalerConfig *v1.AutoscalerConfig, opts metav1.UpdateOptions) (*v1.AutoscalerConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AutoscalerConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AutoscalerConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AutoscalerConfig, err error) + AutoscalerConfigExpansion +} + +// autoscalerConfigs implements AutoscalerConfigInterface +type autoscalerConfigs struct { + client rest.Interface +} + +// newAutoscalerConfigs returns a AutoscalerConfigs +func newAutoscalerConfigs(c *GlobalTsmV1Client) *autoscalerConfigs { + return &autoscalerConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the autoscalerConfig, and returns the corresponding autoscalerConfig object, and an error if there is any. +func (c *autoscalerConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AutoscalerConfig, err error) { + result = &v1.AutoscalerConfig{} + err = c.client.Get(). + Resource("autoscalerconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AutoscalerConfigs that match those selectors. +func (c *autoscalerConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AutoscalerConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AutoscalerConfigList{} + err = c.client.Get(). + Resource("autoscalerconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested autoscalerConfigs. +func (c *autoscalerConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("autoscalerconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a autoscalerConfig and creates it. Returns the server's representation of the autoscalerConfig, and an error, if there is any. +func (c *autoscalerConfigs) Create(ctx context.Context, autoscalerConfig *v1.AutoscalerConfig, opts metav1.CreateOptions) (result *v1.AutoscalerConfig, err error) { + result = &v1.AutoscalerConfig{} + err = c.client.Post(). + Resource("autoscalerconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(autoscalerConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a autoscalerConfig and updates it. Returns the server's representation of the autoscalerConfig, and an error, if there is any. +func (c *autoscalerConfigs) Update(ctx context.Context, autoscalerConfig *v1.AutoscalerConfig, opts metav1.UpdateOptions) (result *v1.AutoscalerConfig, err error) { + result = &v1.AutoscalerConfig{} + err = c.client.Put(). + Resource("autoscalerconfigs"). + Name(autoscalerConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(autoscalerConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the autoscalerConfig and deletes it. Returns an error if one occurs. +func (c *autoscalerConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("autoscalerconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *autoscalerConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("autoscalerconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched autoscalerConfig. +func (c *autoscalerConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AutoscalerConfig, err error) { + result = &v1.AutoscalerConfig{} + err = c.client.Patch(pt). + Resource("autoscalerconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/autoscalercr.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/autoscalercr.go new file mode 100644 index 000000000..6d1bd6610 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/autoscalercr.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AutoscalerCRsGetter has a method to return a AutoscalerCRInterface. +// A group's client should implement this interface. +type AutoscalerCRsGetter interface { + AutoscalerCRs() AutoscalerCRInterface +} + +// AutoscalerCRInterface has methods to work with AutoscalerCR resources. +type AutoscalerCRInterface interface { + Create(ctx context.Context, autoscalerCR *v1.AutoscalerCR, opts metav1.CreateOptions) (*v1.AutoscalerCR, error) + Update(ctx context.Context, autoscalerCR *v1.AutoscalerCR, opts metav1.UpdateOptions) (*v1.AutoscalerCR, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AutoscalerCR, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AutoscalerCRList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AutoscalerCR, err error) + AutoscalerCRExpansion +} + +// autoscalerCRs implements AutoscalerCRInterface +type autoscalerCRs struct { + client rest.Interface +} + +// newAutoscalerCRs returns a AutoscalerCRs +func newAutoscalerCRs(c *GlobalTsmV1Client) *autoscalerCRs { + return &autoscalerCRs{ + client: c.RESTClient(), + } +} + +// Get takes name of the autoscalerCR, and returns the corresponding autoscalerCR object, and an error if there is any. +func (c *autoscalerCRs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AutoscalerCR, err error) { + result = &v1.AutoscalerCR{} + err = c.client.Get(). + Resource("autoscalercrs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AutoscalerCRs that match those selectors. +func (c *autoscalerCRs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AutoscalerCRList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AutoscalerCRList{} + err = c.client.Get(). + Resource("autoscalercrs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested autoscalerCRs. +func (c *autoscalerCRs) Watch(ctx context.Context, opts metav1.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(). + Resource("autoscalercrs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a autoscalerCR and creates it. Returns the server's representation of the autoscalerCR, and an error, if there is any. +func (c *autoscalerCRs) Create(ctx context.Context, autoscalerCR *v1.AutoscalerCR, opts metav1.CreateOptions) (result *v1.AutoscalerCR, err error) { + result = &v1.AutoscalerCR{} + err = c.client.Post(). + Resource("autoscalercrs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(autoscalerCR). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a autoscalerCR and updates it. Returns the server's representation of the autoscalerCR, and an error, if there is any. +func (c *autoscalerCRs) Update(ctx context.Context, autoscalerCR *v1.AutoscalerCR, opts metav1.UpdateOptions) (result *v1.AutoscalerCR, err error) { + result = &v1.AutoscalerCR{} + err = c.client.Put(). + Resource("autoscalercrs"). + Name(autoscalerCR.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(autoscalerCR). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the autoscalerCR and deletes it. Returns an error if one occurs. +func (c *autoscalerCRs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("autoscalercrs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *autoscalerCRs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("autoscalercrs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched autoscalerCR. +func (c *autoscalerCRs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AutoscalerCR, err error) { + result = &v1.AutoscalerCR{} + err = c.client.Patch(pt). + Resource("autoscalercrs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/autoscalerfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/autoscalerfolder.go new file mode 100644 index 000000000..06ca8323c --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/autoscalerfolder.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AutoscalerFoldersGetter has a method to return a AutoscalerFolderInterface. +// A group's client should implement this interface. +type AutoscalerFoldersGetter interface { + AutoscalerFolders() AutoscalerFolderInterface +} + +// AutoscalerFolderInterface has methods to work with AutoscalerFolder resources. +type AutoscalerFolderInterface interface { + Create(ctx context.Context, autoscalerFolder *v1.AutoscalerFolder, opts metav1.CreateOptions) (*v1.AutoscalerFolder, error) + Update(ctx context.Context, autoscalerFolder *v1.AutoscalerFolder, opts metav1.UpdateOptions) (*v1.AutoscalerFolder, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AutoscalerFolder, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AutoscalerFolderList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AutoscalerFolder, err error) + AutoscalerFolderExpansion +} + +// autoscalerFolders implements AutoscalerFolderInterface +type autoscalerFolders struct { + client rest.Interface +} + +// newAutoscalerFolders returns a AutoscalerFolders +func newAutoscalerFolders(c *GlobalTsmV1Client) *autoscalerFolders { + return &autoscalerFolders{ + client: c.RESTClient(), + } +} + +// Get takes name of the autoscalerFolder, and returns the corresponding autoscalerFolder object, and an error if there is any. +func (c *autoscalerFolders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AutoscalerFolder, err error) { + result = &v1.AutoscalerFolder{} + err = c.client.Get(). + Resource("autoscalerfolders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AutoscalerFolders that match those selectors. +func (c *autoscalerFolders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AutoscalerFolderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AutoscalerFolderList{} + err = c.client.Get(). + Resource("autoscalerfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested autoscalerFolders. +func (c *autoscalerFolders) Watch(ctx context.Context, opts metav1.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(). + Resource("autoscalerfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a autoscalerFolder and creates it. Returns the server's representation of the autoscalerFolder, and an error, if there is any. +func (c *autoscalerFolders) Create(ctx context.Context, autoscalerFolder *v1.AutoscalerFolder, opts metav1.CreateOptions) (result *v1.AutoscalerFolder, err error) { + result = &v1.AutoscalerFolder{} + err = c.client.Post(). + Resource("autoscalerfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(autoscalerFolder). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a autoscalerFolder and updates it. Returns the server's representation of the autoscalerFolder, and an error, if there is any. +func (c *autoscalerFolders) Update(ctx context.Context, autoscalerFolder *v1.AutoscalerFolder, opts metav1.UpdateOptions) (result *v1.AutoscalerFolder, err error) { + result = &v1.AutoscalerFolder{} + err = c.client.Put(). + Resource("autoscalerfolders"). + Name(autoscalerFolder.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(autoscalerFolder). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the autoscalerFolder and deletes it. Returns an error if one occurs. +func (c *autoscalerFolders) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("autoscalerfolders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *autoscalerFolders) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("autoscalerfolders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched autoscalerFolder. +func (c *autoscalerFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AutoscalerFolder, err error) { + result = &v1.AutoscalerFolder{} + err = c.client.Patch(pt). + Resource("autoscalerfolders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/autoscalingpolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/autoscalingpolicy.go new file mode 100644 index 000000000..82df42b87 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/autoscalingpolicy.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AutoscalingPoliciesGetter has a method to return a AutoscalingPolicyInterface. +// A group's client should implement this interface. +type AutoscalingPoliciesGetter interface { + AutoscalingPolicies() AutoscalingPolicyInterface +} + +// AutoscalingPolicyInterface has methods to work with AutoscalingPolicy resources. +type AutoscalingPolicyInterface interface { + Create(ctx context.Context, autoscalingPolicy *v1.AutoscalingPolicy, opts metav1.CreateOptions) (*v1.AutoscalingPolicy, error) + Update(ctx context.Context, autoscalingPolicy *v1.AutoscalingPolicy, opts metav1.UpdateOptions) (*v1.AutoscalingPolicy, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AutoscalingPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AutoscalingPolicyList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AutoscalingPolicy, err error) + AutoscalingPolicyExpansion +} + +// autoscalingPolicies implements AutoscalingPolicyInterface +type autoscalingPolicies struct { + client rest.Interface +} + +// newAutoscalingPolicies returns a AutoscalingPolicies +func newAutoscalingPolicies(c *GlobalTsmV1Client) *autoscalingPolicies { + return &autoscalingPolicies{ + client: c.RESTClient(), + } +} + +// Get takes name of the autoscalingPolicy, and returns the corresponding autoscalingPolicy object, and an error if there is any. +func (c *autoscalingPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AutoscalingPolicy, err error) { + result = &v1.AutoscalingPolicy{} + err = c.client.Get(). + Resource("autoscalingpolicies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AutoscalingPolicies that match those selectors. +func (c *autoscalingPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AutoscalingPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AutoscalingPolicyList{} + err = c.client.Get(). + Resource("autoscalingpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested autoscalingPolicies. +func (c *autoscalingPolicies) Watch(ctx context.Context, opts metav1.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(). + Resource("autoscalingpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a autoscalingPolicy and creates it. Returns the server's representation of the autoscalingPolicy, and an error, if there is any. +func (c *autoscalingPolicies) Create(ctx context.Context, autoscalingPolicy *v1.AutoscalingPolicy, opts metav1.CreateOptions) (result *v1.AutoscalingPolicy, err error) { + result = &v1.AutoscalingPolicy{} + err = c.client.Post(). + Resource("autoscalingpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(autoscalingPolicy). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a autoscalingPolicy and updates it. Returns the server's representation of the autoscalingPolicy, and an error, if there is any. +func (c *autoscalingPolicies) Update(ctx context.Context, autoscalingPolicy *v1.AutoscalingPolicy, opts metav1.UpdateOptions) (result *v1.AutoscalingPolicy, err error) { + result = &v1.AutoscalingPolicy{} + err = c.client.Put(). + Resource("autoscalingpolicies"). + Name(autoscalingPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(autoscalingPolicy). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the autoscalingPolicy and deletes it. Returns an error if one occurs. +func (c *autoscalingPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("autoscalingpolicies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *autoscalingPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("autoscalingpolicies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched autoscalingPolicy. +func (c *autoscalingPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AutoscalingPolicy, err error) { + result = &v1.AutoscalingPolicy{} + err = c.client.Patch(pt). + Resource("autoscalingpolicies"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/awsconnector.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/awsconnector.go new file mode 100644 index 000000000..fb8b89ae3 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/awsconnector.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// AwsConnectorsGetter has a method to return a AwsConnectorInterface. +// A group's client should implement this interface. +type AwsConnectorsGetter interface { + AwsConnectors() AwsConnectorInterface +} + +// AwsConnectorInterface has methods to work with AwsConnector resources. +type AwsConnectorInterface interface { + Create(ctx context.Context, awsConnector *v1.AwsConnector, opts metav1.CreateOptions) (*v1.AwsConnector, error) + Update(ctx context.Context, awsConnector *v1.AwsConnector, opts metav1.UpdateOptions) (*v1.AwsConnector, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AwsConnector, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AwsConnectorList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AwsConnector, err error) + AwsConnectorExpansion +} + +// awsConnectors implements AwsConnectorInterface +type awsConnectors struct { + client rest.Interface +} + +// newAwsConnectors returns a AwsConnectors +func newAwsConnectors(c *GlobalTsmV1Client) *awsConnectors { + return &awsConnectors{ + client: c.RESTClient(), + } +} + +// Get takes name of the awsConnector, and returns the corresponding awsConnector object, and an error if there is any. +func (c *awsConnectors) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AwsConnector, err error) { + result = &v1.AwsConnector{} + err = c.client.Get(). + Resource("awsconnectors"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AwsConnectors that match those selectors. +func (c *awsConnectors) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AwsConnectorList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AwsConnectorList{} + err = c.client.Get(). + Resource("awsconnectors"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested awsConnectors. +func (c *awsConnectors) Watch(ctx context.Context, opts metav1.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(). + Resource("awsconnectors"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a awsConnector and creates it. Returns the server's representation of the awsConnector, and an error, if there is any. +func (c *awsConnectors) Create(ctx context.Context, awsConnector *v1.AwsConnector, opts metav1.CreateOptions) (result *v1.AwsConnector, err error) { + result = &v1.AwsConnector{} + err = c.client.Post(). + Resource("awsconnectors"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(awsConnector). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a awsConnector and updates it. Returns the server's representation of the awsConnector, and an error, if there is any. +func (c *awsConnectors) Update(ctx context.Context, awsConnector *v1.AwsConnector, opts metav1.UpdateOptions) (result *v1.AwsConnector, err error) { + result = &v1.AwsConnector{} + err = c.client.Put(). + Resource("awsconnectors"). + Name(awsConnector.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(awsConnector). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the awsConnector and deletes it. Returns an error if one occurs. +func (c *awsConnectors) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("awsconnectors"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *awsConnectors) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("awsconnectors"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched awsConnector. +func (c *awsConnectors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AwsConnector, err error) { + result = &v1.AwsConnector{} + err = c.client.Patch(pt). + Resource("awsconnectors"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/bucket.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/bucket.go new file mode 100644 index 000000000..bb6bb23fb --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/bucket.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// BucketsGetter has a method to return a BucketInterface. +// A group's client should implement this interface. +type BucketsGetter interface { + Buckets() BucketInterface +} + +// BucketInterface has methods to work with Bucket resources. +type BucketInterface interface { + Create(ctx context.Context, bucket *v1.Bucket, opts metav1.CreateOptions) (*v1.Bucket, error) + Update(ctx context.Context, bucket *v1.Bucket, opts metav1.UpdateOptions) (*v1.Bucket, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Bucket, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.BucketList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Bucket, err error) + BucketExpansion +} + +// buckets implements BucketInterface +type buckets struct { + client rest.Interface +} + +// newBuckets returns a Buckets +func newBuckets(c *GlobalTsmV1Client) *buckets { + return &buckets{ + client: c.RESTClient(), + } +} + +// Get takes name of the bucket, and returns the corresponding bucket object, and an error if there is any. +func (c *buckets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Bucket, err error) { + result = &v1.Bucket{} + err = c.client.Get(). + Resource("buckets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Buckets that match those selectors. +func (c *buckets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.BucketList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.BucketList{} + err = c.client.Get(). + Resource("buckets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested buckets. +func (c *buckets) Watch(ctx context.Context, opts metav1.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(). + Resource("buckets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a bucket and creates it. Returns the server's representation of the bucket, and an error, if there is any. +func (c *buckets) Create(ctx context.Context, bucket *v1.Bucket, opts metav1.CreateOptions) (result *v1.Bucket, err error) { + result = &v1.Bucket{} + err = c.client.Post(). + Resource("buckets"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(bucket). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a bucket and updates it. Returns the server's representation of the bucket, and an error, if there is any. +func (c *buckets) Update(ctx context.Context, bucket *v1.Bucket, opts metav1.UpdateOptions) (result *v1.Bucket, err error) { + result = &v1.Bucket{} + err = c.client.Put(). + Resource("buckets"). + Name(bucket.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(bucket). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the bucket and deletes it. Returns an error if one occurs. +func (c *buckets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("buckets"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *buckets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("buckets"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched bucket. +func (c *buckets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Bucket, err error) { + result = &v1.Bucket{} + err = c.client.Patch(pt). + Resource("buckets"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/certificate.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/certificate.go new file mode 100644 index 000000000..91ae6bb86 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/certificate.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// CertificatesGetter has a method to return a CertificateInterface. +// A group's client should implement this interface. +type CertificatesGetter interface { + Certificates() CertificateInterface +} + +// CertificateInterface has methods to work with Certificate resources. +type CertificateInterface interface { + Create(ctx context.Context, certificate *v1.Certificate, opts metav1.CreateOptions) (*v1.Certificate, error) + Update(ctx context.Context, certificate *v1.Certificate, opts metav1.UpdateOptions) (*v1.Certificate, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Certificate, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.CertificateList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Certificate, err error) + CertificateExpansion +} + +// certificates implements CertificateInterface +type certificates struct { + client rest.Interface +} + +// newCertificates returns a Certificates +func newCertificates(c *GlobalTsmV1Client) *certificates { + return &certificates{ + client: c.RESTClient(), + } +} + +// Get takes name of the certificate, and returns the corresponding certificate object, and an error if there is any. +func (c *certificates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Certificate, err error) { + result = &v1.Certificate{} + err = c.client.Get(). + Resource("certificates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Certificates that match those selectors. +func (c *certificates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.CertificateList{} + err = c.client.Get(). + Resource("certificates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested certificates. +func (c *certificates) Watch(ctx context.Context, opts metav1.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(). + Resource("certificates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a certificate and creates it. Returns the server's representation of the certificate, and an error, if there is any. +func (c *certificates) Create(ctx context.Context, certificate *v1.Certificate, opts metav1.CreateOptions) (result *v1.Certificate, err error) { + result = &v1.Certificate{} + err = c.client.Post(). + Resource("certificates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(certificate). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a certificate and updates it. Returns the server's representation of the certificate, and an error, if there is any. +func (c *certificates) Update(ctx context.Context, certificate *v1.Certificate, opts metav1.UpdateOptions) (result *v1.Certificate, err error) { + result = &v1.Certificate{} + err = c.client.Put(). + Resource("certificates"). + Name(certificate.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(certificate). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the certificate and deletes it. Returns an error if one occurs. +func (c *certificates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("certificates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *certificates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("certificates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched certificate. +func (c *certificates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Certificate, err error) { + result = &v1.Certificate{} + err = c.client.Patch(pt). + Resource("certificates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/certificateauthorityconfign.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/certificateauthorityconfign.go new file mode 100644 index 000000000..c0dc52c22 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/certificateauthorityconfign.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// CertificateAuthorityConfigNsGetter has a method to return a CertificateAuthorityConfigNInterface. +// A group's client should implement this interface. +type CertificateAuthorityConfigNsGetter interface { + CertificateAuthorityConfigNs() CertificateAuthorityConfigNInterface +} + +// CertificateAuthorityConfigNInterface has methods to work with CertificateAuthorityConfigN resources. +type CertificateAuthorityConfigNInterface interface { + Create(ctx context.Context, certificateAuthorityConfigN *v1.CertificateAuthorityConfigN, opts metav1.CreateOptions) (*v1.CertificateAuthorityConfigN, error) + Update(ctx context.Context, certificateAuthorityConfigN *v1.CertificateAuthorityConfigN, opts metav1.UpdateOptions) (*v1.CertificateAuthorityConfigN, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CertificateAuthorityConfigN, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.CertificateAuthorityConfigNList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CertificateAuthorityConfigN, err error) + CertificateAuthorityConfigNExpansion +} + +// certificateAuthorityConfigNs implements CertificateAuthorityConfigNInterface +type certificateAuthorityConfigNs struct { + client rest.Interface +} + +// newCertificateAuthorityConfigNs returns a CertificateAuthorityConfigNs +func newCertificateAuthorityConfigNs(c *GlobalTsmV1Client) *certificateAuthorityConfigNs { + return &certificateAuthorityConfigNs{ + client: c.RESTClient(), + } +} + +// Get takes name of the certificateAuthorityConfigN, and returns the corresponding certificateAuthorityConfigN object, and an error if there is any. +func (c *certificateAuthorityConfigNs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CertificateAuthorityConfigN, err error) { + result = &v1.CertificateAuthorityConfigN{} + err = c.client.Get(). + Resource("certificateauthorityconfigns"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of CertificateAuthorityConfigNs that match those selectors. +func (c *certificateAuthorityConfigNs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateAuthorityConfigNList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.CertificateAuthorityConfigNList{} + err = c.client.Get(). + Resource("certificateauthorityconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested certificateAuthorityConfigNs. +func (c *certificateAuthorityConfigNs) Watch(ctx context.Context, opts metav1.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(). + Resource("certificateauthorityconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a certificateAuthorityConfigN and creates it. Returns the server's representation of the certificateAuthorityConfigN, and an error, if there is any. +func (c *certificateAuthorityConfigNs) Create(ctx context.Context, certificateAuthorityConfigN *v1.CertificateAuthorityConfigN, opts metav1.CreateOptions) (result *v1.CertificateAuthorityConfigN, err error) { + result = &v1.CertificateAuthorityConfigN{} + err = c.client.Post(). + Resource("certificateauthorityconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(certificateAuthorityConfigN). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a certificateAuthorityConfigN and updates it. Returns the server's representation of the certificateAuthorityConfigN, and an error, if there is any. +func (c *certificateAuthorityConfigNs) Update(ctx context.Context, certificateAuthorityConfigN *v1.CertificateAuthorityConfigN, opts metav1.UpdateOptions) (result *v1.CertificateAuthorityConfigN, err error) { + result = &v1.CertificateAuthorityConfigN{} + err = c.client.Put(). + Resource("certificateauthorityconfigns"). + Name(certificateAuthorityConfigN.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(certificateAuthorityConfigN). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the certificateAuthorityConfigN and deletes it. Returns an error if one occurs. +func (c *certificateAuthorityConfigNs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("certificateauthorityconfigns"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *certificateAuthorityConfigNs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("certificateauthorityconfigns"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched certificateAuthorityConfigN. +func (c *certificateAuthorityConfigNs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CertificateAuthorityConfigN, err error) { + result = &v1.CertificateAuthorityConfigN{} + err = c.client.Patch(pt). + Resource("certificateauthorityconfigns"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/certificateauthorityrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/certificateauthorityrt.go new file mode 100644 index 000000000..2b5d0ca2d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/certificateauthorityrt.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// CertificateAuthorityRTsGetter has a method to return a CertificateAuthorityRTInterface. +// A group's client should implement this interface. +type CertificateAuthorityRTsGetter interface { + CertificateAuthorityRTs() CertificateAuthorityRTInterface +} + +// CertificateAuthorityRTInterface has methods to work with CertificateAuthorityRT resources. +type CertificateAuthorityRTInterface interface { + Create(ctx context.Context, certificateAuthorityRT *v1.CertificateAuthorityRT, opts metav1.CreateOptions) (*v1.CertificateAuthorityRT, error) + Update(ctx context.Context, certificateAuthorityRT *v1.CertificateAuthorityRT, opts metav1.UpdateOptions) (*v1.CertificateAuthorityRT, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CertificateAuthorityRT, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.CertificateAuthorityRTList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CertificateAuthorityRT, err error) + CertificateAuthorityRTExpansion +} + +// certificateAuthorityRTs implements CertificateAuthorityRTInterface +type certificateAuthorityRTs struct { + client rest.Interface +} + +// newCertificateAuthorityRTs returns a CertificateAuthorityRTs +func newCertificateAuthorityRTs(c *GlobalTsmV1Client) *certificateAuthorityRTs { + return &certificateAuthorityRTs{ + client: c.RESTClient(), + } +} + +// Get takes name of the certificateAuthorityRT, and returns the corresponding certificateAuthorityRT object, and an error if there is any. +func (c *certificateAuthorityRTs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CertificateAuthorityRT, err error) { + result = &v1.CertificateAuthorityRT{} + err = c.client.Get(). + Resource("certificateauthorityrts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of CertificateAuthorityRTs that match those selectors. +func (c *certificateAuthorityRTs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateAuthorityRTList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.CertificateAuthorityRTList{} + err = c.client.Get(). + Resource("certificateauthorityrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested certificateAuthorityRTs. +func (c *certificateAuthorityRTs) Watch(ctx context.Context, opts metav1.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(). + Resource("certificateauthorityrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a certificateAuthorityRT and creates it. Returns the server's representation of the certificateAuthorityRT, and an error, if there is any. +func (c *certificateAuthorityRTs) Create(ctx context.Context, certificateAuthorityRT *v1.CertificateAuthorityRT, opts metav1.CreateOptions) (result *v1.CertificateAuthorityRT, err error) { + result = &v1.CertificateAuthorityRT{} + err = c.client.Post(). + Resource("certificateauthorityrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(certificateAuthorityRT). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a certificateAuthorityRT and updates it. Returns the server's representation of the certificateAuthorityRT, and an error, if there is any. +func (c *certificateAuthorityRTs) Update(ctx context.Context, certificateAuthorityRT *v1.CertificateAuthorityRT, opts metav1.UpdateOptions) (result *v1.CertificateAuthorityRT, err error) { + result = &v1.CertificateAuthorityRT{} + err = c.client.Put(). + Resource("certificateauthorityrts"). + Name(certificateAuthorityRT.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(certificateAuthorityRT). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the certificateAuthorityRT and deletes it. Returns an error if one occurs. +func (c *certificateAuthorityRTs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("certificateauthorityrts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *certificateAuthorityRTs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("certificateauthorityrts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched certificateAuthorityRT. +func (c *certificateAuthorityRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CertificateAuthorityRT, err error) { + result = &v1.CertificateAuthorityRT{} + err = c.client.Patch(pt). + Resource("certificateauthorityrts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/certificateconfign.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/certificateconfign.go new file mode 100644 index 000000000..b777bef53 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/certificateconfign.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// CertificateConfigNsGetter has a method to return a CertificateConfigNInterface. +// A group's client should implement this interface. +type CertificateConfigNsGetter interface { + CertificateConfigNs() CertificateConfigNInterface +} + +// CertificateConfigNInterface has methods to work with CertificateConfigN resources. +type CertificateConfigNInterface interface { + Create(ctx context.Context, certificateConfigN *v1.CertificateConfigN, opts metav1.CreateOptions) (*v1.CertificateConfigN, error) + Update(ctx context.Context, certificateConfigN *v1.CertificateConfigN, opts metav1.UpdateOptions) (*v1.CertificateConfigN, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CertificateConfigN, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.CertificateConfigNList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CertificateConfigN, err error) + CertificateConfigNExpansion +} + +// certificateConfigNs implements CertificateConfigNInterface +type certificateConfigNs struct { + client rest.Interface +} + +// newCertificateConfigNs returns a CertificateConfigNs +func newCertificateConfigNs(c *GlobalTsmV1Client) *certificateConfigNs { + return &certificateConfigNs{ + client: c.RESTClient(), + } +} + +// Get takes name of the certificateConfigN, and returns the corresponding certificateConfigN object, and an error if there is any. +func (c *certificateConfigNs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CertificateConfigN, err error) { + result = &v1.CertificateConfigN{} + err = c.client.Get(). + Resource("certificateconfigns"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of CertificateConfigNs that match those selectors. +func (c *certificateConfigNs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateConfigNList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.CertificateConfigNList{} + err = c.client.Get(). + Resource("certificateconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested certificateConfigNs. +func (c *certificateConfigNs) Watch(ctx context.Context, opts metav1.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(). + Resource("certificateconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a certificateConfigN and creates it. Returns the server's representation of the certificateConfigN, and an error, if there is any. +func (c *certificateConfigNs) Create(ctx context.Context, certificateConfigN *v1.CertificateConfigN, opts metav1.CreateOptions) (result *v1.CertificateConfigN, err error) { + result = &v1.CertificateConfigN{} + err = c.client.Post(). + Resource("certificateconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(certificateConfigN). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a certificateConfigN and updates it. Returns the server's representation of the certificateConfigN, and an error, if there is any. +func (c *certificateConfigNs) Update(ctx context.Context, certificateConfigN *v1.CertificateConfigN, opts metav1.UpdateOptions) (result *v1.CertificateConfigN, err error) { + result = &v1.CertificateConfigN{} + err = c.client.Put(). + Resource("certificateconfigns"). + Name(certificateConfigN.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(certificateConfigN). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the certificateConfigN and deletes it. Returns an error if one occurs. +func (c *certificateConfigNs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("certificateconfigns"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *certificateConfigNs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("certificateconfigns"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched certificateConfigN. +func (c *certificateConfigNs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CertificateConfigN, err error) { + result = &v1.CertificateConfigN{} + err = c.client.Patch(pt). + Resource("certificateconfigns"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/certificaterequest.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/certificaterequest.go new file mode 100644 index 000000000..d9349c8ab --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/certificaterequest.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// CertificateRequestsGetter has a method to return a CertificateRequestInterface. +// A group's client should implement this interface. +type CertificateRequestsGetter interface { + CertificateRequests() CertificateRequestInterface +} + +// CertificateRequestInterface has methods to work with CertificateRequest resources. +type CertificateRequestInterface interface { + Create(ctx context.Context, certificateRequest *v1.CertificateRequest, opts metav1.CreateOptions) (*v1.CertificateRequest, error) + Update(ctx context.Context, certificateRequest *v1.CertificateRequest, opts metav1.UpdateOptions) (*v1.CertificateRequest, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CertificateRequest, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.CertificateRequestList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CertificateRequest, err error) + CertificateRequestExpansion +} + +// certificateRequests implements CertificateRequestInterface +type certificateRequests struct { + client rest.Interface +} + +// newCertificateRequests returns a CertificateRequests +func newCertificateRequests(c *GlobalTsmV1Client) *certificateRequests { + return &certificateRequests{ + client: c.RESTClient(), + } +} + +// Get takes name of the certificateRequest, and returns the corresponding certificateRequest object, and an error if there is any. +func (c *certificateRequests) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CertificateRequest, err error) { + result = &v1.CertificateRequest{} + err = c.client.Get(). + Resource("certificaterequests"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of CertificateRequests that match those selectors. +func (c *certificateRequests) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateRequestList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.CertificateRequestList{} + err = c.client.Get(). + Resource("certificaterequests"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested certificateRequests. +func (c *certificateRequests) Watch(ctx context.Context, opts metav1.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(). + Resource("certificaterequests"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a certificateRequest and creates it. Returns the server's representation of the certificateRequest, and an error, if there is any. +func (c *certificateRequests) Create(ctx context.Context, certificateRequest *v1.CertificateRequest, opts metav1.CreateOptions) (result *v1.CertificateRequest, err error) { + result = &v1.CertificateRequest{} + err = c.client.Post(). + Resource("certificaterequests"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(certificateRequest). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a certificateRequest and updates it. Returns the server's representation of the certificateRequest, and an error, if there is any. +func (c *certificateRequests) Update(ctx context.Context, certificateRequest *v1.CertificateRequest, opts metav1.UpdateOptions) (result *v1.CertificateRequest, err error) { + result = &v1.CertificateRequest{} + err = c.client.Put(). + Resource("certificaterequests"). + Name(certificateRequest.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(certificateRequest). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the certificateRequest and deletes it. Returns an error if one occurs. +func (c *certificateRequests) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("certificaterequests"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *certificateRequests) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("certificaterequests"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched certificateRequest. +func (c *certificateRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CertificateRequest, err error) { + result = &v1.CertificateRequest{} + err = c.client.Patch(pt). + Resource("certificaterequests"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/cluster.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/cluster.go new file mode 100644 index 000000000..1937e9c99 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/cluster.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ClustersGetter has a method to return a ClusterInterface. +// A group's client should implement this interface. +type ClustersGetter interface { + Clusters() ClusterInterface +} + +// ClusterInterface has methods to work with Cluster resources. +type ClusterInterface interface { + Create(ctx context.Context, cluster *v1.Cluster, opts metav1.CreateOptions) (*v1.Cluster, error) + Update(ctx context.Context, cluster *v1.Cluster, opts metav1.UpdateOptions) (*v1.Cluster, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Cluster, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Cluster, err error) + ClusterExpansion +} + +// clusters implements ClusterInterface +type clusters struct { + client rest.Interface +} + +// newClusters returns a Clusters +func newClusters(c *GlobalTsmV1Client) *clusters { + return &clusters{ + client: c.RESTClient(), + } +} + +// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any. +func (c *clusters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Cluster, err error) { + result = &v1.Cluster{} + err = c.client.Get(). + Resource("clusters"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Clusters that match those selectors. +func (c *clusters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ClusterList{} + err = c.client.Get(). + Resource("clusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusters. +func (c *clusters) Watch(ctx context.Context, opts metav1.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(). + Resource("clusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any. +func (c *clusters) Create(ctx context.Context, cluster *v1.Cluster, opts metav1.CreateOptions) (result *v1.Cluster, err error) { + result = &v1.Cluster{} + err = c.client.Post(). + Resource("clusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(cluster). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any. +func (c *clusters) Update(ctx context.Context, cluster *v1.Cluster, opts metav1.UpdateOptions) (result *v1.Cluster, err error) { + result = &v1.Cluster{} + err = c.client.Put(). + Resource("clusters"). + Name(cluster.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(cluster). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the cluster and deletes it. Returns an error if one occurs. +func (c *clusters) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("clusters"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("clusters"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched cluster. +func (c *clusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Cluster, err error) { + result = &v1.Cluster{} + err = c.client.Patch(pt). + Resource("clusters"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/clusterconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/clusterconfig.go new file mode 100644 index 000000000..19bb7323b --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/clusterconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ClusterConfigsGetter has a method to return a ClusterConfigInterface. +// A group's client should implement this interface. +type ClusterConfigsGetter interface { + ClusterConfigs() ClusterConfigInterface +} + +// ClusterConfigInterface has methods to work with ClusterConfig resources. +type ClusterConfigInterface interface { + Create(ctx context.Context, clusterConfig *v1.ClusterConfig, opts metav1.CreateOptions) (*v1.ClusterConfig, error) + Update(ctx context.Context, clusterConfig *v1.ClusterConfig, opts metav1.UpdateOptions) (*v1.ClusterConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterConfig, err error) + ClusterConfigExpansion +} + +// clusterConfigs implements ClusterConfigInterface +type clusterConfigs struct { + client rest.Interface +} + +// newClusterConfigs returns a ClusterConfigs +func newClusterConfigs(c *GlobalTsmV1Client) *clusterConfigs { + return &clusterConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the clusterConfig, and returns the corresponding clusterConfig object, and an error if there is any. +func (c *clusterConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterConfig, err error) { + result = &v1.ClusterConfig{} + err = c.client.Get(). + Resource("clusterconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterConfigs that match those selectors. +func (c *clusterConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ClusterConfigList{} + err = c.client.Get(). + Resource("clusterconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterConfigs. +func (c *clusterConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("clusterconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterConfig and creates it. Returns the server's representation of the clusterConfig, and an error, if there is any. +func (c *clusterConfigs) Create(ctx context.Context, clusterConfig *v1.ClusterConfig, opts metav1.CreateOptions) (result *v1.ClusterConfig, err error) { + result = &v1.ClusterConfig{} + err = c.client.Post(). + Resource("clusterconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterConfig and updates it. Returns the server's representation of the clusterConfig, and an error, if there is any. +func (c *clusterConfigs) Update(ctx context.Context, clusterConfig *v1.ClusterConfig, opts metav1.UpdateOptions) (result *v1.ClusterConfig, err error) { + result = &v1.ClusterConfig{} + err = c.client.Put(). + Resource("clusterconfigs"). + Name(clusterConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterConfig and deletes it. Returns an error if one occurs. +func (c *clusterConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("clusterconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("clusterconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterConfig. +func (c *clusterConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterConfig, err error) { + result = &v1.ClusterConfig{} + err = c.client.Patch(pt). + Resource("clusterconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/clusterconfigfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/clusterconfigfolder.go new file mode 100644 index 000000000..033dd37e7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/clusterconfigfolder.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ClusterConfigFoldersGetter has a method to return a ClusterConfigFolderInterface. +// A group's client should implement this interface. +type ClusterConfigFoldersGetter interface { + ClusterConfigFolders() ClusterConfigFolderInterface +} + +// ClusterConfigFolderInterface has methods to work with ClusterConfigFolder resources. +type ClusterConfigFolderInterface interface { + Create(ctx context.Context, clusterConfigFolder *v1.ClusterConfigFolder, opts metav1.CreateOptions) (*v1.ClusterConfigFolder, error) + Update(ctx context.Context, clusterConfigFolder *v1.ClusterConfigFolder, opts metav1.UpdateOptions) (*v1.ClusterConfigFolder, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterConfigFolder, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterConfigFolderList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterConfigFolder, err error) + ClusterConfigFolderExpansion +} + +// clusterConfigFolders implements ClusterConfigFolderInterface +type clusterConfigFolders struct { + client rest.Interface +} + +// newClusterConfigFolders returns a ClusterConfigFolders +func newClusterConfigFolders(c *GlobalTsmV1Client) *clusterConfigFolders { + return &clusterConfigFolders{ + client: c.RESTClient(), + } +} + +// Get takes name of the clusterConfigFolder, and returns the corresponding clusterConfigFolder object, and an error if there is any. +func (c *clusterConfigFolders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterConfigFolder, err error) { + result = &v1.ClusterConfigFolder{} + err = c.client.Get(). + Resource("clusterconfigfolders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterConfigFolders that match those selectors. +func (c *clusterConfigFolders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterConfigFolderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ClusterConfigFolderList{} + err = c.client.Get(). + Resource("clusterconfigfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterConfigFolders. +func (c *clusterConfigFolders) Watch(ctx context.Context, opts metav1.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(). + Resource("clusterconfigfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterConfigFolder and creates it. Returns the server's representation of the clusterConfigFolder, and an error, if there is any. +func (c *clusterConfigFolders) Create(ctx context.Context, clusterConfigFolder *v1.ClusterConfigFolder, opts metav1.CreateOptions) (result *v1.ClusterConfigFolder, err error) { + result = &v1.ClusterConfigFolder{} + err = c.client.Post(). + Resource("clusterconfigfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterConfigFolder). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterConfigFolder and updates it. Returns the server's representation of the clusterConfigFolder, and an error, if there is any. +func (c *clusterConfigFolders) Update(ctx context.Context, clusterConfigFolder *v1.ClusterConfigFolder, opts metav1.UpdateOptions) (result *v1.ClusterConfigFolder, err error) { + result = &v1.ClusterConfigFolder{} + err = c.client.Put(). + Resource("clusterconfigfolders"). + Name(clusterConfigFolder.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterConfigFolder). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterConfigFolder and deletes it. Returns an error if one occurs. +func (c *clusterConfigFolders) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("clusterconfigfolders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterConfigFolders) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("clusterconfigfolders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterConfigFolder. +func (c *clusterConfigFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterConfigFolder, err error) { + result = &v1.ClusterConfigFolder{} + err = c.client.Patch(pt). + Resource("clusterconfigfolders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/clusterfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/clusterfolder.go new file mode 100644 index 000000000..78ad2ec93 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/clusterfolder.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ClusterFoldersGetter has a method to return a ClusterFolderInterface. +// A group's client should implement this interface. +type ClusterFoldersGetter interface { + ClusterFolders() ClusterFolderInterface +} + +// ClusterFolderInterface has methods to work with ClusterFolder resources. +type ClusterFolderInterface interface { + Create(ctx context.Context, clusterFolder *v1.ClusterFolder, opts metav1.CreateOptions) (*v1.ClusterFolder, error) + Update(ctx context.Context, clusterFolder *v1.ClusterFolder, opts metav1.UpdateOptions) (*v1.ClusterFolder, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterFolder, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterFolderList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterFolder, err error) + ClusterFolderExpansion +} + +// clusterFolders implements ClusterFolderInterface +type clusterFolders struct { + client rest.Interface +} + +// newClusterFolders returns a ClusterFolders +func newClusterFolders(c *GlobalTsmV1Client) *clusterFolders { + return &clusterFolders{ + client: c.RESTClient(), + } +} + +// Get takes name of the clusterFolder, and returns the corresponding clusterFolder object, and an error if there is any. +func (c *clusterFolders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterFolder, err error) { + result = &v1.ClusterFolder{} + err = c.client.Get(). + Resource("clusterfolders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterFolders that match those selectors. +func (c *clusterFolders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterFolderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ClusterFolderList{} + err = c.client.Get(). + Resource("clusterfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterFolders. +func (c *clusterFolders) Watch(ctx context.Context, opts metav1.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(). + Resource("clusterfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterFolder and creates it. Returns the server's representation of the clusterFolder, and an error, if there is any. +func (c *clusterFolders) Create(ctx context.Context, clusterFolder *v1.ClusterFolder, opts metav1.CreateOptions) (result *v1.ClusterFolder, err error) { + result = &v1.ClusterFolder{} + err = c.client.Post(). + Resource("clusterfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterFolder). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterFolder and updates it. Returns the server's representation of the clusterFolder, and an error, if there is any. +func (c *clusterFolders) Update(ctx context.Context, clusterFolder *v1.ClusterFolder, opts metav1.UpdateOptions) (result *v1.ClusterFolder, err error) { + result = &v1.ClusterFolder{} + err = c.client.Put(). + Resource("clusterfolders"). + Name(clusterFolder.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterFolder). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterFolder and deletes it. Returns an error if one occurs. +func (c *clusterFolders) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("clusterfolders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterFolders) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("clusterfolders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterFolder. +func (c *clusterFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterFolder, err error) { + result = &v1.ClusterFolder{} + err = c.client.Patch(pt). + Resource("clusterfolders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/clustersettings.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/clustersettings.go new file mode 100644 index 000000000..ed4b7354f --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/clustersettings.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ClusterSettingsesGetter has a method to return a ClusterSettingsInterface. +// A group's client should implement this interface. +type ClusterSettingsesGetter interface { + ClusterSettingses() ClusterSettingsInterface +} + +// ClusterSettingsInterface has methods to work with ClusterSettings resources. +type ClusterSettingsInterface interface { + Create(ctx context.Context, clusterSettings *v1.ClusterSettings, opts metav1.CreateOptions) (*v1.ClusterSettings, error) + Update(ctx context.Context, clusterSettings *v1.ClusterSettings, opts metav1.UpdateOptions) (*v1.ClusterSettings, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterSettings, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterSettingsList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterSettings, err error) + ClusterSettingsExpansion +} + +// clusterSettingses implements ClusterSettingsInterface +type clusterSettingses struct { + client rest.Interface +} + +// newClusterSettingses returns a ClusterSettingses +func newClusterSettingses(c *GlobalTsmV1Client) *clusterSettingses { + return &clusterSettingses{ + client: c.RESTClient(), + } +} + +// Get takes name of the clusterSettings, and returns the corresponding clusterSettings object, and an error if there is any. +func (c *clusterSettingses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterSettings, err error) { + result = &v1.ClusterSettings{} + err = c.client.Get(). + Resource("clustersettingses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterSettingses that match those selectors. +func (c *clusterSettingses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterSettingsList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ClusterSettingsList{} + err = c.client.Get(). + Resource("clustersettingses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterSettingses. +func (c *clusterSettingses) Watch(ctx context.Context, opts metav1.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(). + Resource("clustersettingses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterSettings and creates it. Returns the server's representation of the clusterSettings, and an error, if there is any. +func (c *clusterSettingses) Create(ctx context.Context, clusterSettings *v1.ClusterSettings, opts metav1.CreateOptions) (result *v1.ClusterSettings, err error) { + result = &v1.ClusterSettings{} + err = c.client.Post(). + Resource("clustersettingses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterSettings). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterSettings and updates it. Returns the server's representation of the clusterSettings, and an error, if there is any. +func (c *clusterSettingses) Update(ctx context.Context, clusterSettings *v1.ClusterSettings, opts metav1.UpdateOptions) (result *v1.ClusterSettings, err error) { + result = &v1.ClusterSettings{} + err = c.client.Put(). + Resource("clustersettingses"). + Name(clusterSettings.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterSettings). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterSettings and deletes it. Returns an error if one occurs. +func (c *clusterSettingses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("clustersettingses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterSettingses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("clustersettingses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterSettings. +func (c *clusterSettingses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterSettings, err error) { + result = &v1.ClusterSettings{} + err = c.client.Patch(pt). + Resource("clustersettingses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/config.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/config.go new file mode 100644 index 000000000..37ca7d3b9 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/config.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ConfigsGetter has a method to return a ConfigInterface. +// A group's client should implement this interface. +type ConfigsGetter interface { + Configs() ConfigInterface +} + +// ConfigInterface has methods to work with Config resources. +type ConfigInterface interface { + Create(ctx context.Context, config *v1.Config, opts metav1.CreateOptions) (*v1.Config, error) + Update(ctx context.Context, config *v1.Config, opts metav1.UpdateOptions) (*v1.Config, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Config, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Config, err error) + ConfigExpansion +} + +// configs implements ConfigInterface +type configs struct { + client rest.Interface +} + +// newConfigs returns a Configs +func newConfigs(c *GlobalTsmV1Client) *configs { + return &configs{ + client: c.RESTClient(), + } +} + +// Get takes name of the config, and returns the corresponding config object, and an error if there is any. +func (c *configs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Config, err error) { + result = &v1.Config{} + err = c.client.Get(). + Resource("configs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Configs that match those selectors. +func (c *configs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ConfigList{} + err = c.client.Get(). + Resource("configs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested configs. +func (c *configs) Watch(ctx context.Context, opts metav1.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(). + Resource("configs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a config and creates it. Returns the server's representation of the config, and an error, if there is any. +func (c *configs) Create(ctx context.Context, config *v1.Config, opts metav1.CreateOptions) (result *v1.Config, err error) { + result = &v1.Config{} + err = c.client.Post(). + Resource("configs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(config). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a config and updates it. Returns the server's representation of the config, and an error, if there is any. +func (c *configs) Update(ctx context.Context, config *v1.Config, opts metav1.UpdateOptions) (result *v1.Config, err error) { + result = &v1.Config{} + err = c.client.Put(). + Resource("configs"). + Name(config.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(config). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the config and deletes it. Returns an error if one occurs. +func (c *configs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("configs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *configs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("configs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched config. +func (c *configs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Config, err error) { + result = &v1.Config{} + err = c.client.Patch(pt). + Resource("configs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/configmap.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/configmap.go new file mode 100644 index 000000000..d6c018567 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/configmap.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ConfigMapsGetter has a method to return a ConfigMapInterface. +// A group's client should implement this interface. +type ConfigMapsGetter interface { + ConfigMaps() ConfigMapInterface +} + +// ConfigMapInterface has methods to work with ConfigMap resources. +type ConfigMapInterface interface { + Create(ctx context.Context, configMap *v1.ConfigMap, opts metav1.CreateOptions) (*v1.ConfigMap, error) + Update(ctx context.Context, configMap *v1.ConfigMap, opts metav1.UpdateOptions) (*v1.ConfigMap, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ConfigMap, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ConfigMapList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ConfigMap, err error) + ConfigMapExpansion +} + +// configMaps implements ConfigMapInterface +type configMaps struct { + client rest.Interface +} + +// newConfigMaps returns a ConfigMaps +func newConfigMaps(c *GlobalTsmV1Client) *configMaps { + return &configMaps{ + client: c.RESTClient(), + } +} + +// Get takes name of the configMap, and returns the corresponding configMap object, and an error if there is any. +func (c *configMaps) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ConfigMap, err error) { + result = &v1.ConfigMap{} + err = c.client.Get(). + Resource("configmaps"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ConfigMaps that match those selectors. +func (c *configMaps) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigMapList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ConfigMapList{} + err = c.client.Get(). + Resource("configmaps"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested configMaps. +func (c *configMaps) Watch(ctx context.Context, opts metav1.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(). + Resource("configmaps"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a configMap and creates it. Returns the server's representation of the configMap, and an error, if there is any. +func (c *configMaps) Create(ctx context.Context, configMap *v1.ConfigMap, opts metav1.CreateOptions) (result *v1.ConfigMap, err error) { + result = &v1.ConfigMap{} + err = c.client.Post(). + Resource("configmaps"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(configMap). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a configMap and updates it. Returns the server's representation of the configMap, and an error, if there is any. +func (c *configMaps) Update(ctx context.Context, configMap *v1.ConfigMap, opts metav1.UpdateOptions) (result *v1.ConfigMap, err error) { + result = &v1.ConfigMap{} + err = c.client.Put(). + Resource("configmaps"). + Name(configMap.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(configMap). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the configMap and deletes it. Returns an error if one occurs. +func (c *configMaps) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("configmaps"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *configMaps) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("configmaps"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched configMap. +func (c *configMaps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ConfigMap, err error) { + result = &v1.ConfigMap{} + err = c.client.Patch(pt). + Resource("configmaps"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/connectionstatus.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/connectionstatus.go new file mode 100644 index 000000000..c01671570 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/connectionstatus.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ConnectionStatusesGetter has a method to return a ConnectionStatusInterface. +// A group's client should implement this interface. +type ConnectionStatusesGetter interface { + ConnectionStatuses() ConnectionStatusInterface +} + +// ConnectionStatusInterface has methods to work with ConnectionStatus resources. +type ConnectionStatusInterface interface { + Create(ctx context.Context, connectionStatus *v1.ConnectionStatus, opts metav1.CreateOptions) (*v1.ConnectionStatus, error) + Update(ctx context.Context, connectionStatus *v1.ConnectionStatus, opts metav1.UpdateOptions) (*v1.ConnectionStatus, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ConnectionStatus, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ConnectionStatusList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ConnectionStatus, err error) + ConnectionStatusExpansion +} + +// connectionStatuses implements ConnectionStatusInterface +type connectionStatuses struct { + client rest.Interface +} + +// newConnectionStatuses returns a ConnectionStatuses +func newConnectionStatuses(c *GlobalTsmV1Client) *connectionStatuses { + return &connectionStatuses{ + client: c.RESTClient(), + } +} + +// Get takes name of the connectionStatus, and returns the corresponding connectionStatus object, and an error if there is any. +func (c *connectionStatuses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ConnectionStatus, err error) { + result = &v1.ConnectionStatus{} + err = c.client.Get(). + Resource("connectionstatuses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ConnectionStatuses that match those selectors. +func (c *connectionStatuses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConnectionStatusList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ConnectionStatusList{} + err = c.client.Get(). + Resource("connectionstatuses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested connectionStatuses. +func (c *connectionStatuses) Watch(ctx context.Context, opts metav1.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(). + Resource("connectionstatuses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a connectionStatus and creates it. Returns the server's representation of the connectionStatus, and an error, if there is any. +func (c *connectionStatuses) Create(ctx context.Context, connectionStatus *v1.ConnectionStatus, opts metav1.CreateOptions) (result *v1.ConnectionStatus, err error) { + result = &v1.ConnectionStatus{} + err = c.client.Post(). + Resource("connectionstatuses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(connectionStatus). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a connectionStatus and updates it. Returns the server's representation of the connectionStatus, and an error, if there is any. +func (c *connectionStatuses) Update(ctx context.Context, connectionStatus *v1.ConnectionStatus, opts metav1.UpdateOptions) (result *v1.ConnectionStatus, err error) { + result = &v1.ConnectionStatus{} + err = c.client.Put(). + Resource("connectionstatuses"). + Name(connectionStatus.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(connectionStatus). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the connectionStatus and deletes it. Returns an error if one occurs. +func (c *connectionStatuses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("connectionstatuses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *connectionStatuses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("connectionstatuses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched connectionStatus. +func (c *connectionStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ConnectionStatus, err error) { + result = &v1.ConnectionStatus{} + err = c.client.Patch(pt). + Resource("connectionstatuses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/database.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/database.go new file mode 100644 index 000000000..761431d34 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/database.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DatabasesGetter has a method to return a DatabaseInterface. +// A group's client should implement this interface. +type DatabasesGetter interface { + Databases() DatabaseInterface +} + +// DatabaseInterface has methods to work with Database resources. +type DatabaseInterface interface { + Create(ctx context.Context, database *v1.Database, opts metav1.CreateOptions) (*v1.Database, error) + Update(ctx context.Context, database *v1.Database, opts metav1.UpdateOptions) (*v1.Database, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Database, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DatabaseList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Database, err error) + DatabaseExpansion +} + +// databases implements DatabaseInterface +type databases struct { + client rest.Interface +} + +// newDatabases returns a Databases +func newDatabases(c *GlobalTsmV1Client) *databases { + return &databases{ + client: c.RESTClient(), + } +} + +// Get takes name of the database, and returns the corresponding database object, and an error if there is any. +func (c *databases) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Database, err error) { + result = &v1.Database{} + err = c.client.Get(). + Resource("databases"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Databases that match those selectors. +func (c *databases) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DatabaseList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DatabaseList{} + err = c.client.Get(). + Resource("databases"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested databases. +func (c *databases) Watch(ctx context.Context, opts metav1.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(). + Resource("databases"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a database and creates it. Returns the server's representation of the database, and an error, if there is any. +func (c *databases) Create(ctx context.Context, database *v1.Database, opts metav1.CreateOptions) (result *v1.Database, err error) { + result = &v1.Database{} + err = c.client.Post(). + Resource("databases"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(database). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a database and updates it. Returns the server's representation of the database, and an error, if there is any. +func (c *databases) Update(ctx context.Context, database *v1.Database, opts metav1.UpdateOptions) (result *v1.Database, err error) { + result = &v1.Database{} + err = c.client.Put(). + Resource("databases"). + Name(database.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(database). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the database and deletes it. Returns an error if one occurs. +func (c *databases) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("databases"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *databases) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("databases"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched database. +func (c *databases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Database, err error) { + result = &v1.Database{} + err = c.client.Patch(pt). + Resource("databases"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datafolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datafolder.go new file mode 100644 index 000000000..a0776f5b0 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datafolder.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DataFoldersGetter has a method to return a DataFolderInterface. +// A group's client should implement this interface. +type DataFoldersGetter interface { + DataFolders() DataFolderInterface +} + +// DataFolderInterface has methods to work with DataFolder resources. +type DataFolderInterface interface { + Create(ctx context.Context, dataFolder *v1.DataFolder, opts metav1.CreateOptions) (*v1.DataFolder, error) + Update(ctx context.Context, dataFolder *v1.DataFolder, opts metav1.UpdateOptions) (*v1.DataFolder, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DataFolder, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DataFolderList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DataFolder, err error) + DataFolderExpansion +} + +// dataFolders implements DataFolderInterface +type dataFolders struct { + client rest.Interface +} + +// newDataFolders returns a DataFolders +func newDataFolders(c *GlobalTsmV1Client) *dataFolders { + return &dataFolders{ + client: c.RESTClient(), + } +} + +// Get takes name of the dataFolder, and returns the corresponding dataFolder object, and an error if there is any. +func (c *dataFolders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DataFolder, err error) { + result = &v1.DataFolder{} + err = c.client.Get(). + Resource("datafolders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DataFolders that match those selectors. +func (c *dataFolders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DataFolderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DataFolderList{} + err = c.client.Get(). + Resource("datafolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dataFolders. +func (c *dataFolders) Watch(ctx context.Context, opts metav1.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(). + Resource("datafolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a dataFolder and creates it. Returns the server's representation of the dataFolder, and an error, if there is any. +func (c *dataFolders) Create(ctx context.Context, dataFolder *v1.DataFolder, opts metav1.CreateOptions) (result *v1.DataFolder, err error) { + result = &v1.DataFolder{} + err = c.client.Post(). + Resource("datafolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dataFolder). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a dataFolder and updates it. Returns the server's representation of the dataFolder, and an error, if there is any. +func (c *dataFolders) Update(ctx context.Context, dataFolder *v1.DataFolder, opts metav1.UpdateOptions) (result *v1.DataFolder, err error) { + result = &v1.DataFolder{} + err = c.client.Put(). + Resource("datafolders"). + Name(dataFolder.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dataFolder). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the dataFolder and deletes it. Returns an error if one occurs. +func (c *dataFolders) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("datafolders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dataFolders) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("datafolders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched dataFolder. +func (c *dataFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DataFolder, err error) { + result = &v1.DataFolder{} + err = c.client.Patch(pt). + Resource("datafolders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datafolderdomain.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datafolderdomain.go new file mode 100644 index 000000000..25d20e07d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datafolderdomain.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DataFolderDomainsGetter has a method to return a DataFolderDomainInterface. +// A group's client should implement this interface. +type DataFolderDomainsGetter interface { + DataFolderDomains() DataFolderDomainInterface +} + +// DataFolderDomainInterface has methods to work with DataFolderDomain resources. +type DataFolderDomainInterface interface { + Create(ctx context.Context, dataFolderDomain *v1.DataFolderDomain, opts metav1.CreateOptions) (*v1.DataFolderDomain, error) + Update(ctx context.Context, dataFolderDomain *v1.DataFolderDomain, opts metav1.UpdateOptions) (*v1.DataFolderDomain, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DataFolderDomain, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DataFolderDomainList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DataFolderDomain, err error) + DataFolderDomainExpansion +} + +// dataFolderDomains implements DataFolderDomainInterface +type dataFolderDomains struct { + client rest.Interface +} + +// newDataFolderDomains returns a DataFolderDomains +func newDataFolderDomains(c *GlobalTsmV1Client) *dataFolderDomains { + return &dataFolderDomains{ + client: c.RESTClient(), + } +} + +// Get takes name of the dataFolderDomain, and returns the corresponding dataFolderDomain object, and an error if there is any. +func (c *dataFolderDomains) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DataFolderDomain, err error) { + result = &v1.DataFolderDomain{} + err = c.client.Get(). + Resource("datafolderdomains"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DataFolderDomains that match those selectors. +func (c *dataFolderDomains) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DataFolderDomainList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DataFolderDomainList{} + err = c.client.Get(). + Resource("datafolderdomains"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dataFolderDomains. +func (c *dataFolderDomains) Watch(ctx context.Context, opts metav1.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(). + Resource("datafolderdomains"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a dataFolderDomain and creates it. Returns the server's representation of the dataFolderDomain, and an error, if there is any. +func (c *dataFolderDomains) Create(ctx context.Context, dataFolderDomain *v1.DataFolderDomain, opts metav1.CreateOptions) (result *v1.DataFolderDomain, err error) { + result = &v1.DataFolderDomain{} + err = c.client.Post(). + Resource("datafolderdomains"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dataFolderDomain). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a dataFolderDomain and updates it. Returns the server's representation of the dataFolderDomain, and an error, if there is any. +func (c *dataFolderDomains) Update(ctx context.Context, dataFolderDomain *v1.DataFolderDomain, opts metav1.UpdateOptions) (result *v1.DataFolderDomain, err error) { + result = &v1.DataFolderDomain{} + err = c.client.Put(). + Resource("datafolderdomains"). + Name(dataFolderDomain.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dataFolderDomain). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the dataFolderDomain and deletes it. Returns an error if one occurs. +func (c *dataFolderDomains) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("datafolderdomains"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dataFolderDomains) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("datafolderdomains"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched dataFolderDomain. +func (c *dataFolderDomains) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DataFolderDomain, err error) { + result = &v1.DataFolderDomain{} + err = c.client.Patch(pt). + Resource("datafolderdomains"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datafolderdomaincluster.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datafolderdomaincluster.go new file mode 100644 index 000000000..372a55542 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datafolderdomaincluster.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DataFolderDomainClustersGetter has a method to return a DataFolderDomainClusterInterface. +// A group's client should implement this interface. +type DataFolderDomainClustersGetter interface { + DataFolderDomainClusters() DataFolderDomainClusterInterface +} + +// DataFolderDomainClusterInterface has methods to work with DataFolderDomainCluster resources. +type DataFolderDomainClusterInterface interface { + Create(ctx context.Context, dataFolderDomainCluster *v1.DataFolderDomainCluster, opts metav1.CreateOptions) (*v1.DataFolderDomainCluster, error) + Update(ctx context.Context, dataFolderDomainCluster *v1.DataFolderDomainCluster, opts metav1.UpdateOptions) (*v1.DataFolderDomainCluster, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DataFolderDomainCluster, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DataFolderDomainClusterList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DataFolderDomainCluster, err error) + DataFolderDomainClusterExpansion +} + +// dataFolderDomainClusters implements DataFolderDomainClusterInterface +type dataFolderDomainClusters struct { + client rest.Interface +} + +// newDataFolderDomainClusters returns a DataFolderDomainClusters +func newDataFolderDomainClusters(c *GlobalTsmV1Client) *dataFolderDomainClusters { + return &dataFolderDomainClusters{ + client: c.RESTClient(), + } +} + +// Get takes name of the dataFolderDomainCluster, and returns the corresponding dataFolderDomainCluster object, and an error if there is any. +func (c *dataFolderDomainClusters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DataFolderDomainCluster, err error) { + result = &v1.DataFolderDomainCluster{} + err = c.client.Get(). + Resource("datafolderdomainclusters"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DataFolderDomainClusters that match those selectors. +func (c *dataFolderDomainClusters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DataFolderDomainClusterList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DataFolderDomainClusterList{} + err = c.client.Get(). + Resource("datafolderdomainclusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dataFolderDomainClusters. +func (c *dataFolderDomainClusters) Watch(ctx context.Context, opts metav1.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(). + Resource("datafolderdomainclusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a dataFolderDomainCluster and creates it. Returns the server's representation of the dataFolderDomainCluster, and an error, if there is any. +func (c *dataFolderDomainClusters) Create(ctx context.Context, dataFolderDomainCluster *v1.DataFolderDomainCluster, opts metav1.CreateOptions) (result *v1.DataFolderDomainCluster, err error) { + result = &v1.DataFolderDomainCluster{} + err = c.client.Post(). + Resource("datafolderdomainclusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dataFolderDomainCluster). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a dataFolderDomainCluster and updates it. Returns the server's representation of the dataFolderDomainCluster, and an error, if there is any. +func (c *dataFolderDomainClusters) Update(ctx context.Context, dataFolderDomainCluster *v1.DataFolderDomainCluster, opts metav1.UpdateOptions) (result *v1.DataFolderDomainCluster, err error) { + result = &v1.DataFolderDomainCluster{} + err = c.client.Put(). + Resource("datafolderdomainclusters"). + Name(dataFolderDomainCluster.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dataFolderDomainCluster). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the dataFolderDomainCluster and deletes it. Returns an error if one occurs. +func (c *dataFolderDomainClusters) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("datafolderdomainclusters"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dataFolderDomainClusters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("datafolderdomainclusters"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched dataFolderDomainCluster. +func (c *dataFolderDomainClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DataFolderDomainCluster, err error) { + result = &v1.DataFolderDomainCluster{} + err = c.client.Patch(pt). + Resource("datafolderdomainclusters"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datafolderdomainservice.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datafolderdomainservice.go new file mode 100644 index 000000000..f8c699e91 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datafolderdomainservice.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DataFolderDomainServicesGetter has a method to return a DataFolderDomainServiceInterface. +// A group's client should implement this interface. +type DataFolderDomainServicesGetter interface { + DataFolderDomainServices() DataFolderDomainServiceInterface +} + +// DataFolderDomainServiceInterface has methods to work with DataFolderDomainService resources. +type DataFolderDomainServiceInterface interface { + Create(ctx context.Context, dataFolderDomainService *v1.DataFolderDomainService, opts metav1.CreateOptions) (*v1.DataFolderDomainService, error) + Update(ctx context.Context, dataFolderDomainService *v1.DataFolderDomainService, opts metav1.UpdateOptions) (*v1.DataFolderDomainService, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DataFolderDomainService, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DataFolderDomainServiceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DataFolderDomainService, err error) + DataFolderDomainServiceExpansion +} + +// dataFolderDomainServices implements DataFolderDomainServiceInterface +type dataFolderDomainServices struct { + client rest.Interface +} + +// newDataFolderDomainServices returns a DataFolderDomainServices +func newDataFolderDomainServices(c *GlobalTsmV1Client) *dataFolderDomainServices { + return &dataFolderDomainServices{ + client: c.RESTClient(), + } +} + +// Get takes name of the dataFolderDomainService, and returns the corresponding dataFolderDomainService object, and an error if there is any. +func (c *dataFolderDomainServices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DataFolderDomainService, err error) { + result = &v1.DataFolderDomainService{} + err = c.client.Get(). + Resource("datafolderdomainservices"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DataFolderDomainServices that match those selectors. +func (c *dataFolderDomainServices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DataFolderDomainServiceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DataFolderDomainServiceList{} + err = c.client.Get(). + Resource("datafolderdomainservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dataFolderDomainServices. +func (c *dataFolderDomainServices) Watch(ctx context.Context, opts metav1.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(). + Resource("datafolderdomainservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a dataFolderDomainService and creates it. Returns the server's representation of the dataFolderDomainService, and an error, if there is any. +func (c *dataFolderDomainServices) Create(ctx context.Context, dataFolderDomainService *v1.DataFolderDomainService, opts metav1.CreateOptions) (result *v1.DataFolderDomainService, err error) { + result = &v1.DataFolderDomainService{} + err = c.client.Post(). + Resource("datafolderdomainservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dataFolderDomainService). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a dataFolderDomainService and updates it. Returns the server's representation of the dataFolderDomainService, and an error, if there is any. +func (c *dataFolderDomainServices) Update(ctx context.Context, dataFolderDomainService *v1.DataFolderDomainService, opts metav1.UpdateOptions) (result *v1.DataFolderDomainService, err error) { + result = &v1.DataFolderDomainService{} + err = c.client.Put(). + Resource("datafolderdomainservices"). + Name(dataFolderDomainService.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dataFolderDomainService). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the dataFolderDomainService and deletes it. Returns an error if one occurs. +func (c *dataFolderDomainServices) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("datafolderdomainservices"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dataFolderDomainServices) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("datafolderdomainservices"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched dataFolderDomainService. +func (c *dataFolderDomainServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DataFolderDomainService, err error) { + result = &v1.DataFolderDomainService{} + err = c.client.Patch(pt). + Resource("datafolderdomainservices"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datafolderdomainserviceversion.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datafolderdomainserviceversion.go new file mode 100644 index 000000000..8d22c1a50 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datafolderdomainserviceversion.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DataFolderDomainServiceVersionsGetter has a method to return a DataFolderDomainServiceVersionInterface. +// A group's client should implement this interface. +type DataFolderDomainServiceVersionsGetter interface { + DataFolderDomainServiceVersions() DataFolderDomainServiceVersionInterface +} + +// DataFolderDomainServiceVersionInterface has methods to work with DataFolderDomainServiceVersion resources. +type DataFolderDomainServiceVersionInterface interface { + Create(ctx context.Context, dataFolderDomainServiceVersion *v1.DataFolderDomainServiceVersion, opts metav1.CreateOptions) (*v1.DataFolderDomainServiceVersion, error) + Update(ctx context.Context, dataFolderDomainServiceVersion *v1.DataFolderDomainServiceVersion, opts metav1.UpdateOptions) (*v1.DataFolderDomainServiceVersion, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DataFolderDomainServiceVersion, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DataFolderDomainServiceVersionList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DataFolderDomainServiceVersion, err error) + DataFolderDomainServiceVersionExpansion +} + +// dataFolderDomainServiceVersions implements DataFolderDomainServiceVersionInterface +type dataFolderDomainServiceVersions struct { + client rest.Interface +} + +// newDataFolderDomainServiceVersions returns a DataFolderDomainServiceVersions +func newDataFolderDomainServiceVersions(c *GlobalTsmV1Client) *dataFolderDomainServiceVersions { + return &dataFolderDomainServiceVersions{ + client: c.RESTClient(), + } +} + +// Get takes name of the dataFolderDomainServiceVersion, and returns the corresponding dataFolderDomainServiceVersion object, and an error if there is any. +func (c *dataFolderDomainServiceVersions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DataFolderDomainServiceVersion, err error) { + result = &v1.DataFolderDomainServiceVersion{} + err = c.client.Get(). + Resource("datafolderdomainserviceversions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DataFolderDomainServiceVersions that match those selectors. +func (c *dataFolderDomainServiceVersions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DataFolderDomainServiceVersionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DataFolderDomainServiceVersionList{} + err = c.client.Get(). + Resource("datafolderdomainserviceversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dataFolderDomainServiceVersions. +func (c *dataFolderDomainServiceVersions) Watch(ctx context.Context, opts metav1.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(). + Resource("datafolderdomainserviceversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a dataFolderDomainServiceVersion and creates it. Returns the server's representation of the dataFolderDomainServiceVersion, and an error, if there is any. +func (c *dataFolderDomainServiceVersions) Create(ctx context.Context, dataFolderDomainServiceVersion *v1.DataFolderDomainServiceVersion, opts metav1.CreateOptions) (result *v1.DataFolderDomainServiceVersion, err error) { + result = &v1.DataFolderDomainServiceVersion{} + err = c.client.Post(). + Resource("datafolderdomainserviceversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dataFolderDomainServiceVersion). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a dataFolderDomainServiceVersion and updates it. Returns the server's representation of the dataFolderDomainServiceVersion, and an error, if there is any. +func (c *dataFolderDomainServiceVersions) Update(ctx context.Context, dataFolderDomainServiceVersion *v1.DataFolderDomainServiceVersion, opts metav1.UpdateOptions) (result *v1.DataFolderDomainServiceVersion, err error) { + result = &v1.DataFolderDomainServiceVersion{} + err = c.client.Put(). + Resource("datafolderdomainserviceversions"). + Name(dataFolderDomainServiceVersion.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dataFolderDomainServiceVersion). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the dataFolderDomainServiceVersion and deletes it. Returns an error if one occurs. +func (c *dataFolderDomainServiceVersions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("datafolderdomainserviceversions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dataFolderDomainServiceVersions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("datafolderdomainserviceversions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched dataFolderDomainServiceVersion. +func (c *dataFolderDomainServiceVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DataFolderDomainServiceVersion, err error) { + result = &v1.DataFolderDomainServiceVersion{} + err = c.client.Patch(pt). + Resource("datafolderdomainserviceversions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datagroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datagroup.go new file mode 100644 index 000000000..074f032c4 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datagroup.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DataGroupsGetter has a method to return a DataGroupInterface. +// A group's client should implement this interface. +type DataGroupsGetter interface { + DataGroups() DataGroupInterface +} + +// DataGroupInterface has methods to work with DataGroup resources. +type DataGroupInterface interface { + Create(ctx context.Context, dataGroup *v1.DataGroup, opts metav1.CreateOptions) (*v1.DataGroup, error) + Update(ctx context.Context, dataGroup *v1.DataGroup, opts metav1.UpdateOptions) (*v1.DataGroup, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DataGroup, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DataGroupList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DataGroup, err error) + DataGroupExpansion +} + +// dataGroups implements DataGroupInterface +type dataGroups struct { + client rest.Interface +} + +// newDataGroups returns a DataGroups +func newDataGroups(c *GlobalTsmV1Client) *dataGroups { + return &dataGroups{ + client: c.RESTClient(), + } +} + +// Get takes name of the dataGroup, and returns the corresponding dataGroup object, and an error if there is any. +func (c *dataGroups) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DataGroup, err error) { + result = &v1.DataGroup{} + err = c.client.Get(). + Resource("datagroups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DataGroups that match those selectors. +func (c *dataGroups) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DataGroupList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DataGroupList{} + err = c.client.Get(). + Resource("datagroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dataGroups. +func (c *dataGroups) Watch(ctx context.Context, opts metav1.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(). + Resource("datagroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a dataGroup and creates it. Returns the server's representation of the dataGroup, and an error, if there is any. +func (c *dataGroups) Create(ctx context.Context, dataGroup *v1.DataGroup, opts metav1.CreateOptions) (result *v1.DataGroup, err error) { + result = &v1.DataGroup{} + err = c.client.Post(). + Resource("datagroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dataGroup). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a dataGroup and updates it. Returns the server's representation of the dataGroup, and an error, if there is any. +func (c *dataGroups) Update(ctx context.Context, dataGroup *v1.DataGroup, opts metav1.UpdateOptions) (result *v1.DataGroup, err error) { + result = &v1.DataGroup{} + err = c.client.Put(). + Resource("datagroups"). + Name(dataGroup.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dataGroup). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the dataGroup and deletes it. Returns an error if one occurs. +func (c *dataGroups) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("datagroups"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dataGroups) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("datagroups"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched dataGroup. +func (c *dataGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DataGroup, err error) { + result = &v1.DataGroup{} + err = c.client.Patch(pt). + Resource("datagroups"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datatemplate.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datatemplate.go new file mode 100644 index 000000000..1b213282c --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/datatemplate.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DataTemplatesGetter has a method to return a DataTemplateInterface. +// A group's client should implement this interface. +type DataTemplatesGetter interface { + DataTemplates() DataTemplateInterface +} + +// DataTemplateInterface has methods to work with DataTemplate resources. +type DataTemplateInterface interface { + Create(ctx context.Context, dataTemplate *v1.DataTemplate, opts metav1.CreateOptions) (*v1.DataTemplate, error) + Update(ctx context.Context, dataTemplate *v1.DataTemplate, opts metav1.UpdateOptions) (*v1.DataTemplate, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DataTemplate, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DataTemplateList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DataTemplate, err error) + DataTemplateExpansion +} + +// dataTemplates implements DataTemplateInterface +type dataTemplates struct { + client rest.Interface +} + +// newDataTemplates returns a DataTemplates +func newDataTemplates(c *GlobalTsmV1Client) *dataTemplates { + return &dataTemplates{ + client: c.RESTClient(), + } +} + +// Get takes name of the dataTemplate, and returns the corresponding dataTemplate object, and an error if there is any. +func (c *dataTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DataTemplate, err error) { + result = &v1.DataTemplate{} + err = c.client.Get(). + Resource("datatemplates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DataTemplates that match those selectors. +func (c *dataTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DataTemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DataTemplateList{} + err = c.client.Get(). + Resource("datatemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dataTemplates. +func (c *dataTemplates) Watch(ctx context.Context, opts metav1.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(). + Resource("datatemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a dataTemplate and creates it. Returns the server's representation of the dataTemplate, and an error, if there is any. +func (c *dataTemplates) Create(ctx context.Context, dataTemplate *v1.DataTemplate, opts metav1.CreateOptions) (result *v1.DataTemplate, err error) { + result = &v1.DataTemplate{} + err = c.client.Post(). + Resource("datatemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dataTemplate). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a dataTemplate and updates it. Returns the server's representation of the dataTemplate, and an error, if there is any. +func (c *dataTemplates) Update(ctx context.Context, dataTemplate *v1.DataTemplate, opts metav1.UpdateOptions) (result *v1.DataTemplate, err error) { + result = &v1.DataTemplate{} + err = c.client.Put(). + Resource("datatemplates"). + Name(dataTemplate.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dataTemplate). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the dataTemplate and deletes it. Returns an error if one occurs. +func (c *dataTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("datatemplates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dataTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("datatemplates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched dataTemplate. +func (c *dataTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DataTemplate, err error) { + result = &v1.DataTemplate{} + err = c.client.Patch(pt). + Resource("datatemplates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dcregion.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dcregion.go new file mode 100644 index 000000000..0499b764f --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dcregion.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DCRegionsGetter has a method to return a DCRegionInterface. +// A group's client should implement this interface. +type DCRegionsGetter interface { + DCRegions() DCRegionInterface +} + +// DCRegionInterface has methods to work with DCRegion resources. +type DCRegionInterface interface { + Create(ctx context.Context, dCRegion *v1.DCRegion, opts metav1.CreateOptions) (*v1.DCRegion, error) + Update(ctx context.Context, dCRegion *v1.DCRegion, opts metav1.UpdateOptions) (*v1.DCRegion, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DCRegion, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DCRegionList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DCRegion, err error) + DCRegionExpansion +} + +// dCRegions implements DCRegionInterface +type dCRegions struct { + client rest.Interface +} + +// newDCRegions returns a DCRegions +func newDCRegions(c *GlobalTsmV1Client) *dCRegions { + return &dCRegions{ + client: c.RESTClient(), + } +} + +// Get takes name of the dCRegion, and returns the corresponding dCRegion object, and an error if there is any. +func (c *dCRegions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DCRegion, err error) { + result = &v1.DCRegion{} + err = c.client.Get(). + Resource("dcregions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DCRegions that match those selectors. +func (c *dCRegions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DCRegionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DCRegionList{} + err = c.client.Get(). + Resource("dcregions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dCRegions. +func (c *dCRegions) Watch(ctx context.Context, opts metav1.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(). + Resource("dcregions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a dCRegion and creates it. Returns the server's representation of the dCRegion, and an error, if there is any. +func (c *dCRegions) Create(ctx context.Context, dCRegion *v1.DCRegion, opts metav1.CreateOptions) (result *v1.DCRegion, err error) { + result = &v1.DCRegion{} + err = c.client.Post(). + Resource("dcregions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dCRegion). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a dCRegion and updates it. Returns the server's representation of the dCRegion, and an error, if there is any. +func (c *dCRegions) Update(ctx context.Context, dCRegion *v1.DCRegion, opts metav1.UpdateOptions) (result *v1.DCRegion, err error) { + result = &v1.DCRegion{} + err = c.client.Put(). + Resource("dcregions"). + Name(dCRegion.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dCRegion). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the dCRegion and deletes it. Returns an error if one occurs. +func (c *dCRegions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("dcregions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dCRegions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("dcregions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched dCRegion. +func (c *dCRegions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DCRegion, err error) { + result = &v1.DCRegion{} + err = c.client.Patch(pt). + Resource("dcregions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dczone.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dczone.go new file mode 100644 index 000000000..90045c202 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dczone.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DCZonesGetter has a method to return a DCZoneInterface. +// A group's client should implement this interface. +type DCZonesGetter interface { + DCZones() DCZoneInterface +} + +// DCZoneInterface has methods to work with DCZone resources. +type DCZoneInterface interface { + Create(ctx context.Context, dCZone *v1.DCZone, opts metav1.CreateOptions) (*v1.DCZone, error) + Update(ctx context.Context, dCZone *v1.DCZone, opts metav1.UpdateOptions) (*v1.DCZone, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DCZone, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DCZoneList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DCZone, err error) + DCZoneExpansion +} + +// dCZones implements DCZoneInterface +type dCZones struct { + client rest.Interface +} + +// newDCZones returns a DCZones +func newDCZones(c *GlobalTsmV1Client) *dCZones { + return &dCZones{ + client: c.RESTClient(), + } +} + +// Get takes name of the dCZone, and returns the corresponding dCZone object, and an error if there is any. +func (c *dCZones) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DCZone, err error) { + result = &v1.DCZone{} + err = c.client.Get(). + Resource("dczones"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DCZones that match those selectors. +func (c *dCZones) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DCZoneList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DCZoneList{} + err = c.client.Get(). + Resource("dczones"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dCZones. +func (c *dCZones) Watch(ctx context.Context, opts metav1.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(). + Resource("dczones"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a dCZone and creates it. Returns the server's representation of the dCZone, and an error, if there is any. +func (c *dCZones) Create(ctx context.Context, dCZone *v1.DCZone, opts metav1.CreateOptions) (result *v1.DCZone, err error) { + result = &v1.DCZone{} + err = c.client.Post(). + Resource("dczones"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dCZone). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a dCZone and updates it. Returns the server's representation of the dCZone, and an error, if there is any. +func (c *dCZones) Update(ctx context.Context, dCZone *v1.DCZone, opts metav1.UpdateOptions) (result *v1.DCZone, err error) { + result = &v1.DCZone{} + err = c.client.Put(). + Resource("dczones"). + Name(dCZone.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dCZone). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the dCZone and deletes it. Returns an error if one occurs. +func (c *dCZones) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("dczones"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dCZones) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("dczones"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched dCZone. +func (c *dCZones) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DCZone, err error) { + result = &v1.DCZone{} + err = c.client.Patch(pt). + Resource("dczones"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/destinationrule.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/destinationrule.go new file mode 100644 index 000000000..a4109d5fd --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/destinationrule.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DestinationRulesGetter has a method to return a DestinationRuleInterface. +// A group's client should implement this interface. +type DestinationRulesGetter interface { + DestinationRules() DestinationRuleInterface +} + +// DestinationRuleInterface has methods to work with DestinationRule resources. +type DestinationRuleInterface interface { + Create(ctx context.Context, destinationRule *v1.DestinationRule, opts metav1.CreateOptions) (*v1.DestinationRule, error) + Update(ctx context.Context, destinationRule *v1.DestinationRule, opts metav1.UpdateOptions) (*v1.DestinationRule, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DestinationRule, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DestinationRuleList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DestinationRule, err error) + DestinationRuleExpansion +} + +// destinationRules implements DestinationRuleInterface +type destinationRules struct { + client rest.Interface +} + +// newDestinationRules returns a DestinationRules +func newDestinationRules(c *GlobalTsmV1Client) *destinationRules { + return &destinationRules{ + client: c.RESTClient(), + } +} + +// Get takes name of the destinationRule, and returns the corresponding destinationRule object, and an error if there is any. +func (c *destinationRules) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DestinationRule, err error) { + result = &v1.DestinationRule{} + err = c.client.Get(). + Resource("destinationrules"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DestinationRules that match those selectors. +func (c *destinationRules) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DestinationRuleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DestinationRuleList{} + err = c.client.Get(). + Resource("destinationrules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested destinationRules. +func (c *destinationRules) Watch(ctx context.Context, opts metav1.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(). + Resource("destinationrules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a destinationRule and creates it. Returns the server's representation of the destinationRule, and an error, if there is any. +func (c *destinationRules) Create(ctx context.Context, destinationRule *v1.DestinationRule, opts metav1.CreateOptions) (result *v1.DestinationRule, err error) { + result = &v1.DestinationRule{} + err = c.client.Post(). + Resource("destinationrules"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(destinationRule). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a destinationRule and updates it. Returns the server's representation of the destinationRule, and an error, if there is any. +func (c *destinationRules) Update(ctx context.Context, destinationRule *v1.DestinationRule, opts metav1.UpdateOptions) (result *v1.DestinationRule, err error) { + result = &v1.DestinationRule{} + err = c.client.Put(). + Resource("destinationrules"). + Name(destinationRule.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(destinationRule). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the destinationRule and deletes it. Returns an error if one occurs. +func (c *destinationRules) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("destinationrules"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *destinationRules) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("destinationrules"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched destinationRule. +func (c *destinationRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DestinationRule, err error) { + result = &v1.DestinationRule{} + err = c.client.Patch(pt). + Resource("destinationrules"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/directory.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/directory.go new file mode 100644 index 000000000..f226e7bd0 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/directory.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DirectoriesGetter has a method to return a DirectoryInterface. +// A group's client should implement this interface. +type DirectoriesGetter interface { + Directories() DirectoryInterface +} + +// DirectoryInterface has methods to work with Directory resources. +type DirectoryInterface interface { + Create(ctx context.Context, directory *v1.Directory, opts metav1.CreateOptions) (*v1.Directory, error) + Update(ctx context.Context, directory *v1.Directory, opts metav1.UpdateOptions) (*v1.Directory, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Directory, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DirectoryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Directory, err error) + DirectoryExpansion +} + +// directories implements DirectoryInterface +type directories struct { + client rest.Interface +} + +// newDirectories returns a Directories +func newDirectories(c *GlobalTsmV1Client) *directories { + return &directories{ + client: c.RESTClient(), + } +} + +// Get takes name of the directory, and returns the corresponding directory object, and an error if there is any. +func (c *directories) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Directory, err error) { + result = &v1.Directory{} + err = c.client.Get(). + Resource("directories"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Directories that match those selectors. +func (c *directories) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DirectoryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DirectoryList{} + err = c.client.Get(). + Resource("directories"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested directories. +func (c *directories) Watch(ctx context.Context, opts metav1.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(). + Resource("directories"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a directory and creates it. Returns the server's representation of the directory, and an error, if there is any. +func (c *directories) Create(ctx context.Context, directory *v1.Directory, opts metav1.CreateOptions) (result *v1.Directory, err error) { + result = &v1.Directory{} + err = c.client.Post(). + Resource("directories"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(directory). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a directory and updates it. Returns the server's representation of the directory, and an error, if there is any. +func (c *directories) Update(ctx context.Context, directory *v1.Directory, opts metav1.UpdateOptions) (result *v1.Directory, err error) { + result = &v1.Directory{} + err = c.client.Put(). + Resource("directories"). + Name(directory.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(directory). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the directory and deletes it. Returns an error if one occurs. +func (c *directories) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("directories"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *directories) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("directories"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched directory. +func (c *directories) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Directory, err error) { + result = &v1.Directory{} + err = c.client.Patch(pt). + Resource("directories"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dnsconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dnsconfig.go new file mode 100644 index 000000000..a2b3ef55c --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dnsconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DNSConfigsGetter has a method to return a DNSConfigInterface. +// A group's client should implement this interface. +type DNSConfigsGetter interface { + DNSConfigs() DNSConfigInterface +} + +// DNSConfigInterface has methods to work with DNSConfig resources. +type DNSConfigInterface interface { + Create(ctx context.Context, dNSConfig *v1.DNSConfig, opts metav1.CreateOptions) (*v1.DNSConfig, error) + Update(ctx context.Context, dNSConfig *v1.DNSConfig, opts metav1.UpdateOptions) (*v1.DNSConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DNSConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DNSConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DNSConfig, err error) + DNSConfigExpansion +} + +// dNSConfigs implements DNSConfigInterface +type dNSConfigs struct { + client rest.Interface +} + +// newDNSConfigs returns a DNSConfigs +func newDNSConfigs(c *GlobalTsmV1Client) *dNSConfigs { + return &dNSConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the dNSConfig, and returns the corresponding dNSConfig object, and an error if there is any. +func (c *dNSConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DNSConfig, err error) { + result = &v1.DNSConfig{} + err = c.client.Get(). + Resource("dnsconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DNSConfigs that match those selectors. +func (c *dNSConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DNSConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DNSConfigList{} + err = c.client.Get(). + Resource("dnsconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dNSConfigs. +func (c *dNSConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("dnsconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a dNSConfig and creates it. Returns the server's representation of the dNSConfig, and an error, if there is any. +func (c *dNSConfigs) Create(ctx context.Context, dNSConfig *v1.DNSConfig, opts metav1.CreateOptions) (result *v1.DNSConfig, err error) { + result = &v1.DNSConfig{} + err = c.client.Post(). + Resource("dnsconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dNSConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a dNSConfig and updates it. Returns the server's representation of the dNSConfig, and an error, if there is any. +func (c *dNSConfigs) Update(ctx context.Context, dNSConfig *v1.DNSConfig, opts metav1.UpdateOptions) (result *v1.DNSConfig, err error) { + result = &v1.DNSConfig{} + err = c.client.Put(). + Resource("dnsconfigs"). + Name(dNSConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dNSConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the dNSConfig and deletes it. Returns an error if one occurs. +func (c *dNSConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("dnsconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dNSConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("dnsconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched dNSConfig. +func (c *dNSConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DNSConfig, err error) { + result = &v1.DNSConfig{} + err = c.client.Patch(pt). + Resource("dnsconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dnsconfigfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dnsconfigfolder.go new file mode 100644 index 000000000..1e443812a --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dnsconfigfolder.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DNSConfigFoldersGetter has a method to return a DNSConfigFolderInterface. +// A group's client should implement this interface. +type DNSConfigFoldersGetter interface { + DNSConfigFolders() DNSConfigFolderInterface +} + +// DNSConfigFolderInterface has methods to work with DNSConfigFolder resources. +type DNSConfigFolderInterface interface { + Create(ctx context.Context, dNSConfigFolder *v1.DNSConfigFolder, opts metav1.CreateOptions) (*v1.DNSConfigFolder, error) + Update(ctx context.Context, dNSConfigFolder *v1.DNSConfigFolder, opts metav1.UpdateOptions) (*v1.DNSConfigFolder, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DNSConfigFolder, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DNSConfigFolderList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DNSConfigFolder, err error) + DNSConfigFolderExpansion +} + +// dNSConfigFolders implements DNSConfigFolderInterface +type dNSConfigFolders struct { + client rest.Interface +} + +// newDNSConfigFolders returns a DNSConfigFolders +func newDNSConfigFolders(c *GlobalTsmV1Client) *dNSConfigFolders { + return &dNSConfigFolders{ + client: c.RESTClient(), + } +} + +// Get takes name of the dNSConfigFolder, and returns the corresponding dNSConfigFolder object, and an error if there is any. +func (c *dNSConfigFolders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DNSConfigFolder, err error) { + result = &v1.DNSConfigFolder{} + err = c.client.Get(). + Resource("dnsconfigfolders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DNSConfigFolders that match those selectors. +func (c *dNSConfigFolders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DNSConfigFolderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DNSConfigFolderList{} + err = c.client.Get(). + Resource("dnsconfigfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dNSConfigFolders. +func (c *dNSConfigFolders) Watch(ctx context.Context, opts metav1.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(). + Resource("dnsconfigfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a dNSConfigFolder and creates it. Returns the server's representation of the dNSConfigFolder, and an error, if there is any. +func (c *dNSConfigFolders) Create(ctx context.Context, dNSConfigFolder *v1.DNSConfigFolder, opts metav1.CreateOptions) (result *v1.DNSConfigFolder, err error) { + result = &v1.DNSConfigFolder{} + err = c.client.Post(). + Resource("dnsconfigfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dNSConfigFolder). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a dNSConfigFolder and updates it. Returns the server's representation of the dNSConfigFolder, and an error, if there is any. +func (c *dNSConfigFolders) Update(ctx context.Context, dNSConfigFolder *v1.DNSConfigFolder, opts metav1.UpdateOptions) (result *v1.DNSConfigFolder, err error) { + result = &v1.DNSConfigFolder{} + err = c.client.Put(). + Resource("dnsconfigfolders"). + Name(dNSConfigFolder.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dNSConfigFolder). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the dNSConfigFolder and deletes it. Returns an error if one occurs. +func (c *dNSConfigFolders) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("dnsconfigfolders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dNSConfigFolders) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("dnsconfigfolders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched dNSConfigFolder. +func (c *dNSConfigFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DNSConfigFolder, err error) { + result = &v1.DNSConfigFolder{} + err = c.client.Patch(pt). + Resource("dnsconfigfolders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dnsprobeconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dnsprobeconfig.go new file mode 100644 index 000000000..30990796d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dnsprobeconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DNSProbeConfigsGetter has a method to return a DNSProbeConfigInterface. +// A group's client should implement this interface. +type DNSProbeConfigsGetter interface { + DNSProbeConfigs() DNSProbeConfigInterface +} + +// DNSProbeConfigInterface has methods to work with DNSProbeConfig resources. +type DNSProbeConfigInterface interface { + Create(ctx context.Context, dNSProbeConfig *v1.DNSProbeConfig, opts metav1.CreateOptions) (*v1.DNSProbeConfig, error) + Update(ctx context.Context, dNSProbeConfig *v1.DNSProbeConfig, opts metav1.UpdateOptions) (*v1.DNSProbeConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DNSProbeConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DNSProbeConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DNSProbeConfig, err error) + DNSProbeConfigExpansion +} + +// dNSProbeConfigs implements DNSProbeConfigInterface +type dNSProbeConfigs struct { + client rest.Interface +} + +// newDNSProbeConfigs returns a DNSProbeConfigs +func newDNSProbeConfigs(c *GlobalTsmV1Client) *dNSProbeConfigs { + return &dNSProbeConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the dNSProbeConfig, and returns the corresponding dNSProbeConfig object, and an error if there is any. +func (c *dNSProbeConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DNSProbeConfig, err error) { + result = &v1.DNSProbeConfig{} + err = c.client.Get(). + Resource("dnsprobeconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DNSProbeConfigs that match those selectors. +func (c *dNSProbeConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DNSProbeConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DNSProbeConfigList{} + err = c.client.Get(). + Resource("dnsprobeconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dNSProbeConfigs. +func (c *dNSProbeConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("dnsprobeconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a dNSProbeConfig and creates it. Returns the server's representation of the dNSProbeConfig, and an error, if there is any. +func (c *dNSProbeConfigs) Create(ctx context.Context, dNSProbeConfig *v1.DNSProbeConfig, opts metav1.CreateOptions) (result *v1.DNSProbeConfig, err error) { + result = &v1.DNSProbeConfig{} + err = c.client.Post(). + Resource("dnsprobeconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dNSProbeConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a dNSProbeConfig and updates it. Returns the server's representation of the dNSProbeConfig, and an error, if there is any. +func (c *dNSProbeConfigs) Update(ctx context.Context, dNSProbeConfig *v1.DNSProbeConfig, opts metav1.UpdateOptions) (result *v1.DNSProbeConfig, err error) { + result = &v1.DNSProbeConfig{} + err = c.client.Put(). + Resource("dnsprobeconfigs"). + Name(dNSProbeConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dNSProbeConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the dNSProbeConfig and deletes it. Returns an error if one occurs. +func (c *dNSProbeConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("dnsprobeconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dNSProbeConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("dnsprobeconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched dNSProbeConfig. +func (c *dNSProbeConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DNSProbeConfig, err error) { + result = &v1.DNSProbeConfig{} + err = c.client.Patch(pt). + Resource("dnsprobeconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dnsprobesconfigfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dnsprobesconfigfolder.go new file mode 100644 index 000000000..d69281c07 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dnsprobesconfigfolder.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DNSProbesConfigFoldersGetter has a method to return a DNSProbesConfigFolderInterface. +// A group's client should implement this interface. +type DNSProbesConfigFoldersGetter interface { + DNSProbesConfigFolders() DNSProbesConfigFolderInterface +} + +// DNSProbesConfigFolderInterface has methods to work with DNSProbesConfigFolder resources. +type DNSProbesConfigFolderInterface interface { + Create(ctx context.Context, dNSProbesConfigFolder *v1.DNSProbesConfigFolder, opts metav1.CreateOptions) (*v1.DNSProbesConfigFolder, error) + Update(ctx context.Context, dNSProbesConfigFolder *v1.DNSProbesConfigFolder, opts metav1.UpdateOptions) (*v1.DNSProbesConfigFolder, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DNSProbesConfigFolder, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DNSProbesConfigFolderList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DNSProbesConfigFolder, err error) + DNSProbesConfigFolderExpansion +} + +// dNSProbesConfigFolders implements DNSProbesConfigFolderInterface +type dNSProbesConfigFolders struct { + client rest.Interface +} + +// newDNSProbesConfigFolders returns a DNSProbesConfigFolders +func newDNSProbesConfigFolders(c *GlobalTsmV1Client) *dNSProbesConfigFolders { + return &dNSProbesConfigFolders{ + client: c.RESTClient(), + } +} + +// Get takes name of the dNSProbesConfigFolder, and returns the corresponding dNSProbesConfigFolder object, and an error if there is any. +func (c *dNSProbesConfigFolders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DNSProbesConfigFolder, err error) { + result = &v1.DNSProbesConfigFolder{} + err = c.client.Get(). + Resource("dnsprobesconfigfolders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DNSProbesConfigFolders that match those selectors. +func (c *dNSProbesConfigFolders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DNSProbesConfigFolderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DNSProbesConfigFolderList{} + err = c.client.Get(). + Resource("dnsprobesconfigfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dNSProbesConfigFolders. +func (c *dNSProbesConfigFolders) Watch(ctx context.Context, opts metav1.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(). + Resource("dnsprobesconfigfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a dNSProbesConfigFolder and creates it. Returns the server's representation of the dNSProbesConfigFolder, and an error, if there is any. +func (c *dNSProbesConfigFolders) Create(ctx context.Context, dNSProbesConfigFolder *v1.DNSProbesConfigFolder, opts metav1.CreateOptions) (result *v1.DNSProbesConfigFolder, err error) { + result = &v1.DNSProbesConfigFolder{} + err = c.client.Post(). + Resource("dnsprobesconfigfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dNSProbesConfigFolder). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a dNSProbesConfigFolder and updates it. Returns the server's representation of the dNSProbesConfigFolder, and an error, if there is any. +func (c *dNSProbesConfigFolders) Update(ctx context.Context, dNSProbesConfigFolder *v1.DNSProbesConfigFolder, opts metav1.UpdateOptions) (result *v1.DNSProbesConfigFolder, err error) { + result = &v1.DNSProbesConfigFolder{} + err = c.client.Put(). + Resource("dnsprobesconfigfolders"). + Name(dNSProbesConfigFolder.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dNSProbesConfigFolder). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the dNSProbesConfigFolder and deletes it. Returns an error if one occurs. +func (c *dNSProbesConfigFolders) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("dnsprobesconfigfolders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dNSProbesConfigFolders) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("dnsprobesconfigfolders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched dNSProbesConfigFolder. +func (c *dNSProbesConfigFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DNSProbesConfigFolder, err error) { + result = &v1.DNSProbesConfigFolder{} + err = c.client.Patch(pt). + Resource("dnsprobesconfigfolders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dnsprobestatus.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dnsprobestatus.go new file mode 100644 index 000000000..b498824ee --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/dnsprobestatus.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DNSProbeStatusesGetter has a method to return a DNSProbeStatusInterface. +// A group's client should implement this interface. +type DNSProbeStatusesGetter interface { + DNSProbeStatuses() DNSProbeStatusInterface +} + +// DNSProbeStatusInterface has methods to work with DNSProbeStatus resources. +type DNSProbeStatusInterface interface { + Create(ctx context.Context, dNSProbeStatus *v1.DNSProbeStatus, opts metav1.CreateOptions) (*v1.DNSProbeStatus, error) + Update(ctx context.Context, dNSProbeStatus *v1.DNSProbeStatus, opts metav1.UpdateOptions) (*v1.DNSProbeStatus, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DNSProbeStatus, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DNSProbeStatusList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DNSProbeStatus, err error) + DNSProbeStatusExpansion +} + +// dNSProbeStatuses implements DNSProbeStatusInterface +type dNSProbeStatuses struct { + client rest.Interface +} + +// newDNSProbeStatuses returns a DNSProbeStatuses +func newDNSProbeStatuses(c *GlobalTsmV1Client) *dNSProbeStatuses { + return &dNSProbeStatuses{ + client: c.RESTClient(), + } +} + +// Get takes name of the dNSProbeStatus, and returns the corresponding dNSProbeStatus object, and an error if there is any. +func (c *dNSProbeStatuses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DNSProbeStatus, err error) { + result = &v1.DNSProbeStatus{} + err = c.client.Get(). + Resource("dnsprobestatuses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DNSProbeStatuses that match those selectors. +func (c *dNSProbeStatuses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DNSProbeStatusList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DNSProbeStatusList{} + err = c.client.Get(). + Resource("dnsprobestatuses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dNSProbeStatuses. +func (c *dNSProbeStatuses) Watch(ctx context.Context, opts metav1.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(). + Resource("dnsprobestatuses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a dNSProbeStatus and creates it. Returns the server's representation of the dNSProbeStatus, and an error, if there is any. +func (c *dNSProbeStatuses) Create(ctx context.Context, dNSProbeStatus *v1.DNSProbeStatus, opts metav1.CreateOptions) (result *v1.DNSProbeStatus, err error) { + result = &v1.DNSProbeStatus{} + err = c.client.Post(). + Resource("dnsprobestatuses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dNSProbeStatus). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a dNSProbeStatus and updates it. Returns the server's representation of the dNSProbeStatus, and an error, if there is any. +func (c *dNSProbeStatuses) Update(ctx context.Context, dNSProbeStatus *v1.DNSProbeStatus, opts metav1.UpdateOptions) (result *v1.DNSProbeStatus, err error) { + result = &v1.DNSProbeStatus{} + err = c.client.Put(). + Resource("dnsprobestatuses"). + Name(dNSProbeStatus.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dNSProbeStatus). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the dNSProbeStatus and deletes it. Returns an error if one occurs. +func (c *dNSProbeStatuses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("dnsprobestatuses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dNSProbeStatuses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("dnsprobestatuses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched dNSProbeStatus. +func (c *dNSProbeStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DNSProbeStatus, err error) { + result = &v1.DNSProbeStatus{} + err = c.client.Patch(pt). + Resource("dnsprobestatuses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/doc.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/doc.go similarity index 100% rename from compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/doc.go rename to compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/doc.go diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/domain.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/domain.go new file mode 100644 index 000000000..233069fc4 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/domain.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DomainsGetter has a method to return a DomainInterface. +// A group's client should implement this interface. +type DomainsGetter interface { + Domains() DomainInterface +} + +// DomainInterface has methods to work with Domain resources. +type DomainInterface interface { + Create(ctx context.Context, domain *v1.Domain, opts metav1.CreateOptions) (*v1.Domain, error) + Update(ctx context.Context, domain *v1.Domain, opts metav1.UpdateOptions) (*v1.Domain, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Domain, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DomainList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Domain, err error) + DomainExpansion +} + +// domains implements DomainInterface +type domains struct { + client rest.Interface +} + +// newDomains returns a Domains +func newDomains(c *GlobalTsmV1Client) *domains { + return &domains{ + client: c.RESTClient(), + } +} + +// Get takes name of the domain, and returns the corresponding domain object, and an error if there is any. +func (c *domains) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Domain, err error) { + result = &v1.Domain{} + err = c.client.Get(). + Resource("domains"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Domains that match those selectors. +func (c *domains) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DomainList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DomainList{} + err = c.client.Get(). + Resource("domains"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested domains. +func (c *domains) Watch(ctx context.Context, opts metav1.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(). + Resource("domains"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a domain and creates it. Returns the server's representation of the domain, and an error, if there is any. +func (c *domains) Create(ctx context.Context, domain *v1.Domain, opts metav1.CreateOptions) (result *v1.Domain, err error) { + result = &v1.Domain{} + err = c.client.Post(). + Resource("domains"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(domain). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a domain and updates it. Returns the server's representation of the domain, and an error, if there is any. +func (c *domains) Update(ctx context.Context, domain *v1.Domain, opts metav1.UpdateOptions) (result *v1.Domain, err error) { + result = &v1.Domain{} + err = c.client.Put(). + Resource("domains"). + Name(domain.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(domain). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the domain and deletes it. Returns an error if one occurs. +func (c *domains) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("domains"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *domains) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("domains"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched domain. +func (c *domains) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Domain, err error) { + result = &v1.Domain{} + err = c.client.Patch(pt). + Resource("domains"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/domainconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/domainconfig.go new file mode 100644 index 000000000..0d70ee137 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/domainconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// DomainConfigsGetter has a method to return a DomainConfigInterface. +// A group's client should implement this interface. +type DomainConfigsGetter interface { + DomainConfigs() DomainConfigInterface +} + +// DomainConfigInterface has methods to work with DomainConfig resources. +type DomainConfigInterface interface { + Create(ctx context.Context, domainConfig *v1.DomainConfig, opts metav1.CreateOptions) (*v1.DomainConfig, error) + Update(ctx context.Context, domainConfig *v1.DomainConfig, opts metav1.UpdateOptions) (*v1.DomainConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DomainConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DomainConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DomainConfig, err error) + DomainConfigExpansion +} + +// domainConfigs implements DomainConfigInterface +type domainConfigs struct { + client rest.Interface +} + +// newDomainConfigs returns a DomainConfigs +func newDomainConfigs(c *GlobalTsmV1Client) *domainConfigs { + return &domainConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the domainConfig, and returns the corresponding domainConfig object, and an error if there is any. +func (c *domainConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DomainConfig, err error) { + result = &v1.DomainConfig{} + err = c.client.Get(). + Resource("domainconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DomainConfigs that match those selectors. +func (c *domainConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DomainConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DomainConfigList{} + err = c.client.Get(). + Resource("domainconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested domainConfigs. +func (c *domainConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("domainconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a domainConfig and creates it. Returns the server's representation of the domainConfig, and an error, if there is any. +func (c *domainConfigs) Create(ctx context.Context, domainConfig *v1.DomainConfig, opts metav1.CreateOptions) (result *v1.DomainConfig, err error) { + result = &v1.DomainConfig{} + err = c.client.Post(). + Resource("domainconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(domainConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a domainConfig and updates it. Returns the server's representation of the domainConfig, and an error, if there is any. +func (c *domainConfigs) Update(ctx context.Context, domainConfig *v1.DomainConfig, opts metav1.UpdateOptions) (result *v1.DomainConfig, err error) { + result = &v1.DomainConfig{} + err = c.client.Put(). + Resource("domainconfigs"). + Name(domainConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(domainConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the domainConfig and deletes it. Returns an error if one occurs. +func (c *domainConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("domainconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *domainConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("domainconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched domainConfig. +func (c *domainConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DomainConfig, err error) { + result = &v1.DomainConfig{} + err = c.client.Patch(pt). + Resource("domainconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/endpoints.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/endpoints.go new file mode 100644 index 000000000..66efbaed6 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/endpoints.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// EndpointsGetter has a method to return a EndpointsInterface. +// A group's client should implement this interface. +type EndpointsGetter interface { + Endpoints() EndpointsInterface +} + +// EndpointsInterface has methods to work with Endpoints resources. +type EndpointsInterface interface { + Create(ctx context.Context, endpoints *v1.Endpoints, opts metav1.CreateOptions) (*v1.Endpoints, error) + Update(ctx context.Context, endpoints *v1.Endpoints, opts metav1.UpdateOptions) (*v1.Endpoints, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Endpoints, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointsList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Endpoints, err error) + EndpointsExpansion +} + +// endpoints implements EndpointsInterface +type endpoints struct { + client rest.Interface +} + +// newEndpoints returns a Endpoints +func newEndpoints(c *GlobalTsmV1Client) *endpoints { + return &endpoints{ + client: c.RESTClient(), + } +} + +// Get takes name of the endpoints, and returns the corresponding endpoints object, and an error if there is any. +func (c *endpoints) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Endpoints, err error) { + result = &v1.Endpoints{} + err = c.client.Get(). + Resource("endpoints"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Endpoints that match those selectors. +func (c *endpoints) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointsList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.EndpointsList{} + err = c.client.Get(). + Resource("endpoints"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested endpoints. +func (c *endpoints) Watch(ctx context.Context, opts metav1.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(). + Resource("endpoints"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a endpoints and creates it. Returns the server's representation of the endpoints, and an error, if there is any. +func (c *endpoints) Create(ctx context.Context, endpoints *v1.Endpoints, opts metav1.CreateOptions) (result *v1.Endpoints, err error) { + result = &v1.Endpoints{} + err = c.client.Post(). + Resource("endpoints"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(endpoints). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a endpoints and updates it. Returns the server's representation of the endpoints, and an error, if there is any. +func (c *endpoints) Update(ctx context.Context, endpoints *v1.Endpoints, opts metav1.UpdateOptions) (result *v1.Endpoints, err error) { + result = &v1.Endpoints{} + err = c.client.Put(). + Resource("endpoints"). + Name(endpoints.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(endpoints). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the endpoints and deletes it. Returns an error if one occurs. +func (c *endpoints) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("endpoints"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *endpoints) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("endpoints"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched endpoints. +func (c *endpoints) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Endpoints, err error) { + result = &v1.Endpoints{} + err = c.client.Patch(pt). + Resource("endpoints"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/envoyfilter.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/envoyfilter.go new file mode 100644 index 000000000..0b3d3c677 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/envoyfilter.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// EnvoyFiltersGetter has a method to return a EnvoyFilterInterface. +// A group's client should implement this interface. +type EnvoyFiltersGetter interface { + EnvoyFilters() EnvoyFilterInterface +} + +// EnvoyFilterInterface has methods to work with EnvoyFilter resources. +type EnvoyFilterInterface interface { + Create(ctx context.Context, envoyFilter *v1.EnvoyFilter, opts metav1.CreateOptions) (*v1.EnvoyFilter, error) + Update(ctx context.Context, envoyFilter *v1.EnvoyFilter, opts metav1.UpdateOptions) (*v1.EnvoyFilter, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.EnvoyFilter, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.EnvoyFilterList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EnvoyFilter, err error) + EnvoyFilterExpansion +} + +// envoyFilters implements EnvoyFilterInterface +type envoyFilters struct { + client rest.Interface +} + +// newEnvoyFilters returns a EnvoyFilters +func newEnvoyFilters(c *GlobalTsmV1Client) *envoyFilters { + return &envoyFilters{ + client: c.RESTClient(), + } +} + +// Get takes name of the envoyFilter, and returns the corresponding envoyFilter object, and an error if there is any. +func (c *envoyFilters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.EnvoyFilter, err error) { + result = &v1.EnvoyFilter{} + err = c.client.Get(). + Resource("envoyfilters"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of EnvoyFilters that match those selectors. +func (c *envoyFilters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EnvoyFilterList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.EnvoyFilterList{} + err = c.client.Get(). + Resource("envoyfilters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested envoyFilters. +func (c *envoyFilters) Watch(ctx context.Context, opts metav1.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(). + Resource("envoyfilters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a envoyFilter and creates it. Returns the server's representation of the envoyFilter, and an error, if there is any. +func (c *envoyFilters) Create(ctx context.Context, envoyFilter *v1.EnvoyFilter, opts metav1.CreateOptions) (result *v1.EnvoyFilter, err error) { + result = &v1.EnvoyFilter{} + err = c.client.Post(). + Resource("envoyfilters"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(envoyFilter). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a envoyFilter and updates it. Returns the server's representation of the envoyFilter, and an error, if there is any. +func (c *envoyFilters) Update(ctx context.Context, envoyFilter *v1.EnvoyFilter, opts metav1.UpdateOptions) (result *v1.EnvoyFilter, err error) { + result = &v1.EnvoyFilter{} + err = c.client.Put(). + Resource("envoyfilters"). + Name(envoyFilter.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(envoyFilter). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the envoyFilter and deletes it. Returns an error if one occurs. +func (c *envoyFilters) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("envoyfilters"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *envoyFilters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("envoyfilters"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched envoyFilter. +func (c *envoyFilters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EnvoyFilter, err error) { + result = &v1.EnvoyFilter{} + err = c.client.Patch(pt). + Resource("envoyfilters"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalaccountconfign.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalaccountconfign.go new file mode 100644 index 000000000..aafd85021 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalaccountconfign.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalAccountConfigNsGetter has a method to return a ExternalAccountConfigNInterface. +// A group's client should implement this interface. +type ExternalAccountConfigNsGetter interface { + ExternalAccountConfigNs() ExternalAccountConfigNInterface +} + +// ExternalAccountConfigNInterface has methods to work with ExternalAccountConfigN resources. +type ExternalAccountConfigNInterface interface { + Create(ctx context.Context, externalAccountConfigN *v1.ExternalAccountConfigN, opts metav1.CreateOptions) (*v1.ExternalAccountConfigN, error) + Update(ctx context.Context, externalAccountConfigN *v1.ExternalAccountConfigN, opts metav1.UpdateOptions) (*v1.ExternalAccountConfigN, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalAccountConfigN, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalAccountConfigNList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalAccountConfigN, err error) + ExternalAccountConfigNExpansion +} + +// externalAccountConfigNs implements ExternalAccountConfigNInterface +type externalAccountConfigNs struct { + client rest.Interface +} + +// newExternalAccountConfigNs returns a ExternalAccountConfigNs +func newExternalAccountConfigNs(c *GlobalTsmV1Client) *externalAccountConfigNs { + return &externalAccountConfigNs{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalAccountConfigN, and returns the corresponding externalAccountConfigN object, and an error if there is any. +func (c *externalAccountConfigNs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalAccountConfigN, err error) { + result = &v1.ExternalAccountConfigN{} + err = c.client.Get(). + Resource("externalaccountconfigns"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalAccountConfigNs that match those selectors. +func (c *externalAccountConfigNs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalAccountConfigNList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalAccountConfigNList{} + err = c.client.Get(). + Resource("externalaccountconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalAccountConfigNs. +func (c *externalAccountConfigNs) Watch(ctx context.Context, opts metav1.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(). + Resource("externalaccountconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalAccountConfigN and creates it. Returns the server's representation of the externalAccountConfigN, and an error, if there is any. +func (c *externalAccountConfigNs) Create(ctx context.Context, externalAccountConfigN *v1.ExternalAccountConfigN, opts metav1.CreateOptions) (result *v1.ExternalAccountConfigN, err error) { + result = &v1.ExternalAccountConfigN{} + err = c.client.Post(). + Resource("externalaccountconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalAccountConfigN). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalAccountConfigN and updates it. Returns the server's representation of the externalAccountConfigN, and an error, if there is any. +func (c *externalAccountConfigNs) Update(ctx context.Context, externalAccountConfigN *v1.ExternalAccountConfigN, opts metav1.UpdateOptions) (result *v1.ExternalAccountConfigN, err error) { + result = &v1.ExternalAccountConfigN{} + err = c.client.Put(). + Resource("externalaccountconfigns"). + Name(externalAccountConfigN.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalAccountConfigN). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalAccountConfigN and deletes it. Returns an error if one occurs. +func (c *externalAccountConfigNs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externalaccountconfigns"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalAccountConfigNs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externalaccountconfigns"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalAccountConfigN. +func (c *externalAccountConfigNs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalAccountConfigN, err error) { + result = &v1.ExternalAccountConfigN{} + err = c.client.Patch(pt). + Resource("externalaccountconfigns"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalauditstorage.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalauditstorage.go new file mode 100644 index 000000000..a1373c52b --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalauditstorage.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalAuditStoragesGetter has a method to return a ExternalAuditStorageInterface. +// A group's client should implement this interface. +type ExternalAuditStoragesGetter interface { + ExternalAuditStorages() ExternalAuditStorageInterface +} + +// ExternalAuditStorageInterface has methods to work with ExternalAuditStorage resources. +type ExternalAuditStorageInterface interface { + Create(ctx context.Context, externalAuditStorage *v1.ExternalAuditStorage, opts metav1.CreateOptions) (*v1.ExternalAuditStorage, error) + Update(ctx context.Context, externalAuditStorage *v1.ExternalAuditStorage, opts metav1.UpdateOptions) (*v1.ExternalAuditStorage, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalAuditStorage, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalAuditStorageList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalAuditStorage, err error) + ExternalAuditStorageExpansion +} + +// externalAuditStorages implements ExternalAuditStorageInterface +type externalAuditStorages struct { + client rest.Interface +} + +// newExternalAuditStorages returns a ExternalAuditStorages +func newExternalAuditStorages(c *GlobalTsmV1Client) *externalAuditStorages { + return &externalAuditStorages{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalAuditStorage, and returns the corresponding externalAuditStorage object, and an error if there is any. +func (c *externalAuditStorages) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalAuditStorage, err error) { + result = &v1.ExternalAuditStorage{} + err = c.client.Get(). + Resource("externalauditstorages"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalAuditStorages that match those selectors. +func (c *externalAuditStorages) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalAuditStorageList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalAuditStorageList{} + err = c.client.Get(). + Resource("externalauditstorages"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalAuditStorages. +func (c *externalAuditStorages) Watch(ctx context.Context, opts metav1.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(). + Resource("externalauditstorages"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalAuditStorage and creates it. Returns the server's representation of the externalAuditStorage, and an error, if there is any. +func (c *externalAuditStorages) Create(ctx context.Context, externalAuditStorage *v1.ExternalAuditStorage, opts metav1.CreateOptions) (result *v1.ExternalAuditStorage, err error) { + result = &v1.ExternalAuditStorage{} + err = c.client.Post(). + Resource("externalauditstorages"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalAuditStorage). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalAuditStorage and updates it. Returns the server's representation of the externalAuditStorage, and an error, if there is any. +func (c *externalAuditStorages) Update(ctx context.Context, externalAuditStorage *v1.ExternalAuditStorage, opts metav1.UpdateOptions) (result *v1.ExternalAuditStorage, err error) { + result = &v1.ExternalAuditStorage{} + err = c.client.Put(). + Resource("externalauditstorages"). + Name(externalAuditStorage.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalAuditStorage). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalAuditStorage and deletes it. Returns an error if one occurs. +func (c *externalAuditStorages) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externalauditstorages"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalAuditStorages) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externalauditstorages"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalAuditStorage. +func (c *externalAuditStorages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalAuditStorage, err error) { + result = &v1.ExternalAuditStorage{} + err = c.client.Patch(pt). + Resource("externalauditstorages"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsconfign.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsconfign.go new file mode 100644 index 000000000..1969c004f --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsconfign.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalDNSConfigNsGetter has a method to return a ExternalDNSConfigNInterface. +// A group's client should implement this interface. +type ExternalDNSConfigNsGetter interface { + ExternalDNSConfigNs() ExternalDNSConfigNInterface +} + +// ExternalDNSConfigNInterface has methods to work with ExternalDNSConfigN resources. +type ExternalDNSConfigNInterface interface { + Create(ctx context.Context, externalDNSConfigN *v1.ExternalDNSConfigN, opts metav1.CreateOptions) (*v1.ExternalDNSConfigN, error) + Update(ctx context.Context, externalDNSConfigN *v1.ExternalDNSConfigN, opts metav1.UpdateOptions) (*v1.ExternalDNSConfigN, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalDNSConfigN, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalDNSConfigNList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSConfigN, err error) + ExternalDNSConfigNExpansion +} + +// externalDNSConfigNs implements ExternalDNSConfigNInterface +type externalDNSConfigNs struct { + client rest.Interface +} + +// newExternalDNSConfigNs returns a ExternalDNSConfigNs +func newExternalDNSConfigNs(c *GlobalTsmV1Client) *externalDNSConfigNs { + return &externalDNSConfigNs{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalDNSConfigN, and returns the corresponding externalDNSConfigN object, and an error if there is any. +func (c *externalDNSConfigNs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalDNSConfigN, err error) { + result = &v1.ExternalDNSConfigN{} + err = c.client.Get(). + Resource("externaldnsconfigns"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalDNSConfigNs that match those selectors. +func (c *externalDNSConfigNs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalDNSConfigNList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalDNSConfigNList{} + err = c.client.Get(). + Resource("externaldnsconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalDNSConfigNs. +func (c *externalDNSConfigNs) Watch(ctx context.Context, opts metav1.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(). + Resource("externaldnsconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalDNSConfigN and creates it. Returns the server's representation of the externalDNSConfigN, and an error, if there is any. +func (c *externalDNSConfigNs) Create(ctx context.Context, externalDNSConfigN *v1.ExternalDNSConfigN, opts metav1.CreateOptions) (result *v1.ExternalDNSConfigN, err error) { + result = &v1.ExternalDNSConfigN{} + err = c.client.Post(). + Resource("externaldnsconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSConfigN). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalDNSConfigN and updates it. Returns the server's representation of the externalDNSConfigN, and an error, if there is any. +func (c *externalDNSConfigNs) Update(ctx context.Context, externalDNSConfigN *v1.ExternalDNSConfigN, opts metav1.UpdateOptions) (result *v1.ExternalDNSConfigN, err error) { + result = &v1.ExternalDNSConfigN{} + err = c.client.Put(). + Resource("externaldnsconfigns"). + Name(externalDNSConfigN.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSConfigN). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalDNSConfigN and deletes it. Returns an error if one occurs. +func (c *externalDNSConfigNs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externaldnsconfigns"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalDNSConfigNs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externaldnsconfigns"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalDNSConfigN. +func (c *externalDNSConfigNs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSConfigN, err error) { + result = &v1.ExternalDNSConfigN{} + err = c.client.Patch(pt). + Resource("externaldnsconfigns"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsinventory.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsinventory.go new file mode 100644 index 000000000..ff3fbc4a4 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsinventory.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalDNSInventoriesGetter has a method to return a ExternalDNSInventoryInterface. +// A group's client should implement this interface. +type ExternalDNSInventoriesGetter interface { + ExternalDNSInventories() ExternalDNSInventoryInterface +} + +// ExternalDNSInventoryInterface has methods to work with ExternalDNSInventory resources. +type ExternalDNSInventoryInterface interface { + Create(ctx context.Context, externalDNSInventory *v1.ExternalDNSInventory, opts metav1.CreateOptions) (*v1.ExternalDNSInventory, error) + Update(ctx context.Context, externalDNSInventory *v1.ExternalDNSInventory, opts metav1.UpdateOptions) (*v1.ExternalDNSInventory, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalDNSInventory, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalDNSInventoryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSInventory, err error) + ExternalDNSInventoryExpansion +} + +// externalDNSInventories implements ExternalDNSInventoryInterface +type externalDNSInventories struct { + client rest.Interface +} + +// newExternalDNSInventories returns a ExternalDNSInventories +func newExternalDNSInventories(c *GlobalTsmV1Client) *externalDNSInventories { + return &externalDNSInventories{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalDNSInventory, and returns the corresponding externalDNSInventory object, and an error if there is any. +func (c *externalDNSInventories) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalDNSInventory, err error) { + result = &v1.ExternalDNSInventory{} + err = c.client.Get(). + Resource("externaldnsinventories"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalDNSInventories that match those selectors. +func (c *externalDNSInventories) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalDNSInventoryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalDNSInventoryList{} + err = c.client.Get(). + Resource("externaldnsinventories"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalDNSInventories. +func (c *externalDNSInventories) Watch(ctx context.Context, opts metav1.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(). + Resource("externaldnsinventories"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalDNSInventory and creates it. Returns the server's representation of the externalDNSInventory, and an error, if there is any. +func (c *externalDNSInventories) Create(ctx context.Context, externalDNSInventory *v1.ExternalDNSInventory, opts metav1.CreateOptions) (result *v1.ExternalDNSInventory, err error) { + result = &v1.ExternalDNSInventory{} + err = c.client.Post(). + Resource("externaldnsinventories"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSInventory). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalDNSInventory and updates it. Returns the server's representation of the externalDNSInventory, and an error, if there is any. +func (c *externalDNSInventories) Update(ctx context.Context, externalDNSInventory *v1.ExternalDNSInventory, opts metav1.UpdateOptions) (result *v1.ExternalDNSInventory, err error) { + result = &v1.ExternalDNSInventory{} + err = c.client.Put(). + Resource("externaldnsinventories"). + Name(externalDNSInventory.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSInventory). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalDNSInventory and deletes it. Returns an error if one occurs. +func (c *externalDNSInventories) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externaldnsinventories"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalDNSInventories) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externaldnsinventories"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalDNSInventory. +func (c *externalDNSInventories) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSInventory, err error) { + result = &v1.ExternalDNSInventory{} + err = c.client.Patch(pt). + Resource("externaldnsinventories"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryhealthcheck.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryhealthcheck.go new file mode 100644 index 000000000..e8eb93060 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryhealthcheck.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalDNSInventoryHealthChecksGetter has a method to return a ExternalDNSInventoryHealthCheckInterface. +// A group's client should implement this interface. +type ExternalDNSInventoryHealthChecksGetter interface { + ExternalDNSInventoryHealthChecks() ExternalDNSInventoryHealthCheckInterface +} + +// ExternalDNSInventoryHealthCheckInterface has methods to work with ExternalDNSInventoryHealthCheck resources. +type ExternalDNSInventoryHealthCheckInterface interface { + Create(ctx context.Context, externalDNSInventoryHealthCheck *v1.ExternalDNSInventoryHealthCheck, opts metav1.CreateOptions) (*v1.ExternalDNSInventoryHealthCheck, error) + Update(ctx context.Context, externalDNSInventoryHealthCheck *v1.ExternalDNSInventoryHealthCheck, opts metav1.UpdateOptions) (*v1.ExternalDNSInventoryHealthCheck, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalDNSInventoryHealthCheck, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalDNSInventoryHealthCheckList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSInventoryHealthCheck, err error) + ExternalDNSInventoryHealthCheckExpansion +} + +// externalDNSInventoryHealthChecks implements ExternalDNSInventoryHealthCheckInterface +type externalDNSInventoryHealthChecks struct { + client rest.Interface +} + +// newExternalDNSInventoryHealthChecks returns a ExternalDNSInventoryHealthChecks +func newExternalDNSInventoryHealthChecks(c *GlobalTsmV1Client) *externalDNSInventoryHealthChecks { + return &externalDNSInventoryHealthChecks{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalDNSInventoryHealthCheck, and returns the corresponding externalDNSInventoryHealthCheck object, and an error if there is any. +func (c *externalDNSInventoryHealthChecks) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalDNSInventoryHealthCheck, err error) { + result = &v1.ExternalDNSInventoryHealthCheck{} + err = c.client.Get(). + Resource("externaldnsinventoryhealthchecks"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalDNSInventoryHealthChecks that match those selectors. +func (c *externalDNSInventoryHealthChecks) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalDNSInventoryHealthCheckList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalDNSInventoryHealthCheckList{} + err = c.client.Get(). + Resource("externaldnsinventoryhealthchecks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalDNSInventoryHealthChecks. +func (c *externalDNSInventoryHealthChecks) Watch(ctx context.Context, opts metav1.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(). + Resource("externaldnsinventoryhealthchecks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalDNSInventoryHealthCheck and creates it. Returns the server's representation of the externalDNSInventoryHealthCheck, and an error, if there is any. +func (c *externalDNSInventoryHealthChecks) Create(ctx context.Context, externalDNSInventoryHealthCheck *v1.ExternalDNSInventoryHealthCheck, opts metav1.CreateOptions) (result *v1.ExternalDNSInventoryHealthCheck, err error) { + result = &v1.ExternalDNSInventoryHealthCheck{} + err = c.client.Post(). + Resource("externaldnsinventoryhealthchecks"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSInventoryHealthCheck). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalDNSInventoryHealthCheck and updates it. Returns the server's representation of the externalDNSInventoryHealthCheck, and an error, if there is any. +func (c *externalDNSInventoryHealthChecks) Update(ctx context.Context, externalDNSInventoryHealthCheck *v1.ExternalDNSInventoryHealthCheck, opts metav1.UpdateOptions) (result *v1.ExternalDNSInventoryHealthCheck, err error) { + result = &v1.ExternalDNSInventoryHealthCheck{} + err = c.client.Put(). + Resource("externaldnsinventoryhealthchecks"). + Name(externalDNSInventoryHealthCheck.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSInventoryHealthCheck). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalDNSInventoryHealthCheck and deletes it. Returns an error if one occurs. +func (c *externalDNSInventoryHealthChecks) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externaldnsinventoryhealthchecks"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalDNSInventoryHealthChecks) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externaldnsinventoryhealthchecks"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalDNSInventoryHealthCheck. +func (c *externalDNSInventoryHealthChecks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSInventoryHealthCheck, err error) { + result = &v1.ExternalDNSInventoryHealthCheck{} + err = c.client.Patch(pt). + Resource("externaldnsinventoryhealthchecks"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryprimarydomain.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryprimarydomain.go new file mode 100644 index 000000000..44320fc64 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryprimarydomain.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalDNSInventoryPrimaryDomainsGetter has a method to return a ExternalDNSInventoryPrimaryDomainInterface. +// A group's client should implement this interface. +type ExternalDNSInventoryPrimaryDomainsGetter interface { + ExternalDNSInventoryPrimaryDomains() ExternalDNSInventoryPrimaryDomainInterface +} + +// ExternalDNSInventoryPrimaryDomainInterface has methods to work with ExternalDNSInventoryPrimaryDomain resources. +type ExternalDNSInventoryPrimaryDomainInterface interface { + Create(ctx context.Context, externalDNSInventoryPrimaryDomain *v1.ExternalDNSInventoryPrimaryDomain, opts metav1.CreateOptions) (*v1.ExternalDNSInventoryPrimaryDomain, error) + Update(ctx context.Context, externalDNSInventoryPrimaryDomain *v1.ExternalDNSInventoryPrimaryDomain, opts metav1.UpdateOptions) (*v1.ExternalDNSInventoryPrimaryDomain, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalDNSInventoryPrimaryDomain, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalDNSInventoryPrimaryDomainList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSInventoryPrimaryDomain, err error) + ExternalDNSInventoryPrimaryDomainExpansion +} + +// externalDNSInventoryPrimaryDomains implements ExternalDNSInventoryPrimaryDomainInterface +type externalDNSInventoryPrimaryDomains struct { + client rest.Interface +} + +// newExternalDNSInventoryPrimaryDomains returns a ExternalDNSInventoryPrimaryDomains +func newExternalDNSInventoryPrimaryDomains(c *GlobalTsmV1Client) *externalDNSInventoryPrimaryDomains { + return &externalDNSInventoryPrimaryDomains{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalDNSInventoryPrimaryDomain, and returns the corresponding externalDNSInventoryPrimaryDomain object, and an error if there is any. +func (c *externalDNSInventoryPrimaryDomains) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalDNSInventoryPrimaryDomain, err error) { + result = &v1.ExternalDNSInventoryPrimaryDomain{} + err = c.client.Get(). + Resource("externaldnsinventoryprimarydomains"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalDNSInventoryPrimaryDomains that match those selectors. +func (c *externalDNSInventoryPrimaryDomains) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalDNSInventoryPrimaryDomainList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalDNSInventoryPrimaryDomainList{} + err = c.client.Get(). + Resource("externaldnsinventoryprimarydomains"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalDNSInventoryPrimaryDomains. +func (c *externalDNSInventoryPrimaryDomains) Watch(ctx context.Context, opts metav1.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(). + Resource("externaldnsinventoryprimarydomains"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalDNSInventoryPrimaryDomain and creates it. Returns the server's representation of the externalDNSInventoryPrimaryDomain, and an error, if there is any. +func (c *externalDNSInventoryPrimaryDomains) Create(ctx context.Context, externalDNSInventoryPrimaryDomain *v1.ExternalDNSInventoryPrimaryDomain, opts metav1.CreateOptions) (result *v1.ExternalDNSInventoryPrimaryDomain, err error) { + result = &v1.ExternalDNSInventoryPrimaryDomain{} + err = c.client.Post(). + Resource("externaldnsinventoryprimarydomains"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSInventoryPrimaryDomain). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalDNSInventoryPrimaryDomain and updates it. Returns the server's representation of the externalDNSInventoryPrimaryDomain, and an error, if there is any. +func (c *externalDNSInventoryPrimaryDomains) Update(ctx context.Context, externalDNSInventoryPrimaryDomain *v1.ExternalDNSInventoryPrimaryDomain, opts metav1.UpdateOptions) (result *v1.ExternalDNSInventoryPrimaryDomain, err error) { + result = &v1.ExternalDNSInventoryPrimaryDomain{} + err = c.client.Put(). + Resource("externaldnsinventoryprimarydomains"). + Name(externalDNSInventoryPrimaryDomain.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSInventoryPrimaryDomain). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalDNSInventoryPrimaryDomain and deletes it. Returns an error if one occurs. +func (c *externalDNSInventoryPrimaryDomains) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externaldnsinventoryprimarydomains"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalDNSInventoryPrimaryDomains) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externaldnsinventoryprimarydomains"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalDNSInventoryPrimaryDomain. +func (c *externalDNSInventoryPrimaryDomains) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSInventoryPrimaryDomain, err error) { + result = &v1.ExternalDNSInventoryPrimaryDomain{} + err = c.client.Patch(pt). + Resource("externaldnsinventoryprimarydomains"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryrecord.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryrecord.go new file mode 100644 index 000000000..929155598 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryrecord.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalDNSInventoryRecordsGetter has a method to return a ExternalDNSInventoryRecordInterface. +// A group's client should implement this interface. +type ExternalDNSInventoryRecordsGetter interface { + ExternalDNSInventoryRecords() ExternalDNSInventoryRecordInterface +} + +// ExternalDNSInventoryRecordInterface has methods to work with ExternalDNSInventoryRecord resources. +type ExternalDNSInventoryRecordInterface interface { + Create(ctx context.Context, externalDNSInventoryRecord *v1.ExternalDNSInventoryRecord, opts metav1.CreateOptions) (*v1.ExternalDNSInventoryRecord, error) + Update(ctx context.Context, externalDNSInventoryRecord *v1.ExternalDNSInventoryRecord, opts metav1.UpdateOptions) (*v1.ExternalDNSInventoryRecord, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalDNSInventoryRecord, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalDNSInventoryRecordList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSInventoryRecord, err error) + ExternalDNSInventoryRecordExpansion +} + +// externalDNSInventoryRecords implements ExternalDNSInventoryRecordInterface +type externalDNSInventoryRecords struct { + client rest.Interface +} + +// newExternalDNSInventoryRecords returns a ExternalDNSInventoryRecords +func newExternalDNSInventoryRecords(c *GlobalTsmV1Client) *externalDNSInventoryRecords { + return &externalDNSInventoryRecords{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalDNSInventoryRecord, and returns the corresponding externalDNSInventoryRecord object, and an error if there is any. +func (c *externalDNSInventoryRecords) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalDNSInventoryRecord, err error) { + result = &v1.ExternalDNSInventoryRecord{} + err = c.client.Get(). + Resource("externaldnsinventoryrecords"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalDNSInventoryRecords that match those selectors. +func (c *externalDNSInventoryRecords) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalDNSInventoryRecordList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalDNSInventoryRecordList{} + err = c.client.Get(). + Resource("externaldnsinventoryrecords"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalDNSInventoryRecords. +func (c *externalDNSInventoryRecords) Watch(ctx context.Context, opts metav1.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(). + Resource("externaldnsinventoryrecords"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalDNSInventoryRecord and creates it. Returns the server's representation of the externalDNSInventoryRecord, and an error, if there is any. +func (c *externalDNSInventoryRecords) Create(ctx context.Context, externalDNSInventoryRecord *v1.ExternalDNSInventoryRecord, opts metav1.CreateOptions) (result *v1.ExternalDNSInventoryRecord, err error) { + result = &v1.ExternalDNSInventoryRecord{} + err = c.client.Post(). + Resource("externaldnsinventoryrecords"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSInventoryRecord). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalDNSInventoryRecord and updates it. Returns the server's representation of the externalDNSInventoryRecord, and an error, if there is any. +func (c *externalDNSInventoryRecords) Update(ctx context.Context, externalDNSInventoryRecord *v1.ExternalDNSInventoryRecord, opts metav1.UpdateOptions) (result *v1.ExternalDNSInventoryRecord, err error) { + result = &v1.ExternalDNSInventoryRecord{} + err = c.client.Put(). + Resource("externaldnsinventoryrecords"). + Name(externalDNSInventoryRecord.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSInventoryRecord). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalDNSInventoryRecord and deletes it. Returns an error if one occurs. +func (c *externalDNSInventoryRecords) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externaldnsinventoryrecords"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalDNSInventoryRecords) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externaldnsinventoryrecords"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalDNSInventoryRecord. +func (c *externalDNSInventoryRecords) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSInventoryRecord, err error) { + result = &v1.ExternalDNSInventoryRecord{} + err = c.client.Patch(pt). + Resource("externaldnsinventoryrecords"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryzone.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryzone.go new file mode 100644 index 000000000..ccef693cd --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryzone.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalDNSInventoryZonesGetter has a method to return a ExternalDNSInventoryZoneInterface. +// A group's client should implement this interface. +type ExternalDNSInventoryZonesGetter interface { + ExternalDNSInventoryZones() ExternalDNSInventoryZoneInterface +} + +// ExternalDNSInventoryZoneInterface has methods to work with ExternalDNSInventoryZone resources. +type ExternalDNSInventoryZoneInterface interface { + Create(ctx context.Context, externalDNSInventoryZone *v1.ExternalDNSInventoryZone, opts metav1.CreateOptions) (*v1.ExternalDNSInventoryZone, error) + Update(ctx context.Context, externalDNSInventoryZone *v1.ExternalDNSInventoryZone, opts metav1.UpdateOptions) (*v1.ExternalDNSInventoryZone, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalDNSInventoryZone, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalDNSInventoryZoneList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSInventoryZone, err error) + ExternalDNSInventoryZoneExpansion +} + +// externalDNSInventoryZones implements ExternalDNSInventoryZoneInterface +type externalDNSInventoryZones struct { + client rest.Interface +} + +// newExternalDNSInventoryZones returns a ExternalDNSInventoryZones +func newExternalDNSInventoryZones(c *GlobalTsmV1Client) *externalDNSInventoryZones { + return &externalDNSInventoryZones{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalDNSInventoryZone, and returns the corresponding externalDNSInventoryZone object, and an error if there is any. +func (c *externalDNSInventoryZones) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalDNSInventoryZone, err error) { + result = &v1.ExternalDNSInventoryZone{} + err = c.client.Get(). + Resource("externaldnsinventoryzones"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalDNSInventoryZones that match those selectors. +func (c *externalDNSInventoryZones) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalDNSInventoryZoneList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalDNSInventoryZoneList{} + err = c.client.Get(). + Resource("externaldnsinventoryzones"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalDNSInventoryZones. +func (c *externalDNSInventoryZones) Watch(ctx context.Context, opts metav1.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(). + Resource("externaldnsinventoryzones"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalDNSInventoryZone and creates it. Returns the server's representation of the externalDNSInventoryZone, and an error, if there is any. +func (c *externalDNSInventoryZones) Create(ctx context.Context, externalDNSInventoryZone *v1.ExternalDNSInventoryZone, opts metav1.CreateOptions) (result *v1.ExternalDNSInventoryZone, err error) { + result = &v1.ExternalDNSInventoryZone{} + err = c.client.Post(). + Resource("externaldnsinventoryzones"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSInventoryZone). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalDNSInventoryZone and updates it. Returns the server's representation of the externalDNSInventoryZone, and an error, if there is any. +func (c *externalDNSInventoryZones) Update(ctx context.Context, externalDNSInventoryZone *v1.ExternalDNSInventoryZone, opts metav1.UpdateOptions) (result *v1.ExternalDNSInventoryZone, err error) { + result = &v1.ExternalDNSInventoryZone{} + err = c.client.Put(). + Resource("externaldnsinventoryzones"). + Name(externalDNSInventoryZone.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSInventoryZone). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalDNSInventoryZone and deletes it. Returns an error if one occurs. +func (c *externalDNSInventoryZones) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externaldnsinventoryzones"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalDNSInventoryZones) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externaldnsinventoryzones"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalDNSInventoryZone. +func (c *externalDNSInventoryZones) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSInventoryZone, err error) { + result = &v1.ExternalDNSInventoryZone{} + err = c.client.Patch(pt). + Resource("externaldnsinventoryzones"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsruntime.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsruntime.go new file mode 100644 index 000000000..50145cb93 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsruntime.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalDNSRuntimesGetter has a method to return a ExternalDNSRuntimeInterface. +// A group's client should implement this interface. +type ExternalDNSRuntimesGetter interface { + ExternalDNSRuntimes() ExternalDNSRuntimeInterface +} + +// ExternalDNSRuntimeInterface has methods to work with ExternalDNSRuntime resources. +type ExternalDNSRuntimeInterface interface { + Create(ctx context.Context, externalDNSRuntime *v1.ExternalDNSRuntime, opts metav1.CreateOptions) (*v1.ExternalDNSRuntime, error) + Update(ctx context.Context, externalDNSRuntime *v1.ExternalDNSRuntime, opts metav1.UpdateOptions) (*v1.ExternalDNSRuntime, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalDNSRuntime, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalDNSRuntimeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSRuntime, err error) + ExternalDNSRuntimeExpansion +} + +// externalDNSRuntimes implements ExternalDNSRuntimeInterface +type externalDNSRuntimes struct { + client rest.Interface +} + +// newExternalDNSRuntimes returns a ExternalDNSRuntimes +func newExternalDNSRuntimes(c *GlobalTsmV1Client) *externalDNSRuntimes { + return &externalDNSRuntimes{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalDNSRuntime, and returns the corresponding externalDNSRuntime object, and an error if there is any. +func (c *externalDNSRuntimes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalDNSRuntime, err error) { + result = &v1.ExternalDNSRuntime{} + err = c.client.Get(). + Resource("externaldnsruntimes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalDNSRuntimes that match those selectors. +func (c *externalDNSRuntimes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalDNSRuntimeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalDNSRuntimeList{} + err = c.client.Get(). + Resource("externaldnsruntimes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalDNSRuntimes. +func (c *externalDNSRuntimes) Watch(ctx context.Context, opts metav1.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(). + Resource("externaldnsruntimes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalDNSRuntime and creates it. Returns the server's representation of the externalDNSRuntime, and an error, if there is any. +func (c *externalDNSRuntimes) Create(ctx context.Context, externalDNSRuntime *v1.ExternalDNSRuntime, opts metav1.CreateOptions) (result *v1.ExternalDNSRuntime, err error) { + result = &v1.ExternalDNSRuntime{} + err = c.client.Post(). + Resource("externaldnsruntimes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSRuntime). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalDNSRuntime and updates it. Returns the server's representation of the externalDNSRuntime, and an error, if there is any. +func (c *externalDNSRuntimes) Update(ctx context.Context, externalDNSRuntime *v1.ExternalDNSRuntime, opts metav1.UpdateOptions) (result *v1.ExternalDNSRuntime, err error) { + result = &v1.ExternalDNSRuntime{} + err = c.client.Put(). + Resource("externaldnsruntimes"). + Name(externalDNSRuntime.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSRuntime). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalDNSRuntime and deletes it. Returns an error if one occurs. +func (c *externalDNSRuntimes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externaldnsruntimes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalDNSRuntimes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externaldnsruntimes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalDNSRuntime. +func (c *externalDNSRuntimes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSRuntime, err error) { + result = &v1.ExternalDNSRuntime{} + err = c.client.Patch(pt). + Resource("externaldnsruntimes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeendpoint.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeendpoint.go new file mode 100644 index 000000000..9ec9d6ded --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeendpoint.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalDNSRuntimeEndpointsGetter has a method to return a ExternalDNSRuntimeEndpointInterface. +// A group's client should implement this interface. +type ExternalDNSRuntimeEndpointsGetter interface { + ExternalDNSRuntimeEndpoints() ExternalDNSRuntimeEndpointInterface +} + +// ExternalDNSRuntimeEndpointInterface has methods to work with ExternalDNSRuntimeEndpoint resources. +type ExternalDNSRuntimeEndpointInterface interface { + Create(ctx context.Context, externalDNSRuntimeEndpoint *v1.ExternalDNSRuntimeEndpoint, opts metav1.CreateOptions) (*v1.ExternalDNSRuntimeEndpoint, error) + Update(ctx context.Context, externalDNSRuntimeEndpoint *v1.ExternalDNSRuntimeEndpoint, opts metav1.UpdateOptions) (*v1.ExternalDNSRuntimeEndpoint, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalDNSRuntimeEndpoint, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalDNSRuntimeEndpointList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSRuntimeEndpoint, err error) + ExternalDNSRuntimeEndpointExpansion +} + +// externalDNSRuntimeEndpoints implements ExternalDNSRuntimeEndpointInterface +type externalDNSRuntimeEndpoints struct { + client rest.Interface +} + +// newExternalDNSRuntimeEndpoints returns a ExternalDNSRuntimeEndpoints +func newExternalDNSRuntimeEndpoints(c *GlobalTsmV1Client) *externalDNSRuntimeEndpoints { + return &externalDNSRuntimeEndpoints{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalDNSRuntimeEndpoint, and returns the corresponding externalDNSRuntimeEndpoint object, and an error if there is any. +func (c *externalDNSRuntimeEndpoints) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalDNSRuntimeEndpoint, err error) { + result = &v1.ExternalDNSRuntimeEndpoint{} + err = c.client.Get(). + Resource("externaldnsruntimeendpoints"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalDNSRuntimeEndpoints that match those selectors. +func (c *externalDNSRuntimeEndpoints) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalDNSRuntimeEndpointList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalDNSRuntimeEndpointList{} + err = c.client.Get(). + Resource("externaldnsruntimeendpoints"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalDNSRuntimeEndpoints. +func (c *externalDNSRuntimeEndpoints) Watch(ctx context.Context, opts metav1.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(). + Resource("externaldnsruntimeendpoints"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalDNSRuntimeEndpoint and creates it. Returns the server's representation of the externalDNSRuntimeEndpoint, and an error, if there is any. +func (c *externalDNSRuntimeEndpoints) Create(ctx context.Context, externalDNSRuntimeEndpoint *v1.ExternalDNSRuntimeEndpoint, opts metav1.CreateOptions) (result *v1.ExternalDNSRuntimeEndpoint, err error) { + result = &v1.ExternalDNSRuntimeEndpoint{} + err = c.client.Post(). + Resource("externaldnsruntimeendpoints"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSRuntimeEndpoint). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalDNSRuntimeEndpoint and updates it. Returns the server's representation of the externalDNSRuntimeEndpoint, and an error, if there is any. +func (c *externalDNSRuntimeEndpoints) Update(ctx context.Context, externalDNSRuntimeEndpoint *v1.ExternalDNSRuntimeEndpoint, opts metav1.UpdateOptions) (result *v1.ExternalDNSRuntimeEndpoint, err error) { + result = &v1.ExternalDNSRuntimeEndpoint{} + err = c.client.Put(). + Resource("externaldnsruntimeendpoints"). + Name(externalDNSRuntimeEndpoint.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSRuntimeEndpoint). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalDNSRuntimeEndpoint and deletes it. Returns an error if one occurs. +func (c *externalDNSRuntimeEndpoints) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externaldnsruntimeendpoints"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalDNSRuntimeEndpoints) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externaldnsruntimeendpoints"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalDNSRuntimeEndpoint. +func (c *externalDNSRuntimeEndpoints) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSRuntimeEndpoint, err error) { + result = &v1.ExternalDNSRuntimeEndpoint{} + err = c.client.Patch(pt). + Resource("externaldnsruntimeendpoints"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeprimarydomain.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeprimarydomain.go new file mode 100644 index 000000000..7ab785c60 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeprimarydomain.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalDNSRuntimePrimaryDomainsGetter has a method to return a ExternalDNSRuntimePrimaryDomainInterface. +// A group's client should implement this interface. +type ExternalDNSRuntimePrimaryDomainsGetter interface { + ExternalDNSRuntimePrimaryDomains() ExternalDNSRuntimePrimaryDomainInterface +} + +// ExternalDNSRuntimePrimaryDomainInterface has methods to work with ExternalDNSRuntimePrimaryDomain resources. +type ExternalDNSRuntimePrimaryDomainInterface interface { + Create(ctx context.Context, externalDNSRuntimePrimaryDomain *v1.ExternalDNSRuntimePrimaryDomain, opts metav1.CreateOptions) (*v1.ExternalDNSRuntimePrimaryDomain, error) + Update(ctx context.Context, externalDNSRuntimePrimaryDomain *v1.ExternalDNSRuntimePrimaryDomain, opts metav1.UpdateOptions) (*v1.ExternalDNSRuntimePrimaryDomain, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalDNSRuntimePrimaryDomain, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalDNSRuntimePrimaryDomainList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSRuntimePrimaryDomain, err error) + ExternalDNSRuntimePrimaryDomainExpansion +} + +// externalDNSRuntimePrimaryDomains implements ExternalDNSRuntimePrimaryDomainInterface +type externalDNSRuntimePrimaryDomains struct { + client rest.Interface +} + +// newExternalDNSRuntimePrimaryDomains returns a ExternalDNSRuntimePrimaryDomains +func newExternalDNSRuntimePrimaryDomains(c *GlobalTsmV1Client) *externalDNSRuntimePrimaryDomains { + return &externalDNSRuntimePrimaryDomains{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalDNSRuntimePrimaryDomain, and returns the corresponding externalDNSRuntimePrimaryDomain object, and an error if there is any. +func (c *externalDNSRuntimePrimaryDomains) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalDNSRuntimePrimaryDomain, err error) { + result = &v1.ExternalDNSRuntimePrimaryDomain{} + err = c.client.Get(). + Resource("externaldnsruntimeprimarydomains"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalDNSRuntimePrimaryDomains that match those selectors. +func (c *externalDNSRuntimePrimaryDomains) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalDNSRuntimePrimaryDomainList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalDNSRuntimePrimaryDomainList{} + err = c.client.Get(). + Resource("externaldnsruntimeprimarydomains"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalDNSRuntimePrimaryDomains. +func (c *externalDNSRuntimePrimaryDomains) Watch(ctx context.Context, opts metav1.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(). + Resource("externaldnsruntimeprimarydomains"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalDNSRuntimePrimaryDomain and creates it. Returns the server's representation of the externalDNSRuntimePrimaryDomain, and an error, if there is any. +func (c *externalDNSRuntimePrimaryDomains) Create(ctx context.Context, externalDNSRuntimePrimaryDomain *v1.ExternalDNSRuntimePrimaryDomain, opts metav1.CreateOptions) (result *v1.ExternalDNSRuntimePrimaryDomain, err error) { + result = &v1.ExternalDNSRuntimePrimaryDomain{} + err = c.client.Post(). + Resource("externaldnsruntimeprimarydomains"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSRuntimePrimaryDomain). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalDNSRuntimePrimaryDomain and updates it. Returns the server's representation of the externalDNSRuntimePrimaryDomain, and an error, if there is any. +func (c *externalDNSRuntimePrimaryDomains) Update(ctx context.Context, externalDNSRuntimePrimaryDomain *v1.ExternalDNSRuntimePrimaryDomain, opts metav1.UpdateOptions) (result *v1.ExternalDNSRuntimePrimaryDomain, err error) { + result = &v1.ExternalDNSRuntimePrimaryDomain{} + err = c.client.Put(). + Resource("externaldnsruntimeprimarydomains"). + Name(externalDNSRuntimePrimaryDomain.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSRuntimePrimaryDomain). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalDNSRuntimePrimaryDomain and deletes it. Returns an error if one occurs. +func (c *externalDNSRuntimePrimaryDomains) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externaldnsruntimeprimarydomains"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalDNSRuntimePrimaryDomains) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externaldnsruntimeprimarydomains"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalDNSRuntimePrimaryDomain. +func (c *externalDNSRuntimePrimaryDomains) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSRuntimePrimaryDomain, err error) { + result = &v1.ExternalDNSRuntimePrimaryDomain{} + err = c.client.Patch(pt). + Resource("externaldnsruntimeprimarydomains"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsruntimesubdomain.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsruntimesubdomain.go new file mode 100644 index 000000000..374e48368 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externaldnsruntimesubdomain.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalDNSRuntimeSubdomainsGetter has a method to return a ExternalDNSRuntimeSubdomainInterface. +// A group's client should implement this interface. +type ExternalDNSRuntimeSubdomainsGetter interface { + ExternalDNSRuntimeSubdomains() ExternalDNSRuntimeSubdomainInterface +} + +// ExternalDNSRuntimeSubdomainInterface has methods to work with ExternalDNSRuntimeSubdomain resources. +type ExternalDNSRuntimeSubdomainInterface interface { + Create(ctx context.Context, externalDNSRuntimeSubdomain *v1.ExternalDNSRuntimeSubdomain, opts metav1.CreateOptions) (*v1.ExternalDNSRuntimeSubdomain, error) + Update(ctx context.Context, externalDNSRuntimeSubdomain *v1.ExternalDNSRuntimeSubdomain, opts metav1.UpdateOptions) (*v1.ExternalDNSRuntimeSubdomain, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalDNSRuntimeSubdomain, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalDNSRuntimeSubdomainList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSRuntimeSubdomain, err error) + ExternalDNSRuntimeSubdomainExpansion +} + +// externalDNSRuntimeSubdomains implements ExternalDNSRuntimeSubdomainInterface +type externalDNSRuntimeSubdomains struct { + client rest.Interface +} + +// newExternalDNSRuntimeSubdomains returns a ExternalDNSRuntimeSubdomains +func newExternalDNSRuntimeSubdomains(c *GlobalTsmV1Client) *externalDNSRuntimeSubdomains { + return &externalDNSRuntimeSubdomains{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalDNSRuntimeSubdomain, and returns the corresponding externalDNSRuntimeSubdomain object, and an error if there is any. +func (c *externalDNSRuntimeSubdomains) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalDNSRuntimeSubdomain, err error) { + result = &v1.ExternalDNSRuntimeSubdomain{} + err = c.client.Get(). + Resource("externaldnsruntimesubdomains"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalDNSRuntimeSubdomains that match those selectors. +func (c *externalDNSRuntimeSubdomains) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalDNSRuntimeSubdomainList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalDNSRuntimeSubdomainList{} + err = c.client.Get(). + Resource("externaldnsruntimesubdomains"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalDNSRuntimeSubdomains. +func (c *externalDNSRuntimeSubdomains) Watch(ctx context.Context, opts metav1.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(). + Resource("externaldnsruntimesubdomains"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalDNSRuntimeSubdomain and creates it. Returns the server's representation of the externalDNSRuntimeSubdomain, and an error, if there is any. +func (c *externalDNSRuntimeSubdomains) Create(ctx context.Context, externalDNSRuntimeSubdomain *v1.ExternalDNSRuntimeSubdomain, opts metav1.CreateOptions) (result *v1.ExternalDNSRuntimeSubdomain, err error) { + result = &v1.ExternalDNSRuntimeSubdomain{} + err = c.client.Post(). + Resource("externaldnsruntimesubdomains"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSRuntimeSubdomain). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalDNSRuntimeSubdomain and updates it. Returns the server's representation of the externalDNSRuntimeSubdomain, and an error, if there is any. +func (c *externalDNSRuntimeSubdomains) Update(ctx context.Context, externalDNSRuntimeSubdomain *v1.ExternalDNSRuntimeSubdomain, opts metav1.UpdateOptions) (result *v1.ExternalDNSRuntimeSubdomain, err error) { + result = &v1.ExternalDNSRuntimeSubdomain{} + err = c.client.Put(). + Resource("externaldnsruntimesubdomains"). + Name(externalDNSRuntimeSubdomain.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalDNSRuntimeSubdomain). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalDNSRuntimeSubdomain and deletes it. Returns an error if one occurs. +func (c *externalDNSRuntimeSubdomains) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externaldnsruntimesubdomains"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalDNSRuntimeSubdomains) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externaldnsruntimesubdomains"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalDNSRuntimeSubdomain. +func (c *externalDNSRuntimeSubdomains) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalDNSRuntimeSubdomain, err error) { + result = &v1.ExternalDNSRuntimeSubdomain{} + err = c.client.Patch(pt). + Resource("externaldnsruntimesubdomains"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externallbconfign.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externallbconfign.go new file mode 100644 index 000000000..1b3a98b07 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externallbconfign.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalLBConfigNsGetter has a method to return a ExternalLBConfigNInterface. +// A group's client should implement this interface. +type ExternalLBConfigNsGetter interface { + ExternalLBConfigNs() ExternalLBConfigNInterface +} + +// ExternalLBConfigNInterface has methods to work with ExternalLBConfigN resources. +type ExternalLBConfigNInterface interface { + Create(ctx context.Context, externalLBConfigN *v1.ExternalLBConfigN, opts metav1.CreateOptions) (*v1.ExternalLBConfigN, error) + Update(ctx context.Context, externalLBConfigN *v1.ExternalLBConfigN, opts metav1.UpdateOptions) (*v1.ExternalLBConfigN, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalLBConfigN, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalLBConfigNList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalLBConfigN, err error) + ExternalLBConfigNExpansion +} + +// externalLBConfigNs implements ExternalLBConfigNInterface +type externalLBConfigNs struct { + client rest.Interface +} + +// newExternalLBConfigNs returns a ExternalLBConfigNs +func newExternalLBConfigNs(c *GlobalTsmV1Client) *externalLBConfigNs { + return &externalLBConfigNs{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalLBConfigN, and returns the corresponding externalLBConfigN object, and an error if there is any. +func (c *externalLBConfigNs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalLBConfigN, err error) { + result = &v1.ExternalLBConfigN{} + err = c.client.Get(). + Resource("externallbconfigns"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalLBConfigNs that match those selectors. +func (c *externalLBConfigNs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalLBConfigNList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalLBConfigNList{} + err = c.client.Get(). + Resource("externallbconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalLBConfigNs. +func (c *externalLBConfigNs) Watch(ctx context.Context, opts metav1.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(). + Resource("externallbconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalLBConfigN and creates it. Returns the server's representation of the externalLBConfigN, and an error, if there is any. +func (c *externalLBConfigNs) Create(ctx context.Context, externalLBConfigN *v1.ExternalLBConfigN, opts metav1.CreateOptions) (result *v1.ExternalLBConfigN, err error) { + result = &v1.ExternalLBConfigN{} + err = c.client.Post(). + Resource("externallbconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalLBConfigN). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalLBConfigN and updates it. Returns the server's representation of the externalLBConfigN, and an error, if there is any. +func (c *externalLBConfigNs) Update(ctx context.Context, externalLBConfigN *v1.ExternalLBConfigN, opts metav1.UpdateOptions) (result *v1.ExternalLBConfigN, err error) { + result = &v1.ExternalLBConfigN{} + err = c.client.Put(). + Resource("externallbconfigns"). + Name(externalLBConfigN.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalLBConfigN). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalLBConfigN and deletes it. Returns an error if one occurs. +func (c *externalLBConfigNs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externallbconfigns"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalLBConfigNs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externallbconfigns"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalLBConfigN. +func (c *externalLBConfigNs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalLBConfigN, err error) { + result = &v1.ExternalLBConfigN{} + err = c.client.Patch(pt). + Resource("externallbconfigns"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalplugincapability.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalplugincapability.go new file mode 100644 index 000000000..9cc6a240b --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalplugincapability.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalPluginCapabilitiesGetter has a method to return a ExternalPluginCapabilityInterface. +// A group's client should implement this interface. +type ExternalPluginCapabilitiesGetter interface { + ExternalPluginCapabilities() ExternalPluginCapabilityInterface +} + +// ExternalPluginCapabilityInterface has methods to work with ExternalPluginCapability resources. +type ExternalPluginCapabilityInterface interface { + Create(ctx context.Context, externalPluginCapability *v1.ExternalPluginCapability, opts metav1.CreateOptions) (*v1.ExternalPluginCapability, error) + Update(ctx context.Context, externalPluginCapability *v1.ExternalPluginCapability, opts metav1.UpdateOptions) (*v1.ExternalPluginCapability, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalPluginCapability, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalPluginCapabilityList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalPluginCapability, err error) + ExternalPluginCapabilityExpansion +} + +// externalPluginCapabilities implements ExternalPluginCapabilityInterface +type externalPluginCapabilities struct { + client rest.Interface +} + +// newExternalPluginCapabilities returns a ExternalPluginCapabilities +func newExternalPluginCapabilities(c *GlobalTsmV1Client) *externalPluginCapabilities { + return &externalPluginCapabilities{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalPluginCapability, and returns the corresponding externalPluginCapability object, and an error if there is any. +func (c *externalPluginCapabilities) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalPluginCapability, err error) { + result = &v1.ExternalPluginCapability{} + err = c.client.Get(). + Resource("externalplugincapabilities"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalPluginCapabilities that match those selectors. +func (c *externalPluginCapabilities) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalPluginCapabilityList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalPluginCapabilityList{} + err = c.client.Get(). + Resource("externalplugincapabilities"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalPluginCapabilities. +func (c *externalPluginCapabilities) Watch(ctx context.Context, opts metav1.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(). + Resource("externalplugincapabilities"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalPluginCapability and creates it. Returns the server's representation of the externalPluginCapability, and an error, if there is any. +func (c *externalPluginCapabilities) Create(ctx context.Context, externalPluginCapability *v1.ExternalPluginCapability, opts metav1.CreateOptions) (result *v1.ExternalPluginCapability, err error) { + result = &v1.ExternalPluginCapability{} + err = c.client.Post(). + Resource("externalplugincapabilities"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalPluginCapability). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalPluginCapability and updates it. Returns the server's representation of the externalPluginCapability, and an error, if there is any. +func (c *externalPluginCapabilities) Update(ctx context.Context, externalPluginCapability *v1.ExternalPluginCapability, opts metav1.UpdateOptions) (result *v1.ExternalPluginCapability, err error) { + result = &v1.ExternalPluginCapability{} + err = c.client.Put(). + Resource("externalplugincapabilities"). + Name(externalPluginCapability.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalPluginCapability). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalPluginCapability and deletes it. Returns an error if one occurs. +func (c *externalPluginCapabilities) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externalplugincapabilities"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalPluginCapabilities) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externalplugincapabilities"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalPluginCapability. +func (c *externalPluginCapabilities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalPluginCapability, err error) { + result = &v1.ExternalPluginCapability{} + err = c.client.Patch(pt). + Resource("externalplugincapabilities"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalpluginconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalpluginconfig.go new file mode 100644 index 000000000..af574d9b7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalpluginconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalPluginConfigsGetter has a method to return a ExternalPluginConfigInterface. +// A group's client should implement this interface. +type ExternalPluginConfigsGetter interface { + ExternalPluginConfigs() ExternalPluginConfigInterface +} + +// ExternalPluginConfigInterface has methods to work with ExternalPluginConfig resources. +type ExternalPluginConfigInterface interface { + Create(ctx context.Context, externalPluginConfig *v1.ExternalPluginConfig, opts metav1.CreateOptions) (*v1.ExternalPluginConfig, error) + Update(ctx context.Context, externalPluginConfig *v1.ExternalPluginConfig, opts metav1.UpdateOptions) (*v1.ExternalPluginConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalPluginConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalPluginConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalPluginConfig, err error) + ExternalPluginConfigExpansion +} + +// externalPluginConfigs implements ExternalPluginConfigInterface +type externalPluginConfigs struct { + client rest.Interface +} + +// newExternalPluginConfigs returns a ExternalPluginConfigs +func newExternalPluginConfigs(c *GlobalTsmV1Client) *externalPluginConfigs { + return &externalPluginConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalPluginConfig, and returns the corresponding externalPluginConfig object, and an error if there is any. +func (c *externalPluginConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalPluginConfig, err error) { + result = &v1.ExternalPluginConfig{} + err = c.client.Get(). + Resource("externalpluginconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalPluginConfigs that match those selectors. +func (c *externalPluginConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalPluginConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalPluginConfigList{} + err = c.client.Get(). + Resource("externalpluginconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalPluginConfigs. +func (c *externalPluginConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("externalpluginconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalPluginConfig and creates it. Returns the server's representation of the externalPluginConfig, and an error, if there is any. +func (c *externalPluginConfigs) Create(ctx context.Context, externalPluginConfig *v1.ExternalPluginConfig, opts metav1.CreateOptions) (result *v1.ExternalPluginConfig, err error) { + result = &v1.ExternalPluginConfig{} + err = c.client.Post(). + Resource("externalpluginconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalPluginConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalPluginConfig and updates it. Returns the server's representation of the externalPluginConfig, and an error, if there is any. +func (c *externalPluginConfigs) Update(ctx context.Context, externalPluginConfig *v1.ExternalPluginConfig, opts metav1.UpdateOptions) (result *v1.ExternalPluginConfig, err error) { + result = &v1.ExternalPluginConfig{} + err = c.client.Put(). + Resource("externalpluginconfigs"). + Name(externalPluginConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalPluginConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalPluginConfig and deletes it. Returns an error if one occurs. +func (c *externalPluginConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externalpluginconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalPluginConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externalpluginconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalPluginConfig. +func (c *externalPluginConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalPluginConfig, err error) { + result = &v1.ExternalPluginConfig{} + err = c.client.Patch(pt). + Resource("externalpluginconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalpluginconfigfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalpluginconfigfolder.go new file mode 100644 index 000000000..601d0f0ab --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalpluginconfigfolder.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalPluginConfigFoldersGetter has a method to return a ExternalPluginConfigFolderInterface. +// A group's client should implement this interface. +type ExternalPluginConfigFoldersGetter interface { + ExternalPluginConfigFolders() ExternalPluginConfigFolderInterface +} + +// ExternalPluginConfigFolderInterface has methods to work with ExternalPluginConfigFolder resources. +type ExternalPluginConfigFolderInterface interface { + Create(ctx context.Context, externalPluginConfigFolder *v1.ExternalPluginConfigFolder, opts metav1.CreateOptions) (*v1.ExternalPluginConfigFolder, error) + Update(ctx context.Context, externalPluginConfigFolder *v1.ExternalPluginConfigFolder, opts metav1.UpdateOptions) (*v1.ExternalPluginConfigFolder, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalPluginConfigFolder, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalPluginConfigFolderList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalPluginConfigFolder, err error) + ExternalPluginConfigFolderExpansion +} + +// externalPluginConfigFolders implements ExternalPluginConfigFolderInterface +type externalPluginConfigFolders struct { + client rest.Interface +} + +// newExternalPluginConfigFolders returns a ExternalPluginConfigFolders +func newExternalPluginConfigFolders(c *GlobalTsmV1Client) *externalPluginConfigFolders { + return &externalPluginConfigFolders{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalPluginConfigFolder, and returns the corresponding externalPluginConfigFolder object, and an error if there is any. +func (c *externalPluginConfigFolders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalPluginConfigFolder, err error) { + result = &v1.ExternalPluginConfigFolder{} + err = c.client.Get(). + Resource("externalpluginconfigfolders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalPluginConfigFolders that match those selectors. +func (c *externalPluginConfigFolders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalPluginConfigFolderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalPluginConfigFolderList{} + err = c.client.Get(). + Resource("externalpluginconfigfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalPluginConfigFolders. +func (c *externalPluginConfigFolders) Watch(ctx context.Context, opts metav1.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(). + Resource("externalpluginconfigfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalPluginConfigFolder and creates it. Returns the server's representation of the externalPluginConfigFolder, and an error, if there is any. +func (c *externalPluginConfigFolders) Create(ctx context.Context, externalPluginConfigFolder *v1.ExternalPluginConfigFolder, opts metav1.CreateOptions) (result *v1.ExternalPluginConfigFolder, err error) { + result = &v1.ExternalPluginConfigFolder{} + err = c.client.Post(). + Resource("externalpluginconfigfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalPluginConfigFolder). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalPluginConfigFolder and updates it. Returns the server's representation of the externalPluginConfigFolder, and an error, if there is any. +func (c *externalPluginConfigFolders) Update(ctx context.Context, externalPluginConfigFolder *v1.ExternalPluginConfigFolder, opts metav1.UpdateOptions) (result *v1.ExternalPluginConfigFolder, err error) { + result = &v1.ExternalPluginConfigFolder{} + err = c.client.Put(). + Resource("externalpluginconfigfolders"). + Name(externalPluginConfigFolder.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalPluginConfigFolder). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalPluginConfigFolder and deletes it. Returns an error if one occurs. +func (c *externalPluginConfigFolders) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externalpluginconfigfolders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalPluginConfigFolders) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externalpluginconfigfolders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalPluginConfigFolder. +func (c *externalPluginConfigFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalPluginConfigFolder, err error) { + result = &v1.ExternalPluginConfigFolder{} + err = c.client.Patch(pt). + Resource("externalpluginconfigfolders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalplugininstanceconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalplugininstanceconfig.go new file mode 100644 index 000000000..6f558b656 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalplugininstanceconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalPluginInstanceConfigsGetter has a method to return a ExternalPluginInstanceConfigInterface. +// A group's client should implement this interface. +type ExternalPluginInstanceConfigsGetter interface { + ExternalPluginInstanceConfigs() ExternalPluginInstanceConfigInterface +} + +// ExternalPluginInstanceConfigInterface has methods to work with ExternalPluginInstanceConfig resources. +type ExternalPluginInstanceConfigInterface interface { + Create(ctx context.Context, externalPluginInstanceConfig *v1.ExternalPluginInstanceConfig, opts metav1.CreateOptions) (*v1.ExternalPluginInstanceConfig, error) + Update(ctx context.Context, externalPluginInstanceConfig *v1.ExternalPluginInstanceConfig, opts metav1.UpdateOptions) (*v1.ExternalPluginInstanceConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalPluginInstanceConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalPluginInstanceConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalPluginInstanceConfig, err error) + ExternalPluginInstanceConfigExpansion +} + +// externalPluginInstanceConfigs implements ExternalPluginInstanceConfigInterface +type externalPluginInstanceConfigs struct { + client rest.Interface +} + +// newExternalPluginInstanceConfigs returns a ExternalPluginInstanceConfigs +func newExternalPluginInstanceConfigs(c *GlobalTsmV1Client) *externalPluginInstanceConfigs { + return &externalPluginInstanceConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalPluginInstanceConfig, and returns the corresponding externalPluginInstanceConfig object, and an error if there is any. +func (c *externalPluginInstanceConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalPluginInstanceConfig, err error) { + result = &v1.ExternalPluginInstanceConfig{} + err = c.client.Get(). + Resource("externalplugininstanceconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalPluginInstanceConfigs that match those selectors. +func (c *externalPluginInstanceConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalPluginInstanceConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalPluginInstanceConfigList{} + err = c.client.Get(). + Resource("externalplugininstanceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalPluginInstanceConfigs. +func (c *externalPluginInstanceConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("externalplugininstanceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalPluginInstanceConfig and creates it. Returns the server's representation of the externalPluginInstanceConfig, and an error, if there is any. +func (c *externalPluginInstanceConfigs) Create(ctx context.Context, externalPluginInstanceConfig *v1.ExternalPluginInstanceConfig, opts metav1.CreateOptions) (result *v1.ExternalPluginInstanceConfig, err error) { + result = &v1.ExternalPluginInstanceConfig{} + err = c.client.Post(). + Resource("externalplugininstanceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalPluginInstanceConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalPluginInstanceConfig and updates it. Returns the server's representation of the externalPluginInstanceConfig, and an error, if there is any. +func (c *externalPluginInstanceConfigs) Update(ctx context.Context, externalPluginInstanceConfig *v1.ExternalPluginInstanceConfig, opts metav1.UpdateOptions) (result *v1.ExternalPluginInstanceConfig, err error) { + result = &v1.ExternalPluginInstanceConfig{} + err = c.client.Put(). + Resource("externalplugininstanceconfigs"). + Name(externalPluginInstanceConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalPluginInstanceConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalPluginInstanceConfig and deletes it. Returns an error if one occurs. +func (c *externalPluginInstanceConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externalplugininstanceconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalPluginInstanceConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externalplugininstanceconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalPluginInstanceConfig. +func (c *externalPluginInstanceConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalPluginInstanceConfig, err error) { + result = &v1.ExternalPluginInstanceConfig{} + err = c.client.Patch(pt). + Resource("externalplugininstanceconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalpluginmonitor.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalpluginmonitor.go new file mode 100644 index 000000000..fbfaae1e5 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalpluginmonitor.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalPluginMonitorsGetter has a method to return a ExternalPluginMonitorInterface. +// A group's client should implement this interface. +type ExternalPluginMonitorsGetter interface { + ExternalPluginMonitors() ExternalPluginMonitorInterface +} + +// ExternalPluginMonitorInterface has methods to work with ExternalPluginMonitor resources. +type ExternalPluginMonitorInterface interface { + Create(ctx context.Context, externalPluginMonitor *v1.ExternalPluginMonitor, opts metav1.CreateOptions) (*v1.ExternalPluginMonitor, error) + Update(ctx context.Context, externalPluginMonitor *v1.ExternalPluginMonitor, opts metav1.UpdateOptions) (*v1.ExternalPluginMonitor, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalPluginMonitor, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalPluginMonitorList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalPluginMonitor, err error) + ExternalPluginMonitorExpansion +} + +// externalPluginMonitors implements ExternalPluginMonitorInterface +type externalPluginMonitors struct { + client rest.Interface +} + +// newExternalPluginMonitors returns a ExternalPluginMonitors +func newExternalPluginMonitors(c *GlobalTsmV1Client) *externalPluginMonitors { + return &externalPluginMonitors{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalPluginMonitor, and returns the corresponding externalPluginMonitor object, and an error if there is any. +func (c *externalPluginMonitors) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalPluginMonitor, err error) { + result = &v1.ExternalPluginMonitor{} + err = c.client.Get(). + Resource("externalpluginmonitors"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalPluginMonitors that match those selectors. +func (c *externalPluginMonitors) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalPluginMonitorList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalPluginMonitorList{} + err = c.client.Get(). + Resource("externalpluginmonitors"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalPluginMonitors. +func (c *externalPluginMonitors) Watch(ctx context.Context, opts metav1.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(). + Resource("externalpluginmonitors"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalPluginMonitor and creates it. Returns the server's representation of the externalPluginMonitor, and an error, if there is any. +func (c *externalPluginMonitors) Create(ctx context.Context, externalPluginMonitor *v1.ExternalPluginMonitor, opts metav1.CreateOptions) (result *v1.ExternalPluginMonitor, err error) { + result = &v1.ExternalPluginMonitor{} + err = c.client.Post(). + Resource("externalpluginmonitors"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalPluginMonitor). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalPluginMonitor and updates it. Returns the server's representation of the externalPluginMonitor, and an error, if there is any. +func (c *externalPluginMonitors) Update(ctx context.Context, externalPluginMonitor *v1.ExternalPluginMonitor, opts metav1.UpdateOptions) (result *v1.ExternalPluginMonitor, err error) { + result = &v1.ExternalPluginMonitor{} + err = c.client.Put(). + Resource("externalpluginmonitors"). + Name(externalPluginMonitor.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalPluginMonitor). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalPluginMonitor and deletes it. Returns an error if one occurs. +func (c *externalPluginMonitors) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externalpluginmonitors"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalPluginMonitors) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externalpluginmonitors"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalPluginMonitor. +func (c *externalPluginMonitors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalPluginMonitor, err error) { + result = &v1.ExternalPluginMonitor{} + err = c.client.Patch(pt). + Resource("externalpluginmonitors"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalserviceconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalserviceconfig.go new file mode 100644 index 000000000..585a4681e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalserviceconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalServiceConfigsGetter has a method to return a ExternalServiceConfigInterface. +// A group's client should implement this interface. +type ExternalServiceConfigsGetter interface { + ExternalServiceConfigs() ExternalServiceConfigInterface +} + +// ExternalServiceConfigInterface has methods to work with ExternalServiceConfig resources. +type ExternalServiceConfigInterface interface { + Create(ctx context.Context, externalServiceConfig *v1.ExternalServiceConfig, opts metav1.CreateOptions) (*v1.ExternalServiceConfig, error) + Update(ctx context.Context, externalServiceConfig *v1.ExternalServiceConfig, opts metav1.UpdateOptions) (*v1.ExternalServiceConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalServiceConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalServiceConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalServiceConfig, err error) + ExternalServiceConfigExpansion +} + +// externalServiceConfigs implements ExternalServiceConfigInterface +type externalServiceConfigs struct { + client rest.Interface +} + +// newExternalServiceConfigs returns a ExternalServiceConfigs +func newExternalServiceConfigs(c *GlobalTsmV1Client) *externalServiceConfigs { + return &externalServiceConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalServiceConfig, and returns the corresponding externalServiceConfig object, and an error if there is any. +func (c *externalServiceConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalServiceConfig, err error) { + result = &v1.ExternalServiceConfig{} + err = c.client.Get(). + Resource("externalserviceconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalServiceConfigs that match those selectors. +func (c *externalServiceConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalServiceConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalServiceConfigList{} + err = c.client.Get(). + Resource("externalserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalServiceConfigs. +func (c *externalServiceConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("externalserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalServiceConfig and creates it. Returns the server's representation of the externalServiceConfig, and an error, if there is any. +func (c *externalServiceConfigs) Create(ctx context.Context, externalServiceConfig *v1.ExternalServiceConfig, opts metav1.CreateOptions) (result *v1.ExternalServiceConfig, err error) { + result = &v1.ExternalServiceConfig{} + err = c.client.Post(). + Resource("externalserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalServiceConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalServiceConfig and updates it. Returns the server's representation of the externalServiceConfig, and an error, if there is any. +func (c *externalServiceConfigs) Update(ctx context.Context, externalServiceConfig *v1.ExternalServiceConfig, opts metav1.UpdateOptions) (result *v1.ExternalServiceConfig, err error) { + result = &v1.ExternalServiceConfig{} + err = c.client.Put(). + Resource("externalserviceconfigs"). + Name(externalServiceConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalServiceConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalServiceConfig and deletes it. Returns an error if one occurs. +func (c *externalServiceConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externalserviceconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalServiceConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externalserviceconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalServiceConfig. +func (c *externalServiceConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalServiceConfig, err error) { + result = &v1.ExternalServiceConfig{} + err = c.client.Patch(pt). + Resource("externalserviceconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalservicesrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalservicesrt.go new file mode 100644 index 000000000..bb8ce302c --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/externalservicesrt.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ExternalServicesRTsGetter has a method to return a ExternalServicesRTInterface. +// A group's client should implement this interface. +type ExternalServicesRTsGetter interface { + ExternalServicesRTs() ExternalServicesRTInterface +} + +// ExternalServicesRTInterface has methods to work with ExternalServicesRT resources. +type ExternalServicesRTInterface interface { + Create(ctx context.Context, externalServicesRT *v1.ExternalServicesRT, opts metav1.CreateOptions) (*v1.ExternalServicesRT, error) + Update(ctx context.Context, externalServicesRT *v1.ExternalServicesRT, opts metav1.UpdateOptions) (*v1.ExternalServicesRT, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ExternalServicesRT, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExternalServicesRTList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalServicesRT, err error) + ExternalServicesRTExpansion +} + +// externalServicesRTs implements ExternalServicesRTInterface +type externalServicesRTs struct { + client rest.Interface +} + +// newExternalServicesRTs returns a ExternalServicesRTs +func newExternalServicesRTs(c *GlobalTsmV1Client) *externalServicesRTs { + return &externalServicesRTs{ + client: c.RESTClient(), + } +} + +// Get takes name of the externalServicesRT, and returns the corresponding externalServicesRT object, and an error if there is any. +func (c *externalServicesRTs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExternalServicesRT, err error) { + result = &v1.ExternalServicesRT{} + err = c.client.Get(). + Resource("externalservicesrts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExternalServicesRTs that match those selectors. +func (c *externalServicesRTs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExternalServicesRTList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExternalServicesRTList{} + err = c.client.Get(). + Resource("externalservicesrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested externalServicesRTs. +func (c *externalServicesRTs) Watch(ctx context.Context, opts metav1.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(). + Resource("externalservicesrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a externalServicesRT and creates it. Returns the server's representation of the externalServicesRT, and an error, if there is any. +func (c *externalServicesRTs) Create(ctx context.Context, externalServicesRT *v1.ExternalServicesRT, opts metav1.CreateOptions) (result *v1.ExternalServicesRT, err error) { + result = &v1.ExternalServicesRT{} + err = c.client.Post(). + Resource("externalservicesrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalServicesRT). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a externalServicesRT and updates it. Returns the server's representation of the externalServicesRT, and an error, if there is any. +func (c *externalServicesRTs) Update(ctx context.Context, externalServicesRT *v1.ExternalServicesRT, opts metav1.UpdateOptions) (result *v1.ExternalServicesRT, err error) { + result = &v1.ExternalServicesRT{} + err = c.client.Put(). + Resource("externalservicesrts"). + Name(externalServicesRT.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(externalServicesRT). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the externalServicesRT and deletes it. Returns an error if one occurs. +func (c *externalServicesRTs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("externalservicesrts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *externalServicesRTs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("externalservicesrts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched externalServicesRT. +func (c *externalServicesRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExternalServicesRT, err error) { + result = &v1.ExternalServicesRT{} + err = c.client.Patch(pt). + Resource("externalservicesrts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/doc.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/doc.go similarity index 100% rename from compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/doc.go rename to compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/doc.go diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_accesscontrolpolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_accesscontrolpolicy.go new file mode 100644 index 000000000..7ba52c3ee --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_accesscontrolpolicy.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAccessControlPolicies implements AccessControlPolicyInterface +type FakeAccessControlPolicies struct { + Fake *FakeGlobalTsmV1 +} + +var accesscontrolpoliciesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "accesscontrolpolicies"} + +var accesscontrolpoliciesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AccessControlPolicy"} + +// Get takes name of the accessControlPolicy, and returns the corresponding accessControlPolicy object, and an error if there is any. +func (c *FakeAccessControlPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AccessControlPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(accesscontrolpoliciesResource, name), &globaltsmtanzuvmwarecomv1.AccessControlPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AccessControlPolicy), err +} + +// List takes label and field selectors, and returns the list of AccessControlPolicies that match those selectors. +func (c *FakeAccessControlPolicies) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AccessControlPolicyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(accesscontrolpoliciesResource, accesscontrolpoliciesKind, opts), &globaltsmtanzuvmwarecomv1.AccessControlPolicyList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AccessControlPolicyList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AccessControlPolicyList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AccessControlPolicyList).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 accessControlPolicies. +func (c *FakeAccessControlPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(accesscontrolpoliciesResource, opts)) +} + +// Create takes the representation of a accessControlPolicy and creates it. Returns the server's representation of the accessControlPolicy, and an error, if there is any. +func (c *FakeAccessControlPolicies) Create(ctx context.Context, accessControlPolicy *globaltsmtanzuvmwarecomv1.AccessControlPolicy, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AccessControlPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(accesscontrolpoliciesResource, accessControlPolicy), &globaltsmtanzuvmwarecomv1.AccessControlPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AccessControlPolicy), err +} + +// Update takes the representation of a accessControlPolicy and updates it. Returns the server's representation of the accessControlPolicy, and an error, if there is any. +func (c *FakeAccessControlPolicies) Update(ctx context.Context, accessControlPolicy *globaltsmtanzuvmwarecomv1.AccessControlPolicy, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AccessControlPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(accesscontrolpoliciesResource, accessControlPolicy), &globaltsmtanzuvmwarecomv1.AccessControlPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AccessControlPolicy), err +} + +// Delete takes name of the accessControlPolicy and deletes it. Returns an error if one occurs. +func (c *FakeAccessControlPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(accesscontrolpoliciesResource, name), &globaltsmtanzuvmwarecomv1.AccessControlPolicy{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAccessControlPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(accesscontrolpoliciesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AccessControlPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched accessControlPolicy. +func (c *FakeAccessControlPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AccessControlPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(accesscontrolpoliciesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AccessControlPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AccessControlPolicy), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_accesstoken.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_accesstoken.go new file mode 100644 index 000000000..01b6825e5 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_accesstoken.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAccessTokens implements AccessTokenInterface +type FakeAccessTokens struct { + Fake *FakeGlobalTsmV1 +} + +var accesstokensResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "accesstokens"} + +var accesstokensKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AccessToken"} + +// Get takes name of the accessToken, and returns the corresponding accessToken object, and an error if there is any. +func (c *FakeAccessTokens) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AccessToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(accesstokensResource, name), &globaltsmtanzuvmwarecomv1.AccessToken{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AccessToken), err +} + +// List takes label and field selectors, and returns the list of AccessTokens that match those selectors. +func (c *FakeAccessTokens) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AccessTokenList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(accesstokensResource, accesstokensKind, opts), &globaltsmtanzuvmwarecomv1.AccessTokenList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AccessTokenList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AccessTokenList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AccessTokenList).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 accessTokens. +func (c *FakeAccessTokens) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(accesstokensResource, opts)) +} + +// Create takes the representation of a accessToken and creates it. Returns the server's representation of the accessToken, and an error, if there is any. +func (c *FakeAccessTokens) Create(ctx context.Context, accessToken *globaltsmtanzuvmwarecomv1.AccessToken, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AccessToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(accesstokensResource, accessToken), &globaltsmtanzuvmwarecomv1.AccessToken{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AccessToken), err +} + +// Update takes the representation of a accessToken and updates it. Returns the server's representation of the accessToken, and an error, if there is any. +func (c *FakeAccessTokens) Update(ctx context.Context, accessToken *globaltsmtanzuvmwarecomv1.AccessToken, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AccessToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(accesstokensResource, accessToken), &globaltsmtanzuvmwarecomv1.AccessToken{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AccessToken), err +} + +// Delete takes name of the accessToken and deletes it. Returns an error if one occurs. +func (c *FakeAccessTokens) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(accesstokensResource, name), &globaltsmtanzuvmwarecomv1.AccessToken{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAccessTokens) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(accesstokensResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AccessTokenList{}) + return err +} + +// Patch applies the patch and returns the patched accessToken. +func (c *FakeAccessTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AccessToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(accesstokensResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AccessToken{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AccessToken), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_acpconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_acpconfig.go new file mode 100644 index 000000000..36ebc1b4b --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_acpconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeACPConfigs implements ACPConfigInterface +type FakeACPConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var acpconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "acpconfigs"} + +var acpconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ACPConfig"} + +// Get takes name of the aCPConfig, and returns the corresponding aCPConfig object, and an error if there is any. +func (c *FakeACPConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ACPConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(acpconfigsResource, name), &globaltsmtanzuvmwarecomv1.ACPConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ACPConfig), err +} + +// List takes label and field selectors, and returns the list of ACPConfigs that match those selectors. +func (c *FakeACPConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ACPConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(acpconfigsResource, acpconfigsKind, opts), &globaltsmtanzuvmwarecomv1.ACPConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ACPConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ACPConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ACPConfigList).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 aCPConfigs. +func (c *FakeACPConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(acpconfigsResource, opts)) +} + +// Create takes the representation of a aCPConfig and creates it. Returns the server's representation of the aCPConfig, and an error, if there is any. +func (c *FakeACPConfigs) Create(ctx context.Context, aCPConfig *globaltsmtanzuvmwarecomv1.ACPConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ACPConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(acpconfigsResource, aCPConfig), &globaltsmtanzuvmwarecomv1.ACPConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ACPConfig), err +} + +// Update takes the representation of a aCPConfig and updates it. Returns the server's representation of the aCPConfig, and an error, if there is any. +func (c *FakeACPConfigs) Update(ctx context.Context, aCPConfig *globaltsmtanzuvmwarecomv1.ACPConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ACPConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(acpconfigsResource, aCPConfig), &globaltsmtanzuvmwarecomv1.ACPConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ACPConfig), err +} + +// Delete takes name of the aCPConfig and deletes it. Returns an error if one occurs. +func (c *FakeACPConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(acpconfigsResource, name), &globaltsmtanzuvmwarecomv1.ACPConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeACPConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(acpconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ACPConfigList{}) + return err +} + +// Patch applies the patch and returns the patched aCPConfig. +func (c *FakeACPConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ACPConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(acpconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ACPConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ACPConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_additionalattributes.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_additionalattributes.go new file mode 100644 index 000000000..4b666c84f --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_additionalattributes.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAdditionalAttributeses implements AdditionalAttributesInterface +type FakeAdditionalAttributeses struct { + Fake *FakeGlobalTsmV1 +} + +var additionalattributesesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "additionalattributeses"} + +var additionalattributesesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AdditionalAttributes"} + +// Get takes name of the additionalAttributes, and returns the corresponding additionalAttributes object, and an error if there is any. +func (c *FakeAdditionalAttributeses) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AdditionalAttributes, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(additionalattributesesResource, name), &globaltsmtanzuvmwarecomv1.AdditionalAttributes{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AdditionalAttributes), err +} + +// List takes label and field selectors, and returns the list of AdditionalAttributeses that match those selectors. +func (c *FakeAdditionalAttributeses) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AdditionalAttributesList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(additionalattributesesResource, additionalattributesesKind, opts), &globaltsmtanzuvmwarecomv1.AdditionalAttributesList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AdditionalAttributesList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AdditionalAttributesList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AdditionalAttributesList).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 additionalAttributeses. +func (c *FakeAdditionalAttributeses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(additionalattributesesResource, opts)) +} + +// Create takes the representation of a additionalAttributes and creates it. Returns the server's representation of the additionalAttributes, and an error, if there is any. +func (c *FakeAdditionalAttributeses) Create(ctx context.Context, additionalAttributes *globaltsmtanzuvmwarecomv1.AdditionalAttributes, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AdditionalAttributes, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(additionalattributesesResource, additionalAttributes), &globaltsmtanzuvmwarecomv1.AdditionalAttributes{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AdditionalAttributes), err +} + +// Update takes the representation of a additionalAttributes and updates it. Returns the server's representation of the additionalAttributes, and an error, if there is any. +func (c *FakeAdditionalAttributeses) Update(ctx context.Context, additionalAttributes *globaltsmtanzuvmwarecomv1.AdditionalAttributes, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AdditionalAttributes, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(additionalattributesesResource, additionalAttributes), &globaltsmtanzuvmwarecomv1.AdditionalAttributes{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AdditionalAttributes), err +} + +// Delete takes name of the additionalAttributes and deletes it. Returns an error if one occurs. +func (c *FakeAdditionalAttributeses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(additionalattributesesResource, name), &globaltsmtanzuvmwarecomv1.AdditionalAttributes{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAdditionalAttributeses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(additionalattributesesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AdditionalAttributesList{}) + return err +} + +// Patch applies the patch and returns the patched additionalAttributes. +func (c *FakeAdditionalAttributeses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AdditionalAttributes, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(additionalattributesesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AdditionalAttributes{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AdditionalAttributes), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_allsparkservices.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_allsparkservices.go new file mode 100644 index 000000000..74876e5c4 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_allsparkservices.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAllSparkServiceses implements AllSparkServicesInterface +type FakeAllSparkServiceses struct { + Fake *FakeGlobalTsmV1 +} + +var allsparkservicesesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "allsparkserviceses"} + +var allsparkservicesesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AllSparkServices"} + +// Get takes name of the allSparkServices, and returns the corresponding allSparkServices object, and an error if there is any. +func (c *FakeAllSparkServiceses) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AllSparkServices, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(allsparkservicesesResource, name), &globaltsmtanzuvmwarecomv1.AllSparkServices{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AllSparkServices), err +} + +// List takes label and field selectors, and returns the list of AllSparkServiceses that match those selectors. +func (c *FakeAllSparkServiceses) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AllSparkServicesList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(allsparkservicesesResource, allsparkservicesesKind, opts), &globaltsmtanzuvmwarecomv1.AllSparkServicesList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AllSparkServicesList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AllSparkServicesList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AllSparkServicesList).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 allSparkServiceses. +func (c *FakeAllSparkServiceses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(allsparkservicesesResource, opts)) +} + +// Create takes the representation of a allSparkServices and creates it. Returns the server's representation of the allSparkServices, and an error, if there is any. +func (c *FakeAllSparkServiceses) Create(ctx context.Context, allSparkServices *globaltsmtanzuvmwarecomv1.AllSparkServices, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AllSparkServices, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(allsparkservicesesResource, allSparkServices), &globaltsmtanzuvmwarecomv1.AllSparkServices{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AllSparkServices), err +} + +// Update takes the representation of a allSparkServices and updates it. Returns the server's representation of the allSparkServices, and an error, if there is any. +func (c *FakeAllSparkServiceses) Update(ctx context.Context, allSparkServices *globaltsmtanzuvmwarecomv1.AllSparkServices, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AllSparkServices, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(allsparkservicesesResource, allSparkServices), &globaltsmtanzuvmwarecomv1.AllSparkServices{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AllSparkServices), err +} + +// Delete takes name of the allSparkServices and deletes it. Returns an error if one occurs. +func (c *FakeAllSparkServiceses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(allsparkservicesesResource, name), &globaltsmtanzuvmwarecomv1.AllSparkServices{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAllSparkServiceses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(allsparkservicesesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AllSparkServicesList{}) + return err +} + +// Patch applies the patch and returns the patched allSparkServices. +func (c *FakeAllSparkServiceses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AllSparkServices, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(allsparkservicesesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AllSparkServices{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AllSparkServices), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_annotation.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_annotation.go new file mode 100644 index 000000000..616948c8d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_annotation.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAnnotations implements AnnotationInterface +type FakeAnnotations struct { + Fake *FakeGlobalTsmV1 +} + +var annotationsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "annotations"} + +var annotationsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Annotation"} + +// Get takes name of the annotation, and returns the corresponding annotation object, and an error if there is any. +func (c *FakeAnnotations) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Annotation, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(annotationsResource, name), &globaltsmtanzuvmwarecomv1.Annotation{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Annotation), err +} + +// List takes label and field selectors, and returns the list of Annotations that match those selectors. +func (c *FakeAnnotations) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AnnotationList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(annotationsResource, annotationsKind, opts), &globaltsmtanzuvmwarecomv1.AnnotationList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AnnotationList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AnnotationList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AnnotationList).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 annotations. +func (c *FakeAnnotations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(annotationsResource, opts)) +} + +// Create takes the representation of a annotation and creates it. Returns the server's representation of the annotation, and an error, if there is any. +func (c *FakeAnnotations) Create(ctx context.Context, annotation *globaltsmtanzuvmwarecomv1.Annotation, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Annotation, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(annotationsResource, annotation), &globaltsmtanzuvmwarecomv1.Annotation{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Annotation), err +} + +// Update takes the representation of a annotation and updates it. Returns the server's representation of the annotation, and an error, if there is any. +func (c *FakeAnnotations) Update(ctx context.Context, annotation *globaltsmtanzuvmwarecomv1.Annotation, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Annotation, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(annotationsResource, annotation), &globaltsmtanzuvmwarecomv1.Annotation{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Annotation), err +} + +// Delete takes name of the annotation and deletes it. Returns an error if one occurs. +func (c *FakeAnnotations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(annotationsResource, name), &globaltsmtanzuvmwarecomv1.Annotation{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAnnotations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(annotationsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AnnotationList{}) + return err +} + +// Patch applies the patch and returns the patched annotation. +func (c *FakeAnnotations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Annotation, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(annotationsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Annotation{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Annotation), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_apidiscovery.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_apidiscovery.go new file mode 100644 index 000000000..acfb7508f --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_apidiscovery.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeApiDiscoveries implements ApiDiscoveryInterface +type FakeApiDiscoveries struct { + Fake *FakeGlobalTsmV1 +} + +var apidiscoveriesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "apidiscoveries"} + +var apidiscoveriesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ApiDiscovery"} + +// Get takes name of the apiDiscovery, and returns the corresponding apiDiscovery object, and an error if there is any. +func (c *FakeApiDiscoveries) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ApiDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(apidiscoveriesResource, name), &globaltsmtanzuvmwarecomv1.ApiDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ApiDiscovery), err +} + +// List takes label and field selectors, and returns the list of ApiDiscoveries that match those selectors. +func (c *FakeApiDiscoveries) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ApiDiscoveryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(apidiscoveriesResource, apidiscoveriesKind, opts), &globaltsmtanzuvmwarecomv1.ApiDiscoveryList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ApiDiscoveryList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ApiDiscoveryList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ApiDiscoveryList).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 apiDiscoveries. +func (c *FakeApiDiscoveries) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(apidiscoveriesResource, opts)) +} + +// Create takes the representation of a apiDiscovery and creates it. Returns the server's representation of the apiDiscovery, and an error, if there is any. +func (c *FakeApiDiscoveries) Create(ctx context.Context, apiDiscovery *globaltsmtanzuvmwarecomv1.ApiDiscovery, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ApiDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(apidiscoveriesResource, apiDiscovery), &globaltsmtanzuvmwarecomv1.ApiDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ApiDiscovery), err +} + +// Update takes the representation of a apiDiscovery and updates it. Returns the server's representation of the apiDiscovery, and an error, if there is any. +func (c *FakeApiDiscoveries) Update(ctx context.Context, apiDiscovery *globaltsmtanzuvmwarecomv1.ApiDiscovery, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ApiDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(apidiscoveriesResource, apiDiscovery), &globaltsmtanzuvmwarecomv1.ApiDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ApiDiscovery), err +} + +// Delete takes name of the apiDiscovery and deletes it. Returns an error if one occurs. +func (c *FakeApiDiscoveries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(apidiscoveriesResource, name), &globaltsmtanzuvmwarecomv1.ApiDiscovery{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeApiDiscoveries) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(apidiscoveriesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ApiDiscoveryList{}) + return err +} + +// Patch applies the patch and returns the patched apiDiscovery. +func (c *FakeApiDiscoveries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ApiDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(apidiscoveriesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ApiDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ApiDiscovery), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_apidiscoveryrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_apidiscoveryrt.go new file mode 100644 index 000000000..07fd4c0a4 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_apidiscoveryrt.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeApiDiscoveryRTs implements ApiDiscoveryRTInterface +type FakeApiDiscoveryRTs struct { + Fake *FakeGlobalTsmV1 +} + +var apidiscoveryrtsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "apidiscoveryrts"} + +var apidiscoveryrtsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ApiDiscoveryRT"} + +// Get takes name of the apiDiscoveryRT, and returns the corresponding apiDiscoveryRT object, and an error if there is any. +func (c *FakeApiDiscoveryRTs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ApiDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(apidiscoveryrtsResource, name), &globaltsmtanzuvmwarecomv1.ApiDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ApiDiscoveryRT), err +} + +// List takes label and field selectors, and returns the list of ApiDiscoveryRTs that match those selectors. +func (c *FakeApiDiscoveryRTs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ApiDiscoveryRTList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(apidiscoveryrtsResource, apidiscoveryrtsKind, opts), &globaltsmtanzuvmwarecomv1.ApiDiscoveryRTList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ApiDiscoveryRTList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ApiDiscoveryRTList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ApiDiscoveryRTList).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 apiDiscoveryRTs. +func (c *FakeApiDiscoveryRTs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(apidiscoveryrtsResource, opts)) +} + +// Create takes the representation of a apiDiscoveryRT and creates it. Returns the server's representation of the apiDiscoveryRT, and an error, if there is any. +func (c *FakeApiDiscoveryRTs) Create(ctx context.Context, apiDiscoveryRT *globaltsmtanzuvmwarecomv1.ApiDiscoveryRT, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ApiDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(apidiscoveryrtsResource, apiDiscoveryRT), &globaltsmtanzuvmwarecomv1.ApiDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ApiDiscoveryRT), err +} + +// Update takes the representation of a apiDiscoveryRT and updates it. Returns the server's representation of the apiDiscoveryRT, and an error, if there is any. +func (c *FakeApiDiscoveryRTs) Update(ctx context.Context, apiDiscoveryRT *globaltsmtanzuvmwarecomv1.ApiDiscoveryRT, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ApiDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(apidiscoveryrtsResource, apiDiscoveryRT), &globaltsmtanzuvmwarecomv1.ApiDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ApiDiscoveryRT), err +} + +// Delete takes name of the apiDiscoveryRT and deletes it. Returns an error if one occurs. +func (c *FakeApiDiscoveryRTs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(apidiscoveryrtsResource, name), &globaltsmtanzuvmwarecomv1.ApiDiscoveryRT{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeApiDiscoveryRTs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(apidiscoveryrtsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ApiDiscoveryRTList{}) + return err +} + +// Patch applies the patch and returns the patched apiDiscoveryRT. +func (c *FakeApiDiscoveryRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ApiDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(apidiscoveryrtsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ApiDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ApiDiscoveryRT), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_app.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_app.go new file mode 100644 index 000000000..0adc6db5e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_app.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeApps implements AppInterface +type FakeApps struct { + Fake *FakeGlobalTsmV1 +} + +var appsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "apps"} + +var appsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "App"} + +// Get takes name of the app, and returns the corresponding app object, and an error if there is any. +func (c *FakeApps) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.App, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(appsResource, name), &globaltsmtanzuvmwarecomv1.App{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.App), err +} + +// List takes label and field selectors, and returns the list of Apps that match those selectors. +func (c *FakeApps) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AppList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(appsResource, appsKind, opts), &globaltsmtanzuvmwarecomv1.AppList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AppList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AppList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AppList).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 apps. +func (c *FakeApps) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(appsResource, opts)) +} + +// Create takes the representation of a app and creates it. Returns the server's representation of the app, and an error, if there is any. +func (c *FakeApps) Create(ctx context.Context, app *globaltsmtanzuvmwarecomv1.App, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.App, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(appsResource, app), &globaltsmtanzuvmwarecomv1.App{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.App), err +} + +// Update takes the representation of a app and updates it. Returns the server's representation of the app, and an error, if there is any. +func (c *FakeApps) Update(ctx context.Context, app *globaltsmtanzuvmwarecomv1.App, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.App, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(appsResource, app), &globaltsmtanzuvmwarecomv1.App{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.App), err +} + +// Delete takes name of the app and deletes it. Returns an error if one occurs. +func (c *FakeApps) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(appsResource, name), &globaltsmtanzuvmwarecomv1.App{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeApps) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(appsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AppList{}) + return err +} + +// Patch applies the patch and returns the patched app. +func (c *FakeApps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.App, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(appsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.App{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.App), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_appfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_appfolder.go new file mode 100644 index 000000000..a826fa59d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_appfolder.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAppFolders implements AppFolderInterface +type FakeAppFolders struct { + Fake *FakeGlobalTsmV1 +} + +var appfoldersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "appfolders"} + +var appfoldersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AppFolder"} + +// Get takes name of the appFolder, and returns the corresponding appFolder object, and an error if there is any. +func (c *FakeAppFolders) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AppFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(appfoldersResource, name), &globaltsmtanzuvmwarecomv1.AppFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppFolder), err +} + +// List takes label and field selectors, and returns the list of AppFolders that match those selectors. +func (c *FakeAppFolders) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AppFolderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(appfoldersResource, appfoldersKind, opts), &globaltsmtanzuvmwarecomv1.AppFolderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AppFolderList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AppFolderList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AppFolderList).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 appFolders. +func (c *FakeAppFolders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(appfoldersResource, opts)) +} + +// Create takes the representation of a appFolder and creates it. Returns the server's representation of the appFolder, and an error, if there is any. +func (c *FakeAppFolders) Create(ctx context.Context, appFolder *globaltsmtanzuvmwarecomv1.AppFolder, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AppFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(appfoldersResource, appFolder), &globaltsmtanzuvmwarecomv1.AppFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppFolder), err +} + +// Update takes the representation of a appFolder and updates it. Returns the server's representation of the appFolder, and an error, if there is any. +func (c *FakeAppFolders) Update(ctx context.Context, appFolder *globaltsmtanzuvmwarecomv1.AppFolder, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AppFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(appfoldersResource, appFolder), &globaltsmtanzuvmwarecomv1.AppFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppFolder), err +} + +// Delete takes name of the appFolder and deletes it. Returns an error if one occurs. +func (c *FakeAppFolders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(appfoldersResource, name), &globaltsmtanzuvmwarecomv1.AppFolder{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAppFolders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(appfoldersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AppFolderList{}) + return err +} + +// Patch applies the patch and returns the patched appFolder. +func (c *FakeAppFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AppFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(appfoldersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AppFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppFolder), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_appgroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_appgroup.go new file mode 100644 index 000000000..7cec9f094 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_appgroup.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAppGroups implements AppGroupInterface +type FakeAppGroups struct { + Fake *FakeGlobalTsmV1 +} + +var appgroupsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "appgroups"} + +var appgroupsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AppGroup"} + +// Get takes name of the appGroup, and returns the corresponding appGroup object, and an error if there is any. +func (c *FakeAppGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AppGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(appgroupsResource, name), &globaltsmtanzuvmwarecomv1.AppGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppGroup), err +} + +// List takes label and field selectors, and returns the list of AppGroups that match those selectors. +func (c *FakeAppGroups) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AppGroupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(appgroupsResource, appgroupsKind, opts), &globaltsmtanzuvmwarecomv1.AppGroupList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AppGroupList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AppGroupList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AppGroupList).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 appGroups. +func (c *FakeAppGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(appgroupsResource, opts)) +} + +// Create takes the representation of a appGroup and creates it. Returns the server's representation of the appGroup, and an error, if there is any. +func (c *FakeAppGroups) Create(ctx context.Context, appGroup *globaltsmtanzuvmwarecomv1.AppGroup, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AppGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(appgroupsResource, appGroup), &globaltsmtanzuvmwarecomv1.AppGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppGroup), err +} + +// Update takes the representation of a appGroup and updates it. Returns the server's representation of the appGroup, and an error, if there is any. +func (c *FakeAppGroups) Update(ctx context.Context, appGroup *globaltsmtanzuvmwarecomv1.AppGroup, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AppGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(appgroupsResource, appGroup), &globaltsmtanzuvmwarecomv1.AppGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppGroup), err +} + +// Delete takes name of the appGroup and deletes it. Returns an error if one occurs. +func (c *FakeAppGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(appgroupsResource, name), &globaltsmtanzuvmwarecomv1.AppGroup{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAppGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(appgroupsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AppGroupList{}) + return err +} + +// Patch applies the patch and returns the patched appGroup. +func (c *FakeAppGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AppGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(appgroupsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AppGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppGroup), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_applicationinfo.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_applicationinfo.go new file mode 100644 index 000000000..03a47e887 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_applicationinfo.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeApplicationInfos implements ApplicationInfoInterface +type FakeApplicationInfos struct { + Fake *FakeGlobalTsmV1 +} + +var applicationinfosResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "applicationinfos"} + +var applicationinfosKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ApplicationInfo"} + +// Get takes name of the applicationInfo, and returns the corresponding applicationInfo object, and an error if there is any. +func (c *FakeApplicationInfos) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ApplicationInfo, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(applicationinfosResource, name), &globaltsmtanzuvmwarecomv1.ApplicationInfo{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ApplicationInfo), err +} + +// List takes label and field selectors, and returns the list of ApplicationInfos that match those selectors. +func (c *FakeApplicationInfos) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ApplicationInfoList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(applicationinfosResource, applicationinfosKind, opts), &globaltsmtanzuvmwarecomv1.ApplicationInfoList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ApplicationInfoList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ApplicationInfoList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ApplicationInfoList).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 applicationInfos. +func (c *FakeApplicationInfos) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(applicationinfosResource, opts)) +} + +// Create takes the representation of a applicationInfo and creates it. Returns the server's representation of the applicationInfo, and an error, if there is any. +func (c *FakeApplicationInfos) Create(ctx context.Context, applicationInfo *globaltsmtanzuvmwarecomv1.ApplicationInfo, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ApplicationInfo, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(applicationinfosResource, applicationInfo), &globaltsmtanzuvmwarecomv1.ApplicationInfo{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ApplicationInfo), err +} + +// Update takes the representation of a applicationInfo and updates it. Returns the server's representation of the applicationInfo, and an error, if there is any. +func (c *FakeApplicationInfos) Update(ctx context.Context, applicationInfo *globaltsmtanzuvmwarecomv1.ApplicationInfo, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ApplicationInfo, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(applicationinfosResource, applicationInfo), &globaltsmtanzuvmwarecomv1.ApplicationInfo{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ApplicationInfo), err +} + +// Delete takes name of the applicationInfo and deletes it. Returns an error if one occurs. +func (c *FakeApplicationInfos) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(applicationinfosResource, name), &globaltsmtanzuvmwarecomv1.ApplicationInfo{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeApplicationInfos) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(applicationinfosResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ApplicationInfoList{}) + return err +} + +// Patch applies the patch and returns the patched applicationInfo. +func (c *FakeApplicationInfos) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ApplicationInfo, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(applicationinfosResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ApplicationInfo{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ApplicationInfo), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_apptemplate.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_apptemplate.go new file mode 100644 index 000000000..d39f764fe --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_apptemplate.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAppTemplates implements AppTemplateInterface +type FakeAppTemplates struct { + Fake *FakeGlobalTsmV1 +} + +var apptemplatesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "apptemplates"} + +var apptemplatesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AppTemplate"} + +// Get takes name of the appTemplate, and returns the corresponding appTemplate object, and an error if there is any. +func (c *FakeAppTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AppTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(apptemplatesResource, name), &globaltsmtanzuvmwarecomv1.AppTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppTemplate), err +} + +// List takes label and field selectors, and returns the list of AppTemplates that match those selectors. +func (c *FakeAppTemplates) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AppTemplateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(apptemplatesResource, apptemplatesKind, opts), &globaltsmtanzuvmwarecomv1.AppTemplateList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AppTemplateList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AppTemplateList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AppTemplateList).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 appTemplates. +func (c *FakeAppTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(apptemplatesResource, opts)) +} + +// Create takes the representation of a appTemplate and creates it. Returns the server's representation of the appTemplate, and an error, if there is any. +func (c *FakeAppTemplates) Create(ctx context.Context, appTemplate *globaltsmtanzuvmwarecomv1.AppTemplate, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AppTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(apptemplatesResource, appTemplate), &globaltsmtanzuvmwarecomv1.AppTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppTemplate), err +} + +// Update takes the representation of a appTemplate and updates it. Returns the server's representation of the appTemplate, and an error, if there is any. +func (c *FakeAppTemplates) Update(ctx context.Context, appTemplate *globaltsmtanzuvmwarecomv1.AppTemplate, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AppTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(apptemplatesResource, appTemplate), &globaltsmtanzuvmwarecomv1.AppTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppTemplate), err +} + +// Delete takes name of the appTemplate and deletes it. Returns an error if one occurs. +func (c *FakeAppTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(apptemplatesResource, name), &globaltsmtanzuvmwarecomv1.AppTemplate{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAppTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(apptemplatesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AppTemplateList{}) + return err +} + +// Patch applies the patch and returns the patched appTemplate. +func (c *FakeAppTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AppTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(apptemplatesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AppTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppTemplate), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_apptemplateservicedefinition.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_apptemplateservicedefinition.go new file mode 100644 index 000000000..fe9fe50bc --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_apptemplateservicedefinition.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAppTemplateServiceDefinitions implements AppTemplateServiceDefinitionInterface +type FakeAppTemplateServiceDefinitions struct { + Fake *FakeGlobalTsmV1 +} + +var apptemplateservicedefinitionsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "apptemplateservicedefinitions"} + +var apptemplateservicedefinitionsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AppTemplateServiceDefinition"} + +// Get takes name of the appTemplateServiceDefinition, and returns the corresponding appTemplateServiceDefinition object, and an error if there is any. +func (c *FakeAppTemplateServiceDefinitions) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(apptemplateservicedefinitionsResource, name), &globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition), err +} + +// List takes label and field selectors, and returns the list of AppTemplateServiceDefinitions that match those selectors. +func (c *FakeAppTemplateServiceDefinitions) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinitionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(apptemplateservicedefinitionsResource, apptemplateservicedefinitionsKind, opts), &globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinitionList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinitionList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinitionList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinitionList).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 appTemplateServiceDefinitions. +func (c *FakeAppTemplateServiceDefinitions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(apptemplateservicedefinitionsResource, opts)) +} + +// Create takes the representation of a appTemplateServiceDefinition and creates it. Returns the server's representation of the appTemplateServiceDefinition, and an error, if there is any. +func (c *FakeAppTemplateServiceDefinitions) Create(ctx context.Context, appTemplateServiceDefinition *globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(apptemplateservicedefinitionsResource, appTemplateServiceDefinition), &globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition), err +} + +// Update takes the representation of a appTemplateServiceDefinition and updates it. Returns the server's representation of the appTemplateServiceDefinition, and an error, if there is any. +func (c *FakeAppTemplateServiceDefinitions) Update(ctx context.Context, appTemplateServiceDefinition *globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(apptemplateservicedefinitionsResource, appTemplateServiceDefinition), &globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition), err +} + +// Delete takes name of the appTemplateServiceDefinition and deletes it. Returns an error if one occurs. +func (c *FakeAppTemplateServiceDefinitions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(apptemplateservicedefinitionsResource, name), &globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAppTemplateServiceDefinitions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(apptemplateservicedefinitionsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinitionList{}) + return err +} + +// Patch applies the patch and returns the patched appTemplateServiceDefinition. +func (c *FakeAppTemplateServiceDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(apptemplateservicedefinitionsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_appuser.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_appuser.go new file mode 100644 index 000000000..4b406ede4 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_appuser.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAppUsers implements AppUserInterface +type FakeAppUsers struct { + Fake *FakeGlobalTsmV1 +} + +var appusersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "appusers"} + +var appusersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AppUser"} + +// Get takes name of the appUser, and returns the corresponding appUser object, and an error if there is any. +func (c *FakeAppUsers) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AppUser, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(appusersResource, name), &globaltsmtanzuvmwarecomv1.AppUser{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppUser), err +} + +// List takes label and field selectors, and returns the list of AppUsers that match those selectors. +func (c *FakeAppUsers) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AppUserList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(appusersResource, appusersKind, opts), &globaltsmtanzuvmwarecomv1.AppUserList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AppUserList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AppUserList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AppUserList).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 appUsers. +func (c *FakeAppUsers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(appusersResource, opts)) +} + +// Create takes the representation of a appUser and creates it. Returns the server's representation of the appUser, and an error, if there is any. +func (c *FakeAppUsers) Create(ctx context.Context, appUser *globaltsmtanzuvmwarecomv1.AppUser, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AppUser, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(appusersResource, appUser), &globaltsmtanzuvmwarecomv1.AppUser{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppUser), err +} + +// Update takes the representation of a appUser and updates it. Returns the server's representation of the appUser, and an error, if there is any. +func (c *FakeAppUsers) Update(ctx context.Context, appUser *globaltsmtanzuvmwarecomv1.AppUser, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AppUser, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(appusersResource, appUser), &globaltsmtanzuvmwarecomv1.AppUser{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppUser), err +} + +// Delete takes name of the appUser and deletes it. Returns an error if one occurs. +func (c *FakeAppUsers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(appusersResource, name), &globaltsmtanzuvmwarecomv1.AppUser{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAppUsers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(appusersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AppUserList{}) + return err +} + +// Patch applies the patch and returns the patched appUser. +func (c *FakeAppUsers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AppUser, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(appusersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AppUser{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppUser), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_appversion.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_appversion.go new file mode 100644 index 000000000..4599c6d09 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_appversion.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAppVersions implements AppVersionInterface +type FakeAppVersions struct { + Fake *FakeGlobalTsmV1 +} + +var appversionsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "appversions"} + +var appversionsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AppVersion"} + +// Get takes name of the appVersion, and returns the corresponding appVersion object, and an error if there is any. +func (c *FakeAppVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AppVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(appversionsResource, name), &globaltsmtanzuvmwarecomv1.AppVersion{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppVersion), err +} + +// List takes label and field selectors, and returns the list of AppVersions that match those selectors. +func (c *FakeAppVersions) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AppVersionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(appversionsResource, appversionsKind, opts), &globaltsmtanzuvmwarecomv1.AppVersionList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AppVersionList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AppVersionList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AppVersionList).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 appVersions. +func (c *FakeAppVersions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(appversionsResource, opts)) +} + +// Create takes the representation of a appVersion and creates it. Returns the server's representation of the appVersion, and an error, if there is any. +func (c *FakeAppVersions) Create(ctx context.Context, appVersion *globaltsmtanzuvmwarecomv1.AppVersion, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AppVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(appversionsResource, appVersion), &globaltsmtanzuvmwarecomv1.AppVersion{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppVersion), err +} + +// Update takes the representation of a appVersion and updates it. Returns the server's representation of the appVersion, and an error, if there is any. +func (c *FakeAppVersions) Update(ctx context.Context, appVersion *globaltsmtanzuvmwarecomv1.AppVersion, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AppVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(appversionsResource, appVersion), &globaltsmtanzuvmwarecomv1.AppVersion{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppVersion), err +} + +// Delete takes name of the appVersion and deletes it. Returns an error if one occurs. +func (c *FakeAppVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(appversionsResource, name), &globaltsmtanzuvmwarecomv1.AppVersion{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAppVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(appversionsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AppVersionList{}) + return err +} + +// Patch applies the patch and returns the patched appVersion. +func (c *FakeAppVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AppVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(appversionsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AppVersion{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AppVersion), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_attackdiscovery.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_attackdiscovery.go new file mode 100644 index 000000000..40a7373ef --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_attackdiscovery.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAttackDiscoveries implements AttackDiscoveryInterface +type FakeAttackDiscoveries struct { + Fake *FakeGlobalTsmV1 +} + +var attackdiscoveriesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "attackdiscoveries"} + +var attackdiscoveriesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AttackDiscovery"} + +// Get takes name of the attackDiscovery, and returns the corresponding attackDiscovery object, and an error if there is any. +func (c *FakeAttackDiscoveries) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AttackDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(attackdiscoveriesResource, name), &globaltsmtanzuvmwarecomv1.AttackDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AttackDiscovery), err +} + +// List takes label and field selectors, and returns the list of AttackDiscoveries that match those selectors. +func (c *FakeAttackDiscoveries) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AttackDiscoveryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(attackdiscoveriesResource, attackdiscoveriesKind, opts), &globaltsmtanzuvmwarecomv1.AttackDiscoveryList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AttackDiscoveryList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AttackDiscoveryList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AttackDiscoveryList).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 attackDiscoveries. +func (c *FakeAttackDiscoveries) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(attackdiscoveriesResource, opts)) +} + +// Create takes the representation of a attackDiscovery and creates it. Returns the server's representation of the attackDiscovery, and an error, if there is any. +func (c *FakeAttackDiscoveries) Create(ctx context.Context, attackDiscovery *globaltsmtanzuvmwarecomv1.AttackDiscovery, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AttackDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(attackdiscoveriesResource, attackDiscovery), &globaltsmtanzuvmwarecomv1.AttackDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AttackDiscovery), err +} + +// Update takes the representation of a attackDiscovery and updates it. Returns the server's representation of the attackDiscovery, and an error, if there is any. +func (c *FakeAttackDiscoveries) Update(ctx context.Context, attackDiscovery *globaltsmtanzuvmwarecomv1.AttackDiscovery, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AttackDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(attackdiscoveriesResource, attackDiscovery), &globaltsmtanzuvmwarecomv1.AttackDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AttackDiscovery), err +} + +// Delete takes name of the attackDiscovery and deletes it. Returns an error if one occurs. +func (c *FakeAttackDiscoveries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(attackdiscoveriesResource, name), &globaltsmtanzuvmwarecomv1.AttackDiscovery{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAttackDiscoveries) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(attackdiscoveriesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AttackDiscoveryList{}) + return err +} + +// Patch applies the patch and returns the patched attackDiscovery. +func (c *FakeAttackDiscoveries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AttackDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(attackdiscoveriesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AttackDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AttackDiscovery), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_attackdiscoveryrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_attackdiscoveryrt.go new file mode 100644 index 000000000..77800e90b --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_attackdiscoveryrt.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAttackDiscoveryRTs implements AttackDiscoveryRTInterface +type FakeAttackDiscoveryRTs struct { + Fake *FakeGlobalTsmV1 +} + +var attackdiscoveryrtsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "attackdiscoveryrts"} + +var attackdiscoveryrtsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AttackDiscoveryRT"} + +// Get takes name of the attackDiscoveryRT, and returns the corresponding attackDiscoveryRT object, and an error if there is any. +func (c *FakeAttackDiscoveryRTs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AttackDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(attackdiscoveryrtsResource, name), &globaltsmtanzuvmwarecomv1.AttackDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AttackDiscoveryRT), err +} + +// List takes label and field selectors, and returns the list of AttackDiscoveryRTs that match those selectors. +func (c *FakeAttackDiscoveryRTs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AttackDiscoveryRTList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(attackdiscoveryrtsResource, attackdiscoveryrtsKind, opts), &globaltsmtanzuvmwarecomv1.AttackDiscoveryRTList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AttackDiscoveryRTList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AttackDiscoveryRTList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AttackDiscoveryRTList).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 attackDiscoveryRTs. +func (c *FakeAttackDiscoveryRTs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(attackdiscoveryrtsResource, opts)) +} + +// Create takes the representation of a attackDiscoveryRT and creates it. Returns the server's representation of the attackDiscoveryRT, and an error, if there is any. +func (c *FakeAttackDiscoveryRTs) Create(ctx context.Context, attackDiscoveryRT *globaltsmtanzuvmwarecomv1.AttackDiscoveryRT, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AttackDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(attackdiscoveryrtsResource, attackDiscoveryRT), &globaltsmtanzuvmwarecomv1.AttackDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AttackDiscoveryRT), err +} + +// Update takes the representation of a attackDiscoveryRT and updates it. Returns the server's representation of the attackDiscoveryRT, and an error, if there is any. +func (c *FakeAttackDiscoveryRTs) Update(ctx context.Context, attackDiscoveryRT *globaltsmtanzuvmwarecomv1.AttackDiscoveryRT, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AttackDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(attackdiscoveryrtsResource, attackDiscoveryRT), &globaltsmtanzuvmwarecomv1.AttackDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AttackDiscoveryRT), err +} + +// Delete takes name of the attackDiscoveryRT and deletes it. Returns an error if one occurs. +func (c *FakeAttackDiscoveryRTs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(attackdiscoveryrtsResource, name), &globaltsmtanzuvmwarecomv1.AttackDiscoveryRT{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAttackDiscoveryRTs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(attackdiscoveryrtsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AttackDiscoveryRTList{}) + return err +} + +// Patch applies the patch and returns the patched attackDiscoveryRT. +func (c *FakeAttackDiscoveryRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AttackDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(attackdiscoveryrtsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AttackDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AttackDiscoveryRT), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_authenticationpolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_authenticationpolicy.go new file mode 100644 index 000000000..a8bc4781a --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_authenticationpolicy.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAuthenticationPolicies implements AuthenticationPolicyInterface +type FakeAuthenticationPolicies struct { + Fake *FakeGlobalTsmV1 +} + +var authenticationpoliciesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "authenticationpolicies"} + +var authenticationpoliciesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AuthenticationPolicy"} + +// Get takes name of the authenticationPolicy, and returns the corresponding authenticationPolicy object, and an error if there is any. +func (c *FakeAuthenticationPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AuthenticationPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(authenticationpoliciesResource, name), &globaltsmtanzuvmwarecomv1.AuthenticationPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AuthenticationPolicy), err +} + +// List takes label and field selectors, and returns the list of AuthenticationPolicies that match those selectors. +func (c *FakeAuthenticationPolicies) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AuthenticationPolicyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(authenticationpoliciesResource, authenticationpoliciesKind, opts), &globaltsmtanzuvmwarecomv1.AuthenticationPolicyList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AuthenticationPolicyList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AuthenticationPolicyList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AuthenticationPolicyList).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 authenticationPolicies. +func (c *FakeAuthenticationPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(authenticationpoliciesResource, opts)) +} + +// Create takes the representation of a authenticationPolicy and creates it. Returns the server's representation of the authenticationPolicy, and an error, if there is any. +func (c *FakeAuthenticationPolicies) Create(ctx context.Context, authenticationPolicy *globaltsmtanzuvmwarecomv1.AuthenticationPolicy, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AuthenticationPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(authenticationpoliciesResource, authenticationPolicy), &globaltsmtanzuvmwarecomv1.AuthenticationPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AuthenticationPolicy), err +} + +// Update takes the representation of a authenticationPolicy and updates it. Returns the server's representation of the authenticationPolicy, and an error, if there is any. +func (c *FakeAuthenticationPolicies) Update(ctx context.Context, authenticationPolicy *globaltsmtanzuvmwarecomv1.AuthenticationPolicy, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AuthenticationPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(authenticationpoliciesResource, authenticationPolicy), &globaltsmtanzuvmwarecomv1.AuthenticationPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AuthenticationPolicy), err +} + +// Delete takes name of the authenticationPolicy and deletes it. Returns an error if one occurs. +func (c *FakeAuthenticationPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(authenticationpoliciesResource, name), &globaltsmtanzuvmwarecomv1.AuthenticationPolicy{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAuthenticationPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(authenticationpoliciesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AuthenticationPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched authenticationPolicy. +func (c *FakeAuthenticationPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AuthenticationPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(authenticationpoliciesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AuthenticationPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AuthenticationPolicy), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_autoscaler.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_autoscaler.go new file mode 100644 index 000000000..e2d205f36 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_autoscaler.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAutoscalers implements AutoscalerInterface +type FakeAutoscalers struct { + Fake *FakeGlobalTsmV1 +} + +var autoscalersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "autoscalers"} + +var autoscalersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Autoscaler"} + +// Get takes name of the autoscaler, and returns the corresponding autoscaler object, and an error if there is any. +func (c *FakeAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Autoscaler, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(autoscalersResource, name), &globaltsmtanzuvmwarecomv1.Autoscaler{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Autoscaler), err +} + +// List takes label and field selectors, and returns the list of Autoscalers that match those selectors. +func (c *FakeAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AutoscalerList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(autoscalersResource, autoscalersKind, opts), &globaltsmtanzuvmwarecomv1.AutoscalerList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AutoscalerList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AutoscalerList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AutoscalerList).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 autoscalers. +func (c *FakeAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(autoscalersResource, opts)) +} + +// Create takes the representation of a autoscaler and creates it. Returns the server's representation of the autoscaler, and an error, if there is any. +func (c *FakeAutoscalers) Create(ctx context.Context, autoscaler *globaltsmtanzuvmwarecomv1.Autoscaler, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Autoscaler, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(autoscalersResource, autoscaler), &globaltsmtanzuvmwarecomv1.Autoscaler{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Autoscaler), err +} + +// Update takes the representation of a autoscaler and updates it. Returns the server's representation of the autoscaler, and an error, if there is any. +func (c *FakeAutoscalers) Update(ctx context.Context, autoscaler *globaltsmtanzuvmwarecomv1.Autoscaler, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Autoscaler, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(autoscalersResource, autoscaler), &globaltsmtanzuvmwarecomv1.Autoscaler{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Autoscaler), err +} + +// Delete takes name of the autoscaler and deletes it. Returns an error if one occurs. +func (c *FakeAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(autoscalersResource, name), &globaltsmtanzuvmwarecomv1.Autoscaler{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(autoscalersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AutoscalerList{}) + return err +} + +// Patch applies the patch and returns the patched autoscaler. +func (c *FakeAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Autoscaler, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(autoscalersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Autoscaler{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Autoscaler), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_autoscalerconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_autoscalerconfig.go new file mode 100644 index 000000000..54b3c2932 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_autoscalerconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAutoscalerConfigs implements AutoscalerConfigInterface +type FakeAutoscalerConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var autoscalerconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "autoscalerconfigs"} + +var autoscalerconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AutoscalerConfig"} + +// Get takes name of the autoscalerConfig, and returns the corresponding autoscalerConfig object, and an error if there is any. +func (c *FakeAutoscalerConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AutoscalerConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(autoscalerconfigsResource, name), &globaltsmtanzuvmwarecomv1.AutoscalerConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AutoscalerConfig), err +} + +// List takes label and field selectors, and returns the list of AutoscalerConfigs that match those selectors. +func (c *FakeAutoscalerConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AutoscalerConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(autoscalerconfigsResource, autoscalerconfigsKind, opts), &globaltsmtanzuvmwarecomv1.AutoscalerConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AutoscalerConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AutoscalerConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AutoscalerConfigList).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 autoscalerConfigs. +func (c *FakeAutoscalerConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(autoscalerconfigsResource, opts)) +} + +// Create takes the representation of a autoscalerConfig and creates it. Returns the server's representation of the autoscalerConfig, and an error, if there is any. +func (c *FakeAutoscalerConfigs) Create(ctx context.Context, autoscalerConfig *globaltsmtanzuvmwarecomv1.AutoscalerConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AutoscalerConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(autoscalerconfigsResource, autoscalerConfig), &globaltsmtanzuvmwarecomv1.AutoscalerConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AutoscalerConfig), err +} + +// Update takes the representation of a autoscalerConfig and updates it. Returns the server's representation of the autoscalerConfig, and an error, if there is any. +func (c *FakeAutoscalerConfigs) Update(ctx context.Context, autoscalerConfig *globaltsmtanzuvmwarecomv1.AutoscalerConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AutoscalerConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(autoscalerconfigsResource, autoscalerConfig), &globaltsmtanzuvmwarecomv1.AutoscalerConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AutoscalerConfig), err +} + +// Delete takes name of the autoscalerConfig and deletes it. Returns an error if one occurs. +func (c *FakeAutoscalerConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(autoscalerconfigsResource, name), &globaltsmtanzuvmwarecomv1.AutoscalerConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAutoscalerConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(autoscalerconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AutoscalerConfigList{}) + return err +} + +// Patch applies the patch and returns the patched autoscalerConfig. +func (c *FakeAutoscalerConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AutoscalerConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(autoscalerconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AutoscalerConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AutoscalerConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_autoscalercr.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_autoscalercr.go new file mode 100644 index 000000000..e99816c1f --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_autoscalercr.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAutoscalerCRs implements AutoscalerCRInterface +type FakeAutoscalerCRs struct { + Fake *FakeGlobalTsmV1 +} + +var autoscalercrsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "autoscalercrs"} + +var autoscalercrsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AutoscalerCR"} + +// Get takes name of the autoscalerCR, and returns the corresponding autoscalerCR object, and an error if there is any. +func (c *FakeAutoscalerCRs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AutoscalerCR, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(autoscalercrsResource, name), &globaltsmtanzuvmwarecomv1.AutoscalerCR{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AutoscalerCR), err +} + +// List takes label and field selectors, and returns the list of AutoscalerCRs that match those selectors. +func (c *FakeAutoscalerCRs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AutoscalerCRList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(autoscalercrsResource, autoscalercrsKind, opts), &globaltsmtanzuvmwarecomv1.AutoscalerCRList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AutoscalerCRList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AutoscalerCRList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AutoscalerCRList).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 autoscalerCRs. +func (c *FakeAutoscalerCRs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(autoscalercrsResource, opts)) +} + +// Create takes the representation of a autoscalerCR and creates it. Returns the server's representation of the autoscalerCR, and an error, if there is any. +func (c *FakeAutoscalerCRs) Create(ctx context.Context, autoscalerCR *globaltsmtanzuvmwarecomv1.AutoscalerCR, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AutoscalerCR, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(autoscalercrsResource, autoscalerCR), &globaltsmtanzuvmwarecomv1.AutoscalerCR{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AutoscalerCR), err +} + +// Update takes the representation of a autoscalerCR and updates it. Returns the server's representation of the autoscalerCR, and an error, if there is any. +func (c *FakeAutoscalerCRs) Update(ctx context.Context, autoscalerCR *globaltsmtanzuvmwarecomv1.AutoscalerCR, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AutoscalerCR, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(autoscalercrsResource, autoscalerCR), &globaltsmtanzuvmwarecomv1.AutoscalerCR{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AutoscalerCR), err +} + +// Delete takes name of the autoscalerCR and deletes it. Returns an error if one occurs. +func (c *FakeAutoscalerCRs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(autoscalercrsResource, name), &globaltsmtanzuvmwarecomv1.AutoscalerCR{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAutoscalerCRs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(autoscalercrsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AutoscalerCRList{}) + return err +} + +// Patch applies the patch and returns the patched autoscalerCR. +func (c *FakeAutoscalerCRs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AutoscalerCR, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(autoscalercrsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AutoscalerCR{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AutoscalerCR), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_autoscalerfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_autoscalerfolder.go new file mode 100644 index 000000000..8eef78735 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_autoscalerfolder.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAutoscalerFolders implements AutoscalerFolderInterface +type FakeAutoscalerFolders struct { + Fake *FakeGlobalTsmV1 +} + +var autoscalerfoldersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "autoscalerfolders"} + +var autoscalerfoldersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AutoscalerFolder"} + +// Get takes name of the autoscalerFolder, and returns the corresponding autoscalerFolder object, and an error if there is any. +func (c *FakeAutoscalerFolders) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AutoscalerFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(autoscalerfoldersResource, name), &globaltsmtanzuvmwarecomv1.AutoscalerFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AutoscalerFolder), err +} + +// List takes label and field selectors, and returns the list of AutoscalerFolders that match those selectors. +func (c *FakeAutoscalerFolders) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AutoscalerFolderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(autoscalerfoldersResource, autoscalerfoldersKind, opts), &globaltsmtanzuvmwarecomv1.AutoscalerFolderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AutoscalerFolderList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AutoscalerFolderList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AutoscalerFolderList).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 autoscalerFolders. +func (c *FakeAutoscalerFolders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(autoscalerfoldersResource, opts)) +} + +// Create takes the representation of a autoscalerFolder and creates it. Returns the server's representation of the autoscalerFolder, and an error, if there is any. +func (c *FakeAutoscalerFolders) Create(ctx context.Context, autoscalerFolder *globaltsmtanzuvmwarecomv1.AutoscalerFolder, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AutoscalerFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(autoscalerfoldersResource, autoscalerFolder), &globaltsmtanzuvmwarecomv1.AutoscalerFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AutoscalerFolder), err +} + +// Update takes the representation of a autoscalerFolder and updates it. Returns the server's representation of the autoscalerFolder, and an error, if there is any. +func (c *FakeAutoscalerFolders) Update(ctx context.Context, autoscalerFolder *globaltsmtanzuvmwarecomv1.AutoscalerFolder, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AutoscalerFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(autoscalerfoldersResource, autoscalerFolder), &globaltsmtanzuvmwarecomv1.AutoscalerFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AutoscalerFolder), err +} + +// Delete takes name of the autoscalerFolder and deletes it. Returns an error if one occurs. +func (c *FakeAutoscalerFolders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(autoscalerfoldersResource, name), &globaltsmtanzuvmwarecomv1.AutoscalerFolder{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAutoscalerFolders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(autoscalerfoldersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AutoscalerFolderList{}) + return err +} + +// Patch applies the patch and returns the patched autoscalerFolder. +func (c *FakeAutoscalerFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AutoscalerFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(autoscalerfoldersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AutoscalerFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AutoscalerFolder), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_autoscalingpolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_autoscalingpolicy.go new file mode 100644 index 000000000..a6397303e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_autoscalingpolicy.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAutoscalingPolicies implements AutoscalingPolicyInterface +type FakeAutoscalingPolicies struct { + Fake *FakeGlobalTsmV1 +} + +var autoscalingpoliciesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "autoscalingpolicies"} + +var autoscalingpoliciesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AutoscalingPolicy"} + +// Get takes name of the autoscalingPolicy, and returns the corresponding autoscalingPolicy object, and an error if there is any. +func (c *FakeAutoscalingPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AutoscalingPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(autoscalingpoliciesResource, name), &globaltsmtanzuvmwarecomv1.AutoscalingPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AutoscalingPolicy), err +} + +// List takes label and field selectors, and returns the list of AutoscalingPolicies that match those selectors. +func (c *FakeAutoscalingPolicies) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AutoscalingPolicyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(autoscalingpoliciesResource, autoscalingpoliciesKind, opts), &globaltsmtanzuvmwarecomv1.AutoscalingPolicyList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AutoscalingPolicyList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AutoscalingPolicyList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AutoscalingPolicyList).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 autoscalingPolicies. +func (c *FakeAutoscalingPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(autoscalingpoliciesResource, opts)) +} + +// Create takes the representation of a autoscalingPolicy and creates it. Returns the server's representation of the autoscalingPolicy, and an error, if there is any. +func (c *FakeAutoscalingPolicies) Create(ctx context.Context, autoscalingPolicy *globaltsmtanzuvmwarecomv1.AutoscalingPolicy, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AutoscalingPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(autoscalingpoliciesResource, autoscalingPolicy), &globaltsmtanzuvmwarecomv1.AutoscalingPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AutoscalingPolicy), err +} + +// Update takes the representation of a autoscalingPolicy and updates it. Returns the server's representation of the autoscalingPolicy, and an error, if there is any. +func (c *FakeAutoscalingPolicies) Update(ctx context.Context, autoscalingPolicy *globaltsmtanzuvmwarecomv1.AutoscalingPolicy, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AutoscalingPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(autoscalingpoliciesResource, autoscalingPolicy), &globaltsmtanzuvmwarecomv1.AutoscalingPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AutoscalingPolicy), err +} + +// Delete takes name of the autoscalingPolicy and deletes it. Returns an error if one occurs. +func (c *FakeAutoscalingPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(autoscalingpoliciesResource, name), &globaltsmtanzuvmwarecomv1.AutoscalingPolicy{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAutoscalingPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(autoscalingpoliciesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AutoscalingPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched autoscalingPolicy. +func (c *FakeAutoscalingPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AutoscalingPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(autoscalingpoliciesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AutoscalingPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AutoscalingPolicy), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_awsconnector.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_awsconnector.go new file mode 100644 index 000000000..115629440 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_awsconnector.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeAwsConnectors implements AwsConnectorInterface +type FakeAwsConnectors struct { + Fake *FakeGlobalTsmV1 +} + +var awsconnectorsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "awsconnectors"} + +var awsconnectorsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "AwsConnector"} + +// Get takes name of the awsConnector, and returns the corresponding awsConnector object, and an error if there is any. +func (c *FakeAwsConnectors) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.AwsConnector, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(awsconnectorsResource, name), &globaltsmtanzuvmwarecomv1.AwsConnector{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AwsConnector), err +} + +// List takes label and field selectors, and returns the list of AwsConnectors that match those selectors. +func (c *FakeAwsConnectors) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.AwsConnectorList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(awsconnectorsResource, awsconnectorsKind, opts), &globaltsmtanzuvmwarecomv1.AwsConnectorList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.AwsConnectorList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.AwsConnectorList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.AwsConnectorList).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 awsConnectors. +func (c *FakeAwsConnectors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(awsconnectorsResource, opts)) +} + +// Create takes the representation of a awsConnector and creates it. Returns the server's representation of the awsConnector, and an error, if there is any. +func (c *FakeAwsConnectors) Create(ctx context.Context, awsConnector *globaltsmtanzuvmwarecomv1.AwsConnector, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.AwsConnector, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(awsconnectorsResource, awsConnector), &globaltsmtanzuvmwarecomv1.AwsConnector{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AwsConnector), err +} + +// Update takes the representation of a awsConnector and updates it. Returns the server's representation of the awsConnector, and an error, if there is any. +func (c *FakeAwsConnectors) Update(ctx context.Context, awsConnector *globaltsmtanzuvmwarecomv1.AwsConnector, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.AwsConnector, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(awsconnectorsResource, awsConnector), &globaltsmtanzuvmwarecomv1.AwsConnector{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AwsConnector), err +} + +// Delete takes name of the awsConnector and deletes it. Returns an error if one occurs. +func (c *FakeAwsConnectors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(awsconnectorsResource, name), &globaltsmtanzuvmwarecomv1.AwsConnector{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAwsConnectors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(awsconnectorsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.AwsConnectorList{}) + return err +} + +// Patch applies the patch and returns the patched awsConnector. +func (c *FakeAwsConnectors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.AwsConnector, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(awsconnectorsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.AwsConnector{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.AwsConnector), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_bucket.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_bucket.go new file mode 100644 index 000000000..57cde5791 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_bucket.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeBuckets implements BucketInterface +type FakeBuckets struct { + Fake *FakeGlobalTsmV1 +} + +var bucketsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "buckets"} + +var bucketsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Bucket"} + +// Get takes name of the bucket, and returns the corresponding bucket object, and an error if there is any. +func (c *FakeBuckets) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Bucket, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(bucketsResource, name), &globaltsmtanzuvmwarecomv1.Bucket{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Bucket), err +} + +// List takes label and field selectors, and returns the list of Buckets that match those selectors. +func (c *FakeBuckets) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.BucketList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(bucketsResource, bucketsKind, opts), &globaltsmtanzuvmwarecomv1.BucketList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.BucketList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.BucketList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.BucketList).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 buckets. +func (c *FakeBuckets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(bucketsResource, opts)) +} + +// Create takes the representation of a bucket and creates it. Returns the server's representation of the bucket, and an error, if there is any. +func (c *FakeBuckets) Create(ctx context.Context, bucket *globaltsmtanzuvmwarecomv1.Bucket, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Bucket, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(bucketsResource, bucket), &globaltsmtanzuvmwarecomv1.Bucket{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Bucket), err +} + +// Update takes the representation of a bucket and updates it. Returns the server's representation of the bucket, and an error, if there is any. +func (c *FakeBuckets) Update(ctx context.Context, bucket *globaltsmtanzuvmwarecomv1.Bucket, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Bucket, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(bucketsResource, bucket), &globaltsmtanzuvmwarecomv1.Bucket{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Bucket), err +} + +// Delete takes name of the bucket and deletes it. Returns an error if one occurs. +func (c *FakeBuckets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(bucketsResource, name), &globaltsmtanzuvmwarecomv1.Bucket{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBuckets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(bucketsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.BucketList{}) + return err +} + +// Patch applies the patch and returns the patched bucket. +func (c *FakeBuckets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Bucket, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(bucketsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Bucket{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Bucket), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_certificate.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_certificate.go new file mode 100644 index 000000000..aca5c251d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_certificate.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeCertificates implements CertificateInterface +type FakeCertificates struct { + Fake *FakeGlobalTsmV1 +} + +var certificatesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "certificates"} + +var certificatesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Certificate"} + +// Get takes name of the certificate, and returns the corresponding certificate object, and an error if there is any. +func (c *FakeCertificates) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Certificate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(certificatesResource, name), &globaltsmtanzuvmwarecomv1.Certificate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Certificate), err +} + +// List takes label and field selectors, and returns the list of Certificates that match those selectors. +func (c *FakeCertificates) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.CertificateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(certificatesResource, certificatesKind, opts), &globaltsmtanzuvmwarecomv1.CertificateList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.CertificateList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.CertificateList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.CertificateList).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 certificates. +func (c *FakeCertificates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(certificatesResource, opts)) +} + +// Create takes the representation of a certificate and creates it. Returns the server's representation of the certificate, and an error, if there is any. +func (c *FakeCertificates) Create(ctx context.Context, certificate *globaltsmtanzuvmwarecomv1.Certificate, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Certificate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(certificatesResource, certificate), &globaltsmtanzuvmwarecomv1.Certificate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Certificate), err +} + +// Update takes the representation of a certificate and updates it. Returns the server's representation of the certificate, and an error, if there is any. +func (c *FakeCertificates) Update(ctx context.Context, certificate *globaltsmtanzuvmwarecomv1.Certificate, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Certificate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(certificatesResource, certificate), &globaltsmtanzuvmwarecomv1.Certificate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Certificate), err +} + +// Delete takes name of the certificate and deletes it. Returns an error if one occurs. +func (c *FakeCertificates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(certificatesResource, name), &globaltsmtanzuvmwarecomv1.Certificate{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeCertificates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(certificatesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.CertificateList{}) + return err +} + +// Patch applies the patch and returns the patched certificate. +func (c *FakeCertificates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Certificate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(certificatesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Certificate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Certificate), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_certificateauthorityconfign.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_certificateauthorityconfign.go new file mode 100644 index 000000000..c398444cb --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_certificateauthorityconfign.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeCertificateAuthorityConfigNs implements CertificateAuthorityConfigNInterface +type FakeCertificateAuthorityConfigNs struct { + Fake *FakeGlobalTsmV1 +} + +var certificateauthorityconfignsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "certificateauthorityconfigns"} + +var certificateauthorityconfignsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "CertificateAuthorityConfigN"} + +// Get takes name of the certificateAuthorityConfigN, and returns the corresponding certificateAuthorityConfigN object, and an error if there is any. +func (c *FakeCertificateAuthorityConfigNs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(certificateauthorityconfignsResource, name), &globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN), err +} + +// List takes label and field selectors, and returns the list of CertificateAuthorityConfigNs that match those selectors. +func (c *FakeCertificateAuthorityConfigNs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigNList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(certificateauthorityconfignsResource, certificateauthorityconfignsKind, opts), &globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigNList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigNList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigNList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigNList).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 certificateAuthorityConfigNs. +func (c *FakeCertificateAuthorityConfigNs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(certificateauthorityconfignsResource, opts)) +} + +// Create takes the representation of a certificateAuthorityConfigN and creates it. Returns the server's representation of the certificateAuthorityConfigN, and an error, if there is any. +func (c *FakeCertificateAuthorityConfigNs) Create(ctx context.Context, certificateAuthorityConfigN *globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(certificateauthorityconfignsResource, certificateAuthorityConfigN), &globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN), err +} + +// Update takes the representation of a certificateAuthorityConfigN and updates it. Returns the server's representation of the certificateAuthorityConfigN, and an error, if there is any. +func (c *FakeCertificateAuthorityConfigNs) Update(ctx context.Context, certificateAuthorityConfigN *globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(certificateauthorityconfignsResource, certificateAuthorityConfigN), &globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN), err +} + +// Delete takes name of the certificateAuthorityConfigN and deletes it. Returns an error if one occurs. +func (c *FakeCertificateAuthorityConfigNs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(certificateauthorityconfignsResource, name), &globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeCertificateAuthorityConfigNs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(certificateauthorityconfignsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigNList{}) + return err +} + +// Patch applies the patch and returns the patched certificateAuthorityConfigN. +func (c *FakeCertificateAuthorityConfigNs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(certificateauthorityconfignsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_certificateauthorityrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_certificateauthorityrt.go new file mode 100644 index 000000000..4257766c7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_certificateauthorityrt.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeCertificateAuthorityRTs implements CertificateAuthorityRTInterface +type FakeCertificateAuthorityRTs struct { + Fake *FakeGlobalTsmV1 +} + +var certificateauthorityrtsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "certificateauthorityrts"} + +var certificateauthorityrtsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "CertificateAuthorityRT"} + +// Get takes name of the certificateAuthorityRT, and returns the corresponding certificateAuthorityRT object, and an error if there is any. +func (c *FakeCertificateAuthorityRTs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.CertificateAuthorityRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(certificateauthorityrtsResource, name), &globaltsmtanzuvmwarecomv1.CertificateAuthorityRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.CertificateAuthorityRT), err +} + +// List takes label and field selectors, and returns the list of CertificateAuthorityRTs that match those selectors. +func (c *FakeCertificateAuthorityRTs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.CertificateAuthorityRTList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(certificateauthorityrtsResource, certificateauthorityrtsKind, opts), &globaltsmtanzuvmwarecomv1.CertificateAuthorityRTList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.CertificateAuthorityRTList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.CertificateAuthorityRTList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.CertificateAuthorityRTList).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 certificateAuthorityRTs. +func (c *FakeCertificateAuthorityRTs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(certificateauthorityrtsResource, opts)) +} + +// Create takes the representation of a certificateAuthorityRT and creates it. Returns the server's representation of the certificateAuthorityRT, and an error, if there is any. +func (c *FakeCertificateAuthorityRTs) Create(ctx context.Context, certificateAuthorityRT *globaltsmtanzuvmwarecomv1.CertificateAuthorityRT, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.CertificateAuthorityRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(certificateauthorityrtsResource, certificateAuthorityRT), &globaltsmtanzuvmwarecomv1.CertificateAuthorityRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.CertificateAuthorityRT), err +} + +// Update takes the representation of a certificateAuthorityRT and updates it. Returns the server's representation of the certificateAuthorityRT, and an error, if there is any. +func (c *FakeCertificateAuthorityRTs) Update(ctx context.Context, certificateAuthorityRT *globaltsmtanzuvmwarecomv1.CertificateAuthorityRT, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.CertificateAuthorityRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(certificateauthorityrtsResource, certificateAuthorityRT), &globaltsmtanzuvmwarecomv1.CertificateAuthorityRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.CertificateAuthorityRT), err +} + +// Delete takes name of the certificateAuthorityRT and deletes it. Returns an error if one occurs. +func (c *FakeCertificateAuthorityRTs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(certificateauthorityrtsResource, name), &globaltsmtanzuvmwarecomv1.CertificateAuthorityRT{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeCertificateAuthorityRTs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(certificateauthorityrtsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.CertificateAuthorityRTList{}) + return err +} + +// Patch applies the patch and returns the patched certificateAuthorityRT. +func (c *FakeCertificateAuthorityRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.CertificateAuthorityRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(certificateauthorityrtsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.CertificateAuthorityRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.CertificateAuthorityRT), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_certificateconfign.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_certificateconfign.go new file mode 100644 index 000000000..895b77ab1 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_certificateconfign.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeCertificateConfigNs implements CertificateConfigNInterface +type FakeCertificateConfigNs struct { + Fake *FakeGlobalTsmV1 +} + +var certificateconfignsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "certificateconfigns"} + +var certificateconfignsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "CertificateConfigN"} + +// Get takes name of the certificateConfigN, and returns the corresponding certificateConfigN object, and an error if there is any. +func (c *FakeCertificateConfigNs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.CertificateConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(certificateconfignsResource, name), &globaltsmtanzuvmwarecomv1.CertificateConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.CertificateConfigN), err +} + +// List takes label and field selectors, and returns the list of CertificateConfigNs that match those selectors. +func (c *FakeCertificateConfigNs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.CertificateConfigNList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(certificateconfignsResource, certificateconfignsKind, opts), &globaltsmtanzuvmwarecomv1.CertificateConfigNList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.CertificateConfigNList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.CertificateConfigNList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.CertificateConfigNList).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 certificateConfigNs. +func (c *FakeCertificateConfigNs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(certificateconfignsResource, opts)) +} + +// Create takes the representation of a certificateConfigN and creates it. Returns the server's representation of the certificateConfigN, and an error, if there is any. +func (c *FakeCertificateConfigNs) Create(ctx context.Context, certificateConfigN *globaltsmtanzuvmwarecomv1.CertificateConfigN, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.CertificateConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(certificateconfignsResource, certificateConfigN), &globaltsmtanzuvmwarecomv1.CertificateConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.CertificateConfigN), err +} + +// Update takes the representation of a certificateConfigN and updates it. Returns the server's representation of the certificateConfigN, and an error, if there is any. +func (c *FakeCertificateConfigNs) Update(ctx context.Context, certificateConfigN *globaltsmtanzuvmwarecomv1.CertificateConfigN, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.CertificateConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(certificateconfignsResource, certificateConfigN), &globaltsmtanzuvmwarecomv1.CertificateConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.CertificateConfigN), err +} + +// Delete takes name of the certificateConfigN and deletes it. Returns an error if one occurs. +func (c *FakeCertificateConfigNs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(certificateconfignsResource, name), &globaltsmtanzuvmwarecomv1.CertificateConfigN{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeCertificateConfigNs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(certificateconfignsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.CertificateConfigNList{}) + return err +} + +// Patch applies the patch and returns the patched certificateConfigN. +func (c *FakeCertificateConfigNs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.CertificateConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(certificateconfignsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.CertificateConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.CertificateConfigN), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_certificaterequest.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_certificaterequest.go new file mode 100644 index 000000000..d16294b30 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_certificaterequest.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeCertificateRequests implements CertificateRequestInterface +type FakeCertificateRequests struct { + Fake *FakeGlobalTsmV1 +} + +var certificaterequestsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "certificaterequests"} + +var certificaterequestsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "CertificateRequest"} + +// Get takes name of the certificateRequest, and returns the corresponding certificateRequest object, and an error if there is any. +func (c *FakeCertificateRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.CertificateRequest, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(certificaterequestsResource, name), &globaltsmtanzuvmwarecomv1.CertificateRequest{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.CertificateRequest), err +} + +// List takes label and field selectors, and returns the list of CertificateRequests that match those selectors. +func (c *FakeCertificateRequests) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.CertificateRequestList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(certificaterequestsResource, certificaterequestsKind, opts), &globaltsmtanzuvmwarecomv1.CertificateRequestList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.CertificateRequestList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.CertificateRequestList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.CertificateRequestList).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 certificateRequests. +func (c *FakeCertificateRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(certificaterequestsResource, opts)) +} + +// Create takes the representation of a certificateRequest and creates it. Returns the server's representation of the certificateRequest, and an error, if there is any. +func (c *FakeCertificateRequests) Create(ctx context.Context, certificateRequest *globaltsmtanzuvmwarecomv1.CertificateRequest, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.CertificateRequest, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(certificaterequestsResource, certificateRequest), &globaltsmtanzuvmwarecomv1.CertificateRequest{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.CertificateRequest), err +} + +// Update takes the representation of a certificateRequest and updates it. Returns the server's representation of the certificateRequest, and an error, if there is any. +func (c *FakeCertificateRequests) Update(ctx context.Context, certificateRequest *globaltsmtanzuvmwarecomv1.CertificateRequest, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.CertificateRequest, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(certificaterequestsResource, certificateRequest), &globaltsmtanzuvmwarecomv1.CertificateRequest{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.CertificateRequest), err +} + +// Delete takes name of the certificateRequest and deletes it. Returns an error if one occurs. +func (c *FakeCertificateRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(certificaterequestsResource, name), &globaltsmtanzuvmwarecomv1.CertificateRequest{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeCertificateRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(certificaterequestsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.CertificateRequestList{}) + return err +} + +// Patch applies the patch and returns the patched certificateRequest. +func (c *FakeCertificateRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.CertificateRequest, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(certificaterequestsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.CertificateRequest{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.CertificateRequest), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_cluster.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_cluster.go new file mode 100644 index 000000000..acdea128a --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_cluster.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeClusters implements ClusterInterface +type FakeClusters struct { + Fake *FakeGlobalTsmV1 +} + +var clustersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "clusters"} + +var clustersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Cluster"} + +// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any. +func (c *FakeClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Cluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clustersResource, name), &globaltsmtanzuvmwarecomv1.Cluster{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Cluster), err +} + +// List takes label and field selectors, and returns the list of Clusters that match those selectors. +func (c *FakeClusters) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ClusterList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clustersResource, clustersKind, opts), &globaltsmtanzuvmwarecomv1.ClusterList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ClusterList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ClusterList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ClusterList).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 clusters. +func (c *FakeClusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clustersResource, opts)) +} + +// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any. +func (c *FakeClusters) Create(ctx context.Context, cluster *globaltsmtanzuvmwarecomv1.Cluster, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Cluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clustersResource, cluster), &globaltsmtanzuvmwarecomv1.Cluster{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Cluster), err +} + +// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any. +func (c *FakeClusters) Update(ctx context.Context, cluster *globaltsmtanzuvmwarecomv1.Cluster, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Cluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clustersResource, cluster), &globaltsmtanzuvmwarecomv1.Cluster{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Cluster), err +} + +// Delete takes name of the cluster and deletes it. Returns an error if one occurs. +func (c *FakeClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(clustersResource, name), &globaltsmtanzuvmwarecomv1.Cluster{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clustersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ClusterList{}) + return err +} + +// Patch applies the patch and returns the patched cluster. +func (c *FakeClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Cluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clustersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Cluster{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Cluster), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_clusterconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_clusterconfig.go new file mode 100644 index 000000000..5c6081ca7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_clusterconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeClusterConfigs implements ClusterConfigInterface +type FakeClusterConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var clusterconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "clusterconfigs"} + +var clusterconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ClusterConfig"} + +// Get takes name of the clusterConfig, and returns the corresponding clusterConfig object, and an error if there is any. +func (c *FakeClusterConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ClusterConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clusterconfigsResource, name), &globaltsmtanzuvmwarecomv1.ClusterConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ClusterConfig), err +} + +// List takes label and field selectors, and returns the list of ClusterConfigs that match those selectors. +func (c *FakeClusterConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ClusterConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clusterconfigsResource, clusterconfigsKind, opts), &globaltsmtanzuvmwarecomv1.ClusterConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ClusterConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ClusterConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ClusterConfigList).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 clusterConfigs. +func (c *FakeClusterConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clusterconfigsResource, opts)) +} + +// Create takes the representation of a clusterConfig and creates it. Returns the server's representation of the clusterConfig, and an error, if there is any. +func (c *FakeClusterConfigs) Create(ctx context.Context, clusterConfig *globaltsmtanzuvmwarecomv1.ClusterConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ClusterConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clusterconfigsResource, clusterConfig), &globaltsmtanzuvmwarecomv1.ClusterConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ClusterConfig), err +} + +// Update takes the representation of a clusterConfig and updates it. Returns the server's representation of the clusterConfig, and an error, if there is any. +func (c *FakeClusterConfigs) Update(ctx context.Context, clusterConfig *globaltsmtanzuvmwarecomv1.ClusterConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ClusterConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clusterconfigsResource, clusterConfig), &globaltsmtanzuvmwarecomv1.ClusterConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ClusterConfig), err +} + +// Delete takes name of the clusterConfig and deletes it. Returns an error if one occurs. +func (c *FakeClusterConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(clusterconfigsResource, name), &globaltsmtanzuvmwarecomv1.ClusterConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clusterconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ClusterConfigList{}) + return err +} + +// Patch applies the patch and returns the patched clusterConfig. +func (c *FakeClusterConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ClusterConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clusterconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ClusterConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ClusterConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_clusterconfigfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_clusterconfigfolder.go new file mode 100644 index 000000000..c80d1728e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_clusterconfigfolder.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeClusterConfigFolders implements ClusterConfigFolderInterface +type FakeClusterConfigFolders struct { + Fake *FakeGlobalTsmV1 +} + +var clusterconfigfoldersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "clusterconfigfolders"} + +var clusterconfigfoldersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ClusterConfigFolder"} + +// Get takes name of the clusterConfigFolder, and returns the corresponding clusterConfigFolder object, and an error if there is any. +func (c *FakeClusterConfigFolders) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ClusterConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clusterconfigfoldersResource, name), &globaltsmtanzuvmwarecomv1.ClusterConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ClusterConfigFolder), err +} + +// List takes label and field selectors, and returns the list of ClusterConfigFolders that match those selectors. +func (c *FakeClusterConfigFolders) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ClusterConfigFolderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clusterconfigfoldersResource, clusterconfigfoldersKind, opts), &globaltsmtanzuvmwarecomv1.ClusterConfigFolderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ClusterConfigFolderList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ClusterConfigFolderList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ClusterConfigFolderList).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 clusterConfigFolders. +func (c *FakeClusterConfigFolders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clusterconfigfoldersResource, opts)) +} + +// Create takes the representation of a clusterConfigFolder and creates it. Returns the server's representation of the clusterConfigFolder, and an error, if there is any. +func (c *FakeClusterConfigFolders) Create(ctx context.Context, clusterConfigFolder *globaltsmtanzuvmwarecomv1.ClusterConfigFolder, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ClusterConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clusterconfigfoldersResource, clusterConfigFolder), &globaltsmtanzuvmwarecomv1.ClusterConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ClusterConfigFolder), err +} + +// Update takes the representation of a clusterConfigFolder and updates it. Returns the server's representation of the clusterConfigFolder, and an error, if there is any. +func (c *FakeClusterConfigFolders) Update(ctx context.Context, clusterConfigFolder *globaltsmtanzuvmwarecomv1.ClusterConfigFolder, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ClusterConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clusterconfigfoldersResource, clusterConfigFolder), &globaltsmtanzuvmwarecomv1.ClusterConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ClusterConfigFolder), err +} + +// Delete takes name of the clusterConfigFolder and deletes it. Returns an error if one occurs. +func (c *FakeClusterConfigFolders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(clusterconfigfoldersResource, name), &globaltsmtanzuvmwarecomv1.ClusterConfigFolder{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterConfigFolders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clusterconfigfoldersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ClusterConfigFolderList{}) + return err +} + +// Patch applies the patch and returns the patched clusterConfigFolder. +func (c *FakeClusterConfigFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ClusterConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clusterconfigfoldersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ClusterConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ClusterConfigFolder), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_clusterfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_clusterfolder.go new file mode 100644 index 000000000..c25bc27e7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_clusterfolder.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeClusterFolders implements ClusterFolderInterface +type FakeClusterFolders struct { + Fake *FakeGlobalTsmV1 +} + +var clusterfoldersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "clusterfolders"} + +var clusterfoldersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ClusterFolder"} + +// Get takes name of the clusterFolder, and returns the corresponding clusterFolder object, and an error if there is any. +func (c *FakeClusterFolders) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ClusterFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clusterfoldersResource, name), &globaltsmtanzuvmwarecomv1.ClusterFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ClusterFolder), err +} + +// List takes label and field selectors, and returns the list of ClusterFolders that match those selectors. +func (c *FakeClusterFolders) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ClusterFolderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clusterfoldersResource, clusterfoldersKind, opts), &globaltsmtanzuvmwarecomv1.ClusterFolderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ClusterFolderList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ClusterFolderList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ClusterFolderList).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 clusterFolders. +func (c *FakeClusterFolders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clusterfoldersResource, opts)) +} + +// Create takes the representation of a clusterFolder and creates it. Returns the server's representation of the clusterFolder, and an error, if there is any. +func (c *FakeClusterFolders) Create(ctx context.Context, clusterFolder *globaltsmtanzuvmwarecomv1.ClusterFolder, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ClusterFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clusterfoldersResource, clusterFolder), &globaltsmtanzuvmwarecomv1.ClusterFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ClusterFolder), err +} + +// Update takes the representation of a clusterFolder and updates it. Returns the server's representation of the clusterFolder, and an error, if there is any. +func (c *FakeClusterFolders) Update(ctx context.Context, clusterFolder *globaltsmtanzuvmwarecomv1.ClusterFolder, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ClusterFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clusterfoldersResource, clusterFolder), &globaltsmtanzuvmwarecomv1.ClusterFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ClusterFolder), err +} + +// Delete takes name of the clusterFolder and deletes it. Returns an error if one occurs. +func (c *FakeClusterFolders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(clusterfoldersResource, name), &globaltsmtanzuvmwarecomv1.ClusterFolder{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterFolders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clusterfoldersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ClusterFolderList{}) + return err +} + +// Patch applies the patch and returns the patched clusterFolder. +func (c *FakeClusterFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ClusterFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clusterfoldersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ClusterFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ClusterFolder), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_clustersettings.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_clustersettings.go new file mode 100644 index 000000000..055b255eb --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_clustersettings.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeClusterSettingses implements ClusterSettingsInterface +type FakeClusterSettingses struct { + Fake *FakeGlobalTsmV1 +} + +var clustersettingsesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "clustersettingses"} + +var clustersettingsesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ClusterSettings"} + +// Get takes name of the clusterSettings, and returns the corresponding clusterSettings object, and an error if there is any. +func (c *FakeClusterSettingses) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ClusterSettings, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clustersettingsesResource, name), &globaltsmtanzuvmwarecomv1.ClusterSettings{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ClusterSettings), err +} + +// List takes label and field selectors, and returns the list of ClusterSettingses that match those selectors. +func (c *FakeClusterSettingses) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ClusterSettingsList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clustersettingsesResource, clustersettingsesKind, opts), &globaltsmtanzuvmwarecomv1.ClusterSettingsList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ClusterSettingsList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ClusterSettingsList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ClusterSettingsList).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 clusterSettingses. +func (c *FakeClusterSettingses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clustersettingsesResource, opts)) +} + +// Create takes the representation of a clusterSettings and creates it. Returns the server's representation of the clusterSettings, and an error, if there is any. +func (c *FakeClusterSettingses) Create(ctx context.Context, clusterSettings *globaltsmtanzuvmwarecomv1.ClusterSettings, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ClusterSettings, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clustersettingsesResource, clusterSettings), &globaltsmtanzuvmwarecomv1.ClusterSettings{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ClusterSettings), err +} + +// Update takes the representation of a clusterSettings and updates it. Returns the server's representation of the clusterSettings, and an error, if there is any. +func (c *FakeClusterSettingses) Update(ctx context.Context, clusterSettings *globaltsmtanzuvmwarecomv1.ClusterSettings, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ClusterSettings, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clustersettingsesResource, clusterSettings), &globaltsmtanzuvmwarecomv1.ClusterSettings{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ClusterSettings), err +} + +// Delete takes name of the clusterSettings and deletes it. Returns an error if one occurs. +func (c *FakeClusterSettingses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(clustersettingsesResource, name), &globaltsmtanzuvmwarecomv1.ClusterSettings{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterSettingses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clustersettingsesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ClusterSettingsList{}) + return err +} + +// Patch applies the patch and returns the patched clusterSettings. +func (c *FakeClusterSettingses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ClusterSettings, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clustersettingsesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ClusterSettings{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ClusterSettings), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_config.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_config.go new file mode 100644 index 000000000..3379abead --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_config.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeConfigs implements ConfigInterface +type FakeConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var configsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "configs"} + +var configsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Config"} + +// Get takes name of the config, and returns the corresponding config object, and an error if there is any. +func (c *FakeConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Config, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(configsResource, name), &globaltsmtanzuvmwarecomv1.Config{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Config), err +} + +// List takes label and field selectors, and returns the list of Configs that match those selectors. +func (c *FakeConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(configsResource, configsKind, opts), &globaltsmtanzuvmwarecomv1.ConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ConfigList).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 configs. +func (c *FakeConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(configsResource, opts)) +} + +// Create takes the representation of a config and creates it. Returns the server's representation of the config, and an error, if there is any. +func (c *FakeConfigs) Create(ctx context.Context, config *globaltsmtanzuvmwarecomv1.Config, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Config, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(configsResource, config), &globaltsmtanzuvmwarecomv1.Config{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Config), err +} + +// Update takes the representation of a config and updates it. Returns the server's representation of the config, and an error, if there is any. +func (c *FakeConfigs) Update(ctx context.Context, config *globaltsmtanzuvmwarecomv1.Config, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Config, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(configsResource, config), &globaltsmtanzuvmwarecomv1.Config{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Config), err +} + +// Delete takes name of the config and deletes it. Returns an error if one occurs. +func (c *FakeConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(configsResource, name), &globaltsmtanzuvmwarecomv1.Config{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(configsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ConfigList{}) + return err +} + +// Patch applies the patch and returns the patched config. +func (c *FakeConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Config, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(configsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Config{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Config), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_configmap.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_configmap.go new file mode 100644 index 000000000..027111bf2 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_configmap.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeConfigMaps implements ConfigMapInterface +type FakeConfigMaps struct { + Fake *FakeGlobalTsmV1 +} + +var configmapsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "configmaps"} + +var configmapsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ConfigMap"} + +// Get takes name of the configMap, and returns the corresponding configMap object, and an error if there is any. +func (c *FakeConfigMaps) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ConfigMap, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(configmapsResource, name), &globaltsmtanzuvmwarecomv1.ConfigMap{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ConfigMap), err +} + +// List takes label and field selectors, and returns the list of ConfigMaps that match those selectors. +func (c *FakeConfigMaps) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ConfigMapList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(configmapsResource, configmapsKind, opts), &globaltsmtanzuvmwarecomv1.ConfigMapList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ConfigMapList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ConfigMapList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ConfigMapList).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 configMaps. +func (c *FakeConfigMaps) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(configmapsResource, opts)) +} + +// Create takes the representation of a configMap and creates it. Returns the server's representation of the configMap, and an error, if there is any. +func (c *FakeConfigMaps) Create(ctx context.Context, configMap *globaltsmtanzuvmwarecomv1.ConfigMap, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ConfigMap, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(configmapsResource, configMap), &globaltsmtanzuvmwarecomv1.ConfigMap{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ConfigMap), err +} + +// Update takes the representation of a configMap and updates it. Returns the server's representation of the configMap, and an error, if there is any. +func (c *FakeConfigMaps) Update(ctx context.Context, configMap *globaltsmtanzuvmwarecomv1.ConfigMap, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ConfigMap, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(configmapsResource, configMap), &globaltsmtanzuvmwarecomv1.ConfigMap{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ConfigMap), err +} + +// Delete takes name of the configMap and deletes it. Returns an error if one occurs. +func (c *FakeConfigMaps) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(configmapsResource, name), &globaltsmtanzuvmwarecomv1.ConfigMap{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeConfigMaps) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(configmapsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ConfigMapList{}) + return err +} + +// Patch applies the patch and returns the patched configMap. +func (c *FakeConfigMaps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ConfigMap, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(configmapsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ConfigMap{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ConfigMap), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_connectionstatus.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_connectionstatus.go new file mode 100644 index 000000000..b1cb85a74 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_connectionstatus.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeConnectionStatuses implements ConnectionStatusInterface +type FakeConnectionStatuses struct { + Fake *FakeGlobalTsmV1 +} + +var connectionstatusesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "connectionstatuses"} + +var connectionstatusesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ConnectionStatus"} + +// Get takes name of the connectionStatus, and returns the corresponding connectionStatus object, and an error if there is any. +func (c *FakeConnectionStatuses) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ConnectionStatus, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(connectionstatusesResource, name), &globaltsmtanzuvmwarecomv1.ConnectionStatus{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ConnectionStatus), err +} + +// List takes label and field selectors, and returns the list of ConnectionStatuses that match those selectors. +func (c *FakeConnectionStatuses) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ConnectionStatusList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(connectionstatusesResource, connectionstatusesKind, opts), &globaltsmtanzuvmwarecomv1.ConnectionStatusList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ConnectionStatusList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ConnectionStatusList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ConnectionStatusList).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 connectionStatuses. +func (c *FakeConnectionStatuses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(connectionstatusesResource, opts)) +} + +// Create takes the representation of a connectionStatus and creates it. Returns the server's representation of the connectionStatus, and an error, if there is any. +func (c *FakeConnectionStatuses) Create(ctx context.Context, connectionStatus *globaltsmtanzuvmwarecomv1.ConnectionStatus, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ConnectionStatus, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(connectionstatusesResource, connectionStatus), &globaltsmtanzuvmwarecomv1.ConnectionStatus{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ConnectionStatus), err +} + +// Update takes the representation of a connectionStatus and updates it. Returns the server's representation of the connectionStatus, and an error, if there is any. +func (c *FakeConnectionStatuses) Update(ctx context.Context, connectionStatus *globaltsmtanzuvmwarecomv1.ConnectionStatus, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ConnectionStatus, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(connectionstatusesResource, connectionStatus), &globaltsmtanzuvmwarecomv1.ConnectionStatus{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ConnectionStatus), err +} + +// Delete takes name of the connectionStatus and deletes it. Returns an error if one occurs. +func (c *FakeConnectionStatuses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(connectionstatusesResource, name), &globaltsmtanzuvmwarecomv1.ConnectionStatus{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeConnectionStatuses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(connectionstatusesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ConnectionStatusList{}) + return err +} + +// Patch applies the patch and returns the patched connectionStatus. +func (c *FakeConnectionStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ConnectionStatus, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(connectionstatusesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ConnectionStatus{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ConnectionStatus), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_database.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_database.go new file mode 100644 index 000000000..a22cdd60c --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_database.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDatabases implements DatabaseInterface +type FakeDatabases struct { + Fake *FakeGlobalTsmV1 +} + +var databasesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "databases"} + +var databasesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Database"} + +// Get takes name of the database, and returns the corresponding database object, and an error if there is any. +func (c *FakeDatabases) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Database, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(databasesResource, name), &globaltsmtanzuvmwarecomv1.Database{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Database), err +} + +// List takes label and field selectors, and returns the list of Databases that match those selectors. +func (c *FakeDatabases) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DatabaseList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(databasesResource, databasesKind, opts), &globaltsmtanzuvmwarecomv1.DatabaseList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DatabaseList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DatabaseList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DatabaseList).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 databases. +func (c *FakeDatabases) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(databasesResource, opts)) +} + +// Create takes the representation of a database and creates it. Returns the server's representation of the database, and an error, if there is any. +func (c *FakeDatabases) Create(ctx context.Context, database *globaltsmtanzuvmwarecomv1.Database, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Database, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(databasesResource, database), &globaltsmtanzuvmwarecomv1.Database{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Database), err +} + +// Update takes the representation of a database and updates it. Returns the server's representation of the database, and an error, if there is any. +func (c *FakeDatabases) Update(ctx context.Context, database *globaltsmtanzuvmwarecomv1.Database, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Database, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(databasesResource, database), &globaltsmtanzuvmwarecomv1.Database{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Database), err +} + +// Delete takes name of the database and deletes it. Returns an error if one occurs. +func (c *FakeDatabases) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(databasesResource, name), &globaltsmtanzuvmwarecomv1.Database{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDatabases) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(databasesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DatabaseList{}) + return err +} + +// Patch applies the patch and returns the patched database. +func (c *FakeDatabases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Database, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(databasesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Database{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Database), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datafolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datafolder.go new file mode 100644 index 000000000..1c4f9f4a7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datafolder.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDataFolders implements DataFolderInterface +type FakeDataFolders struct { + Fake *FakeGlobalTsmV1 +} + +var datafoldersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "datafolders"} + +var datafoldersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "DataFolder"} + +// Get takes name of the dataFolder, and returns the corresponding dataFolder object, and an error if there is any. +func (c *FakeDataFolders) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.DataFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(datafoldersResource, name), &globaltsmtanzuvmwarecomv1.DataFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolder), err +} + +// List takes label and field selectors, and returns the list of DataFolders that match those selectors. +func (c *FakeDataFolders) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DataFolderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(datafoldersResource, datafoldersKind, opts), &globaltsmtanzuvmwarecomv1.DataFolderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DataFolderList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DataFolderList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DataFolderList).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 dataFolders. +func (c *FakeDataFolders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(datafoldersResource, opts)) +} + +// Create takes the representation of a dataFolder and creates it. Returns the server's representation of the dataFolder, and an error, if there is any. +func (c *FakeDataFolders) Create(ctx context.Context, dataFolder *globaltsmtanzuvmwarecomv1.DataFolder, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.DataFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(datafoldersResource, dataFolder), &globaltsmtanzuvmwarecomv1.DataFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolder), err +} + +// Update takes the representation of a dataFolder and updates it. Returns the server's representation of the dataFolder, and an error, if there is any. +func (c *FakeDataFolders) Update(ctx context.Context, dataFolder *globaltsmtanzuvmwarecomv1.DataFolder, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.DataFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(datafoldersResource, dataFolder), &globaltsmtanzuvmwarecomv1.DataFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolder), err +} + +// Delete takes name of the dataFolder and deletes it. Returns an error if one occurs. +func (c *FakeDataFolders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(datafoldersResource, name), &globaltsmtanzuvmwarecomv1.DataFolder{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDataFolders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(datafoldersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DataFolderList{}) + return err +} + +// Patch applies the patch and returns the patched dataFolder. +func (c *FakeDataFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.DataFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(datafoldersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.DataFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolder), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datafolderdomain.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datafolderdomain.go new file mode 100644 index 000000000..d9398f786 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datafolderdomain.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDataFolderDomains implements DataFolderDomainInterface +type FakeDataFolderDomains struct { + Fake *FakeGlobalTsmV1 +} + +var datafolderdomainsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "datafolderdomains"} + +var datafolderdomainsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "DataFolderDomain"} + +// Get takes name of the dataFolderDomain, and returns the corresponding dataFolderDomain object, and an error if there is any. +func (c *FakeDataFolderDomains) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.DataFolderDomain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(datafolderdomainsResource, name), &globaltsmtanzuvmwarecomv1.DataFolderDomain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomain), err +} + +// List takes label and field selectors, and returns the list of DataFolderDomains that match those selectors. +func (c *FakeDataFolderDomains) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DataFolderDomainList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(datafolderdomainsResource, datafolderdomainsKind, opts), &globaltsmtanzuvmwarecomv1.DataFolderDomainList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DataFolderDomainList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainList).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 dataFolderDomains. +func (c *FakeDataFolderDomains) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(datafolderdomainsResource, opts)) +} + +// Create takes the representation of a dataFolderDomain and creates it. Returns the server's representation of the dataFolderDomain, and an error, if there is any. +func (c *FakeDataFolderDomains) Create(ctx context.Context, dataFolderDomain *globaltsmtanzuvmwarecomv1.DataFolderDomain, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.DataFolderDomain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(datafolderdomainsResource, dataFolderDomain), &globaltsmtanzuvmwarecomv1.DataFolderDomain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomain), err +} + +// Update takes the representation of a dataFolderDomain and updates it. Returns the server's representation of the dataFolderDomain, and an error, if there is any. +func (c *FakeDataFolderDomains) Update(ctx context.Context, dataFolderDomain *globaltsmtanzuvmwarecomv1.DataFolderDomain, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.DataFolderDomain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(datafolderdomainsResource, dataFolderDomain), &globaltsmtanzuvmwarecomv1.DataFolderDomain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomain), err +} + +// Delete takes name of the dataFolderDomain and deletes it. Returns an error if one occurs. +func (c *FakeDataFolderDomains) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(datafolderdomainsResource, name), &globaltsmtanzuvmwarecomv1.DataFolderDomain{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDataFolderDomains) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(datafolderdomainsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DataFolderDomainList{}) + return err +} + +// Patch applies the patch and returns the patched dataFolderDomain. +func (c *FakeDataFolderDomains) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.DataFolderDomain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(datafolderdomainsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.DataFolderDomain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomain), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datafolderdomaincluster.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datafolderdomaincluster.go new file mode 100644 index 000000000..86a5c9ba5 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datafolderdomaincluster.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDataFolderDomainClusters implements DataFolderDomainClusterInterface +type FakeDataFolderDomainClusters struct { + Fake *FakeGlobalTsmV1 +} + +var datafolderdomainclustersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "datafolderdomainclusters"} + +var datafolderdomainclustersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "DataFolderDomainCluster"} + +// Get takes name of the dataFolderDomainCluster, and returns the corresponding dataFolderDomainCluster object, and an error if there is any. +func (c *FakeDataFolderDomainClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.DataFolderDomainCluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(datafolderdomainclustersResource, name), &globaltsmtanzuvmwarecomv1.DataFolderDomainCluster{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainCluster), err +} + +// List takes label and field selectors, and returns the list of DataFolderDomainClusters that match those selectors. +func (c *FakeDataFolderDomainClusters) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DataFolderDomainClusterList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(datafolderdomainclustersResource, datafolderdomainclustersKind, opts), &globaltsmtanzuvmwarecomv1.DataFolderDomainClusterList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DataFolderDomainClusterList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainClusterList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainClusterList).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 dataFolderDomainClusters. +func (c *FakeDataFolderDomainClusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(datafolderdomainclustersResource, opts)) +} + +// Create takes the representation of a dataFolderDomainCluster and creates it. Returns the server's representation of the dataFolderDomainCluster, and an error, if there is any. +func (c *FakeDataFolderDomainClusters) Create(ctx context.Context, dataFolderDomainCluster *globaltsmtanzuvmwarecomv1.DataFolderDomainCluster, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.DataFolderDomainCluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(datafolderdomainclustersResource, dataFolderDomainCluster), &globaltsmtanzuvmwarecomv1.DataFolderDomainCluster{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainCluster), err +} + +// Update takes the representation of a dataFolderDomainCluster and updates it. Returns the server's representation of the dataFolderDomainCluster, and an error, if there is any. +func (c *FakeDataFolderDomainClusters) Update(ctx context.Context, dataFolderDomainCluster *globaltsmtanzuvmwarecomv1.DataFolderDomainCluster, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.DataFolderDomainCluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(datafolderdomainclustersResource, dataFolderDomainCluster), &globaltsmtanzuvmwarecomv1.DataFolderDomainCluster{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainCluster), err +} + +// Delete takes name of the dataFolderDomainCluster and deletes it. Returns an error if one occurs. +func (c *FakeDataFolderDomainClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(datafolderdomainclustersResource, name), &globaltsmtanzuvmwarecomv1.DataFolderDomainCluster{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDataFolderDomainClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(datafolderdomainclustersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DataFolderDomainClusterList{}) + return err +} + +// Patch applies the patch and returns the patched dataFolderDomainCluster. +func (c *FakeDataFolderDomainClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.DataFolderDomainCluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(datafolderdomainclustersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.DataFolderDomainCluster{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainCluster), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datafolderdomainservice.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datafolderdomainservice.go new file mode 100644 index 000000000..5c4e3bdfc --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datafolderdomainservice.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDataFolderDomainServices implements DataFolderDomainServiceInterface +type FakeDataFolderDomainServices struct { + Fake *FakeGlobalTsmV1 +} + +var datafolderdomainservicesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "datafolderdomainservices"} + +var datafolderdomainservicesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "DataFolderDomainService"} + +// Get takes name of the dataFolderDomainService, and returns the corresponding dataFolderDomainService object, and an error if there is any. +func (c *FakeDataFolderDomainServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.DataFolderDomainService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(datafolderdomainservicesResource, name), &globaltsmtanzuvmwarecomv1.DataFolderDomainService{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainService), err +} + +// List takes label and field selectors, and returns the list of DataFolderDomainServices that match those selectors. +func (c *FakeDataFolderDomainServices) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DataFolderDomainServiceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(datafolderdomainservicesResource, datafolderdomainservicesKind, opts), &globaltsmtanzuvmwarecomv1.DataFolderDomainServiceList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DataFolderDomainServiceList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainServiceList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainServiceList).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 dataFolderDomainServices. +func (c *FakeDataFolderDomainServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(datafolderdomainservicesResource, opts)) +} + +// Create takes the representation of a dataFolderDomainService and creates it. Returns the server's representation of the dataFolderDomainService, and an error, if there is any. +func (c *FakeDataFolderDomainServices) Create(ctx context.Context, dataFolderDomainService *globaltsmtanzuvmwarecomv1.DataFolderDomainService, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.DataFolderDomainService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(datafolderdomainservicesResource, dataFolderDomainService), &globaltsmtanzuvmwarecomv1.DataFolderDomainService{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainService), err +} + +// Update takes the representation of a dataFolderDomainService and updates it. Returns the server's representation of the dataFolderDomainService, and an error, if there is any. +func (c *FakeDataFolderDomainServices) Update(ctx context.Context, dataFolderDomainService *globaltsmtanzuvmwarecomv1.DataFolderDomainService, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.DataFolderDomainService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(datafolderdomainservicesResource, dataFolderDomainService), &globaltsmtanzuvmwarecomv1.DataFolderDomainService{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainService), err +} + +// Delete takes name of the dataFolderDomainService and deletes it. Returns an error if one occurs. +func (c *FakeDataFolderDomainServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(datafolderdomainservicesResource, name), &globaltsmtanzuvmwarecomv1.DataFolderDomainService{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDataFolderDomainServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(datafolderdomainservicesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DataFolderDomainServiceList{}) + return err +} + +// Patch applies the patch and returns the patched dataFolderDomainService. +func (c *FakeDataFolderDomainServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.DataFolderDomainService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(datafolderdomainservicesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.DataFolderDomainService{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainService), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datafolderdomainserviceversion.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datafolderdomainserviceversion.go new file mode 100644 index 000000000..f97755187 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datafolderdomainserviceversion.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDataFolderDomainServiceVersions implements DataFolderDomainServiceVersionInterface +type FakeDataFolderDomainServiceVersions struct { + Fake *FakeGlobalTsmV1 +} + +var datafolderdomainserviceversionsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "datafolderdomainserviceversions"} + +var datafolderdomainserviceversionsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "DataFolderDomainServiceVersion"} + +// Get takes name of the dataFolderDomainServiceVersion, and returns the corresponding dataFolderDomainServiceVersion object, and an error if there is any. +func (c *FakeDataFolderDomainServiceVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(datafolderdomainserviceversionsResource, name), &globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion), err +} + +// List takes label and field selectors, and returns the list of DataFolderDomainServiceVersions that match those selectors. +func (c *FakeDataFolderDomainServiceVersions) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(datafolderdomainserviceversionsResource, datafolderdomainserviceversionsKind, opts), &globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersionList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersionList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersionList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersionList).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 dataFolderDomainServiceVersions. +func (c *FakeDataFolderDomainServiceVersions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(datafolderdomainserviceversionsResource, opts)) +} + +// Create takes the representation of a dataFolderDomainServiceVersion and creates it. Returns the server's representation of the dataFolderDomainServiceVersion, and an error, if there is any. +func (c *FakeDataFolderDomainServiceVersions) Create(ctx context.Context, dataFolderDomainServiceVersion *globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(datafolderdomainserviceversionsResource, dataFolderDomainServiceVersion), &globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion), err +} + +// Update takes the representation of a dataFolderDomainServiceVersion and updates it. Returns the server's representation of the dataFolderDomainServiceVersion, and an error, if there is any. +func (c *FakeDataFolderDomainServiceVersions) Update(ctx context.Context, dataFolderDomainServiceVersion *globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(datafolderdomainserviceversionsResource, dataFolderDomainServiceVersion), &globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion), err +} + +// Delete takes name of the dataFolderDomainServiceVersion and deletes it. Returns an error if one occurs. +func (c *FakeDataFolderDomainServiceVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(datafolderdomainserviceversionsResource, name), &globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDataFolderDomainServiceVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(datafolderdomainserviceversionsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersionList{}) + return err +} + +// Patch applies the patch and returns the patched dataFolderDomainServiceVersion. +func (c *FakeDataFolderDomainServiceVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(datafolderdomainserviceversionsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datagroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datagroup.go new file mode 100644 index 000000000..13cd42c5d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datagroup.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDataGroups implements DataGroupInterface +type FakeDataGroups struct { + Fake *FakeGlobalTsmV1 +} + +var datagroupsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "datagroups"} + +var datagroupsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "DataGroup"} + +// Get takes name of the dataGroup, and returns the corresponding dataGroup object, and an error if there is any. +func (c *FakeDataGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.DataGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(datagroupsResource, name), &globaltsmtanzuvmwarecomv1.DataGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataGroup), err +} + +// List takes label and field selectors, and returns the list of DataGroups that match those selectors. +func (c *FakeDataGroups) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DataGroupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(datagroupsResource, datagroupsKind, opts), &globaltsmtanzuvmwarecomv1.DataGroupList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DataGroupList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DataGroupList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DataGroupList).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 dataGroups. +func (c *FakeDataGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(datagroupsResource, opts)) +} + +// Create takes the representation of a dataGroup and creates it. Returns the server's representation of the dataGroup, and an error, if there is any. +func (c *FakeDataGroups) Create(ctx context.Context, dataGroup *globaltsmtanzuvmwarecomv1.DataGroup, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.DataGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(datagroupsResource, dataGroup), &globaltsmtanzuvmwarecomv1.DataGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataGroup), err +} + +// Update takes the representation of a dataGroup and updates it. Returns the server's representation of the dataGroup, and an error, if there is any. +func (c *FakeDataGroups) Update(ctx context.Context, dataGroup *globaltsmtanzuvmwarecomv1.DataGroup, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.DataGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(datagroupsResource, dataGroup), &globaltsmtanzuvmwarecomv1.DataGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataGroup), err +} + +// Delete takes name of the dataGroup and deletes it. Returns an error if one occurs. +func (c *FakeDataGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(datagroupsResource, name), &globaltsmtanzuvmwarecomv1.DataGroup{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDataGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(datagroupsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DataGroupList{}) + return err +} + +// Patch applies the patch and returns the patched dataGroup. +func (c *FakeDataGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.DataGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(datagroupsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.DataGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataGroup), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datatemplate.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datatemplate.go new file mode 100644 index 000000000..74861f765 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_datatemplate.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDataTemplates implements DataTemplateInterface +type FakeDataTemplates struct { + Fake *FakeGlobalTsmV1 +} + +var datatemplatesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "datatemplates"} + +var datatemplatesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "DataTemplate"} + +// Get takes name of the dataTemplate, and returns the corresponding dataTemplate object, and an error if there is any. +func (c *FakeDataTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.DataTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(datatemplatesResource, name), &globaltsmtanzuvmwarecomv1.DataTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataTemplate), err +} + +// List takes label and field selectors, and returns the list of DataTemplates that match those selectors. +func (c *FakeDataTemplates) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DataTemplateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(datatemplatesResource, datatemplatesKind, opts), &globaltsmtanzuvmwarecomv1.DataTemplateList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DataTemplateList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DataTemplateList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DataTemplateList).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 dataTemplates. +func (c *FakeDataTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(datatemplatesResource, opts)) +} + +// Create takes the representation of a dataTemplate and creates it. Returns the server's representation of the dataTemplate, and an error, if there is any. +func (c *FakeDataTemplates) Create(ctx context.Context, dataTemplate *globaltsmtanzuvmwarecomv1.DataTemplate, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.DataTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(datatemplatesResource, dataTemplate), &globaltsmtanzuvmwarecomv1.DataTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataTemplate), err +} + +// Update takes the representation of a dataTemplate and updates it. Returns the server's representation of the dataTemplate, and an error, if there is any. +func (c *FakeDataTemplates) Update(ctx context.Context, dataTemplate *globaltsmtanzuvmwarecomv1.DataTemplate, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.DataTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(datatemplatesResource, dataTemplate), &globaltsmtanzuvmwarecomv1.DataTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataTemplate), err +} + +// Delete takes name of the dataTemplate and deletes it. Returns an error if one occurs. +func (c *FakeDataTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(datatemplatesResource, name), &globaltsmtanzuvmwarecomv1.DataTemplate{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDataTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(datatemplatesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DataTemplateList{}) + return err +} + +// Patch applies the patch and returns the patched dataTemplate. +func (c *FakeDataTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.DataTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(datatemplatesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.DataTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DataTemplate), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dcregion.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dcregion.go new file mode 100644 index 000000000..00c9ba677 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dcregion.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDCRegions implements DCRegionInterface +type FakeDCRegions struct { + Fake *FakeGlobalTsmV1 +} + +var dcregionsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "dcregions"} + +var dcregionsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "DCRegion"} + +// Get takes name of the dCRegion, and returns the corresponding dCRegion object, and an error if there is any. +func (c *FakeDCRegions) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.DCRegion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(dcregionsResource, name), &globaltsmtanzuvmwarecomv1.DCRegion{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DCRegion), err +} + +// List takes label and field selectors, and returns the list of DCRegions that match those selectors. +func (c *FakeDCRegions) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DCRegionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(dcregionsResource, dcregionsKind, opts), &globaltsmtanzuvmwarecomv1.DCRegionList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DCRegionList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DCRegionList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DCRegionList).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 dCRegions. +func (c *FakeDCRegions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(dcregionsResource, opts)) +} + +// Create takes the representation of a dCRegion and creates it. Returns the server's representation of the dCRegion, and an error, if there is any. +func (c *FakeDCRegions) Create(ctx context.Context, dCRegion *globaltsmtanzuvmwarecomv1.DCRegion, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.DCRegion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(dcregionsResource, dCRegion), &globaltsmtanzuvmwarecomv1.DCRegion{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DCRegion), err +} + +// Update takes the representation of a dCRegion and updates it. Returns the server's representation of the dCRegion, and an error, if there is any. +func (c *FakeDCRegions) Update(ctx context.Context, dCRegion *globaltsmtanzuvmwarecomv1.DCRegion, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.DCRegion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(dcregionsResource, dCRegion), &globaltsmtanzuvmwarecomv1.DCRegion{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DCRegion), err +} + +// Delete takes name of the dCRegion and deletes it. Returns an error if one occurs. +func (c *FakeDCRegions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(dcregionsResource, name), &globaltsmtanzuvmwarecomv1.DCRegion{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDCRegions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(dcregionsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DCRegionList{}) + return err +} + +// Patch applies the patch and returns the patched dCRegion. +func (c *FakeDCRegions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.DCRegion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(dcregionsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.DCRegion{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DCRegion), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dczone.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dczone.go new file mode 100644 index 000000000..8d898aa00 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dczone.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDCZones implements DCZoneInterface +type FakeDCZones struct { + Fake *FakeGlobalTsmV1 +} + +var dczonesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "dczones"} + +var dczonesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "DCZone"} + +// Get takes name of the dCZone, and returns the corresponding dCZone object, and an error if there is any. +func (c *FakeDCZones) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.DCZone, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(dczonesResource, name), &globaltsmtanzuvmwarecomv1.DCZone{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DCZone), err +} + +// List takes label and field selectors, and returns the list of DCZones that match those selectors. +func (c *FakeDCZones) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DCZoneList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(dczonesResource, dczonesKind, opts), &globaltsmtanzuvmwarecomv1.DCZoneList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DCZoneList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DCZoneList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DCZoneList).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 dCZones. +func (c *FakeDCZones) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(dczonesResource, opts)) +} + +// Create takes the representation of a dCZone and creates it. Returns the server's representation of the dCZone, and an error, if there is any. +func (c *FakeDCZones) Create(ctx context.Context, dCZone *globaltsmtanzuvmwarecomv1.DCZone, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.DCZone, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(dczonesResource, dCZone), &globaltsmtanzuvmwarecomv1.DCZone{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DCZone), err +} + +// Update takes the representation of a dCZone and updates it. Returns the server's representation of the dCZone, and an error, if there is any. +func (c *FakeDCZones) Update(ctx context.Context, dCZone *globaltsmtanzuvmwarecomv1.DCZone, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.DCZone, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(dczonesResource, dCZone), &globaltsmtanzuvmwarecomv1.DCZone{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DCZone), err +} + +// Delete takes name of the dCZone and deletes it. Returns an error if one occurs. +func (c *FakeDCZones) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(dczonesResource, name), &globaltsmtanzuvmwarecomv1.DCZone{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDCZones) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(dczonesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DCZoneList{}) + return err +} + +// Patch applies the patch and returns the patched dCZone. +func (c *FakeDCZones) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.DCZone, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(dczonesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.DCZone{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DCZone), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_destinationrule.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_destinationrule.go new file mode 100644 index 000000000..1b4d83ad1 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_destinationrule.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDestinationRules implements DestinationRuleInterface +type FakeDestinationRules struct { + Fake *FakeGlobalTsmV1 +} + +var destinationrulesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "destinationrules"} + +var destinationrulesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "DestinationRule"} + +// Get takes name of the destinationRule, and returns the corresponding destinationRule object, and an error if there is any. +func (c *FakeDestinationRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.DestinationRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(destinationrulesResource, name), &globaltsmtanzuvmwarecomv1.DestinationRule{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DestinationRule), err +} + +// List takes label and field selectors, and returns the list of DestinationRules that match those selectors. +func (c *FakeDestinationRules) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DestinationRuleList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(destinationrulesResource, destinationrulesKind, opts), &globaltsmtanzuvmwarecomv1.DestinationRuleList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DestinationRuleList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DestinationRuleList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DestinationRuleList).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 destinationRules. +func (c *FakeDestinationRules) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(destinationrulesResource, opts)) +} + +// Create takes the representation of a destinationRule and creates it. Returns the server's representation of the destinationRule, and an error, if there is any. +func (c *FakeDestinationRules) Create(ctx context.Context, destinationRule *globaltsmtanzuvmwarecomv1.DestinationRule, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.DestinationRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(destinationrulesResource, destinationRule), &globaltsmtanzuvmwarecomv1.DestinationRule{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DestinationRule), err +} + +// Update takes the representation of a destinationRule and updates it. Returns the server's representation of the destinationRule, and an error, if there is any. +func (c *FakeDestinationRules) Update(ctx context.Context, destinationRule *globaltsmtanzuvmwarecomv1.DestinationRule, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.DestinationRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(destinationrulesResource, destinationRule), &globaltsmtanzuvmwarecomv1.DestinationRule{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DestinationRule), err +} + +// Delete takes name of the destinationRule and deletes it. Returns an error if one occurs. +func (c *FakeDestinationRules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(destinationrulesResource, name), &globaltsmtanzuvmwarecomv1.DestinationRule{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDestinationRules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(destinationrulesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DestinationRuleList{}) + return err +} + +// Patch applies the patch and returns the patched destinationRule. +func (c *FakeDestinationRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.DestinationRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(destinationrulesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.DestinationRule{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DestinationRule), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_directory.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_directory.go new file mode 100644 index 000000000..fad527498 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_directory.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDirectories implements DirectoryInterface +type FakeDirectories struct { + Fake *FakeGlobalTsmV1 +} + +var directoriesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "directories"} + +var directoriesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Directory"} + +// Get takes name of the directory, and returns the corresponding directory object, and an error if there is any. +func (c *FakeDirectories) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Directory, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(directoriesResource, name), &globaltsmtanzuvmwarecomv1.Directory{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Directory), err +} + +// List takes label and field selectors, and returns the list of Directories that match those selectors. +func (c *FakeDirectories) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DirectoryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(directoriesResource, directoriesKind, opts), &globaltsmtanzuvmwarecomv1.DirectoryList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DirectoryList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DirectoryList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DirectoryList).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 directories. +func (c *FakeDirectories) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(directoriesResource, opts)) +} + +// Create takes the representation of a directory and creates it. Returns the server's representation of the directory, and an error, if there is any. +func (c *FakeDirectories) Create(ctx context.Context, directory *globaltsmtanzuvmwarecomv1.Directory, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Directory, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(directoriesResource, directory), &globaltsmtanzuvmwarecomv1.Directory{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Directory), err +} + +// Update takes the representation of a directory and updates it. Returns the server's representation of the directory, and an error, if there is any. +func (c *FakeDirectories) Update(ctx context.Context, directory *globaltsmtanzuvmwarecomv1.Directory, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Directory, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(directoriesResource, directory), &globaltsmtanzuvmwarecomv1.Directory{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Directory), err +} + +// Delete takes name of the directory and deletes it. Returns an error if one occurs. +func (c *FakeDirectories) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(directoriesResource, name), &globaltsmtanzuvmwarecomv1.Directory{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDirectories) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(directoriesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DirectoryList{}) + return err +} + +// Patch applies the patch and returns the patched directory. +func (c *FakeDirectories) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Directory, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(directoriesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Directory{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Directory), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dnsconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dnsconfig.go new file mode 100644 index 000000000..fb48f9ed0 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dnsconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDNSConfigs implements DNSConfigInterface +type FakeDNSConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var dnsconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "dnsconfigs"} + +var dnsconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "DNSConfig"} + +// Get takes name of the dNSConfig, and returns the corresponding dNSConfig object, and an error if there is any. +func (c *FakeDNSConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.DNSConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(dnsconfigsResource, name), &globaltsmtanzuvmwarecomv1.DNSConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSConfig), err +} + +// List takes label and field selectors, and returns the list of DNSConfigs that match those selectors. +func (c *FakeDNSConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DNSConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(dnsconfigsResource, dnsconfigsKind, opts), &globaltsmtanzuvmwarecomv1.DNSConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DNSConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DNSConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DNSConfigList).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 dNSConfigs. +func (c *FakeDNSConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(dnsconfigsResource, opts)) +} + +// Create takes the representation of a dNSConfig and creates it. Returns the server's representation of the dNSConfig, and an error, if there is any. +func (c *FakeDNSConfigs) Create(ctx context.Context, dNSConfig *globaltsmtanzuvmwarecomv1.DNSConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.DNSConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(dnsconfigsResource, dNSConfig), &globaltsmtanzuvmwarecomv1.DNSConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSConfig), err +} + +// Update takes the representation of a dNSConfig and updates it. Returns the server's representation of the dNSConfig, and an error, if there is any. +func (c *FakeDNSConfigs) Update(ctx context.Context, dNSConfig *globaltsmtanzuvmwarecomv1.DNSConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.DNSConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(dnsconfigsResource, dNSConfig), &globaltsmtanzuvmwarecomv1.DNSConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSConfig), err +} + +// Delete takes name of the dNSConfig and deletes it. Returns an error if one occurs. +func (c *FakeDNSConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(dnsconfigsResource, name), &globaltsmtanzuvmwarecomv1.DNSConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDNSConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(dnsconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DNSConfigList{}) + return err +} + +// Patch applies the patch and returns the patched dNSConfig. +func (c *FakeDNSConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.DNSConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(dnsconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.DNSConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dnsconfigfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dnsconfigfolder.go new file mode 100644 index 000000000..6f2e32c94 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dnsconfigfolder.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDNSConfigFolders implements DNSConfigFolderInterface +type FakeDNSConfigFolders struct { + Fake *FakeGlobalTsmV1 +} + +var dnsconfigfoldersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "dnsconfigfolders"} + +var dnsconfigfoldersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "DNSConfigFolder"} + +// Get takes name of the dNSConfigFolder, and returns the corresponding dNSConfigFolder object, and an error if there is any. +func (c *FakeDNSConfigFolders) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.DNSConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(dnsconfigfoldersResource, name), &globaltsmtanzuvmwarecomv1.DNSConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSConfigFolder), err +} + +// List takes label and field selectors, and returns the list of DNSConfigFolders that match those selectors. +func (c *FakeDNSConfigFolders) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DNSConfigFolderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(dnsconfigfoldersResource, dnsconfigfoldersKind, opts), &globaltsmtanzuvmwarecomv1.DNSConfigFolderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DNSConfigFolderList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DNSConfigFolderList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DNSConfigFolderList).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 dNSConfigFolders. +func (c *FakeDNSConfigFolders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(dnsconfigfoldersResource, opts)) +} + +// Create takes the representation of a dNSConfigFolder and creates it. Returns the server's representation of the dNSConfigFolder, and an error, if there is any. +func (c *FakeDNSConfigFolders) Create(ctx context.Context, dNSConfigFolder *globaltsmtanzuvmwarecomv1.DNSConfigFolder, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.DNSConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(dnsconfigfoldersResource, dNSConfigFolder), &globaltsmtanzuvmwarecomv1.DNSConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSConfigFolder), err +} + +// Update takes the representation of a dNSConfigFolder and updates it. Returns the server's representation of the dNSConfigFolder, and an error, if there is any. +func (c *FakeDNSConfigFolders) Update(ctx context.Context, dNSConfigFolder *globaltsmtanzuvmwarecomv1.DNSConfigFolder, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.DNSConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(dnsconfigfoldersResource, dNSConfigFolder), &globaltsmtanzuvmwarecomv1.DNSConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSConfigFolder), err +} + +// Delete takes name of the dNSConfigFolder and deletes it. Returns an error if one occurs. +func (c *FakeDNSConfigFolders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(dnsconfigfoldersResource, name), &globaltsmtanzuvmwarecomv1.DNSConfigFolder{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDNSConfigFolders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(dnsconfigfoldersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DNSConfigFolderList{}) + return err +} + +// Patch applies the patch and returns the patched dNSConfigFolder. +func (c *FakeDNSConfigFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.DNSConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(dnsconfigfoldersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.DNSConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSConfigFolder), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dnsprobeconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dnsprobeconfig.go new file mode 100644 index 000000000..be2ae03f0 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dnsprobeconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDNSProbeConfigs implements DNSProbeConfigInterface +type FakeDNSProbeConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var dnsprobeconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "dnsprobeconfigs"} + +var dnsprobeconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "DNSProbeConfig"} + +// Get takes name of the dNSProbeConfig, and returns the corresponding dNSProbeConfig object, and an error if there is any. +func (c *FakeDNSProbeConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.DNSProbeConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(dnsprobeconfigsResource, name), &globaltsmtanzuvmwarecomv1.DNSProbeConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSProbeConfig), err +} + +// List takes label and field selectors, and returns the list of DNSProbeConfigs that match those selectors. +func (c *FakeDNSProbeConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DNSProbeConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(dnsprobeconfigsResource, dnsprobeconfigsKind, opts), &globaltsmtanzuvmwarecomv1.DNSProbeConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DNSProbeConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DNSProbeConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DNSProbeConfigList).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 dNSProbeConfigs. +func (c *FakeDNSProbeConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(dnsprobeconfigsResource, opts)) +} + +// Create takes the representation of a dNSProbeConfig and creates it. Returns the server's representation of the dNSProbeConfig, and an error, if there is any. +func (c *FakeDNSProbeConfigs) Create(ctx context.Context, dNSProbeConfig *globaltsmtanzuvmwarecomv1.DNSProbeConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.DNSProbeConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(dnsprobeconfigsResource, dNSProbeConfig), &globaltsmtanzuvmwarecomv1.DNSProbeConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSProbeConfig), err +} + +// Update takes the representation of a dNSProbeConfig and updates it. Returns the server's representation of the dNSProbeConfig, and an error, if there is any. +func (c *FakeDNSProbeConfigs) Update(ctx context.Context, dNSProbeConfig *globaltsmtanzuvmwarecomv1.DNSProbeConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.DNSProbeConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(dnsprobeconfigsResource, dNSProbeConfig), &globaltsmtanzuvmwarecomv1.DNSProbeConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSProbeConfig), err +} + +// Delete takes name of the dNSProbeConfig and deletes it. Returns an error if one occurs. +func (c *FakeDNSProbeConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(dnsprobeconfigsResource, name), &globaltsmtanzuvmwarecomv1.DNSProbeConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDNSProbeConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(dnsprobeconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DNSProbeConfigList{}) + return err +} + +// Patch applies the patch and returns the patched dNSProbeConfig. +func (c *FakeDNSProbeConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.DNSProbeConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(dnsprobeconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.DNSProbeConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSProbeConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dnsprobesconfigfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dnsprobesconfigfolder.go new file mode 100644 index 000000000..7de0a34bd --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dnsprobesconfigfolder.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDNSProbesConfigFolders implements DNSProbesConfigFolderInterface +type FakeDNSProbesConfigFolders struct { + Fake *FakeGlobalTsmV1 +} + +var dnsprobesconfigfoldersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "dnsprobesconfigfolders"} + +var dnsprobesconfigfoldersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "DNSProbesConfigFolder"} + +// Get takes name of the dNSProbesConfigFolder, and returns the corresponding dNSProbesConfigFolder object, and an error if there is any. +func (c *FakeDNSProbesConfigFolders) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.DNSProbesConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(dnsprobesconfigfoldersResource, name), &globaltsmtanzuvmwarecomv1.DNSProbesConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSProbesConfigFolder), err +} + +// List takes label and field selectors, and returns the list of DNSProbesConfigFolders that match those selectors. +func (c *FakeDNSProbesConfigFolders) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DNSProbesConfigFolderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(dnsprobesconfigfoldersResource, dnsprobesconfigfoldersKind, opts), &globaltsmtanzuvmwarecomv1.DNSProbesConfigFolderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DNSProbesConfigFolderList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DNSProbesConfigFolderList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DNSProbesConfigFolderList).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 dNSProbesConfigFolders. +func (c *FakeDNSProbesConfigFolders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(dnsprobesconfigfoldersResource, opts)) +} + +// Create takes the representation of a dNSProbesConfigFolder and creates it. Returns the server's representation of the dNSProbesConfigFolder, and an error, if there is any. +func (c *FakeDNSProbesConfigFolders) Create(ctx context.Context, dNSProbesConfigFolder *globaltsmtanzuvmwarecomv1.DNSProbesConfigFolder, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.DNSProbesConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(dnsprobesconfigfoldersResource, dNSProbesConfigFolder), &globaltsmtanzuvmwarecomv1.DNSProbesConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSProbesConfigFolder), err +} + +// Update takes the representation of a dNSProbesConfigFolder and updates it. Returns the server's representation of the dNSProbesConfigFolder, and an error, if there is any. +func (c *FakeDNSProbesConfigFolders) Update(ctx context.Context, dNSProbesConfigFolder *globaltsmtanzuvmwarecomv1.DNSProbesConfigFolder, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.DNSProbesConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(dnsprobesconfigfoldersResource, dNSProbesConfigFolder), &globaltsmtanzuvmwarecomv1.DNSProbesConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSProbesConfigFolder), err +} + +// Delete takes name of the dNSProbesConfigFolder and deletes it. Returns an error if one occurs. +func (c *FakeDNSProbesConfigFolders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(dnsprobesconfigfoldersResource, name), &globaltsmtanzuvmwarecomv1.DNSProbesConfigFolder{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDNSProbesConfigFolders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(dnsprobesconfigfoldersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DNSProbesConfigFolderList{}) + return err +} + +// Patch applies the patch and returns the patched dNSProbesConfigFolder. +func (c *FakeDNSProbesConfigFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.DNSProbesConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(dnsprobesconfigfoldersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.DNSProbesConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSProbesConfigFolder), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dnsprobestatus.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dnsprobestatus.go new file mode 100644 index 000000000..0ee932a84 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_dnsprobestatus.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDNSProbeStatuses implements DNSProbeStatusInterface +type FakeDNSProbeStatuses struct { + Fake *FakeGlobalTsmV1 +} + +var dnsprobestatusesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "dnsprobestatuses"} + +var dnsprobestatusesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "DNSProbeStatus"} + +// Get takes name of the dNSProbeStatus, and returns the corresponding dNSProbeStatus object, and an error if there is any. +func (c *FakeDNSProbeStatuses) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.DNSProbeStatus, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(dnsprobestatusesResource, name), &globaltsmtanzuvmwarecomv1.DNSProbeStatus{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSProbeStatus), err +} + +// List takes label and field selectors, and returns the list of DNSProbeStatuses that match those selectors. +func (c *FakeDNSProbeStatuses) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DNSProbeStatusList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(dnsprobestatusesResource, dnsprobestatusesKind, opts), &globaltsmtanzuvmwarecomv1.DNSProbeStatusList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DNSProbeStatusList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DNSProbeStatusList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DNSProbeStatusList).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 dNSProbeStatuses. +func (c *FakeDNSProbeStatuses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(dnsprobestatusesResource, opts)) +} + +// Create takes the representation of a dNSProbeStatus and creates it. Returns the server's representation of the dNSProbeStatus, and an error, if there is any. +func (c *FakeDNSProbeStatuses) Create(ctx context.Context, dNSProbeStatus *globaltsmtanzuvmwarecomv1.DNSProbeStatus, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.DNSProbeStatus, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(dnsprobestatusesResource, dNSProbeStatus), &globaltsmtanzuvmwarecomv1.DNSProbeStatus{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSProbeStatus), err +} + +// Update takes the representation of a dNSProbeStatus and updates it. Returns the server's representation of the dNSProbeStatus, and an error, if there is any. +func (c *FakeDNSProbeStatuses) Update(ctx context.Context, dNSProbeStatus *globaltsmtanzuvmwarecomv1.DNSProbeStatus, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.DNSProbeStatus, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(dnsprobestatusesResource, dNSProbeStatus), &globaltsmtanzuvmwarecomv1.DNSProbeStatus{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSProbeStatus), err +} + +// Delete takes name of the dNSProbeStatus and deletes it. Returns an error if one occurs. +func (c *FakeDNSProbeStatuses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(dnsprobestatusesResource, name), &globaltsmtanzuvmwarecomv1.DNSProbeStatus{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDNSProbeStatuses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(dnsprobestatusesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DNSProbeStatusList{}) + return err +} + +// Patch applies the patch and returns the patched dNSProbeStatus. +func (c *FakeDNSProbeStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.DNSProbeStatus, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(dnsprobestatusesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.DNSProbeStatus{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DNSProbeStatus), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_domain.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_domain.go new file mode 100644 index 000000000..d01010af4 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_domain.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDomains implements DomainInterface +type FakeDomains struct { + Fake *FakeGlobalTsmV1 +} + +var domainsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "domains"} + +var domainsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Domain"} + +// Get takes name of the domain, and returns the corresponding domain object, and an error if there is any. +func (c *FakeDomains) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Domain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(domainsResource, name), &globaltsmtanzuvmwarecomv1.Domain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Domain), err +} + +// List takes label and field selectors, and returns the list of Domains that match those selectors. +func (c *FakeDomains) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DomainList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(domainsResource, domainsKind, opts), &globaltsmtanzuvmwarecomv1.DomainList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DomainList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DomainList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DomainList).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 domains. +func (c *FakeDomains) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(domainsResource, opts)) +} + +// Create takes the representation of a domain and creates it. Returns the server's representation of the domain, and an error, if there is any. +func (c *FakeDomains) Create(ctx context.Context, domain *globaltsmtanzuvmwarecomv1.Domain, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Domain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(domainsResource, domain), &globaltsmtanzuvmwarecomv1.Domain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Domain), err +} + +// Update takes the representation of a domain and updates it. Returns the server's representation of the domain, and an error, if there is any. +func (c *FakeDomains) Update(ctx context.Context, domain *globaltsmtanzuvmwarecomv1.Domain, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Domain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(domainsResource, domain), &globaltsmtanzuvmwarecomv1.Domain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Domain), err +} + +// Delete takes name of the domain and deletes it. Returns an error if one occurs. +func (c *FakeDomains) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(domainsResource, name), &globaltsmtanzuvmwarecomv1.Domain{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDomains) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(domainsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DomainList{}) + return err +} + +// Patch applies the patch and returns the patched domain. +func (c *FakeDomains) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Domain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(domainsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Domain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Domain), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_domainconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_domainconfig.go new file mode 100644 index 000000000..8acc903db --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_domainconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeDomainConfigs implements DomainConfigInterface +type FakeDomainConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var domainconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "domainconfigs"} + +var domainconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "DomainConfig"} + +// Get takes name of the domainConfig, and returns the corresponding domainConfig object, and an error if there is any. +func (c *FakeDomainConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.DomainConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(domainconfigsResource, name), &globaltsmtanzuvmwarecomv1.DomainConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DomainConfig), err +} + +// List takes label and field selectors, and returns the list of DomainConfigs that match those selectors. +func (c *FakeDomainConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.DomainConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(domainconfigsResource, domainconfigsKind, opts), &globaltsmtanzuvmwarecomv1.DomainConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.DomainConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.DomainConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.DomainConfigList).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 domainConfigs. +func (c *FakeDomainConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(domainconfigsResource, opts)) +} + +// Create takes the representation of a domainConfig and creates it. Returns the server's representation of the domainConfig, and an error, if there is any. +func (c *FakeDomainConfigs) Create(ctx context.Context, domainConfig *globaltsmtanzuvmwarecomv1.DomainConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.DomainConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(domainconfigsResource, domainConfig), &globaltsmtanzuvmwarecomv1.DomainConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DomainConfig), err +} + +// Update takes the representation of a domainConfig and updates it. Returns the server's representation of the domainConfig, and an error, if there is any. +func (c *FakeDomainConfigs) Update(ctx context.Context, domainConfig *globaltsmtanzuvmwarecomv1.DomainConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.DomainConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(domainconfigsResource, domainConfig), &globaltsmtanzuvmwarecomv1.DomainConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DomainConfig), err +} + +// Delete takes name of the domainConfig and deletes it. Returns an error if one occurs. +func (c *FakeDomainConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(domainconfigsResource, name), &globaltsmtanzuvmwarecomv1.DomainConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDomainConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(domainconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.DomainConfigList{}) + return err +} + +// Patch applies the patch and returns the patched domainConfig. +func (c *FakeDomainConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.DomainConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(domainconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.DomainConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.DomainConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_endpoints.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_endpoints.go new file mode 100644 index 000000000..2a32f06f3 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_endpoints.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeEndpoints implements EndpointsInterface +type FakeEndpoints struct { + Fake *FakeGlobalTsmV1 +} + +var endpointsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "endpoints"} + +var endpointsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Endpoints"} + +// Get takes name of the endpoints, and returns the corresponding endpoints object, and an error if there is any. +func (c *FakeEndpoints) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Endpoints, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(endpointsResource, name), &globaltsmtanzuvmwarecomv1.Endpoints{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Endpoints), err +} + +// List takes label and field selectors, and returns the list of Endpoints that match those selectors. +func (c *FakeEndpoints) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.EndpointsList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(endpointsResource, endpointsKind, opts), &globaltsmtanzuvmwarecomv1.EndpointsList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.EndpointsList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.EndpointsList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.EndpointsList).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 endpoints. +func (c *FakeEndpoints) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(endpointsResource, opts)) +} + +// Create takes the representation of a endpoints and creates it. Returns the server's representation of the endpoints, and an error, if there is any. +func (c *FakeEndpoints) Create(ctx context.Context, endpoints *globaltsmtanzuvmwarecomv1.Endpoints, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Endpoints, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(endpointsResource, endpoints), &globaltsmtanzuvmwarecomv1.Endpoints{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Endpoints), err +} + +// Update takes the representation of a endpoints and updates it. Returns the server's representation of the endpoints, and an error, if there is any. +func (c *FakeEndpoints) Update(ctx context.Context, endpoints *globaltsmtanzuvmwarecomv1.Endpoints, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Endpoints, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(endpointsResource, endpoints), &globaltsmtanzuvmwarecomv1.Endpoints{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Endpoints), err +} + +// Delete takes name of the endpoints and deletes it. Returns an error if one occurs. +func (c *FakeEndpoints) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(endpointsResource, name), &globaltsmtanzuvmwarecomv1.Endpoints{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeEndpoints) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(endpointsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.EndpointsList{}) + return err +} + +// Patch applies the patch and returns the patched endpoints. +func (c *FakeEndpoints) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Endpoints, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(endpointsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Endpoints{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Endpoints), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_envoyfilter.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_envoyfilter.go new file mode 100644 index 000000000..e38b3a63d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_envoyfilter.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeEnvoyFilters implements EnvoyFilterInterface +type FakeEnvoyFilters struct { + Fake *FakeGlobalTsmV1 +} + +var envoyfiltersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "envoyfilters"} + +var envoyfiltersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "EnvoyFilter"} + +// Get takes name of the envoyFilter, and returns the corresponding envoyFilter object, and an error if there is any. +func (c *FakeEnvoyFilters) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.EnvoyFilter, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(envoyfiltersResource, name), &globaltsmtanzuvmwarecomv1.EnvoyFilter{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.EnvoyFilter), err +} + +// List takes label and field selectors, and returns the list of EnvoyFilters that match those selectors. +func (c *FakeEnvoyFilters) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.EnvoyFilterList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(envoyfiltersResource, envoyfiltersKind, opts), &globaltsmtanzuvmwarecomv1.EnvoyFilterList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.EnvoyFilterList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.EnvoyFilterList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.EnvoyFilterList).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 envoyFilters. +func (c *FakeEnvoyFilters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(envoyfiltersResource, opts)) +} + +// Create takes the representation of a envoyFilter and creates it. Returns the server's representation of the envoyFilter, and an error, if there is any. +func (c *FakeEnvoyFilters) Create(ctx context.Context, envoyFilter *globaltsmtanzuvmwarecomv1.EnvoyFilter, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.EnvoyFilter, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(envoyfiltersResource, envoyFilter), &globaltsmtanzuvmwarecomv1.EnvoyFilter{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.EnvoyFilter), err +} + +// Update takes the representation of a envoyFilter and updates it. Returns the server's representation of the envoyFilter, and an error, if there is any. +func (c *FakeEnvoyFilters) Update(ctx context.Context, envoyFilter *globaltsmtanzuvmwarecomv1.EnvoyFilter, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.EnvoyFilter, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(envoyfiltersResource, envoyFilter), &globaltsmtanzuvmwarecomv1.EnvoyFilter{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.EnvoyFilter), err +} + +// Delete takes name of the envoyFilter and deletes it. Returns an error if one occurs. +func (c *FakeEnvoyFilters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(envoyfiltersResource, name), &globaltsmtanzuvmwarecomv1.EnvoyFilter{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeEnvoyFilters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(envoyfiltersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.EnvoyFilterList{}) + return err +} + +// Patch applies the patch and returns the patched envoyFilter. +func (c *FakeEnvoyFilters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.EnvoyFilter, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(envoyfiltersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.EnvoyFilter{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.EnvoyFilter), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalaccountconfign.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalaccountconfign.go new file mode 100644 index 000000000..3b25e106b --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalaccountconfign.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalAccountConfigNs implements ExternalAccountConfigNInterface +type FakeExternalAccountConfigNs struct { + Fake *FakeGlobalTsmV1 +} + +var externalaccountconfignsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externalaccountconfigns"} + +var externalaccountconfignsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalAccountConfigN"} + +// Get takes name of the externalAccountConfigN, and returns the corresponding externalAccountConfigN object, and an error if there is any. +func (c *FakeExternalAccountConfigNs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalAccountConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externalaccountconfignsResource, name), &globaltsmtanzuvmwarecomv1.ExternalAccountConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalAccountConfigN), err +} + +// List takes label and field selectors, and returns the list of ExternalAccountConfigNs that match those selectors. +func (c *FakeExternalAccountConfigNs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalAccountConfigNList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externalaccountconfignsResource, externalaccountconfignsKind, opts), &globaltsmtanzuvmwarecomv1.ExternalAccountConfigNList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalAccountConfigNList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalAccountConfigNList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalAccountConfigNList).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 externalAccountConfigNs. +func (c *FakeExternalAccountConfigNs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externalaccountconfignsResource, opts)) +} + +// Create takes the representation of a externalAccountConfigN and creates it. Returns the server's representation of the externalAccountConfigN, and an error, if there is any. +func (c *FakeExternalAccountConfigNs) Create(ctx context.Context, externalAccountConfigN *globaltsmtanzuvmwarecomv1.ExternalAccountConfigN, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalAccountConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externalaccountconfignsResource, externalAccountConfigN), &globaltsmtanzuvmwarecomv1.ExternalAccountConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalAccountConfigN), err +} + +// Update takes the representation of a externalAccountConfigN and updates it. Returns the server's representation of the externalAccountConfigN, and an error, if there is any. +func (c *FakeExternalAccountConfigNs) Update(ctx context.Context, externalAccountConfigN *globaltsmtanzuvmwarecomv1.ExternalAccountConfigN, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalAccountConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externalaccountconfignsResource, externalAccountConfigN), &globaltsmtanzuvmwarecomv1.ExternalAccountConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalAccountConfigN), err +} + +// Delete takes name of the externalAccountConfigN and deletes it. Returns an error if one occurs. +func (c *FakeExternalAccountConfigNs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externalaccountconfignsResource, name), &globaltsmtanzuvmwarecomv1.ExternalAccountConfigN{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalAccountConfigNs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externalaccountconfignsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalAccountConfigNList{}) + return err +} + +// Patch applies the patch and returns the patched externalAccountConfigN. +func (c *FakeExternalAccountConfigNs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalAccountConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externalaccountconfignsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalAccountConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalAccountConfigN), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalauditstorage.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalauditstorage.go new file mode 100644 index 000000000..d1ccc775b --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalauditstorage.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalAuditStorages implements ExternalAuditStorageInterface +type FakeExternalAuditStorages struct { + Fake *FakeGlobalTsmV1 +} + +var externalauditstoragesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externalauditstorages"} + +var externalauditstoragesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalAuditStorage"} + +// Get takes name of the externalAuditStorage, and returns the corresponding externalAuditStorage object, and an error if there is any. +func (c *FakeExternalAuditStorages) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalAuditStorage, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externalauditstoragesResource, name), &globaltsmtanzuvmwarecomv1.ExternalAuditStorage{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalAuditStorage), err +} + +// List takes label and field selectors, and returns the list of ExternalAuditStorages that match those selectors. +func (c *FakeExternalAuditStorages) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalAuditStorageList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externalauditstoragesResource, externalauditstoragesKind, opts), &globaltsmtanzuvmwarecomv1.ExternalAuditStorageList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalAuditStorageList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalAuditStorageList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalAuditStorageList).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 externalAuditStorages. +func (c *FakeExternalAuditStorages) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externalauditstoragesResource, opts)) +} + +// Create takes the representation of a externalAuditStorage and creates it. Returns the server's representation of the externalAuditStorage, and an error, if there is any. +func (c *FakeExternalAuditStorages) Create(ctx context.Context, externalAuditStorage *globaltsmtanzuvmwarecomv1.ExternalAuditStorage, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalAuditStorage, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externalauditstoragesResource, externalAuditStorage), &globaltsmtanzuvmwarecomv1.ExternalAuditStorage{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalAuditStorage), err +} + +// Update takes the representation of a externalAuditStorage and updates it. Returns the server's representation of the externalAuditStorage, and an error, if there is any. +func (c *FakeExternalAuditStorages) Update(ctx context.Context, externalAuditStorage *globaltsmtanzuvmwarecomv1.ExternalAuditStorage, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalAuditStorage, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externalauditstoragesResource, externalAuditStorage), &globaltsmtanzuvmwarecomv1.ExternalAuditStorage{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalAuditStorage), err +} + +// Delete takes name of the externalAuditStorage and deletes it. Returns an error if one occurs. +func (c *FakeExternalAuditStorages) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externalauditstoragesResource, name), &globaltsmtanzuvmwarecomv1.ExternalAuditStorage{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalAuditStorages) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externalauditstoragesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalAuditStorageList{}) + return err +} + +// Patch applies the patch and returns the patched externalAuditStorage. +func (c *FakeExternalAuditStorages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalAuditStorage, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externalauditstoragesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalAuditStorage{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalAuditStorage), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsconfign.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsconfign.go new file mode 100644 index 000000000..3f3841b6f --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsconfign.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalDNSConfigNs implements ExternalDNSConfigNInterface +type FakeExternalDNSConfigNs struct { + Fake *FakeGlobalTsmV1 +} + +var externaldnsconfignsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externaldnsconfigns"} + +var externaldnsconfignsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalDNSConfigN"} + +// Get takes name of the externalDNSConfigN, and returns the corresponding externalDNSConfigN object, and an error if there is any. +func (c *FakeExternalDNSConfigNs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externaldnsconfignsResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSConfigN), err +} + +// List takes label and field selectors, and returns the list of ExternalDNSConfigNs that match those selectors. +func (c *FakeExternalDNSConfigNs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSConfigNList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externaldnsconfignsResource, externaldnsconfignsKind, opts), &globaltsmtanzuvmwarecomv1.ExternalDNSConfigNList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalDNSConfigNList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSConfigNList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSConfigNList).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 externalDNSConfigNs. +func (c *FakeExternalDNSConfigNs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externaldnsconfignsResource, opts)) +} + +// Create takes the representation of a externalDNSConfigN and creates it. Returns the server's representation of the externalDNSConfigN, and an error, if there is any. +func (c *FakeExternalDNSConfigNs) Create(ctx context.Context, externalDNSConfigN *globaltsmtanzuvmwarecomv1.ExternalDNSConfigN, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externaldnsconfignsResource, externalDNSConfigN), &globaltsmtanzuvmwarecomv1.ExternalDNSConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSConfigN), err +} + +// Update takes the representation of a externalDNSConfigN and updates it. Returns the server's representation of the externalDNSConfigN, and an error, if there is any. +func (c *FakeExternalDNSConfigNs) Update(ctx context.Context, externalDNSConfigN *globaltsmtanzuvmwarecomv1.ExternalDNSConfigN, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externaldnsconfignsResource, externalDNSConfigN), &globaltsmtanzuvmwarecomv1.ExternalDNSConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSConfigN), err +} + +// Delete takes name of the externalDNSConfigN and deletes it. Returns an error if one occurs. +func (c *FakeExternalDNSConfigNs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externaldnsconfignsResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSConfigN{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalDNSConfigNs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externaldnsconfignsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalDNSConfigNList{}) + return err +} + +// Patch applies the patch and returns the patched externalDNSConfigN. +func (c *FakeExternalDNSConfigNs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalDNSConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externaldnsconfignsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalDNSConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSConfigN), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsinventory.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsinventory.go new file mode 100644 index 000000000..da63fe423 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsinventory.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalDNSInventories implements ExternalDNSInventoryInterface +type FakeExternalDNSInventories struct { + Fake *FakeGlobalTsmV1 +} + +var externaldnsinventoriesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externaldnsinventories"} + +var externaldnsinventoriesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalDNSInventory"} + +// Get takes name of the externalDNSInventory, and returns the corresponding externalDNSInventory object, and an error if there is any. +func (c *FakeExternalDNSInventories) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventory, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externaldnsinventoriesResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSInventory{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventory), err +} + +// List takes label and field selectors, and returns the list of ExternalDNSInventories that match those selectors. +func (c *FakeExternalDNSInventories) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externaldnsinventoriesResource, externaldnsinventoriesKind, opts), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryList).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 externalDNSInventories. +func (c *FakeExternalDNSInventories) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externaldnsinventoriesResource, opts)) +} + +// Create takes the representation of a externalDNSInventory and creates it. Returns the server's representation of the externalDNSInventory, and an error, if there is any. +func (c *FakeExternalDNSInventories) Create(ctx context.Context, externalDNSInventory *globaltsmtanzuvmwarecomv1.ExternalDNSInventory, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventory, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externaldnsinventoriesResource, externalDNSInventory), &globaltsmtanzuvmwarecomv1.ExternalDNSInventory{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventory), err +} + +// Update takes the representation of a externalDNSInventory and updates it. Returns the server's representation of the externalDNSInventory, and an error, if there is any. +func (c *FakeExternalDNSInventories) Update(ctx context.Context, externalDNSInventory *globaltsmtanzuvmwarecomv1.ExternalDNSInventory, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventory, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externaldnsinventoriesResource, externalDNSInventory), &globaltsmtanzuvmwarecomv1.ExternalDNSInventory{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventory), err +} + +// Delete takes name of the externalDNSInventory and deletes it. Returns an error if one occurs. +func (c *FakeExternalDNSInventories) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externaldnsinventoriesResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSInventory{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalDNSInventories) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externaldnsinventoriesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryList{}) + return err +} + +// Patch applies the patch and returns the patched externalDNSInventory. +func (c *FakeExternalDNSInventories) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventory, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externaldnsinventoriesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalDNSInventory{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventory), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsinventoryhealthcheck.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsinventoryhealthcheck.go new file mode 100644 index 000000000..85805c879 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsinventoryhealthcheck.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalDNSInventoryHealthChecks implements ExternalDNSInventoryHealthCheckInterface +type FakeExternalDNSInventoryHealthChecks struct { + Fake *FakeGlobalTsmV1 +} + +var externaldnsinventoryhealthchecksResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externaldnsinventoryhealthchecks"} + +var externaldnsinventoryhealthchecksKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalDNSInventoryHealthCheck"} + +// Get takes name of the externalDNSInventoryHealthCheck, and returns the corresponding externalDNSInventoryHealthCheck object, and an error if there is any. +func (c *FakeExternalDNSInventoryHealthChecks) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externaldnsinventoryhealthchecksResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck), err +} + +// List takes label and field selectors, and returns the list of ExternalDNSInventoryHealthChecks that match those selectors. +func (c *FakeExternalDNSInventoryHealthChecks) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheckList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externaldnsinventoryhealthchecksResource, externaldnsinventoryhealthchecksKind, opts), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheckList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheckList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheckList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheckList).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 externalDNSInventoryHealthChecks. +func (c *FakeExternalDNSInventoryHealthChecks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externaldnsinventoryhealthchecksResource, opts)) +} + +// Create takes the representation of a externalDNSInventoryHealthCheck and creates it. Returns the server's representation of the externalDNSInventoryHealthCheck, and an error, if there is any. +func (c *FakeExternalDNSInventoryHealthChecks) Create(ctx context.Context, externalDNSInventoryHealthCheck *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externaldnsinventoryhealthchecksResource, externalDNSInventoryHealthCheck), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck), err +} + +// Update takes the representation of a externalDNSInventoryHealthCheck and updates it. Returns the server's representation of the externalDNSInventoryHealthCheck, and an error, if there is any. +func (c *FakeExternalDNSInventoryHealthChecks) Update(ctx context.Context, externalDNSInventoryHealthCheck *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externaldnsinventoryhealthchecksResource, externalDNSInventoryHealthCheck), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck), err +} + +// Delete takes name of the externalDNSInventoryHealthCheck and deletes it. Returns an error if one occurs. +func (c *FakeExternalDNSInventoryHealthChecks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externaldnsinventoryhealthchecksResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalDNSInventoryHealthChecks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externaldnsinventoryhealthchecksResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheckList{}) + return err +} + +// Patch applies the patch and returns the patched externalDNSInventoryHealthCheck. +func (c *FakeExternalDNSInventoryHealthChecks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externaldnsinventoryhealthchecksResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsinventoryprimarydomain.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsinventoryprimarydomain.go new file mode 100644 index 000000000..f85986545 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsinventoryprimarydomain.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalDNSInventoryPrimaryDomains implements ExternalDNSInventoryPrimaryDomainInterface +type FakeExternalDNSInventoryPrimaryDomains struct { + Fake *FakeGlobalTsmV1 +} + +var externaldnsinventoryprimarydomainsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externaldnsinventoryprimarydomains"} + +var externaldnsinventoryprimarydomainsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalDNSInventoryPrimaryDomain"} + +// Get takes name of the externalDNSInventoryPrimaryDomain, and returns the corresponding externalDNSInventoryPrimaryDomain object, and an error if there is any. +func (c *FakeExternalDNSInventoryPrimaryDomains) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externaldnsinventoryprimarydomainsResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain), err +} + +// List takes label and field selectors, and returns the list of ExternalDNSInventoryPrimaryDomains that match those selectors. +func (c *FakeExternalDNSInventoryPrimaryDomains) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomainList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externaldnsinventoryprimarydomainsResource, externaldnsinventoryprimarydomainsKind, opts), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomainList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomainList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomainList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomainList).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 externalDNSInventoryPrimaryDomains. +func (c *FakeExternalDNSInventoryPrimaryDomains) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externaldnsinventoryprimarydomainsResource, opts)) +} + +// Create takes the representation of a externalDNSInventoryPrimaryDomain and creates it. Returns the server's representation of the externalDNSInventoryPrimaryDomain, and an error, if there is any. +func (c *FakeExternalDNSInventoryPrimaryDomains) Create(ctx context.Context, externalDNSInventoryPrimaryDomain *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externaldnsinventoryprimarydomainsResource, externalDNSInventoryPrimaryDomain), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain), err +} + +// Update takes the representation of a externalDNSInventoryPrimaryDomain and updates it. Returns the server's representation of the externalDNSInventoryPrimaryDomain, and an error, if there is any. +func (c *FakeExternalDNSInventoryPrimaryDomains) Update(ctx context.Context, externalDNSInventoryPrimaryDomain *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externaldnsinventoryprimarydomainsResource, externalDNSInventoryPrimaryDomain), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain), err +} + +// Delete takes name of the externalDNSInventoryPrimaryDomain and deletes it. Returns an error if one occurs. +func (c *FakeExternalDNSInventoryPrimaryDomains) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externaldnsinventoryprimarydomainsResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalDNSInventoryPrimaryDomains) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externaldnsinventoryprimarydomainsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomainList{}) + return err +} + +// Patch applies the patch and returns the patched externalDNSInventoryPrimaryDomain. +func (c *FakeExternalDNSInventoryPrimaryDomains) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externaldnsinventoryprimarydomainsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsinventoryrecord.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsinventoryrecord.go new file mode 100644 index 000000000..148ec400d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsinventoryrecord.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalDNSInventoryRecords implements ExternalDNSInventoryRecordInterface +type FakeExternalDNSInventoryRecords struct { + Fake *FakeGlobalTsmV1 +} + +var externaldnsinventoryrecordsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externaldnsinventoryrecords"} + +var externaldnsinventoryrecordsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalDNSInventoryRecord"} + +// Get takes name of the externalDNSInventoryRecord, and returns the corresponding externalDNSInventoryRecord object, and an error if there is any. +func (c *FakeExternalDNSInventoryRecords) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externaldnsinventoryrecordsResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord), err +} + +// List takes label and field selectors, and returns the list of ExternalDNSInventoryRecords that match those selectors. +func (c *FakeExternalDNSInventoryRecords) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecordList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externaldnsinventoryrecordsResource, externaldnsinventoryrecordsKind, opts), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecordList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecordList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecordList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecordList).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 externalDNSInventoryRecords. +func (c *FakeExternalDNSInventoryRecords) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externaldnsinventoryrecordsResource, opts)) +} + +// Create takes the representation of a externalDNSInventoryRecord and creates it. Returns the server's representation of the externalDNSInventoryRecord, and an error, if there is any. +func (c *FakeExternalDNSInventoryRecords) Create(ctx context.Context, externalDNSInventoryRecord *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externaldnsinventoryrecordsResource, externalDNSInventoryRecord), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord), err +} + +// Update takes the representation of a externalDNSInventoryRecord and updates it. Returns the server's representation of the externalDNSInventoryRecord, and an error, if there is any. +func (c *FakeExternalDNSInventoryRecords) Update(ctx context.Context, externalDNSInventoryRecord *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externaldnsinventoryrecordsResource, externalDNSInventoryRecord), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord), err +} + +// Delete takes name of the externalDNSInventoryRecord and deletes it. Returns an error if one occurs. +func (c *FakeExternalDNSInventoryRecords) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externaldnsinventoryrecordsResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalDNSInventoryRecords) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externaldnsinventoryrecordsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecordList{}) + return err +} + +// Patch applies the patch and returns the patched externalDNSInventoryRecord. +func (c *FakeExternalDNSInventoryRecords) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externaldnsinventoryrecordsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsinventoryzone.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsinventoryzone.go new file mode 100644 index 000000000..47a22e5f7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsinventoryzone.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalDNSInventoryZones implements ExternalDNSInventoryZoneInterface +type FakeExternalDNSInventoryZones struct { + Fake *FakeGlobalTsmV1 +} + +var externaldnsinventoryzonesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externaldnsinventoryzones"} + +var externaldnsinventoryzonesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalDNSInventoryZone"} + +// Get takes name of the externalDNSInventoryZone, and returns the corresponding externalDNSInventoryZone object, and an error if there is any. +func (c *FakeExternalDNSInventoryZones) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externaldnsinventoryzonesResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone), err +} + +// List takes label and field selectors, and returns the list of ExternalDNSInventoryZones that match those selectors. +func (c *FakeExternalDNSInventoryZones) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZoneList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externaldnsinventoryzonesResource, externaldnsinventoryzonesKind, opts), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZoneList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZoneList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZoneList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZoneList).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 externalDNSInventoryZones. +func (c *FakeExternalDNSInventoryZones) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externaldnsinventoryzonesResource, opts)) +} + +// Create takes the representation of a externalDNSInventoryZone and creates it. Returns the server's representation of the externalDNSInventoryZone, and an error, if there is any. +func (c *FakeExternalDNSInventoryZones) Create(ctx context.Context, externalDNSInventoryZone *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externaldnsinventoryzonesResource, externalDNSInventoryZone), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone), err +} + +// Update takes the representation of a externalDNSInventoryZone and updates it. Returns the server's representation of the externalDNSInventoryZone, and an error, if there is any. +func (c *FakeExternalDNSInventoryZones) Update(ctx context.Context, externalDNSInventoryZone *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externaldnsinventoryzonesResource, externalDNSInventoryZone), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone), err +} + +// Delete takes name of the externalDNSInventoryZone and deletes it. Returns an error if one occurs. +func (c *FakeExternalDNSInventoryZones) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externaldnsinventoryzonesResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalDNSInventoryZones) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externaldnsinventoryzonesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZoneList{}) + return err +} + +// Patch applies the patch and returns the patched externalDNSInventoryZone. +func (c *FakeExternalDNSInventoryZones) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externaldnsinventoryzonesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsruntime.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsruntime.go new file mode 100644 index 000000000..b5ef32d4a --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsruntime.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalDNSRuntimes implements ExternalDNSRuntimeInterface +type FakeExternalDNSRuntimes struct { + Fake *FakeGlobalTsmV1 +} + +var externaldnsruntimesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externaldnsruntimes"} + +var externaldnsruntimesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalDNSRuntime"} + +// Get takes name of the externalDNSRuntime, and returns the corresponding externalDNSRuntime object, and an error if there is any. +func (c *FakeExternalDNSRuntimes) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntime, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externaldnsruntimesResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntime{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntime), err +} + +// List takes label and field selectors, and returns the list of ExternalDNSRuntimes that match those selectors. +func (c *FakeExternalDNSRuntimes) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externaldnsruntimesResource, externaldnsruntimesKind, opts), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeList).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 externalDNSRuntimes. +func (c *FakeExternalDNSRuntimes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externaldnsruntimesResource, opts)) +} + +// Create takes the representation of a externalDNSRuntime and creates it. Returns the server's representation of the externalDNSRuntime, and an error, if there is any. +func (c *FakeExternalDNSRuntimes) Create(ctx context.Context, externalDNSRuntime *globaltsmtanzuvmwarecomv1.ExternalDNSRuntime, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntime, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externaldnsruntimesResource, externalDNSRuntime), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntime{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntime), err +} + +// Update takes the representation of a externalDNSRuntime and updates it. Returns the server's representation of the externalDNSRuntime, and an error, if there is any. +func (c *FakeExternalDNSRuntimes) Update(ctx context.Context, externalDNSRuntime *globaltsmtanzuvmwarecomv1.ExternalDNSRuntime, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntime, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externaldnsruntimesResource, externalDNSRuntime), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntime{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntime), err +} + +// Delete takes name of the externalDNSRuntime and deletes it. Returns an error if one occurs. +func (c *FakeExternalDNSRuntimes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externaldnsruntimesResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntime{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalDNSRuntimes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externaldnsruntimesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeList{}) + return err +} + +// Patch applies the patch and returns the patched externalDNSRuntime. +func (c *FakeExternalDNSRuntimes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntime, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externaldnsruntimesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntime{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntime), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsruntimeendpoint.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsruntimeendpoint.go new file mode 100644 index 000000000..61d59f08f --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsruntimeendpoint.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalDNSRuntimeEndpoints implements ExternalDNSRuntimeEndpointInterface +type FakeExternalDNSRuntimeEndpoints struct { + Fake *FakeGlobalTsmV1 +} + +var externaldnsruntimeendpointsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externaldnsruntimeendpoints"} + +var externaldnsruntimeendpointsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalDNSRuntimeEndpoint"} + +// Get takes name of the externalDNSRuntimeEndpoint, and returns the corresponding externalDNSRuntimeEndpoint object, and an error if there is any. +func (c *FakeExternalDNSRuntimeEndpoints) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externaldnsruntimeendpointsResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint), err +} + +// List takes label and field selectors, and returns the list of ExternalDNSRuntimeEndpoints that match those selectors. +func (c *FakeExternalDNSRuntimeEndpoints) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpointList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externaldnsruntimeendpointsResource, externaldnsruntimeendpointsKind, opts), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpointList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpointList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpointList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpointList).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 externalDNSRuntimeEndpoints. +func (c *FakeExternalDNSRuntimeEndpoints) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externaldnsruntimeendpointsResource, opts)) +} + +// Create takes the representation of a externalDNSRuntimeEndpoint and creates it. Returns the server's representation of the externalDNSRuntimeEndpoint, and an error, if there is any. +func (c *FakeExternalDNSRuntimeEndpoints) Create(ctx context.Context, externalDNSRuntimeEndpoint *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externaldnsruntimeendpointsResource, externalDNSRuntimeEndpoint), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint), err +} + +// Update takes the representation of a externalDNSRuntimeEndpoint and updates it. Returns the server's representation of the externalDNSRuntimeEndpoint, and an error, if there is any. +func (c *FakeExternalDNSRuntimeEndpoints) Update(ctx context.Context, externalDNSRuntimeEndpoint *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externaldnsruntimeendpointsResource, externalDNSRuntimeEndpoint), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint), err +} + +// Delete takes name of the externalDNSRuntimeEndpoint and deletes it. Returns an error if one occurs. +func (c *FakeExternalDNSRuntimeEndpoints) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externaldnsruntimeendpointsResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalDNSRuntimeEndpoints) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externaldnsruntimeendpointsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpointList{}) + return err +} + +// Patch applies the patch and returns the patched externalDNSRuntimeEndpoint. +func (c *FakeExternalDNSRuntimeEndpoints) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externaldnsruntimeendpointsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsruntimeprimarydomain.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsruntimeprimarydomain.go new file mode 100644 index 000000000..de3861982 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsruntimeprimarydomain.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalDNSRuntimePrimaryDomains implements ExternalDNSRuntimePrimaryDomainInterface +type FakeExternalDNSRuntimePrimaryDomains struct { + Fake *FakeGlobalTsmV1 +} + +var externaldnsruntimeprimarydomainsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externaldnsruntimeprimarydomains"} + +var externaldnsruntimeprimarydomainsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalDNSRuntimePrimaryDomain"} + +// Get takes name of the externalDNSRuntimePrimaryDomain, and returns the corresponding externalDNSRuntimePrimaryDomain object, and an error if there is any. +func (c *FakeExternalDNSRuntimePrimaryDomains) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externaldnsruntimeprimarydomainsResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain), err +} + +// List takes label and field selectors, and returns the list of ExternalDNSRuntimePrimaryDomains that match those selectors. +func (c *FakeExternalDNSRuntimePrimaryDomains) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomainList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externaldnsruntimeprimarydomainsResource, externaldnsruntimeprimarydomainsKind, opts), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomainList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomainList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomainList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomainList).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 externalDNSRuntimePrimaryDomains. +func (c *FakeExternalDNSRuntimePrimaryDomains) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externaldnsruntimeprimarydomainsResource, opts)) +} + +// Create takes the representation of a externalDNSRuntimePrimaryDomain and creates it. Returns the server's representation of the externalDNSRuntimePrimaryDomain, and an error, if there is any. +func (c *FakeExternalDNSRuntimePrimaryDomains) Create(ctx context.Context, externalDNSRuntimePrimaryDomain *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externaldnsruntimeprimarydomainsResource, externalDNSRuntimePrimaryDomain), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain), err +} + +// Update takes the representation of a externalDNSRuntimePrimaryDomain and updates it. Returns the server's representation of the externalDNSRuntimePrimaryDomain, and an error, if there is any. +func (c *FakeExternalDNSRuntimePrimaryDomains) Update(ctx context.Context, externalDNSRuntimePrimaryDomain *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externaldnsruntimeprimarydomainsResource, externalDNSRuntimePrimaryDomain), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain), err +} + +// Delete takes name of the externalDNSRuntimePrimaryDomain and deletes it. Returns an error if one occurs. +func (c *FakeExternalDNSRuntimePrimaryDomains) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externaldnsruntimeprimarydomainsResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalDNSRuntimePrimaryDomains) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externaldnsruntimeprimarydomainsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomainList{}) + return err +} + +// Patch applies the patch and returns the patched externalDNSRuntimePrimaryDomain. +func (c *FakeExternalDNSRuntimePrimaryDomains) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externaldnsruntimeprimarydomainsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsruntimesubdomain.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsruntimesubdomain.go new file mode 100644 index 000000000..ff9709c2e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externaldnsruntimesubdomain.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalDNSRuntimeSubdomains implements ExternalDNSRuntimeSubdomainInterface +type FakeExternalDNSRuntimeSubdomains struct { + Fake *FakeGlobalTsmV1 +} + +var externaldnsruntimesubdomainsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externaldnsruntimesubdomains"} + +var externaldnsruntimesubdomainsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalDNSRuntimeSubdomain"} + +// Get takes name of the externalDNSRuntimeSubdomain, and returns the corresponding externalDNSRuntimeSubdomain object, and an error if there is any. +func (c *FakeExternalDNSRuntimeSubdomains) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externaldnsruntimesubdomainsResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain), err +} + +// List takes label and field selectors, and returns the list of ExternalDNSRuntimeSubdomains that match those selectors. +func (c *FakeExternalDNSRuntimeSubdomains) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomainList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externaldnsruntimesubdomainsResource, externaldnsruntimesubdomainsKind, opts), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomainList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomainList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomainList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomainList).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 externalDNSRuntimeSubdomains. +func (c *FakeExternalDNSRuntimeSubdomains) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externaldnsruntimesubdomainsResource, opts)) +} + +// Create takes the representation of a externalDNSRuntimeSubdomain and creates it. Returns the server's representation of the externalDNSRuntimeSubdomain, and an error, if there is any. +func (c *FakeExternalDNSRuntimeSubdomains) Create(ctx context.Context, externalDNSRuntimeSubdomain *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externaldnsruntimesubdomainsResource, externalDNSRuntimeSubdomain), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain), err +} + +// Update takes the representation of a externalDNSRuntimeSubdomain and updates it. Returns the server's representation of the externalDNSRuntimeSubdomain, and an error, if there is any. +func (c *FakeExternalDNSRuntimeSubdomains) Update(ctx context.Context, externalDNSRuntimeSubdomain *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externaldnsruntimesubdomainsResource, externalDNSRuntimeSubdomain), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain), err +} + +// Delete takes name of the externalDNSRuntimeSubdomain and deletes it. Returns an error if one occurs. +func (c *FakeExternalDNSRuntimeSubdomains) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externaldnsruntimesubdomainsResource, name), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalDNSRuntimeSubdomains) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externaldnsruntimesubdomainsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomainList{}) + return err +} + +// Patch applies the patch and returns the patched externalDNSRuntimeSubdomain. +func (c *FakeExternalDNSRuntimeSubdomains) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externaldnsruntimesubdomainsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externallbconfign.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externallbconfign.go new file mode 100644 index 000000000..d2f126a3f --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externallbconfign.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalLBConfigNs implements ExternalLBConfigNInterface +type FakeExternalLBConfigNs struct { + Fake *FakeGlobalTsmV1 +} + +var externallbconfignsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externallbconfigns"} + +var externallbconfignsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalLBConfigN"} + +// Get takes name of the externalLBConfigN, and returns the corresponding externalLBConfigN object, and an error if there is any. +func (c *FakeExternalLBConfigNs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalLBConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externallbconfignsResource, name), &globaltsmtanzuvmwarecomv1.ExternalLBConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalLBConfigN), err +} + +// List takes label and field selectors, and returns the list of ExternalLBConfigNs that match those selectors. +func (c *FakeExternalLBConfigNs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalLBConfigNList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externallbconfignsResource, externallbconfignsKind, opts), &globaltsmtanzuvmwarecomv1.ExternalLBConfigNList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalLBConfigNList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalLBConfigNList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalLBConfigNList).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 externalLBConfigNs. +func (c *FakeExternalLBConfigNs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externallbconfignsResource, opts)) +} + +// Create takes the representation of a externalLBConfigN and creates it. Returns the server's representation of the externalLBConfigN, and an error, if there is any. +func (c *FakeExternalLBConfigNs) Create(ctx context.Context, externalLBConfigN *globaltsmtanzuvmwarecomv1.ExternalLBConfigN, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalLBConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externallbconfignsResource, externalLBConfigN), &globaltsmtanzuvmwarecomv1.ExternalLBConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalLBConfigN), err +} + +// Update takes the representation of a externalLBConfigN and updates it. Returns the server's representation of the externalLBConfigN, and an error, if there is any. +func (c *FakeExternalLBConfigNs) Update(ctx context.Context, externalLBConfigN *globaltsmtanzuvmwarecomv1.ExternalLBConfigN, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalLBConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externallbconfignsResource, externalLBConfigN), &globaltsmtanzuvmwarecomv1.ExternalLBConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalLBConfigN), err +} + +// Delete takes name of the externalLBConfigN and deletes it. Returns an error if one occurs. +func (c *FakeExternalLBConfigNs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externallbconfignsResource, name), &globaltsmtanzuvmwarecomv1.ExternalLBConfigN{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalLBConfigNs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externallbconfignsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalLBConfigNList{}) + return err +} + +// Patch applies the patch and returns the patched externalLBConfigN. +func (c *FakeExternalLBConfigNs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalLBConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externallbconfignsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalLBConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalLBConfigN), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalplugincapability.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalplugincapability.go new file mode 100644 index 000000000..b9748a9c5 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalplugincapability.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalPluginCapabilities implements ExternalPluginCapabilityInterface +type FakeExternalPluginCapabilities struct { + Fake *FakeGlobalTsmV1 +} + +var externalplugincapabilitiesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externalplugincapabilities"} + +var externalplugincapabilitiesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalPluginCapability"} + +// Get takes name of the externalPluginCapability, and returns the corresponding externalPluginCapability object, and an error if there is any. +func (c *FakeExternalPluginCapabilities) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginCapability, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externalplugincapabilitiesResource, name), &globaltsmtanzuvmwarecomv1.ExternalPluginCapability{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginCapability), err +} + +// List takes label and field selectors, and returns the list of ExternalPluginCapabilities that match those selectors. +func (c *FakeExternalPluginCapabilities) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginCapabilityList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externalplugincapabilitiesResource, externalplugincapabilitiesKind, opts), &globaltsmtanzuvmwarecomv1.ExternalPluginCapabilityList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalPluginCapabilityList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginCapabilityList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginCapabilityList).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 externalPluginCapabilities. +func (c *FakeExternalPluginCapabilities) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externalplugincapabilitiesResource, opts)) +} + +// Create takes the representation of a externalPluginCapability and creates it. Returns the server's representation of the externalPluginCapability, and an error, if there is any. +func (c *FakeExternalPluginCapabilities) Create(ctx context.Context, externalPluginCapability *globaltsmtanzuvmwarecomv1.ExternalPluginCapability, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginCapability, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externalplugincapabilitiesResource, externalPluginCapability), &globaltsmtanzuvmwarecomv1.ExternalPluginCapability{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginCapability), err +} + +// Update takes the representation of a externalPluginCapability and updates it. Returns the server's representation of the externalPluginCapability, and an error, if there is any. +func (c *FakeExternalPluginCapabilities) Update(ctx context.Context, externalPluginCapability *globaltsmtanzuvmwarecomv1.ExternalPluginCapability, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginCapability, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externalplugincapabilitiesResource, externalPluginCapability), &globaltsmtanzuvmwarecomv1.ExternalPluginCapability{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginCapability), err +} + +// Delete takes name of the externalPluginCapability and deletes it. Returns an error if one occurs. +func (c *FakeExternalPluginCapabilities) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externalplugincapabilitiesResource, name), &globaltsmtanzuvmwarecomv1.ExternalPluginCapability{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalPluginCapabilities) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externalplugincapabilitiesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalPluginCapabilityList{}) + return err +} + +// Patch applies the patch and returns the patched externalPluginCapability. +func (c *FakeExternalPluginCapabilities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalPluginCapability, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externalplugincapabilitiesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalPluginCapability{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginCapability), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalpluginconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalpluginconfig.go new file mode 100644 index 000000000..629aa28e8 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalpluginconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalPluginConfigs implements ExternalPluginConfigInterface +type FakeExternalPluginConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var externalpluginconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externalpluginconfigs"} + +var externalpluginconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalPluginConfig"} + +// Get takes name of the externalPluginConfig, and returns the corresponding externalPluginConfig object, and an error if there is any. +func (c *FakeExternalPluginConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externalpluginconfigsResource, name), &globaltsmtanzuvmwarecomv1.ExternalPluginConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginConfig), err +} + +// List takes label and field selectors, and returns the list of ExternalPluginConfigs that match those selectors. +func (c *FakeExternalPluginConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externalpluginconfigsResource, externalpluginconfigsKind, opts), &globaltsmtanzuvmwarecomv1.ExternalPluginConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalPluginConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginConfigList).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 externalPluginConfigs. +func (c *FakeExternalPluginConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externalpluginconfigsResource, opts)) +} + +// Create takes the representation of a externalPluginConfig and creates it. Returns the server's representation of the externalPluginConfig, and an error, if there is any. +func (c *FakeExternalPluginConfigs) Create(ctx context.Context, externalPluginConfig *globaltsmtanzuvmwarecomv1.ExternalPluginConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externalpluginconfigsResource, externalPluginConfig), &globaltsmtanzuvmwarecomv1.ExternalPluginConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginConfig), err +} + +// Update takes the representation of a externalPluginConfig and updates it. Returns the server's representation of the externalPluginConfig, and an error, if there is any. +func (c *FakeExternalPluginConfigs) Update(ctx context.Context, externalPluginConfig *globaltsmtanzuvmwarecomv1.ExternalPluginConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externalpluginconfigsResource, externalPluginConfig), &globaltsmtanzuvmwarecomv1.ExternalPluginConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginConfig), err +} + +// Delete takes name of the externalPluginConfig and deletes it. Returns an error if one occurs. +func (c *FakeExternalPluginConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externalpluginconfigsResource, name), &globaltsmtanzuvmwarecomv1.ExternalPluginConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalPluginConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externalpluginconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalPluginConfigList{}) + return err +} + +// Patch applies the patch and returns the patched externalPluginConfig. +func (c *FakeExternalPluginConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalPluginConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externalpluginconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalPluginConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalpluginconfigfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalpluginconfigfolder.go new file mode 100644 index 000000000..77ee02bb0 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalpluginconfigfolder.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalPluginConfigFolders implements ExternalPluginConfigFolderInterface +type FakeExternalPluginConfigFolders struct { + Fake *FakeGlobalTsmV1 +} + +var externalpluginconfigfoldersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externalpluginconfigfolders"} + +var externalpluginconfigfoldersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalPluginConfigFolder"} + +// Get takes name of the externalPluginConfigFolder, and returns the corresponding externalPluginConfigFolder object, and an error if there is any. +func (c *FakeExternalPluginConfigFolders) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externalpluginconfigfoldersResource, name), &globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder), err +} + +// List takes label and field selectors, and returns the list of ExternalPluginConfigFolders that match those selectors. +func (c *FakeExternalPluginConfigFolders) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externalpluginconfigfoldersResource, externalpluginconfigfoldersKind, opts), &globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolderList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolderList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolderList).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 externalPluginConfigFolders. +func (c *FakeExternalPluginConfigFolders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externalpluginconfigfoldersResource, opts)) +} + +// Create takes the representation of a externalPluginConfigFolder and creates it. Returns the server's representation of the externalPluginConfigFolder, and an error, if there is any. +func (c *FakeExternalPluginConfigFolders) Create(ctx context.Context, externalPluginConfigFolder *globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externalpluginconfigfoldersResource, externalPluginConfigFolder), &globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder), err +} + +// Update takes the representation of a externalPluginConfigFolder and updates it. Returns the server's representation of the externalPluginConfigFolder, and an error, if there is any. +func (c *FakeExternalPluginConfigFolders) Update(ctx context.Context, externalPluginConfigFolder *globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externalpluginconfigfoldersResource, externalPluginConfigFolder), &globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder), err +} + +// Delete takes name of the externalPluginConfigFolder and deletes it. Returns an error if one occurs. +func (c *FakeExternalPluginConfigFolders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externalpluginconfigfoldersResource, name), &globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalPluginConfigFolders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externalpluginconfigfoldersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolderList{}) + return err +} + +// Patch applies the patch and returns the patched externalPluginConfigFolder. +func (c *FakeExternalPluginConfigFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externalpluginconfigfoldersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalplugininstanceconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalplugininstanceconfig.go new file mode 100644 index 000000000..151ebc922 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalplugininstanceconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalPluginInstanceConfigs implements ExternalPluginInstanceConfigInterface +type FakeExternalPluginInstanceConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var externalplugininstanceconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externalplugininstanceconfigs"} + +var externalplugininstanceconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalPluginInstanceConfig"} + +// Get takes name of the externalPluginInstanceConfig, and returns the corresponding externalPluginInstanceConfig object, and an error if there is any. +func (c *FakeExternalPluginInstanceConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externalplugininstanceconfigsResource, name), &globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig), err +} + +// List takes label and field selectors, and returns the list of ExternalPluginInstanceConfigs that match those selectors. +func (c *FakeExternalPluginInstanceConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externalplugininstanceconfigsResource, externalplugininstanceconfigsKind, opts), &globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfigList).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 externalPluginInstanceConfigs. +func (c *FakeExternalPluginInstanceConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externalplugininstanceconfigsResource, opts)) +} + +// Create takes the representation of a externalPluginInstanceConfig and creates it. Returns the server's representation of the externalPluginInstanceConfig, and an error, if there is any. +func (c *FakeExternalPluginInstanceConfigs) Create(ctx context.Context, externalPluginInstanceConfig *globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externalplugininstanceconfigsResource, externalPluginInstanceConfig), &globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig), err +} + +// Update takes the representation of a externalPluginInstanceConfig and updates it. Returns the server's representation of the externalPluginInstanceConfig, and an error, if there is any. +func (c *FakeExternalPluginInstanceConfigs) Update(ctx context.Context, externalPluginInstanceConfig *globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externalplugininstanceconfigsResource, externalPluginInstanceConfig), &globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig), err +} + +// Delete takes name of the externalPluginInstanceConfig and deletes it. Returns an error if one occurs. +func (c *FakeExternalPluginInstanceConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externalplugininstanceconfigsResource, name), &globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalPluginInstanceConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externalplugininstanceconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfigList{}) + return err +} + +// Patch applies the patch and returns the patched externalPluginInstanceConfig. +func (c *FakeExternalPluginInstanceConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externalplugininstanceconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalpluginmonitor.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalpluginmonitor.go new file mode 100644 index 000000000..20b5362ff --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalpluginmonitor.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalPluginMonitors implements ExternalPluginMonitorInterface +type FakeExternalPluginMonitors struct { + Fake *FakeGlobalTsmV1 +} + +var externalpluginmonitorsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externalpluginmonitors"} + +var externalpluginmonitorsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalPluginMonitor"} + +// Get takes name of the externalPluginMonitor, and returns the corresponding externalPluginMonitor object, and an error if there is any. +func (c *FakeExternalPluginMonitors) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginMonitor, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externalpluginmonitorsResource, name), &globaltsmtanzuvmwarecomv1.ExternalPluginMonitor{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginMonitor), err +} + +// List takes label and field selectors, and returns the list of ExternalPluginMonitors that match those selectors. +func (c *FakeExternalPluginMonitors) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginMonitorList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externalpluginmonitorsResource, externalpluginmonitorsKind, opts), &globaltsmtanzuvmwarecomv1.ExternalPluginMonitorList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalPluginMonitorList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginMonitorList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginMonitorList).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 externalPluginMonitors. +func (c *FakeExternalPluginMonitors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externalpluginmonitorsResource, opts)) +} + +// Create takes the representation of a externalPluginMonitor and creates it. Returns the server's representation of the externalPluginMonitor, and an error, if there is any. +func (c *FakeExternalPluginMonitors) Create(ctx context.Context, externalPluginMonitor *globaltsmtanzuvmwarecomv1.ExternalPluginMonitor, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginMonitor, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externalpluginmonitorsResource, externalPluginMonitor), &globaltsmtanzuvmwarecomv1.ExternalPluginMonitor{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginMonitor), err +} + +// Update takes the representation of a externalPluginMonitor and updates it. Returns the server's representation of the externalPluginMonitor, and an error, if there is any. +func (c *FakeExternalPluginMonitors) Update(ctx context.Context, externalPluginMonitor *globaltsmtanzuvmwarecomv1.ExternalPluginMonitor, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalPluginMonitor, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externalpluginmonitorsResource, externalPluginMonitor), &globaltsmtanzuvmwarecomv1.ExternalPluginMonitor{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginMonitor), err +} + +// Delete takes name of the externalPluginMonitor and deletes it. Returns an error if one occurs. +func (c *FakeExternalPluginMonitors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externalpluginmonitorsResource, name), &globaltsmtanzuvmwarecomv1.ExternalPluginMonitor{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalPluginMonitors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externalpluginmonitorsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalPluginMonitorList{}) + return err +} + +// Patch applies the patch and returns the patched externalPluginMonitor. +func (c *FakeExternalPluginMonitors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalPluginMonitor, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externalpluginmonitorsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalPluginMonitor{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalPluginMonitor), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalserviceconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalserviceconfig.go new file mode 100644 index 000000000..894f53c63 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalserviceconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalServiceConfigs implements ExternalServiceConfigInterface +type FakeExternalServiceConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var externalserviceconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externalserviceconfigs"} + +var externalserviceconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalServiceConfig"} + +// Get takes name of the externalServiceConfig, and returns the corresponding externalServiceConfig object, and an error if there is any. +func (c *FakeExternalServiceConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externalserviceconfigsResource, name), &globaltsmtanzuvmwarecomv1.ExternalServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalServiceConfig), err +} + +// List takes label and field selectors, and returns the list of ExternalServiceConfigs that match those selectors. +func (c *FakeExternalServiceConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalServiceConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externalserviceconfigsResource, externalserviceconfigsKind, opts), &globaltsmtanzuvmwarecomv1.ExternalServiceConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalServiceConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalServiceConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalServiceConfigList).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 externalServiceConfigs. +func (c *FakeExternalServiceConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externalserviceconfigsResource, opts)) +} + +// Create takes the representation of a externalServiceConfig and creates it. Returns the server's representation of the externalServiceConfig, and an error, if there is any. +func (c *FakeExternalServiceConfigs) Create(ctx context.Context, externalServiceConfig *globaltsmtanzuvmwarecomv1.ExternalServiceConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externalserviceconfigsResource, externalServiceConfig), &globaltsmtanzuvmwarecomv1.ExternalServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalServiceConfig), err +} + +// Update takes the representation of a externalServiceConfig and updates it. Returns the server's representation of the externalServiceConfig, and an error, if there is any. +func (c *FakeExternalServiceConfigs) Update(ctx context.Context, externalServiceConfig *globaltsmtanzuvmwarecomv1.ExternalServiceConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externalserviceconfigsResource, externalServiceConfig), &globaltsmtanzuvmwarecomv1.ExternalServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalServiceConfig), err +} + +// Delete takes name of the externalServiceConfig and deletes it. Returns an error if one occurs. +func (c *FakeExternalServiceConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externalserviceconfigsResource, name), &globaltsmtanzuvmwarecomv1.ExternalServiceConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalServiceConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externalserviceconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalServiceConfigList{}) + return err +} + +// Patch applies the patch and returns the patched externalServiceConfig. +func (c *FakeExternalServiceConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externalserviceconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalServiceConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalservicesrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalservicesrt.go new file mode 100644 index 000000000..495639cde --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_externalservicesrt.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeExternalServicesRTs implements ExternalServicesRTInterface +type FakeExternalServicesRTs struct { + Fake *FakeGlobalTsmV1 +} + +var externalservicesrtsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "externalservicesrts"} + +var externalservicesrtsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ExternalServicesRT"} + +// Get takes name of the externalServicesRT, and returns the corresponding externalServicesRT object, and an error if there is any. +func (c *FakeExternalServicesRTs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ExternalServicesRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(externalservicesrtsResource, name), &globaltsmtanzuvmwarecomv1.ExternalServicesRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalServicesRT), err +} + +// List takes label and field selectors, and returns the list of ExternalServicesRTs that match those selectors. +func (c *FakeExternalServicesRTs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ExternalServicesRTList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(externalservicesrtsResource, externalservicesrtsKind, opts), &globaltsmtanzuvmwarecomv1.ExternalServicesRTList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ExternalServicesRTList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ExternalServicesRTList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ExternalServicesRTList).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 externalServicesRTs. +func (c *FakeExternalServicesRTs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(externalservicesrtsResource, opts)) +} + +// Create takes the representation of a externalServicesRT and creates it. Returns the server's representation of the externalServicesRT, and an error, if there is any. +func (c *FakeExternalServicesRTs) Create(ctx context.Context, externalServicesRT *globaltsmtanzuvmwarecomv1.ExternalServicesRT, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalServicesRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(externalservicesrtsResource, externalServicesRT), &globaltsmtanzuvmwarecomv1.ExternalServicesRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalServicesRT), err +} + +// Update takes the representation of a externalServicesRT and updates it. Returns the server's representation of the externalServicesRT, and an error, if there is any. +func (c *FakeExternalServicesRTs) Update(ctx context.Context, externalServicesRT *globaltsmtanzuvmwarecomv1.ExternalServicesRT, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ExternalServicesRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(externalservicesrtsResource, externalServicesRT), &globaltsmtanzuvmwarecomv1.ExternalServicesRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalServicesRT), err +} + +// Delete takes name of the externalServicesRT and deletes it. Returns an error if one occurs. +func (c *FakeExternalServicesRTs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(externalservicesrtsResource, name), &globaltsmtanzuvmwarecomv1.ExternalServicesRT{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExternalServicesRTs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(externalservicesrtsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ExternalServicesRTList{}) + return err +} + +// Patch applies the patch and returns the patched externalServicesRT. +func (c *FakeExternalServicesRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ExternalServicesRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(externalservicesrtsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ExternalServicesRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ExternalServicesRT), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_featureflag.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_featureflag.go new file mode 100644 index 000000000..e9095280e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_featureflag.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeFeatureFlags implements FeatureFlagInterface +type FakeFeatureFlags struct { + Fake *FakeGlobalTsmV1 +} + +var featureflagsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "featureflags"} + +var featureflagsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "FeatureFlag"} + +// Get takes name of the featureFlag, and returns the corresponding featureFlag object, and an error if there is any. +func (c *FakeFeatureFlags) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.FeatureFlag, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(featureflagsResource, name), &globaltsmtanzuvmwarecomv1.FeatureFlag{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.FeatureFlag), err +} + +// List takes label and field selectors, and returns the list of FeatureFlags that match those selectors. +func (c *FakeFeatureFlags) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.FeatureFlagList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(featureflagsResource, featureflagsKind, opts), &globaltsmtanzuvmwarecomv1.FeatureFlagList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.FeatureFlagList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.FeatureFlagList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.FeatureFlagList).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 featureFlags. +func (c *FakeFeatureFlags) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(featureflagsResource, opts)) +} + +// Create takes the representation of a featureFlag and creates it. Returns the server's representation of the featureFlag, and an error, if there is any. +func (c *FakeFeatureFlags) Create(ctx context.Context, featureFlag *globaltsmtanzuvmwarecomv1.FeatureFlag, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.FeatureFlag, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(featureflagsResource, featureFlag), &globaltsmtanzuvmwarecomv1.FeatureFlag{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.FeatureFlag), err +} + +// Update takes the representation of a featureFlag and updates it. Returns the server's representation of the featureFlag, and an error, if there is any. +func (c *FakeFeatureFlags) Update(ctx context.Context, featureFlag *globaltsmtanzuvmwarecomv1.FeatureFlag, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.FeatureFlag, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(featureflagsResource, featureFlag), &globaltsmtanzuvmwarecomv1.FeatureFlag{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.FeatureFlag), err +} + +// Delete takes name of the featureFlag and deletes it. Returns an error if one occurs. +func (c *FakeFeatureFlags) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(featureflagsResource, name), &globaltsmtanzuvmwarecomv1.FeatureFlag{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeFeatureFlags) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(featureflagsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.FeatureFlagList{}) + return err +} + +// Patch applies the patch and returns the patched featureFlag. +func (c *FakeFeatureFlags) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.FeatureFlag, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(featureflagsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.FeatureFlag{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.FeatureFlag), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_federatedsloconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_federatedsloconfig.go new file mode 100644 index 000000000..a7c62cd89 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_federatedsloconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeFederatedSloConfigs implements FederatedSloConfigInterface +type FakeFederatedSloConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var federatedsloconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "federatedsloconfigs"} + +var federatedsloconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "FederatedSloConfig"} + +// Get takes name of the federatedSloConfig, and returns the corresponding federatedSloConfig object, and an error if there is any. +func (c *FakeFederatedSloConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.FederatedSloConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(federatedsloconfigsResource, name), &globaltsmtanzuvmwarecomv1.FederatedSloConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.FederatedSloConfig), err +} + +// List takes label and field selectors, and returns the list of FederatedSloConfigs that match those selectors. +func (c *FakeFederatedSloConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.FederatedSloConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(federatedsloconfigsResource, federatedsloconfigsKind, opts), &globaltsmtanzuvmwarecomv1.FederatedSloConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.FederatedSloConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.FederatedSloConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.FederatedSloConfigList).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 federatedSloConfigs. +func (c *FakeFederatedSloConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(federatedsloconfigsResource, opts)) +} + +// Create takes the representation of a federatedSloConfig and creates it. Returns the server's representation of the federatedSloConfig, and an error, if there is any. +func (c *FakeFederatedSloConfigs) Create(ctx context.Context, federatedSloConfig *globaltsmtanzuvmwarecomv1.FederatedSloConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.FederatedSloConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(federatedsloconfigsResource, federatedSloConfig), &globaltsmtanzuvmwarecomv1.FederatedSloConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.FederatedSloConfig), err +} + +// Update takes the representation of a federatedSloConfig and updates it. Returns the server's representation of the federatedSloConfig, and an error, if there is any. +func (c *FakeFederatedSloConfigs) Update(ctx context.Context, federatedSloConfig *globaltsmtanzuvmwarecomv1.FederatedSloConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.FederatedSloConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(federatedsloconfigsResource, federatedSloConfig), &globaltsmtanzuvmwarecomv1.FederatedSloConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.FederatedSloConfig), err +} + +// Delete takes name of the federatedSloConfig and deletes it. Returns an error if one occurs. +func (c *FakeFederatedSloConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(federatedsloconfigsResource, name), &globaltsmtanzuvmwarecomv1.FederatedSloConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeFederatedSloConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(federatedsloconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.FederatedSloConfigList{}) + return err +} + +// Patch applies the patch and returns the patched federatedSloConfig. +func (c *FakeFederatedSloConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.FederatedSloConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(federatedsloconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.FederatedSloConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.FederatedSloConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_federatedsloserviceconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_federatedsloserviceconfig.go new file mode 100644 index 000000000..c4bcd7fdd --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_federatedsloserviceconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeFederatedSloServiceConfigs implements FederatedSloServiceConfigInterface +type FakeFederatedSloServiceConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var federatedsloserviceconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "federatedsloserviceconfigs"} + +var federatedsloserviceconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "FederatedSloServiceConfig"} + +// Get takes name of the federatedSloServiceConfig, and returns the corresponding federatedSloServiceConfig object, and an error if there is any. +func (c *FakeFederatedSloServiceConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.FederatedSloServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(federatedsloserviceconfigsResource, name), &globaltsmtanzuvmwarecomv1.FederatedSloServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.FederatedSloServiceConfig), err +} + +// List takes label and field selectors, and returns the list of FederatedSloServiceConfigs that match those selectors. +func (c *FakeFederatedSloServiceConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.FederatedSloServiceConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(federatedsloserviceconfigsResource, federatedsloserviceconfigsKind, opts), &globaltsmtanzuvmwarecomv1.FederatedSloServiceConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.FederatedSloServiceConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.FederatedSloServiceConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.FederatedSloServiceConfigList).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 federatedSloServiceConfigs. +func (c *FakeFederatedSloServiceConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(federatedsloserviceconfigsResource, opts)) +} + +// Create takes the representation of a federatedSloServiceConfig and creates it. Returns the server's representation of the federatedSloServiceConfig, and an error, if there is any. +func (c *FakeFederatedSloServiceConfigs) Create(ctx context.Context, federatedSloServiceConfig *globaltsmtanzuvmwarecomv1.FederatedSloServiceConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.FederatedSloServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(federatedsloserviceconfigsResource, federatedSloServiceConfig), &globaltsmtanzuvmwarecomv1.FederatedSloServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.FederatedSloServiceConfig), err +} + +// Update takes the representation of a federatedSloServiceConfig and updates it. Returns the server's representation of the federatedSloServiceConfig, and an error, if there is any. +func (c *FakeFederatedSloServiceConfigs) Update(ctx context.Context, federatedSloServiceConfig *globaltsmtanzuvmwarecomv1.FederatedSloServiceConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.FederatedSloServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(federatedsloserviceconfigsResource, federatedSloServiceConfig), &globaltsmtanzuvmwarecomv1.FederatedSloServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.FederatedSloServiceConfig), err +} + +// Delete takes name of the federatedSloServiceConfig and deletes it. Returns an error if one occurs. +func (c *FakeFederatedSloServiceConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(federatedsloserviceconfigsResource, name), &globaltsmtanzuvmwarecomv1.FederatedSloServiceConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeFederatedSloServiceConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(federatedsloserviceconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.FederatedSloServiceConfigList{}) + return err +} + +// Patch applies the patch and returns the patched federatedSloServiceConfig. +func (c *FakeFederatedSloServiceConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.FederatedSloServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(federatedsloserviceconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.FederatedSloServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.FederatedSloServiceConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gateway.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gateway.go new file mode 100644 index 000000000..93bacfcd5 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gateway.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGateways implements GatewayInterface +type FakeGateways struct { + Fake *FakeGlobalTsmV1 +} + +var gatewaysResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gateways"} + +var gatewaysKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Gateway"} + +// Get takes name of the gateway, and returns the corresponding gateway object, and an error if there is any. +func (c *FakeGateways) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Gateway, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gatewaysResource, name), &globaltsmtanzuvmwarecomv1.Gateway{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Gateway), err +} + +// List takes label and field selectors, and returns the list of Gateways that match those selectors. +func (c *FakeGateways) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GatewayList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gatewaysResource, gatewaysKind, opts), &globaltsmtanzuvmwarecomv1.GatewayList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GatewayList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GatewayList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GatewayList).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 gateways. +func (c *FakeGateways) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gatewaysResource, opts)) +} + +// Create takes the representation of a gateway and creates it. Returns the server's representation of the gateway, and an error, if there is any. +func (c *FakeGateways) Create(ctx context.Context, gateway *globaltsmtanzuvmwarecomv1.Gateway, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Gateway, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gatewaysResource, gateway), &globaltsmtanzuvmwarecomv1.Gateway{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Gateway), err +} + +// Update takes the representation of a gateway and updates it. Returns the server's representation of the gateway, and an error, if there is any. +func (c *FakeGateways) Update(ctx context.Context, gateway *globaltsmtanzuvmwarecomv1.Gateway, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Gateway, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gatewaysResource, gateway), &globaltsmtanzuvmwarecomv1.Gateway{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Gateway), err +} + +// Delete takes name of the gateway and deletes it. Returns an error if one occurs. +func (c *FakeGateways) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gatewaysResource, name), &globaltsmtanzuvmwarecomv1.Gateway{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGateways) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gatewaysResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GatewayList{}) + return err +} + +// Patch applies the patch and returns the patched gateway. +func (c *FakeGateways) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Gateway, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gatewaysResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Gateway{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Gateway), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gatewayconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gatewayconfig.go new file mode 100644 index 000000000..981e4c66b --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gatewayconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGatewayConfigs implements GatewayConfigInterface +type FakeGatewayConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var gatewayconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gatewayconfigs"} + +var gatewayconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GatewayConfig"} + +// Get takes name of the gatewayConfig, and returns the corresponding gatewayConfig object, and an error if there is any. +func (c *FakeGatewayConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GatewayConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gatewayconfigsResource, name), &globaltsmtanzuvmwarecomv1.GatewayConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GatewayConfig), err +} + +// List takes label and field selectors, and returns the list of GatewayConfigs that match those selectors. +func (c *FakeGatewayConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GatewayConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gatewayconfigsResource, gatewayconfigsKind, opts), &globaltsmtanzuvmwarecomv1.GatewayConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GatewayConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigList).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 gatewayConfigs. +func (c *FakeGatewayConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gatewayconfigsResource, opts)) +} + +// Create takes the representation of a gatewayConfig and creates it. Returns the server's representation of the gatewayConfig, and an error, if there is any. +func (c *FakeGatewayConfigs) Create(ctx context.Context, gatewayConfig *globaltsmtanzuvmwarecomv1.GatewayConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GatewayConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gatewayconfigsResource, gatewayConfig), &globaltsmtanzuvmwarecomv1.GatewayConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GatewayConfig), err +} + +// Update takes the representation of a gatewayConfig and updates it. Returns the server's representation of the gatewayConfig, and an error, if there is any. +func (c *FakeGatewayConfigs) Update(ctx context.Context, gatewayConfig *globaltsmtanzuvmwarecomv1.GatewayConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GatewayConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gatewayconfigsResource, gatewayConfig), &globaltsmtanzuvmwarecomv1.GatewayConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GatewayConfig), err +} + +// Delete takes name of the gatewayConfig and deletes it. Returns an error if one occurs. +func (c *FakeGatewayConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gatewayconfigsResource, name), &globaltsmtanzuvmwarecomv1.GatewayConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGatewayConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gatewayconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GatewayConfigList{}) + return err +} + +// Patch applies the patch and returns the patched gatewayConfig. +func (c *FakeGatewayConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GatewayConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gatewayconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GatewayConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GatewayConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gatewayconfigadditionallisteners.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gatewayconfigadditionallisteners.go new file mode 100644 index 000000000..91d3a3af8 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gatewayconfigadditionallisteners.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGatewayConfigAdditionalListenerses implements GatewayConfigAdditionalListenersInterface +type FakeGatewayConfigAdditionalListenerses struct { + Fake *FakeGlobalTsmV1 +} + +var gatewayconfigadditionallistenersesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gatewayconfigadditionallistenerses"} + +var gatewayconfigadditionallistenersesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GatewayConfigAdditionalListeners"} + +// Get takes name of the gatewayConfigAdditionalListeners, and returns the corresponding gatewayConfigAdditionalListeners object, and an error if there is any. +func (c *FakeGatewayConfigAdditionalListenerses) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gatewayconfigadditionallistenersesResource, name), &globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners), err +} + +// List takes label and field selectors, and returns the list of GatewayConfigAdditionalListenerses that match those selectors. +func (c *FakeGatewayConfigAdditionalListenerses) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListenersList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gatewayconfigadditionallistenersesResource, gatewayconfigadditionallistenersesKind, opts), &globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListenersList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListenersList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListenersList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListenersList).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 gatewayConfigAdditionalListenerses. +func (c *FakeGatewayConfigAdditionalListenerses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gatewayconfigadditionallistenersesResource, opts)) +} + +// Create takes the representation of a gatewayConfigAdditionalListeners and creates it. Returns the server's representation of the gatewayConfigAdditionalListeners, and an error, if there is any. +func (c *FakeGatewayConfigAdditionalListenerses) Create(ctx context.Context, gatewayConfigAdditionalListeners *globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gatewayconfigadditionallistenersesResource, gatewayConfigAdditionalListeners), &globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners), err +} + +// Update takes the representation of a gatewayConfigAdditionalListeners and updates it. Returns the server's representation of the gatewayConfigAdditionalListeners, and an error, if there is any. +func (c *FakeGatewayConfigAdditionalListenerses) Update(ctx context.Context, gatewayConfigAdditionalListeners *globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gatewayconfigadditionallistenersesResource, gatewayConfigAdditionalListeners), &globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners), err +} + +// Delete takes name of the gatewayConfigAdditionalListeners and deletes it. Returns an error if one occurs. +func (c *FakeGatewayConfigAdditionalListenerses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gatewayconfigadditionallistenersesResource, name), &globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGatewayConfigAdditionalListenerses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gatewayconfigadditionallistenersesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListenersList{}) + return err +} + +// Patch applies the patch and returns the patched gatewayConfigAdditionalListeners. +func (c *FakeGatewayConfigAdditionalListenerses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gatewayconfigadditionallistenersesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gatewayconfiglistenercertificate.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gatewayconfiglistenercertificate.go new file mode 100644 index 000000000..0bd6561ea --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gatewayconfiglistenercertificate.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGatewayConfigListenerCertificates implements GatewayConfigListenerCertificateInterface +type FakeGatewayConfigListenerCertificates struct { + Fake *FakeGlobalTsmV1 +} + +var gatewayconfiglistenercertificatesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gatewayconfiglistenercertificates"} + +var gatewayconfiglistenercertificatesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GatewayConfigListenerCertificate"} + +// Get takes name of the gatewayConfigListenerCertificate, and returns the corresponding gatewayConfigListenerCertificate object, and an error if there is any. +func (c *FakeGatewayConfigListenerCertificates) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gatewayconfiglistenercertificatesResource, name), &globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate), err +} + +// List takes label and field selectors, and returns the list of GatewayConfigListenerCertificates that match those selectors. +func (c *FakeGatewayConfigListenerCertificates) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gatewayconfiglistenercertificatesResource, gatewayconfiglistenercertificatesKind, opts), &globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificateList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificateList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificateList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificateList).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 gatewayConfigListenerCertificates. +func (c *FakeGatewayConfigListenerCertificates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gatewayconfiglistenercertificatesResource, opts)) +} + +// Create takes the representation of a gatewayConfigListenerCertificate and creates it. Returns the server's representation of the gatewayConfigListenerCertificate, and an error, if there is any. +func (c *FakeGatewayConfigListenerCertificates) Create(ctx context.Context, gatewayConfigListenerCertificate *globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gatewayconfiglistenercertificatesResource, gatewayConfigListenerCertificate), &globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate), err +} + +// Update takes the representation of a gatewayConfigListenerCertificate and updates it. Returns the server's representation of the gatewayConfigListenerCertificate, and an error, if there is any. +func (c *FakeGatewayConfigListenerCertificates) Update(ctx context.Context, gatewayConfigListenerCertificate *globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gatewayconfiglistenercertificatesResource, gatewayConfigListenerCertificate), &globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate), err +} + +// Delete takes name of the gatewayConfigListenerCertificate and deletes it. Returns an error if one occurs. +func (c *FakeGatewayConfigListenerCertificates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gatewayconfiglistenercertificatesResource, name), &globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGatewayConfigListenerCertificates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gatewayconfiglistenercertificatesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificateList{}) + return err +} + +// Patch applies the patch and returns the patched gatewayConfigListenerCertificate. +func (c *FakeGatewayConfigListenerCertificates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gatewayconfiglistenercertificatesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gatewayconfiglistenerdestinationroute.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gatewayconfiglistenerdestinationroute.go new file mode 100644 index 000000000..03b37aa51 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gatewayconfiglistenerdestinationroute.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGatewayConfigListenerDestinationRoutes implements GatewayConfigListenerDestinationRouteInterface +type FakeGatewayConfigListenerDestinationRoutes struct { + Fake *FakeGlobalTsmV1 +} + +var gatewayconfiglistenerdestinationroutesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gatewayconfiglistenerdestinationroutes"} + +var gatewayconfiglistenerdestinationroutesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GatewayConfigListenerDestinationRoute"} + +// Get takes name of the gatewayConfigListenerDestinationRoute, and returns the corresponding gatewayConfigListenerDestinationRoute object, and an error if there is any. +func (c *FakeGatewayConfigListenerDestinationRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gatewayconfiglistenerdestinationroutesResource, name), &globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute), err +} + +// List takes label and field selectors, and returns the list of GatewayConfigListenerDestinationRoutes that match those selectors. +func (c *FakeGatewayConfigListenerDestinationRoutes) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRouteList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gatewayconfiglistenerdestinationroutesResource, gatewayconfiglistenerdestinationroutesKind, opts), &globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRouteList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRouteList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRouteList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRouteList).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 gatewayConfigListenerDestinationRoutes. +func (c *FakeGatewayConfigListenerDestinationRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gatewayconfiglistenerdestinationroutesResource, opts)) +} + +// Create takes the representation of a gatewayConfigListenerDestinationRoute and creates it. Returns the server's representation of the gatewayConfigListenerDestinationRoute, and an error, if there is any. +func (c *FakeGatewayConfigListenerDestinationRoutes) Create(ctx context.Context, gatewayConfigListenerDestinationRoute *globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gatewayconfiglistenerdestinationroutesResource, gatewayConfigListenerDestinationRoute), &globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute), err +} + +// Update takes the representation of a gatewayConfigListenerDestinationRoute and updates it. Returns the server's representation of the gatewayConfigListenerDestinationRoute, and an error, if there is any. +func (c *FakeGatewayConfigListenerDestinationRoutes) Update(ctx context.Context, gatewayConfigListenerDestinationRoute *globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gatewayconfiglistenerdestinationroutesResource, gatewayConfigListenerDestinationRoute), &globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute), err +} + +// Delete takes name of the gatewayConfigListenerDestinationRoute and deletes it. Returns an error if one occurs. +func (c *FakeGatewayConfigListenerDestinationRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gatewayconfiglistenerdestinationroutesResource, name), &globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGatewayConfigListenerDestinationRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gatewayconfiglistenerdestinationroutesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRouteList{}) + return err +} + +// Patch applies the patch and returns the patched gatewayConfigListenerDestinationRoute. +func (c *FakeGatewayConfigListenerDestinationRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gatewayconfiglistenerdestinationroutesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_geodiscovery.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_geodiscovery.go new file mode 100644 index 000000000..d51a13c4a --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_geodiscovery.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGeoDiscoveries implements GeoDiscoveryInterface +type FakeGeoDiscoveries struct { + Fake *FakeGlobalTsmV1 +} + +var geodiscoveriesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "geodiscoveries"} + +var geodiscoveriesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GeoDiscovery"} + +// Get takes name of the geoDiscovery, and returns the corresponding geoDiscovery object, and an error if there is any. +func (c *FakeGeoDiscoveries) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GeoDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(geodiscoveriesResource, name), &globaltsmtanzuvmwarecomv1.GeoDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GeoDiscovery), err +} + +// List takes label and field selectors, and returns the list of GeoDiscoveries that match those selectors. +func (c *FakeGeoDiscoveries) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GeoDiscoveryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(geodiscoveriesResource, geodiscoveriesKind, opts), &globaltsmtanzuvmwarecomv1.GeoDiscoveryList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GeoDiscoveryList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GeoDiscoveryList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GeoDiscoveryList).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 geoDiscoveries. +func (c *FakeGeoDiscoveries) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(geodiscoveriesResource, opts)) +} + +// Create takes the representation of a geoDiscovery and creates it. Returns the server's representation of the geoDiscovery, and an error, if there is any. +func (c *FakeGeoDiscoveries) Create(ctx context.Context, geoDiscovery *globaltsmtanzuvmwarecomv1.GeoDiscovery, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GeoDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(geodiscoveriesResource, geoDiscovery), &globaltsmtanzuvmwarecomv1.GeoDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GeoDiscovery), err +} + +// Update takes the representation of a geoDiscovery and updates it. Returns the server's representation of the geoDiscovery, and an error, if there is any. +func (c *FakeGeoDiscoveries) Update(ctx context.Context, geoDiscovery *globaltsmtanzuvmwarecomv1.GeoDiscovery, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GeoDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(geodiscoveriesResource, geoDiscovery), &globaltsmtanzuvmwarecomv1.GeoDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GeoDiscovery), err +} + +// Delete takes name of the geoDiscovery and deletes it. Returns an error if one occurs. +func (c *FakeGeoDiscoveries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(geodiscoveriesResource, name), &globaltsmtanzuvmwarecomv1.GeoDiscovery{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGeoDiscoveries) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(geodiscoveriesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GeoDiscoveryList{}) + return err +} + +// Patch applies the patch and returns the patched geoDiscovery. +func (c *FakeGeoDiscoveries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GeoDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(geodiscoveriesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GeoDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GeoDiscovery), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_geodiscoveryrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_geodiscoveryrt.go new file mode 100644 index 000000000..91e1596eb --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_geodiscoveryrt.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGeoDiscoveryRTs implements GeoDiscoveryRTInterface +type FakeGeoDiscoveryRTs struct { + Fake *FakeGlobalTsmV1 +} + +var geodiscoveryrtsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "geodiscoveryrts"} + +var geodiscoveryrtsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GeoDiscoveryRT"} + +// Get takes name of the geoDiscoveryRT, and returns the corresponding geoDiscoveryRT object, and an error if there is any. +func (c *FakeGeoDiscoveryRTs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GeoDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(geodiscoveryrtsResource, name), &globaltsmtanzuvmwarecomv1.GeoDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GeoDiscoveryRT), err +} + +// List takes label and field selectors, and returns the list of GeoDiscoveryRTs that match those selectors. +func (c *FakeGeoDiscoveryRTs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GeoDiscoveryRTList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(geodiscoveryrtsResource, geodiscoveryrtsKind, opts), &globaltsmtanzuvmwarecomv1.GeoDiscoveryRTList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GeoDiscoveryRTList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GeoDiscoveryRTList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GeoDiscoveryRTList).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 geoDiscoveryRTs. +func (c *FakeGeoDiscoveryRTs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(geodiscoveryrtsResource, opts)) +} + +// Create takes the representation of a geoDiscoveryRT and creates it. Returns the server's representation of the geoDiscoveryRT, and an error, if there is any. +func (c *FakeGeoDiscoveryRTs) Create(ctx context.Context, geoDiscoveryRT *globaltsmtanzuvmwarecomv1.GeoDiscoveryRT, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GeoDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(geodiscoveryrtsResource, geoDiscoveryRT), &globaltsmtanzuvmwarecomv1.GeoDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GeoDiscoveryRT), err +} + +// Update takes the representation of a geoDiscoveryRT and updates it. Returns the server's representation of the geoDiscoveryRT, and an error, if there is any. +func (c *FakeGeoDiscoveryRTs) Update(ctx context.Context, geoDiscoveryRT *globaltsmtanzuvmwarecomv1.GeoDiscoveryRT, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GeoDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(geodiscoveryrtsResource, geoDiscoveryRT), &globaltsmtanzuvmwarecomv1.GeoDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GeoDiscoveryRT), err +} + +// Delete takes name of the geoDiscoveryRT and deletes it. Returns an error if one occurs. +func (c *FakeGeoDiscoveryRTs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(geodiscoveryrtsResource, name), &globaltsmtanzuvmwarecomv1.GeoDiscoveryRT{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGeoDiscoveryRTs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(geodiscoveryrtsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GeoDiscoveryRTList{}) + return err +} + +// Patch applies the patch and returns the patched geoDiscoveryRT. +func (c *FakeGeoDiscoveryRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GeoDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(geodiscoveryrtsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GeoDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GeoDiscoveryRT), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_global.tsm.tanzu.vmware.com_client.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_global.tsm.tanzu.vmware.com_client.go new file mode 100644 index 000000000..a8d6bbd1a --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_global.tsm.tanzu.vmware.com_client.go @@ -0,0 +1,869 @@ +/* +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 ( + v1 "nexustempmodule/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1" + + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeGlobalTsmV1 struct { + *testing.Fake +} + +func (c *FakeGlobalTsmV1) ACPConfigs() v1.ACPConfigInterface { + return &FakeACPConfigs{c} +} + +func (c *FakeGlobalTsmV1) AccessControlPolicies() v1.AccessControlPolicyInterface { + return &FakeAccessControlPolicies{c} +} + +func (c *FakeGlobalTsmV1) AccessTokens() v1.AccessTokenInterface { + return &FakeAccessTokens{c} +} + +func (c *FakeGlobalTsmV1) AdditionalAttributeses() v1.AdditionalAttributesInterface { + return &FakeAdditionalAttributeses{c} +} + +func (c *FakeGlobalTsmV1) AllSparkServiceses() v1.AllSparkServicesInterface { + return &FakeAllSparkServiceses{c} +} + +func (c *FakeGlobalTsmV1) Annotations() v1.AnnotationInterface { + return &FakeAnnotations{c} +} + +func (c *FakeGlobalTsmV1) ApiDiscoveries() v1.ApiDiscoveryInterface { + return &FakeApiDiscoveries{c} +} + +func (c *FakeGlobalTsmV1) ApiDiscoveryRTs() v1.ApiDiscoveryRTInterface { + return &FakeApiDiscoveryRTs{c} +} + +func (c *FakeGlobalTsmV1) Apps() v1.AppInterface { + return &FakeApps{c} +} + +func (c *FakeGlobalTsmV1) AppFolders() v1.AppFolderInterface { + return &FakeAppFolders{c} +} + +func (c *FakeGlobalTsmV1) AppGroups() v1.AppGroupInterface { + return &FakeAppGroups{c} +} + +func (c *FakeGlobalTsmV1) AppTemplates() v1.AppTemplateInterface { + return &FakeAppTemplates{c} +} + +func (c *FakeGlobalTsmV1) AppTemplateServiceDefinitions() v1.AppTemplateServiceDefinitionInterface { + return &FakeAppTemplateServiceDefinitions{c} +} + +func (c *FakeGlobalTsmV1) AppUsers() v1.AppUserInterface { + return &FakeAppUsers{c} +} + +func (c *FakeGlobalTsmV1) AppVersions() v1.AppVersionInterface { + return &FakeAppVersions{c} +} + +func (c *FakeGlobalTsmV1) ApplicationInfos() v1.ApplicationInfoInterface { + return &FakeApplicationInfos{c} +} + +func (c *FakeGlobalTsmV1) AttackDiscoveries() v1.AttackDiscoveryInterface { + return &FakeAttackDiscoveries{c} +} + +func (c *FakeGlobalTsmV1) AttackDiscoveryRTs() v1.AttackDiscoveryRTInterface { + return &FakeAttackDiscoveryRTs{c} +} + +func (c *FakeGlobalTsmV1) AuthenticationPolicies() v1.AuthenticationPolicyInterface { + return &FakeAuthenticationPolicies{c} +} + +func (c *FakeGlobalTsmV1) Autoscalers() v1.AutoscalerInterface { + return &FakeAutoscalers{c} +} + +func (c *FakeGlobalTsmV1) AutoscalerCRs() v1.AutoscalerCRInterface { + return &FakeAutoscalerCRs{c} +} + +func (c *FakeGlobalTsmV1) AutoscalerConfigs() v1.AutoscalerConfigInterface { + return &FakeAutoscalerConfigs{c} +} + +func (c *FakeGlobalTsmV1) AutoscalerFolders() v1.AutoscalerFolderInterface { + return &FakeAutoscalerFolders{c} +} + +func (c *FakeGlobalTsmV1) AutoscalingPolicies() v1.AutoscalingPolicyInterface { + return &FakeAutoscalingPolicies{c} +} + +func (c *FakeGlobalTsmV1) AwsConnectors() v1.AwsConnectorInterface { + return &FakeAwsConnectors{c} +} + +func (c *FakeGlobalTsmV1) Buckets() v1.BucketInterface { + return &FakeBuckets{c} +} + +func (c *FakeGlobalTsmV1) Certificates() v1.CertificateInterface { + return &FakeCertificates{c} +} + +func (c *FakeGlobalTsmV1) CertificateAuthorityConfigNs() v1.CertificateAuthorityConfigNInterface { + return &FakeCertificateAuthorityConfigNs{c} +} + +func (c *FakeGlobalTsmV1) CertificateAuthorityRTs() v1.CertificateAuthorityRTInterface { + return &FakeCertificateAuthorityRTs{c} +} + +func (c *FakeGlobalTsmV1) CertificateConfigNs() v1.CertificateConfigNInterface { + return &FakeCertificateConfigNs{c} +} + +func (c *FakeGlobalTsmV1) CertificateRequests() v1.CertificateRequestInterface { + return &FakeCertificateRequests{c} +} + +func (c *FakeGlobalTsmV1) Clusters() v1.ClusterInterface { + return &FakeClusters{c} +} + +func (c *FakeGlobalTsmV1) ClusterConfigs() v1.ClusterConfigInterface { + return &FakeClusterConfigs{c} +} + +func (c *FakeGlobalTsmV1) ClusterConfigFolders() v1.ClusterConfigFolderInterface { + return &FakeClusterConfigFolders{c} +} + +func (c *FakeGlobalTsmV1) ClusterFolders() v1.ClusterFolderInterface { + return &FakeClusterFolders{c} +} + +func (c *FakeGlobalTsmV1) ClusterSettingses() v1.ClusterSettingsInterface { + return &FakeClusterSettingses{c} +} + +func (c *FakeGlobalTsmV1) Configs() v1.ConfigInterface { + return &FakeConfigs{c} +} + +func (c *FakeGlobalTsmV1) ConfigMaps() v1.ConfigMapInterface { + return &FakeConfigMaps{c} +} + +func (c *FakeGlobalTsmV1) ConnectionStatuses() v1.ConnectionStatusInterface { + return &FakeConnectionStatuses{c} +} + +func (c *FakeGlobalTsmV1) DCRegions() v1.DCRegionInterface { + return &FakeDCRegions{c} +} + +func (c *FakeGlobalTsmV1) DCZones() v1.DCZoneInterface { + return &FakeDCZones{c} +} + +func (c *FakeGlobalTsmV1) DNSConfigs() v1.DNSConfigInterface { + return &FakeDNSConfigs{c} +} + +func (c *FakeGlobalTsmV1) DNSConfigFolders() v1.DNSConfigFolderInterface { + return &FakeDNSConfigFolders{c} +} + +func (c *FakeGlobalTsmV1) DNSProbeConfigs() v1.DNSProbeConfigInterface { + return &FakeDNSProbeConfigs{c} +} + +func (c *FakeGlobalTsmV1) DNSProbeStatuses() v1.DNSProbeStatusInterface { + return &FakeDNSProbeStatuses{c} +} + +func (c *FakeGlobalTsmV1) DNSProbesConfigFolders() v1.DNSProbesConfigFolderInterface { + return &FakeDNSProbesConfigFolders{c} +} + +func (c *FakeGlobalTsmV1) DataFolders() v1.DataFolderInterface { + return &FakeDataFolders{c} +} + +func (c *FakeGlobalTsmV1) DataFolderDomains() v1.DataFolderDomainInterface { + return &FakeDataFolderDomains{c} +} + +func (c *FakeGlobalTsmV1) DataFolderDomainClusters() v1.DataFolderDomainClusterInterface { + return &FakeDataFolderDomainClusters{c} +} + +func (c *FakeGlobalTsmV1) DataFolderDomainServices() v1.DataFolderDomainServiceInterface { + return &FakeDataFolderDomainServices{c} +} + +func (c *FakeGlobalTsmV1) DataFolderDomainServiceVersions() v1.DataFolderDomainServiceVersionInterface { + return &FakeDataFolderDomainServiceVersions{c} +} + +func (c *FakeGlobalTsmV1) DataGroups() v1.DataGroupInterface { + return &FakeDataGroups{c} +} + +func (c *FakeGlobalTsmV1) DataTemplates() v1.DataTemplateInterface { + return &FakeDataTemplates{c} +} + +func (c *FakeGlobalTsmV1) Databases() v1.DatabaseInterface { + return &FakeDatabases{c} +} + +func (c *FakeGlobalTsmV1) DestinationRules() v1.DestinationRuleInterface { + return &FakeDestinationRules{c} +} + +func (c *FakeGlobalTsmV1) Directories() v1.DirectoryInterface { + return &FakeDirectories{c} +} + +func (c *FakeGlobalTsmV1) Domains() v1.DomainInterface { + return &FakeDomains{c} +} + +func (c *FakeGlobalTsmV1) DomainConfigs() v1.DomainConfigInterface { + return &FakeDomainConfigs{c} +} + +func (c *FakeGlobalTsmV1) Endpoints() v1.EndpointsInterface { + return &FakeEndpoints{c} +} + +func (c *FakeGlobalTsmV1) EnvoyFilters() v1.EnvoyFilterInterface { + return &FakeEnvoyFilters{c} +} + +func (c *FakeGlobalTsmV1) ExternalAccountConfigNs() v1.ExternalAccountConfigNInterface { + return &FakeExternalAccountConfigNs{c} +} + +func (c *FakeGlobalTsmV1) ExternalAuditStorages() v1.ExternalAuditStorageInterface { + return &FakeExternalAuditStorages{c} +} + +func (c *FakeGlobalTsmV1) ExternalDNSConfigNs() v1.ExternalDNSConfigNInterface { + return &FakeExternalDNSConfigNs{c} +} + +func (c *FakeGlobalTsmV1) ExternalDNSInventories() v1.ExternalDNSInventoryInterface { + return &FakeExternalDNSInventories{c} +} + +func (c *FakeGlobalTsmV1) ExternalDNSInventoryHealthChecks() v1.ExternalDNSInventoryHealthCheckInterface { + return &FakeExternalDNSInventoryHealthChecks{c} +} + +func (c *FakeGlobalTsmV1) ExternalDNSInventoryPrimaryDomains() v1.ExternalDNSInventoryPrimaryDomainInterface { + return &FakeExternalDNSInventoryPrimaryDomains{c} +} + +func (c *FakeGlobalTsmV1) ExternalDNSInventoryRecords() v1.ExternalDNSInventoryRecordInterface { + return &FakeExternalDNSInventoryRecords{c} +} + +func (c *FakeGlobalTsmV1) ExternalDNSInventoryZones() v1.ExternalDNSInventoryZoneInterface { + return &FakeExternalDNSInventoryZones{c} +} + +func (c *FakeGlobalTsmV1) ExternalDNSRuntimes() v1.ExternalDNSRuntimeInterface { + return &FakeExternalDNSRuntimes{c} +} + +func (c *FakeGlobalTsmV1) ExternalDNSRuntimeEndpoints() v1.ExternalDNSRuntimeEndpointInterface { + return &FakeExternalDNSRuntimeEndpoints{c} +} + +func (c *FakeGlobalTsmV1) ExternalDNSRuntimePrimaryDomains() v1.ExternalDNSRuntimePrimaryDomainInterface { + return &FakeExternalDNSRuntimePrimaryDomains{c} +} + +func (c *FakeGlobalTsmV1) ExternalDNSRuntimeSubdomains() v1.ExternalDNSRuntimeSubdomainInterface { + return &FakeExternalDNSRuntimeSubdomains{c} +} + +func (c *FakeGlobalTsmV1) ExternalLBConfigNs() v1.ExternalLBConfigNInterface { + return &FakeExternalLBConfigNs{c} +} + +func (c *FakeGlobalTsmV1) ExternalPluginCapabilities() v1.ExternalPluginCapabilityInterface { + return &FakeExternalPluginCapabilities{c} +} + +func (c *FakeGlobalTsmV1) ExternalPluginConfigs() v1.ExternalPluginConfigInterface { + return &FakeExternalPluginConfigs{c} +} + +func (c *FakeGlobalTsmV1) ExternalPluginConfigFolders() v1.ExternalPluginConfigFolderInterface { + return &FakeExternalPluginConfigFolders{c} +} + +func (c *FakeGlobalTsmV1) ExternalPluginInstanceConfigs() v1.ExternalPluginInstanceConfigInterface { + return &FakeExternalPluginInstanceConfigs{c} +} + +func (c *FakeGlobalTsmV1) ExternalPluginMonitors() v1.ExternalPluginMonitorInterface { + return &FakeExternalPluginMonitors{c} +} + +func (c *FakeGlobalTsmV1) ExternalServiceConfigs() v1.ExternalServiceConfigInterface { + return &FakeExternalServiceConfigs{c} +} + +func (c *FakeGlobalTsmV1) ExternalServicesRTs() v1.ExternalServicesRTInterface { + return &FakeExternalServicesRTs{c} +} + +func (c *FakeGlobalTsmV1) FeatureFlags() v1.FeatureFlagInterface { + return &FakeFeatureFlags{c} +} + +func (c *FakeGlobalTsmV1) FederatedSloConfigs() v1.FederatedSloConfigInterface { + return &FakeFederatedSloConfigs{c} +} + +func (c *FakeGlobalTsmV1) FederatedSloServiceConfigs() v1.FederatedSloServiceConfigInterface { + return &FakeFederatedSloServiceConfigs{c} +} + +func (c *FakeGlobalTsmV1) GNSs() v1.GNSInterface { + return &FakeGNSs{c} +} + +func (c *FakeGlobalTsmV1) GNSRoutingConfigs() v1.GNSRoutingConfigInterface { + return &FakeGNSRoutingConfigs{c} +} + +func (c *FakeGlobalTsmV1) GNSSvcGroups() v1.GNSSvcGroupInterface { + return &FakeGNSSvcGroups{c} +} + +func (c *FakeGlobalTsmV1) Gateways() v1.GatewayInterface { + return &FakeGateways{c} +} + +func (c *FakeGlobalTsmV1) GatewayConfigs() v1.GatewayConfigInterface { + return &FakeGatewayConfigs{c} +} + +func (c *FakeGlobalTsmV1) GatewayConfigAdditionalListenerses() v1.GatewayConfigAdditionalListenersInterface { + return &FakeGatewayConfigAdditionalListenerses{c} +} + +func (c *FakeGlobalTsmV1) GatewayConfigListenerCertificates() v1.GatewayConfigListenerCertificateInterface { + return &FakeGatewayConfigListenerCertificates{c} +} + +func (c *FakeGlobalTsmV1) GatewayConfigListenerDestinationRoutes() v1.GatewayConfigListenerDestinationRouteInterface { + return &FakeGatewayConfigListenerDestinationRoutes{c} +} + +func (c *FakeGlobalTsmV1) GeoDiscoveries() v1.GeoDiscoveryInterface { + return &FakeGeoDiscoveries{c} +} + +func (c *FakeGlobalTsmV1) GeoDiscoveryRTs() v1.GeoDiscoveryRTInterface { + return &FakeGeoDiscoveryRTs{c} +} + +func (c *FakeGlobalTsmV1) GlobalNamespaces() v1.GlobalNamespaceInterface { + return &FakeGlobalNamespaces{c} +} + +func (c *FakeGlobalTsmV1) GlobalNses() v1.GlobalNsInterface { + return &FakeGlobalNses{c} +} + +func (c *FakeGlobalTsmV1) GlobalRegistrationServices() v1.GlobalRegistrationServiceInterface { + return &FakeGlobalRegistrationServices{c} +} + +func (c *FakeGlobalTsmV1) GnsAccessControlPolicies() v1.GnsAccessControlPolicyInterface { + return &FakeGnsAccessControlPolicies{c} +} + +func (c *FakeGlobalTsmV1) GnsAccessControlPolicyRTs() v1.GnsAccessControlPolicyRTInterface { + return &FakeGnsAccessControlPolicyRTs{c} +} + +func (c *FakeGlobalTsmV1) GnsBindingRTs() v1.GnsBindingRTInterface { + return &FakeGnsBindingRTs{c} +} + +func (c *FakeGlobalTsmV1) GnsEndpointsConfigs() v1.GnsEndpointsConfigInterface { + return &FakeGnsEndpointsConfigs{c} +} + +func (c *FakeGlobalTsmV1) GnsRoutingRuleConfigs() v1.GnsRoutingRuleConfigInterface { + return &FakeGnsRoutingRuleConfigs{c} +} + +func (c *FakeGlobalTsmV1) GnsSchemaViolationDiscoveries() v1.GnsSchemaViolationDiscoveryInterface { + return &FakeGnsSchemaViolationDiscoveries{c} +} + +func (c *FakeGlobalTsmV1) GnsSegmentationPolicies() v1.GnsSegmentationPolicyInterface { + return &FakeGnsSegmentationPolicies{c} +} + +func (c *FakeGlobalTsmV1) GnsSegmentationPolicyRTs() v1.GnsSegmentationPolicyRTInterface { + return &FakeGnsSegmentationPolicyRTs{c} +} + +func (c *FakeGlobalTsmV1) GnsServiceEntryConfigs() v1.GnsServiceEntryConfigInterface { + return &FakeGnsServiceEntryConfigs{c} +} + +func (c *FakeGlobalTsmV1) GnsSvcGroupRTs() v1.GnsSvcGroupRTInterface { + return &FakeGnsSvcGroupRTs{c} +} + +func (c *FakeGlobalTsmV1) HaConfigs() v1.HaConfigInterface { + return &FakeHaConfigs{c} +} + +func (c *FakeGlobalTsmV1) HaConfigV2s() v1.HaConfigV2Interface { + return &FakeHaConfigV2s{c} +} + +func (c *FakeGlobalTsmV1) HealthCheckConfigNs() v1.HealthCheckConfigNInterface { + return &FakeHealthCheckConfigNs{c} +} + +func (c *FakeGlobalTsmV1) HostConfigs() v1.HostConfigInterface { + return &FakeHostConfigs{c} +} + +func (c *FakeGlobalTsmV1) HostConfigV2s() v1.HostConfigV2Interface { + return &FakeHostConfigV2s{c} +} + +func (c *FakeGlobalTsmV1) InboundAuthenticationConfigs() v1.InboundAuthenticationConfigInterface { + return &FakeInboundAuthenticationConfigs{c} +} + +func (c *FakeGlobalTsmV1) Inventories() v1.InventoryInterface { + return &FakeInventories{c} +} + +func (c *FakeGlobalTsmV1) Issuers() v1.IssuerInterface { + return &FakeIssuers{c} +} + +func (c *FakeGlobalTsmV1) Jobs() v1.JobInterface { + return &FakeJobs{c} +} + +func (c *FakeGlobalTsmV1) JobConfigs() v1.JobConfigInterface { + return &FakeJobConfigs{c} +} + +func (c *FakeGlobalTsmV1) JobConfigFolders() v1.JobConfigFolderInterface { + return &FakeJobConfigFolders{c} +} + +func (c *FakeGlobalTsmV1) JobFolders() v1.JobFolderInterface { + return &FakeJobFolders{c} +} + +func (c *FakeGlobalTsmV1) KnativeIngresses() v1.KnativeIngressInterface { + return &FakeKnativeIngresses{c} +} + +func (c *FakeGlobalTsmV1) LabelConfigs() v1.LabelConfigInterface { + return &FakeLabelConfigs{c} +} + +func (c *FakeGlobalTsmV1) LocalRegistrationServices() v1.LocalRegistrationServiceInterface { + return &FakeLocalRegistrationServices{c} +} + +func (c *FakeGlobalTsmV1) LocalRegistrationServiceClusters() v1.LocalRegistrationServiceClusterInterface { + return &FakeLocalRegistrationServiceClusters{c} +} + +func (c *FakeGlobalTsmV1) LocalRegistrationServiceResources() v1.LocalRegistrationServiceResourceInterface { + return &FakeLocalRegistrationServiceResources{c} +} + +func (c *FakeGlobalTsmV1) Logs() v1.LogInterface { + return &FakeLogs{c} +} + +func (c *FakeGlobalTsmV1) LogFolders() v1.LogFolderInterface { + return &FakeLogFolders{c} +} + +func (c *FakeGlobalTsmV1) MetricMonitors() v1.MetricMonitorInterface { + return &FakeMetricMonitors{c} +} + +func (c *FakeGlobalTsmV1) NetworkAttachmentDefinitions() v1.NetworkAttachmentDefinitionInterface { + return &FakeNetworkAttachmentDefinitions{c} +} + +func (c *FakeGlobalTsmV1) NetworkAttachmentDefinitionConfigs() v1.NetworkAttachmentDefinitionConfigInterface { + return &FakeNetworkAttachmentDefinitionConfigs{c} +} + +func (c *FakeGlobalTsmV1) Nodes() v1.NodeInterface { + return &FakeNodes{c} +} + +func (c *FakeGlobalTsmV1) NodeDefinitions() v1.NodeDefinitionInterface { + return &FakeNodeDefinitions{c} +} + +func (c *FakeGlobalTsmV1) NodeFolders() v1.NodeFolderInterface { + return &FakeNodeFolders{c} +} + +func (c *FakeGlobalTsmV1) NodeFolderClusters() v1.NodeFolderClusterInterface { + return &FakeNodeFolderClusters{c} +} + +func (c *FakeGlobalTsmV1) NodeGroups() v1.NodeGroupInterface { + return &FakeNodeGroups{c} +} + +func (c *FakeGlobalTsmV1) NodeStatuses() v1.NodeStatusInterface { + return &FakeNodeStatuses{c} +} + +func (c *FakeGlobalTsmV1) NodeTemplates() v1.NodeTemplateInterface { + return &FakeNodeTemplates{c} +} + +func (c *FakeGlobalTsmV1) OutboundAuthenticationModes() v1.OutboundAuthenticationModeInterface { + return &FakeOutboundAuthenticationModes{c} +} + +func (c *FakeGlobalTsmV1) PeerAuthentications() v1.PeerAuthenticationInterface { + return &FakePeerAuthentications{c} +} + +func (c *FakeGlobalTsmV1) PiiDiscoveries() v1.PiiDiscoveryInterface { + return &FakePiiDiscoveries{c} +} + +func (c *FakeGlobalTsmV1) PiiDiscoveryRTs() v1.PiiDiscoveryRTInterface { + return &FakePiiDiscoveryRTs{c} +} + +func (c *FakeGlobalTsmV1) PolicyConfigs() v1.PolicyConfigInterface { + return &FakePolicyConfigs{c} +} + +func (c *FakeGlobalTsmV1) PolicyTemplates() v1.PolicyTemplateInterface { + return &FakePolicyTemplates{c} +} + +func (c *FakeGlobalTsmV1) ProgressiveUpgrades() v1.ProgressiveUpgradeInterface { + return &FakeProgressiveUpgrades{c} +} + +func (c *FakeGlobalTsmV1) ProgressiveUpgradeConfigs() v1.ProgressiveUpgradeConfigInterface { + return &FakeProgressiveUpgradeConfigs{c} +} + +func (c *FakeGlobalTsmV1) ProgressiveUpgradeFolders() v1.ProgressiveUpgradeFolderInterface { + return &FakeProgressiveUpgradeFolders{c} +} + +func (c *FakeGlobalTsmV1) ProgressiveUpgradeRuntimes() v1.ProgressiveUpgradeRuntimeInterface { + return &FakeProgressiveUpgradeRuntimes{c} +} + +func (c *FakeGlobalTsmV1) Projects() v1.ProjectInterface { + return &FakeProjects{c} +} + +func (c *FakeGlobalTsmV1) ProjectConfigs() v1.ProjectConfigInterface { + return &FakeProjectConfigs{c} +} + +func (c *FakeGlobalTsmV1) ProjectInventories() v1.ProjectInventoryInterface { + return &FakeProjectInventories{c} +} + +func (c *FakeGlobalTsmV1) ProjectQueries() v1.ProjectQueryInterface { + return &FakeProjectQueries{c} +} + +func (c *FakeGlobalTsmV1) PublicServiceConfigs() v1.PublicServiceConfigInterface { + return &FakePublicServiceConfigs{c} +} + +func (c *FakeGlobalTsmV1) PublicServiceRTs() v1.PublicServiceRTInterface { + return &FakePublicServiceRTs{c} +} + +func (c *FakeGlobalTsmV1) PublicServiceRouteConfigs() v1.PublicServiceRouteConfigInterface { + return &FakePublicServiceRouteConfigs{c} +} + +func (c *FakeGlobalTsmV1) RPolicies() v1.RPolicyInterface { + return &FakeRPolicies{c} +} + +func (c *FakeGlobalTsmV1) RemoteGatewayServiceConfigs() v1.RemoteGatewayServiceConfigInterface { + return &FakeRemoteGatewayServiceConfigs{c} +} + +func (c *FakeGlobalTsmV1) ResourceGroups() v1.ResourceGroupInterface { + return &FakeResourceGroups{c} +} + +func (c *FakeGlobalTsmV1) ResourceGroupRTs() v1.ResourceGroupRTInterface { + return &FakeResourceGroupRTs{c} +} + +func (c *FakeGlobalTsmV1) Roots() v1.RootInterface { + return &FakeRoots{c} +} + +func (c *FakeGlobalTsmV1) Runtimes() v1.RuntimeInterface { + return &FakeRuntimes{c} +} + +func (c *FakeGlobalTsmV1) SLOFolders() v1.SLOFolderInterface { + return &FakeSLOFolders{c} +} + +func (c *FakeGlobalTsmV1) SLOPolicies() v1.SLOPolicyInterface { + return &FakeSLOPolicies{c} +} + +func (c *FakeGlobalTsmV1) SchemaViolationDiscoveryRTs() v1.SchemaViolationDiscoveryRTInterface { + return &FakeSchemaViolationDiscoveryRTs{c} +} + +func (c *FakeGlobalTsmV1) SecretHashes() v1.SecretHashInterface { + return &FakeSecretHashes{c} +} + +func (c *FakeGlobalTsmV1) SecretRTConfigs() v1.SecretRTConfigInterface { + return &FakeSecretRTConfigs{c} +} + +func (c *FakeGlobalTsmV1) SecurityContextConstraintses() v1.SecurityContextConstraintsInterface { + return &FakeSecurityContextConstraintses{c} +} + +func (c *FakeGlobalTsmV1) SecurityContextConstraintsConfigs() v1.SecurityContextConstraintsConfigInterface { + return &FakeSecurityContextConstraintsConfigs{c} +} + +func (c *FakeGlobalTsmV1) Services() v1.ServiceInterface { + return &FakeServices{c} +} + +func (c *FakeGlobalTsmV1) ServiceConfigs() v1.ServiceConfigInterface { + return &FakeServiceConfigs{c} +} + +func (c *FakeGlobalTsmV1) ServiceCronJobs() v1.ServiceCronJobInterface { + return &FakeServiceCronJobs{c} +} + +func (c *FakeGlobalTsmV1) ServiceDaemonSets() v1.ServiceDaemonSetInterface { + return &FakeServiceDaemonSets{c} +} + +func (c *FakeGlobalTsmV1) ServiceDeployments() v1.ServiceDeploymentInterface { + return &FakeServiceDeployments{c} +} + +func (c *FakeGlobalTsmV1) ServiceDeploymentContainers() v1.ServiceDeploymentContainerInterface { + return &FakeServiceDeploymentContainers{c} +} + +func (c *FakeGlobalTsmV1) ServiceDirectoryEntryConfigs() v1.ServiceDirectoryEntryConfigInterface { + return &FakeServiceDirectoryEntryConfigs{c} +} + +func (c *FakeGlobalTsmV1) ServiceDirectoryNs() v1.ServiceDirectoryNInterface { + return &FakeServiceDirectoryNs{c} +} + +func (c *FakeGlobalTsmV1) ServiceDirectoryRTs() v1.ServiceDirectoryRTInterface { + return &FakeServiceDirectoryRTs{c} +} + +func (c *FakeGlobalTsmV1) ServiceDirectoryRTFolders() v1.ServiceDirectoryRTFolderInterface { + return &FakeServiceDirectoryRTFolders{c} +} + +func (c *FakeGlobalTsmV1) ServiceDirectoryRTFolderEntries() v1.ServiceDirectoryRTFolderEntryInterface { + return &FakeServiceDirectoryRTFolderEntries{c} +} + +func (c *FakeGlobalTsmV1) ServiceEntries() v1.ServiceEntryInterface { + return &FakeServiceEntries{c} +} + +func (c *FakeGlobalTsmV1) ServiceEntryConfigs() v1.ServiceEntryConfigInterface { + return &FakeServiceEntryConfigs{c} +} + +func (c *FakeGlobalTsmV1) ServiceInstances() v1.ServiceInstanceInterface { + return &FakeServiceInstances{c} +} + +func (c *FakeGlobalTsmV1) ServiceInstanceContainers() v1.ServiceInstanceContainerInterface { + return &FakeServiceInstanceContainers{c} +} + +func (c *FakeGlobalTsmV1) ServiceJobs() v1.ServiceJobInterface { + return &FakeServiceJobs{c} +} + +func (c *FakeGlobalTsmV1) ServiceLevelObjectives() v1.ServiceLevelObjectiveInterface { + return &FakeServiceLevelObjectives{c} +} + +func (c *FakeGlobalTsmV1) ServiceLevelObjectiveFolders() v1.ServiceLevelObjectiveFolderInterface { + return &FakeServiceLevelObjectiveFolders{c} +} + +func (c *FakeGlobalTsmV1) ServiceReplicaSets() v1.ServiceReplicaSetInterface { + return &FakeServiceReplicaSets{c} +} + +func (c *FakeGlobalTsmV1) ServiceStatefulSets() v1.ServiceStatefulSetInterface { + return &FakeServiceStatefulSets{c} +} + +func (c *FakeGlobalTsmV1) ServiceTemplates() v1.ServiceTemplateInterface { + return &FakeServiceTemplates{c} +} + +func (c *FakeGlobalTsmV1) ServiceTemplateServiceDefinitions() v1.ServiceTemplateServiceDefinitionInterface { + return &FakeServiceTemplateServiceDefinitions{c} +} + +func (c *FakeGlobalTsmV1) ServiceVersions() v1.ServiceVersionInterface { + return &FakeServiceVersions{c} +} + +func (c *FakeGlobalTsmV1) ServiceVersionConfigs() v1.ServiceVersionConfigInterface { + return &FakeServiceVersionConfigs{c} +} + +func (c *FakeGlobalTsmV1) SharedServiceConfigs() v1.SharedServiceConfigInterface { + return &FakeSharedServiceConfigs{c} +} + +func (c *FakeGlobalTsmV1) SloConfigs() v1.SloConfigInterface { + return &FakeSloConfigs{c} +} + +func (c *FakeGlobalTsmV1) SloServiceConfigs() v1.SloServiceConfigInterface { + return &FakeSloServiceConfigs{c} +} + +func (c *FakeGlobalTsmV1) SvcGroups() v1.SvcGroupInterface { + return &FakeSvcGroups{c} +} + +func (c *FakeGlobalTsmV1) SvcGroupRTs() v1.SvcGroupRTInterface { + return &FakeSvcGroupRTs{c} +} + +func (c *FakeGlobalTsmV1) Tables() v1.TableInterface { + return &FakeTables{c} +} + +func (c *FakeGlobalTsmV1) Templates() v1.TemplateInterface { + return &FakeTemplates{c} +} + +func (c *FakeGlobalTsmV1) TemplateGroups() v1.TemplateGroupInterface { + return &FakeTemplateGroups{c} +} + +func (c *FakeGlobalTsmV1) Tenants() v1.TenantInterface { + return &FakeTenants{c} +} + +func (c *FakeGlobalTsmV1) TenantResources() v1.TenantResourceInterface { + return &FakeTenantResources{c} +} + +func (c *FakeGlobalTsmV1) TenantTokens() v1.TenantTokenInterface { + return &FakeTenantTokens{c} +} + +func (c *FakeGlobalTsmV1) Users() v1.UserInterface { + return &FakeUsers{c} +} + +func (c *FakeGlobalTsmV1) UserDiscoveries() v1.UserDiscoveryInterface { + return &FakeUserDiscoveries{c} +} + +func (c *FakeGlobalTsmV1) UserDiscoveryRTs() v1.UserDiscoveryRTInterface { + return &FakeUserDiscoveryRTs{c} +} + +func (c *FakeGlobalTsmV1) UserFolders() v1.UserFolderInterface { + return &FakeUserFolders{c} +} + +func (c *FakeGlobalTsmV1) UserGroups() v1.UserGroupInterface { + return &FakeUserGroups{c} +} + +func (c *FakeGlobalTsmV1) UserPreferences() v1.UserPreferenceInterface { + return &FakeUserPreferences{c} +} + +func (c *FakeGlobalTsmV1) VirtualServices() v1.VirtualServiceInterface { + return &FakeVirtualServices{c} +} + +func (c *FakeGlobalTsmV1) WorkloadEntries() v1.WorkloadEntryInterface { + return &FakeWorkloadEntries{c} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeGlobalTsmV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_globalnamespace.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_globalnamespace.go new file mode 100644 index 000000000..7aa7795bb --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_globalnamespace.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGlobalNamespaces implements GlobalNamespaceInterface +type FakeGlobalNamespaces struct { + Fake *FakeGlobalTsmV1 +} + +var globalnamespacesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "globalnamespaces"} + +var globalnamespacesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GlobalNamespace"} + +// Get takes name of the globalNamespace, and returns the corresponding globalNamespace object, and an error if there is any. +func (c *FakeGlobalNamespaces) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GlobalNamespace, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(globalnamespacesResource, name), &globaltsmtanzuvmwarecomv1.GlobalNamespace{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GlobalNamespace), err +} + +// List takes label and field selectors, and returns the list of GlobalNamespaces that match those selectors. +func (c *FakeGlobalNamespaces) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GlobalNamespaceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(globalnamespacesResource, globalnamespacesKind, opts), &globaltsmtanzuvmwarecomv1.GlobalNamespaceList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GlobalNamespaceList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GlobalNamespaceList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GlobalNamespaceList).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 globalNamespaces. +func (c *FakeGlobalNamespaces) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(globalnamespacesResource, opts)) +} + +// Create takes the representation of a globalNamespace and creates it. Returns the server's representation of the globalNamespace, and an error, if there is any. +func (c *FakeGlobalNamespaces) Create(ctx context.Context, globalNamespace *globaltsmtanzuvmwarecomv1.GlobalNamespace, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GlobalNamespace, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(globalnamespacesResource, globalNamespace), &globaltsmtanzuvmwarecomv1.GlobalNamespace{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GlobalNamespace), err +} + +// Update takes the representation of a globalNamespace and updates it. Returns the server's representation of the globalNamespace, and an error, if there is any. +func (c *FakeGlobalNamespaces) Update(ctx context.Context, globalNamespace *globaltsmtanzuvmwarecomv1.GlobalNamespace, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GlobalNamespace, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(globalnamespacesResource, globalNamespace), &globaltsmtanzuvmwarecomv1.GlobalNamespace{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GlobalNamespace), err +} + +// Delete takes name of the globalNamespace and deletes it. Returns an error if one occurs. +func (c *FakeGlobalNamespaces) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(globalnamespacesResource, name), &globaltsmtanzuvmwarecomv1.GlobalNamespace{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGlobalNamespaces) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(globalnamespacesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GlobalNamespaceList{}) + return err +} + +// Patch applies the patch and returns the patched globalNamespace. +func (c *FakeGlobalNamespaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GlobalNamespace, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(globalnamespacesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GlobalNamespace{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GlobalNamespace), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_globalns.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_globalns.go new file mode 100644 index 000000000..75e4764a1 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_globalns.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGlobalNses implements GlobalNsInterface +type FakeGlobalNses struct { + Fake *FakeGlobalTsmV1 +} + +var globalnsesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "globalnses"} + +var globalnsesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GlobalNs"} + +// Get takes name of the globalNs, and returns the corresponding globalNs object, and an error if there is any. +func (c *FakeGlobalNses) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GlobalNs, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(globalnsesResource, name), &globaltsmtanzuvmwarecomv1.GlobalNs{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GlobalNs), err +} + +// List takes label and field selectors, and returns the list of GlobalNses that match those selectors. +func (c *FakeGlobalNses) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GlobalNsList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(globalnsesResource, globalnsesKind, opts), &globaltsmtanzuvmwarecomv1.GlobalNsList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GlobalNsList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GlobalNsList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GlobalNsList).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 globalNses. +func (c *FakeGlobalNses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(globalnsesResource, opts)) +} + +// Create takes the representation of a globalNs and creates it. Returns the server's representation of the globalNs, and an error, if there is any. +func (c *FakeGlobalNses) Create(ctx context.Context, globalNs *globaltsmtanzuvmwarecomv1.GlobalNs, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GlobalNs, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(globalnsesResource, globalNs), &globaltsmtanzuvmwarecomv1.GlobalNs{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GlobalNs), err +} + +// Update takes the representation of a globalNs and updates it. Returns the server's representation of the globalNs, and an error, if there is any. +func (c *FakeGlobalNses) Update(ctx context.Context, globalNs *globaltsmtanzuvmwarecomv1.GlobalNs, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GlobalNs, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(globalnsesResource, globalNs), &globaltsmtanzuvmwarecomv1.GlobalNs{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GlobalNs), err +} + +// Delete takes name of the globalNs and deletes it. Returns an error if one occurs. +func (c *FakeGlobalNses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(globalnsesResource, name), &globaltsmtanzuvmwarecomv1.GlobalNs{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGlobalNses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(globalnsesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GlobalNsList{}) + return err +} + +// Patch applies the patch and returns the patched globalNs. +func (c *FakeGlobalNses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GlobalNs, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(globalnsesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GlobalNs{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GlobalNs), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_globalregistrationservice.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_globalregistrationservice.go new file mode 100644 index 000000000..0a6205bc7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_globalregistrationservice.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGlobalRegistrationServices implements GlobalRegistrationServiceInterface +type FakeGlobalRegistrationServices struct { + Fake *FakeGlobalTsmV1 +} + +var globalregistrationservicesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "globalregistrationservices"} + +var globalregistrationservicesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GlobalRegistrationService"} + +// Get takes name of the globalRegistrationService, and returns the corresponding globalRegistrationService object, and an error if there is any. +func (c *FakeGlobalRegistrationServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GlobalRegistrationService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(globalregistrationservicesResource, name), &globaltsmtanzuvmwarecomv1.GlobalRegistrationService{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GlobalRegistrationService), err +} + +// List takes label and field selectors, and returns the list of GlobalRegistrationServices that match those selectors. +func (c *FakeGlobalRegistrationServices) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GlobalRegistrationServiceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(globalregistrationservicesResource, globalregistrationservicesKind, opts), &globaltsmtanzuvmwarecomv1.GlobalRegistrationServiceList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GlobalRegistrationServiceList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GlobalRegistrationServiceList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GlobalRegistrationServiceList).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 globalRegistrationServices. +func (c *FakeGlobalRegistrationServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(globalregistrationservicesResource, opts)) +} + +// Create takes the representation of a globalRegistrationService and creates it. Returns the server's representation of the globalRegistrationService, and an error, if there is any. +func (c *FakeGlobalRegistrationServices) Create(ctx context.Context, globalRegistrationService *globaltsmtanzuvmwarecomv1.GlobalRegistrationService, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GlobalRegistrationService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(globalregistrationservicesResource, globalRegistrationService), &globaltsmtanzuvmwarecomv1.GlobalRegistrationService{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GlobalRegistrationService), err +} + +// Update takes the representation of a globalRegistrationService and updates it. Returns the server's representation of the globalRegistrationService, and an error, if there is any. +func (c *FakeGlobalRegistrationServices) Update(ctx context.Context, globalRegistrationService *globaltsmtanzuvmwarecomv1.GlobalRegistrationService, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GlobalRegistrationService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(globalregistrationservicesResource, globalRegistrationService), &globaltsmtanzuvmwarecomv1.GlobalRegistrationService{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GlobalRegistrationService), err +} + +// Delete takes name of the globalRegistrationService and deletes it. Returns an error if one occurs. +func (c *FakeGlobalRegistrationServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(globalregistrationservicesResource, name), &globaltsmtanzuvmwarecomv1.GlobalRegistrationService{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGlobalRegistrationServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(globalregistrationservicesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GlobalRegistrationServiceList{}) + return err +} + +// Patch applies the patch and returns the patched globalRegistrationService. +func (c *FakeGlobalRegistrationServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GlobalRegistrationService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(globalregistrationservicesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GlobalRegistrationService{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GlobalRegistrationService), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gns.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gns.go new file mode 100644 index 000000000..1b5394a85 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gns.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGNSs implements GNSInterface +type FakeGNSs struct { + Fake *FakeGlobalTsmV1 +} + +var gnssResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gnss"} + +var gnssKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GNS"} + +// Get takes name of the gNS, and returns the corresponding gNS object, and an error if there is any. +func (c *FakeGNSs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GNS, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gnssResource, name), &globaltsmtanzuvmwarecomv1.GNS{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GNS), err +} + +// List takes label and field selectors, and returns the list of GNSs that match those selectors. +func (c *FakeGNSs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GNSList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gnssResource, gnssKind, opts), &globaltsmtanzuvmwarecomv1.GNSList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GNSList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GNSList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GNSList).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 gNSs. +func (c *FakeGNSs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gnssResource, opts)) +} + +// Create takes the representation of a gNS and creates it. Returns the server's representation of the gNS, and an error, if there is any. +func (c *FakeGNSs) Create(ctx context.Context, gNS *globaltsmtanzuvmwarecomv1.GNS, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GNS, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gnssResource, gNS), &globaltsmtanzuvmwarecomv1.GNS{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GNS), err +} + +// Update takes the representation of a gNS and updates it. Returns the server's representation of the gNS, and an error, if there is any. +func (c *FakeGNSs) Update(ctx context.Context, gNS *globaltsmtanzuvmwarecomv1.GNS, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GNS, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gnssResource, gNS), &globaltsmtanzuvmwarecomv1.GNS{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GNS), err +} + +// Delete takes name of the gNS and deletes it. Returns an error if one occurs. +func (c *FakeGNSs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gnssResource, name), &globaltsmtanzuvmwarecomv1.GNS{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGNSs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gnssResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GNSList{}) + return err +} + +// Patch applies the patch and returns the patched gNS. +func (c *FakeGNSs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GNS, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gnssResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GNS{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GNS), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsaccesscontrolpolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsaccesscontrolpolicy.go new file mode 100644 index 000000000..acb1ec167 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsaccesscontrolpolicy.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGnsAccessControlPolicies implements GnsAccessControlPolicyInterface +type FakeGnsAccessControlPolicies struct { + Fake *FakeGlobalTsmV1 +} + +var gnsaccesscontrolpoliciesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gnsaccesscontrolpolicies"} + +var gnsaccesscontrolpoliciesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GnsAccessControlPolicy"} + +// Get takes name of the gnsAccessControlPolicy, and returns the corresponding gnsAccessControlPolicy object, and an error if there is any. +func (c *FakeGnsAccessControlPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GnsAccessControlPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gnsaccesscontrolpoliciesResource, name), &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsAccessControlPolicy), err +} + +// List takes label and field selectors, and returns the list of GnsAccessControlPolicies that match those selectors. +func (c *FakeGnsAccessControlPolicies) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gnsaccesscontrolpoliciesResource, gnsaccesscontrolpoliciesKind, opts), &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyList).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 gnsAccessControlPolicies. +func (c *FakeGnsAccessControlPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gnsaccesscontrolpoliciesResource, opts)) +} + +// Create takes the representation of a gnsAccessControlPolicy and creates it. Returns the server's representation of the gnsAccessControlPolicy, and an error, if there is any. +func (c *FakeGnsAccessControlPolicies) Create(ctx context.Context, gnsAccessControlPolicy *globaltsmtanzuvmwarecomv1.GnsAccessControlPolicy, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GnsAccessControlPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gnsaccesscontrolpoliciesResource, gnsAccessControlPolicy), &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsAccessControlPolicy), err +} + +// Update takes the representation of a gnsAccessControlPolicy and updates it. Returns the server's representation of the gnsAccessControlPolicy, and an error, if there is any. +func (c *FakeGnsAccessControlPolicies) Update(ctx context.Context, gnsAccessControlPolicy *globaltsmtanzuvmwarecomv1.GnsAccessControlPolicy, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GnsAccessControlPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gnsaccesscontrolpoliciesResource, gnsAccessControlPolicy), &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsAccessControlPolicy), err +} + +// Delete takes name of the gnsAccessControlPolicy and deletes it. Returns an error if one occurs. +func (c *FakeGnsAccessControlPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gnsaccesscontrolpoliciesResource, name), &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicy{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGnsAccessControlPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gnsaccesscontrolpoliciesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched gnsAccessControlPolicy. +func (c *FakeGnsAccessControlPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GnsAccessControlPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gnsaccesscontrolpoliciesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsAccessControlPolicy), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsaccesscontrolpolicyrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsaccesscontrolpolicyrt.go new file mode 100644 index 000000000..4c9f93a84 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsaccesscontrolpolicyrt.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGnsAccessControlPolicyRTs implements GnsAccessControlPolicyRTInterface +type FakeGnsAccessControlPolicyRTs struct { + Fake *FakeGlobalTsmV1 +} + +var gnsaccesscontrolpolicyrtsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gnsaccesscontrolpolicyrts"} + +var gnsaccesscontrolpolicyrtsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GnsAccessControlPolicyRT"} + +// Get takes name of the gnsAccessControlPolicyRT, and returns the corresponding gnsAccessControlPolicyRT object, and an error if there is any. +func (c *FakeGnsAccessControlPolicyRTs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gnsaccesscontrolpolicyrtsResource, name), &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT), err +} + +// List takes label and field selectors, and returns the list of GnsAccessControlPolicyRTs that match those selectors. +func (c *FakeGnsAccessControlPolicyRTs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRTList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gnsaccesscontrolpolicyrtsResource, gnsaccesscontrolpolicyrtsKind, opts), &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRTList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRTList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRTList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRTList).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 gnsAccessControlPolicyRTs. +func (c *FakeGnsAccessControlPolicyRTs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gnsaccesscontrolpolicyrtsResource, opts)) +} + +// Create takes the representation of a gnsAccessControlPolicyRT and creates it. Returns the server's representation of the gnsAccessControlPolicyRT, and an error, if there is any. +func (c *FakeGnsAccessControlPolicyRTs) Create(ctx context.Context, gnsAccessControlPolicyRT *globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gnsaccesscontrolpolicyrtsResource, gnsAccessControlPolicyRT), &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT), err +} + +// Update takes the representation of a gnsAccessControlPolicyRT and updates it. Returns the server's representation of the gnsAccessControlPolicyRT, and an error, if there is any. +func (c *FakeGnsAccessControlPolicyRTs) Update(ctx context.Context, gnsAccessControlPolicyRT *globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gnsaccesscontrolpolicyrtsResource, gnsAccessControlPolicyRT), &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT), err +} + +// Delete takes name of the gnsAccessControlPolicyRT and deletes it. Returns an error if one occurs. +func (c *FakeGnsAccessControlPolicyRTs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gnsaccesscontrolpolicyrtsResource, name), &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGnsAccessControlPolicyRTs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gnsaccesscontrolpolicyrtsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRTList{}) + return err +} + +// Patch applies the patch and returns the patched gnsAccessControlPolicyRT. +func (c *FakeGnsAccessControlPolicyRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gnsaccesscontrolpolicyrtsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsbindingrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsbindingrt.go new file mode 100644 index 000000000..384965bf2 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsbindingrt.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGnsBindingRTs implements GnsBindingRTInterface +type FakeGnsBindingRTs struct { + Fake *FakeGlobalTsmV1 +} + +var gnsbindingrtsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gnsbindingrts"} + +var gnsbindingrtsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GnsBindingRT"} + +// Get takes name of the gnsBindingRT, and returns the corresponding gnsBindingRT object, and an error if there is any. +func (c *FakeGnsBindingRTs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GnsBindingRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gnsbindingrtsResource, name), &globaltsmtanzuvmwarecomv1.GnsBindingRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsBindingRT), err +} + +// List takes label and field selectors, and returns the list of GnsBindingRTs that match those selectors. +func (c *FakeGnsBindingRTs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GnsBindingRTList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gnsbindingrtsResource, gnsbindingrtsKind, opts), &globaltsmtanzuvmwarecomv1.GnsBindingRTList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GnsBindingRTList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GnsBindingRTList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GnsBindingRTList).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 gnsBindingRTs. +func (c *FakeGnsBindingRTs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gnsbindingrtsResource, opts)) +} + +// Create takes the representation of a gnsBindingRT and creates it. Returns the server's representation of the gnsBindingRT, and an error, if there is any. +func (c *FakeGnsBindingRTs) Create(ctx context.Context, gnsBindingRT *globaltsmtanzuvmwarecomv1.GnsBindingRT, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GnsBindingRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gnsbindingrtsResource, gnsBindingRT), &globaltsmtanzuvmwarecomv1.GnsBindingRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsBindingRT), err +} + +// Update takes the representation of a gnsBindingRT and updates it. Returns the server's representation of the gnsBindingRT, and an error, if there is any. +func (c *FakeGnsBindingRTs) Update(ctx context.Context, gnsBindingRT *globaltsmtanzuvmwarecomv1.GnsBindingRT, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GnsBindingRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gnsbindingrtsResource, gnsBindingRT), &globaltsmtanzuvmwarecomv1.GnsBindingRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsBindingRT), err +} + +// Delete takes name of the gnsBindingRT and deletes it. Returns an error if one occurs. +func (c *FakeGnsBindingRTs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gnsbindingrtsResource, name), &globaltsmtanzuvmwarecomv1.GnsBindingRT{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGnsBindingRTs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gnsbindingrtsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GnsBindingRTList{}) + return err +} + +// Patch applies the patch and returns the patched gnsBindingRT. +func (c *FakeGnsBindingRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GnsBindingRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gnsbindingrtsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GnsBindingRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsBindingRT), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsendpointsconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsendpointsconfig.go new file mode 100644 index 000000000..a83c0ff7c --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsendpointsconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGnsEndpointsConfigs implements GnsEndpointsConfigInterface +type FakeGnsEndpointsConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var gnsendpointsconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gnsendpointsconfigs"} + +var gnsendpointsconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GnsEndpointsConfig"} + +// Get takes name of the gnsEndpointsConfig, and returns the corresponding gnsEndpointsConfig object, and an error if there is any. +func (c *FakeGnsEndpointsConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GnsEndpointsConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gnsendpointsconfigsResource, name), &globaltsmtanzuvmwarecomv1.GnsEndpointsConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsEndpointsConfig), err +} + +// List takes label and field selectors, and returns the list of GnsEndpointsConfigs that match those selectors. +func (c *FakeGnsEndpointsConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GnsEndpointsConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gnsendpointsconfigsResource, gnsendpointsconfigsKind, opts), &globaltsmtanzuvmwarecomv1.GnsEndpointsConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GnsEndpointsConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GnsEndpointsConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GnsEndpointsConfigList).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 gnsEndpointsConfigs. +func (c *FakeGnsEndpointsConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gnsendpointsconfigsResource, opts)) +} + +// Create takes the representation of a gnsEndpointsConfig and creates it. Returns the server's representation of the gnsEndpointsConfig, and an error, if there is any. +func (c *FakeGnsEndpointsConfigs) Create(ctx context.Context, gnsEndpointsConfig *globaltsmtanzuvmwarecomv1.GnsEndpointsConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GnsEndpointsConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gnsendpointsconfigsResource, gnsEndpointsConfig), &globaltsmtanzuvmwarecomv1.GnsEndpointsConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsEndpointsConfig), err +} + +// Update takes the representation of a gnsEndpointsConfig and updates it. Returns the server's representation of the gnsEndpointsConfig, and an error, if there is any. +func (c *FakeGnsEndpointsConfigs) Update(ctx context.Context, gnsEndpointsConfig *globaltsmtanzuvmwarecomv1.GnsEndpointsConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GnsEndpointsConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gnsendpointsconfigsResource, gnsEndpointsConfig), &globaltsmtanzuvmwarecomv1.GnsEndpointsConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsEndpointsConfig), err +} + +// Delete takes name of the gnsEndpointsConfig and deletes it. Returns an error if one occurs. +func (c *FakeGnsEndpointsConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gnsendpointsconfigsResource, name), &globaltsmtanzuvmwarecomv1.GnsEndpointsConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGnsEndpointsConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gnsendpointsconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GnsEndpointsConfigList{}) + return err +} + +// Patch applies the patch and returns the patched gnsEndpointsConfig. +func (c *FakeGnsEndpointsConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GnsEndpointsConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gnsendpointsconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GnsEndpointsConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsEndpointsConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsroutingconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsroutingconfig.go new file mode 100644 index 000000000..8b1556f0e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsroutingconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGNSRoutingConfigs implements GNSRoutingConfigInterface +type FakeGNSRoutingConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var gnsroutingconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gnsroutingconfigs"} + +var gnsroutingconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GNSRoutingConfig"} + +// Get takes name of the gNSRoutingConfig, and returns the corresponding gNSRoutingConfig object, and an error if there is any. +func (c *FakeGNSRoutingConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GNSRoutingConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gnsroutingconfigsResource, name), &globaltsmtanzuvmwarecomv1.GNSRoutingConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GNSRoutingConfig), err +} + +// List takes label and field selectors, and returns the list of GNSRoutingConfigs that match those selectors. +func (c *FakeGNSRoutingConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GNSRoutingConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gnsroutingconfigsResource, gnsroutingconfigsKind, opts), &globaltsmtanzuvmwarecomv1.GNSRoutingConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GNSRoutingConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GNSRoutingConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GNSRoutingConfigList).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 gNSRoutingConfigs. +func (c *FakeGNSRoutingConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gnsroutingconfigsResource, opts)) +} + +// Create takes the representation of a gNSRoutingConfig and creates it. Returns the server's representation of the gNSRoutingConfig, and an error, if there is any. +func (c *FakeGNSRoutingConfigs) Create(ctx context.Context, gNSRoutingConfig *globaltsmtanzuvmwarecomv1.GNSRoutingConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GNSRoutingConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gnsroutingconfigsResource, gNSRoutingConfig), &globaltsmtanzuvmwarecomv1.GNSRoutingConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GNSRoutingConfig), err +} + +// Update takes the representation of a gNSRoutingConfig and updates it. Returns the server's representation of the gNSRoutingConfig, and an error, if there is any. +func (c *FakeGNSRoutingConfigs) Update(ctx context.Context, gNSRoutingConfig *globaltsmtanzuvmwarecomv1.GNSRoutingConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GNSRoutingConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gnsroutingconfigsResource, gNSRoutingConfig), &globaltsmtanzuvmwarecomv1.GNSRoutingConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GNSRoutingConfig), err +} + +// Delete takes name of the gNSRoutingConfig and deletes it. Returns an error if one occurs. +func (c *FakeGNSRoutingConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gnsroutingconfigsResource, name), &globaltsmtanzuvmwarecomv1.GNSRoutingConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGNSRoutingConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gnsroutingconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GNSRoutingConfigList{}) + return err +} + +// Patch applies the patch and returns the patched gNSRoutingConfig. +func (c *FakeGNSRoutingConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GNSRoutingConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gnsroutingconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GNSRoutingConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GNSRoutingConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsroutingruleconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsroutingruleconfig.go new file mode 100644 index 000000000..fb56fe49c --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsroutingruleconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGnsRoutingRuleConfigs implements GnsRoutingRuleConfigInterface +type FakeGnsRoutingRuleConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var gnsroutingruleconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gnsroutingruleconfigs"} + +var gnsroutingruleconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GnsRoutingRuleConfig"} + +// Get takes name of the gnsRoutingRuleConfig, and returns the corresponding gnsRoutingRuleConfig object, and an error if there is any. +func (c *FakeGnsRoutingRuleConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gnsroutingruleconfigsResource, name), &globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig), err +} + +// List takes label and field selectors, and returns the list of GnsRoutingRuleConfigs that match those selectors. +func (c *FakeGnsRoutingRuleConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gnsroutingruleconfigsResource, gnsroutingruleconfigsKind, opts), &globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfigList).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 gnsRoutingRuleConfigs. +func (c *FakeGnsRoutingRuleConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gnsroutingruleconfigsResource, opts)) +} + +// Create takes the representation of a gnsRoutingRuleConfig and creates it. Returns the server's representation of the gnsRoutingRuleConfig, and an error, if there is any. +func (c *FakeGnsRoutingRuleConfigs) Create(ctx context.Context, gnsRoutingRuleConfig *globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gnsroutingruleconfigsResource, gnsRoutingRuleConfig), &globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig), err +} + +// Update takes the representation of a gnsRoutingRuleConfig and updates it. Returns the server's representation of the gnsRoutingRuleConfig, and an error, if there is any. +func (c *FakeGnsRoutingRuleConfigs) Update(ctx context.Context, gnsRoutingRuleConfig *globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gnsroutingruleconfigsResource, gnsRoutingRuleConfig), &globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig), err +} + +// Delete takes name of the gnsRoutingRuleConfig and deletes it. Returns an error if one occurs. +func (c *FakeGnsRoutingRuleConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gnsroutingruleconfigsResource, name), &globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGnsRoutingRuleConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gnsroutingruleconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfigList{}) + return err +} + +// Patch applies the patch and returns the patched gnsRoutingRuleConfig. +func (c *FakeGnsRoutingRuleConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gnsroutingruleconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsschemaviolationdiscovery.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsschemaviolationdiscovery.go new file mode 100644 index 000000000..d5a0541a9 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsschemaviolationdiscovery.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGnsSchemaViolationDiscoveries implements GnsSchemaViolationDiscoveryInterface +type FakeGnsSchemaViolationDiscoveries struct { + Fake *FakeGlobalTsmV1 +} + +var gnsschemaviolationdiscoveriesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gnsschemaviolationdiscoveries"} + +var gnsschemaviolationdiscoveriesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GnsSchemaViolationDiscovery"} + +// Get takes name of the gnsSchemaViolationDiscovery, and returns the corresponding gnsSchemaViolationDiscovery object, and an error if there is any. +func (c *FakeGnsSchemaViolationDiscoveries) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gnsschemaviolationdiscoveriesResource, name), &globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery), err +} + +// List takes label and field selectors, and returns the list of GnsSchemaViolationDiscoveries that match those selectors. +func (c *FakeGnsSchemaViolationDiscoveries) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscoveryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gnsschemaviolationdiscoveriesResource, gnsschemaviolationdiscoveriesKind, opts), &globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscoveryList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscoveryList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscoveryList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscoveryList).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 gnsSchemaViolationDiscoveries. +func (c *FakeGnsSchemaViolationDiscoveries) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gnsschemaviolationdiscoveriesResource, opts)) +} + +// Create takes the representation of a gnsSchemaViolationDiscovery and creates it. Returns the server's representation of the gnsSchemaViolationDiscovery, and an error, if there is any. +func (c *FakeGnsSchemaViolationDiscoveries) Create(ctx context.Context, gnsSchemaViolationDiscovery *globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gnsschemaviolationdiscoveriesResource, gnsSchemaViolationDiscovery), &globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery), err +} + +// Update takes the representation of a gnsSchemaViolationDiscovery and updates it. Returns the server's representation of the gnsSchemaViolationDiscovery, and an error, if there is any. +func (c *FakeGnsSchemaViolationDiscoveries) Update(ctx context.Context, gnsSchemaViolationDiscovery *globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gnsschemaviolationdiscoveriesResource, gnsSchemaViolationDiscovery), &globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery), err +} + +// Delete takes name of the gnsSchemaViolationDiscovery and deletes it. Returns an error if one occurs. +func (c *FakeGnsSchemaViolationDiscoveries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gnsschemaviolationdiscoveriesResource, name), &globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGnsSchemaViolationDiscoveries) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gnsschemaviolationdiscoveriesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscoveryList{}) + return err +} + +// Patch applies the patch and returns the patched gnsSchemaViolationDiscovery. +func (c *FakeGnsSchemaViolationDiscoveries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gnsschemaviolationdiscoveriesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnssegmentationpolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnssegmentationpolicy.go new file mode 100644 index 000000000..2857d2fb1 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnssegmentationpolicy.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGnsSegmentationPolicies implements GnsSegmentationPolicyInterface +type FakeGnsSegmentationPolicies struct { + Fake *FakeGlobalTsmV1 +} + +var gnssegmentationpoliciesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gnssegmentationpolicies"} + +var gnssegmentationpoliciesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GnsSegmentationPolicy"} + +// Get takes name of the gnsSegmentationPolicy, and returns the corresponding gnsSegmentationPolicy object, and an error if there is any. +func (c *FakeGnsSegmentationPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GnsSegmentationPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gnssegmentationpoliciesResource, name), &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsSegmentationPolicy), err +} + +// List takes label and field selectors, and returns the list of GnsSegmentationPolicies that match those selectors. +func (c *FakeGnsSegmentationPolicies) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gnssegmentationpoliciesResource, gnssegmentationpoliciesKind, opts), &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyList).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 gnsSegmentationPolicies. +func (c *FakeGnsSegmentationPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gnssegmentationpoliciesResource, opts)) +} + +// Create takes the representation of a gnsSegmentationPolicy and creates it. Returns the server's representation of the gnsSegmentationPolicy, and an error, if there is any. +func (c *FakeGnsSegmentationPolicies) Create(ctx context.Context, gnsSegmentationPolicy *globaltsmtanzuvmwarecomv1.GnsSegmentationPolicy, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GnsSegmentationPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gnssegmentationpoliciesResource, gnsSegmentationPolicy), &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsSegmentationPolicy), err +} + +// Update takes the representation of a gnsSegmentationPolicy and updates it. Returns the server's representation of the gnsSegmentationPolicy, and an error, if there is any. +func (c *FakeGnsSegmentationPolicies) Update(ctx context.Context, gnsSegmentationPolicy *globaltsmtanzuvmwarecomv1.GnsSegmentationPolicy, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GnsSegmentationPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gnssegmentationpoliciesResource, gnsSegmentationPolicy), &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsSegmentationPolicy), err +} + +// Delete takes name of the gnsSegmentationPolicy and deletes it. Returns an error if one occurs. +func (c *FakeGnsSegmentationPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gnssegmentationpoliciesResource, name), &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicy{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGnsSegmentationPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gnssegmentationpoliciesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched gnsSegmentationPolicy. +func (c *FakeGnsSegmentationPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GnsSegmentationPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gnssegmentationpoliciesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsSegmentationPolicy), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnssegmentationpolicyrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnssegmentationpolicyrt.go new file mode 100644 index 000000000..5241f0222 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnssegmentationpolicyrt.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGnsSegmentationPolicyRTs implements GnsSegmentationPolicyRTInterface +type FakeGnsSegmentationPolicyRTs struct { + Fake *FakeGlobalTsmV1 +} + +var gnssegmentationpolicyrtsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gnssegmentationpolicyrts"} + +var gnssegmentationpolicyrtsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GnsSegmentationPolicyRT"} + +// Get takes name of the gnsSegmentationPolicyRT, and returns the corresponding gnsSegmentationPolicyRT object, and an error if there is any. +func (c *FakeGnsSegmentationPolicyRTs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gnssegmentationpolicyrtsResource, name), &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT), err +} + +// List takes label and field selectors, and returns the list of GnsSegmentationPolicyRTs that match those selectors. +func (c *FakeGnsSegmentationPolicyRTs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRTList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gnssegmentationpolicyrtsResource, gnssegmentationpolicyrtsKind, opts), &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRTList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRTList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRTList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRTList).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 gnsSegmentationPolicyRTs. +func (c *FakeGnsSegmentationPolicyRTs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gnssegmentationpolicyrtsResource, opts)) +} + +// Create takes the representation of a gnsSegmentationPolicyRT and creates it. Returns the server's representation of the gnsSegmentationPolicyRT, and an error, if there is any. +func (c *FakeGnsSegmentationPolicyRTs) Create(ctx context.Context, gnsSegmentationPolicyRT *globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gnssegmentationpolicyrtsResource, gnsSegmentationPolicyRT), &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT), err +} + +// Update takes the representation of a gnsSegmentationPolicyRT and updates it. Returns the server's representation of the gnsSegmentationPolicyRT, and an error, if there is any. +func (c *FakeGnsSegmentationPolicyRTs) Update(ctx context.Context, gnsSegmentationPolicyRT *globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gnssegmentationpolicyrtsResource, gnsSegmentationPolicyRT), &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT), err +} + +// Delete takes name of the gnsSegmentationPolicyRT and deletes it. Returns an error if one occurs. +func (c *FakeGnsSegmentationPolicyRTs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gnssegmentationpolicyrtsResource, name), &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGnsSegmentationPolicyRTs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gnssegmentationpolicyrtsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRTList{}) + return err +} + +// Patch applies the patch and returns the patched gnsSegmentationPolicyRT. +func (c *FakeGnsSegmentationPolicyRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gnssegmentationpolicyrtsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsserviceentryconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsserviceentryconfig.go new file mode 100644 index 000000000..a8002bc1d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnsserviceentryconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGnsServiceEntryConfigs implements GnsServiceEntryConfigInterface +type FakeGnsServiceEntryConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var gnsserviceentryconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gnsserviceentryconfigs"} + +var gnsserviceentryconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GnsServiceEntryConfig"} + +// Get takes name of the gnsServiceEntryConfig, and returns the corresponding gnsServiceEntryConfig object, and an error if there is any. +func (c *FakeGnsServiceEntryConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GnsServiceEntryConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gnsserviceentryconfigsResource, name), &globaltsmtanzuvmwarecomv1.GnsServiceEntryConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsServiceEntryConfig), err +} + +// List takes label and field selectors, and returns the list of GnsServiceEntryConfigs that match those selectors. +func (c *FakeGnsServiceEntryConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GnsServiceEntryConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gnsserviceentryconfigsResource, gnsserviceentryconfigsKind, opts), &globaltsmtanzuvmwarecomv1.GnsServiceEntryConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GnsServiceEntryConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GnsServiceEntryConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GnsServiceEntryConfigList).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 gnsServiceEntryConfigs. +func (c *FakeGnsServiceEntryConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gnsserviceentryconfigsResource, opts)) +} + +// Create takes the representation of a gnsServiceEntryConfig and creates it. Returns the server's representation of the gnsServiceEntryConfig, and an error, if there is any. +func (c *FakeGnsServiceEntryConfigs) Create(ctx context.Context, gnsServiceEntryConfig *globaltsmtanzuvmwarecomv1.GnsServiceEntryConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GnsServiceEntryConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gnsserviceentryconfigsResource, gnsServiceEntryConfig), &globaltsmtanzuvmwarecomv1.GnsServiceEntryConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsServiceEntryConfig), err +} + +// Update takes the representation of a gnsServiceEntryConfig and updates it. Returns the server's representation of the gnsServiceEntryConfig, and an error, if there is any. +func (c *FakeGnsServiceEntryConfigs) Update(ctx context.Context, gnsServiceEntryConfig *globaltsmtanzuvmwarecomv1.GnsServiceEntryConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GnsServiceEntryConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gnsserviceentryconfigsResource, gnsServiceEntryConfig), &globaltsmtanzuvmwarecomv1.GnsServiceEntryConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsServiceEntryConfig), err +} + +// Delete takes name of the gnsServiceEntryConfig and deletes it. Returns an error if one occurs. +func (c *FakeGnsServiceEntryConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gnsserviceentryconfigsResource, name), &globaltsmtanzuvmwarecomv1.GnsServiceEntryConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGnsServiceEntryConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gnsserviceentryconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GnsServiceEntryConfigList{}) + return err +} + +// Patch applies the patch and returns the patched gnsServiceEntryConfig. +func (c *FakeGnsServiceEntryConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GnsServiceEntryConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gnsserviceentryconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GnsServiceEntryConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsServiceEntryConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnssvcgroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnssvcgroup.go new file mode 100644 index 000000000..9e8f94425 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnssvcgroup.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGNSSvcGroups implements GNSSvcGroupInterface +type FakeGNSSvcGroups struct { + Fake *FakeGlobalTsmV1 +} + +var gnssvcgroupsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gnssvcgroups"} + +var gnssvcgroupsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GNSSvcGroup"} + +// Get takes name of the gNSSvcGroup, and returns the corresponding gNSSvcGroup object, and an error if there is any. +func (c *FakeGNSSvcGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GNSSvcGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gnssvcgroupsResource, name), &globaltsmtanzuvmwarecomv1.GNSSvcGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GNSSvcGroup), err +} + +// List takes label and field selectors, and returns the list of GNSSvcGroups that match those selectors. +func (c *FakeGNSSvcGroups) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GNSSvcGroupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gnssvcgroupsResource, gnssvcgroupsKind, opts), &globaltsmtanzuvmwarecomv1.GNSSvcGroupList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GNSSvcGroupList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GNSSvcGroupList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GNSSvcGroupList).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 gNSSvcGroups. +func (c *FakeGNSSvcGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gnssvcgroupsResource, opts)) +} + +// Create takes the representation of a gNSSvcGroup and creates it. Returns the server's representation of the gNSSvcGroup, and an error, if there is any. +func (c *FakeGNSSvcGroups) Create(ctx context.Context, gNSSvcGroup *globaltsmtanzuvmwarecomv1.GNSSvcGroup, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GNSSvcGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gnssvcgroupsResource, gNSSvcGroup), &globaltsmtanzuvmwarecomv1.GNSSvcGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GNSSvcGroup), err +} + +// Update takes the representation of a gNSSvcGroup and updates it. Returns the server's representation of the gNSSvcGroup, and an error, if there is any. +func (c *FakeGNSSvcGroups) Update(ctx context.Context, gNSSvcGroup *globaltsmtanzuvmwarecomv1.GNSSvcGroup, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GNSSvcGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gnssvcgroupsResource, gNSSvcGroup), &globaltsmtanzuvmwarecomv1.GNSSvcGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GNSSvcGroup), err +} + +// Delete takes name of the gNSSvcGroup and deletes it. Returns an error if one occurs. +func (c *FakeGNSSvcGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gnssvcgroupsResource, name), &globaltsmtanzuvmwarecomv1.GNSSvcGroup{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGNSSvcGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gnssvcgroupsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GNSSvcGroupList{}) + return err +} + +// Patch applies the patch and returns the patched gNSSvcGroup. +func (c *FakeGNSSvcGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GNSSvcGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gnssvcgroupsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GNSSvcGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GNSSvcGroup), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnssvcgrouprt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnssvcgrouprt.go new file mode 100644 index 000000000..2492994c7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_gnssvcgrouprt.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeGnsSvcGroupRTs implements GnsSvcGroupRTInterface +type FakeGnsSvcGroupRTs struct { + Fake *FakeGlobalTsmV1 +} + +var gnssvcgrouprtsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "gnssvcgrouprts"} + +var gnssvcgrouprtsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "GnsSvcGroupRT"} + +// Get takes name of the gnsSvcGroupRT, and returns the corresponding gnsSvcGroupRT object, and an error if there is any. +func (c *FakeGnsSvcGroupRTs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.GnsSvcGroupRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gnssvcgrouprtsResource, name), &globaltsmtanzuvmwarecomv1.GnsSvcGroupRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsSvcGroupRT), err +} + +// List takes label and field selectors, and returns the list of GnsSvcGroupRTs that match those selectors. +func (c *FakeGnsSvcGroupRTs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.GnsSvcGroupRTList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gnssvcgrouprtsResource, gnssvcgrouprtsKind, opts), &globaltsmtanzuvmwarecomv1.GnsSvcGroupRTList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.GnsSvcGroupRTList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.GnsSvcGroupRTList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.GnsSvcGroupRTList).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 gnsSvcGroupRTs. +func (c *FakeGnsSvcGroupRTs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gnssvcgrouprtsResource, opts)) +} + +// Create takes the representation of a gnsSvcGroupRT and creates it. Returns the server's representation of the gnsSvcGroupRT, and an error, if there is any. +func (c *FakeGnsSvcGroupRTs) Create(ctx context.Context, gnsSvcGroupRT *globaltsmtanzuvmwarecomv1.GnsSvcGroupRT, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.GnsSvcGroupRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gnssvcgrouprtsResource, gnsSvcGroupRT), &globaltsmtanzuvmwarecomv1.GnsSvcGroupRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsSvcGroupRT), err +} + +// Update takes the representation of a gnsSvcGroupRT and updates it. Returns the server's representation of the gnsSvcGroupRT, and an error, if there is any. +func (c *FakeGnsSvcGroupRTs) Update(ctx context.Context, gnsSvcGroupRT *globaltsmtanzuvmwarecomv1.GnsSvcGroupRT, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.GnsSvcGroupRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gnssvcgrouprtsResource, gnsSvcGroupRT), &globaltsmtanzuvmwarecomv1.GnsSvcGroupRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsSvcGroupRT), err +} + +// Delete takes name of the gnsSvcGroupRT and deletes it. Returns an error if one occurs. +func (c *FakeGnsSvcGroupRTs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gnssvcgrouprtsResource, name), &globaltsmtanzuvmwarecomv1.GnsSvcGroupRT{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGnsSvcGroupRTs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gnssvcgrouprtsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.GnsSvcGroupRTList{}) + return err +} + +// Patch applies the patch and returns the patched gnsSvcGroupRT. +func (c *FakeGnsSvcGroupRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.GnsSvcGroupRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gnssvcgrouprtsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.GnsSvcGroupRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.GnsSvcGroupRT), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_haconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_haconfig.go new file mode 100644 index 000000000..76941f3ec --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_haconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeHaConfigs implements HaConfigInterface +type FakeHaConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var haconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "haconfigs"} + +var haconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "HaConfig"} + +// Get takes name of the haConfig, and returns the corresponding haConfig object, and an error if there is any. +func (c *FakeHaConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.HaConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(haconfigsResource, name), &globaltsmtanzuvmwarecomv1.HaConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HaConfig), err +} + +// List takes label and field selectors, and returns the list of HaConfigs that match those selectors. +func (c *FakeHaConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.HaConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(haconfigsResource, haconfigsKind, opts), &globaltsmtanzuvmwarecomv1.HaConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.HaConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.HaConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.HaConfigList).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 haConfigs. +func (c *FakeHaConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(haconfigsResource, opts)) +} + +// Create takes the representation of a haConfig and creates it. Returns the server's representation of the haConfig, and an error, if there is any. +func (c *FakeHaConfigs) Create(ctx context.Context, haConfig *globaltsmtanzuvmwarecomv1.HaConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.HaConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(haconfigsResource, haConfig), &globaltsmtanzuvmwarecomv1.HaConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HaConfig), err +} + +// Update takes the representation of a haConfig and updates it. Returns the server's representation of the haConfig, and an error, if there is any. +func (c *FakeHaConfigs) Update(ctx context.Context, haConfig *globaltsmtanzuvmwarecomv1.HaConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.HaConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(haconfigsResource, haConfig), &globaltsmtanzuvmwarecomv1.HaConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HaConfig), err +} + +// Delete takes name of the haConfig and deletes it. Returns an error if one occurs. +func (c *FakeHaConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(haconfigsResource, name), &globaltsmtanzuvmwarecomv1.HaConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeHaConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(haconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.HaConfigList{}) + return err +} + +// Patch applies the patch and returns the patched haConfig. +func (c *FakeHaConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.HaConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(haconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.HaConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HaConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_haconfigv2.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_haconfigv2.go new file mode 100644 index 000000000..b64d49a27 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_haconfigv2.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeHaConfigV2s implements HaConfigV2Interface +type FakeHaConfigV2s struct { + Fake *FakeGlobalTsmV1 +} + +var haconfigv2sResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "haconfigv2s"} + +var haconfigv2sKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "HaConfigV2"} + +// Get takes name of the haConfigV2, and returns the corresponding haConfigV2 object, and an error if there is any. +func (c *FakeHaConfigV2s) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.HaConfigV2, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(haconfigv2sResource, name), &globaltsmtanzuvmwarecomv1.HaConfigV2{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HaConfigV2), err +} + +// List takes label and field selectors, and returns the list of HaConfigV2s that match those selectors. +func (c *FakeHaConfigV2s) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.HaConfigV2List, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(haconfigv2sResource, haconfigv2sKind, opts), &globaltsmtanzuvmwarecomv1.HaConfigV2List{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.HaConfigV2List{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.HaConfigV2List).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.HaConfigV2List).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 haConfigV2s. +func (c *FakeHaConfigV2s) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(haconfigv2sResource, opts)) +} + +// Create takes the representation of a haConfigV2 and creates it. Returns the server's representation of the haConfigV2, and an error, if there is any. +func (c *FakeHaConfigV2s) Create(ctx context.Context, haConfigV2 *globaltsmtanzuvmwarecomv1.HaConfigV2, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.HaConfigV2, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(haconfigv2sResource, haConfigV2), &globaltsmtanzuvmwarecomv1.HaConfigV2{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HaConfigV2), err +} + +// Update takes the representation of a haConfigV2 and updates it. Returns the server's representation of the haConfigV2, and an error, if there is any. +func (c *FakeHaConfigV2s) Update(ctx context.Context, haConfigV2 *globaltsmtanzuvmwarecomv1.HaConfigV2, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.HaConfigV2, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(haconfigv2sResource, haConfigV2), &globaltsmtanzuvmwarecomv1.HaConfigV2{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HaConfigV2), err +} + +// Delete takes name of the haConfigV2 and deletes it. Returns an error if one occurs. +func (c *FakeHaConfigV2s) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(haconfigv2sResource, name), &globaltsmtanzuvmwarecomv1.HaConfigV2{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeHaConfigV2s) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(haconfigv2sResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.HaConfigV2List{}) + return err +} + +// Patch applies the patch and returns the patched haConfigV2. +func (c *FakeHaConfigV2s) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.HaConfigV2, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(haconfigv2sResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.HaConfigV2{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HaConfigV2), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_healthcheckconfign.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_healthcheckconfign.go new file mode 100644 index 000000000..737a0c0c6 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_healthcheckconfign.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeHealthCheckConfigNs implements HealthCheckConfigNInterface +type FakeHealthCheckConfigNs struct { + Fake *FakeGlobalTsmV1 +} + +var healthcheckconfignsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "healthcheckconfigns"} + +var healthcheckconfignsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "HealthCheckConfigN"} + +// Get takes name of the healthCheckConfigN, and returns the corresponding healthCheckConfigN object, and an error if there is any. +func (c *FakeHealthCheckConfigNs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.HealthCheckConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(healthcheckconfignsResource, name), &globaltsmtanzuvmwarecomv1.HealthCheckConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HealthCheckConfigN), err +} + +// List takes label and field selectors, and returns the list of HealthCheckConfigNs that match those selectors. +func (c *FakeHealthCheckConfigNs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.HealthCheckConfigNList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(healthcheckconfignsResource, healthcheckconfignsKind, opts), &globaltsmtanzuvmwarecomv1.HealthCheckConfigNList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.HealthCheckConfigNList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.HealthCheckConfigNList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.HealthCheckConfigNList).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 healthCheckConfigNs. +func (c *FakeHealthCheckConfigNs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(healthcheckconfignsResource, opts)) +} + +// Create takes the representation of a healthCheckConfigN and creates it. Returns the server's representation of the healthCheckConfigN, and an error, if there is any. +func (c *FakeHealthCheckConfigNs) Create(ctx context.Context, healthCheckConfigN *globaltsmtanzuvmwarecomv1.HealthCheckConfigN, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.HealthCheckConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(healthcheckconfignsResource, healthCheckConfigN), &globaltsmtanzuvmwarecomv1.HealthCheckConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HealthCheckConfigN), err +} + +// Update takes the representation of a healthCheckConfigN and updates it. Returns the server's representation of the healthCheckConfigN, and an error, if there is any. +func (c *FakeHealthCheckConfigNs) Update(ctx context.Context, healthCheckConfigN *globaltsmtanzuvmwarecomv1.HealthCheckConfigN, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.HealthCheckConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(healthcheckconfignsResource, healthCheckConfigN), &globaltsmtanzuvmwarecomv1.HealthCheckConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HealthCheckConfigN), err +} + +// Delete takes name of the healthCheckConfigN and deletes it. Returns an error if one occurs. +func (c *FakeHealthCheckConfigNs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(healthcheckconfignsResource, name), &globaltsmtanzuvmwarecomv1.HealthCheckConfigN{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeHealthCheckConfigNs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(healthcheckconfignsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.HealthCheckConfigNList{}) + return err +} + +// Patch applies the patch and returns the patched healthCheckConfigN. +func (c *FakeHealthCheckConfigNs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.HealthCheckConfigN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(healthcheckconfignsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.HealthCheckConfigN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HealthCheckConfigN), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_hostconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_hostconfig.go new file mode 100644 index 000000000..5fe7ec258 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_hostconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeHostConfigs implements HostConfigInterface +type FakeHostConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var hostconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "hostconfigs"} + +var hostconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "HostConfig"} + +// Get takes name of the hostConfig, and returns the corresponding hostConfig object, and an error if there is any. +func (c *FakeHostConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.HostConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(hostconfigsResource, name), &globaltsmtanzuvmwarecomv1.HostConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HostConfig), err +} + +// List takes label and field selectors, and returns the list of HostConfigs that match those selectors. +func (c *FakeHostConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.HostConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(hostconfigsResource, hostconfigsKind, opts), &globaltsmtanzuvmwarecomv1.HostConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.HostConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.HostConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.HostConfigList).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 hostConfigs. +func (c *FakeHostConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(hostconfigsResource, opts)) +} + +// Create takes the representation of a hostConfig and creates it. Returns the server's representation of the hostConfig, and an error, if there is any. +func (c *FakeHostConfigs) Create(ctx context.Context, hostConfig *globaltsmtanzuvmwarecomv1.HostConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.HostConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(hostconfigsResource, hostConfig), &globaltsmtanzuvmwarecomv1.HostConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HostConfig), err +} + +// Update takes the representation of a hostConfig and updates it. Returns the server's representation of the hostConfig, and an error, if there is any. +func (c *FakeHostConfigs) Update(ctx context.Context, hostConfig *globaltsmtanzuvmwarecomv1.HostConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.HostConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(hostconfigsResource, hostConfig), &globaltsmtanzuvmwarecomv1.HostConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HostConfig), err +} + +// Delete takes name of the hostConfig and deletes it. Returns an error if one occurs. +func (c *FakeHostConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(hostconfigsResource, name), &globaltsmtanzuvmwarecomv1.HostConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeHostConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(hostconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.HostConfigList{}) + return err +} + +// Patch applies the patch and returns the patched hostConfig. +func (c *FakeHostConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.HostConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(hostconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.HostConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HostConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_hostconfigv2.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_hostconfigv2.go new file mode 100644 index 000000000..93c9e4e83 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_hostconfigv2.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeHostConfigV2s implements HostConfigV2Interface +type FakeHostConfigV2s struct { + Fake *FakeGlobalTsmV1 +} + +var hostconfigv2sResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "hostconfigv2s"} + +var hostconfigv2sKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "HostConfigV2"} + +// Get takes name of the hostConfigV2, and returns the corresponding hostConfigV2 object, and an error if there is any. +func (c *FakeHostConfigV2s) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.HostConfigV2, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(hostconfigv2sResource, name), &globaltsmtanzuvmwarecomv1.HostConfigV2{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HostConfigV2), err +} + +// List takes label and field selectors, and returns the list of HostConfigV2s that match those selectors. +func (c *FakeHostConfigV2s) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.HostConfigV2List, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(hostconfigv2sResource, hostconfigv2sKind, opts), &globaltsmtanzuvmwarecomv1.HostConfigV2List{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.HostConfigV2List{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.HostConfigV2List).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.HostConfigV2List).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 hostConfigV2s. +func (c *FakeHostConfigV2s) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(hostconfigv2sResource, opts)) +} + +// Create takes the representation of a hostConfigV2 and creates it. Returns the server's representation of the hostConfigV2, and an error, if there is any. +func (c *FakeHostConfigV2s) Create(ctx context.Context, hostConfigV2 *globaltsmtanzuvmwarecomv1.HostConfigV2, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.HostConfigV2, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(hostconfigv2sResource, hostConfigV2), &globaltsmtanzuvmwarecomv1.HostConfigV2{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HostConfigV2), err +} + +// Update takes the representation of a hostConfigV2 and updates it. Returns the server's representation of the hostConfigV2, and an error, if there is any. +func (c *FakeHostConfigV2s) Update(ctx context.Context, hostConfigV2 *globaltsmtanzuvmwarecomv1.HostConfigV2, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.HostConfigV2, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(hostconfigv2sResource, hostConfigV2), &globaltsmtanzuvmwarecomv1.HostConfigV2{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HostConfigV2), err +} + +// Delete takes name of the hostConfigV2 and deletes it. Returns an error if one occurs. +func (c *FakeHostConfigV2s) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(hostconfigv2sResource, name), &globaltsmtanzuvmwarecomv1.HostConfigV2{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeHostConfigV2s) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(hostconfigv2sResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.HostConfigV2List{}) + return err +} + +// Patch applies the patch and returns the patched hostConfigV2. +func (c *FakeHostConfigV2s) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.HostConfigV2, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(hostconfigv2sResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.HostConfigV2{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.HostConfigV2), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_inboundauthenticationconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_inboundauthenticationconfig.go new file mode 100644 index 000000000..79c6c0602 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_inboundauthenticationconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeInboundAuthenticationConfigs implements InboundAuthenticationConfigInterface +type FakeInboundAuthenticationConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var inboundauthenticationconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "inboundauthenticationconfigs"} + +var inboundauthenticationconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "InboundAuthenticationConfig"} + +// Get takes name of the inboundAuthenticationConfig, and returns the corresponding inboundAuthenticationConfig object, and an error if there is any. +func (c *FakeInboundAuthenticationConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.InboundAuthenticationConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(inboundauthenticationconfigsResource, name), &globaltsmtanzuvmwarecomv1.InboundAuthenticationConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.InboundAuthenticationConfig), err +} + +// List takes label and field selectors, and returns the list of InboundAuthenticationConfigs that match those selectors. +func (c *FakeInboundAuthenticationConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.InboundAuthenticationConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(inboundauthenticationconfigsResource, inboundauthenticationconfigsKind, opts), &globaltsmtanzuvmwarecomv1.InboundAuthenticationConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.InboundAuthenticationConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.InboundAuthenticationConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.InboundAuthenticationConfigList).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 inboundAuthenticationConfigs. +func (c *FakeInboundAuthenticationConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(inboundauthenticationconfigsResource, opts)) +} + +// Create takes the representation of a inboundAuthenticationConfig and creates it. Returns the server's representation of the inboundAuthenticationConfig, and an error, if there is any. +func (c *FakeInboundAuthenticationConfigs) Create(ctx context.Context, inboundAuthenticationConfig *globaltsmtanzuvmwarecomv1.InboundAuthenticationConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.InboundAuthenticationConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(inboundauthenticationconfigsResource, inboundAuthenticationConfig), &globaltsmtanzuvmwarecomv1.InboundAuthenticationConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.InboundAuthenticationConfig), err +} + +// Update takes the representation of a inboundAuthenticationConfig and updates it. Returns the server's representation of the inboundAuthenticationConfig, and an error, if there is any. +func (c *FakeInboundAuthenticationConfigs) Update(ctx context.Context, inboundAuthenticationConfig *globaltsmtanzuvmwarecomv1.InboundAuthenticationConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.InboundAuthenticationConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(inboundauthenticationconfigsResource, inboundAuthenticationConfig), &globaltsmtanzuvmwarecomv1.InboundAuthenticationConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.InboundAuthenticationConfig), err +} + +// Delete takes name of the inboundAuthenticationConfig and deletes it. Returns an error if one occurs. +func (c *FakeInboundAuthenticationConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(inboundauthenticationconfigsResource, name), &globaltsmtanzuvmwarecomv1.InboundAuthenticationConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeInboundAuthenticationConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(inboundauthenticationconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.InboundAuthenticationConfigList{}) + return err +} + +// Patch applies the patch and returns the patched inboundAuthenticationConfig. +func (c *FakeInboundAuthenticationConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.InboundAuthenticationConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(inboundauthenticationconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.InboundAuthenticationConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.InboundAuthenticationConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_inventory.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_inventory.go new file mode 100644 index 000000000..b5ae4edec --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_inventory.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeInventories implements InventoryInterface +type FakeInventories struct { + Fake *FakeGlobalTsmV1 +} + +var inventoriesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "inventories"} + +var inventoriesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Inventory"} + +// Get takes name of the inventory, and returns the corresponding inventory object, and an error if there is any. +func (c *FakeInventories) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Inventory, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(inventoriesResource, name), &globaltsmtanzuvmwarecomv1.Inventory{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Inventory), err +} + +// List takes label and field selectors, and returns the list of Inventories that match those selectors. +func (c *FakeInventories) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.InventoryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(inventoriesResource, inventoriesKind, opts), &globaltsmtanzuvmwarecomv1.InventoryList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.InventoryList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.InventoryList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.InventoryList).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 inventories. +func (c *FakeInventories) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(inventoriesResource, opts)) +} + +// Create takes the representation of a inventory and creates it. Returns the server's representation of the inventory, and an error, if there is any. +func (c *FakeInventories) Create(ctx context.Context, inventory *globaltsmtanzuvmwarecomv1.Inventory, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Inventory, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(inventoriesResource, inventory), &globaltsmtanzuvmwarecomv1.Inventory{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Inventory), err +} + +// Update takes the representation of a inventory and updates it. Returns the server's representation of the inventory, and an error, if there is any. +func (c *FakeInventories) Update(ctx context.Context, inventory *globaltsmtanzuvmwarecomv1.Inventory, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Inventory, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(inventoriesResource, inventory), &globaltsmtanzuvmwarecomv1.Inventory{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Inventory), err +} + +// Delete takes name of the inventory and deletes it. Returns an error if one occurs. +func (c *FakeInventories) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(inventoriesResource, name), &globaltsmtanzuvmwarecomv1.Inventory{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeInventories) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(inventoriesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.InventoryList{}) + return err +} + +// Patch applies the patch and returns the patched inventory. +func (c *FakeInventories) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Inventory, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(inventoriesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Inventory{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Inventory), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_issuer.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_issuer.go new file mode 100644 index 000000000..a8b8ae144 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_issuer.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeIssuers implements IssuerInterface +type FakeIssuers struct { + Fake *FakeGlobalTsmV1 +} + +var issuersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "issuers"} + +var issuersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Issuer"} + +// Get takes name of the issuer, and returns the corresponding issuer object, and an error if there is any. +func (c *FakeIssuers) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Issuer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(issuersResource, name), &globaltsmtanzuvmwarecomv1.Issuer{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Issuer), err +} + +// List takes label and field selectors, and returns the list of Issuers that match those selectors. +func (c *FakeIssuers) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.IssuerList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(issuersResource, issuersKind, opts), &globaltsmtanzuvmwarecomv1.IssuerList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.IssuerList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.IssuerList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.IssuerList).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 issuers. +func (c *FakeIssuers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(issuersResource, opts)) +} + +// Create takes the representation of a issuer and creates it. Returns the server's representation of the issuer, and an error, if there is any. +func (c *FakeIssuers) Create(ctx context.Context, issuer *globaltsmtanzuvmwarecomv1.Issuer, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Issuer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(issuersResource, issuer), &globaltsmtanzuvmwarecomv1.Issuer{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Issuer), err +} + +// Update takes the representation of a issuer and updates it. Returns the server's representation of the issuer, and an error, if there is any. +func (c *FakeIssuers) Update(ctx context.Context, issuer *globaltsmtanzuvmwarecomv1.Issuer, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Issuer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(issuersResource, issuer), &globaltsmtanzuvmwarecomv1.Issuer{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Issuer), err +} + +// Delete takes name of the issuer and deletes it. Returns an error if one occurs. +func (c *FakeIssuers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(issuersResource, name), &globaltsmtanzuvmwarecomv1.Issuer{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeIssuers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(issuersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.IssuerList{}) + return err +} + +// Patch applies the patch and returns the patched issuer. +func (c *FakeIssuers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Issuer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(issuersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Issuer{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Issuer), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_job.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_job.go new file mode 100644 index 000000000..503fa14db --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_job.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeJobs implements JobInterface +type FakeJobs struct { + Fake *FakeGlobalTsmV1 +} + +var jobsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "jobs"} + +var jobsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Job"} + +// Get takes name of the job, and returns the corresponding job object, and an error if there is any. +func (c *FakeJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Job, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(jobsResource, name), &globaltsmtanzuvmwarecomv1.Job{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Job), err +} + +// List takes label and field selectors, and returns the list of Jobs that match those selectors. +func (c *FakeJobs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.JobList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(jobsResource, jobsKind, opts), &globaltsmtanzuvmwarecomv1.JobList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.JobList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.JobList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.JobList).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 jobs. +func (c *FakeJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(jobsResource, opts)) +} + +// Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any. +func (c *FakeJobs) Create(ctx context.Context, job *globaltsmtanzuvmwarecomv1.Job, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Job, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(jobsResource, job), &globaltsmtanzuvmwarecomv1.Job{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Job), err +} + +// Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any. +func (c *FakeJobs) Update(ctx context.Context, job *globaltsmtanzuvmwarecomv1.Job, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Job, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(jobsResource, job), &globaltsmtanzuvmwarecomv1.Job{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Job), err +} + +// Delete takes name of the job and deletes it. Returns an error if one occurs. +func (c *FakeJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(jobsResource, name), &globaltsmtanzuvmwarecomv1.Job{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(jobsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.JobList{}) + return err +} + +// Patch applies the patch and returns the patched job. +func (c *FakeJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Job, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(jobsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Job{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Job), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_jobconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_jobconfig.go new file mode 100644 index 000000000..6cd26cea7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_jobconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeJobConfigs implements JobConfigInterface +type FakeJobConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var jobconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "jobconfigs"} + +var jobconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "JobConfig"} + +// Get takes name of the jobConfig, and returns the corresponding jobConfig object, and an error if there is any. +func (c *FakeJobConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.JobConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(jobconfigsResource, name), &globaltsmtanzuvmwarecomv1.JobConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.JobConfig), err +} + +// List takes label and field selectors, and returns the list of JobConfigs that match those selectors. +func (c *FakeJobConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.JobConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(jobconfigsResource, jobconfigsKind, opts), &globaltsmtanzuvmwarecomv1.JobConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.JobConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.JobConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.JobConfigList).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 jobConfigs. +func (c *FakeJobConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(jobconfigsResource, opts)) +} + +// Create takes the representation of a jobConfig and creates it. Returns the server's representation of the jobConfig, and an error, if there is any. +func (c *FakeJobConfigs) Create(ctx context.Context, jobConfig *globaltsmtanzuvmwarecomv1.JobConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.JobConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(jobconfigsResource, jobConfig), &globaltsmtanzuvmwarecomv1.JobConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.JobConfig), err +} + +// Update takes the representation of a jobConfig and updates it. Returns the server's representation of the jobConfig, and an error, if there is any. +func (c *FakeJobConfigs) Update(ctx context.Context, jobConfig *globaltsmtanzuvmwarecomv1.JobConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.JobConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(jobconfigsResource, jobConfig), &globaltsmtanzuvmwarecomv1.JobConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.JobConfig), err +} + +// Delete takes name of the jobConfig and deletes it. Returns an error if one occurs. +func (c *FakeJobConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(jobconfigsResource, name), &globaltsmtanzuvmwarecomv1.JobConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeJobConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(jobconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.JobConfigList{}) + return err +} + +// Patch applies the patch and returns the patched jobConfig. +func (c *FakeJobConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.JobConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(jobconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.JobConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.JobConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_jobconfigfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_jobconfigfolder.go new file mode 100644 index 000000000..506cbfa22 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_jobconfigfolder.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeJobConfigFolders implements JobConfigFolderInterface +type FakeJobConfigFolders struct { + Fake *FakeGlobalTsmV1 +} + +var jobconfigfoldersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "jobconfigfolders"} + +var jobconfigfoldersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "JobConfigFolder"} + +// Get takes name of the jobConfigFolder, and returns the corresponding jobConfigFolder object, and an error if there is any. +func (c *FakeJobConfigFolders) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.JobConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(jobconfigfoldersResource, name), &globaltsmtanzuvmwarecomv1.JobConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.JobConfigFolder), err +} + +// List takes label and field selectors, and returns the list of JobConfigFolders that match those selectors. +func (c *FakeJobConfigFolders) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.JobConfigFolderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(jobconfigfoldersResource, jobconfigfoldersKind, opts), &globaltsmtanzuvmwarecomv1.JobConfigFolderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.JobConfigFolderList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.JobConfigFolderList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.JobConfigFolderList).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 jobConfigFolders. +func (c *FakeJobConfigFolders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(jobconfigfoldersResource, opts)) +} + +// Create takes the representation of a jobConfigFolder and creates it. Returns the server's representation of the jobConfigFolder, and an error, if there is any. +func (c *FakeJobConfigFolders) Create(ctx context.Context, jobConfigFolder *globaltsmtanzuvmwarecomv1.JobConfigFolder, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.JobConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(jobconfigfoldersResource, jobConfigFolder), &globaltsmtanzuvmwarecomv1.JobConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.JobConfigFolder), err +} + +// Update takes the representation of a jobConfigFolder and updates it. Returns the server's representation of the jobConfigFolder, and an error, if there is any. +func (c *FakeJobConfigFolders) Update(ctx context.Context, jobConfigFolder *globaltsmtanzuvmwarecomv1.JobConfigFolder, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.JobConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(jobconfigfoldersResource, jobConfigFolder), &globaltsmtanzuvmwarecomv1.JobConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.JobConfigFolder), err +} + +// Delete takes name of the jobConfigFolder and deletes it. Returns an error if one occurs. +func (c *FakeJobConfigFolders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(jobconfigfoldersResource, name), &globaltsmtanzuvmwarecomv1.JobConfigFolder{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeJobConfigFolders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(jobconfigfoldersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.JobConfigFolderList{}) + return err +} + +// Patch applies the patch and returns the patched jobConfigFolder. +func (c *FakeJobConfigFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.JobConfigFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(jobconfigfoldersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.JobConfigFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.JobConfigFolder), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_jobfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_jobfolder.go new file mode 100644 index 000000000..dff9e8381 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_jobfolder.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeJobFolders implements JobFolderInterface +type FakeJobFolders struct { + Fake *FakeGlobalTsmV1 +} + +var jobfoldersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "jobfolders"} + +var jobfoldersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "JobFolder"} + +// Get takes name of the jobFolder, and returns the corresponding jobFolder object, and an error if there is any. +func (c *FakeJobFolders) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.JobFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(jobfoldersResource, name), &globaltsmtanzuvmwarecomv1.JobFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.JobFolder), err +} + +// List takes label and field selectors, and returns the list of JobFolders that match those selectors. +func (c *FakeJobFolders) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.JobFolderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(jobfoldersResource, jobfoldersKind, opts), &globaltsmtanzuvmwarecomv1.JobFolderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.JobFolderList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.JobFolderList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.JobFolderList).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 jobFolders. +func (c *FakeJobFolders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(jobfoldersResource, opts)) +} + +// Create takes the representation of a jobFolder and creates it. Returns the server's representation of the jobFolder, and an error, if there is any. +func (c *FakeJobFolders) Create(ctx context.Context, jobFolder *globaltsmtanzuvmwarecomv1.JobFolder, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.JobFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(jobfoldersResource, jobFolder), &globaltsmtanzuvmwarecomv1.JobFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.JobFolder), err +} + +// Update takes the representation of a jobFolder and updates it. Returns the server's representation of the jobFolder, and an error, if there is any. +func (c *FakeJobFolders) Update(ctx context.Context, jobFolder *globaltsmtanzuvmwarecomv1.JobFolder, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.JobFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(jobfoldersResource, jobFolder), &globaltsmtanzuvmwarecomv1.JobFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.JobFolder), err +} + +// Delete takes name of the jobFolder and deletes it. Returns an error if one occurs. +func (c *FakeJobFolders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(jobfoldersResource, name), &globaltsmtanzuvmwarecomv1.JobFolder{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeJobFolders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(jobfoldersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.JobFolderList{}) + return err +} + +// Patch applies the patch and returns the patched jobFolder. +func (c *FakeJobFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.JobFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(jobfoldersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.JobFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.JobFolder), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_knativeingress.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_knativeingress.go new file mode 100644 index 000000000..be129b78e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_knativeingress.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeKnativeIngresses implements KnativeIngressInterface +type FakeKnativeIngresses struct { + Fake *FakeGlobalTsmV1 +} + +var knativeingressesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "knativeingresses"} + +var knativeingressesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "KnativeIngress"} + +// Get takes name of the knativeIngress, and returns the corresponding knativeIngress object, and an error if there is any. +func (c *FakeKnativeIngresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.KnativeIngress, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(knativeingressesResource, name), &globaltsmtanzuvmwarecomv1.KnativeIngress{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.KnativeIngress), err +} + +// List takes label and field selectors, and returns the list of KnativeIngresses that match those selectors. +func (c *FakeKnativeIngresses) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.KnativeIngressList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(knativeingressesResource, knativeingressesKind, opts), &globaltsmtanzuvmwarecomv1.KnativeIngressList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.KnativeIngressList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.KnativeIngressList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.KnativeIngressList).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 knativeIngresses. +func (c *FakeKnativeIngresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(knativeingressesResource, opts)) +} + +// Create takes the representation of a knativeIngress and creates it. Returns the server's representation of the knativeIngress, and an error, if there is any. +func (c *FakeKnativeIngresses) Create(ctx context.Context, knativeIngress *globaltsmtanzuvmwarecomv1.KnativeIngress, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.KnativeIngress, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(knativeingressesResource, knativeIngress), &globaltsmtanzuvmwarecomv1.KnativeIngress{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.KnativeIngress), err +} + +// Update takes the representation of a knativeIngress and updates it. Returns the server's representation of the knativeIngress, and an error, if there is any. +func (c *FakeKnativeIngresses) Update(ctx context.Context, knativeIngress *globaltsmtanzuvmwarecomv1.KnativeIngress, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.KnativeIngress, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(knativeingressesResource, knativeIngress), &globaltsmtanzuvmwarecomv1.KnativeIngress{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.KnativeIngress), err +} + +// Delete takes name of the knativeIngress and deletes it. Returns an error if one occurs. +func (c *FakeKnativeIngresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(knativeingressesResource, name), &globaltsmtanzuvmwarecomv1.KnativeIngress{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeKnativeIngresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(knativeingressesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.KnativeIngressList{}) + return err +} + +// Patch applies the patch and returns the patched knativeIngress. +func (c *FakeKnativeIngresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.KnativeIngress, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(knativeingressesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.KnativeIngress{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.KnativeIngress), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_labelconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_labelconfig.go new file mode 100644 index 000000000..de4cae313 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_labelconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeLabelConfigs implements LabelConfigInterface +type FakeLabelConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var labelconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "labelconfigs"} + +var labelconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "LabelConfig"} + +// Get takes name of the labelConfig, and returns the corresponding labelConfig object, and an error if there is any. +func (c *FakeLabelConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.LabelConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(labelconfigsResource, name), &globaltsmtanzuvmwarecomv1.LabelConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LabelConfig), err +} + +// List takes label and field selectors, and returns the list of LabelConfigs that match those selectors. +func (c *FakeLabelConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.LabelConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(labelconfigsResource, labelconfigsKind, opts), &globaltsmtanzuvmwarecomv1.LabelConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.LabelConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.LabelConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.LabelConfigList).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 labelConfigs. +func (c *FakeLabelConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(labelconfigsResource, opts)) +} + +// Create takes the representation of a labelConfig and creates it. Returns the server's representation of the labelConfig, and an error, if there is any. +func (c *FakeLabelConfigs) Create(ctx context.Context, labelConfig *globaltsmtanzuvmwarecomv1.LabelConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.LabelConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(labelconfigsResource, labelConfig), &globaltsmtanzuvmwarecomv1.LabelConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LabelConfig), err +} + +// Update takes the representation of a labelConfig and updates it. Returns the server's representation of the labelConfig, and an error, if there is any. +func (c *FakeLabelConfigs) Update(ctx context.Context, labelConfig *globaltsmtanzuvmwarecomv1.LabelConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.LabelConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(labelconfigsResource, labelConfig), &globaltsmtanzuvmwarecomv1.LabelConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LabelConfig), err +} + +// Delete takes name of the labelConfig and deletes it. Returns an error if one occurs. +func (c *FakeLabelConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(labelconfigsResource, name), &globaltsmtanzuvmwarecomv1.LabelConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeLabelConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(labelconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.LabelConfigList{}) + return err +} + +// Patch applies the patch and returns the patched labelConfig. +func (c *FakeLabelConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.LabelConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(labelconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.LabelConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LabelConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_localregistrationservice.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_localregistrationservice.go new file mode 100644 index 000000000..3b9518ef1 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_localregistrationservice.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeLocalRegistrationServices implements LocalRegistrationServiceInterface +type FakeLocalRegistrationServices struct { + Fake *FakeGlobalTsmV1 +} + +var localregistrationservicesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "localregistrationservices"} + +var localregistrationservicesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "LocalRegistrationService"} + +// Get takes name of the localRegistrationService, and returns the corresponding localRegistrationService object, and an error if there is any. +func (c *FakeLocalRegistrationServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.LocalRegistrationService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(localregistrationservicesResource, name), &globaltsmtanzuvmwarecomv1.LocalRegistrationService{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationService), err +} + +// List takes label and field selectors, and returns the list of LocalRegistrationServices that match those selectors. +func (c *FakeLocalRegistrationServices) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.LocalRegistrationServiceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(localregistrationservicesResource, localregistrationservicesKind, opts), &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationServiceList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationServiceList).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 localRegistrationServices. +func (c *FakeLocalRegistrationServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(localregistrationservicesResource, opts)) +} + +// Create takes the representation of a localRegistrationService and creates it. Returns the server's representation of the localRegistrationService, and an error, if there is any. +func (c *FakeLocalRegistrationServices) Create(ctx context.Context, localRegistrationService *globaltsmtanzuvmwarecomv1.LocalRegistrationService, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.LocalRegistrationService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(localregistrationservicesResource, localRegistrationService), &globaltsmtanzuvmwarecomv1.LocalRegistrationService{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationService), err +} + +// Update takes the representation of a localRegistrationService and updates it. Returns the server's representation of the localRegistrationService, and an error, if there is any. +func (c *FakeLocalRegistrationServices) Update(ctx context.Context, localRegistrationService *globaltsmtanzuvmwarecomv1.LocalRegistrationService, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.LocalRegistrationService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(localregistrationservicesResource, localRegistrationService), &globaltsmtanzuvmwarecomv1.LocalRegistrationService{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationService), err +} + +// Delete takes name of the localRegistrationService and deletes it. Returns an error if one occurs. +func (c *FakeLocalRegistrationServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(localregistrationservicesResource, name), &globaltsmtanzuvmwarecomv1.LocalRegistrationService{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeLocalRegistrationServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(localregistrationservicesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceList{}) + return err +} + +// Patch applies the patch and returns the patched localRegistrationService. +func (c *FakeLocalRegistrationServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.LocalRegistrationService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(localregistrationservicesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.LocalRegistrationService{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationService), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_localregistrationservicecluster.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_localregistrationservicecluster.go new file mode 100644 index 000000000..3dc8c0191 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_localregistrationservicecluster.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeLocalRegistrationServiceClusters implements LocalRegistrationServiceClusterInterface +type FakeLocalRegistrationServiceClusters struct { + Fake *FakeGlobalTsmV1 +} + +var localregistrationserviceclustersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "localregistrationserviceclusters"} + +var localregistrationserviceclustersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "LocalRegistrationServiceCluster"} + +// Get takes name of the localRegistrationServiceCluster, and returns the corresponding localRegistrationServiceCluster object, and an error if there is any. +func (c *FakeLocalRegistrationServiceClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(localregistrationserviceclustersResource, name), &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster), err +} + +// List takes label and field selectors, and returns the list of LocalRegistrationServiceClusters that match those selectors. +func (c *FakeLocalRegistrationServiceClusters) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.LocalRegistrationServiceClusterList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(localregistrationserviceclustersResource, localregistrationserviceclustersKind, opts), &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceClusterList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceClusterList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationServiceClusterList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationServiceClusterList).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 localRegistrationServiceClusters. +func (c *FakeLocalRegistrationServiceClusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(localregistrationserviceclustersResource, opts)) +} + +// Create takes the representation of a localRegistrationServiceCluster and creates it. Returns the server's representation of the localRegistrationServiceCluster, and an error, if there is any. +func (c *FakeLocalRegistrationServiceClusters) Create(ctx context.Context, localRegistrationServiceCluster *globaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(localregistrationserviceclustersResource, localRegistrationServiceCluster), &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster), err +} + +// Update takes the representation of a localRegistrationServiceCluster and updates it. Returns the server's representation of the localRegistrationServiceCluster, and an error, if there is any. +func (c *FakeLocalRegistrationServiceClusters) Update(ctx context.Context, localRegistrationServiceCluster *globaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(localregistrationserviceclustersResource, localRegistrationServiceCluster), &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster), err +} + +// Delete takes name of the localRegistrationServiceCluster and deletes it. Returns an error if one occurs. +func (c *FakeLocalRegistrationServiceClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(localregistrationserviceclustersResource, name), &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeLocalRegistrationServiceClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(localregistrationserviceclustersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceClusterList{}) + return err +} + +// Patch applies the patch and returns the patched localRegistrationServiceCluster. +func (c *FakeLocalRegistrationServiceClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(localregistrationserviceclustersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_localregistrationserviceresource.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_localregistrationserviceresource.go new file mode 100644 index 000000000..54bf6512d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_localregistrationserviceresource.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeLocalRegistrationServiceResources implements LocalRegistrationServiceResourceInterface +type FakeLocalRegistrationServiceResources struct { + Fake *FakeGlobalTsmV1 +} + +var localregistrationserviceresourcesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "localregistrationserviceresources"} + +var localregistrationserviceresourcesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "LocalRegistrationServiceResource"} + +// Get takes name of the localRegistrationServiceResource, and returns the corresponding localRegistrationServiceResource object, and an error if there is any. +func (c *FakeLocalRegistrationServiceResources) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(localregistrationserviceresourcesResource, name), &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource), err +} + +// List takes label and field selectors, and returns the list of LocalRegistrationServiceResources that match those selectors. +func (c *FakeLocalRegistrationServiceResources) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResourceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(localregistrationserviceresourcesResource, localregistrationserviceresourcesKind, opts), &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResourceList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResourceList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResourceList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResourceList).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 localRegistrationServiceResources. +func (c *FakeLocalRegistrationServiceResources) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(localregistrationserviceresourcesResource, opts)) +} + +// Create takes the representation of a localRegistrationServiceResource and creates it. Returns the server's representation of the localRegistrationServiceResource, and an error, if there is any. +func (c *FakeLocalRegistrationServiceResources) Create(ctx context.Context, localRegistrationServiceResource *globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(localregistrationserviceresourcesResource, localRegistrationServiceResource), &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource), err +} + +// Update takes the representation of a localRegistrationServiceResource and updates it. Returns the server's representation of the localRegistrationServiceResource, and an error, if there is any. +func (c *FakeLocalRegistrationServiceResources) Update(ctx context.Context, localRegistrationServiceResource *globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(localregistrationserviceresourcesResource, localRegistrationServiceResource), &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource), err +} + +// Delete takes name of the localRegistrationServiceResource and deletes it. Returns an error if one occurs. +func (c *FakeLocalRegistrationServiceResources) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(localregistrationserviceresourcesResource, name), &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeLocalRegistrationServiceResources) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(localregistrationserviceresourcesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResourceList{}) + return err +} + +// Patch applies the patch and returns the patched localRegistrationServiceResource. +func (c *FakeLocalRegistrationServiceResources) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(localregistrationserviceresourcesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_log.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_log.go new file mode 100644 index 000000000..191922dd0 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_log.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeLogs implements LogInterface +type FakeLogs struct { + Fake *FakeGlobalTsmV1 +} + +var logsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "logs"} + +var logsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Log"} + +// Get takes name of the log, and returns the corresponding log object, and an error if there is any. +func (c *FakeLogs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Log, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(logsResource, name), &globaltsmtanzuvmwarecomv1.Log{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Log), err +} + +// List takes label and field selectors, and returns the list of Logs that match those selectors. +func (c *FakeLogs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.LogList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(logsResource, logsKind, opts), &globaltsmtanzuvmwarecomv1.LogList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.LogList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.LogList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.LogList).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 logs. +func (c *FakeLogs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(logsResource, opts)) +} + +// Create takes the representation of a log and creates it. Returns the server's representation of the log, and an error, if there is any. +func (c *FakeLogs) Create(ctx context.Context, log *globaltsmtanzuvmwarecomv1.Log, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Log, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(logsResource, log), &globaltsmtanzuvmwarecomv1.Log{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Log), err +} + +// Update takes the representation of a log and updates it. Returns the server's representation of the log, and an error, if there is any. +func (c *FakeLogs) Update(ctx context.Context, log *globaltsmtanzuvmwarecomv1.Log, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Log, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(logsResource, log), &globaltsmtanzuvmwarecomv1.Log{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Log), err +} + +// Delete takes name of the log and deletes it. Returns an error if one occurs. +func (c *FakeLogs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(logsResource, name), &globaltsmtanzuvmwarecomv1.Log{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeLogs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(logsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.LogList{}) + return err +} + +// Patch applies the patch and returns the patched log. +func (c *FakeLogs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Log, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(logsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Log{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Log), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_logfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_logfolder.go new file mode 100644 index 000000000..e748b9beb --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_logfolder.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeLogFolders implements LogFolderInterface +type FakeLogFolders struct { + Fake *FakeGlobalTsmV1 +} + +var logfoldersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "logfolders"} + +var logfoldersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "LogFolder"} + +// Get takes name of the logFolder, and returns the corresponding logFolder object, and an error if there is any. +func (c *FakeLogFolders) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.LogFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(logfoldersResource, name), &globaltsmtanzuvmwarecomv1.LogFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LogFolder), err +} + +// List takes label and field selectors, and returns the list of LogFolders that match those selectors. +func (c *FakeLogFolders) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.LogFolderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(logfoldersResource, logfoldersKind, opts), &globaltsmtanzuvmwarecomv1.LogFolderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.LogFolderList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.LogFolderList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.LogFolderList).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 logFolders. +func (c *FakeLogFolders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(logfoldersResource, opts)) +} + +// Create takes the representation of a logFolder and creates it. Returns the server's representation of the logFolder, and an error, if there is any. +func (c *FakeLogFolders) Create(ctx context.Context, logFolder *globaltsmtanzuvmwarecomv1.LogFolder, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.LogFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(logfoldersResource, logFolder), &globaltsmtanzuvmwarecomv1.LogFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LogFolder), err +} + +// Update takes the representation of a logFolder and updates it. Returns the server's representation of the logFolder, and an error, if there is any. +func (c *FakeLogFolders) Update(ctx context.Context, logFolder *globaltsmtanzuvmwarecomv1.LogFolder, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.LogFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(logfoldersResource, logFolder), &globaltsmtanzuvmwarecomv1.LogFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LogFolder), err +} + +// Delete takes name of the logFolder and deletes it. Returns an error if one occurs. +func (c *FakeLogFolders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(logfoldersResource, name), &globaltsmtanzuvmwarecomv1.LogFolder{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeLogFolders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(logfoldersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.LogFolderList{}) + return err +} + +// Patch applies the patch and returns the patched logFolder. +func (c *FakeLogFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.LogFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(logfoldersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.LogFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.LogFolder), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_metricmonitor.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_metricmonitor.go new file mode 100644 index 000000000..87f03e881 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_metricmonitor.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeMetricMonitors implements MetricMonitorInterface +type FakeMetricMonitors struct { + Fake *FakeGlobalTsmV1 +} + +var metricmonitorsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "metricmonitors"} + +var metricmonitorsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "MetricMonitor"} + +// Get takes name of the metricMonitor, and returns the corresponding metricMonitor object, and an error if there is any. +func (c *FakeMetricMonitors) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.MetricMonitor, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(metricmonitorsResource, name), &globaltsmtanzuvmwarecomv1.MetricMonitor{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.MetricMonitor), err +} + +// List takes label and field selectors, and returns the list of MetricMonitors that match those selectors. +func (c *FakeMetricMonitors) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.MetricMonitorList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(metricmonitorsResource, metricmonitorsKind, opts), &globaltsmtanzuvmwarecomv1.MetricMonitorList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.MetricMonitorList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.MetricMonitorList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.MetricMonitorList).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 metricMonitors. +func (c *FakeMetricMonitors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(metricmonitorsResource, opts)) +} + +// Create takes the representation of a metricMonitor and creates it. Returns the server's representation of the metricMonitor, and an error, if there is any. +func (c *FakeMetricMonitors) Create(ctx context.Context, metricMonitor *globaltsmtanzuvmwarecomv1.MetricMonitor, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.MetricMonitor, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(metricmonitorsResource, metricMonitor), &globaltsmtanzuvmwarecomv1.MetricMonitor{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.MetricMonitor), err +} + +// Update takes the representation of a metricMonitor and updates it. Returns the server's representation of the metricMonitor, and an error, if there is any. +func (c *FakeMetricMonitors) Update(ctx context.Context, metricMonitor *globaltsmtanzuvmwarecomv1.MetricMonitor, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.MetricMonitor, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(metricmonitorsResource, metricMonitor), &globaltsmtanzuvmwarecomv1.MetricMonitor{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.MetricMonitor), err +} + +// Delete takes name of the metricMonitor and deletes it. Returns an error if one occurs. +func (c *FakeMetricMonitors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(metricmonitorsResource, name), &globaltsmtanzuvmwarecomv1.MetricMonitor{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeMetricMonitors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(metricmonitorsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.MetricMonitorList{}) + return err +} + +// Patch applies the patch and returns the patched metricMonitor. +func (c *FakeMetricMonitors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.MetricMonitor, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(metricmonitorsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.MetricMonitor{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.MetricMonitor), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_networkattachmentdefinition.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_networkattachmentdefinition.go new file mode 100644 index 000000000..5268cc788 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_networkattachmentdefinition.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeNetworkAttachmentDefinitions implements NetworkAttachmentDefinitionInterface +type FakeNetworkAttachmentDefinitions struct { + Fake *FakeGlobalTsmV1 +} + +var networkattachmentdefinitionsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "networkattachmentdefinitions"} + +var networkattachmentdefinitionsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "NetworkAttachmentDefinition"} + +// Get takes name of the networkAttachmentDefinition, and returns the corresponding networkAttachmentDefinition object, and an error if there is any. +func (c *FakeNetworkAttachmentDefinitions) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(networkattachmentdefinitionsResource, name), &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition), err +} + +// List takes label and field selectors, and returns the list of NetworkAttachmentDefinitions that match those selectors. +func (c *FakeNetworkAttachmentDefinitions) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(networkattachmentdefinitionsResource, networkattachmentdefinitionsKind, opts), &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionList).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 networkAttachmentDefinitions. +func (c *FakeNetworkAttachmentDefinitions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(networkattachmentdefinitionsResource, opts)) +} + +// Create takes the representation of a networkAttachmentDefinition and creates it. Returns the server's representation of the networkAttachmentDefinition, and an error, if there is any. +func (c *FakeNetworkAttachmentDefinitions) Create(ctx context.Context, networkAttachmentDefinition *globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(networkattachmentdefinitionsResource, networkAttachmentDefinition), &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition), err +} + +// Update takes the representation of a networkAttachmentDefinition and updates it. Returns the server's representation of the networkAttachmentDefinition, and an error, if there is any. +func (c *FakeNetworkAttachmentDefinitions) Update(ctx context.Context, networkAttachmentDefinition *globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(networkattachmentdefinitionsResource, networkAttachmentDefinition), &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition), err +} + +// Delete takes name of the networkAttachmentDefinition and deletes it. Returns an error if one occurs. +func (c *FakeNetworkAttachmentDefinitions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(networkattachmentdefinitionsResource, name), &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNetworkAttachmentDefinitions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(networkattachmentdefinitionsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionList{}) + return err +} + +// Patch applies the patch and returns the patched networkAttachmentDefinition. +func (c *FakeNetworkAttachmentDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(networkattachmentdefinitionsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_networkattachmentdefinitionconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_networkattachmentdefinitionconfig.go new file mode 100644 index 000000000..5c7c6d186 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_networkattachmentdefinitionconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeNetworkAttachmentDefinitionConfigs implements NetworkAttachmentDefinitionConfigInterface +type FakeNetworkAttachmentDefinitionConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var networkattachmentdefinitionconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "networkattachmentdefinitionconfigs"} + +var networkattachmentdefinitionconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "NetworkAttachmentDefinitionConfig"} + +// Get takes name of the networkAttachmentDefinitionConfig, and returns the corresponding networkAttachmentDefinitionConfig object, and an error if there is any. +func (c *FakeNetworkAttachmentDefinitionConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(networkattachmentdefinitionconfigsResource, name), &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig), err +} + +// List takes label and field selectors, and returns the list of NetworkAttachmentDefinitionConfigs that match those selectors. +func (c *FakeNetworkAttachmentDefinitionConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(networkattachmentdefinitionconfigsResource, networkattachmentdefinitionconfigsKind, opts), &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfigList).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 networkAttachmentDefinitionConfigs. +func (c *FakeNetworkAttachmentDefinitionConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(networkattachmentdefinitionconfigsResource, opts)) +} + +// Create takes the representation of a networkAttachmentDefinitionConfig and creates it. Returns the server's representation of the networkAttachmentDefinitionConfig, and an error, if there is any. +func (c *FakeNetworkAttachmentDefinitionConfigs) Create(ctx context.Context, networkAttachmentDefinitionConfig *globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(networkattachmentdefinitionconfigsResource, networkAttachmentDefinitionConfig), &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig), err +} + +// Update takes the representation of a networkAttachmentDefinitionConfig and updates it. Returns the server's representation of the networkAttachmentDefinitionConfig, and an error, if there is any. +func (c *FakeNetworkAttachmentDefinitionConfigs) Update(ctx context.Context, networkAttachmentDefinitionConfig *globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(networkattachmentdefinitionconfigsResource, networkAttachmentDefinitionConfig), &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig), err +} + +// Delete takes name of the networkAttachmentDefinitionConfig and deletes it. Returns an error if one occurs. +func (c *FakeNetworkAttachmentDefinitionConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(networkattachmentdefinitionconfigsResource, name), &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNetworkAttachmentDefinitionConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(networkattachmentdefinitionconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfigList{}) + return err +} + +// Patch applies the patch and returns the patched networkAttachmentDefinitionConfig. +func (c *FakeNetworkAttachmentDefinitionConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(networkattachmentdefinitionconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_node.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_node.go new file mode 100644 index 000000000..1f1736243 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_node.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeNodes implements NodeInterface +type FakeNodes struct { + Fake *FakeGlobalTsmV1 +} + +var nodesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "nodes"} + +var nodesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Node"} + +// Get takes name of the node, and returns the corresponding node object, and an error if there is any. +func (c *FakeNodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Node, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(nodesResource, name), &globaltsmtanzuvmwarecomv1.Node{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Node), err +} + +// List takes label and field selectors, and returns the list of Nodes that match those selectors. +func (c *FakeNodes) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.NodeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(nodesResource, nodesKind, opts), &globaltsmtanzuvmwarecomv1.NodeList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.NodeList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.NodeList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.NodeList).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 nodes. +func (c *FakeNodes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(nodesResource, opts)) +} + +// Create takes the representation of a node and creates it. Returns the server's representation of the node, and an error, if there is any. +func (c *FakeNodes) Create(ctx context.Context, node *globaltsmtanzuvmwarecomv1.Node, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Node, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(nodesResource, node), &globaltsmtanzuvmwarecomv1.Node{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Node), err +} + +// Update takes the representation of a node and updates it. Returns the server's representation of the node, and an error, if there is any. +func (c *FakeNodes) Update(ctx context.Context, node *globaltsmtanzuvmwarecomv1.Node, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Node, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(nodesResource, node), &globaltsmtanzuvmwarecomv1.Node{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Node), err +} + +// Delete takes name of the node and deletes it. Returns an error if one occurs. +func (c *FakeNodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(nodesResource, name), &globaltsmtanzuvmwarecomv1.Node{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(nodesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.NodeList{}) + return err +} + +// Patch applies the patch and returns the patched node. +func (c *FakeNodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Node, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(nodesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Node{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Node), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodedefinition.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodedefinition.go new file mode 100644 index 000000000..cad03d639 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodedefinition.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeNodeDefinitions implements NodeDefinitionInterface +type FakeNodeDefinitions struct { + Fake *FakeGlobalTsmV1 +} + +var nodedefinitionsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "nodedefinitions"} + +var nodedefinitionsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "NodeDefinition"} + +// Get takes name of the nodeDefinition, and returns the corresponding nodeDefinition object, and an error if there is any. +func (c *FakeNodeDefinitions) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.NodeDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(nodedefinitionsResource, name), &globaltsmtanzuvmwarecomv1.NodeDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeDefinition), err +} + +// List takes label and field selectors, and returns the list of NodeDefinitions that match those selectors. +func (c *FakeNodeDefinitions) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.NodeDefinitionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(nodedefinitionsResource, nodedefinitionsKind, opts), &globaltsmtanzuvmwarecomv1.NodeDefinitionList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.NodeDefinitionList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.NodeDefinitionList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.NodeDefinitionList).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 nodeDefinitions. +func (c *FakeNodeDefinitions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(nodedefinitionsResource, opts)) +} + +// Create takes the representation of a nodeDefinition and creates it. Returns the server's representation of the nodeDefinition, and an error, if there is any. +func (c *FakeNodeDefinitions) Create(ctx context.Context, nodeDefinition *globaltsmtanzuvmwarecomv1.NodeDefinition, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.NodeDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(nodedefinitionsResource, nodeDefinition), &globaltsmtanzuvmwarecomv1.NodeDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeDefinition), err +} + +// Update takes the representation of a nodeDefinition and updates it. Returns the server's representation of the nodeDefinition, and an error, if there is any. +func (c *FakeNodeDefinitions) Update(ctx context.Context, nodeDefinition *globaltsmtanzuvmwarecomv1.NodeDefinition, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.NodeDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(nodedefinitionsResource, nodeDefinition), &globaltsmtanzuvmwarecomv1.NodeDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeDefinition), err +} + +// Delete takes name of the nodeDefinition and deletes it. Returns an error if one occurs. +func (c *FakeNodeDefinitions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(nodedefinitionsResource, name), &globaltsmtanzuvmwarecomv1.NodeDefinition{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNodeDefinitions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(nodedefinitionsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.NodeDefinitionList{}) + return err +} + +// Patch applies the patch and returns the patched nodeDefinition. +func (c *FakeNodeDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.NodeDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(nodedefinitionsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.NodeDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeDefinition), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodefolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodefolder.go new file mode 100644 index 000000000..e41d3bfe6 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodefolder.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeNodeFolders implements NodeFolderInterface +type FakeNodeFolders struct { + Fake *FakeGlobalTsmV1 +} + +var nodefoldersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "nodefolders"} + +var nodefoldersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "NodeFolder"} + +// Get takes name of the nodeFolder, and returns the corresponding nodeFolder object, and an error if there is any. +func (c *FakeNodeFolders) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.NodeFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(nodefoldersResource, name), &globaltsmtanzuvmwarecomv1.NodeFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeFolder), err +} + +// List takes label and field selectors, and returns the list of NodeFolders that match those selectors. +func (c *FakeNodeFolders) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.NodeFolderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(nodefoldersResource, nodefoldersKind, opts), &globaltsmtanzuvmwarecomv1.NodeFolderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.NodeFolderList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.NodeFolderList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.NodeFolderList).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 nodeFolders. +func (c *FakeNodeFolders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(nodefoldersResource, opts)) +} + +// Create takes the representation of a nodeFolder and creates it. Returns the server's representation of the nodeFolder, and an error, if there is any. +func (c *FakeNodeFolders) Create(ctx context.Context, nodeFolder *globaltsmtanzuvmwarecomv1.NodeFolder, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.NodeFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(nodefoldersResource, nodeFolder), &globaltsmtanzuvmwarecomv1.NodeFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeFolder), err +} + +// Update takes the representation of a nodeFolder and updates it. Returns the server's representation of the nodeFolder, and an error, if there is any. +func (c *FakeNodeFolders) Update(ctx context.Context, nodeFolder *globaltsmtanzuvmwarecomv1.NodeFolder, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.NodeFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(nodefoldersResource, nodeFolder), &globaltsmtanzuvmwarecomv1.NodeFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeFolder), err +} + +// Delete takes name of the nodeFolder and deletes it. Returns an error if one occurs. +func (c *FakeNodeFolders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(nodefoldersResource, name), &globaltsmtanzuvmwarecomv1.NodeFolder{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNodeFolders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(nodefoldersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.NodeFolderList{}) + return err +} + +// Patch applies the patch and returns the patched nodeFolder. +func (c *FakeNodeFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.NodeFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(nodefoldersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.NodeFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeFolder), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodefoldercluster.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodefoldercluster.go new file mode 100644 index 000000000..f93f4b965 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodefoldercluster.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeNodeFolderClusters implements NodeFolderClusterInterface +type FakeNodeFolderClusters struct { + Fake *FakeGlobalTsmV1 +} + +var nodefolderclustersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "nodefolderclusters"} + +var nodefolderclustersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "NodeFolderCluster"} + +// Get takes name of the nodeFolderCluster, and returns the corresponding nodeFolderCluster object, and an error if there is any. +func (c *FakeNodeFolderClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.NodeFolderCluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(nodefolderclustersResource, name), &globaltsmtanzuvmwarecomv1.NodeFolderCluster{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeFolderCluster), err +} + +// List takes label and field selectors, and returns the list of NodeFolderClusters that match those selectors. +func (c *FakeNodeFolderClusters) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.NodeFolderClusterList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(nodefolderclustersResource, nodefolderclustersKind, opts), &globaltsmtanzuvmwarecomv1.NodeFolderClusterList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.NodeFolderClusterList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.NodeFolderClusterList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.NodeFolderClusterList).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 nodeFolderClusters. +func (c *FakeNodeFolderClusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(nodefolderclustersResource, opts)) +} + +// Create takes the representation of a nodeFolderCluster and creates it. Returns the server's representation of the nodeFolderCluster, and an error, if there is any. +func (c *FakeNodeFolderClusters) Create(ctx context.Context, nodeFolderCluster *globaltsmtanzuvmwarecomv1.NodeFolderCluster, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.NodeFolderCluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(nodefolderclustersResource, nodeFolderCluster), &globaltsmtanzuvmwarecomv1.NodeFolderCluster{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeFolderCluster), err +} + +// Update takes the representation of a nodeFolderCluster and updates it. Returns the server's representation of the nodeFolderCluster, and an error, if there is any. +func (c *FakeNodeFolderClusters) Update(ctx context.Context, nodeFolderCluster *globaltsmtanzuvmwarecomv1.NodeFolderCluster, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.NodeFolderCluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(nodefolderclustersResource, nodeFolderCluster), &globaltsmtanzuvmwarecomv1.NodeFolderCluster{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeFolderCluster), err +} + +// Delete takes name of the nodeFolderCluster and deletes it. Returns an error if one occurs. +func (c *FakeNodeFolderClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(nodefolderclustersResource, name), &globaltsmtanzuvmwarecomv1.NodeFolderCluster{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNodeFolderClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(nodefolderclustersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.NodeFolderClusterList{}) + return err +} + +// Patch applies the patch and returns the patched nodeFolderCluster. +func (c *FakeNodeFolderClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.NodeFolderCluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(nodefolderclustersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.NodeFolderCluster{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeFolderCluster), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodegroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodegroup.go new file mode 100644 index 000000000..95c7d7c65 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodegroup.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeNodeGroups implements NodeGroupInterface +type FakeNodeGroups struct { + Fake *FakeGlobalTsmV1 +} + +var nodegroupsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "nodegroups"} + +var nodegroupsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "NodeGroup"} + +// Get takes name of the nodeGroup, and returns the corresponding nodeGroup object, and an error if there is any. +func (c *FakeNodeGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.NodeGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(nodegroupsResource, name), &globaltsmtanzuvmwarecomv1.NodeGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeGroup), err +} + +// List takes label and field selectors, and returns the list of NodeGroups that match those selectors. +func (c *FakeNodeGroups) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.NodeGroupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(nodegroupsResource, nodegroupsKind, opts), &globaltsmtanzuvmwarecomv1.NodeGroupList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.NodeGroupList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.NodeGroupList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.NodeGroupList).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 nodeGroups. +func (c *FakeNodeGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(nodegroupsResource, opts)) +} + +// Create takes the representation of a nodeGroup and creates it. Returns the server's representation of the nodeGroup, and an error, if there is any. +func (c *FakeNodeGroups) Create(ctx context.Context, nodeGroup *globaltsmtanzuvmwarecomv1.NodeGroup, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.NodeGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(nodegroupsResource, nodeGroup), &globaltsmtanzuvmwarecomv1.NodeGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeGroup), err +} + +// Update takes the representation of a nodeGroup and updates it. Returns the server's representation of the nodeGroup, and an error, if there is any. +func (c *FakeNodeGroups) Update(ctx context.Context, nodeGroup *globaltsmtanzuvmwarecomv1.NodeGroup, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.NodeGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(nodegroupsResource, nodeGroup), &globaltsmtanzuvmwarecomv1.NodeGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeGroup), err +} + +// Delete takes name of the nodeGroup and deletes it. Returns an error if one occurs. +func (c *FakeNodeGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(nodegroupsResource, name), &globaltsmtanzuvmwarecomv1.NodeGroup{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNodeGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(nodegroupsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.NodeGroupList{}) + return err +} + +// Patch applies the patch and returns the patched nodeGroup. +func (c *FakeNodeGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.NodeGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(nodegroupsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.NodeGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeGroup), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodestatus.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodestatus.go new file mode 100644 index 000000000..11fe1514a --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodestatus.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeNodeStatuses implements NodeStatusInterface +type FakeNodeStatuses struct { + Fake *FakeGlobalTsmV1 +} + +var nodestatusesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "nodestatuses"} + +var nodestatusesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "NodeStatus"} + +// Get takes name of the nodeStatus, and returns the corresponding nodeStatus object, and an error if there is any. +func (c *FakeNodeStatuses) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.NodeStatus, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(nodestatusesResource, name), &globaltsmtanzuvmwarecomv1.NodeStatus{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeStatus), err +} + +// List takes label and field selectors, and returns the list of NodeStatuses that match those selectors. +func (c *FakeNodeStatuses) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.NodeStatusList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(nodestatusesResource, nodestatusesKind, opts), &globaltsmtanzuvmwarecomv1.NodeStatusList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.NodeStatusList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.NodeStatusList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.NodeStatusList).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 nodeStatuses. +func (c *FakeNodeStatuses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(nodestatusesResource, opts)) +} + +// Create takes the representation of a nodeStatus and creates it. Returns the server's representation of the nodeStatus, and an error, if there is any. +func (c *FakeNodeStatuses) Create(ctx context.Context, nodeStatus *globaltsmtanzuvmwarecomv1.NodeStatus, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.NodeStatus, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(nodestatusesResource, nodeStatus), &globaltsmtanzuvmwarecomv1.NodeStatus{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeStatus), err +} + +// Update takes the representation of a nodeStatus and updates it. Returns the server's representation of the nodeStatus, and an error, if there is any. +func (c *FakeNodeStatuses) Update(ctx context.Context, nodeStatus *globaltsmtanzuvmwarecomv1.NodeStatus, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.NodeStatus, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(nodestatusesResource, nodeStatus), &globaltsmtanzuvmwarecomv1.NodeStatus{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeStatus), err +} + +// Delete takes name of the nodeStatus and deletes it. Returns an error if one occurs. +func (c *FakeNodeStatuses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(nodestatusesResource, name), &globaltsmtanzuvmwarecomv1.NodeStatus{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNodeStatuses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(nodestatusesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.NodeStatusList{}) + return err +} + +// Patch applies the patch and returns the patched nodeStatus. +func (c *FakeNodeStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.NodeStatus, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(nodestatusesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.NodeStatus{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeStatus), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodetemplate.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodetemplate.go new file mode 100644 index 000000000..46aaf3feb --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_nodetemplate.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeNodeTemplates implements NodeTemplateInterface +type FakeNodeTemplates struct { + Fake *FakeGlobalTsmV1 +} + +var nodetemplatesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "nodetemplates"} + +var nodetemplatesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "NodeTemplate"} + +// Get takes name of the nodeTemplate, and returns the corresponding nodeTemplate object, and an error if there is any. +func (c *FakeNodeTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.NodeTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(nodetemplatesResource, name), &globaltsmtanzuvmwarecomv1.NodeTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeTemplate), err +} + +// List takes label and field selectors, and returns the list of NodeTemplates that match those selectors. +func (c *FakeNodeTemplates) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.NodeTemplateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(nodetemplatesResource, nodetemplatesKind, opts), &globaltsmtanzuvmwarecomv1.NodeTemplateList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.NodeTemplateList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.NodeTemplateList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.NodeTemplateList).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 nodeTemplates. +func (c *FakeNodeTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(nodetemplatesResource, opts)) +} + +// Create takes the representation of a nodeTemplate and creates it. Returns the server's representation of the nodeTemplate, and an error, if there is any. +func (c *FakeNodeTemplates) Create(ctx context.Context, nodeTemplate *globaltsmtanzuvmwarecomv1.NodeTemplate, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.NodeTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(nodetemplatesResource, nodeTemplate), &globaltsmtanzuvmwarecomv1.NodeTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeTemplate), err +} + +// Update takes the representation of a nodeTemplate and updates it. Returns the server's representation of the nodeTemplate, and an error, if there is any. +func (c *FakeNodeTemplates) Update(ctx context.Context, nodeTemplate *globaltsmtanzuvmwarecomv1.NodeTemplate, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.NodeTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(nodetemplatesResource, nodeTemplate), &globaltsmtanzuvmwarecomv1.NodeTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeTemplate), err +} + +// Delete takes name of the nodeTemplate and deletes it. Returns an error if one occurs. +func (c *FakeNodeTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(nodetemplatesResource, name), &globaltsmtanzuvmwarecomv1.NodeTemplate{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNodeTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(nodetemplatesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.NodeTemplateList{}) + return err +} + +// Patch applies the patch and returns the patched nodeTemplate. +func (c *FakeNodeTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.NodeTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(nodetemplatesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.NodeTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.NodeTemplate), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_outboundauthenticationmode.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_outboundauthenticationmode.go new file mode 100644 index 000000000..82c54cfb0 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_outboundauthenticationmode.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeOutboundAuthenticationModes implements OutboundAuthenticationModeInterface +type FakeOutboundAuthenticationModes struct { + Fake *FakeGlobalTsmV1 +} + +var outboundauthenticationmodesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "outboundauthenticationmodes"} + +var outboundauthenticationmodesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "OutboundAuthenticationMode"} + +// Get takes name of the outboundAuthenticationMode, and returns the corresponding outboundAuthenticationMode object, and an error if there is any. +func (c *FakeOutboundAuthenticationModes) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.OutboundAuthenticationMode, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(outboundauthenticationmodesResource, name), &globaltsmtanzuvmwarecomv1.OutboundAuthenticationMode{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.OutboundAuthenticationMode), err +} + +// List takes label and field selectors, and returns the list of OutboundAuthenticationModes that match those selectors. +func (c *FakeOutboundAuthenticationModes) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.OutboundAuthenticationModeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(outboundauthenticationmodesResource, outboundauthenticationmodesKind, opts), &globaltsmtanzuvmwarecomv1.OutboundAuthenticationModeList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.OutboundAuthenticationModeList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.OutboundAuthenticationModeList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.OutboundAuthenticationModeList).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 outboundAuthenticationModes. +func (c *FakeOutboundAuthenticationModes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(outboundauthenticationmodesResource, opts)) +} + +// Create takes the representation of a outboundAuthenticationMode and creates it. Returns the server's representation of the outboundAuthenticationMode, and an error, if there is any. +func (c *FakeOutboundAuthenticationModes) Create(ctx context.Context, outboundAuthenticationMode *globaltsmtanzuvmwarecomv1.OutboundAuthenticationMode, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.OutboundAuthenticationMode, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(outboundauthenticationmodesResource, outboundAuthenticationMode), &globaltsmtanzuvmwarecomv1.OutboundAuthenticationMode{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.OutboundAuthenticationMode), err +} + +// Update takes the representation of a outboundAuthenticationMode and updates it. Returns the server's representation of the outboundAuthenticationMode, and an error, if there is any. +func (c *FakeOutboundAuthenticationModes) Update(ctx context.Context, outboundAuthenticationMode *globaltsmtanzuvmwarecomv1.OutboundAuthenticationMode, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.OutboundAuthenticationMode, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(outboundauthenticationmodesResource, outboundAuthenticationMode), &globaltsmtanzuvmwarecomv1.OutboundAuthenticationMode{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.OutboundAuthenticationMode), err +} + +// Delete takes name of the outboundAuthenticationMode and deletes it. Returns an error if one occurs. +func (c *FakeOutboundAuthenticationModes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(outboundauthenticationmodesResource, name), &globaltsmtanzuvmwarecomv1.OutboundAuthenticationMode{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeOutboundAuthenticationModes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(outboundauthenticationmodesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.OutboundAuthenticationModeList{}) + return err +} + +// Patch applies the patch and returns the patched outboundAuthenticationMode. +func (c *FakeOutboundAuthenticationModes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.OutboundAuthenticationMode, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(outboundauthenticationmodesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.OutboundAuthenticationMode{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.OutboundAuthenticationMode), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_peerauthentication.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_peerauthentication.go new file mode 100644 index 000000000..516653d5f --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_peerauthentication.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakePeerAuthentications implements PeerAuthenticationInterface +type FakePeerAuthentications struct { + Fake *FakeGlobalTsmV1 +} + +var peerauthenticationsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "peerauthentications"} + +var peerauthenticationsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "PeerAuthentication"} + +// Get takes name of the peerAuthentication, and returns the corresponding peerAuthentication object, and an error if there is any. +func (c *FakePeerAuthentications) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.PeerAuthentication, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(peerauthenticationsResource, name), &globaltsmtanzuvmwarecomv1.PeerAuthentication{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PeerAuthentication), err +} + +// List takes label and field selectors, and returns the list of PeerAuthentications that match those selectors. +func (c *FakePeerAuthentications) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.PeerAuthenticationList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(peerauthenticationsResource, peerauthenticationsKind, opts), &globaltsmtanzuvmwarecomv1.PeerAuthenticationList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.PeerAuthenticationList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.PeerAuthenticationList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.PeerAuthenticationList).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 peerAuthentications. +func (c *FakePeerAuthentications) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(peerauthenticationsResource, opts)) +} + +// Create takes the representation of a peerAuthentication and creates it. Returns the server's representation of the peerAuthentication, and an error, if there is any. +func (c *FakePeerAuthentications) Create(ctx context.Context, peerAuthentication *globaltsmtanzuvmwarecomv1.PeerAuthentication, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.PeerAuthentication, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(peerauthenticationsResource, peerAuthentication), &globaltsmtanzuvmwarecomv1.PeerAuthentication{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PeerAuthentication), err +} + +// Update takes the representation of a peerAuthentication and updates it. Returns the server's representation of the peerAuthentication, and an error, if there is any. +func (c *FakePeerAuthentications) Update(ctx context.Context, peerAuthentication *globaltsmtanzuvmwarecomv1.PeerAuthentication, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.PeerAuthentication, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(peerauthenticationsResource, peerAuthentication), &globaltsmtanzuvmwarecomv1.PeerAuthentication{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PeerAuthentication), err +} + +// Delete takes name of the peerAuthentication and deletes it. Returns an error if one occurs. +func (c *FakePeerAuthentications) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(peerauthenticationsResource, name), &globaltsmtanzuvmwarecomv1.PeerAuthentication{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePeerAuthentications) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(peerauthenticationsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.PeerAuthenticationList{}) + return err +} + +// Patch applies the patch and returns the patched peerAuthentication. +func (c *FakePeerAuthentications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.PeerAuthentication, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(peerauthenticationsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.PeerAuthentication{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PeerAuthentication), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_piidiscovery.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_piidiscovery.go new file mode 100644 index 000000000..3c5fb423f --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_piidiscovery.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakePiiDiscoveries implements PiiDiscoveryInterface +type FakePiiDiscoveries struct { + Fake *FakeGlobalTsmV1 +} + +var piidiscoveriesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "piidiscoveries"} + +var piidiscoveriesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "PiiDiscovery"} + +// Get takes name of the piiDiscovery, and returns the corresponding piiDiscovery object, and an error if there is any. +func (c *FakePiiDiscoveries) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.PiiDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(piidiscoveriesResource, name), &globaltsmtanzuvmwarecomv1.PiiDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PiiDiscovery), err +} + +// List takes label and field selectors, and returns the list of PiiDiscoveries that match those selectors. +func (c *FakePiiDiscoveries) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.PiiDiscoveryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(piidiscoveriesResource, piidiscoveriesKind, opts), &globaltsmtanzuvmwarecomv1.PiiDiscoveryList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.PiiDiscoveryList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.PiiDiscoveryList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.PiiDiscoveryList).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 piiDiscoveries. +func (c *FakePiiDiscoveries) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(piidiscoveriesResource, opts)) +} + +// Create takes the representation of a piiDiscovery and creates it. Returns the server's representation of the piiDiscovery, and an error, if there is any. +func (c *FakePiiDiscoveries) Create(ctx context.Context, piiDiscovery *globaltsmtanzuvmwarecomv1.PiiDiscovery, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.PiiDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(piidiscoveriesResource, piiDiscovery), &globaltsmtanzuvmwarecomv1.PiiDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PiiDiscovery), err +} + +// Update takes the representation of a piiDiscovery and updates it. Returns the server's representation of the piiDiscovery, and an error, if there is any. +func (c *FakePiiDiscoveries) Update(ctx context.Context, piiDiscovery *globaltsmtanzuvmwarecomv1.PiiDiscovery, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.PiiDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(piidiscoveriesResource, piiDiscovery), &globaltsmtanzuvmwarecomv1.PiiDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PiiDiscovery), err +} + +// Delete takes name of the piiDiscovery and deletes it. Returns an error if one occurs. +func (c *FakePiiDiscoveries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(piidiscoveriesResource, name), &globaltsmtanzuvmwarecomv1.PiiDiscovery{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePiiDiscoveries) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(piidiscoveriesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.PiiDiscoveryList{}) + return err +} + +// Patch applies the patch and returns the patched piiDiscovery. +func (c *FakePiiDiscoveries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.PiiDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(piidiscoveriesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.PiiDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PiiDiscovery), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_piidiscoveryrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_piidiscoveryrt.go new file mode 100644 index 000000000..e8c304954 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_piidiscoveryrt.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakePiiDiscoveryRTs implements PiiDiscoveryRTInterface +type FakePiiDiscoveryRTs struct { + Fake *FakeGlobalTsmV1 +} + +var piidiscoveryrtsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "piidiscoveryrts"} + +var piidiscoveryrtsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "PiiDiscoveryRT"} + +// Get takes name of the piiDiscoveryRT, and returns the corresponding piiDiscoveryRT object, and an error if there is any. +func (c *FakePiiDiscoveryRTs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.PiiDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(piidiscoveryrtsResource, name), &globaltsmtanzuvmwarecomv1.PiiDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PiiDiscoveryRT), err +} + +// List takes label and field selectors, and returns the list of PiiDiscoveryRTs that match those selectors. +func (c *FakePiiDiscoveryRTs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.PiiDiscoveryRTList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(piidiscoveryrtsResource, piidiscoveryrtsKind, opts), &globaltsmtanzuvmwarecomv1.PiiDiscoveryRTList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.PiiDiscoveryRTList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.PiiDiscoveryRTList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.PiiDiscoveryRTList).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 piiDiscoveryRTs. +func (c *FakePiiDiscoveryRTs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(piidiscoveryrtsResource, opts)) +} + +// Create takes the representation of a piiDiscoveryRT and creates it. Returns the server's representation of the piiDiscoveryRT, and an error, if there is any. +func (c *FakePiiDiscoveryRTs) Create(ctx context.Context, piiDiscoveryRT *globaltsmtanzuvmwarecomv1.PiiDiscoveryRT, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.PiiDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(piidiscoveryrtsResource, piiDiscoveryRT), &globaltsmtanzuvmwarecomv1.PiiDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PiiDiscoveryRT), err +} + +// Update takes the representation of a piiDiscoveryRT and updates it. Returns the server's representation of the piiDiscoveryRT, and an error, if there is any. +func (c *FakePiiDiscoveryRTs) Update(ctx context.Context, piiDiscoveryRT *globaltsmtanzuvmwarecomv1.PiiDiscoveryRT, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.PiiDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(piidiscoveryrtsResource, piiDiscoveryRT), &globaltsmtanzuvmwarecomv1.PiiDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PiiDiscoveryRT), err +} + +// Delete takes name of the piiDiscoveryRT and deletes it. Returns an error if one occurs. +func (c *FakePiiDiscoveryRTs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(piidiscoveryrtsResource, name), &globaltsmtanzuvmwarecomv1.PiiDiscoveryRT{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePiiDiscoveryRTs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(piidiscoveryrtsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.PiiDiscoveryRTList{}) + return err +} + +// Patch applies the patch and returns the patched piiDiscoveryRT. +func (c *FakePiiDiscoveryRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.PiiDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(piidiscoveryrtsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.PiiDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PiiDiscoveryRT), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_policyconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_policyconfig.go new file mode 100644 index 000000000..bcb00329e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_policyconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakePolicyConfigs implements PolicyConfigInterface +type FakePolicyConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var policyconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "policyconfigs"} + +var policyconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "PolicyConfig"} + +// Get takes name of the policyConfig, and returns the corresponding policyConfig object, and an error if there is any. +func (c *FakePolicyConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.PolicyConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(policyconfigsResource, name), &globaltsmtanzuvmwarecomv1.PolicyConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PolicyConfig), err +} + +// List takes label and field selectors, and returns the list of PolicyConfigs that match those selectors. +func (c *FakePolicyConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.PolicyConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(policyconfigsResource, policyconfigsKind, opts), &globaltsmtanzuvmwarecomv1.PolicyConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.PolicyConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.PolicyConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.PolicyConfigList).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 policyConfigs. +func (c *FakePolicyConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(policyconfigsResource, opts)) +} + +// Create takes the representation of a policyConfig and creates it. Returns the server's representation of the policyConfig, and an error, if there is any. +func (c *FakePolicyConfigs) Create(ctx context.Context, policyConfig *globaltsmtanzuvmwarecomv1.PolicyConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.PolicyConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(policyconfigsResource, policyConfig), &globaltsmtanzuvmwarecomv1.PolicyConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PolicyConfig), err +} + +// Update takes the representation of a policyConfig and updates it. Returns the server's representation of the policyConfig, and an error, if there is any. +func (c *FakePolicyConfigs) Update(ctx context.Context, policyConfig *globaltsmtanzuvmwarecomv1.PolicyConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.PolicyConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(policyconfigsResource, policyConfig), &globaltsmtanzuvmwarecomv1.PolicyConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PolicyConfig), err +} + +// Delete takes name of the policyConfig and deletes it. Returns an error if one occurs. +func (c *FakePolicyConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(policyconfigsResource, name), &globaltsmtanzuvmwarecomv1.PolicyConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePolicyConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(policyconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.PolicyConfigList{}) + return err +} + +// Patch applies the patch and returns the patched policyConfig. +func (c *FakePolicyConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.PolicyConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(policyconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.PolicyConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PolicyConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_policytemplate.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_policytemplate.go new file mode 100644 index 000000000..8011a6937 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_policytemplate.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakePolicyTemplates implements PolicyTemplateInterface +type FakePolicyTemplates struct { + Fake *FakeGlobalTsmV1 +} + +var policytemplatesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "policytemplates"} + +var policytemplatesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "PolicyTemplate"} + +// Get takes name of the policyTemplate, and returns the corresponding policyTemplate object, and an error if there is any. +func (c *FakePolicyTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.PolicyTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(policytemplatesResource, name), &globaltsmtanzuvmwarecomv1.PolicyTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PolicyTemplate), err +} + +// List takes label and field selectors, and returns the list of PolicyTemplates that match those selectors. +func (c *FakePolicyTemplates) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.PolicyTemplateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(policytemplatesResource, policytemplatesKind, opts), &globaltsmtanzuvmwarecomv1.PolicyTemplateList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.PolicyTemplateList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.PolicyTemplateList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.PolicyTemplateList).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 policyTemplates. +func (c *FakePolicyTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(policytemplatesResource, opts)) +} + +// Create takes the representation of a policyTemplate and creates it. Returns the server's representation of the policyTemplate, and an error, if there is any. +func (c *FakePolicyTemplates) Create(ctx context.Context, policyTemplate *globaltsmtanzuvmwarecomv1.PolicyTemplate, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.PolicyTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(policytemplatesResource, policyTemplate), &globaltsmtanzuvmwarecomv1.PolicyTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PolicyTemplate), err +} + +// Update takes the representation of a policyTemplate and updates it. Returns the server's representation of the policyTemplate, and an error, if there is any. +func (c *FakePolicyTemplates) Update(ctx context.Context, policyTemplate *globaltsmtanzuvmwarecomv1.PolicyTemplate, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.PolicyTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(policytemplatesResource, policyTemplate), &globaltsmtanzuvmwarecomv1.PolicyTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PolicyTemplate), err +} + +// Delete takes name of the policyTemplate and deletes it. Returns an error if one occurs. +func (c *FakePolicyTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(policytemplatesResource, name), &globaltsmtanzuvmwarecomv1.PolicyTemplate{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePolicyTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(policytemplatesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.PolicyTemplateList{}) + return err +} + +// Patch applies the patch and returns the patched policyTemplate. +func (c *FakePolicyTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.PolicyTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(policytemplatesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.PolicyTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PolicyTemplate), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_progressiveupgrade.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_progressiveupgrade.go new file mode 100644 index 000000000..bf3de99e1 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_progressiveupgrade.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeProgressiveUpgrades implements ProgressiveUpgradeInterface +type FakeProgressiveUpgrades struct { + Fake *FakeGlobalTsmV1 +} + +var progressiveupgradesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "progressiveupgrades"} + +var progressiveupgradesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ProgressiveUpgrade"} + +// Get takes name of the progressiveUpgrade, and returns the corresponding progressiveUpgrade object, and an error if there is any. +func (c *FakeProgressiveUpgrades) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgrade, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(progressiveupgradesResource, name), &globaltsmtanzuvmwarecomv1.ProgressiveUpgrade{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgrade), err +} + +// List takes label and field selectors, and returns the list of ProgressiveUpgrades that match those selectors. +func (c *FakeProgressiveUpgrades) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(progressiveupgradesResource, progressiveupgradesKind, opts), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeList).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 progressiveUpgrades. +func (c *FakeProgressiveUpgrades) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(progressiveupgradesResource, opts)) +} + +// Create takes the representation of a progressiveUpgrade and creates it. Returns the server's representation of the progressiveUpgrade, and an error, if there is any. +func (c *FakeProgressiveUpgrades) Create(ctx context.Context, progressiveUpgrade *globaltsmtanzuvmwarecomv1.ProgressiveUpgrade, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgrade, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(progressiveupgradesResource, progressiveUpgrade), &globaltsmtanzuvmwarecomv1.ProgressiveUpgrade{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgrade), err +} + +// Update takes the representation of a progressiveUpgrade and updates it. Returns the server's representation of the progressiveUpgrade, and an error, if there is any. +func (c *FakeProgressiveUpgrades) Update(ctx context.Context, progressiveUpgrade *globaltsmtanzuvmwarecomv1.ProgressiveUpgrade, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgrade, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(progressiveupgradesResource, progressiveUpgrade), &globaltsmtanzuvmwarecomv1.ProgressiveUpgrade{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgrade), err +} + +// Delete takes name of the progressiveUpgrade and deletes it. Returns an error if one occurs. +func (c *FakeProgressiveUpgrades) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(progressiveupgradesResource, name), &globaltsmtanzuvmwarecomv1.ProgressiveUpgrade{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProgressiveUpgrades) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(progressiveupgradesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeList{}) + return err +} + +// Patch applies the patch and returns the patched progressiveUpgrade. +func (c *FakeProgressiveUpgrades) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgrade, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(progressiveupgradesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ProgressiveUpgrade{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgrade), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_progressiveupgradeconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_progressiveupgradeconfig.go new file mode 100644 index 000000000..85f50ba00 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_progressiveupgradeconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeProgressiveUpgradeConfigs implements ProgressiveUpgradeConfigInterface +type FakeProgressiveUpgradeConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var progressiveupgradeconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "progressiveupgradeconfigs"} + +var progressiveupgradeconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ProgressiveUpgradeConfig"} + +// Get takes name of the progressiveUpgradeConfig, and returns the corresponding progressiveUpgradeConfig object, and an error if there is any. +func (c *FakeProgressiveUpgradeConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(progressiveupgradeconfigsResource, name), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig), err +} + +// List takes label and field selectors, and returns the list of ProgressiveUpgradeConfigs that match those selectors. +func (c *FakeProgressiveUpgradeConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(progressiveupgradeconfigsResource, progressiveupgradeconfigsKind, opts), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfigList).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 progressiveUpgradeConfigs. +func (c *FakeProgressiveUpgradeConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(progressiveupgradeconfigsResource, opts)) +} + +// Create takes the representation of a progressiveUpgradeConfig and creates it. Returns the server's representation of the progressiveUpgradeConfig, and an error, if there is any. +func (c *FakeProgressiveUpgradeConfigs) Create(ctx context.Context, progressiveUpgradeConfig *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(progressiveupgradeconfigsResource, progressiveUpgradeConfig), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig), err +} + +// Update takes the representation of a progressiveUpgradeConfig and updates it. Returns the server's representation of the progressiveUpgradeConfig, and an error, if there is any. +func (c *FakeProgressiveUpgradeConfigs) Update(ctx context.Context, progressiveUpgradeConfig *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(progressiveupgradeconfigsResource, progressiveUpgradeConfig), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig), err +} + +// Delete takes name of the progressiveUpgradeConfig and deletes it. Returns an error if one occurs. +func (c *FakeProgressiveUpgradeConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(progressiveupgradeconfigsResource, name), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProgressiveUpgradeConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(progressiveupgradeconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfigList{}) + return err +} + +// Patch applies the patch and returns the patched progressiveUpgradeConfig. +func (c *FakeProgressiveUpgradeConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(progressiveupgradeconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_progressiveupgradefolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_progressiveupgradefolder.go new file mode 100644 index 000000000..64831d943 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_progressiveupgradefolder.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeProgressiveUpgradeFolders implements ProgressiveUpgradeFolderInterface +type FakeProgressiveUpgradeFolders struct { + Fake *FakeGlobalTsmV1 +} + +var progressiveupgradefoldersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "progressiveupgradefolders"} + +var progressiveupgradefoldersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ProgressiveUpgradeFolder"} + +// Get takes name of the progressiveUpgradeFolder, and returns the corresponding progressiveUpgradeFolder object, and an error if there is any. +func (c *FakeProgressiveUpgradeFolders) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(progressiveupgradefoldersResource, name), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder), err +} + +// List takes label and field selectors, and returns the list of ProgressiveUpgradeFolders that match those selectors. +func (c *FakeProgressiveUpgradeFolders) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(progressiveupgradefoldersResource, progressiveupgradefoldersKind, opts), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolderList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolderList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolderList).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 progressiveUpgradeFolders. +func (c *FakeProgressiveUpgradeFolders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(progressiveupgradefoldersResource, opts)) +} + +// Create takes the representation of a progressiveUpgradeFolder and creates it. Returns the server's representation of the progressiveUpgradeFolder, and an error, if there is any. +func (c *FakeProgressiveUpgradeFolders) Create(ctx context.Context, progressiveUpgradeFolder *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(progressiveupgradefoldersResource, progressiveUpgradeFolder), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder), err +} + +// Update takes the representation of a progressiveUpgradeFolder and updates it. Returns the server's representation of the progressiveUpgradeFolder, and an error, if there is any. +func (c *FakeProgressiveUpgradeFolders) Update(ctx context.Context, progressiveUpgradeFolder *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(progressiveupgradefoldersResource, progressiveUpgradeFolder), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder), err +} + +// Delete takes name of the progressiveUpgradeFolder and deletes it. Returns an error if one occurs. +func (c *FakeProgressiveUpgradeFolders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(progressiveupgradefoldersResource, name), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProgressiveUpgradeFolders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(progressiveupgradefoldersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolderList{}) + return err +} + +// Patch applies the patch and returns the patched progressiveUpgradeFolder. +func (c *FakeProgressiveUpgradeFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(progressiveupgradefoldersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_progressiveupgraderuntime.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_progressiveupgraderuntime.go new file mode 100644 index 000000000..0b52c51de --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_progressiveupgraderuntime.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeProgressiveUpgradeRuntimes implements ProgressiveUpgradeRuntimeInterface +type FakeProgressiveUpgradeRuntimes struct { + Fake *FakeGlobalTsmV1 +} + +var progressiveupgraderuntimesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "progressiveupgraderuntimes"} + +var progressiveupgraderuntimesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ProgressiveUpgradeRuntime"} + +// Get takes name of the progressiveUpgradeRuntime, and returns the corresponding progressiveUpgradeRuntime object, and an error if there is any. +func (c *FakeProgressiveUpgradeRuntimes) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(progressiveupgraderuntimesResource, name), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime), err +} + +// List takes label and field selectors, and returns the list of ProgressiveUpgradeRuntimes that match those selectors. +func (c *FakeProgressiveUpgradeRuntimes) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntimeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(progressiveupgraderuntimesResource, progressiveupgraderuntimesKind, opts), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntimeList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntimeList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntimeList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntimeList).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 progressiveUpgradeRuntimes. +func (c *FakeProgressiveUpgradeRuntimes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(progressiveupgraderuntimesResource, opts)) +} + +// Create takes the representation of a progressiveUpgradeRuntime and creates it. Returns the server's representation of the progressiveUpgradeRuntime, and an error, if there is any. +func (c *FakeProgressiveUpgradeRuntimes) Create(ctx context.Context, progressiveUpgradeRuntime *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(progressiveupgraderuntimesResource, progressiveUpgradeRuntime), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime), err +} + +// Update takes the representation of a progressiveUpgradeRuntime and updates it. Returns the server's representation of the progressiveUpgradeRuntime, and an error, if there is any. +func (c *FakeProgressiveUpgradeRuntimes) Update(ctx context.Context, progressiveUpgradeRuntime *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(progressiveupgraderuntimesResource, progressiveUpgradeRuntime), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime), err +} + +// Delete takes name of the progressiveUpgradeRuntime and deletes it. Returns an error if one occurs. +func (c *FakeProgressiveUpgradeRuntimes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(progressiveupgraderuntimesResource, name), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProgressiveUpgradeRuntimes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(progressiveupgraderuntimesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntimeList{}) + return err +} + +// Patch applies the patch and returns the patched progressiveUpgradeRuntime. +func (c *FakeProgressiveUpgradeRuntimes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(progressiveupgraderuntimesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_project.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_project.go new file mode 100644 index 000000000..6660c687c --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_project.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeProjects implements ProjectInterface +type FakeProjects struct { + Fake *FakeGlobalTsmV1 +} + +var projectsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "projects"} + +var projectsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Project"} + +// Get takes name of the project, and returns the corresponding project object, and an error if there is any. +func (c *FakeProjects) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Project, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(projectsResource, name), &globaltsmtanzuvmwarecomv1.Project{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Project), err +} + +// List takes label and field selectors, and returns the list of Projects that match those selectors. +func (c *FakeProjects) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ProjectList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(projectsResource, projectsKind, opts), &globaltsmtanzuvmwarecomv1.ProjectList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ProjectList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ProjectList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ProjectList).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 projects. +func (c *FakeProjects) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(projectsResource, opts)) +} + +// Create takes the representation of a project and creates it. Returns the server's representation of the project, and an error, if there is any. +func (c *FakeProjects) Create(ctx context.Context, project *globaltsmtanzuvmwarecomv1.Project, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Project, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(projectsResource, project), &globaltsmtanzuvmwarecomv1.Project{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Project), err +} + +// Update takes the representation of a project and updates it. Returns the server's representation of the project, and an error, if there is any. +func (c *FakeProjects) Update(ctx context.Context, project *globaltsmtanzuvmwarecomv1.Project, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Project, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(projectsResource, project), &globaltsmtanzuvmwarecomv1.Project{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Project), err +} + +// Delete takes name of the project and deletes it. Returns an error if one occurs. +func (c *FakeProjects) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(projectsResource, name), &globaltsmtanzuvmwarecomv1.Project{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProjects) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(projectsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ProjectList{}) + return err +} + +// Patch applies the patch and returns the patched project. +func (c *FakeProjects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Project, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(projectsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Project{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Project), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_projectconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_projectconfig.go new file mode 100644 index 000000000..35fda56d1 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_projectconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeProjectConfigs implements ProjectConfigInterface +type FakeProjectConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var projectconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "projectconfigs"} + +var projectconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ProjectConfig"} + +// Get takes name of the projectConfig, and returns the corresponding projectConfig object, and an error if there is any. +func (c *FakeProjectConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ProjectConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(projectconfigsResource, name), &globaltsmtanzuvmwarecomv1.ProjectConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProjectConfig), err +} + +// List takes label and field selectors, and returns the list of ProjectConfigs that match those selectors. +func (c *FakeProjectConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ProjectConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(projectconfigsResource, projectconfigsKind, opts), &globaltsmtanzuvmwarecomv1.ProjectConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ProjectConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ProjectConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ProjectConfigList).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 projectConfigs. +func (c *FakeProjectConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(projectconfigsResource, opts)) +} + +// Create takes the representation of a projectConfig and creates it. Returns the server's representation of the projectConfig, and an error, if there is any. +func (c *FakeProjectConfigs) Create(ctx context.Context, projectConfig *globaltsmtanzuvmwarecomv1.ProjectConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ProjectConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(projectconfigsResource, projectConfig), &globaltsmtanzuvmwarecomv1.ProjectConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProjectConfig), err +} + +// Update takes the representation of a projectConfig and updates it. Returns the server's representation of the projectConfig, and an error, if there is any. +func (c *FakeProjectConfigs) Update(ctx context.Context, projectConfig *globaltsmtanzuvmwarecomv1.ProjectConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ProjectConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(projectconfigsResource, projectConfig), &globaltsmtanzuvmwarecomv1.ProjectConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProjectConfig), err +} + +// Delete takes name of the projectConfig and deletes it. Returns an error if one occurs. +func (c *FakeProjectConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(projectconfigsResource, name), &globaltsmtanzuvmwarecomv1.ProjectConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProjectConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(projectconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ProjectConfigList{}) + return err +} + +// Patch applies the patch and returns the patched projectConfig. +func (c *FakeProjectConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ProjectConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(projectconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ProjectConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProjectConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_projectinventory.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_projectinventory.go new file mode 100644 index 000000000..aece09573 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_projectinventory.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeProjectInventories implements ProjectInventoryInterface +type FakeProjectInventories struct { + Fake *FakeGlobalTsmV1 +} + +var projectinventoriesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "projectinventories"} + +var projectinventoriesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ProjectInventory"} + +// Get takes name of the projectInventory, and returns the corresponding projectInventory object, and an error if there is any. +func (c *FakeProjectInventories) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ProjectInventory, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(projectinventoriesResource, name), &globaltsmtanzuvmwarecomv1.ProjectInventory{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProjectInventory), err +} + +// List takes label and field selectors, and returns the list of ProjectInventories that match those selectors. +func (c *FakeProjectInventories) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ProjectInventoryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(projectinventoriesResource, projectinventoriesKind, opts), &globaltsmtanzuvmwarecomv1.ProjectInventoryList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ProjectInventoryList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ProjectInventoryList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ProjectInventoryList).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 projectInventories. +func (c *FakeProjectInventories) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(projectinventoriesResource, opts)) +} + +// Create takes the representation of a projectInventory and creates it. Returns the server's representation of the projectInventory, and an error, if there is any. +func (c *FakeProjectInventories) Create(ctx context.Context, projectInventory *globaltsmtanzuvmwarecomv1.ProjectInventory, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ProjectInventory, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(projectinventoriesResource, projectInventory), &globaltsmtanzuvmwarecomv1.ProjectInventory{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProjectInventory), err +} + +// Update takes the representation of a projectInventory and updates it. Returns the server's representation of the projectInventory, and an error, if there is any. +func (c *FakeProjectInventories) Update(ctx context.Context, projectInventory *globaltsmtanzuvmwarecomv1.ProjectInventory, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ProjectInventory, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(projectinventoriesResource, projectInventory), &globaltsmtanzuvmwarecomv1.ProjectInventory{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProjectInventory), err +} + +// Delete takes name of the projectInventory and deletes it. Returns an error if one occurs. +func (c *FakeProjectInventories) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(projectinventoriesResource, name), &globaltsmtanzuvmwarecomv1.ProjectInventory{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProjectInventories) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(projectinventoriesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ProjectInventoryList{}) + return err +} + +// Patch applies the patch and returns the patched projectInventory. +func (c *FakeProjectInventories) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ProjectInventory, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(projectinventoriesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ProjectInventory{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProjectInventory), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_projectquery.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_projectquery.go new file mode 100644 index 000000000..6b457cafd --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_projectquery.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeProjectQueries implements ProjectQueryInterface +type FakeProjectQueries struct { + Fake *FakeGlobalTsmV1 +} + +var projectqueriesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "projectqueries"} + +var projectqueriesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ProjectQuery"} + +// Get takes name of the projectQuery, and returns the corresponding projectQuery object, and an error if there is any. +func (c *FakeProjectQueries) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ProjectQuery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(projectqueriesResource, name), &globaltsmtanzuvmwarecomv1.ProjectQuery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProjectQuery), err +} + +// List takes label and field selectors, and returns the list of ProjectQueries that match those selectors. +func (c *FakeProjectQueries) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ProjectQueryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(projectqueriesResource, projectqueriesKind, opts), &globaltsmtanzuvmwarecomv1.ProjectQueryList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ProjectQueryList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ProjectQueryList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ProjectQueryList).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 projectQueries. +func (c *FakeProjectQueries) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(projectqueriesResource, opts)) +} + +// Create takes the representation of a projectQuery and creates it. Returns the server's representation of the projectQuery, and an error, if there is any. +func (c *FakeProjectQueries) Create(ctx context.Context, projectQuery *globaltsmtanzuvmwarecomv1.ProjectQuery, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ProjectQuery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(projectqueriesResource, projectQuery), &globaltsmtanzuvmwarecomv1.ProjectQuery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProjectQuery), err +} + +// Update takes the representation of a projectQuery and updates it. Returns the server's representation of the projectQuery, and an error, if there is any. +func (c *FakeProjectQueries) Update(ctx context.Context, projectQuery *globaltsmtanzuvmwarecomv1.ProjectQuery, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ProjectQuery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(projectqueriesResource, projectQuery), &globaltsmtanzuvmwarecomv1.ProjectQuery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProjectQuery), err +} + +// Delete takes name of the projectQuery and deletes it. Returns an error if one occurs. +func (c *FakeProjectQueries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(projectqueriesResource, name), &globaltsmtanzuvmwarecomv1.ProjectQuery{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProjectQueries) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(projectqueriesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ProjectQueryList{}) + return err +} + +// Patch applies the patch and returns the patched projectQuery. +func (c *FakeProjectQueries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ProjectQuery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(projectqueriesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ProjectQuery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ProjectQuery), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_publicserviceconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_publicserviceconfig.go new file mode 100644 index 000000000..4e0073156 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_publicserviceconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakePublicServiceConfigs implements PublicServiceConfigInterface +type FakePublicServiceConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var publicserviceconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "publicserviceconfigs"} + +var publicserviceconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "PublicServiceConfig"} + +// Get takes name of the publicServiceConfig, and returns the corresponding publicServiceConfig object, and an error if there is any. +func (c *FakePublicServiceConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.PublicServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(publicserviceconfigsResource, name), &globaltsmtanzuvmwarecomv1.PublicServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PublicServiceConfig), err +} + +// List takes label and field selectors, and returns the list of PublicServiceConfigs that match those selectors. +func (c *FakePublicServiceConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.PublicServiceConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(publicserviceconfigsResource, publicserviceconfigsKind, opts), &globaltsmtanzuvmwarecomv1.PublicServiceConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.PublicServiceConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.PublicServiceConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.PublicServiceConfigList).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 publicServiceConfigs. +func (c *FakePublicServiceConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(publicserviceconfigsResource, opts)) +} + +// Create takes the representation of a publicServiceConfig and creates it. Returns the server's representation of the publicServiceConfig, and an error, if there is any. +func (c *FakePublicServiceConfigs) Create(ctx context.Context, publicServiceConfig *globaltsmtanzuvmwarecomv1.PublicServiceConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.PublicServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(publicserviceconfigsResource, publicServiceConfig), &globaltsmtanzuvmwarecomv1.PublicServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PublicServiceConfig), err +} + +// Update takes the representation of a publicServiceConfig and updates it. Returns the server's representation of the publicServiceConfig, and an error, if there is any. +func (c *FakePublicServiceConfigs) Update(ctx context.Context, publicServiceConfig *globaltsmtanzuvmwarecomv1.PublicServiceConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.PublicServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(publicserviceconfigsResource, publicServiceConfig), &globaltsmtanzuvmwarecomv1.PublicServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PublicServiceConfig), err +} + +// Delete takes name of the publicServiceConfig and deletes it. Returns an error if one occurs. +func (c *FakePublicServiceConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(publicserviceconfigsResource, name), &globaltsmtanzuvmwarecomv1.PublicServiceConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePublicServiceConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(publicserviceconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.PublicServiceConfigList{}) + return err +} + +// Patch applies the patch and returns the patched publicServiceConfig. +func (c *FakePublicServiceConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.PublicServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(publicserviceconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.PublicServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PublicServiceConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_publicservicerouteconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_publicservicerouteconfig.go new file mode 100644 index 000000000..faa68f706 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_publicservicerouteconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakePublicServiceRouteConfigs implements PublicServiceRouteConfigInterface +type FakePublicServiceRouteConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var publicservicerouteconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "publicservicerouteconfigs"} + +var publicservicerouteconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "PublicServiceRouteConfig"} + +// Get takes name of the publicServiceRouteConfig, and returns the corresponding publicServiceRouteConfig object, and an error if there is any. +func (c *FakePublicServiceRouteConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.PublicServiceRouteConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(publicservicerouteconfigsResource, name), &globaltsmtanzuvmwarecomv1.PublicServiceRouteConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PublicServiceRouteConfig), err +} + +// List takes label and field selectors, and returns the list of PublicServiceRouteConfigs that match those selectors. +func (c *FakePublicServiceRouteConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.PublicServiceRouteConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(publicservicerouteconfigsResource, publicservicerouteconfigsKind, opts), &globaltsmtanzuvmwarecomv1.PublicServiceRouteConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.PublicServiceRouteConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.PublicServiceRouteConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.PublicServiceRouteConfigList).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 publicServiceRouteConfigs. +func (c *FakePublicServiceRouteConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(publicservicerouteconfigsResource, opts)) +} + +// Create takes the representation of a publicServiceRouteConfig and creates it. Returns the server's representation of the publicServiceRouteConfig, and an error, if there is any. +func (c *FakePublicServiceRouteConfigs) Create(ctx context.Context, publicServiceRouteConfig *globaltsmtanzuvmwarecomv1.PublicServiceRouteConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.PublicServiceRouteConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(publicservicerouteconfigsResource, publicServiceRouteConfig), &globaltsmtanzuvmwarecomv1.PublicServiceRouteConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PublicServiceRouteConfig), err +} + +// Update takes the representation of a publicServiceRouteConfig and updates it. Returns the server's representation of the publicServiceRouteConfig, and an error, if there is any. +func (c *FakePublicServiceRouteConfigs) Update(ctx context.Context, publicServiceRouteConfig *globaltsmtanzuvmwarecomv1.PublicServiceRouteConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.PublicServiceRouteConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(publicservicerouteconfigsResource, publicServiceRouteConfig), &globaltsmtanzuvmwarecomv1.PublicServiceRouteConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PublicServiceRouteConfig), err +} + +// Delete takes name of the publicServiceRouteConfig and deletes it. Returns an error if one occurs. +func (c *FakePublicServiceRouteConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(publicservicerouteconfigsResource, name), &globaltsmtanzuvmwarecomv1.PublicServiceRouteConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePublicServiceRouteConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(publicservicerouteconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.PublicServiceRouteConfigList{}) + return err +} + +// Patch applies the patch and returns the patched publicServiceRouteConfig. +func (c *FakePublicServiceRouteConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.PublicServiceRouteConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(publicservicerouteconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.PublicServiceRouteConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PublicServiceRouteConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_publicservicert.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_publicservicert.go new file mode 100644 index 000000000..71bba7973 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_publicservicert.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakePublicServiceRTs implements PublicServiceRTInterface +type FakePublicServiceRTs struct { + Fake *FakeGlobalTsmV1 +} + +var publicservicertsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "publicservicerts"} + +var publicservicertsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "PublicServiceRT"} + +// Get takes name of the publicServiceRT, and returns the corresponding publicServiceRT object, and an error if there is any. +func (c *FakePublicServiceRTs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.PublicServiceRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(publicservicertsResource, name), &globaltsmtanzuvmwarecomv1.PublicServiceRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PublicServiceRT), err +} + +// List takes label and field selectors, and returns the list of PublicServiceRTs that match those selectors. +func (c *FakePublicServiceRTs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.PublicServiceRTList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(publicservicertsResource, publicservicertsKind, opts), &globaltsmtanzuvmwarecomv1.PublicServiceRTList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.PublicServiceRTList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.PublicServiceRTList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.PublicServiceRTList).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 publicServiceRTs. +func (c *FakePublicServiceRTs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(publicservicertsResource, opts)) +} + +// Create takes the representation of a publicServiceRT and creates it. Returns the server's representation of the publicServiceRT, and an error, if there is any. +func (c *FakePublicServiceRTs) Create(ctx context.Context, publicServiceRT *globaltsmtanzuvmwarecomv1.PublicServiceRT, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.PublicServiceRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(publicservicertsResource, publicServiceRT), &globaltsmtanzuvmwarecomv1.PublicServiceRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PublicServiceRT), err +} + +// Update takes the representation of a publicServiceRT and updates it. Returns the server's representation of the publicServiceRT, and an error, if there is any. +func (c *FakePublicServiceRTs) Update(ctx context.Context, publicServiceRT *globaltsmtanzuvmwarecomv1.PublicServiceRT, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.PublicServiceRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(publicservicertsResource, publicServiceRT), &globaltsmtanzuvmwarecomv1.PublicServiceRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PublicServiceRT), err +} + +// Delete takes name of the publicServiceRT and deletes it. Returns an error if one occurs. +func (c *FakePublicServiceRTs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(publicservicertsResource, name), &globaltsmtanzuvmwarecomv1.PublicServiceRT{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePublicServiceRTs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(publicservicertsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.PublicServiceRTList{}) + return err +} + +// Patch applies the patch and returns the patched publicServiceRT. +func (c *FakePublicServiceRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.PublicServiceRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(publicservicertsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.PublicServiceRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.PublicServiceRT), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_remotegatewayserviceconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_remotegatewayserviceconfig.go new file mode 100644 index 000000000..80e0f45ec --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_remotegatewayserviceconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeRemoteGatewayServiceConfigs implements RemoteGatewayServiceConfigInterface +type FakeRemoteGatewayServiceConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var remotegatewayserviceconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "remotegatewayserviceconfigs"} + +var remotegatewayserviceconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "RemoteGatewayServiceConfig"} + +// Get takes name of the remoteGatewayServiceConfig, and returns the corresponding remoteGatewayServiceConfig object, and an error if there is any. +func (c *FakeRemoteGatewayServiceConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(remotegatewayserviceconfigsResource, name), &globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig), err +} + +// List takes label and field selectors, and returns the list of RemoteGatewayServiceConfigs that match those selectors. +func (c *FakeRemoteGatewayServiceConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(remotegatewayserviceconfigsResource, remotegatewayserviceconfigsKind, opts), &globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfigList).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 remoteGatewayServiceConfigs. +func (c *FakeRemoteGatewayServiceConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(remotegatewayserviceconfigsResource, opts)) +} + +// Create takes the representation of a remoteGatewayServiceConfig and creates it. Returns the server's representation of the remoteGatewayServiceConfig, and an error, if there is any. +func (c *FakeRemoteGatewayServiceConfigs) Create(ctx context.Context, remoteGatewayServiceConfig *globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(remotegatewayserviceconfigsResource, remoteGatewayServiceConfig), &globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig), err +} + +// Update takes the representation of a remoteGatewayServiceConfig and updates it. Returns the server's representation of the remoteGatewayServiceConfig, and an error, if there is any. +func (c *FakeRemoteGatewayServiceConfigs) Update(ctx context.Context, remoteGatewayServiceConfig *globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(remotegatewayserviceconfigsResource, remoteGatewayServiceConfig), &globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig), err +} + +// Delete takes name of the remoteGatewayServiceConfig and deletes it. Returns an error if one occurs. +func (c *FakeRemoteGatewayServiceConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(remotegatewayserviceconfigsResource, name), &globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeRemoteGatewayServiceConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(remotegatewayserviceconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfigList{}) + return err +} + +// Patch applies the patch and returns the patched remoteGatewayServiceConfig. +func (c *FakeRemoteGatewayServiceConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(remotegatewayserviceconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_resourcegroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_resourcegroup.go new file mode 100644 index 000000000..658bb6af2 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_resourcegroup.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeResourceGroups implements ResourceGroupInterface +type FakeResourceGroups struct { + Fake *FakeGlobalTsmV1 +} + +var resourcegroupsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "resourcegroups"} + +var resourcegroupsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ResourceGroup"} + +// Get takes name of the resourceGroup, and returns the corresponding resourceGroup object, and an error if there is any. +func (c *FakeResourceGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ResourceGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(resourcegroupsResource, name), &globaltsmtanzuvmwarecomv1.ResourceGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ResourceGroup), err +} + +// List takes label and field selectors, and returns the list of ResourceGroups that match those selectors. +func (c *FakeResourceGroups) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ResourceGroupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(resourcegroupsResource, resourcegroupsKind, opts), &globaltsmtanzuvmwarecomv1.ResourceGroupList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ResourceGroupList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ResourceGroupList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ResourceGroupList).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 resourceGroups. +func (c *FakeResourceGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(resourcegroupsResource, opts)) +} + +// Create takes the representation of a resourceGroup and creates it. Returns the server's representation of the resourceGroup, and an error, if there is any. +func (c *FakeResourceGroups) Create(ctx context.Context, resourceGroup *globaltsmtanzuvmwarecomv1.ResourceGroup, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ResourceGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(resourcegroupsResource, resourceGroup), &globaltsmtanzuvmwarecomv1.ResourceGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ResourceGroup), err +} + +// Update takes the representation of a resourceGroup and updates it. Returns the server's representation of the resourceGroup, and an error, if there is any. +func (c *FakeResourceGroups) Update(ctx context.Context, resourceGroup *globaltsmtanzuvmwarecomv1.ResourceGroup, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ResourceGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(resourcegroupsResource, resourceGroup), &globaltsmtanzuvmwarecomv1.ResourceGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ResourceGroup), err +} + +// Delete takes name of the resourceGroup and deletes it. Returns an error if one occurs. +func (c *FakeResourceGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(resourcegroupsResource, name), &globaltsmtanzuvmwarecomv1.ResourceGroup{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeResourceGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(resourcegroupsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ResourceGroupList{}) + return err +} + +// Patch applies the patch and returns the patched resourceGroup. +func (c *FakeResourceGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ResourceGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(resourcegroupsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ResourceGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ResourceGroup), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_resourcegrouprt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_resourcegrouprt.go new file mode 100644 index 000000000..3ff80b7fd --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_resourcegrouprt.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeResourceGroupRTs implements ResourceGroupRTInterface +type FakeResourceGroupRTs struct { + Fake *FakeGlobalTsmV1 +} + +var resourcegrouprtsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "resourcegrouprts"} + +var resourcegrouprtsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ResourceGroupRT"} + +// Get takes name of the resourceGroupRT, and returns the corresponding resourceGroupRT object, and an error if there is any. +func (c *FakeResourceGroupRTs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ResourceGroupRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(resourcegrouprtsResource, name), &globaltsmtanzuvmwarecomv1.ResourceGroupRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ResourceGroupRT), err +} + +// List takes label and field selectors, and returns the list of ResourceGroupRTs that match those selectors. +func (c *FakeResourceGroupRTs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ResourceGroupRTList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(resourcegrouprtsResource, resourcegrouprtsKind, opts), &globaltsmtanzuvmwarecomv1.ResourceGroupRTList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ResourceGroupRTList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ResourceGroupRTList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ResourceGroupRTList).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 resourceGroupRTs. +func (c *FakeResourceGroupRTs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(resourcegrouprtsResource, opts)) +} + +// Create takes the representation of a resourceGroupRT and creates it. Returns the server's representation of the resourceGroupRT, and an error, if there is any. +func (c *FakeResourceGroupRTs) Create(ctx context.Context, resourceGroupRT *globaltsmtanzuvmwarecomv1.ResourceGroupRT, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ResourceGroupRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(resourcegrouprtsResource, resourceGroupRT), &globaltsmtanzuvmwarecomv1.ResourceGroupRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ResourceGroupRT), err +} + +// Update takes the representation of a resourceGroupRT and updates it. Returns the server's representation of the resourceGroupRT, and an error, if there is any. +func (c *FakeResourceGroupRTs) Update(ctx context.Context, resourceGroupRT *globaltsmtanzuvmwarecomv1.ResourceGroupRT, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ResourceGroupRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(resourcegrouprtsResource, resourceGroupRT), &globaltsmtanzuvmwarecomv1.ResourceGroupRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ResourceGroupRT), err +} + +// Delete takes name of the resourceGroupRT and deletes it. Returns an error if one occurs. +func (c *FakeResourceGroupRTs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(resourcegrouprtsResource, name), &globaltsmtanzuvmwarecomv1.ResourceGroupRT{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeResourceGroupRTs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(resourcegrouprtsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ResourceGroupRTList{}) + return err +} + +// Patch applies the patch and returns the patched resourceGroupRT. +func (c *FakeResourceGroupRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ResourceGroupRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(resourcegrouprtsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ResourceGroupRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ResourceGroupRT), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_root.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_root.go new file mode 100644 index 000000000..82b9ccca3 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_root.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeRoots implements RootInterface +type FakeRoots struct { + Fake *FakeGlobalTsmV1 +} + +var rootsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "roots"} + +var rootsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Root"} + +// Get takes name of the root, and returns the corresponding root object, and an error if there is any. +func (c *FakeRoots) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Root, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(rootsResource, name), &globaltsmtanzuvmwarecomv1.Root{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Root), err +} + +// List takes label and field selectors, and returns the list of Roots that match those selectors. +func (c *FakeRoots) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.RootList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(rootsResource, rootsKind, opts), &globaltsmtanzuvmwarecomv1.RootList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.RootList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.RootList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.RootList).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 roots. +func (c *FakeRoots) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(rootsResource, opts)) +} + +// Create takes the representation of a root and creates it. Returns the server's representation of the root, and an error, if there is any. +func (c *FakeRoots) Create(ctx context.Context, root *globaltsmtanzuvmwarecomv1.Root, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Root, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(rootsResource, root), &globaltsmtanzuvmwarecomv1.Root{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Root), err +} + +// Update takes the representation of a root and updates it. Returns the server's representation of the root, and an error, if there is any. +func (c *FakeRoots) Update(ctx context.Context, root *globaltsmtanzuvmwarecomv1.Root, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Root, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(rootsResource, root), &globaltsmtanzuvmwarecomv1.Root{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Root), err +} + +// Delete takes name of the root and deletes it. Returns an error if one occurs. +func (c *FakeRoots) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(rootsResource, name), &globaltsmtanzuvmwarecomv1.Root{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeRoots) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(rootsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.RootList{}) + return err +} + +// Patch applies the patch and returns the patched root. +func (c *FakeRoots) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Root, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(rootsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Root{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Root), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_rpolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_rpolicy.go new file mode 100644 index 000000000..059fbad68 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_rpolicy.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeRPolicies implements RPolicyInterface +type FakeRPolicies struct { + Fake *FakeGlobalTsmV1 +} + +var rpoliciesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "rpolicies"} + +var rpoliciesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "RPolicy"} + +// Get takes name of the rPolicy, and returns the corresponding rPolicy object, and an error if there is any. +func (c *FakeRPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.RPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(rpoliciesResource, name), &globaltsmtanzuvmwarecomv1.RPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.RPolicy), err +} + +// List takes label and field selectors, and returns the list of RPolicies that match those selectors. +func (c *FakeRPolicies) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.RPolicyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(rpoliciesResource, rpoliciesKind, opts), &globaltsmtanzuvmwarecomv1.RPolicyList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.RPolicyList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.RPolicyList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.RPolicyList).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 rPolicies. +func (c *FakeRPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(rpoliciesResource, opts)) +} + +// Create takes the representation of a rPolicy and creates it. Returns the server's representation of the rPolicy, and an error, if there is any. +func (c *FakeRPolicies) Create(ctx context.Context, rPolicy *globaltsmtanzuvmwarecomv1.RPolicy, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.RPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(rpoliciesResource, rPolicy), &globaltsmtanzuvmwarecomv1.RPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.RPolicy), err +} + +// Update takes the representation of a rPolicy and updates it. Returns the server's representation of the rPolicy, and an error, if there is any. +func (c *FakeRPolicies) Update(ctx context.Context, rPolicy *globaltsmtanzuvmwarecomv1.RPolicy, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.RPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(rpoliciesResource, rPolicy), &globaltsmtanzuvmwarecomv1.RPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.RPolicy), err +} + +// Delete takes name of the rPolicy and deletes it. Returns an error if one occurs. +func (c *FakeRPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(rpoliciesResource, name), &globaltsmtanzuvmwarecomv1.RPolicy{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeRPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(rpoliciesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.RPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched rPolicy. +func (c *FakeRPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.RPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(rpoliciesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.RPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.RPolicy), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_runtime.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_runtime.go new file mode 100644 index 000000000..5d6471a94 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_runtime.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeRuntimes implements RuntimeInterface +type FakeRuntimes struct { + Fake *FakeGlobalTsmV1 +} + +var runtimesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "runtimes"} + +var runtimesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Runtime"} + +// Get takes name of the runtime, and returns the corresponding runtime object, and an error if there is any. +func (c *FakeRuntimes) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Runtime, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(runtimesResource, name), &globaltsmtanzuvmwarecomv1.Runtime{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Runtime), err +} + +// List takes label and field selectors, and returns the list of Runtimes that match those selectors. +func (c *FakeRuntimes) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.RuntimeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(runtimesResource, runtimesKind, opts), &globaltsmtanzuvmwarecomv1.RuntimeList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.RuntimeList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.RuntimeList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.RuntimeList).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 runtimes. +func (c *FakeRuntimes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(runtimesResource, opts)) +} + +// Create takes the representation of a runtime and creates it. Returns the server's representation of the runtime, and an error, if there is any. +func (c *FakeRuntimes) Create(ctx context.Context, runtime *globaltsmtanzuvmwarecomv1.Runtime, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Runtime, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(runtimesResource, runtime), &globaltsmtanzuvmwarecomv1.Runtime{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Runtime), err +} + +// Update takes the representation of a runtime and updates it. Returns the server's representation of the runtime, and an error, if there is any. +func (c *FakeRuntimes) Update(ctx context.Context, runtime *globaltsmtanzuvmwarecomv1.Runtime, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Runtime, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(runtimesResource, runtime), &globaltsmtanzuvmwarecomv1.Runtime{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Runtime), err +} + +// Delete takes name of the runtime and deletes it. Returns an error if one occurs. +func (c *FakeRuntimes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(runtimesResource, name), &globaltsmtanzuvmwarecomv1.Runtime{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeRuntimes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(runtimesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.RuntimeList{}) + return err +} + +// Patch applies the patch and returns the patched runtime. +func (c *FakeRuntimes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Runtime, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(runtimesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Runtime{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Runtime), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_schemaviolationdiscoveryrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_schemaviolationdiscoveryrt.go new file mode 100644 index 000000000..65e362e0e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_schemaviolationdiscoveryrt.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeSchemaViolationDiscoveryRTs implements SchemaViolationDiscoveryRTInterface +type FakeSchemaViolationDiscoveryRTs struct { + Fake *FakeGlobalTsmV1 +} + +var schemaviolationdiscoveryrtsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "schemaviolationdiscoveryrts"} + +var schemaviolationdiscoveryrtsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "SchemaViolationDiscoveryRT"} + +// Get takes name of the schemaViolationDiscoveryRT, and returns the corresponding schemaViolationDiscoveryRT object, and an error if there is any. +func (c *FakeSchemaViolationDiscoveryRTs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(schemaviolationdiscoveryrtsResource, name), &globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT), err +} + +// List takes label and field selectors, and returns the list of SchemaViolationDiscoveryRTs that match those selectors. +func (c *FakeSchemaViolationDiscoveryRTs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRTList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(schemaviolationdiscoveryrtsResource, schemaviolationdiscoveryrtsKind, opts), &globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRTList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRTList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRTList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRTList).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 schemaViolationDiscoveryRTs. +func (c *FakeSchemaViolationDiscoveryRTs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(schemaviolationdiscoveryrtsResource, opts)) +} + +// Create takes the representation of a schemaViolationDiscoveryRT and creates it. Returns the server's representation of the schemaViolationDiscoveryRT, and an error, if there is any. +func (c *FakeSchemaViolationDiscoveryRTs) Create(ctx context.Context, schemaViolationDiscoveryRT *globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(schemaviolationdiscoveryrtsResource, schemaViolationDiscoveryRT), &globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT), err +} + +// Update takes the representation of a schemaViolationDiscoveryRT and updates it. Returns the server's representation of the schemaViolationDiscoveryRT, and an error, if there is any. +func (c *FakeSchemaViolationDiscoveryRTs) Update(ctx context.Context, schemaViolationDiscoveryRT *globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(schemaviolationdiscoveryrtsResource, schemaViolationDiscoveryRT), &globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT), err +} + +// Delete takes name of the schemaViolationDiscoveryRT and deletes it. Returns an error if one occurs. +func (c *FakeSchemaViolationDiscoveryRTs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(schemaviolationdiscoveryrtsResource, name), &globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSchemaViolationDiscoveryRTs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(schemaviolationdiscoveryrtsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRTList{}) + return err +} + +// Patch applies the patch and returns the patched schemaViolationDiscoveryRT. +func (c *FakeSchemaViolationDiscoveryRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(schemaviolationdiscoveryrtsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_secrethash.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_secrethash.go new file mode 100644 index 000000000..15fbb251e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_secrethash.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeSecretHashes implements SecretHashInterface +type FakeSecretHashes struct { + Fake *FakeGlobalTsmV1 +} + +var secrethashesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "secrethashes"} + +var secrethashesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "SecretHash"} + +// Get takes name of the secretHash, and returns the corresponding secretHash object, and an error if there is any. +func (c *FakeSecretHashes) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.SecretHash, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(secrethashesResource, name), &globaltsmtanzuvmwarecomv1.SecretHash{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SecretHash), err +} + +// List takes label and field selectors, and returns the list of SecretHashes that match those selectors. +func (c *FakeSecretHashes) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.SecretHashList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(secrethashesResource, secrethashesKind, opts), &globaltsmtanzuvmwarecomv1.SecretHashList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.SecretHashList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.SecretHashList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.SecretHashList).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 secretHashes. +func (c *FakeSecretHashes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(secrethashesResource, opts)) +} + +// Create takes the representation of a secretHash and creates it. Returns the server's representation of the secretHash, and an error, if there is any. +func (c *FakeSecretHashes) Create(ctx context.Context, secretHash *globaltsmtanzuvmwarecomv1.SecretHash, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.SecretHash, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(secrethashesResource, secretHash), &globaltsmtanzuvmwarecomv1.SecretHash{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SecretHash), err +} + +// Update takes the representation of a secretHash and updates it. Returns the server's representation of the secretHash, and an error, if there is any. +func (c *FakeSecretHashes) Update(ctx context.Context, secretHash *globaltsmtanzuvmwarecomv1.SecretHash, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.SecretHash, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(secrethashesResource, secretHash), &globaltsmtanzuvmwarecomv1.SecretHash{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SecretHash), err +} + +// Delete takes name of the secretHash and deletes it. Returns an error if one occurs. +func (c *FakeSecretHashes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(secrethashesResource, name), &globaltsmtanzuvmwarecomv1.SecretHash{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSecretHashes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(secrethashesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.SecretHashList{}) + return err +} + +// Patch applies the patch and returns the patched secretHash. +func (c *FakeSecretHashes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.SecretHash, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(secrethashesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.SecretHash{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SecretHash), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_secretrtconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_secretrtconfig.go new file mode 100644 index 000000000..7e497ca15 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_secretrtconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeSecretRTConfigs implements SecretRTConfigInterface +type FakeSecretRTConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var secretrtconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "secretrtconfigs"} + +var secretrtconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "SecretRTConfig"} + +// Get takes name of the secretRTConfig, and returns the corresponding secretRTConfig object, and an error if there is any. +func (c *FakeSecretRTConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.SecretRTConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(secretrtconfigsResource, name), &globaltsmtanzuvmwarecomv1.SecretRTConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SecretRTConfig), err +} + +// List takes label and field selectors, and returns the list of SecretRTConfigs that match those selectors. +func (c *FakeSecretRTConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.SecretRTConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(secretrtconfigsResource, secretrtconfigsKind, opts), &globaltsmtanzuvmwarecomv1.SecretRTConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.SecretRTConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.SecretRTConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.SecretRTConfigList).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 secretRTConfigs. +func (c *FakeSecretRTConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(secretrtconfigsResource, opts)) +} + +// Create takes the representation of a secretRTConfig and creates it. Returns the server's representation of the secretRTConfig, and an error, if there is any. +func (c *FakeSecretRTConfigs) Create(ctx context.Context, secretRTConfig *globaltsmtanzuvmwarecomv1.SecretRTConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.SecretRTConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(secretrtconfigsResource, secretRTConfig), &globaltsmtanzuvmwarecomv1.SecretRTConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SecretRTConfig), err +} + +// Update takes the representation of a secretRTConfig and updates it. Returns the server's representation of the secretRTConfig, and an error, if there is any. +func (c *FakeSecretRTConfigs) Update(ctx context.Context, secretRTConfig *globaltsmtanzuvmwarecomv1.SecretRTConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.SecretRTConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(secretrtconfigsResource, secretRTConfig), &globaltsmtanzuvmwarecomv1.SecretRTConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SecretRTConfig), err +} + +// Delete takes name of the secretRTConfig and deletes it. Returns an error if one occurs. +func (c *FakeSecretRTConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(secretrtconfigsResource, name), &globaltsmtanzuvmwarecomv1.SecretRTConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSecretRTConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(secretrtconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.SecretRTConfigList{}) + return err +} + +// Patch applies the patch and returns the patched secretRTConfig. +func (c *FakeSecretRTConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.SecretRTConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(secretrtconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.SecretRTConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SecretRTConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_securitycontextconstraints.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_securitycontextconstraints.go new file mode 100644 index 000000000..ea0ced6f4 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_securitycontextconstraints.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeSecurityContextConstraintses implements SecurityContextConstraintsInterface +type FakeSecurityContextConstraintses struct { + Fake *FakeGlobalTsmV1 +} + +var securitycontextconstraintsesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "securitycontextconstraintses"} + +var securitycontextconstraintsesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "SecurityContextConstraints"} + +// Get takes name of the securityContextConstraints, and returns the corresponding securityContextConstraints object, and an error if there is any. +func (c *FakeSecurityContextConstraintses) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.SecurityContextConstraints, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(securitycontextconstraintsesResource, name), &globaltsmtanzuvmwarecomv1.SecurityContextConstraints{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SecurityContextConstraints), err +} + +// List takes label and field selectors, and returns the list of SecurityContextConstraintses that match those selectors. +func (c *FakeSecurityContextConstraintses) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.SecurityContextConstraintsList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(securitycontextconstraintsesResource, securitycontextconstraintsesKind, opts), &globaltsmtanzuvmwarecomv1.SecurityContextConstraintsList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.SecurityContextConstraintsList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.SecurityContextConstraintsList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.SecurityContextConstraintsList).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 securityContextConstraintses. +func (c *FakeSecurityContextConstraintses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(securitycontextconstraintsesResource, opts)) +} + +// Create takes the representation of a securityContextConstraints and creates it. Returns the server's representation of the securityContextConstraints, and an error, if there is any. +func (c *FakeSecurityContextConstraintses) Create(ctx context.Context, securityContextConstraints *globaltsmtanzuvmwarecomv1.SecurityContextConstraints, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.SecurityContextConstraints, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(securitycontextconstraintsesResource, securityContextConstraints), &globaltsmtanzuvmwarecomv1.SecurityContextConstraints{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SecurityContextConstraints), err +} + +// Update takes the representation of a securityContextConstraints and updates it. Returns the server's representation of the securityContextConstraints, and an error, if there is any. +func (c *FakeSecurityContextConstraintses) Update(ctx context.Context, securityContextConstraints *globaltsmtanzuvmwarecomv1.SecurityContextConstraints, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.SecurityContextConstraints, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(securitycontextconstraintsesResource, securityContextConstraints), &globaltsmtanzuvmwarecomv1.SecurityContextConstraints{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SecurityContextConstraints), err +} + +// Delete takes name of the securityContextConstraints and deletes it. Returns an error if one occurs. +func (c *FakeSecurityContextConstraintses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(securitycontextconstraintsesResource, name), &globaltsmtanzuvmwarecomv1.SecurityContextConstraints{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSecurityContextConstraintses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(securitycontextconstraintsesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.SecurityContextConstraintsList{}) + return err +} + +// Patch applies the patch and returns the patched securityContextConstraints. +func (c *FakeSecurityContextConstraintses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.SecurityContextConstraints, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(securitycontextconstraintsesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.SecurityContextConstraints{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SecurityContextConstraints), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_securitycontextconstraintsconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_securitycontextconstraintsconfig.go new file mode 100644 index 000000000..84a7a36e0 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_securitycontextconstraintsconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeSecurityContextConstraintsConfigs implements SecurityContextConstraintsConfigInterface +type FakeSecurityContextConstraintsConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var securitycontextconstraintsconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "securitycontextconstraintsconfigs"} + +var securitycontextconstraintsconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "SecurityContextConstraintsConfig"} + +// Get takes name of the securityContextConstraintsConfig, and returns the corresponding securityContextConstraintsConfig object, and an error if there is any. +func (c *FakeSecurityContextConstraintsConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(securitycontextconstraintsconfigsResource, name), &globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig), err +} + +// List takes label and field selectors, and returns the list of SecurityContextConstraintsConfigs that match those selectors. +func (c *FakeSecurityContextConstraintsConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(securitycontextconstraintsconfigsResource, securitycontextconstraintsconfigsKind, opts), &globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfigList).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 securityContextConstraintsConfigs. +func (c *FakeSecurityContextConstraintsConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(securitycontextconstraintsconfigsResource, opts)) +} + +// Create takes the representation of a securityContextConstraintsConfig and creates it. Returns the server's representation of the securityContextConstraintsConfig, and an error, if there is any. +func (c *FakeSecurityContextConstraintsConfigs) Create(ctx context.Context, securityContextConstraintsConfig *globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(securitycontextconstraintsconfigsResource, securityContextConstraintsConfig), &globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig), err +} + +// Update takes the representation of a securityContextConstraintsConfig and updates it. Returns the server's representation of the securityContextConstraintsConfig, and an error, if there is any. +func (c *FakeSecurityContextConstraintsConfigs) Update(ctx context.Context, securityContextConstraintsConfig *globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(securitycontextconstraintsconfigsResource, securityContextConstraintsConfig), &globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig), err +} + +// Delete takes name of the securityContextConstraintsConfig and deletes it. Returns an error if one occurs. +func (c *FakeSecurityContextConstraintsConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(securitycontextconstraintsconfigsResource, name), &globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSecurityContextConstraintsConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(securitycontextconstraintsconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfigList{}) + return err +} + +// Patch applies the patch and returns the patched securityContextConstraintsConfig. +func (c *FakeSecurityContextConstraintsConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(securitycontextconstraintsconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_service.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_service.go new file mode 100644 index 000000000..e22c7423d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_service.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServices implements ServiceInterface +type FakeServices struct { + Fake *FakeGlobalTsmV1 +} + +var servicesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "services"} + +var servicesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Service"} + +// Get takes name of the service, and returns the corresponding service object, and an error if there is any. +func (c *FakeServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Service, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicesResource, name), &globaltsmtanzuvmwarecomv1.Service{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Service), err +} + +// List takes label and field selectors, and returns the list of Services that match those selectors. +func (c *FakeServices) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicesResource, servicesKind, opts), &globaltsmtanzuvmwarecomv1.ServiceList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceList).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 services. +func (c *FakeServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicesResource, opts)) +} + +// Create takes the representation of a service and creates it. Returns the server's representation of the service, and an error, if there is any. +func (c *FakeServices) Create(ctx context.Context, service *globaltsmtanzuvmwarecomv1.Service, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Service, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicesResource, service), &globaltsmtanzuvmwarecomv1.Service{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Service), err +} + +// Update takes the representation of a service and updates it. Returns the server's representation of the service, and an error, if there is any. +func (c *FakeServices) Update(ctx context.Context, service *globaltsmtanzuvmwarecomv1.Service, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Service, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicesResource, service), &globaltsmtanzuvmwarecomv1.Service{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Service), err +} + +// Delete takes name of the service and deletes it. Returns an error if one occurs. +func (c *FakeServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicesResource, name), &globaltsmtanzuvmwarecomv1.Service{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceList{}) + return err +} + +// Patch applies the patch and returns the patched service. +func (c *FakeServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Service, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Service{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Service), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceconfig.go new file mode 100644 index 000000000..3128ad318 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceConfigs implements ServiceConfigInterface +type FakeServiceConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var serviceconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "serviceconfigs"} + +var serviceconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceConfig"} + +// Get takes name of the serviceConfig, and returns the corresponding serviceConfig object, and an error if there is any. +func (c *FakeServiceConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(serviceconfigsResource, name), &globaltsmtanzuvmwarecomv1.ServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceConfig), err +} + +// List takes label and field selectors, and returns the list of ServiceConfigs that match those selectors. +func (c *FakeServiceConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(serviceconfigsResource, serviceconfigsKind, opts), &globaltsmtanzuvmwarecomv1.ServiceConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceConfigList).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 serviceConfigs. +func (c *FakeServiceConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(serviceconfigsResource, opts)) +} + +// Create takes the representation of a serviceConfig and creates it. Returns the server's representation of the serviceConfig, and an error, if there is any. +func (c *FakeServiceConfigs) Create(ctx context.Context, serviceConfig *globaltsmtanzuvmwarecomv1.ServiceConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(serviceconfigsResource, serviceConfig), &globaltsmtanzuvmwarecomv1.ServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceConfig), err +} + +// Update takes the representation of a serviceConfig and updates it. Returns the server's representation of the serviceConfig, and an error, if there is any. +func (c *FakeServiceConfigs) Update(ctx context.Context, serviceConfig *globaltsmtanzuvmwarecomv1.ServiceConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(serviceconfigsResource, serviceConfig), &globaltsmtanzuvmwarecomv1.ServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceConfig), err +} + +// Delete takes name of the serviceConfig and deletes it. Returns an error if one occurs. +func (c *FakeServiceConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(serviceconfigsResource, name), &globaltsmtanzuvmwarecomv1.ServiceConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(serviceconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceConfigList{}) + return err +} + +// Patch applies the patch and returns the patched serviceConfig. +func (c *FakeServiceConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(serviceconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicecronjob.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicecronjob.go new file mode 100644 index 000000000..ee4880cab --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicecronjob.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceCronJobs implements ServiceCronJobInterface +type FakeServiceCronJobs struct { + Fake *FakeGlobalTsmV1 +} + +var servicecronjobsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "servicecronjobs"} + +var servicecronjobsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceCronJob"} + +// Get takes name of the serviceCronJob, and returns the corresponding serviceCronJob object, and an error if there is any. +func (c *FakeServiceCronJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceCronJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicecronjobsResource, name), &globaltsmtanzuvmwarecomv1.ServiceCronJob{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceCronJob), err +} + +// List takes label and field selectors, and returns the list of ServiceCronJobs that match those selectors. +func (c *FakeServiceCronJobs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceCronJobList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicecronjobsResource, servicecronjobsKind, opts), &globaltsmtanzuvmwarecomv1.ServiceCronJobList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceCronJobList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceCronJobList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceCronJobList).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 serviceCronJobs. +func (c *FakeServiceCronJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicecronjobsResource, opts)) +} + +// Create takes the representation of a serviceCronJob and creates it. Returns the server's representation of the serviceCronJob, and an error, if there is any. +func (c *FakeServiceCronJobs) Create(ctx context.Context, serviceCronJob *globaltsmtanzuvmwarecomv1.ServiceCronJob, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceCronJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicecronjobsResource, serviceCronJob), &globaltsmtanzuvmwarecomv1.ServiceCronJob{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceCronJob), err +} + +// Update takes the representation of a serviceCronJob and updates it. Returns the server's representation of the serviceCronJob, and an error, if there is any. +func (c *FakeServiceCronJobs) Update(ctx context.Context, serviceCronJob *globaltsmtanzuvmwarecomv1.ServiceCronJob, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceCronJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicecronjobsResource, serviceCronJob), &globaltsmtanzuvmwarecomv1.ServiceCronJob{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceCronJob), err +} + +// Delete takes name of the serviceCronJob and deletes it. Returns an error if one occurs. +func (c *FakeServiceCronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicecronjobsResource, name), &globaltsmtanzuvmwarecomv1.ServiceCronJob{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceCronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicecronjobsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceCronJobList{}) + return err +} + +// Patch applies the patch and returns the patched serviceCronJob. +func (c *FakeServiceCronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceCronJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicecronjobsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceCronJob{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceCronJob), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedaemonset.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedaemonset.go new file mode 100644 index 000000000..12a3894db --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedaemonset.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceDaemonSets implements ServiceDaemonSetInterface +type FakeServiceDaemonSets struct { + Fake *FakeGlobalTsmV1 +} + +var servicedaemonsetsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "servicedaemonsets"} + +var servicedaemonsetsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceDaemonSet"} + +// Get takes name of the serviceDaemonSet, and returns the corresponding serviceDaemonSet object, and an error if there is any. +func (c *FakeServiceDaemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDaemonSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicedaemonsetsResource, name), &globaltsmtanzuvmwarecomv1.ServiceDaemonSet{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDaemonSet), err +} + +// List takes label and field selectors, and returns the list of ServiceDaemonSets that match those selectors. +func (c *FakeServiceDaemonSets) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDaemonSetList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicedaemonsetsResource, servicedaemonsetsKind, opts), &globaltsmtanzuvmwarecomv1.ServiceDaemonSetList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceDaemonSetList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceDaemonSetList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceDaemonSetList).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 serviceDaemonSets. +func (c *FakeServiceDaemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicedaemonsetsResource, opts)) +} + +// Create takes the representation of a serviceDaemonSet and creates it. Returns the server's representation of the serviceDaemonSet, and an error, if there is any. +func (c *FakeServiceDaemonSets) Create(ctx context.Context, serviceDaemonSet *globaltsmtanzuvmwarecomv1.ServiceDaemonSet, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDaemonSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicedaemonsetsResource, serviceDaemonSet), &globaltsmtanzuvmwarecomv1.ServiceDaemonSet{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDaemonSet), err +} + +// Update takes the representation of a serviceDaemonSet and updates it. Returns the server's representation of the serviceDaemonSet, and an error, if there is any. +func (c *FakeServiceDaemonSets) Update(ctx context.Context, serviceDaemonSet *globaltsmtanzuvmwarecomv1.ServiceDaemonSet, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDaemonSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicedaemonsetsResource, serviceDaemonSet), &globaltsmtanzuvmwarecomv1.ServiceDaemonSet{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDaemonSet), err +} + +// Delete takes name of the serviceDaemonSet and deletes it. Returns an error if one occurs. +func (c *FakeServiceDaemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicedaemonsetsResource, name), &globaltsmtanzuvmwarecomv1.ServiceDaemonSet{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceDaemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicedaemonsetsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceDaemonSetList{}) + return err +} + +// Patch applies the patch and returns the patched serviceDaemonSet. +func (c *FakeServiceDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceDaemonSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicedaemonsetsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceDaemonSet{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDaemonSet), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedeployment.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedeployment.go new file mode 100644 index 000000000..1a290e7a4 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedeployment.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceDeployments implements ServiceDeploymentInterface +type FakeServiceDeployments struct { + Fake *FakeGlobalTsmV1 +} + +var servicedeploymentsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "servicedeployments"} + +var servicedeploymentsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceDeployment"} + +// Get takes name of the serviceDeployment, and returns the corresponding serviceDeployment object, and an error if there is any. +func (c *FakeServiceDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDeployment, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicedeploymentsResource, name), &globaltsmtanzuvmwarecomv1.ServiceDeployment{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDeployment), err +} + +// List takes label and field selectors, and returns the list of ServiceDeployments that match those selectors. +func (c *FakeServiceDeployments) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDeploymentList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicedeploymentsResource, servicedeploymentsKind, opts), &globaltsmtanzuvmwarecomv1.ServiceDeploymentList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceDeploymentList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceDeploymentList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceDeploymentList).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 serviceDeployments. +func (c *FakeServiceDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicedeploymentsResource, opts)) +} + +// Create takes the representation of a serviceDeployment and creates it. Returns the server's representation of the serviceDeployment, and an error, if there is any. +func (c *FakeServiceDeployments) Create(ctx context.Context, serviceDeployment *globaltsmtanzuvmwarecomv1.ServiceDeployment, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDeployment, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicedeploymentsResource, serviceDeployment), &globaltsmtanzuvmwarecomv1.ServiceDeployment{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDeployment), err +} + +// Update takes the representation of a serviceDeployment and updates it. Returns the server's representation of the serviceDeployment, and an error, if there is any. +func (c *FakeServiceDeployments) Update(ctx context.Context, serviceDeployment *globaltsmtanzuvmwarecomv1.ServiceDeployment, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDeployment, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicedeploymentsResource, serviceDeployment), &globaltsmtanzuvmwarecomv1.ServiceDeployment{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDeployment), err +} + +// Delete takes name of the serviceDeployment and deletes it. Returns an error if one occurs. +func (c *FakeServiceDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicedeploymentsResource, name), &globaltsmtanzuvmwarecomv1.ServiceDeployment{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicedeploymentsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceDeploymentList{}) + return err +} + +// Patch applies the patch and returns the patched serviceDeployment. +func (c *FakeServiceDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceDeployment, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicedeploymentsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceDeployment{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDeployment), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedeploymentcontainer.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedeploymentcontainer.go new file mode 100644 index 000000000..647fb175e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedeploymentcontainer.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceDeploymentContainers implements ServiceDeploymentContainerInterface +type FakeServiceDeploymentContainers struct { + Fake *FakeGlobalTsmV1 +} + +var servicedeploymentcontainersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "servicedeploymentcontainers"} + +var servicedeploymentcontainersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceDeploymentContainer"} + +// Get takes name of the serviceDeploymentContainer, and returns the corresponding serviceDeploymentContainer object, and an error if there is any. +func (c *FakeServiceDeploymentContainers) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDeploymentContainer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicedeploymentcontainersResource, name), &globaltsmtanzuvmwarecomv1.ServiceDeploymentContainer{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDeploymentContainer), err +} + +// List takes label and field selectors, and returns the list of ServiceDeploymentContainers that match those selectors. +func (c *FakeServiceDeploymentContainers) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDeploymentContainerList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicedeploymentcontainersResource, servicedeploymentcontainersKind, opts), &globaltsmtanzuvmwarecomv1.ServiceDeploymentContainerList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceDeploymentContainerList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceDeploymentContainerList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceDeploymentContainerList).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 serviceDeploymentContainers. +func (c *FakeServiceDeploymentContainers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicedeploymentcontainersResource, opts)) +} + +// Create takes the representation of a serviceDeploymentContainer and creates it. Returns the server's representation of the serviceDeploymentContainer, and an error, if there is any. +func (c *FakeServiceDeploymentContainers) Create(ctx context.Context, serviceDeploymentContainer *globaltsmtanzuvmwarecomv1.ServiceDeploymentContainer, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDeploymentContainer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicedeploymentcontainersResource, serviceDeploymentContainer), &globaltsmtanzuvmwarecomv1.ServiceDeploymentContainer{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDeploymentContainer), err +} + +// Update takes the representation of a serviceDeploymentContainer and updates it. Returns the server's representation of the serviceDeploymentContainer, and an error, if there is any. +func (c *FakeServiceDeploymentContainers) Update(ctx context.Context, serviceDeploymentContainer *globaltsmtanzuvmwarecomv1.ServiceDeploymentContainer, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDeploymentContainer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicedeploymentcontainersResource, serviceDeploymentContainer), &globaltsmtanzuvmwarecomv1.ServiceDeploymentContainer{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDeploymentContainer), err +} + +// Delete takes name of the serviceDeploymentContainer and deletes it. Returns an error if one occurs. +func (c *FakeServiceDeploymentContainers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicedeploymentcontainersResource, name), &globaltsmtanzuvmwarecomv1.ServiceDeploymentContainer{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceDeploymentContainers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicedeploymentcontainersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceDeploymentContainerList{}) + return err +} + +// Patch applies the patch and returns the patched serviceDeploymentContainer. +func (c *FakeServiceDeploymentContainers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceDeploymentContainer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicedeploymentcontainersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceDeploymentContainer{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDeploymentContainer), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedirectoryentryconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedirectoryentryconfig.go new file mode 100644 index 000000000..c8fb6a2cc --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedirectoryentryconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceDirectoryEntryConfigs implements ServiceDirectoryEntryConfigInterface +type FakeServiceDirectoryEntryConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var servicedirectoryentryconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "servicedirectoryentryconfigs"} + +var servicedirectoryentryconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceDirectoryEntryConfig"} + +// Get takes name of the serviceDirectoryEntryConfig, and returns the corresponding serviceDirectoryEntryConfig object, and an error if there is any. +func (c *FakeServiceDirectoryEntryConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicedirectoryentryconfigsResource, name), &globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig), err +} + +// List takes label and field selectors, and returns the list of ServiceDirectoryEntryConfigs that match those selectors. +func (c *FakeServiceDirectoryEntryConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicedirectoryentryconfigsResource, servicedirectoryentryconfigsKind, opts), &globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfigList).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 serviceDirectoryEntryConfigs. +func (c *FakeServiceDirectoryEntryConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicedirectoryentryconfigsResource, opts)) +} + +// Create takes the representation of a serviceDirectoryEntryConfig and creates it. Returns the server's representation of the serviceDirectoryEntryConfig, and an error, if there is any. +func (c *FakeServiceDirectoryEntryConfigs) Create(ctx context.Context, serviceDirectoryEntryConfig *globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicedirectoryentryconfigsResource, serviceDirectoryEntryConfig), &globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig), err +} + +// Update takes the representation of a serviceDirectoryEntryConfig and updates it. Returns the server's representation of the serviceDirectoryEntryConfig, and an error, if there is any. +func (c *FakeServiceDirectoryEntryConfigs) Update(ctx context.Context, serviceDirectoryEntryConfig *globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicedirectoryentryconfigsResource, serviceDirectoryEntryConfig), &globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig), err +} + +// Delete takes name of the serviceDirectoryEntryConfig and deletes it. Returns an error if one occurs. +func (c *FakeServiceDirectoryEntryConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicedirectoryentryconfigsResource, name), &globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceDirectoryEntryConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicedirectoryentryconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfigList{}) + return err +} + +// Patch applies the patch and returns the patched serviceDirectoryEntryConfig. +func (c *FakeServiceDirectoryEntryConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicedirectoryentryconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedirectoryn.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedirectoryn.go new file mode 100644 index 000000000..c15d6aed6 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedirectoryn.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceDirectoryNs implements ServiceDirectoryNInterface +type FakeServiceDirectoryNs struct { + Fake *FakeGlobalTsmV1 +} + +var servicedirectorynsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "servicedirectoryns"} + +var servicedirectorynsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceDirectoryN"} + +// Get takes name of the serviceDirectoryN, and returns the corresponding serviceDirectoryN object, and an error if there is any. +func (c *FakeServiceDirectoryNs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicedirectorynsResource, name), &globaltsmtanzuvmwarecomv1.ServiceDirectoryN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryN), err +} + +// List takes label and field selectors, and returns the list of ServiceDirectoryNs that match those selectors. +func (c *FakeServiceDirectoryNs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryNList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicedirectorynsResource, servicedirectorynsKind, opts), &globaltsmtanzuvmwarecomv1.ServiceDirectoryNList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceDirectoryNList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryNList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryNList).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 serviceDirectoryNs. +func (c *FakeServiceDirectoryNs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicedirectorynsResource, opts)) +} + +// Create takes the representation of a serviceDirectoryN and creates it. Returns the server's representation of the serviceDirectoryN, and an error, if there is any. +func (c *FakeServiceDirectoryNs) Create(ctx context.Context, serviceDirectoryN *globaltsmtanzuvmwarecomv1.ServiceDirectoryN, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicedirectorynsResource, serviceDirectoryN), &globaltsmtanzuvmwarecomv1.ServiceDirectoryN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryN), err +} + +// Update takes the representation of a serviceDirectoryN and updates it. Returns the server's representation of the serviceDirectoryN, and an error, if there is any. +func (c *FakeServiceDirectoryNs) Update(ctx context.Context, serviceDirectoryN *globaltsmtanzuvmwarecomv1.ServiceDirectoryN, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicedirectorynsResource, serviceDirectoryN), &globaltsmtanzuvmwarecomv1.ServiceDirectoryN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryN), err +} + +// Delete takes name of the serviceDirectoryN and deletes it. Returns an error if one occurs. +func (c *FakeServiceDirectoryNs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicedirectorynsResource, name), &globaltsmtanzuvmwarecomv1.ServiceDirectoryN{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceDirectoryNs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicedirectorynsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceDirectoryNList{}) + return err +} + +// Patch applies the patch and returns the patched serviceDirectoryN. +func (c *FakeServiceDirectoryNs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryN, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicedirectorynsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceDirectoryN{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryN), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedirectoryrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedirectoryrt.go new file mode 100644 index 000000000..f6562f41d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedirectoryrt.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceDirectoryRTs implements ServiceDirectoryRTInterface +type FakeServiceDirectoryRTs struct { + Fake *FakeGlobalTsmV1 +} + +var servicedirectoryrtsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "servicedirectoryrts"} + +var servicedirectoryrtsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceDirectoryRT"} + +// Get takes name of the serviceDirectoryRT, and returns the corresponding serviceDirectoryRT object, and an error if there is any. +func (c *FakeServiceDirectoryRTs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicedirectoryrtsResource, name), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRT), err +} + +// List takes label and field selectors, and returns the list of ServiceDirectoryRTs that match those selectors. +func (c *FakeServiceDirectoryRTs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryRTList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicedirectoryrtsResource, servicedirectoryrtsKind, opts), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRTList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRTList).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 serviceDirectoryRTs. +func (c *FakeServiceDirectoryRTs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicedirectoryrtsResource, opts)) +} + +// Create takes the representation of a serviceDirectoryRT and creates it. Returns the server's representation of the serviceDirectoryRT, and an error, if there is any. +func (c *FakeServiceDirectoryRTs) Create(ctx context.Context, serviceDirectoryRT *globaltsmtanzuvmwarecomv1.ServiceDirectoryRT, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicedirectoryrtsResource, serviceDirectoryRT), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRT), err +} + +// Update takes the representation of a serviceDirectoryRT and updates it. Returns the server's representation of the serviceDirectoryRT, and an error, if there is any. +func (c *FakeServiceDirectoryRTs) Update(ctx context.Context, serviceDirectoryRT *globaltsmtanzuvmwarecomv1.ServiceDirectoryRT, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicedirectoryrtsResource, serviceDirectoryRT), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRT), err +} + +// Delete takes name of the serviceDirectoryRT and deletes it. Returns an error if one occurs. +func (c *FakeServiceDirectoryRTs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicedirectoryrtsResource, name), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRT{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceDirectoryRTs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicedirectoryrtsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTList{}) + return err +} + +// Patch applies the patch and returns the patched serviceDirectoryRT. +func (c *FakeServiceDirectoryRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicedirectoryrtsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRT), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedirectoryrtfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedirectoryrtfolder.go new file mode 100644 index 000000000..f90479746 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedirectoryrtfolder.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceDirectoryRTFolders implements ServiceDirectoryRTFolderInterface +type FakeServiceDirectoryRTFolders struct { + Fake *FakeGlobalTsmV1 +} + +var servicedirectoryrtfoldersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "servicedirectoryrtfolders"} + +var servicedirectoryrtfoldersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceDirectoryRTFolder"} + +// Get takes name of the serviceDirectoryRTFolder, and returns the corresponding serviceDirectoryRTFolder object, and an error if there is any. +func (c *FakeServiceDirectoryRTFolders) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicedirectoryrtfoldersResource, name), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder), err +} + +// List takes label and field selectors, and returns the list of ServiceDirectoryRTFolders that match those selectors. +func (c *FakeServiceDirectoryRTFolders) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicedirectoryrtfoldersResource, servicedirectoryrtfoldersKind, opts), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderList).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 serviceDirectoryRTFolders. +func (c *FakeServiceDirectoryRTFolders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicedirectoryrtfoldersResource, opts)) +} + +// Create takes the representation of a serviceDirectoryRTFolder and creates it. Returns the server's representation of the serviceDirectoryRTFolder, and an error, if there is any. +func (c *FakeServiceDirectoryRTFolders) Create(ctx context.Context, serviceDirectoryRTFolder *globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicedirectoryrtfoldersResource, serviceDirectoryRTFolder), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder), err +} + +// Update takes the representation of a serviceDirectoryRTFolder and updates it. Returns the server's representation of the serviceDirectoryRTFolder, and an error, if there is any. +func (c *FakeServiceDirectoryRTFolders) Update(ctx context.Context, serviceDirectoryRTFolder *globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicedirectoryrtfoldersResource, serviceDirectoryRTFolder), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder), err +} + +// Delete takes name of the serviceDirectoryRTFolder and deletes it. Returns an error if one occurs. +func (c *FakeServiceDirectoryRTFolders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicedirectoryrtfoldersResource, name), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceDirectoryRTFolders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicedirectoryrtfoldersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderList{}) + return err +} + +// Patch applies the patch and returns the patched serviceDirectoryRTFolder. +func (c *FakeServiceDirectoryRTFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicedirectoryrtfoldersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedirectoryrtfolderentry.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedirectoryrtfolderentry.go new file mode 100644 index 000000000..a70632030 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicedirectoryrtfolderentry.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceDirectoryRTFolderEntries implements ServiceDirectoryRTFolderEntryInterface +type FakeServiceDirectoryRTFolderEntries struct { + Fake *FakeGlobalTsmV1 +} + +var servicedirectoryrtfolderentriesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "servicedirectoryrtfolderentries"} + +var servicedirectoryrtfolderentriesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceDirectoryRTFolderEntry"} + +// Get takes name of the serviceDirectoryRTFolderEntry, and returns the corresponding serviceDirectoryRTFolderEntry object, and an error if there is any. +func (c *FakeServiceDirectoryRTFolderEntries) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicedirectoryrtfolderentriesResource, name), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry), err +} + +// List takes label and field selectors, and returns the list of ServiceDirectoryRTFolderEntries that match those selectors. +func (c *FakeServiceDirectoryRTFolderEntries) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicedirectoryrtfolderentriesResource, servicedirectoryrtfolderentriesKind, opts), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntryList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntryList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntryList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntryList).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 serviceDirectoryRTFolderEntries. +func (c *FakeServiceDirectoryRTFolderEntries) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicedirectoryrtfolderentriesResource, opts)) +} + +// Create takes the representation of a serviceDirectoryRTFolderEntry and creates it. Returns the server's representation of the serviceDirectoryRTFolderEntry, and an error, if there is any. +func (c *FakeServiceDirectoryRTFolderEntries) Create(ctx context.Context, serviceDirectoryRTFolderEntry *globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicedirectoryrtfolderentriesResource, serviceDirectoryRTFolderEntry), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry), err +} + +// Update takes the representation of a serviceDirectoryRTFolderEntry and updates it. Returns the server's representation of the serviceDirectoryRTFolderEntry, and an error, if there is any. +func (c *FakeServiceDirectoryRTFolderEntries) Update(ctx context.Context, serviceDirectoryRTFolderEntry *globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicedirectoryrtfolderentriesResource, serviceDirectoryRTFolderEntry), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry), err +} + +// Delete takes name of the serviceDirectoryRTFolderEntry and deletes it. Returns an error if one occurs. +func (c *FakeServiceDirectoryRTFolderEntries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicedirectoryrtfolderentriesResource, name), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceDirectoryRTFolderEntries) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicedirectoryrtfolderentriesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntryList{}) + return err +} + +// Patch applies the patch and returns the patched serviceDirectoryRTFolderEntry. +func (c *FakeServiceDirectoryRTFolderEntries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicedirectoryrtfolderentriesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceentry.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceentry.go new file mode 100644 index 000000000..a5625489e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceentry.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceEntries implements ServiceEntryInterface +type FakeServiceEntries struct { + Fake *FakeGlobalTsmV1 +} + +var serviceentriesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "serviceentries"} + +var serviceentriesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceEntry"} + +// Get takes name of the serviceEntry, and returns the corresponding serviceEntry object, and an error if there is any. +func (c *FakeServiceEntries) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(serviceentriesResource, name), &globaltsmtanzuvmwarecomv1.ServiceEntry{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceEntry), err +} + +// List takes label and field selectors, and returns the list of ServiceEntries that match those selectors. +func (c *FakeServiceEntries) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceEntryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(serviceentriesResource, serviceentriesKind, opts), &globaltsmtanzuvmwarecomv1.ServiceEntryList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceEntryList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceEntryList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceEntryList).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 serviceEntries. +func (c *FakeServiceEntries) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(serviceentriesResource, opts)) +} + +// Create takes the representation of a serviceEntry and creates it. Returns the server's representation of the serviceEntry, and an error, if there is any. +func (c *FakeServiceEntries) Create(ctx context.Context, serviceEntry *globaltsmtanzuvmwarecomv1.ServiceEntry, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(serviceentriesResource, serviceEntry), &globaltsmtanzuvmwarecomv1.ServiceEntry{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceEntry), err +} + +// Update takes the representation of a serviceEntry and updates it. Returns the server's representation of the serviceEntry, and an error, if there is any. +func (c *FakeServiceEntries) Update(ctx context.Context, serviceEntry *globaltsmtanzuvmwarecomv1.ServiceEntry, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(serviceentriesResource, serviceEntry), &globaltsmtanzuvmwarecomv1.ServiceEntry{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceEntry), err +} + +// Delete takes name of the serviceEntry and deletes it. Returns an error if one occurs. +func (c *FakeServiceEntries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(serviceentriesResource, name), &globaltsmtanzuvmwarecomv1.ServiceEntry{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceEntries) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(serviceentriesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceEntryList{}) + return err +} + +// Patch applies the patch and returns the patched serviceEntry. +func (c *FakeServiceEntries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(serviceentriesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceEntry{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceEntry), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceentryconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceentryconfig.go new file mode 100644 index 000000000..4fd2834fb --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceentryconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceEntryConfigs implements ServiceEntryConfigInterface +type FakeServiceEntryConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var serviceentryconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "serviceentryconfigs"} + +var serviceentryconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceEntryConfig"} + +// Get takes name of the serviceEntryConfig, and returns the corresponding serviceEntryConfig object, and an error if there is any. +func (c *FakeServiceEntryConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceEntryConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(serviceentryconfigsResource, name), &globaltsmtanzuvmwarecomv1.ServiceEntryConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceEntryConfig), err +} + +// List takes label and field selectors, and returns the list of ServiceEntryConfigs that match those selectors. +func (c *FakeServiceEntryConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceEntryConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(serviceentryconfigsResource, serviceentryconfigsKind, opts), &globaltsmtanzuvmwarecomv1.ServiceEntryConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceEntryConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceEntryConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceEntryConfigList).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 serviceEntryConfigs. +func (c *FakeServiceEntryConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(serviceentryconfigsResource, opts)) +} + +// Create takes the representation of a serviceEntryConfig and creates it. Returns the server's representation of the serviceEntryConfig, and an error, if there is any. +func (c *FakeServiceEntryConfigs) Create(ctx context.Context, serviceEntryConfig *globaltsmtanzuvmwarecomv1.ServiceEntryConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceEntryConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(serviceentryconfigsResource, serviceEntryConfig), &globaltsmtanzuvmwarecomv1.ServiceEntryConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceEntryConfig), err +} + +// Update takes the representation of a serviceEntryConfig and updates it. Returns the server's representation of the serviceEntryConfig, and an error, if there is any. +func (c *FakeServiceEntryConfigs) Update(ctx context.Context, serviceEntryConfig *globaltsmtanzuvmwarecomv1.ServiceEntryConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceEntryConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(serviceentryconfigsResource, serviceEntryConfig), &globaltsmtanzuvmwarecomv1.ServiceEntryConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceEntryConfig), err +} + +// Delete takes name of the serviceEntryConfig and deletes it. Returns an error if one occurs. +func (c *FakeServiceEntryConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(serviceentryconfigsResource, name), &globaltsmtanzuvmwarecomv1.ServiceEntryConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceEntryConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(serviceentryconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceEntryConfigList{}) + return err +} + +// Patch applies the patch and returns the patched serviceEntryConfig. +func (c *FakeServiceEntryConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceEntryConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(serviceentryconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceEntryConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceEntryConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceinstance.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceinstance.go new file mode 100644 index 000000000..423640229 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceinstance.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceInstances implements ServiceInstanceInterface +type FakeServiceInstances struct { + Fake *FakeGlobalTsmV1 +} + +var serviceinstancesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "serviceinstances"} + +var serviceinstancesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceInstance"} + +// Get takes name of the serviceInstance, and returns the corresponding serviceInstance object, and an error if there is any. +func (c *FakeServiceInstances) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceInstance, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(serviceinstancesResource, name), &globaltsmtanzuvmwarecomv1.ServiceInstance{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceInstance), err +} + +// List takes label and field selectors, and returns the list of ServiceInstances that match those selectors. +func (c *FakeServiceInstances) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceInstanceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(serviceinstancesResource, serviceinstancesKind, opts), &globaltsmtanzuvmwarecomv1.ServiceInstanceList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceInstanceList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceInstanceList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceInstanceList).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 serviceInstances. +func (c *FakeServiceInstances) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(serviceinstancesResource, opts)) +} + +// Create takes the representation of a serviceInstance and creates it. Returns the server's representation of the serviceInstance, and an error, if there is any. +func (c *FakeServiceInstances) Create(ctx context.Context, serviceInstance *globaltsmtanzuvmwarecomv1.ServiceInstance, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceInstance, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(serviceinstancesResource, serviceInstance), &globaltsmtanzuvmwarecomv1.ServiceInstance{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceInstance), err +} + +// Update takes the representation of a serviceInstance and updates it. Returns the server's representation of the serviceInstance, and an error, if there is any. +func (c *FakeServiceInstances) Update(ctx context.Context, serviceInstance *globaltsmtanzuvmwarecomv1.ServiceInstance, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceInstance, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(serviceinstancesResource, serviceInstance), &globaltsmtanzuvmwarecomv1.ServiceInstance{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceInstance), err +} + +// Delete takes name of the serviceInstance and deletes it. Returns an error if one occurs. +func (c *FakeServiceInstances) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(serviceinstancesResource, name), &globaltsmtanzuvmwarecomv1.ServiceInstance{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceInstances) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(serviceinstancesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceInstanceList{}) + return err +} + +// Patch applies the patch and returns the patched serviceInstance. +func (c *FakeServiceInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceInstance, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(serviceinstancesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceInstance{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceInstance), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceinstancecontainer.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceinstancecontainer.go new file mode 100644 index 000000000..4426b5730 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceinstancecontainer.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceInstanceContainers implements ServiceInstanceContainerInterface +type FakeServiceInstanceContainers struct { + Fake *FakeGlobalTsmV1 +} + +var serviceinstancecontainersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "serviceinstancecontainers"} + +var serviceinstancecontainersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceInstanceContainer"} + +// Get takes name of the serviceInstanceContainer, and returns the corresponding serviceInstanceContainer object, and an error if there is any. +func (c *FakeServiceInstanceContainers) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceInstanceContainer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(serviceinstancecontainersResource, name), &globaltsmtanzuvmwarecomv1.ServiceInstanceContainer{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceInstanceContainer), err +} + +// List takes label and field selectors, and returns the list of ServiceInstanceContainers that match those selectors. +func (c *FakeServiceInstanceContainers) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceInstanceContainerList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(serviceinstancecontainersResource, serviceinstancecontainersKind, opts), &globaltsmtanzuvmwarecomv1.ServiceInstanceContainerList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceInstanceContainerList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceInstanceContainerList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceInstanceContainerList).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 serviceInstanceContainers. +func (c *FakeServiceInstanceContainers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(serviceinstancecontainersResource, opts)) +} + +// Create takes the representation of a serviceInstanceContainer and creates it. Returns the server's representation of the serviceInstanceContainer, and an error, if there is any. +func (c *FakeServiceInstanceContainers) Create(ctx context.Context, serviceInstanceContainer *globaltsmtanzuvmwarecomv1.ServiceInstanceContainer, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceInstanceContainer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(serviceinstancecontainersResource, serviceInstanceContainer), &globaltsmtanzuvmwarecomv1.ServiceInstanceContainer{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceInstanceContainer), err +} + +// Update takes the representation of a serviceInstanceContainer and updates it. Returns the server's representation of the serviceInstanceContainer, and an error, if there is any. +func (c *FakeServiceInstanceContainers) Update(ctx context.Context, serviceInstanceContainer *globaltsmtanzuvmwarecomv1.ServiceInstanceContainer, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceInstanceContainer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(serviceinstancecontainersResource, serviceInstanceContainer), &globaltsmtanzuvmwarecomv1.ServiceInstanceContainer{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceInstanceContainer), err +} + +// Delete takes name of the serviceInstanceContainer and deletes it. Returns an error if one occurs. +func (c *FakeServiceInstanceContainers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(serviceinstancecontainersResource, name), &globaltsmtanzuvmwarecomv1.ServiceInstanceContainer{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceInstanceContainers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(serviceinstancecontainersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceInstanceContainerList{}) + return err +} + +// Patch applies the patch and returns the patched serviceInstanceContainer. +func (c *FakeServiceInstanceContainers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceInstanceContainer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(serviceinstancecontainersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceInstanceContainer{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceInstanceContainer), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicejob.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicejob.go new file mode 100644 index 000000000..5b7878126 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicejob.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceJobs implements ServiceJobInterface +type FakeServiceJobs struct { + Fake *FakeGlobalTsmV1 +} + +var servicejobsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "servicejobs"} + +var servicejobsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceJob"} + +// Get takes name of the serviceJob, and returns the corresponding serviceJob object, and an error if there is any. +func (c *FakeServiceJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicejobsResource, name), &globaltsmtanzuvmwarecomv1.ServiceJob{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceJob), err +} + +// List takes label and field selectors, and returns the list of ServiceJobs that match those selectors. +func (c *FakeServiceJobs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceJobList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicejobsResource, servicejobsKind, opts), &globaltsmtanzuvmwarecomv1.ServiceJobList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceJobList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceJobList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceJobList).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 serviceJobs. +func (c *FakeServiceJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicejobsResource, opts)) +} + +// Create takes the representation of a serviceJob and creates it. Returns the server's representation of the serviceJob, and an error, if there is any. +func (c *FakeServiceJobs) Create(ctx context.Context, serviceJob *globaltsmtanzuvmwarecomv1.ServiceJob, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicejobsResource, serviceJob), &globaltsmtanzuvmwarecomv1.ServiceJob{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceJob), err +} + +// Update takes the representation of a serviceJob and updates it. Returns the server's representation of the serviceJob, and an error, if there is any. +func (c *FakeServiceJobs) Update(ctx context.Context, serviceJob *globaltsmtanzuvmwarecomv1.ServiceJob, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicejobsResource, serviceJob), &globaltsmtanzuvmwarecomv1.ServiceJob{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceJob), err +} + +// Delete takes name of the serviceJob and deletes it. Returns an error if one occurs. +func (c *FakeServiceJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicejobsResource, name), &globaltsmtanzuvmwarecomv1.ServiceJob{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicejobsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceJobList{}) + return err +} + +// Patch applies the patch and returns the patched serviceJob. +func (c *FakeServiceJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicejobsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceJob{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceJob), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicelevelobjective.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicelevelobjective.go new file mode 100644 index 000000000..01f10135d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicelevelobjective.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceLevelObjectives implements ServiceLevelObjectiveInterface +type FakeServiceLevelObjectives struct { + Fake *FakeGlobalTsmV1 +} + +var servicelevelobjectivesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "servicelevelobjectives"} + +var servicelevelobjectivesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceLevelObjective"} + +// Get takes name of the serviceLevelObjective, and returns the corresponding serviceLevelObjective object, and an error if there is any. +func (c *FakeServiceLevelObjectives) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceLevelObjective, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicelevelobjectivesResource, name), &globaltsmtanzuvmwarecomv1.ServiceLevelObjective{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceLevelObjective), err +} + +// List takes label and field selectors, and returns the list of ServiceLevelObjectives that match those selectors. +func (c *FakeServiceLevelObjectives) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicelevelobjectivesResource, servicelevelobjectivesKind, opts), &globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveList).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 serviceLevelObjectives. +func (c *FakeServiceLevelObjectives) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicelevelobjectivesResource, opts)) +} + +// Create takes the representation of a serviceLevelObjective and creates it. Returns the server's representation of the serviceLevelObjective, and an error, if there is any. +func (c *FakeServiceLevelObjectives) Create(ctx context.Context, serviceLevelObjective *globaltsmtanzuvmwarecomv1.ServiceLevelObjective, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceLevelObjective, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicelevelobjectivesResource, serviceLevelObjective), &globaltsmtanzuvmwarecomv1.ServiceLevelObjective{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceLevelObjective), err +} + +// Update takes the representation of a serviceLevelObjective and updates it. Returns the server's representation of the serviceLevelObjective, and an error, if there is any. +func (c *FakeServiceLevelObjectives) Update(ctx context.Context, serviceLevelObjective *globaltsmtanzuvmwarecomv1.ServiceLevelObjective, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceLevelObjective, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicelevelobjectivesResource, serviceLevelObjective), &globaltsmtanzuvmwarecomv1.ServiceLevelObjective{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceLevelObjective), err +} + +// Delete takes name of the serviceLevelObjective and deletes it. Returns an error if one occurs. +func (c *FakeServiceLevelObjectives) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicelevelobjectivesResource, name), &globaltsmtanzuvmwarecomv1.ServiceLevelObjective{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceLevelObjectives) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicelevelobjectivesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveList{}) + return err +} + +// Patch applies the patch and returns the patched serviceLevelObjective. +func (c *FakeServiceLevelObjectives) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceLevelObjective, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicelevelobjectivesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceLevelObjective{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceLevelObjective), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicelevelobjectivefolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicelevelobjectivefolder.go new file mode 100644 index 000000000..803b7fa7c --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicelevelobjectivefolder.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceLevelObjectiveFolders implements ServiceLevelObjectiveFolderInterface +type FakeServiceLevelObjectiveFolders struct { + Fake *FakeGlobalTsmV1 +} + +var servicelevelobjectivefoldersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "servicelevelobjectivefolders"} + +var servicelevelobjectivefoldersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceLevelObjectiveFolder"} + +// Get takes name of the serviceLevelObjectiveFolder, and returns the corresponding serviceLevelObjectiveFolder object, and an error if there is any. +func (c *FakeServiceLevelObjectiveFolders) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicelevelobjectivefoldersResource, name), &globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder), err +} + +// List takes label and field selectors, and returns the list of ServiceLevelObjectiveFolders that match those selectors. +func (c *FakeServiceLevelObjectiveFolders) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicelevelobjectivefoldersResource, servicelevelobjectivefoldersKind, opts), &globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolderList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolderList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolderList).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 serviceLevelObjectiveFolders. +func (c *FakeServiceLevelObjectiveFolders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicelevelobjectivefoldersResource, opts)) +} + +// Create takes the representation of a serviceLevelObjectiveFolder and creates it. Returns the server's representation of the serviceLevelObjectiveFolder, and an error, if there is any. +func (c *FakeServiceLevelObjectiveFolders) Create(ctx context.Context, serviceLevelObjectiveFolder *globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicelevelobjectivefoldersResource, serviceLevelObjectiveFolder), &globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder), err +} + +// Update takes the representation of a serviceLevelObjectiveFolder and updates it. Returns the server's representation of the serviceLevelObjectiveFolder, and an error, if there is any. +func (c *FakeServiceLevelObjectiveFolders) Update(ctx context.Context, serviceLevelObjectiveFolder *globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicelevelobjectivefoldersResource, serviceLevelObjectiveFolder), &globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder), err +} + +// Delete takes name of the serviceLevelObjectiveFolder and deletes it. Returns an error if one occurs. +func (c *FakeServiceLevelObjectiveFolders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicelevelobjectivefoldersResource, name), &globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceLevelObjectiveFolders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicelevelobjectivefoldersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolderList{}) + return err +} + +// Patch applies the patch and returns the patched serviceLevelObjectiveFolder. +func (c *FakeServiceLevelObjectiveFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicelevelobjectivefoldersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicereplicaset.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicereplicaset.go new file mode 100644 index 000000000..b8e8b2b18 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicereplicaset.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceReplicaSets implements ServiceReplicaSetInterface +type FakeServiceReplicaSets struct { + Fake *FakeGlobalTsmV1 +} + +var servicereplicasetsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "servicereplicasets"} + +var servicereplicasetsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceReplicaSet"} + +// Get takes name of the serviceReplicaSet, and returns the corresponding serviceReplicaSet object, and an error if there is any. +func (c *FakeServiceReplicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceReplicaSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicereplicasetsResource, name), &globaltsmtanzuvmwarecomv1.ServiceReplicaSet{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceReplicaSet), err +} + +// List takes label and field selectors, and returns the list of ServiceReplicaSets that match those selectors. +func (c *FakeServiceReplicaSets) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceReplicaSetList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicereplicasetsResource, servicereplicasetsKind, opts), &globaltsmtanzuvmwarecomv1.ServiceReplicaSetList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceReplicaSetList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceReplicaSetList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceReplicaSetList).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 serviceReplicaSets. +func (c *FakeServiceReplicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicereplicasetsResource, opts)) +} + +// Create takes the representation of a serviceReplicaSet and creates it. Returns the server's representation of the serviceReplicaSet, and an error, if there is any. +func (c *FakeServiceReplicaSets) Create(ctx context.Context, serviceReplicaSet *globaltsmtanzuvmwarecomv1.ServiceReplicaSet, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceReplicaSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicereplicasetsResource, serviceReplicaSet), &globaltsmtanzuvmwarecomv1.ServiceReplicaSet{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceReplicaSet), err +} + +// Update takes the representation of a serviceReplicaSet and updates it. Returns the server's representation of the serviceReplicaSet, and an error, if there is any. +func (c *FakeServiceReplicaSets) Update(ctx context.Context, serviceReplicaSet *globaltsmtanzuvmwarecomv1.ServiceReplicaSet, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceReplicaSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicereplicasetsResource, serviceReplicaSet), &globaltsmtanzuvmwarecomv1.ServiceReplicaSet{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceReplicaSet), err +} + +// Delete takes name of the serviceReplicaSet and deletes it. Returns an error if one occurs. +func (c *FakeServiceReplicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicereplicasetsResource, name), &globaltsmtanzuvmwarecomv1.ServiceReplicaSet{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicereplicasetsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceReplicaSetList{}) + return err +} + +// Patch applies the patch and returns the patched serviceReplicaSet. +func (c *FakeServiceReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceReplicaSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicereplicasetsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceReplicaSet{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceReplicaSet), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicestatefulset.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicestatefulset.go new file mode 100644 index 000000000..1eb632eb3 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicestatefulset.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceStatefulSets implements ServiceStatefulSetInterface +type FakeServiceStatefulSets struct { + Fake *FakeGlobalTsmV1 +} + +var servicestatefulsetsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "servicestatefulsets"} + +var servicestatefulsetsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceStatefulSet"} + +// Get takes name of the serviceStatefulSet, and returns the corresponding serviceStatefulSet object, and an error if there is any. +func (c *FakeServiceStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceStatefulSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicestatefulsetsResource, name), &globaltsmtanzuvmwarecomv1.ServiceStatefulSet{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceStatefulSet), err +} + +// List takes label and field selectors, and returns the list of ServiceStatefulSets that match those selectors. +func (c *FakeServiceStatefulSets) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceStatefulSetList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicestatefulsetsResource, servicestatefulsetsKind, opts), &globaltsmtanzuvmwarecomv1.ServiceStatefulSetList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceStatefulSetList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceStatefulSetList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceStatefulSetList).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 serviceStatefulSets. +func (c *FakeServiceStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicestatefulsetsResource, opts)) +} + +// Create takes the representation of a serviceStatefulSet and creates it. Returns the server's representation of the serviceStatefulSet, and an error, if there is any. +func (c *FakeServiceStatefulSets) Create(ctx context.Context, serviceStatefulSet *globaltsmtanzuvmwarecomv1.ServiceStatefulSet, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceStatefulSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicestatefulsetsResource, serviceStatefulSet), &globaltsmtanzuvmwarecomv1.ServiceStatefulSet{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceStatefulSet), err +} + +// Update takes the representation of a serviceStatefulSet and updates it. Returns the server's representation of the serviceStatefulSet, and an error, if there is any. +func (c *FakeServiceStatefulSets) Update(ctx context.Context, serviceStatefulSet *globaltsmtanzuvmwarecomv1.ServiceStatefulSet, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceStatefulSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicestatefulsetsResource, serviceStatefulSet), &globaltsmtanzuvmwarecomv1.ServiceStatefulSet{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceStatefulSet), err +} + +// Delete takes name of the serviceStatefulSet and deletes it. Returns an error if one occurs. +func (c *FakeServiceStatefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicestatefulsetsResource, name), &globaltsmtanzuvmwarecomv1.ServiceStatefulSet{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicestatefulsetsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceStatefulSetList{}) + return err +} + +// Patch applies the patch and returns the patched serviceStatefulSet. +func (c *FakeServiceStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceStatefulSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicestatefulsetsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceStatefulSet{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceStatefulSet), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicetemplate.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicetemplate.go new file mode 100644 index 000000000..a81734aa6 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicetemplate.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceTemplates implements ServiceTemplateInterface +type FakeServiceTemplates struct { + Fake *FakeGlobalTsmV1 +} + +var servicetemplatesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "servicetemplates"} + +var servicetemplatesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceTemplate"} + +// Get takes name of the serviceTemplate, and returns the corresponding serviceTemplate object, and an error if there is any. +func (c *FakeServiceTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicetemplatesResource, name), &globaltsmtanzuvmwarecomv1.ServiceTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceTemplate), err +} + +// List takes label and field selectors, and returns the list of ServiceTemplates that match those selectors. +func (c *FakeServiceTemplates) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceTemplateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicetemplatesResource, servicetemplatesKind, opts), &globaltsmtanzuvmwarecomv1.ServiceTemplateList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceTemplateList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceTemplateList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceTemplateList).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 serviceTemplates. +func (c *FakeServiceTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicetemplatesResource, opts)) +} + +// Create takes the representation of a serviceTemplate and creates it. Returns the server's representation of the serviceTemplate, and an error, if there is any. +func (c *FakeServiceTemplates) Create(ctx context.Context, serviceTemplate *globaltsmtanzuvmwarecomv1.ServiceTemplate, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicetemplatesResource, serviceTemplate), &globaltsmtanzuvmwarecomv1.ServiceTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceTemplate), err +} + +// Update takes the representation of a serviceTemplate and updates it. Returns the server's representation of the serviceTemplate, and an error, if there is any. +func (c *FakeServiceTemplates) Update(ctx context.Context, serviceTemplate *globaltsmtanzuvmwarecomv1.ServiceTemplate, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicetemplatesResource, serviceTemplate), &globaltsmtanzuvmwarecomv1.ServiceTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceTemplate), err +} + +// Delete takes name of the serviceTemplate and deletes it. Returns an error if one occurs. +func (c *FakeServiceTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicetemplatesResource, name), &globaltsmtanzuvmwarecomv1.ServiceTemplate{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicetemplatesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceTemplateList{}) + return err +} + +// Patch applies the patch and returns the patched serviceTemplate. +func (c *FakeServiceTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicetemplatesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceTemplate), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicetemplateservicedefinition.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicetemplateservicedefinition.go new file mode 100644 index 000000000..3bbebd877 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_servicetemplateservicedefinition.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceTemplateServiceDefinitions implements ServiceTemplateServiceDefinitionInterface +type FakeServiceTemplateServiceDefinitions struct { + Fake *FakeGlobalTsmV1 +} + +var servicetemplateservicedefinitionsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "servicetemplateservicedefinitions"} + +var servicetemplateservicedefinitionsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceTemplateServiceDefinition"} + +// Get takes name of the serviceTemplateServiceDefinition, and returns the corresponding serviceTemplateServiceDefinition object, and an error if there is any. +func (c *FakeServiceTemplateServiceDefinitions) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicetemplateservicedefinitionsResource, name), &globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition), err +} + +// List takes label and field selectors, and returns the list of ServiceTemplateServiceDefinitions that match those selectors. +func (c *FakeServiceTemplateServiceDefinitions) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinitionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicetemplateservicedefinitionsResource, servicetemplateservicedefinitionsKind, opts), &globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinitionList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinitionList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinitionList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinitionList).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 serviceTemplateServiceDefinitions. +func (c *FakeServiceTemplateServiceDefinitions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicetemplateservicedefinitionsResource, opts)) +} + +// Create takes the representation of a serviceTemplateServiceDefinition and creates it. Returns the server's representation of the serviceTemplateServiceDefinition, and an error, if there is any. +func (c *FakeServiceTemplateServiceDefinitions) Create(ctx context.Context, serviceTemplateServiceDefinition *globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicetemplateservicedefinitionsResource, serviceTemplateServiceDefinition), &globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition), err +} + +// Update takes the representation of a serviceTemplateServiceDefinition and updates it. Returns the server's representation of the serviceTemplateServiceDefinition, and an error, if there is any. +func (c *FakeServiceTemplateServiceDefinitions) Update(ctx context.Context, serviceTemplateServiceDefinition *globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicetemplateservicedefinitionsResource, serviceTemplateServiceDefinition), &globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition), err +} + +// Delete takes name of the serviceTemplateServiceDefinition and deletes it. Returns an error if one occurs. +func (c *FakeServiceTemplateServiceDefinitions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicetemplateservicedefinitionsResource, name), &globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceTemplateServiceDefinitions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicetemplateservicedefinitionsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinitionList{}) + return err +} + +// Patch applies the patch and returns the patched serviceTemplateServiceDefinition. +func (c *FakeServiceTemplateServiceDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicetemplateservicedefinitionsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceversion.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceversion.go new file mode 100644 index 000000000..dcf14fd43 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceversion.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceVersions implements ServiceVersionInterface +type FakeServiceVersions struct { + Fake *FakeGlobalTsmV1 +} + +var serviceversionsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "serviceversions"} + +var serviceversionsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceVersion"} + +// Get takes name of the serviceVersion, and returns the corresponding serviceVersion object, and an error if there is any. +func (c *FakeServiceVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(serviceversionsResource, name), &globaltsmtanzuvmwarecomv1.ServiceVersion{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceVersion), err +} + +// List takes label and field selectors, and returns the list of ServiceVersions that match those selectors. +func (c *FakeServiceVersions) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceVersionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(serviceversionsResource, serviceversionsKind, opts), &globaltsmtanzuvmwarecomv1.ServiceVersionList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceVersionList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceVersionList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceVersionList).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 serviceVersions. +func (c *FakeServiceVersions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(serviceversionsResource, opts)) +} + +// Create takes the representation of a serviceVersion and creates it. Returns the server's representation of the serviceVersion, and an error, if there is any. +func (c *FakeServiceVersions) Create(ctx context.Context, serviceVersion *globaltsmtanzuvmwarecomv1.ServiceVersion, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(serviceversionsResource, serviceVersion), &globaltsmtanzuvmwarecomv1.ServiceVersion{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceVersion), err +} + +// Update takes the representation of a serviceVersion and updates it. Returns the server's representation of the serviceVersion, and an error, if there is any. +func (c *FakeServiceVersions) Update(ctx context.Context, serviceVersion *globaltsmtanzuvmwarecomv1.ServiceVersion, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(serviceversionsResource, serviceVersion), &globaltsmtanzuvmwarecomv1.ServiceVersion{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceVersion), err +} + +// Delete takes name of the serviceVersion and deletes it. Returns an error if one occurs. +func (c *FakeServiceVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(serviceversionsResource, name), &globaltsmtanzuvmwarecomv1.ServiceVersion{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(serviceversionsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceVersionList{}) + return err +} + +// Patch applies the patch and returns the patched serviceVersion. +func (c *FakeServiceVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(serviceversionsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceVersion{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceVersion), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceversionconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceversionconfig.go new file mode 100644 index 000000000..cb7960bac --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_serviceversionconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeServiceVersionConfigs implements ServiceVersionConfigInterface +type FakeServiceVersionConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var serviceversionconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "serviceversionconfigs"} + +var serviceversionconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "ServiceVersionConfig"} + +// Get takes name of the serviceVersionConfig, and returns the corresponding serviceVersionConfig object, and an error if there is any. +func (c *FakeServiceVersionConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.ServiceVersionConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(serviceversionconfigsResource, name), &globaltsmtanzuvmwarecomv1.ServiceVersionConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceVersionConfig), err +} + +// List takes label and field selectors, and returns the list of ServiceVersionConfigs that match those selectors. +func (c *FakeServiceVersionConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.ServiceVersionConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(serviceversionconfigsResource, serviceversionconfigsKind, opts), &globaltsmtanzuvmwarecomv1.ServiceVersionConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.ServiceVersionConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.ServiceVersionConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.ServiceVersionConfigList).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 serviceVersionConfigs. +func (c *FakeServiceVersionConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(serviceversionconfigsResource, opts)) +} + +// Create takes the representation of a serviceVersionConfig and creates it. Returns the server's representation of the serviceVersionConfig, and an error, if there is any. +func (c *FakeServiceVersionConfigs) Create(ctx context.Context, serviceVersionConfig *globaltsmtanzuvmwarecomv1.ServiceVersionConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceVersionConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(serviceversionconfigsResource, serviceVersionConfig), &globaltsmtanzuvmwarecomv1.ServiceVersionConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceVersionConfig), err +} + +// Update takes the representation of a serviceVersionConfig and updates it. Returns the server's representation of the serviceVersionConfig, and an error, if there is any. +func (c *FakeServiceVersionConfigs) Update(ctx context.Context, serviceVersionConfig *globaltsmtanzuvmwarecomv1.ServiceVersionConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.ServiceVersionConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(serviceversionconfigsResource, serviceVersionConfig), &globaltsmtanzuvmwarecomv1.ServiceVersionConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceVersionConfig), err +} + +// Delete takes name of the serviceVersionConfig and deletes it. Returns an error if one occurs. +func (c *FakeServiceVersionConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(serviceversionconfigsResource, name), &globaltsmtanzuvmwarecomv1.ServiceVersionConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceVersionConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(serviceversionconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.ServiceVersionConfigList{}) + return err +} + +// Patch applies the patch and returns the patched serviceVersionConfig. +func (c *FakeServiceVersionConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.ServiceVersionConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(serviceversionconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.ServiceVersionConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.ServiceVersionConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_sharedserviceconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_sharedserviceconfig.go new file mode 100644 index 000000000..5b52dfdb3 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_sharedserviceconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeSharedServiceConfigs implements SharedServiceConfigInterface +type FakeSharedServiceConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var sharedserviceconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "sharedserviceconfigs"} + +var sharedserviceconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "SharedServiceConfig"} + +// Get takes name of the sharedServiceConfig, and returns the corresponding sharedServiceConfig object, and an error if there is any. +func (c *FakeSharedServiceConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.SharedServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(sharedserviceconfigsResource, name), &globaltsmtanzuvmwarecomv1.SharedServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SharedServiceConfig), err +} + +// List takes label and field selectors, and returns the list of SharedServiceConfigs that match those selectors. +func (c *FakeSharedServiceConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.SharedServiceConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(sharedserviceconfigsResource, sharedserviceconfigsKind, opts), &globaltsmtanzuvmwarecomv1.SharedServiceConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.SharedServiceConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.SharedServiceConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.SharedServiceConfigList).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 sharedServiceConfigs. +func (c *FakeSharedServiceConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(sharedserviceconfigsResource, opts)) +} + +// Create takes the representation of a sharedServiceConfig and creates it. Returns the server's representation of the sharedServiceConfig, and an error, if there is any. +func (c *FakeSharedServiceConfigs) Create(ctx context.Context, sharedServiceConfig *globaltsmtanzuvmwarecomv1.SharedServiceConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.SharedServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(sharedserviceconfigsResource, sharedServiceConfig), &globaltsmtanzuvmwarecomv1.SharedServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SharedServiceConfig), err +} + +// Update takes the representation of a sharedServiceConfig and updates it. Returns the server's representation of the sharedServiceConfig, and an error, if there is any. +func (c *FakeSharedServiceConfigs) Update(ctx context.Context, sharedServiceConfig *globaltsmtanzuvmwarecomv1.SharedServiceConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.SharedServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(sharedserviceconfigsResource, sharedServiceConfig), &globaltsmtanzuvmwarecomv1.SharedServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SharedServiceConfig), err +} + +// Delete takes name of the sharedServiceConfig and deletes it. Returns an error if one occurs. +func (c *FakeSharedServiceConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(sharedserviceconfigsResource, name), &globaltsmtanzuvmwarecomv1.SharedServiceConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSharedServiceConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(sharedserviceconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.SharedServiceConfigList{}) + return err +} + +// Patch applies the patch and returns the patched sharedServiceConfig. +func (c *FakeSharedServiceConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.SharedServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(sharedserviceconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.SharedServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SharedServiceConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_sloconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_sloconfig.go new file mode 100644 index 000000000..c9e3e6fbe --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_sloconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeSloConfigs implements SloConfigInterface +type FakeSloConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var sloconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "sloconfigs"} + +var sloconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "SloConfig"} + +// Get takes name of the sloConfig, and returns the corresponding sloConfig object, and an error if there is any. +func (c *FakeSloConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.SloConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(sloconfigsResource, name), &globaltsmtanzuvmwarecomv1.SloConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SloConfig), err +} + +// List takes label and field selectors, and returns the list of SloConfigs that match those selectors. +func (c *FakeSloConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.SloConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(sloconfigsResource, sloconfigsKind, opts), &globaltsmtanzuvmwarecomv1.SloConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.SloConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.SloConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.SloConfigList).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 sloConfigs. +func (c *FakeSloConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(sloconfigsResource, opts)) +} + +// Create takes the representation of a sloConfig and creates it. Returns the server's representation of the sloConfig, and an error, if there is any. +func (c *FakeSloConfigs) Create(ctx context.Context, sloConfig *globaltsmtanzuvmwarecomv1.SloConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.SloConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(sloconfigsResource, sloConfig), &globaltsmtanzuvmwarecomv1.SloConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SloConfig), err +} + +// Update takes the representation of a sloConfig and updates it. Returns the server's representation of the sloConfig, and an error, if there is any. +func (c *FakeSloConfigs) Update(ctx context.Context, sloConfig *globaltsmtanzuvmwarecomv1.SloConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.SloConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(sloconfigsResource, sloConfig), &globaltsmtanzuvmwarecomv1.SloConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SloConfig), err +} + +// Delete takes name of the sloConfig and deletes it. Returns an error if one occurs. +func (c *FakeSloConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(sloconfigsResource, name), &globaltsmtanzuvmwarecomv1.SloConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSloConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(sloconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.SloConfigList{}) + return err +} + +// Patch applies the patch and returns the patched sloConfig. +func (c *FakeSloConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.SloConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(sloconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.SloConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SloConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_slofolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_slofolder.go new file mode 100644 index 000000000..4a4eb515f --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_slofolder.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeSLOFolders implements SLOFolderInterface +type FakeSLOFolders struct { + Fake *FakeGlobalTsmV1 +} + +var slofoldersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "slofolders"} + +var slofoldersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "SLOFolder"} + +// Get takes name of the sLOFolder, and returns the corresponding sLOFolder object, and an error if there is any. +func (c *FakeSLOFolders) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.SLOFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(slofoldersResource, name), &globaltsmtanzuvmwarecomv1.SLOFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SLOFolder), err +} + +// List takes label and field selectors, and returns the list of SLOFolders that match those selectors. +func (c *FakeSLOFolders) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.SLOFolderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(slofoldersResource, slofoldersKind, opts), &globaltsmtanzuvmwarecomv1.SLOFolderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.SLOFolderList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.SLOFolderList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.SLOFolderList).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 sLOFolders. +func (c *FakeSLOFolders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(slofoldersResource, opts)) +} + +// Create takes the representation of a sLOFolder and creates it. Returns the server's representation of the sLOFolder, and an error, if there is any. +func (c *FakeSLOFolders) Create(ctx context.Context, sLOFolder *globaltsmtanzuvmwarecomv1.SLOFolder, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.SLOFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(slofoldersResource, sLOFolder), &globaltsmtanzuvmwarecomv1.SLOFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SLOFolder), err +} + +// Update takes the representation of a sLOFolder and updates it. Returns the server's representation of the sLOFolder, and an error, if there is any. +func (c *FakeSLOFolders) Update(ctx context.Context, sLOFolder *globaltsmtanzuvmwarecomv1.SLOFolder, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.SLOFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(slofoldersResource, sLOFolder), &globaltsmtanzuvmwarecomv1.SLOFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SLOFolder), err +} + +// Delete takes name of the sLOFolder and deletes it. Returns an error if one occurs. +func (c *FakeSLOFolders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(slofoldersResource, name), &globaltsmtanzuvmwarecomv1.SLOFolder{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSLOFolders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(slofoldersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.SLOFolderList{}) + return err +} + +// Patch applies the patch and returns the patched sLOFolder. +func (c *FakeSLOFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.SLOFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(slofoldersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.SLOFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SLOFolder), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_slopolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_slopolicy.go new file mode 100644 index 000000000..bc39bb2c4 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_slopolicy.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeSLOPolicies implements SLOPolicyInterface +type FakeSLOPolicies struct { + Fake *FakeGlobalTsmV1 +} + +var slopoliciesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "slopolicies"} + +var slopoliciesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "SLOPolicy"} + +// Get takes name of the sLOPolicy, and returns the corresponding sLOPolicy object, and an error if there is any. +func (c *FakeSLOPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.SLOPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(slopoliciesResource, name), &globaltsmtanzuvmwarecomv1.SLOPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SLOPolicy), err +} + +// List takes label and field selectors, and returns the list of SLOPolicies that match those selectors. +func (c *FakeSLOPolicies) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.SLOPolicyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(slopoliciesResource, slopoliciesKind, opts), &globaltsmtanzuvmwarecomv1.SLOPolicyList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.SLOPolicyList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.SLOPolicyList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.SLOPolicyList).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 sLOPolicies. +func (c *FakeSLOPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(slopoliciesResource, opts)) +} + +// Create takes the representation of a sLOPolicy and creates it. Returns the server's representation of the sLOPolicy, and an error, if there is any. +func (c *FakeSLOPolicies) Create(ctx context.Context, sLOPolicy *globaltsmtanzuvmwarecomv1.SLOPolicy, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.SLOPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(slopoliciesResource, sLOPolicy), &globaltsmtanzuvmwarecomv1.SLOPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SLOPolicy), err +} + +// Update takes the representation of a sLOPolicy and updates it. Returns the server's representation of the sLOPolicy, and an error, if there is any. +func (c *FakeSLOPolicies) Update(ctx context.Context, sLOPolicy *globaltsmtanzuvmwarecomv1.SLOPolicy, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.SLOPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(slopoliciesResource, sLOPolicy), &globaltsmtanzuvmwarecomv1.SLOPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SLOPolicy), err +} + +// Delete takes name of the sLOPolicy and deletes it. Returns an error if one occurs. +func (c *FakeSLOPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(slopoliciesResource, name), &globaltsmtanzuvmwarecomv1.SLOPolicy{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSLOPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(slopoliciesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.SLOPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched sLOPolicy. +func (c *FakeSLOPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.SLOPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(slopoliciesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.SLOPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SLOPolicy), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_sloserviceconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_sloserviceconfig.go new file mode 100644 index 000000000..8b9a6ee37 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_sloserviceconfig.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeSloServiceConfigs implements SloServiceConfigInterface +type FakeSloServiceConfigs struct { + Fake *FakeGlobalTsmV1 +} + +var sloserviceconfigsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "sloserviceconfigs"} + +var sloserviceconfigsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "SloServiceConfig"} + +// Get takes name of the sloServiceConfig, and returns the corresponding sloServiceConfig object, and an error if there is any. +func (c *FakeSloServiceConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.SloServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(sloserviceconfigsResource, name), &globaltsmtanzuvmwarecomv1.SloServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SloServiceConfig), err +} + +// List takes label and field selectors, and returns the list of SloServiceConfigs that match those selectors. +func (c *FakeSloServiceConfigs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.SloServiceConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(sloserviceconfigsResource, sloserviceconfigsKind, opts), &globaltsmtanzuvmwarecomv1.SloServiceConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.SloServiceConfigList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.SloServiceConfigList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.SloServiceConfigList).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 sloServiceConfigs. +func (c *FakeSloServiceConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(sloserviceconfigsResource, opts)) +} + +// Create takes the representation of a sloServiceConfig and creates it. Returns the server's representation of the sloServiceConfig, and an error, if there is any. +func (c *FakeSloServiceConfigs) Create(ctx context.Context, sloServiceConfig *globaltsmtanzuvmwarecomv1.SloServiceConfig, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.SloServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(sloserviceconfigsResource, sloServiceConfig), &globaltsmtanzuvmwarecomv1.SloServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SloServiceConfig), err +} + +// Update takes the representation of a sloServiceConfig and updates it. Returns the server's representation of the sloServiceConfig, and an error, if there is any. +func (c *FakeSloServiceConfigs) Update(ctx context.Context, sloServiceConfig *globaltsmtanzuvmwarecomv1.SloServiceConfig, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.SloServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(sloserviceconfigsResource, sloServiceConfig), &globaltsmtanzuvmwarecomv1.SloServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SloServiceConfig), err +} + +// Delete takes name of the sloServiceConfig and deletes it. Returns an error if one occurs. +func (c *FakeSloServiceConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(sloserviceconfigsResource, name), &globaltsmtanzuvmwarecomv1.SloServiceConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSloServiceConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(sloserviceconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.SloServiceConfigList{}) + return err +} + +// Patch applies the patch and returns the patched sloServiceConfig. +func (c *FakeSloServiceConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.SloServiceConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(sloserviceconfigsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.SloServiceConfig{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SloServiceConfig), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_svcgroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_svcgroup.go new file mode 100644 index 000000000..c43e559b1 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_svcgroup.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeSvcGroups implements SvcGroupInterface +type FakeSvcGroups struct { + Fake *FakeGlobalTsmV1 +} + +var svcgroupsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "svcgroups"} + +var svcgroupsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "SvcGroup"} + +// Get takes name of the svcGroup, and returns the corresponding svcGroup object, and an error if there is any. +func (c *FakeSvcGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.SvcGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(svcgroupsResource, name), &globaltsmtanzuvmwarecomv1.SvcGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SvcGroup), err +} + +// List takes label and field selectors, and returns the list of SvcGroups that match those selectors. +func (c *FakeSvcGroups) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.SvcGroupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(svcgroupsResource, svcgroupsKind, opts), &globaltsmtanzuvmwarecomv1.SvcGroupList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.SvcGroupList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.SvcGroupList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.SvcGroupList).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 svcGroups. +func (c *FakeSvcGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(svcgroupsResource, opts)) +} + +// Create takes the representation of a svcGroup and creates it. Returns the server's representation of the svcGroup, and an error, if there is any. +func (c *FakeSvcGroups) Create(ctx context.Context, svcGroup *globaltsmtanzuvmwarecomv1.SvcGroup, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.SvcGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(svcgroupsResource, svcGroup), &globaltsmtanzuvmwarecomv1.SvcGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SvcGroup), err +} + +// Update takes the representation of a svcGroup and updates it. Returns the server's representation of the svcGroup, and an error, if there is any. +func (c *FakeSvcGroups) Update(ctx context.Context, svcGroup *globaltsmtanzuvmwarecomv1.SvcGroup, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.SvcGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(svcgroupsResource, svcGroup), &globaltsmtanzuvmwarecomv1.SvcGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SvcGroup), err +} + +// Delete takes name of the svcGroup and deletes it. Returns an error if one occurs. +func (c *FakeSvcGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(svcgroupsResource, name), &globaltsmtanzuvmwarecomv1.SvcGroup{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSvcGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(svcgroupsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.SvcGroupList{}) + return err +} + +// Patch applies the patch and returns the patched svcGroup. +func (c *FakeSvcGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.SvcGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(svcgroupsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.SvcGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SvcGroup), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_svcgrouprt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_svcgrouprt.go new file mode 100644 index 000000000..1e32a3fa0 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_svcgrouprt.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeSvcGroupRTs implements SvcGroupRTInterface +type FakeSvcGroupRTs struct { + Fake *FakeGlobalTsmV1 +} + +var svcgrouprtsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "svcgrouprts"} + +var svcgrouprtsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "SvcGroupRT"} + +// Get takes name of the svcGroupRT, and returns the corresponding svcGroupRT object, and an error if there is any. +func (c *FakeSvcGroupRTs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.SvcGroupRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(svcgrouprtsResource, name), &globaltsmtanzuvmwarecomv1.SvcGroupRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SvcGroupRT), err +} + +// List takes label and field selectors, and returns the list of SvcGroupRTs that match those selectors. +func (c *FakeSvcGroupRTs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.SvcGroupRTList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(svcgrouprtsResource, svcgrouprtsKind, opts), &globaltsmtanzuvmwarecomv1.SvcGroupRTList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.SvcGroupRTList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.SvcGroupRTList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.SvcGroupRTList).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 svcGroupRTs. +func (c *FakeSvcGroupRTs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(svcgrouprtsResource, opts)) +} + +// Create takes the representation of a svcGroupRT and creates it. Returns the server's representation of the svcGroupRT, and an error, if there is any. +func (c *FakeSvcGroupRTs) Create(ctx context.Context, svcGroupRT *globaltsmtanzuvmwarecomv1.SvcGroupRT, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.SvcGroupRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(svcgrouprtsResource, svcGroupRT), &globaltsmtanzuvmwarecomv1.SvcGroupRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SvcGroupRT), err +} + +// Update takes the representation of a svcGroupRT and updates it. Returns the server's representation of the svcGroupRT, and an error, if there is any. +func (c *FakeSvcGroupRTs) Update(ctx context.Context, svcGroupRT *globaltsmtanzuvmwarecomv1.SvcGroupRT, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.SvcGroupRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(svcgrouprtsResource, svcGroupRT), &globaltsmtanzuvmwarecomv1.SvcGroupRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SvcGroupRT), err +} + +// Delete takes name of the svcGroupRT and deletes it. Returns an error if one occurs. +func (c *FakeSvcGroupRTs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(svcgrouprtsResource, name), &globaltsmtanzuvmwarecomv1.SvcGroupRT{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSvcGroupRTs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(svcgrouprtsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.SvcGroupRTList{}) + return err +} + +// Patch applies the patch and returns the patched svcGroupRT. +func (c *FakeSvcGroupRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.SvcGroupRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(svcgrouprtsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.SvcGroupRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.SvcGroupRT), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_table.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_table.go new file mode 100644 index 000000000..99accc8f4 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_table.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeTables implements TableInterface +type FakeTables struct { + Fake *FakeGlobalTsmV1 +} + +var tablesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "tables"} + +var tablesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Table"} + +// Get takes name of the table, and returns the corresponding table object, and an error if there is any. +func (c *FakeTables) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Table, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(tablesResource, name), &globaltsmtanzuvmwarecomv1.Table{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Table), err +} + +// List takes label and field selectors, and returns the list of Tables that match those selectors. +func (c *FakeTables) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.TableList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(tablesResource, tablesKind, opts), &globaltsmtanzuvmwarecomv1.TableList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.TableList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.TableList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.TableList).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 tables. +func (c *FakeTables) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(tablesResource, opts)) +} + +// Create takes the representation of a table and creates it. Returns the server's representation of the table, and an error, if there is any. +func (c *FakeTables) Create(ctx context.Context, table *globaltsmtanzuvmwarecomv1.Table, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Table, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(tablesResource, table), &globaltsmtanzuvmwarecomv1.Table{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Table), err +} + +// Update takes the representation of a table and updates it. Returns the server's representation of the table, and an error, if there is any. +func (c *FakeTables) Update(ctx context.Context, table *globaltsmtanzuvmwarecomv1.Table, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Table, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(tablesResource, table), &globaltsmtanzuvmwarecomv1.Table{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Table), err +} + +// Delete takes name of the table and deletes it. Returns an error if one occurs. +func (c *FakeTables) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(tablesResource, name), &globaltsmtanzuvmwarecomv1.Table{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTables) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(tablesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.TableList{}) + return err +} + +// Patch applies the patch and returns the patched table. +func (c *FakeTables) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Table, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(tablesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Table{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Table), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_template.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_template.go new file mode 100644 index 000000000..f59321950 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_template.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeTemplates implements TemplateInterface +type FakeTemplates struct { + Fake *FakeGlobalTsmV1 +} + +var templatesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "templates"} + +var templatesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Template"} + +// Get takes name of the template, and returns the corresponding template object, and an error if there is any. +func (c *FakeTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Template, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(templatesResource, name), &globaltsmtanzuvmwarecomv1.Template{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Template), err +} + +// List takes label and field selectors, and returns the list of Templates that match those selectors. +func (c *FakeTemplates) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.TemplateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(templatesResource, templatesKind, opts), &globaltsmtanzuvmwarecomv1.TemplateList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.TemplateList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.TemplateList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.TemplateList).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 templates. +func (c *FakeTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(templatesResource, opts)) +} + +// Create takes the representation of a template and creates it. Returns the server's representation of the template, and an error, if there is any. +func (c *FakeTemplates) Create(ctx context.Context, template *globaltsmtanzuvmwarecomv1.Template, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Template, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(templatesResource, template), &globaltsmtanzuvmwarecomv1.Template{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Template), err +} + +// Update takes the representation of a template and updates it. Returns the server's representation of the template, and an error, if there is any. +func (c *FakeTemplates) Update(ctx context.Context, template *globaltsmtanzuvmwarecomv1.Template, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Template, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(templatesResource, template), &globaltsmtanzuvmwarecomv1.Template{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Template), err +} + +// Delete takes name of the template and deletes it. Returns an error if one occurs. +func (c *FakeTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(templatesResource, name), &globaltsmtanzuvmwarecomv1.Template{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(templatesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.TemplateList{}) + return err +} + +// Patch applies the patch and returns the patched template. +func (c *FakeTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Template, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(templatesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Template{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Template), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_templategroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_templategroup.go new file mode 100644 index 000000000..8a69516f9 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_templategroup.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeTemplateGroups implements TemplateGroupInterface +type FakeTemplateGroups struct { + Fake *FakeGlobalTsmV1 +} + +var templategroupsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "templategroups"} + +var templategroupsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "TemplateGroup"} + +// Get takes name of the templateGroup, and returns the corresponding templateGroup object, and an error if there is any. +func (c *FakeTemplateGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.TemplateGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(templategroupsResource, name), &globaltsmtanzuvmwarecomv1.TemplateGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.TemplateGroup), err +} + +// List takes label and field selectors, and returns the list of TemplateGroups that match those selectors. +func (c *FakeTemplateGroups) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.TemplateGroupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(templategroupsResource, templategroupsKind, opts), &globaltsmtanzuvmwarecomv1.TemplateGroupList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.TemplateGroupList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.TemplateGroupList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.TemplateGroupList).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 templateGroups. +func (c *FakeTemplateGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(templategroupsResource, opts)) +} + +// Create takes the representation of a templateGroup and creates it. Returns the server's representation of the templateGroup, and an error, if there is any. +func (c *FakeTemplateGroups) Create(ctx context.Context, templateGroup *globaltsmtanzuvmwarecomv1.TemplateGroup, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.TemplateGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(templategroupsResource, templateGroup), &globaltsmtanzuvmwarecomv1.TemplateGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.TemplateGroup), err +} + +// Update takes the representation of a templateGroup and updates it. Returns the server's representation of the templateGroup, and an error, if there is any. +func (c *FakeTemplateGroups) Update(ctx context.Context, templateGroup *globaltsmtanzuvmwarecomv1.TemplateGroup, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.TemplateGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(templategroupsResource, templateGroup), &globaltsmtanzuvmwarecomv1.TemplateGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.TemplateGroup), err +} + +// Delete takes name of the templateGroup and deletes it. Returns an error if one occurs. +func (c *FakeTemplateGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(templategroupsResource, name), &globaltsmtanzuvmwarecomv1.TemplateGroup{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTemplateGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(templategroupsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.TemplateGroupList{}) + return err +} + +// Patch applies the patch and returns the patched templateGroup. +func (c *FakeTemplateGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.TemplateGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(templategroupsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.TemplateGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.TemplateGroup), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_tenant.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_tenant.go new file mode 100644 index 000000000..dd5c71593 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_tenant.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeTenants implements TenantInterface +type FakeTenants struct { + Fake *FakeGlobalTsmV1 +} + +var tenantsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "tenants"} + +var tenantsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "Tenant"} + +// Get takes name of the tenant, and returns the corresponding tenant object, and an error if there is any. +func (c *FakeTenants) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.Tenant, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(tenantsResource, name), &globaltsmtanzuvmwarecomv1.Tenant{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Tenant), err +} + +// List takes label and field selectors, and returns the list of Tenants that match those selectors. +func (c *FakeTenants) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.TenantList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(tenantsResource, tenantsKind, opts), &globaltsmtanzuvmwarecomv1.TenantList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.TenantList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.TenantList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.TenantList).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 tenants. +func (c *FakeTenants) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(tenantsResource, opts)) +} + +// Create takes the representation of a tenant and creates it. Returns the server's representation of the tenant, and an error, if there is any. +func (c *FakeTenants) Create(ctx context.Context, tenant *globaltsmtanzuvmwarecomv1.Tenant, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.Tenant, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(tenantsResource, tenant), &globaltsmtanzuvmwarecomv1.Tenant{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Tenant), err +} + +// Update takes the representation of a tenant and updates it. Returns the server's representation of the tenant, and an error, if there is any. +func (c *FakeTenants) Update(ctx context.Context, tenant *globaltsmtanzuvmwarecomv1.Tenant, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.Tenant, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(tenantsResource, tenant), &globaltsmtanzuvmwarecomv1.Tenant{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Tenant), err +} + +// Delete takes name of the tenant and deletes it. Returns an error if one occurs. +func (c *FakeTenants) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(tenantsResource, name), &globaltsmtanzuvmwarecomv1.Tenant{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTenants) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(tenantsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.TenantList{}) + return err +} + +// Patch applies the patch and returns the patched tenant. +func (c *FakeTenants) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.Tenant, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(tenantsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.Tenant{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.Tenant), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_tenantresource.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_tenantresource.go new file mode 100644 index 000000000..462fb1eaa --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_tenantresource.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeTenantResources implements TenantResourceInterface +type FakeTenantResources struct { + Fake *FakeGlobalTsmV1 +} + +var tenantresourcesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "tenantresources"} + +var tenantresourcesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "TenantResource"} + +// Get takes name of the tenantResource, and returns the corresponding tenantResource object, and an error if there is any. +func (c *FakeTenantResources) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.TenantResource, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(tenantresourcesResource, name), &globaltsmtanzuvmwarecomv1.TenantResource{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.TenantResource), err +} + +// List takes label and field selectors, and returns the list of TenantResources that match those selectors. +func (c *FakeTenantResources) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.TenantResourceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(tenantresourcesResource, tenantresourcesKind, opts), &globaltsmtanzuvmwarecomv1.TenantResourceList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.TenantResourceList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.TenantResourceList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.TenantResourceList).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 tenantResources. +func (c *FakeTenantResources) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(tenantresourcesResource, opts)) +} + +// Create takes the representation of a tenantResource and creates it. Returns the server's representation of the tenantResource, and an error, if there is any. +func (c *FakeTenantResources) Create(ctx context.Context, tenantResource *globaltsmtanzuvmwarecomv1.TenantResource, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.TenantResource, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(tenantresourcesResource, tenantResource), &globaltsmtanzuvmwarecomv1.TenantResource{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.TenantResource), err +} + +// Update takes the representation of a tenantResource and updates it. Returns the server's representation of the tenantResource, and an error, if there is any. +func (c *FakeTenantResources) Update(ctx context.Context, tenantResource *globaltsmtanzuvmwarecomv1.TenantResource, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.TenantResource, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(tenantresourcesResource, tenantResource), &globaltsmtanzuvmwarecomv1.TenantResource{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.TenantResource), err +} + +// Delete takes name of the tenantResource and deletes it. Returns an error if one occurs. +func (c *FakeTenantResources) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(tenantresourcesResource, name), &globaltsmtanzuvmwarecomv1.TenantResource{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTenantResources) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(tenantresourcesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.TenantResourceList{}) + return err +} + +// Patch applies the patch and returns the patched tenantResource. +func (c *FakeTenantResources) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.TenantResource, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(tenantresourcesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.TenantResource{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.TenantResource), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_tenanttoken.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_tenanttoken.go new file mode 100644 index 000000000..e769f7db2 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_tenanttoken.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeTenantTokens implements TenantTokenInterface +type FakeTenantTokens struct { + Fake *FakeGlobalTsmV1 +} + +var tenanttokensResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "tenanttokens"} + +var tenanttokensKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "TenantToken"} + +// Get takes name of the tenantToken, and returns the corresponding tenantToken object, and an error if there is any. +func (c *FakeTenantTokens) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.TenantToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(tenanttokensResource, name), &globaltsmtanzuvmwarecomv1.TenantToken{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.TenantToken), err +} + +// List takes label and field selectors, and returns the list of TenantTokens that match those selectors. +func (c *FakeTenantTokens) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.TenantTokenList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(tenanttokensResource, tenanttokensKind, opts), &globaltsmtanzuvmwarecomv1.TenantTokenList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.TenantTokenList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.TenantTokenList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.TenantTokenList).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 tenantTokens. +func (c *FakeTenantTokens) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(tenanttokensResource, opts)) +} + +// Create takes the representation of a tenantToken and creates it. Returns the server's representation of the tenantToken, and an error, if there is any. +func (c *FakeTenantTokens) Create(ctx context.Context, tenantToken *globaltsmtanzuvmwarecomv1.TenantToken, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.TenantToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(tenanttokensResource, tenantToken), &globaltsmtanzuvmwarecomv1.TenantToken{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.TenantToken), err +} + +// Update takes the representation of a tenantToken and updates it. Returns the server's representation of the tenantToken, and an error, if there is any. +func (c *FakeTenantTokens) Update(ctx context.Context, tenantToken *globaltsmtanzuvmwarecomv1.TenantToken, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.TenantToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(tenanttokensResource, tenantToken), &globaltsmtanzuvmwarecomv1.TenantToken{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.TenantToken), err +} + +// Delete takes name of the tenantToken and deletes it. Returns an error if one occurs. +func (c *FakeTenantTokens) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(tenanttokensResource, name), &globaltsmtanzuvmwarecomv1.TenantToken{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTenantTokens) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(tenanttokensResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.TenantTokenList{}) + return err +} + +// Patch applies the patch and returns the patched tenantToken. +func (c *FakeTenantTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.TenantToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(tenanttokensResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.TenantToken{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.TenantToken), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_user.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_user.go new file mode 100644 index 000000000..2de4a0512 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_user.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeUsers implements UserInterface +type FakeUsers struct { + Fake *FakeGlobalTsmV1 +} + +var usersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "users"} + +var usersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "User"} + +// Get takes name of the user, and returns the corresponding user object, and an error if there is any. +func (c *FakeUsers) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.User, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(usersResource, name), &globaltsmtanzuvmwarecomv1.User{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.User), err +} + +// List takes label and field selectors, and returns the list of Users that match those selectors. +func (c *FakeUsers) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.UserList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(usersResource, usersKind, opts), &globaltsmtanzuvmwarecomv1.UserList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.UserList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.UserList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.UserList).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 users. +func (c *FakeUsers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(usersResource, opts)) +} + +// Create takes the representation of a user and creates it. Returns the server's representation of the user, and an error, if there is any. +func (c *FakeUsers) Create(ctx context.Context, user *globaltsmtanzuvmwarecomv1.User, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.User, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(usersResource, user), &globaltsmtanzuvmwarecomv1.User{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.User), err +} + +// Update takes the representation of a user and updates it. Returns the server's representation of the user, and an error, if there is any. +func (c *FakeUsers) Update(ctx context.Context, user *globaltsmtanzuvmwarecomv1.User, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.User, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(usersResource, user), &globaltsmtanzuvmwarecomv1.User{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.User), err +} + +// Delete takes name of the user and deletes it. Returns an error if one occurs. +func (c *FakeUsers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(usersResource, name), &globaltsmtanzuvmwarecomv1.User{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeUsers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(usersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.UserList{}) + return err +} + +// Patch applies the patch and returns the patched user. +func (c *FakeUsers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.User, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(usersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.User{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.User), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_userdiscovery.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_userdiscovery.go new file mode 100644 index 000000000..72f797f13 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_userdiscovery.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeUserDiscoveries implements UserDiscoveryInterface +type FakeUserDiscoveries struct { + Fake *FakeGlobalTsmV1 +} + +var userdiscoveriesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "userdiscoveries"} + +var userdiscoveriesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "UserDiscovery"} + +// Get takes name of the userDiscovery, and returns the corresponding userDiscovery object, and an error if there is any. +func (c *FakeUserDiscoveries) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.UserDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(userdiscoveriesResource, name), &globaltsmtanzuvmwarecomv1.UserDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserDiscovery), err +} + +// List takes label and field selectors, and returns the list of UserDiscoveries that match those selectors. +func (c *FakeUserDiscoveries) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.UserDiscoveryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(userdiscoveriesResource, userdiscoveriesKind, opts), &globaltsmtanzuvmwarecomv1.UserDiscoveryList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.UserDiscoveryList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.UserDiscoveryList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.UserDiscoveryList).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 userDiscoveries. +func (c *FakeUserDiscoveries) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(userdiscoveriesResource, opts)) +} + +// Create takes the representation of a userDiscovery and creates it. Returns the server's representation of the userDiscovery, and an error, if there is any. +func (c *FakeUserDiscoveries) Create(ctx context.Context, userDiscovery *globaltsmtanzuvmwarecomv1.UserDiscovery, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.UserDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(userdiscoveriesResource, userDiscovery), &globaltsmtanzuvmwarecomv1.UserDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserDiscovery), err +} + +// Update takes the representation of a userDiscovery and updates it. Returns the server's representation of the userDiscovery, and an error, if there is any. +func (c *FakeUserDiscoveries) Update(ctx context.Context, userDiscovery *globaltsmtanzuvmwarecomv1.UserDiscovery, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.UserDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(userdiscoveriesResource, userDiscovery), &globaltsmtanzuvmwarecomv1.UserDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserDiscovery), err +} + +// Delete takes name of the userDiscovery and deletes it. Returns an error if one occurs. +func (c *FakeUserDiscoveries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(userdiscoveriesResource, name), &globaltsmtanzuvmwarecomv1.UserDiscovery{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeUserDiscoveries) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(userdiscoveriesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.UserDiscoveryList{}) + return err +} + +// Patch applies the patch and returns the patched userDiscovery. +func (c *FakeUserDiscoveries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.UserDiscovery, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(userdiscoveriesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.UserDiscovery{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserDiscovery), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_userdiscoveryrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_userdiscoveryrt.go new file mode 100644 index 000000000..ab1657979 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_userdiscoveryrt.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeUserDiscoveryRTs implements UserDiscoveryRTInterface +type FakeUserDiscoveryRTs struct { + Fake *FakeGlobalTsmV1 +} + +var userdiscoveryrtsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "userdiscoveryrts"} + +var userdiscoveryrtsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "UserDiscoveryRT"} + +// Get takes name of the userDiscoveryRT, and returns the corresponding userDiscoveryRT object, and an error if there is any. +func (c *FakeUserDiscoveryRTs) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.UserDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(userdiscoveryrtsResource, name), &globaltsmtanzuvmwarecomv1.UserDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserDiscoveryRT), err +} + +// List takes label and field selectors, and returns the list of UserDiscoveryRTs that match those selectors. +func (c *FakeUserDiscoveryRTs) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.UserDiscoveryRTList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(userdiscoveryrtsResource, userdiscoveryrtsKind, opts), &globaltsmtanzuvmwarecomv1.UserDiscoveryRTList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.UserDiscoveryRTList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.UserDiscoveryRTList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.UserDiscoveryRTList).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 userDiscoveryRTs. +func (c *FakeUserDiscoveryRTs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(userdiscoveryrtsResource, opts)) +} + +// Create takes the representation of a userDiscoveryRT and creates it. Returns the server's representation of the userDiscoveryRT, and an error, if there is any. +func (c *FakeUserDiscoveryRTs) Create(ctx context.Context, userDiscoveryRT *globaltsmtanzuvmwarecomv1.UserDiscoveryRT, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.UserDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(userdiscoveryrtsResource, userDiscoveryRT), &globaltsmtanzuvmwarecomv1.UserDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserDiscoveryRT), err +} + +// Update takes the representation of a userDiscoveryRT and updates it. Returns the server's representation of the userDiscoveryRT, and an error, if there is any. +func (c *FakeUserDiscoveryRTs) Update(ctx context.Context, userDiscoveryRT *globaltsmtanzuvmwarecomv1.UserDiscoveryRT, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.UserDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(userdiscoveryrtsResource, userDiscoveryRT), &globaltsmtanzuvmwarecomv1.UserDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserDiscoveryRT), err +} + +// Delete takes name of the userDiscoveryRT and deletes it. Returns an error if one occurs. +func (c *FakeUserDiscoveryRTs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(userdiscoveryrtsResource, name), &globaltsmtanzuvmwarecomv1.UserDiscoveryRT{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeUserDiscoveryRTs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(userdiscoveryrtsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.UserDiscoveryRTList{}) + return err +} + +// Patch applies the patch and returns the patched userDiscoveryRT. +func (c *FakeUserDiscoveryRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.UserDiscoveryRT, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(userdiscoveryrtsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.UserDiscoveryRT{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserDiscoveryRT), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_userfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_userfolder.go new file mode 100644 index 000000000..555a82032 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_userfolder.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeUserFolders implements UserFolderInterface +type FakeUserFolders struct { + Fake *FakeGlobalTsmV1 +} + +var userfoldersResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "userfolders"} + +var userfoldersKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "UserFolder"} + +// Get takes name of the userFolder, and returns the corresponding userFolder object, and an error if there is any. +func (c *FakeUserFolders) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.UserFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(userfoldersResource, name), &globaltsmtanzuvmwarecomv1.UserFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserFolder), err +} + +// List takes label and field selectors, and returns the list of UserFolders that match those selectors. +func (c *FakeUserFolders) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.UserFolderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(userfoldersResource, userfoldersKind, opts), &globaltsmtanzuvmwarecomv1.UserFolderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.UserFolderList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.UserFolderList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.UserFolderList).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 userFolders. +func (c *FakeUserFolders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(userfoldersResource, opts)) +} + +// Create takes the representation of a userFolder and creates it. Returns the server's representation of the userFolder, and an error, if there is any. +func (c *FakeUserFolders) Create(ctx context.Context, userFolder *globaltsmtanzuvmwarecomv1.UserFolder, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.UserFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(userfoldersResource, userFolder), &globaltsmtanzuvmwarecomv1.UserFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserFolder), err +} + +// Update takes the representation of a userFolder and updates it. Returns the server's representation of the userFolder, and an error, if there is any. +func (c *FakeUserFolders) Update(ctx context.Context, userFolder *globaltsmtanzuvmwarecomv1.UserFolder, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.UserFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(userfoldersResource, userFolder), &globaltsmtanzuvmwarecomv1.UserFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserFolder), err +} + +// Delete takes name of the userFolder and deletes it. Returns an error if one occurs. +func (c *FakeUserFolders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(userfoldersResource, name), &globaltsmtanzuvmwarecomv1.UserFolder{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeUserFolders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(userfoldersResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.UserFolderList{}) + return err +} + +// Patch applies the patch and returns the patched userFolder. +func (c *FakeUserFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.UserFolder, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(userfoldersResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.UserFolder{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserFolder), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_usergroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_usergroup.go new file mode 100644 index 000000000..f999ab3f7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_usergroup.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeUserGroups implements UserGroupInterface +type FakeUserGroups struct { + Fake *FakeGlobalTsmV1 +} + +var usergroupsResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "usergroups"} + +var usergroupsKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "UserGroup"} + +// Get takes name of the userGroup, and returns the corresponding userGroup object, and an error if there is any. +func (c *FakeUserGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.UserGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(usergroupsResource, name), &globaltsmtanzuvmwarecomv1.UserGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserGroup), err +} + +// List takes label and field selectors, and returns the list of UserGroups that match those selectors. +func (c *FakeUserGroups) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.UserGroupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(usergroupsResource, usergroupsKind, opts), &globaltsmtanzuvmwarecomv1.UserGroupList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.UserGroupList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.UserGroupList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.UserGroupList).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 userGroups. +func (c *FakeUserGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(usergroupsResource, opts)) +} + +// Create takes the representation of a userGroup and creates it. Returns the server's representation of the userGroup, and an error, if there is any. +func (c *FakeUserGroups) Create(ctx context.Context, userGroup *globaltsmtanzuvmwarecomv1.UserGroup, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.UserGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(usergroupsResource, userGroup), &globaltsmtanzuvmwarecomv1.UserGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserGroup), err +} + +// Update takes the representation of a userGroup and updates it. Returns the server's representation of the userGroup, and an error, if there is any. +func (c *FakeUserGroups) Update(ctx context.Context, userGroup *globaltsmtanzuvmwarecomv1.UserGroup, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.UserGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(usergroupsResource, userGroup), &globaltsmtanzuvmwarecomv1.UserGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserGroup), err +} + +// Delete takes name of the userGroup and deletes it. Returns an error if one occurs. +func (c *FakeUserGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(usergroupsResource, name), &globaltsmtanzuvmwarecomv1.UserGroup{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeUserGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(usergroupsResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.UserGroupList{}) + return err +} + +// Patch applies the patch and returns the patched userGroup. +func (c *FakeUserGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.UserGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(usergroupsResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.UserGroup{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserGroup), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_userpreference.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_userpreference.go new file mode 100644 index 000000000..0d884c11a --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_userpreference.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeUserPreferences implements UserPreferenceInterface +type FakeUserPreferences struct { + Fake *FakeGlobalTsmV1 +} + +var userpreferencesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "userpreferences"} + +var userpreferencesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "UserPreference"} + +// Get takes name of the userPreference, and returns the corresponding userPreference object, and an error if there is any. +func (c *FakeUserPreferences) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.UserPreference, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(userpreferencesResource, name), &globaltsmtanzuvmwarecomv1.UserPreference{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserPreference), err +} + +// List takes label and field selectors, and returns the list of UserPreferences that match those selectors. +func (c *FakeUserPreferences) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.UserPreferenceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(userpreferencesResource, userpreferencesKind, opts), &globaltsmtanzuvmwarecomv1.UserPreferenceList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.UserPreferenceList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.UserPreferenceList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.UserPreferenceList).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 userPreferences. +func (c *FakeUserPreferences) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(userpreferencesResource, opts)) +} + +// Create takes the representation of a userPreference and creates it. Returns the server's representation of the userPreference, and an error, if there is any. +func (c *FakeUserPreferences) Create(ctx context.Context, userPreference *globaltsmtanzuvmwarecomv1.UserPreference, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.UserPreference, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(userpreferencesResource, userPreference), &globaltsmtanzuvmwarecomv1.UserPreference{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserPreference), err +} + +// Update takes the representation of a userPreference and updates it. Returns the server's representation of the userPreference, and an error, if there is any. +func (c *FakeUserPreferences) Update(ctx context.Context, userPreference *globaltsmtanzuvmwarecomv1.UserPreference, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.UserPreference, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(userpreferencesResource, userPreference), &globaltsmtanzuvmwarecomv1.UserPreference{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserPreference), err +} + +// Delete takes name of the userPreference and deletes it. Returns an error if one occurs. +func (c *FakeUserPreferences) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(userpreferencesResource, name), &globaltsmtanzuvmwarecomv1.UserPreference{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeUserPreferences) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(userpreferencesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.UserPreferenceList{}) + return err +} + +// Patch applies the patch and returns the patched userPreference. +func (c *FakeUserPreferences) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.UserPreference, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(userpreferencesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.UserPreference{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.UserPreference), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_virtualservice.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_virtualservice.go new file mode 100644 index 000000000..6fe5bc081 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_virtualservice.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeVirtualServices implements VirtualServiceInterface +type FakeVirtualServices struct { + Fake *FakeGlobalTsmV1 +} + +var virtualservicesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "virtualservices"} + +var virtualservicesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "VirtualService"} + +// Get takes name of the virtualService, and returns the corresponding virtualService object, and an error if there is any. +func (c *FakeVirtualServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.VirtualService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(virtualservicesResource, name), &globaltsmtanzuvmwarecomv1.VirtualService{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.VirtualService), err +} + +// List takes label and field selectors, and returns the list of VirtualServices that match those selectors. +func (c *FakeVirtualServices) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.VirtualServiceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(virtualservicesResource, virtualservicesKind, opts), &globaltsmtanzuvmwarecomv1.VirtualServiceList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.VirtualServiceList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.VirtualServiceList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.VirtualServiceList).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 virtualServices. +func (c *FakeVirtualServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(virtualservicesResource, opts)) +} + +// Create takes the representation of a virtualService and creates it. Returns the server's representation of the virtualService, and an error, if there is any. +func (c *FakeVirtualServices) Create(ctx context.Context, virtualService *globaltsmtanzuvmwarecomv1.VirtualService, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.VirtualService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(virtualservicesResource, virtualService), &globaltsmtanzuvmwarecomv1.VirtualService{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.VirtualService), err +} + +// Update takes the representation of a virtualService and updates it. Returns the server's representation of the virtualService, and an error, if there is any. +func (c *FakeVirtualServices) Update(ctx context.Context, virtualService *globaltsmtanzuvmwarecomv1.VirtualService, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.VirtualService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(virtualservicesResource, virtualService), &globaltsmtanzuvmwarecomv1.VirtualService{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.VirtualService), err +} + +// Delete takes name of the virtualService and deletes it. Returns an error if one occurs. +func (c *FakeVirtualServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(virtualservicesResource, name), &globaltsmtanzuvmwarecomv1.VirtualService{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVirtualServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(virtualservicesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.VirtualServiceList{}) + return err +} + +// Patch applies the patch and returns the patched virtualService. +func (c *FakeVirtualServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.VirtualService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(virtualservicesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.VirtualService{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.VirtualService), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_workloadentry.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_workloadentry.go new file mode 100644 index 000000000..fe952d78c --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/fake/fake_workloadentry.go @@ -0,0 +1,122 @@ +/* +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 ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + 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" +) + +// FakeWorkloadEntries implements WorkloadEntryInterface +type FakeWorkloadEntries struct { + Fake *FakeGlobalTsmV1 +} + +var workloadentriesResource = schema.GroupVersionResource{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Resource: "workloadentries"} + +var workloadentriesKind = schema.GroupVersionKind{Group: "global.tsm.tanzu.vmware.com", Version: "v1", Kind: "WorkloadEntry"} + +// Get takes name of the workloadEntry, and returns the corresponding workloadEntry object, and an error if there is any. +func (c *FakeWorkloadEntries) Get(ctx context.Context, name string, options v1.GetOptions) (result *globaltsmtanzuvmwarecomv1.WorkloadEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(workloadentriesResource, name), &globaltsmtanzuvmwarecomv1.WorkloadEntry{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.WorkloadEntry), err +} + +// List takes label and field selectors, and returns the list of WorkloadEntries that match those selectors. +func (c *FakeWorkloadEntries) List(ctx context.Context, opts v1.ListOptions) (result *globaltsmtanzuvmwarecomv1.WorkloadEntryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(workloadentriesResource, workloadentriesKind, opts), &globaltsmtanzuvmwarecomv1.WorkloadEntryList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &globaltsmtanzuvmwarecomv1.WorkloadEntryList{ListMeta: obj.(*globaltsmtanzuvmwarecomv1.WorkloadEntryList).ListMeta} + for _, item := range obj.(*globaltsmtanzuvmwarecomv1.WorkloadEntryList).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 workloadEntries. +func (c *FakeWorkloadEntries) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(workloadentriesResource, opts)) +} + +// Create takes the representation of a workloadEntry and creates it. Returns the server's representation of the workloadEntry, and an error, if there is any. +func (c *FakeWorkloadEntries) Create(ctx context.Context, workloadEntry *globaltsmtanzuvmwarecomv1.WorkloadEntry, opts v1.CreateOptions) (result *globaltsmtanzuvmwarecomv1.WorkloadEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(workloadentriesResource, workloadEntry), &globaltsmtanzuvmwarecomv1.WorkloadEntry{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.WorkloadEntry), err +} + +// Update takes the representation of a workloadEntry and updates it. Returns the server's representation of the workloadEntry, and an error, if there is any. +func (c *FakeWorkloadEntries) Update(ctx context.Context, workloadEntry *globaltsmtanzuvmwarecomv1.WorkloadEntry, opts v1.UpdateOptions) (result *globaltsmtanzuvmwarecomv1.WorkloadEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(workloadentriesResource, workloadEntry), &globaltsmtanzuvmwarecomv1.WorkloadEntry{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.WorkloadEntry), err +} + +// Delete takes name of the workloadEntry and deletes it. Returns an error if one occurs. +func (c *FakeWorkloadEntries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(workloadentriesResource, name), &globaltsmtanzuvmwarecomv1.WorkloadEntry{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeWorkloadEntries) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(workloadentriesResource, listOpts) + + _, err := c.Fake.Invokes(action, &globaltsmtanzuvmwarecomv1.WorkloadEntryList{}) + return err +} + +// Patch applies the patch and returns the patched workloadEntry. +func (c *FakeWorkloadEntries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *globaltsmtanzuvmwarecomv1.WorkloadEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(workloadentriesResource, name, pt, data, subresources...), &globaltsmtanzuvmwarecomv1.WorkloadEntry{}) + if obj == nil { + return nil, err + } + return obj.(*globaltsmtanzuvmwarecomv1.WorkloadEntry), err +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/featureflag.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/featureflag.go new file mode 100644 index 000000000..75cbe30ac --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/featureflag.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// FeatureFlagsGetter has a method to return a FeatureFlagInterface. +// A group's client should implement this interface. +type FeatureFlagsGetter interface { + FeatureFlags() FeatureFlagInterface +} + +// FeatureFlagInterface has methods to work with FeatureFlag resources. +type FeatureFlagInterface interface { + Create(ctx context.Context, featureFlag *v1.FeatureFlag, opts metav1.CreateOptions) (*v1.FeatureFlag, error) + Update(ctx context.Context, featureFlag *v1.FeatureFlag, opts metav1.UpdateOptions) (*v1.FeatureFlag, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.FeatureFlag, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.FeatureFlagList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FeatureFlag, err error) + FeatureFlagExpansion +} + +// featureFlags implements FeatureFlagInterface +type featureFlags struct { + client rest.Interface +} + +// newFeatureFlags returns a FeatureFlags +func newFeatureFlags(c *GlobalTsmV1Client) *featureFlags { + return &featureFlags{ + client: c.RESTClient(), + } +} + +// Get takes name of the featureFlag, and returns the corresponding featureFlag object, and an error if there is any. +func (c *featureFlags) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FeatureFlag, err error) { + result = &v1.FeatureFlag{} + err = c.client.Get(). + Resource("featureflags"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of FeatureFlags that match those selectors. +func (c *featureFlags) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FeatureFlagList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.FeatureFlagList{} + err = c.client.Get(). + Resource("featureflags"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested featureFlags. +func (c *featureFlags) Watch(ctx context.Context, opts metav1.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(). + Resource("featureflags"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a featureFlag and creates it. Returns the server's representation of the featureFlag, and an error, if there is any. +func (c *featureFlags) Create(ctx context.Context, featureFlag *v1.FeatureFlag, opts metav1.CreateOptions) (result *v1.FeatureFlag, err error) { + result = &v1.FeatureFlag{} + err = c.client.Post(). + Resource("featureflags"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(featureFlag). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a featureFlag and updates it. Returns the server's representation of the featureFlag, and an error, if there is any. +func (c *featureFlags) Update(ctx context.Context, featureFlag *v1.FeatureFlag, opts metav1.UpdateOptions) (result *v1.FeatureFlag, err error) { + result = &v1.FeatureFlag{} + err = c.client.Put(). + Resource("featureflags"). + Name(featureFlag.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(featureFlag). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the featureFlag and deletes it. Returns an error if one occurs. +func (c *featureFlags) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("featureflags"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *featureFlags) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("featureflags"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched featureFlag. +func (c *featureFlags) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FeatureFlag, err error) { + result = &v1.FeatureFlag{} + err = c.client.Patch(pt). + Resource("featureflags"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/federatedsloconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/federatedsloconfig.go new file mode 100644 index 000000000..d435a2320 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/federatedsloconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// FederatedSloConfigsGetter has a method to return a FederatedSloConfigInterface. +// A group's client should implement this interface. +type FederatedSloConfigsGetter interface { + FederatedSloConfigs() FederatedSloConfigInterface +} + +// FederatedSloConfigInterface has methods to work with FederatedSloConfig resources. +type FederatedSloConfigInterface interface { + Create(ctx context.Context, federatedSloConfig *v1.FederatedSloConfig, opts metav1.CreateOptions) (*v1.FederatedSloConfig, error) + Update(ctx context.Context, federatedSloConfig *v1.FederatedSloConfig, opts metav1.UpdateOptions) (*v1.FederatedSloConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.FederatedSloConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.FederatedSloConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FederatedSloConfig, err error) + FederatedSloConfigExpansion +} + +// federatedSloConfigs implements FederatedSloConfigInterface +type federatedSloConfigs struct { + client rest.Interface +} + +// newFederatedSloConfigs returns a FederatedSloConfigs +func newFederatedSloConfigs(c *GlobalTsmV1Client) *federatedSloConfigs { + return &federatedSloConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the federatedSloConfig, and returns the corresponding federatedSloConfig object, and an error if there is any. +func (c *federatedSloConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FederatedSloConfig, err error) { + result = &v1.FederatedSloConfig{} + err = c.client.Get(). + Resource("federatedsloconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of FederatedSloConfigs that match those selectors. +func (c *federatedSloConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FederatedSloConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.FederatedSloConfigList{} + err = c.client.Get(). + Resource("federatedsloconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested federatedSloConfigs. +func (c *federatedSloConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("federatedsloconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a federatedSloConfig and creates it. Returns the server's representation of the federatedSloConfig, and an error, if there is any. +func (c *federatedSloConfigs) Create(ctx context.Context, federatedSloConfig *v1.FederatedSloConfig, opts metav1.CreateOptions) (result *v1.FederatedSloConfig, err error) { + result = &v1.FederatedSloConfig{} + err = c.client.Post(). + Resource("federatedsloconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(federatedSloConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a federatedSloConfig and updates it. Returns the server's representation of the federatedSloConfig, and an error, if there is any. +func (c *federatedSloConfigs) Update(ctx context.Context, federatedSloConfig *v1.FederatedSloConfig, opts metav1.UpdateOptions) (result *v1.FederatedSloConfig, err error) { + result = &v1.FederatedSloConfig{} + err = c.client.Put(). + Resource("federatedsloconfigs"). + Name(federatedSloConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(federatedSloConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the federatedSloConfig and deletes it. Returns an error if one occurs. +func (c *federatedSloConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("federatedsloconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *federatedSloConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("federatedsloconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched federatedSloConfig. +func (c *federatedSloConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FederatedSloConfig, err error) { + result = &v1.FederatedSloConfig{} + err = c.client.Patch(pt). + Resource("federatedsloconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/federatedsloserviceconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/federatedsloserviceconfig.go new file mode 100644 index 000000000..6d3f13c95 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/federatedsloserviceconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// FederatedSloServiceConfigsGetter has a method to return a FederatedSloServiceConfigInterface. +// A group's client should implement this interface. +type FederatedSloServiceConfigsGetter interface { + FederatedSloServiceConfigs() FederatedSloServiceConfigInterface +} + +// FederatedSloServiceConfigInterface has methods to work with FederatedSloServiceConfig resources. +type FederatedSloServiceConfigInterface interface { + Create(ctx context.Context, federatedSloServiceConfig *v1.FederatedSloServiceConfig, opts metav1.CreateOptions) (*v1.FederatedSloServiceConfig, error) + Update(ctx context.Context, federatedSloServiceConfig *v1.FederatedSloServiceConfig, opts metav1.UpdateOptions) (*v1.FederatedSloServiceConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.FederatedSloServiceConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.FederatedSloServiceConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FederatedSloServiceConfig, err error) + FederatedSloServiceConfigExpansion +} + +// federatedSloServiceConfigs implements FederatedSloServiceConfigInterface +type federatedSloServiceConfigs struct { + client rest.Interface +} + +// newFederatedSloServiceConfigs returns a FederatedSloServiceConfigs +func newFederatedSloServiceConfigs(c *GlobalTsmV1Client) *federatedSloServiceConfigs { + return &federatedSloServiceConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the federatedSloServiceConfig, and returns the corresponding federatedSloServiceConfig object, and an error if there is any. +func (c *federatedSloServiceConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FederatedSloServiceConfig, err error) { + result = &v1.FederatedSloServiceConfig{} + err = c.client.Get(). + Resource("federatedsloserviceconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of FederatedSloServiceConfigs that match those selectors. +func (c *federatedSloServiceConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FederatedSloServiceConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.FederatedSloServiceConfigList{} + err = c.client.Get(). + Resource("federatedsloserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested federatedSloServiceConfigs. +func (c *federatedSloServiceConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("federatedsloserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a federatedSloServiceConfig and creates it. Returns the server's representation of the federatedSloServiceConfig, and an error, if there is any. +func (c *federatedSloServiceConfigs) Create(ctx context.Context, federatedSloServiceConfig *v1.FederatedSloServiceConfig, opts metav1.CreateOptions) (result *v1.FederatedSloServiceConfig, err error) { + result = &v1.FederatedSloServiceConfig{} + err = c.client.Post(). + Resource("federatedsloserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(federatedSloServiceConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a federatedSloServiceConfig and updates it. Returns the server's representation of the federatedSloServiceConfig, and an error, if there is any. +func (c *federatedSloServiceConfigs) Update(ctx context.Context, federatedSloServiceConfig *v1.FederatedSloServiceConfig, opts metav1.UpdateOptions) (result *v1.FederatedSloServiceConfig, err error) { + result = &v1.FederatedSloServiceConfig{} + err = c.client.Put(). + Resource("federatedsloserviceconfigs"). + Name(federatedSloServiceConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(federatedSloServiceConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the federatedSloServiceConfig and deletes it. Returns an error if one occurs. +func (c *federatedSloServiceConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("federatedsloserviceconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *federatedSloServiceConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("federatedsloserviceconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched federatedSloServiceConfig. +func (c *federatedSloServiceConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FederatedSloServiceConfig, err error) { + result = &v1.FederatedSloServiceConfig{} + err = c.client.Patch(pt). + Resource("federatedsloserviceconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gateway.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gateway.go new file mode 100644 index 000000000..2dec280a2 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gateway.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GatewaysGetter has a method to return a GatewayInterface. +// A group's client should implement this interface. +type GatewaysGetter interface { + Gateways() GatewayInterface +} + +// GatewayInterface has methods to work with Gateway resources. +type GatewayInterface interface { + Create(ctx context.Context, gateway *v1.Gateway, opts metav1.CreateOptions) (*v1.Gateway, error) + Update(ctx context.Context, gateway *v1.Gateway, opts metav1.UpdateOptions) (*v1.Gateway, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Gateway, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GatewayList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Gateway, err error) + GatewayExpansion +} + +// gateways implements GatewayInterface +type gateways struct { + client rest.Interface +} + +// newGateways returns a Gateways +func newGateways(c *GlobalTsmV1Client) *gateways { + return &gateways{ + client: c.RESTClient(), + } +} + +// Get takes name of the gateway, and returns the corresponding gateway object, and an error if there is any. +func (c *gateways) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Gateway, err error) { + result = &v1.Gateway{} + err = c.client.Get(). + Resource("gateways"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Gateways that match those selectors. +func (c *gateways) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GatewayList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GatewayList{} + err = c.client.Get(). + Resource("gateways"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gateways. +func (c *gateways) Watch(ctx context.Context, opts metav1.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(). + Resource("gateways"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gateway and creates it. Returns the server's representation of the gateway, and an error, if there is any. +func (c *gateways) Create(ctx context.Context, gateway *v1.Gateway, opts metav1.CreateOptions) (result *v1.Gateway, err error) { + result = &v1.Gateway{} + err = c.client.Post(). + Resource("gateways"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gateway). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gateway and updates it. Returns the server's representation of the gateway, and an error, if there is any. +func (c *gateways) Update(ctx context.Context, gateway *v1.Gateway, opts metav1.UpdateOptions) (result *v1.Gateway, err error) { + result = &v1.Gateway{} + err = c.client.Put(). + Resource("gateways"). + Name(gateway.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gateway). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gateway and deletes it. Returns an error if one occurs. +func (c *gateways) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gateways"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gateways) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gateways"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gateway. +func (c *gateways) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Gateway, err error) { + result = &v1.Gateway{} + err = c.client.Patch(pt). + Resource("gateways"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gatewayconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gatewayconfig.go new file mode 100644 index 000000000..def8ac0c1 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gatewayconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GatewayConfigsGetter has a method to return a GatewayConfigInterface. +// A group's client should implement this interface. +type GatewayConfigsGetter interface { + GatewayConfigs() GatewayConfigInterface +} + +// GatewayConfigInterface has methods to work with GatewayConfig resources. +type GatewayConfigInterface interface { + Create(ctx context.Context, gatewayConfig *v1.GatewayConfig, opts metav1.CreateOptions) (*v1.GatewayConfig, error) + Update(ctx context.Context, gatewayConfig *v1.GatewayConfig, opts metav1.UpdateOptions) (*v1.GatewayConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GatewayConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GatewayConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GatewayConfig, err error) + GatewayConfigExpansion +} + +// gatewayConfigs implements GatewayConfigInterface +type gatewayConfigs struct { + client rest.Interface +} + +// newGatewayConfigs returns a GatewayConfigs +func newGatewayConfigs(c *GlobalTsmV1Client) *gatewayConfigs { + return &gatewayConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the gatewayConfig, and returns the corresponding gatewayConfig object, and an error if there is any. +func (c *gatewayConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GatewayConfig, err error) { + result = &v1.GatewayConfig{} + err = c.client.Get(). + Resource("gatewayconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GatewayConfigs that match those selectors. +func (c *gatewayConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GatewayConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GatewayConfigList{} + err = c.client.Get(). + Resource("gatewayconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gatewayConfigs. +func (c *gatewayConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("gatewayconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gatewayConfig and creates it. Returns the server's representation of the gatewayConfig, and an error, if there is any. +func (c *gatewayConfigs) Create(ctx context.Context, gatewayConfig *v1.GatewayConfig, opts metav1.CreateOptions) (result *v1.GatewayConfig, err error) { + result = &v1.GatewayConfig{} + err = c.client.Post(). + Resource("gatewayconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gatewayConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gatewayConfig and updates it. Returns the server's representation of the gatewayConfig, and an error, if there is any. +func (c *gatewayConfigs) Update(ctx context.Context, gatewayConfig *v1.GatewayConfig, opts metav1.UpdateOptions) (result *v1.GatewayConfig, err error) { + result = &v1.GatewayConfig{} + err = c.client.Put(). + Resource("gatewayconfigs"). + Name(gatewayConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gatewayConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gatewayConfig and deletes it. Returns an error if one occurs. +func (c *gatewayConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gatewayconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gatewayConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gatewayconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gatewayConfig. +func (c *gatewayConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GatewayConfig, err error) { + result = &v1.GatewayConfig{} + err = c.client.Patch(pt). + Resource("gatewayconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gatewayconfigadditionallisteners.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gatewayconfigadditionallisteners.go new file mode 100644 index 000000000..f9a71ab62 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gatewayconfigadditionallisteners.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GatewayConfigAdditionalListenersesGetter has a method to return a GatewayConfigAdditionalListenersInterface. +// A group's client should implement this interface. +type GatewayConfigAdditionalListenersesGetter interface { + GatewayConfigAdditionalListenerses() GatewayConfigAdditionalListenersInterface +} + +// GatewayConfigAdditionalListenersInterface has methods to work with GatewayConfigAdditionalListeners resources. +type GatewayConfigAdditionalListenersInterface interface { + Create(ctx context.Context, gatewayConfigAdditionalListeners *v1.GatewayConfigAdditionalListeners, opts metav1.CreateOptions) (*v1.GatewayConfigAdditionalListeners, error) + Update(ctx context.Context, gatewayConfigAdditionalListeners *v1.GatewayConfigAdditionalListeners, opts metav1.UpdateOptions) (*v1.GatewayConfigAdditionalListeners, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GatewayConfigAdditionalListeners, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GatewayConfigAdditionalListenersList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GatewayConfigAdditionalListeners, err error) + GatewayConfigAdditionalListenersExpansion +} + +// gatewayConfigAdditionalListenerses implements GatewayConfigAdditionalListenersInterface +type gatewayConfigAdditionalListenerses struct { + client rest.Interface +} + +// newGatewayConfigAdditionalListenerses returns a GatewayConfigAdditionalListenerses +func newGatewayConfigAdditionalListenerses(c *GlobalTsmV1Client) *gatewayConfigAdditionalListenerses { + return &gatewayConfigAdditionalListenerses{ + client: c.RESTClient(), + } +} + +// Get takes name of the gatewayConfigAdditionalListeners, and returns the corresponding gatewayConfigAdditionalListeners object, and an error if there is any. +func (c *gatewayConfigAdditionalListenerses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GatewayConfigAdditionalListeners, err error) { + result = &v1.GatewayConfigAdditionalListeners{} + err = c.client.Get(). + Resource("gatewayconfigadditionallistenerses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GatewayConfigAdditionalListenerses that match those selectors. +func (c *gatewayConfigAdditionalListenerses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GatewayConfigAdditionalListenersList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GatewayConfigAdditionalListenersList{} + err = c.client.Get(). + Resource("gatewayconfigadditionallistenerses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gatewayConfigAdditionalListenerses. +func (c *gatewayConfigAdditionalListenerses) Watch(ctx context.Context, opts metav1.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(). + Resource("gatewayconfigadditionallistenerses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gatewayConfigAdditionalListeners and creates it. Returns the server's representation of the gatewayConfigAdditionalListeners, and an error, if there is any. +func (c *gatewayConfigAdditionalListenerses) Create(ctx context.Context, gatewayConfigAdditionalListeners *v1.GatewayConfigAdditionalListeners, opts metav1.CreateOptions) (result *v1.GatewayConfigAdditionalListeners, err error) { + result = &v1.GatewayConfigAdditionalListeners{} + err = c.client.Post(). + Resource("gatewayconfigadditionallistenerses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gatewayConfigAdditionalListeners). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gatewayConfigAdditionalListeners and updates it. Returns the server's representation of the gatewayConfigAdditionalListeners, and an error, if there is any. +func (c *gatewayConfigAdditionalListenerses) Update(ctx context.Context, gatewayConfigAdditionalListeners *v1.GatewayConfigAdditionalListeners, opts metav1.UpdateOptions) (result *v1.GatewayConfigAdditionalListeners, err error) { + result = &v1.GatewayConfigAdditionalListeners{} + err = c.client.Put(). + Resource("gatewayconfigadditionallistenerses"). + Name(gatewayConfigAdditionalListeners.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gatewayConfigAdditionalListeners). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gatewayConfigAdditionalListeners and deletes it. Returns an error if one occurs. +func (c *gatewayConfigAdditionalListenerses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gatewayconfigadditionallistenerses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gatewayConfigAdditionalListenerses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gatewayconfigadditionallistenerses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gatewayConfigAdditionalListeners. +func (c *gatewayConfigAdditionalListenerses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GatewayConfigAdditionalListeners, err error) { + result = &v1.GatewayConfigAdditionalListeners{} + err = c.client.Patch(pt). + Resource("gatewayconfigadditionallistenerses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenercertificate.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenercertificate.go new file mode 100644 index 000000000..7d3a31def --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenercertificate.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GatewayConfigListenerCertificatesGetter has a method to return a GatewayConfigListenerCertificateInterface. +// A group's client should implement this interface. +type GatewayConfigListenerCertificatesGetter interface { + GatewayConfigListenerCertificates() GatewayConfigListenerCertificateInterface +} + +// GatewayConfigListenerCertificateInterface has methods to work with GatewayConfigListenerCertificate resources. +type GatewayConfigListenerCertificateInterface interface { + Create(ctx context.Context, gatewayConfigListenerCertificate *v1.GatewayConfigListenerCertificate, opts metav1.CreateOptions) (*v1.GatewayConfigListenerCertificate, error) + Update(ctx context.Context, gatewayConfigListenerCertificate *v1.GatewayConfigListenerCertificate, opts metav1.UpdateOptions) (*v1.GatewayConfigListenerCertificate, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GatewayConfigListenerCertificate, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GatewayConfigListenerCertificateList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GatewayConfigListenerCertificate, err error) + GatewayConfigListenerCertificateExpansion +} + +// gatewayConfigListenerCertificates implements GatewayConfigListenerCertificateInterface +type gatewayConfigListenerCertificates struct { + client rest.Interface +} + +// newGatewayConfigListenerCertificates returns a GatewayConfigListenerCertificates +func newGatewayConfigListenerCertificates(c *GlobalTsmV1Client) *gatewayConfigListenerCertificates { + return &gatewayConfigListenerCertificates{ + client: c.RESTClient(), + } +} + +// Get takes name of the gatewayConfigListenerCertificate, and returns the corresponding gatewayConfigListenerCertificate object, and an error if there is any. +func (c *gatewayConfigListenerCertificates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GatewayConfigListenerCertificate, err error) { + result = &v1.GatewayConfigListenerCertificate{} + err = c.client.Get(). + Resource("gatewayconfiglistenercertificates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GatewayConfigListenerCertificates that match those selectors. +func (c *gatewayConfigListenerCertificates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GatewayConfigListenerCertificateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GatewayConfigListenerCertificateList{} + err = c.client.Get(). + Resource("gatewayconfiglistenercertificates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gatewayConfigListenerCertificates. +func (c *gatewayConfigListenerCertificates) Watch(ctx context.Context, opts metav1.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(). + Resource("gatewayconfiglistenercertificates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gatewayConfigListenerCertificate and creates it. Returns the server's representation of the gatewayConfigListenerCertificate, and an error, if there is any. +func (c *gatewayConfigListenerCertificates) Create(ctx context.Context, gatewayConfigListenerCertificate *v1.GatewayConfigListenerCertificate, opts metav1.CreateOptions) (result *v1.GatewayConfigListenerCertificate, err error) { + result = &v1.GatewayConfigListenerCertificate{} + err = c.client.Post(). + Resource("gatewayconfiglistenercertificates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gatewayConfigListenerCertificate). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gatewayConfigListenerCertificate and updates it. Returns the server's representation of the gatewayConfigListenerCertificate, and an error, if there is any. +func (c *gatewayConfigListenerCertificates) Update(ctx context.Context, gatewayConfigListenerCertificate *v1.GatewayConfigListenerCertificate, opts metav1.UpdateOptions) (result *v1.GatewayConfigListenerCertificate, err error) { + result = &v1.GatewayConfigListenerCertificate{} + err = c.client.Put(). + Resource("gatewayconfiglistenercertificates"). + Name(gatewayConfigListenerCertificate.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gatewayConfigListenerCertificate). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gatewayConfigListenerCertificate and deletes it. Returns an error if one occurs. +func (c *gatewayConfigListenerCertificates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gatewayconfiglistenercertificates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gatewayConfigListenerCertificates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gatewayconfiglistenercertificates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gatewayConfigListenerCertificate. +func (c *gatewayConfigListenerCertificates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GatewayConfigListenerCertificate, err error) { + result = &v1.GatewayConfigListenerCertificate{} + err = c.client.Patch(pt). + Resource("gatewayconfiglistenercertificates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenerdestinationroute.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenerdestinationroute.go new file mode 100644 index 000000000..bce39b095 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenerdestinationroute.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GatewayConfigListenerDestinationRoutesGetter has a method to return a GatewayConfigListenerDestinationRouteInterface. +// A group's client should implement this interface. +type GatewayConfigListenerDestinationRoutesGetter interface { + GatewayConfigListenerDestinationRoutes() GatewayConfigListenerDestinationRouteInterface +} + +// GatewayConfigListenerDestinationRouteInterface has methods to work with GatewayConfigListenerDestinationRoute resources. +type GatewayConfigListenerDestinationRouteInterface interface { + Create(ctx context.Context, gatewayConfigListenerDestinationRoute *v1.GatewayConfigListenerDestinationRoute, opts metav1.CreateOptions) (*v1.GatewayConfigListenerDestinationRoute, error) + Update(ctx context.Context, gatewayConfigListenerDestinationRoute *v1.GatewayConfigListenerDestinationRoute, opts metav1.UpdateOptions) (*v1.GatewayConfigListenerDestinationRoute, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GatewayConfigListenerDestinationRoute, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GatewayConfigListenerDestinationRouteList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GatewayConfigListenerDestinationRoute, err error) + GatewayConfigListenerDestinationRouteExpansion +} + +// gatewayConfigListenerDestinationRoutes implements GatewayConfigListenerDestinationRouteInterface +type gatewayConfigListenerDestinationRoutes struct { + client rest.Interface +} + +// newGatewayConfigListenerDestinationRoutes returns a GatewayConfigListenerDestinationRoutes +func newGatewayConfigListenerDestinationRoutes(c *GlobalTsmV1Client) *gatewayConfigListenerDestinationRoutes { + return &gatewayConfigListenerDestinationRoutes{ + client: c.RESTClient(), + } +} + +// Get takes name of the gatewayConfigListenerDestinationRoute, and returns the corresponding gatewayConfigListenerDestinationRoute object, and an error if there is any. +func (c *gatewayConfigListenerDestinationRoutes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GatewayConfigListenerDestinationRoute, err error) { + result = &v1.GatewayConfigListenerDestinationRoute{} + err = c.client.Get(). + Resource("gatewayconfiglistenerdestinationroutes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GatewayConfigListenerDestinationRoutes that match those selectors. +func (c *gatewayConfigListenerDestinationRoutes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GatewayConfigListenerDestinationRouteList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GatewayConfigListenerDestinationRouteList{} + err = c.client.Get(). + Resource("gatewayconfiglistenerdestinationroutes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gatewayConfigListenerDestinationRoutes. +func (c *gatewayConfigListenerDestinationRoutes) Watch(ctx context.Context, opts metav1.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(). + Resource("gatewayconfiglistenerdestinationroutes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gatewayConfigListenerDestinationRoute and creates it. Returns the server's representation of the gatewayConfigListenerDestinationRoute, and an error, if there is any. +func (c *gatewayConfigListenerDestinationRoutes) Create(ctx context.Context, gatewayConfigListenerDestinationRoute *v1.GatewayConfigListenerDestinationRoute, opts metav1.CreateOptions) (result *v1.GatewayConfigListenerDestinationRoute, err error) { + result = &v1.GatewayConfigListenerDestinationRoute{} + err = c.client.Post(). + Resource("gatewayconfiglistenerdestinationroutes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gatewayConfigListenerDestinationRoute). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gatewayConfigListenerDestinationRoute and updates it. Returns the server's representation of the gatewayConfigListenerDestinationRoute, and an error, if there is any. +func (c *gatewayConfigListenerDestinationRoutes) Update(ctx context.Context, gatewayConfigListenerDestinationRoute *v1.GatewayConfigListenerDestinationRoute, opts metav1.UpdateOptions) (result *v1.GatewayConfigListenerDestinationRoute, err error) { + result = &v1.GatewayConfigListenerDestinationRoute{} + err = c.client.Put(). + Resource("gatewayconfiglistenerdestinationroutes"). + Name(gatewayConfigListenerDestinationRoute.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gatewayConfigListenerDestinationRoute). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gatewayConfigListenerDestinationRoute and deletes it. Returns an error if one occurs. +func (c *gatewayConfigListenerDestinationRoutes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gatewayconfiglistenerdestinationroutes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gatewayConfigListenerDestinationRoutes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gatewayconfiglistenerdestinationroutes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gatewayConfigListenerDestinationRoute. +func (c *gatewayConfigListenerDestinationRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GatewayConfigListenerDestinationRoute, err error) { + result = &v1.GatewayConfigListenerDestinationRoute{} + err = c.client.Patch(pt). + Resource("gatewayconfiglistenerdestinationroutes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/generated_expansion.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/generated_expansion.go new file mode 100644 index 000000000..fbbf3e22c --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/generated_expansion.go @@ -0,0 +1,435 @@ +/* +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 v1 + +type ACPConfigExpansion interface{} + +type AccessControlPolicyExpansion interface{} + +type AccessTokenExpansion interface{} + +type AdditionalAttributesExpansion interface{} + +type AllSparkServicesExpansion interface{} + +type AnnotationExpansion interface{} + +type ApiDiscoveryExpansion interface{} + +type ApiDiscoveryRTExpansion interface{} + +type AppExpansion interface{} + +type AppFolderExpansion interface{} + +type AppGroupExpansion interface{} + +type AppTemplateExpansion interface{} + +type AppTemplateServiceDefinitionExpansion interface{} + +type AppUserExpansion interface{} + +type AppVersionExpansion interface{} + +type ApplicationInfoExpansion interface{} + +type AttackDiscoveryExpansion interface{} + +type AttackDiscoveryRTExpansion interface{} + +type AuthenticationPolicyExpansion interface{} + +type AutoscalerExpansion interface{} + +type AutoscalerCRExpansion interface{} + +type AutoscalerConfigExpansion interface{} + +type AutoscalerFolderExpansion interface{} + +type AutoscalingPolicyExpansion interface{} + +type AwsConnectorExpansion interface{} + +type BucketExpansion interface{} + +type CertificateExpansion interface{} + +type CertificateAuthorityConfigNExpansion interface{} + +type CertificateAuthorityRTExpansion interface{} + +type CertificateConfigNExpansion interface{} + +type CertificateRequestExpansion interface{} + +type ClusterExpansion interface{} + +type ClusterConfigExpansion interface{} + +type ClusterConfigFolderExpansion interface{} + +type ClusterFolderExpansion interface{} + +type ClusterSettingsExpansion interface{} + +type ConfigExpansion interface{} + +type ConfigMapExpansion interface{} + +type ConnectionStatusExpansion interface{} + +type DCRegionExpansion interface{} + +type DCZoneExpansion interface{} + +type DNSConfigExpansion interface{} + +type DNSConfigFolderExpansion interface{} + +type DNSProbeConfigExpansion interface{} + +type DNSProbeStatusExpansion interface{} + +type DNSProbesConfigFolderExpansion interface{} + +type DataFolderExpansion interface{} + +type DataFolderDomainExpansion interface{} + +type DataFolderDomainClusterExpansion interface{} + +type DataFolderDomainServiceExpansion interface{} + +type DataFolderDomainServiceVersionExpansion interface{} + +type DataGroupExpansion interface{} + +type DataTemplateExpansion interface{} + +type DatabaseExpansion interface{} + +type DestinationRuleExpansion interface{} + +type DirectoryExpansion interface{} + +type DomainExpansion interface{} + +type DomainConfigExpansion interface{} + +type EndpointsExpansion interface{} + +type EnvoyFilterExpansion interface{} + +type ExternalAccountConfigNExpansion interface{} + +type ExternalAuditStorageExpansion interface{} + +type ExternalDNSConfigNExpansion interface{} + +type ExternalDNSInventoryExpansion interface{} + +type ExternalDNSInventoryHealthCheckExpansion interface{} + +type ExternalDNSInventoryPrimaryDomainExpansion interface{} + +type ExternalDNSInventoryRecordExpansion interface{} + +type ExternalDNSInventoryZoneExpansion interface{} + +type ExternalDNSRuntimeExpansion interface{} + +type ExternalDNSRuntimeEndpointExpansion interface{} + +type ExternalDNSRuntimePrimaryDomainExpansion interface{} + +type ExternalDNSRuntimeSubdomainExpansion interface{} + +type ExternalLBConfigNExpansion interface{} + +type ExternalPluginCapabilityExpansion interface{} + +type ExternalPluginConfigExpansion interface{} + +type ExternalPluginConfigFolderExpansion interface{} + +type ExternalPluginInstanceConfigExpansion interface{} + +type ExternalPluginMonitorExpansion interface{} + +type ExternalServiceConfigExpansion interface{} + +type ExternalServicesRTExpansion interface{} + +type FeatureFlagExpansion interface{} + +type FederatedSloConfigExpansion interface{} + +type FederatedSloServiceConfigExpansion interface{} + +type GNSExpansion interface{} + +type GNSRoutingConfigExpansion interface{} + +type GNSSvcGroupExpansion interface{} + +type GatewayExpansion interface{} + +type GatewayConfigExpansion interface{} + +type GatewayConfigAdditionalListenersExpansion interface{} + +type GatewayConfigListenerCertificateExpansion interface{} + +type GatewayConfigListenerDestinationRouteExpansion interface{} + +type GeoDiscoveryExpansion interface{} + +type GeoDiscoveryRTExpansion interface{} + +type GlobalNamespaceExpansion interface{} + +type GlobalNsExpansion interface{} + +type GlobalRegistrationServiceExpansion interface{} + +type GnsAccessControlPolicyExpansion interface{} + +type GnsAccessControlPolicyRTExpansion interface{} + +type GnsBindingRTExpansion interface{} + +type GnsEndpointsConfigExpansion interface{} + +type GnsRoutingRuleConfigExpansion interface{} + +type GnsSchemaViolationDiscoveryExpansion interface{} + +type GnsSegmentationPolicyExpansion interface{} + +type GnsSegmentationPolicyRTExpansion interface{} + +type GnsServiceEntryConfigExpansion interface{} + +type GnsSvcGroupRTExpansion interface{} + +type HaConfigExpansion interface{} + +type HaConfigV2Expansion interface{} + +type HealthCheckConfigNExpansion interface{} + +type HostConfigExpansion interface{} + +type HostConfigV2Expansion interface{} + +type InboundAuthenticationConfigExpansion interface{} + +type InventoryExpansion interface{} + +type IssuerExpansion interface{} + +type JobExpansion interface{} + +type JobConfigExpansion interface{} + +type JobConfigFolderExpansion interface{} + +type JobFolderExpansion interface{} + +type KnativeIngressExpansion interface{} + +type LabelConfigExpansion interface{} + +type LocalRegistrationServiceExpansion interface{} + +type LocalRegistrationServiceClusterExpansion interface{} + +type LocalRegistrationServiceResourceExpansion interface{} + +type LogExpansion interface{} + +type LogFolderExpansion interface{} + +type MetricMonitorExpansion interface{} + +type NetworkAttachmentDefinitionExpansion interface{} + +type NetworkAttachmentDefinitionConfigExpansion interface{} + +type NodeExpansion interface{} + +type NodeDefinitionExpansion interface{} + +type NodeFolderExpansion interface{} + +type NodeFolderClusterExpansion interface{} + +type NodeGroupExpansion interface{} + +type NodeStatusExpansion interface{} + +type NodeTemplateExpansion interface{} + +type OutboundAuthenticationModeExpansion interface{} + +type PeerAuthenticationExpansion interface{} + +type PiiDiscoveryExpansion interface{} + +type PiiDiscoveryRTExpansion interface{} + +type PolicyConfigExpansion interface{} + +type PolicyTemplateExpansion interface{} + +type ProgressiveUpgradeExpansion interface{} + +type ProgressiveUpgradeConfigExpansion interface{} + +type ProgressiveUpgradeFolderExpansion interface{} + +type ProgressiveUpgradeRuntimeExpansion interface{} + +type ProjectExpansion interface{} + +type ProjectConfigExpansion interface{} + +type ProjectInventoryExpansion interface{} + +type ProjectQueryExpansion interface{} + +type PublicServiceConfigExpansion interface{} + +type PublicServiceRTExpansion interface{} + +type PublicServiceRouteConfigExpansion interface{} + +type RPolicyExpansion interface{} + +type RemoteGatewayServiceConfigExpansion interface{} + +type ResourceGroupExpansion interface{} + +type ResourceGroupRTExpansion interface{} + +type RootExpansion interface{} + +type RuntimeExpansion interface{} + +type SLOFolderExpansion interface{} + +type SLOPolicyExpansion interface{} + +type SchemaViolationDiscoveryRTExpansion interface{} + +type SecretHashExpansion interface{} + +type SecretRTConfigExpansion interface{} + +type SecurityContextConstraintsExpansion interface{} + +type SecurityContextConstraintsConfigExpansion interface{} + +type ServiceExpansion interface{} + +type ServiceConfigExpansion interface{} + +type ServiceCronJobExpansion interface{} + +type ServiceDaemonSetExpansion interface{} + +type ServiceDeploymentExpansion interface{} + +type ServiceDeploymentContainerExpansion interface{} + +type ServiceDirectoryEntryConfigExpansion interface{} + +type ServiceDirectoryNExpansion interface{} + +type ServiceDirectoryRTExpansion interface{} + +type ServiceDirectoryRTFolderExpansion interface{} + +type ServiceDirectoryRTFolderEntryExpansion interface{} + +type ServiceEntryExpansion interface{} + +type ServiceEntryConfigExpansion interface{} + +type ServiceInstanceExpansion interface{} + +type ServiceInstanceContainerExpansion interface{} + +type ServiceJobExpansion interface{} + +type ServiceLevelObjectiveExpansion interface{} + +type ServiceLevelObjectiveFolderExpansion interface{} + +type ServiceReplicaSetExpansion interface{} + +type ServiceStatefulSetExpansion interface{} + +type ServiceTemplateExpansion interface{} + +type ServiceTemplateServiceDefinitionExpansion interface{} + +type ServiceVersionExpansion interface{} + +type ServiceVersionConfigExpansion interface{} + +type SharedServiceConfigExpansion interface{} + +type SloConfigExpansion interface{} + +type SloServiceConfigExpansion interface{} + +type SvcGroupExpansion interface{} + +type SvcGroupRTExpansion interface{} + +type TableExpansion interface{} + +type TemplateExpansion interface{} + +type TemplateGroupExpansion interface{} + +type TenantExpansion interface{} + +type TenantResourceExpansion interface{} + +type TenantTokenExpansion interface{} + +type UserExpansion interface{} + +type UserDiscoveryExpansion interface{} + +type UserDiscoveryRTExpansion interface{} + +type UserFolderExpansion interface{} + +type UserGroupExpansion interface{} + +type UserPreferenceExpansion interface{} + +type VirtualServiceExpansion interface{} + +type WorkloadEntryExpansion interface{} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/geodiscovery.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/geodiscovery.go new file mode 100644 index 000000000..8bd8e7410 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/geodiscovery.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GeoDiscoveriesGetter has a method to return a GeoDiscoveryInterface. +// A group's client should implement this interface. +type GeoDiscoveriesGetter interface { + GeoDiscoveries() GeoDiscoveryInterface +} + +// GeoDiscoveryInterface has methods to work with GeoDiscovery resources. +type GeoDiscoveryInterface interface { + Create(ctx context.Context, geoDiscovery *v1.GeoDiscovery, opts metav1.CreateOptions) (*v1.GeoDiscovery, error) + Update(ctx context.Context, geoDiscovery *v1.GeoDiscovery, opts metav1.UpdateOptions) (*v1.GeoDiscovery, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GeoDiscovery, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GeoDiscoveryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GeoDiscovery, err error) + GeoDiscoveryExpansion +} + +// geoDiscoveries implements GeoDiscoveryInterface +type geoDiscoveries struct { + client rest.Interface +} + +// newGeoDiscoveries returns a GeoDiscoveries +func newGeoDiscoveries(c *GlobalTsmV1Client) *geoDiscoveries { + return &geoDiscoveries{ + client: c.RESTClient(), + } +} + +// Get takes name of the geoDiscovery, and returns the corresponding geoDiscovery object, and an error if there is any. +func (c *geoDiscoveries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GeoDiscovery, err error) { + result = &v1.GeoDiscovery{} + err = c.client.Get(). + Resource("geodiscoveries"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GeoDiscoveries that match those selectors. +func (c *geoDiscoveries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GeoDiscoveryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GeoDiscoveryList{} + err = c.client.Get(). + Resource("geodiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested geoDiscoveries. +func (c *geoDiscoveries) Watch(ctx context.Context, opts metav1.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(). + Resource("geodiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a geoDiscovery and creates it. Returns the server's representation of the geoDiscovery, and an error, if there is any. +func (c *geoDiscoveries) Create(ctx context.Context, geoDiscovery *v1.GeoDiscovery, opts metav1.CreateOptions) (result *v1.GeoDiscovery, err error) { + result = &v1.GeoDiscovery{} + err = c.client.Post(). + Resource("geodiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(geoDiscovery). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a geoDiscovery and updates it. Returns the server's representation of the geoDiscovery, and an error, if there is any. +func (c *geoDiscoveries) Update(ctx context.Context, geoDiscovery *v1.GeoDiscovery, opts metav1.UpdateOptions) (result *v1.GeoDiscovery, err error) { + result = &v1.GeoDiscovery{} + err = c.client.Put(). + Resource("geodiscoveries"). + Name(geoDiscovery.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(geoDiscovery). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the geoDiscovery and deletes it. Returns an error if one occurs. +func (c *geoDiscoveries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("geodiscoveries"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *geoDiscoveries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("geodiscoveries"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched geoDiscovery. +func (c *geoDiscoveries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GeoDiscovery, err error) { + result = &v1.GeoDiscovery{} + err = c.client.Patch(pt). + Resource("geodiscoveries"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/geodiscoveryrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/geodiscoveryrt.go new file mode 100644 index 000000000..6488ecc22 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/geodiscoveryrt.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GeoDiscoveryRTsGetter has a method to return a GeoDiscoveryRTInterface. +// A group's client should implement this interface. +type GeoDiscoveryRTsGetter interface { + GeoDiscoveryRTs() GeoDiscoveryRTInterface +} + +// GeoDiscoveryRTInterface has methods to work with GeoDiscoveryRT resources. +type GeoDiscoveryRTInterface interface { + Create(ctx context.Context, geoDiscoveryRT *v1.GeoDiscoveryRT, opts metav1.CreateOptions) (*v1.GeoDiscoveryRT, error) + Update(ctx context.Context, geoDiscoveryRT *v1.GeoDiscoveryRT, opts metav1.UpdateOptions) (*v1.GeoDiscoveryRT, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GeoDiscoveryRT, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GeoDiscoveryRTList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GeoDiscoveryRT, err error) + GeoDiscoveryRTExpansion +} + +// geoDiscoveryRTs implements GeoDiscoveryRTInterface +type geoDiscoveryRTs struct { + client rest.Interface +} + +// newGeoDiscoveryRTs returns a GeoDiscoveryRTs +func newGeoDiscoveryRTs(c *GlobalTsmV1Client) *geoDiscoveryRTs { + return &geoDiscoveryRTs{ + client: c.RESTClient(), + } +} + +// Get takes name of the geoDiscoveryRT, and returns the corresponding geoDiscoveryRT object, and an error if there is any. +func (c *geoDiscoveryRTs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GeoDiscoveryRT, err error) { + result = &v1.GeoDiscoveryRT{} + err = c.client.Get(). + Resource("geodiscoveryrts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GeoDiscoveryRTs that match those selectors. +func (c *geoDiscoveryRTs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GeoDiscoveryRTList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GeoDiscoveryRTList{} + err = c.client.Get(). + Resource("geodiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested geoDiscoveryRTs. +func (c *geoDiscoveryRTs) Watch(ctx context.Context, opts metav1.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(). + Resource("geodiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a geoDiscoveryRT and creates it. Returns the server's representation of the geoDiscoveryRT, and an error, if there is any. +func (c *geoDiscoveryRTs) Create(ctx context.Context, geoDiscoveryRT *v1.GeoDiscoveryRT, opts metav1.CreateOptions) (result *v1.GeoDiscoveryRT, err error) { + result = &v1.GeoDiscoveryRT{} + err = c.client.Post(). + Resource("geodiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(geoDiscoveryRT). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a geoDiscoveryRT and updates it. Returns the server's representation of the geoDiscoveryRT, and an error, if there is any. +func (c *geoDiscoveryRTs) Update(ctx context.Context, geoDiscoveryRT *v1.GeoDiscoveryRT, opts metav1.UpdateOptions) (result *v1.GeoDiscoveryRT, err error) { + result = &v1.GeoDiscoveryRT{} + err = c.client.Put(). + Resource("geodiscoveryrts"). + Name(geoDiscoveryRT.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(geoDiscoveryRT). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the geoDiscoveryRT and deletes it. Returns an error if one occurs. +func (c *geoDiscoveryRTs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("geodiscoveryrts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *geoDiscoveryRTs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("geodiscoveryrts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched geoDiscoveryRT. +func (c *geoDiscoveryRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GeoDiscoveryRT, err error) { + result = &v1.GeoDiscoveryRT{} + err = c.client.Patch(pt). + Resource("geodiscoveryrts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/global.tsm.tanzu.vmware.com_client.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/global.tsm.tanzu.vmware.com_client.go new file mode 100644 index 000000000..e623f90ad --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/global.tsm.tanzu.vmware.com_client.go @@ -0,0 +1,1125 @@ +/* +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 v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + "nexustempmodule/client/clientset/versioned/scheme" + + rest "k8s.io/client-go/rest" +) + +type GlobalTsmV1Interface interface { + RESTClient() rest.Interface + ACPConfigsGetter + AccessControlPoliciesGetter + AccessTokensGetter + AdditionalAttributesesGetter + AllSparkServicesesGetter + AnnotationsGetter + ApiDiscoveriesGetter + ApiDiscoveryRTsGetter + AppsGetter + AppFoldersGetter + AppGroupsGetter + AppTemplatesGetter + AppTemplateServiceDefinitionsGetter + AppUsersGetter + AppVersionsGetter + ApplicationInfosGetter + AttackDiscoveriesGetter + AttackDiscoveryRTsGetter + AuthenticationPoliciesGetter + AutoscalersGetter + AutoscalerCRsGetter + AutoscalerConfigsGetter + AutoscalerFoldersGetter + AutoscalingPoliciesGetter + AwsConnectorsGetter + BucketsGetter + CertificatesGetter + CertificateAuthorityConfigNsGetter + CertificateAuthorityRTsGetter + CertificateConfigNsGetter + CertificateRequestsGetter + ClustersGetter + ClusterConfigsGetter + ClusterConfigFoldersGetter + ClusterFoldersGetter + ClusterSettingsesGetter + ConfigsGetter + ConfigMapsGetter + ConnectionStatusesGetter + DCRegionsGetter + DCZonesGetter + DNSConfigsGetter + DNSConfigFoldersGetter + DNSProbeConfigsGetter + DNSProbeStatusesGetter + DNSProbesConfigFoldersGetter + DataFoldersGetter + DataFolderDomainsGetter + DataFolderDomainClustersGetter + DataFolderDomainServicesGetter + DataFolderDomainServiceVersionsGetter + DataGroupsGetter + DataTemplatesGetter + DatabasesGetter + DestinationRulesGetter + DirectoriesGetter + DomainsGetter + DomainConfigsGetter + EndpointsGetter + EnvoyFiltersGetter + ExternalAccountConfigNsGetter + ExternalAuditStoragesGetter + ExternalDNSConfigNsGetter + ExternalDNSInventoriesGetter + ExternalDNSInventoryHealthChecksGetter + ExternalDNSInventoryPrimaryDomainsGetter + ExternalDNSInventoryRecordsGetter + ExternalDNSInventoryZonesGetter + ExternalDNSRuntimesGetter + ExternalDNSRuntimeEndpointsGetter + ExternalDNSRuntimePrimaryDomainsGetter + ExternalDNSRuntimeSubdomainsGetter + ExternalLBConfigNsGetter + ExternalPluginCapabilitiesGetter + ExternalPluginConfigsGetter + ExternalPluginConfigFoldersGetter + ExternalPluginInstanceConfigsGetter + ExternalPluginMonitorsGetter + ExternalServiceConfigsGetter + ExternalServicesRTsGetter + FeatureFlagsGetter + FederatedSloConfigsGetter + FederatedSloServiceConfigsGetter + GNSsGetter + GNSRoutingConfigsGetter + GNSSvcGroupsGetter + GatewaysGetter + GatewayConfigsGetter + GatewayConfigAdditionalListenersesGetter + GatewayConfigListenerCertificatesGetter + GatewayConfigListenerDestinationRoutesGetter + GeoDiscoveriesGetter + GeoDiscoveryRTsGetter + GlobalNamespacesGetter + GlobalNsesGetter + GlobalRegistrationServicesGetter + GnsAccessControlPoliciesGetter + GnsAccessControlPolicyRTsGetter + GnsBindingRTsGetter + GnsEndpointsConfigsGetter + GnsRoutingRuleConfigsGetter + GnsSchemaViolationDiscoveriesGetter + GnsSegmentationPoliciesGetter + GnsSegmentationPolicyRTsGetter + GnsServiceEntryConfigsGetter + GnsSvcGroupRTsGetter + HaConfigsGetter + HaConfigV2sGetter + HealthCheckConfigNsGetter + HostConfigsGetter + HostConfigV2sGetter + InboundAuthenticationConfigsGetter + InventoriesGetter + IssuersGetter + JobsGetter + JobConfigsGetter + JobConfigFoldersGetter + JobFoldersGetter + KnativeIngressesGetter + LabelConfigsGetter + LocalRegistrationServicesGetter + LocalRegistrationServiceClustersGetter + LocalRegistrationServiceResourcesGetter + LogsGetter + LogFoldersGetter + MetricMonitorsGetter + NetworkAttachmentDefinitionsGetter + NetworkAttachmentDefinitionConfigsGetter + NodesGetter + NodeDefinitionsGetter + NodeFoldersGetter + NodeFolderClustersGetter + NodeGroupsGetter + NodeStatusesGetter + NodeTemplatesGetter + OutboundAuthenticationModesGetter + PeerAuthenticationsGetter + PiiDiscoveriesGetter + PiiDiscoveryRTsGetter + PolicyConfigsGetter + PolicyTemplatesGetter + ProgressiveUpgradesGetter + ProgressiveUpgradeConfigsGetter + ProgressiveUpgradeFoldersGetter + ProgressiveUpgradeRuntimesGetter + ProjectsGetter + ProjectConfigsGetter + ProjectInventoriesGetter + ProjectQueriesGetter + PublicServiceConfigsGetter + PublicServiceRTsGetter + PublicServiceRouteConfigsGetter + RPoliciesGetter + RemoteGatewayServiceConfigsGetter + ResourceGroupsGetter + ResourceGroupRTsGetter + RootsGetter + RuntimesGetter + SLOFoldersGetter + SLOPoliciesGetter + SchemaViolationDiscoveryRTsGetter + SecretHashesGetter + SecretRTConfigsGetter + SecurityContextConstraintsesGetter + SecurityContextConstraintsConfigsGetter + ServicesGetter + ServiceConfigsGetter + ServiceCronJobsGetter + ServiceDaemonSetsGetter + ServiceDeploymentsGetter + ServiceDeploymentContainersGetter + ServiceDirectoryEntryConfigsGetter + ServiceDirectoryNsGetter + ServiceDirectoryRTsGetter + ServiceDirectoryRTFoldersGetter + ServiceDirectoryRTFolderEntriesGetter + ServiceEntriesGetter + ServiceEntryConfigsGetter + ServiceInstancesGetter + ServiceInstanceContainersGetter + ServiceJobsGetter + ServiceLevelObjectivesGetter + ServiceLevelObjectiveFoldersGetter + ServiceReplicaSetsGetter + ServiceStatefulSetsGetter + ServiceTemplatesGetter + ServiceTemplateServiceDefinitionsGetter + ServiceVersionsGetter + ServiceVersionConfigsGetter + SharedServiceConfigsGetter + SloConfigsGetter + SloServiceConfigsGetter + SvcGroupsGetter + SvcGroupRTsGetter + TablesGetter + TemplatesGetter + TemplateGroupsGetter + TenantsGetter + TenantResourcesGetter + TenantTokensGetter + UsersGetter + UserDiscoveriesGetter + UserDiscoveryRTsGetter + UserFoldersGetter + UserGroupsGetter + UserPreferencesGetter + VirtualServicesGetter + WorkloadEntriesGetter +} + +// GlobalTsmV1Client is used to interact with features provided by the global.tsm.tanzu.vmware.com group. +type GlobalTsmV1Client struct { + restClient rest.Interface +} + +func (c *GlobalTsmV1Client) ACPConfigs() ACPConfigInterface { + return newACPConfigs(c) +} + +func (c *GlobalTsmV1Client) AccessControlPolicies() AccessControlPolicyInterface { + return newAccessControlPolicies(c) +} + +func (c *GlobalTsmV1Client) AccessTokens() AccessTokenInterface { + return newAccessTokens(c) +} + +func (c *GlobalTsmV1Client) AdditionalAttributeses() AdditionalAttributesInterface { + return newAdditionalAttributeses(c) +} + +func (c *GlobalTsmV1Client) AllSparkServiceses() AllSparkServicesInterface { + return newAllSparkServiceses(c) +} + +func (c *GlobalTsmV1Client) Annotations() AnnotationInterface { + return newAnnotations(c) +} + +func (c *GlobalTsmV1Client) ApiDiscoveries() ApiDiscoveryInterface { + return newApiDiscoveries(c) +} + +func (c *GlobalTsmV1Client) ApiDiscoveryRTs() ApiDiscoveryRTInterface { + return newApiDiscoveryRTs(c) +} + +func (c *GlobalTsmV1Client) Apps() AppInterface { + return newApps(c) +} + +func (c *GlobalTsmV1Client) AppFolders() AppFolderInterface { + return newAppFolders(c) +} + +func (c *GlobalTsmV1Client) AppGroups() AppGroupInterface { + return newAppGroups(c) +} + +func (c *GlobalTsmV1Client) AppTemplates() AppTemplateInterface { + return newAppTemplates(c) +} + +func (c *GlobalTsmV1Client) AppTemplateServiceDefinitions() AppTemplateServiceDefinitionInterface { + return newAppTemplateServiceDefinitions(c) +} + +func (c *GlobalTsmV1Client) AppUsers() AppUserInterface { + return newAppUsers(c) +} + +func (c *GlobalTsmV1Client) AppVersions() AppVersionInterface { + return newAppVersions(c) +} + +func (c *GlobalTsmV1Client) ApplicationInfos() ApplicationInfoInterface { + return newApplicationInfos(c) +} + +func (c *GlobalTsmV1Client) AttackDiscoveries() AttackDiscoveryInterface { + return newAttackDiscoveries(c) +} + +func (c *GlobalTsmV1Client) AttackDiscoveryRTs() AttackDiscoveryRTInterface { + return newAttackDiscoveryRTs(c) +} + +func (c *GlobalTsmV1Client) AuthenticationPolicies() AuthenticationPolicyInterface { + return newAuthenticationPolicies(c) +} + +func (c *GlobalTsmV1Client) Autoscalers() AutoscalerInterface { + return newAutoscalers(c) +} + +func (c *GlobalTsmV1Client) AutoscalerCRs() AutoscalerCRInterface { + return newAutoscalerCRs(c) +} + +func (c *GlobalTsmV1Client) AutoscalerConfigs() AutoscalerConfigInterface { + return newAutoscalerConfigs(c) +} + +func (c *GlobalTsmV1Client) AutoscalerFolders() AutoscalerFolderInterface { + return newAutoscalerFolders(c) +} + +func (c *GlobalTsmV1Client) AutoscalingPolicies() AutoscalingPolicyInterface { + return newAutoscalingPolicies(c) +} + +func (c *GlobalTsmV1Client) AwsConnectors() AwsConnectorInterface { + return newAwsConnectors(c) +} + +func (c *GlobalTsmV1Client) Buckets() BucketInterface { + return newBuckets(c) +} + +func (c *GlobalTsmV1Client) Certificates() CertificateInterface { + return newCertificates(c) +} + +func (c *GlobalTsmV1Client) CertificateAuthorityConfigNs() CertificateAuthorityConfigNInterface { + return newCertificateAuthorityConfigNs(c) +} + +func (c *GlobalTsmV1Client) CertificateAuthorityRTs() CertificateAuthorityRTInterface { + return newCertificateAuthorityRTs(c) +} + +func (c *GlobalTsmV1Client) CertificateConfigNs() CertificateConfigNInterface { + return newCertificateConfigNs(c) +} + +func (c *GlobalTsmV1Client) CertificateRequests() CertificateRequestInterface { + return newCertificateRequests(c) +} + +func (c *GlobalTsmV1Client) Clusters() ClusterInterface { + return newClusters(c) +} + +func (c *GlobalTsmV1Client) ClusterConfigs() ClusterConfigInterface { + return newClusterConfigs(c) +} + +func (c *GlobalTsmV1Client) ClusterConfigFolders() ClusterConfigFolderInterface { + return newClusterConfigFolders(c) +} + +func (c *GlobalTsmV1Client) ClusterFolders() ClusterFolderInterface { + return newClusterFolders(c) +} + +func (c *GlobalTsmV1Client) ClusterSettingses() ClusterSettingsInterface { + return newClusterSettingses(c) +} + +func (c *GlobalTsmV1Client) Configs() ConfigInterface { + return newConfigs(c) +} + +func (c *GlobalTsmV1Client) ConfigMaps() ConfigMapInterface { + return newConfigMaps(c) +} + +func (c *GlobalTsmV1Client) ConnectionStatuses() ConnectionStatusInterface { + return newConnectionStatuses(c) +} + +func (c *GlobalTsmV1Client) DCRegions() DCRegionInterface { + return newDCRegions(c) +} + +func (c *GlobalTsmV1Client) DCZones() DCZoneInterface { + return newDCZones(c) +} + +func (c *GlobalTsmV1Client) DNSConfigs() DNSConfigInterface { + return newDNSConfigs(c) +} + +func (c *GlobalTsmV1Client) DNSConfigFolders() DNSConfigFolderInterface { + return newDNSConfigFolders(c) +} + +func (c *GlobalTsmV1Client) DNSProbeConfigs() DNSProbeConfigInterface { + return newDNSProbeConfigs(c) +} + +func (c *GlobalTsmV1Client) DNSProbeStatuses() DNSProbeStatusInterface { + return newDNSProbeStatuses(c) +} + +func (c *GlobalTsmV1Client) DNSProbesConfigFolders() DNSProbesConfigFolderInterface { + return newDNSProbesConfigFolders(c) +} + +func (c *GlobalTsmV1Client) DataFolders() DataFolderInterface { + return newDataFolders(c) +} + +func (c *GlobalTsmV1Client) DataFolderDomains() DataFolderDomainInterface { + return newDataFolderDomains(c) +} + +func (c *GlobalTsmV1Client) DataFolderDomainClusters() DataFolderDomainClusterInterface { + return newDataFolderDomainClusters(c) +} + +func (c *GlobalTsmV1Client) DataFolderDomainServices() DataFolderDomainServiceInterface { + return newDataFolderDomainServices(c) +} + +func (c *GlobalTsmV1Client) DataFolderDomainServiceVersions() DataFolderDomainServiceVersionInterface { + return newDataFolderDomainServiceVersions(c) +} + +func (c *GlobalTsmV1Client) DataGroups() DataGroupInterface { + return newDataGroups(c) +} + +func (c *GlobalTsmV1Client) DataTemplates() DataTemplateInterface { + return newDataTemplates(c) +} + +func (c *GlobalTsmV1Client) Databases() DatabaseInterface { + return newDatabases(c) +} + +func (c *GlobalTsmV1Client) DestinationRules() DestinationRuleInterface { + return newDestinationRules(c) +} + +func (c *GlobalTsmV1Client) Directories() DirectoryInterface { + return newDirectories(c) +} + +func (c *GlobalTsmV1Client) Domains() DomainInterface { + return newDomains(c) +} + +func (c *GlobalTsmV1Client) DomainConfigs() DomainConfigInterface { + return newDomainConfigs(c) +} + +func (c *GlobalTsmV1Client) Endpoints() EndpointsInterface { + return newEndpoints(c) +} + +func (c *GlobalTsmV1Client) EnvoyFilters() EnvoyFilterInterface { + return newEnvoyFilters(c) +} + +func (c *GlobalTsmV1Client) ExternalAccountConfigNs() ExternalAccountConfigNInterface { + return newExternalAccountConfigNs(c) +} + +func (c *GlobalTsmV1Client) ExternalAuditStorages() ExternalAuditStorageInterface { + return newExternalAuditStorages(c) +} + +func (c *GlobalTsmV1Client) ExternalDNSConfigNs() ExternalDNSConfigNInterface { + return newExternalDNSConfigNs(c) +} + +func (c *GlobalTsmV1Client) ExternalDNSInventories() ExternalDNSInventoryInterface { + return newExternalDNSInventories(c) +} + +func (c *GlobalTsmV1Client) ExternalDNSInventoryHealthChecks() ExternalDNSInventoryHealthCheckInterface { + return newExternalDNSInventoryHealthChecks(c) +} + +func (c *GlobalTsmV1Client) ExternalDNSInventoryPrimaryDomains() ExternalDNSInventoryPrimaryDomainInterface { + return newExternalDNSInventoryPrimaryDomains(c) +} + +func (c *GlobalTsmV1Client) ExternalDNSInventoryRecords() ExternalDNSInventoryRecordInterface { + return newExternalDNSInventoryRecords(c) +} + +func (c *GlobalTsmV1Client) ExternalDNSInventoryZones() ExternalDNSInventoryZoneInterface { + return newExternalDNSInventoryZones(c) +} + +func (c *GlobalTsmV1Client) ExternalDNSRuntimes() ExternalDNSRuntimeInterface { + return newExternalDNSRuntimes(c) +} + +func (c *GlobalTsmV1Client) ExternalDNSRuntimeEndpoints() ExternalDNSRuntimeEndpointInterface { + return newExternalDNSRuntimeEndpoints(c) +} + +func (c *GlobalTsmV1Client) ExternalDNSRuntimePrimaryDomains() ExternalDNSRuntimePrimaryDomainInterface { + return newExternalDNSRuntimePrimaryDomains(c) +} + +func (c *GlobalTsmV1Client) ExternalDNSRuntimeSubdomains() ExternalDNSRuntimeSubdomainInterface { + return newExternalDNSRuntimeSubdomains(c) +} + +func (c *GlobalTsmV1Client) ExternalLBConfigNs() ExternalLBConfigNInterface { + return newExternalLBConfigNs(c) +} + +func (c *GlobalTsmV1Client) ExternalPluginCapabilities() ExternalPluginCapabilityInterface { + return newExternalPluginCapabilities(c) +} + +func (c *GlobalTsmV1Client) ExternalPluginConfigs() ExternalPluginConfigInterface { + return newExternalPluginConfigs(c) +} + +func (c *GlobalTsmV1Client) ExternalPluginConfigFolders() ExternalPluginConfigFolderInterface { + return newExternalPluginConfigFolders(c) +} + +func (c *GlobalTsmV1Client) ExternalPluginInstanceConfigs() ExternalPluginInstanceConfigInterface { + return newExternalPluginInstanceConfigs(c) +} + +func (c *GlobalTsmV1Client) ExternalPluginMonitors() ExternalPluginMonitorInterface { + return newExternalPluginMonitors(c) +} + +func (c *GlobalTsmV1Client) ExternalServiceConfigs() ExternalServiceConfigInterface { + return newExternalServiceConfigs(c) +} + +func (c *GlobalTsmV1Client) ExternalServicesRTs() ExternalServicesRTInterface { + return newExternalServicesRTs(c) +} + +func (c *GlobalTsmV1Client) FeatureFlags() FeatureFlagInterface { + return newFeatureFlags(c) +} + +func (c *GlobalTsmV1Client) FederatedSloConfigs() FederatedSloConfigInterface { + return newFederatedSloConfigs(c) +} + +func (c *GlobalTsmV1Client) FederatedSloServiceConfigs() FederatedSloServiceConfigInterface { + return newFederatedSloServiceConfigs(c) +} + +func (c *GlobalTsmV1Client) GNSs() GNSInterface { + return newGNSs(c) +} + +func (c *GlobalTsmV1Client) GNSRoutingConfigs() GNSRoutingConfigInterface { + return newGNSRoutingConfigs(c) +} + +func (c *GlobalTsmV1Client) GNSSvcGroups() GNSSvcGroupInterface { + return newGNSSvcGroups(c) +} + +func (c *GlobalTsmV1Client) Gateways() GatewayInterface { + return newGateways(c) +} + +func (c *GlobalTsmV1Client) GatewayConfigs() GatewayConfigInterface { + return newGatewayConfigs(c) +} + +func (c *GlobalTsmV1Client) GatewayConfigAdditionalListenerses() GatewayConfigAdditionalListenersInterface { + return newGatewayConfigAdditionalListenerses(c) +} + +func (c *GlobalTsmV1Client) GatewayConfigListenerCertificates() GatewayConfigListenerCertificateInterface { + return newGatewayConfigListenerCertificates(c) +} + +func (c *GlobalTsmV1Client) GatewayConfigListenerDestinationRoutes() GatewayConfigListenerDestinationRouteInterface { + return newGatewayConfigListenerDestinationRoutes(c) +} + +func (c *GlobalTsmV1Client) GeoDiscoveries() GeoDiscoveryInterface { + return newGeoDiscoveries(c) +} + +func (c *GlobalTsmV1Client) GeoDiscoveryRTs() GeoDiscoveryRTInterface { + return newGeoDiscoveryRTs(c) +} + +func (c *GlobalTsmV1Client) GlobalNamespaces() GlobalNamespaceInterface { + return newGlobalNamespaces(c) +} + +func (c *GlobalTsmV1Client) GlobalNses() GlobalNsInterface { + return newGlobalNses(c) +} + +func (c *GlobalTsmV1Client) GlobalRegistrationServices() GlobalRegistrationServiceInterface { + return newGlobalRegistrationServices(c) +} + +func (c *GlobalTsmV1Client) GnsAccessControlPolicies() GnsAccessControlPolicyInterface { + return newGnsAccessControlPolicies(c) +} + +func (c *GlobalTsmV1Client) GnsAccessControlPolicyRTs() GnsAccessControlPolicyRTInterface { + return newGnsAccessControlPolicyRTs(c) +} + +func (c *GlobalTsmV1Client) GnsBindingRTs() GnsBindingRTInterface { + return newGnsBindingRTs(c) +} + +func (c *GlobalTsmV1Client) GnsEndpointsConfigs() GnsEndpointsConfigInterface { + return newGnsEndpointsConfigs(c) +} + +func (c *GlobalTsmV1Client) GnsRoutingRuleConfigs() GnsRoutingRuleConfigInterface { + return newGnsRoutingRuleConfigs(c) +} + +func (c *GlobalTsmV1Client) GnsSchemaViolationDiscoveries() GnsSchemaViolationDiscoveryInterface { + return newGnsSchemaViolationDiscoveries(c) +} + +func (c *GlobalTsmV1Client) GnsSegmentationPolicies() GnsSegmentationPolicyInterface { + return newGnsSegmentationPolicies(c) +} + +func (c *GlobalTsmV1Client) GnsSegmentationPolicyRTs() GnsSegmentationPolicyRTInterface { + return newGnsSegmentationPolicyRTs(c) +} + +func (c *GlobalTsmV1Client) GnsServiceEntryConfigs() GnsServiceEntryConfigInterface { + return newGnsServiceEntryConfigs(c) +} + +func (c *GlobalTsmV1Client) GnsSvcGroupRTs() GnsSvcGroupRTInterface { + return newGnsSvcGroupRTs(c) +} + +func (c *GlobalTsmV1Client) HaConfigs() HaConfigInterface { + return newHaConfigs(c) +} + +func (c *GlobalTsmV1Client) HaConfigV2s() HaConfigV2Interface { + return newHaConfigV2s(c) +} + +func (c *GlobalTsmV1Client) HealthCheckConfigNs() HealthCheckConfigNInterface { + return newHealthCheckConfigNs(c) +} + +func (c *GlobalTsmV1Client) HostConfigs() HostConfigInterface { + return newHostConfigs(c) +} + +func (c *GlobalTsmV1Client) HostConfigV2s() HostConfigV2Interface { + return newHostConfigV2s(c) +} + +func (c *GlobalTsmV1Client) InboundAuthenticationConfigs() InboundAuthenticationConfigInterface { + return newInboundAuthenticationConfigs(c) +} + +func (c *GlobalTsmV1Client) Inventories() InventoryInterface { + return newInventories(c) +} + +func (c *GlobalTsmV1Client) Issuers() IssuerInterface { + return newIssuers(c) +} + +func (c *GlobalTsmV1Client) Jobs() JobInterface { + return newJobs(c) +} + +func (c *GlobalTsmV1Client) JobConfigs() JobConfigInterface { + return newJobConfigs(c) +} + +func (c *GlobalTsmV1Client) JobConfigFolders() JobConfigFolderInterface { + return newJobConfigFolders(c) +} + +func (c *GlobalTsmV1Client) JobFolders() JobFolderInterface { + return newJobFolders(c) +} + +func (c *GlobalTsmV1Client) KnativeIngresses() KnativeIngressInterface { + return newKnativeIngresses(c) +} + +func (c *GlobalTsmV1Client) LabelConfigs() LabelConfigInterface { + return newLabelConfigs(c) +} + +func (c *GlobalTsmV1Client) LocalRegistrationServices() LocalRegistrationServiceInterface { + return newLocalRegistrationServices(c) +} + +func (c *GlobalTsmV1Client) LocalRegistrationServiceClusters() LocalRegistrationServiceClusterInterface { + return newLocalRegistrationServiceClusters(c) +} + +func (c *GlobalTsmV1Client) LocalRegistrationServiceResources() LocalRegistrationServiceResourceInterface { + return newLocalRegistrationServiceResources(c) +} + +func (c *GlobalTsmV1Client) Logs() LogInterface { + return newLogs(c) +} + +func (c *GlobalTsmV1Client) LogFolders() LogFolderInterface { + return newLogFolders(c) +} + +func (c *GlobalTsmV1Client) MetricMonitors() MetricMonitorInterface { + return newMetricMonitors(c) +} + +func (c *GlobalTsmV1Client) NetworkAttachmentDefinitions() NetworkAttachmentDefinitionInterface { + return newNetworkAttachmentDefinitions(c) +} + +func (c *GlobalTsmV1Client) NetworkAttachmentDefinitionConfigs() NetworkAttachmentDefinitionConfigInterface { + return newNetworkAttachmentDefinitionConfigs(c) +} + +func (c *GlobalTsmV1Client) Nodes() NodeInterface { + return newNodes(c) +} + +func (c *GlobalTsmV1Client) NodeDefinitions() NodeDefinitionInterface { + return newNodeDefinitions(c) +} + +func (c *GlobalTsmV1Client) NodeFolders() NodeFolderInterface { + return newNodeFolders(c) +} + +func (c *GlobalTsmV1Client) NodeFolderClusters() NodeFolderClusterInterface { + return newNodeFolderClusters(c) +} + +func (c *GlobalTsmV1Client) NodeGroups() NodeGroupInterface { + return newNodeGroups(c) +} + +func (c *GlobalTsmV1Client) NodeStatuses() NodeStatusInterface { + return newNodeStatuses(c) +} + +func (c *GlobalTsmV1Client) NodeTemplates() NodeTemplateInterface { + return newNodeTemplates(c) +} + +func (c *GlobalTsmV1Client) OutboundAuthenticationModes() OutboundAuthenticationModeInterface { + return newOutboundAuthenticationModes(c) +} + +func (c *GlobalTsmV1Client) PeerAuthentications() PeerAuthenticationInterface { + return newPeerAuthentications(c) +} + +func (c *GlobalTsmV1Client) PiiDiscoveries() PiiDiscoveryInterface { + return newPiiDiscoveries(c) +} + +func (c *GlobalTsmV1Client) PiiDiscoveryRTs() PiiDiscoveryRTInterface { + return newPiiDiscoveryRTs(c) +} + +func (c *GlobalTsmV1Client) PolicyConfigs() PolicyConfigInterface { + return newPolicyConfigs(c) +} + +func (c *GlobalTsmV1Client) PolicyTemplates() PolicyTemplateInterface { + return newPolicyTemplates(c) +} + +func (c *GlobalTsmV1Client) ProgressiveUpgrades() ProgressiveUpgradeInterface { + return newProgressiveUpgrades(c) +} + +func (c *GlobalTsmV1Client) ProgressiveUpgradeConfigs() ProgressiveUpgradeConfigInterface { + return newProgressiveUpgradeConfigs(c) +} + +func (c *GlobalTsmV1Client) ProgressiveUpgradeFolders() ProgressiveUpgradeFolderInterface { + return newProgressiveUpgradeFolders(c) +} + +func (c *GlobalTsmV1Client) ProgressiveUpgradeRuntimes() ProgressiveUpgradeRuntimeInterface { + return newProgressiveUpgradeRuntimes(c) +} + +func (c *GlobalTsmV1Client) Projects() ProjectInterface { + return newProjects(c) +} + +func (c *GlobalTsmV1Client) ProjectConfigs() ProjectConfigInterface { + return newProjectConfigs(c) +} + +func (c *GlobalTsmV1Client) ProjectInventories() ProjectInventoryInterface { + return newProjectInventories(c) +} + +func (c *GlobalTsmV1Client) ProjectQueries() ProjectQueryInterface { + return newProjectQueries(c) +} + +func (c *GlobalTsmV1Client) PublicServiceConfigs() PublicServiceConfigInterface { + return newPublicServiceConfigs(c) +} + +func (c *GlobalTsmV1Client) PublicServiceRTs() PublicServiceRTInterface { + return newPublicServiceRTs(c) +} + +func (c *GlobalTsmV1Client) PublicServiceRouteConfigs() PublicServiceRouteConfigInterface { + return newPublicServiceRouteConfigs(c) +} + +func (c *GlobalTsmV1Client) RPolicies() RPolicyInterface { + return newRPolicies(c) +} + +func (c *GlobalTsmV1Client) RemoteGatewayServiceConfigs() RemoteGatewayServiceConfigInterface { + return newRemoteGatewayServiceConfigs(c) +} + +func (c *GlobalTsmV1Client) ResourceGroups() ResourceGroupInterface { + return newResourceGroups(c) +} + +func (c *GlobalTsmV1Client) ResourceGroupRTs() ResourceGroupRTInterface { + return newResourceGroupRTs(c) +} + +func (c *GlobalTsmV1Client) Roots() RootInterface { + return newRoots(c) +} + +func (c *GlobalTsmV1Client) Runtimes() RuntimeInterface { + return newRuntimes(c) +} + +func (c *GlobalTsmV1Client) SLOFolders() SLOFolderInterface { + return newSLOFolders(c) +} + +func (c *GlobalTsmV1Client) SLOPolicies() SLOPolicyInterface { + return newSLOPolicies(c) +} + +func (c *GlobalTsmV1Client) SchemaViolationDiscoveryRTs() SchemaViolationDiscoveryRTInterface { + return newSchemaViolationDiscoveryRTs(c) +} + +func (c *GlobalTsmV1Client) SecretHashes() SecretHashInterface { + return newSecretHashes(c) +} + +func (c *GlobalTsmV1Client) SecretRTConfigs() SecretRTConfigInterface { + return newSecretRTConfigs(c) +} + +func (c *GlobalTsmV1Client) SecurityContextConstraintses() SecurityContextConstraintsInterface { + return newSecurityContextConstraintses(c) +} + +func (c *GlobalTsmV1Client) SecurityContextConstraintsConfigs() SecurityContextConstraintsConfigInterface { + return newSecurityContextConstraintsConfigs(c) +} + +func (c *GlobalTsmV1Client) Services() ServiceInterface { + return newServices(c) +} + +func (c *GlobalTsmV1Client) ServiceConfigs() ServiceConfigInterface { + return newServiceConfigs(c) +} + +func (c *GlobalTsmV1Client) ServiceCronJobs() ServiceCronJobInterface { + return newServiceCronJobs(c) +} + +func (c *GlobalTsmV1Client) ServiceDaemonSets() ServiceDaemonSetInterface { + return newServiceDaemonSets(c) +} + +func (c *GlobalTsmV1Client) ServiceDeployments() ServiceDeploymentInterface { + return newServiceDeployments(c) +} + +func (c *GlobalTsmV1Client) ServiceDeploymentContainers() ServiceDeploymentContainerInterface { + return newServiceDeploymentContainers(c) +} + +func (c *GlobalTsmV1Client) ServiceDirectoryEntryConfigs() ServiceDirectoryEntryConfigInterface { + return newServiceDirectoryEntryConfigs(c) +} + +func (c *GlobalTsmV1Client) ServiceDirectoryNs() ServiceDirectoryNInterface { + return newServiceDirectoryNs(c) +} + +func (c *GlobalTsmV1Client) ServiceDirectoryRTs() ServiceDirectoryRTInterface { + return newServiceDirectoryRTs(c) +} + +func (c *GlobalTsmV1Client) ServiceDirectoryRTFolders() ServiceDirectoryRTFolderInterface { + return newServiceDirectoryRTFolders(c) +} + +func (c *GlobalTsmV1Client) ServiceDirectoryRTFolderEntries() ServiceDirectoryRTFolderEntryInterface { + return newServiceDirectoryRTFolderEntries(c) +} + +func (c *GlobalTsmV1Client) ServiceEntries() ServiceEntryInterface { + return newServiceEntries(c) +} + +func (c *GlobalTsmV1Client) ServiceEntryConfigs() ServiceEntryConfigInterface { + return newServiceEntryConfigs(c) +} + +func (c *GlobalTsmV1Client) ServiceInstances() ServiceInstanceInterface { + return newServiceInstances(c) +} + +func (c *GlobalTsmV1Client) ServiceInstanceContainers() ServiceInstanceContainerInterface { + return newServiceInstanceContainers(c) +} + +func (c *GlobalTsmV1Client) ServiceJobs() ServiceJobInterface { + return newServiceJobs(c) +} + +func (c *GlobalTsmV1Client) ServiceLevelObjectives() ServiceLevelObjectiveInterface { + return newServiceLevelObjectives(c) +} + +func (c *GlobalTsmV1Client) ServiceLevelObjectiveFolders() ServiceLevelObjectiveFolderInterface { + return newServiceLevelObjectiveFolders(c) +} + +func (c *GlobalTsmV1Client) ServiceReplicaSets() ServiceReplicaSetInterface { + return newServiceReplicaSets(c) +} + +func (c *GlobalTsmV1Client) ServiceStatefulSets() ServiceStatefulSetInterface { + return newServiceStatefulSets(c) +} + +func (c *GlobalTsmV1Client) ServiceTemplates() ServiceTemplateInterface { + return newServiceTemplates(c) +} + +func (c *GlobalTsmV1Client) ServiceTemplateServiceDefinitions() ServiceTemplateServiceDefinitionInterface { + return newServiceTemplateServiceDefinitions(c) +} + +func (c *GlobalTsmV1Client) ServiceVersions() ServiceVersionInterface { + return newServiceVersions(c) +} + +func (c *GlobalTsmV1Client) ServiceVersionConfigs() ServiceVersionConfigInterface { + return newServiceVersionConfigs(c) +} + +func (c *GlobalTsmV1Client) SharedServiceConfigs() SharedServiceConfigInterface { + return newSharedServiceConfigs(c) +} + +func (c *GlobalTsmV1Client) SloConfigs() SloConfigInterface { + return newSloConfigs(c) +} + +func (c *GlobalTsmV1Client) SloServiceConfigs() SloServiceConfigInterface { + return newSloServiceConfigs(c) +} + +func (c *GlobalTsmV1Client) SvcGroups() SvcGroupInterface { + return newSvcGroups(c) +} + +func (c *GlobalTsmV1Client) SvcGroupRTs() SvcGroupRTInterface { + return newSvcGroupRTs(c) +} + +func (c *GlobalTsmV1Client) Tables() TableInterface { + return newTables(c) +} + +func (c *GlobalTsmV1Client) Templates() TemplateInterface { + return newTemplates(c) +} + +func (c *GlobalTsmV1Client) TemplateGroups() TemplateGroupInterface { + return newTemplateGroups(c) +} + +func (c *GlobalTsmV1Client) Tenants() TenantInterface { + return newTenants(c) +} + +func (c *GlobalTsmV1Client) TenantResources() TenantResourceInterface { + return newTenantResources(c) +} + +func (c *GlobalTsmV1Client) TenantTokens() TenantTokenInterface { + return newTenantTokens(c) +} + +func (c *GlobalTsmV1Client) Users() UserInterface { + return newUsers(c) +} + +func (c *GlobalTsmV1Client) UserDiscoveries() UserDiscoveryInterface { + return newUserDiscoveries(c) +} + +func (c *GlobalTsmV1Client) UserDiscoveryRTs() UserDiscoveryRTInterface { + return newUserDiscoveryRTs(c) +} + +func (c *GlobalTsmV1Client) UserFolders() UserFolderInterface { + return newUserFolders(c) +} + +func (c *GlobalTsmV1Client) UserGroups() UserGroupInterface { + return newUserGroups(c) +} + +func (c *GlobalTsmV1Client) UserPreferences() UserPreferenceInterface { + return newUserPreferences(c) +} + +func (c *GlobalTsmV1Client) VirtualServices() VirtualServiceInterface { + return newVirtualServices(c) +} + +func (c *GlobalTsmV1Client) WorkloadEntries() WorkloadEntryInterface { + return newWorkloadEntries(c) +} + +// NewForConfig creates a new GlobalTsmV1Client for the given config. +func NewForConfig(c *rest.Config) (*GlobalTsmV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &GlobalTsmV1Client{client}, nil +} + +// NewForConfigOrDie creates a new GlobalTsmV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *GlobalTsmV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new GlobalTsmV1Client for the given RESTClient. +func New(c rest.Interface) *GlobalTsmV1Client { + return &GlobalTsmV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.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 *GlobalTsmV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/globalnamespace.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/globalnamespace.go new file mode 100644 index 000000000..f351719f7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/globalnamespace.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GlobalNamespacesGetter has a method to return a GlobalNamespaceInterface. +// A group's client should implement this interface. +type GlobalNamespacesGetter interface { + GlobalNamespaces() GlobalNamespaceInterface +} + +// GlobalNamespaceInterface has methods to work with GlobalNamespace resources. +type GlobalNamespaceInterface interface { + Create(ctx context.Context, globalNamespace *v1.GlobalNamespace, opts metav1.CreateOptions) (*v1.GlobalNamespace, error) + Update(ctx context.Context, globalNamespace *v1.GlobalNamespace, opts metav1.UpdateOptions) (*v1.GlobalNamespace, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GlobalNamespace, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GlobalNamespaceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GlobalNamespace, err error) + GlobalNamespaceExpansion +} + +// globalNamespaces implements GlobalNamespaceInterface +type globalNamespaces struct { + client rest.Interface +} + +// newGlobalNamespaces returns a GlobalNamespaces +func newGlobalNamespaces(c *GlobalTsmV1Client) *globalNamespaces { + return &globalNamespaces{ + client: c.RESTClient(), + } +} + +// Get takes name of the globalNamespace, and returns the corresponding globalNamespace object, and an error if there is any. +func (c *globalNamespaces) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GlobalNamespace, err error) { + result = &v1.GlobalNamespace{} + err = c.client.Get(). + Resource("globalnamespaces"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GlobalNamespaces that match those selectors. +func (c *globalNamespaces) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GlobalNamespaceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GlobalNamespaceList{} + err = c.client.Get(). + Resource("globalnamespaces"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested globalNamespaces. +func (c *globalNamespaces) Watch(ctx context.Context, opts metav1.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(). + Resource("globalnamespaces"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a globalNamespace and creates it. Returns the server's representation of the globalNamespace, and an error, if there is any. +func (c *globalNamespaces) Create(ctx context.Context, globalNamespace *v1.GlobalNamespace, opts metav1.CreateOptions) (result *v1.GlobalNamespace, err error) { + result = &v1.GlobalNamespace{} + err = c.client.Post(). + Resource("globalnamespaces"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalNamespace). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a globalNamespace and updates it. Returns the server's representation of the globalNamespace, and an error, if there is any. +func (c *globalNamespaces) Update(ctx context.Context, globalNamespace *v1.GlobalNamespace, opts metav1.UpdateOptions) (result *v1.GlobalNamespace, err error) { + result = &v1.GlobalNamespace{} + err = c.client.Put(). + Resource("globalnamespaces"). + Name(globalNamespace.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalNamespace). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the globalNamespace and deletes it. Returns an error if one occurs. +func (c *globalNamespaces) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("globalnamespaces"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *globalNamespaces) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("globalnamespaces"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched globalNamespace. +func (c *globalNamespaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GlobalNamespace, err error) { + result = &v1.GlobalNamespace{} + err = c.client.Patch(pt). + Resource("globalnamespaces"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/globalns.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/globalns.go new file mode 100644 index 000000000..ab5fc4e26 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/globalns.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GlobalNsesGetter has a method to return a GlobalNsInterface. +// A group's client should implement this interface. +type GlobalNsesGetter interface { + GlobalNses() GlobalNsInterface +} + +// GlobalNsInterface has methods to work with GlobalNs resources. +type GlobalNsInterface interface { + Create(ctx context.Context, globalNs *v1.GlobalNs, opts metav1.CreateOptions) (*v1.GlobalNs, error) + Update(ctx context.Context, globalNs *v1.GlobalNs, opts metav1.UpdateOptions) (*v1.GlobalNs, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GlobalNs, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GlobalNsList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GlobalNs, err error) + GlobalNsExpansion +} + +// globalNses implements GlobalNsInterface +type globalNses struct { + client rest.Interface +} + +// newGlobalNses returns a GlobalNses +func newGlobalNses(c *GlobalTsmV1Client) *globalNses { + return &globalNses{ + client: c.RESTClient(), + } +} + +// Get takes name of the globalNs, and returns the corresponding globalNs object, and an error if there is any. +func (c *globalNses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GlobalNs, err error) { + result = &v1.GlobalNs{} + err = c.client.Get(). + Resource("globalnses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GlobalNses that match those selectors. +func (c *globalNses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GlobalNsList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GlobalNsList{} + err = c.client.Get(). + Resource("globalnses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested globalNses. +func (c *globalNses) Watch(ctx context.Context, opts metav1.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(). + Resource("globalnses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a globalNs and creates it. Returns the server's representation of the globalNs, and an error, if there is any. +func (c *globalNses) Create(ctx context.Context, globalNs *v1.GlobalNs, opts metav1.CreateOptions) (result *v1.GlobalNs, err error) { + result = &v1.GlobalNs{} + err = c.client.Post(). + Resource("globalnses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalNs). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a globalNs and updates it. Returns the server's representation of the globalNs, and an error, if there is any. +func (c *globalNses) Update(ctx context.Context, globalNs *v1.GlobalNs, opts metav1.UpdateOptions) (result *v1.GlobalNs, err error) { + result = &v1.GlobalNs{} + err = c.client.Put(). + Resource("globalnses"). + Name(globalNs.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalNs). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the globalNs and deletes it. Returns an error if one occurs. +func (c *globalNses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("globalnses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *globalNses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("globalnses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched globalNs. +func (c *globalNses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GlobalNs, err error) { + result = &v1.GlobalNs{} + err = c.client.Patch(pt). + Resource("globalnses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/globalregistrationservice.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/globalregistrationservice.go new file mode 100644 index 000000000..4399be24b --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/globalregistrationservice.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GlobalRegistrationServicesGetter has a method to return a GlobalRegistrationServiceInterface. +// A group's client should implement this interface. +type GlobalRegistrationServicesGetter interface { + GlobalRegistrationServices() GlobalRegistrationServiceInterface +} + +// GlobalRegistrationServiceInterface has methods to work with GlobalRegistrationService resources. +type GlobalRegistrationServiceInterface interface { + Create(ctx context.Context, globalRegistrationService *v1.GlobalRegistrationService, opts metav1.CreateOptions) (*v1.GlobalRegistrationService, error) + Update(ctx context.Context, globalRegistrationService *v1.GlobalRegistrationService, opts metav1.UpdateOptions) (*v1.GlobalRegistrationService, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GlobalRegistrationService, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GlobalRegistrationServiceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GlobalRegistrationService, err error) + GlobalRegistrationServiceExpansion +} + +// globalRegistrationServices implements GlobalRegistrationServiceInterface +type globalRegistrationServices struct { + client rest.Interface +} + +// newGlobalRegistrationServices returns a GlobalRegistrationServices +func newGlobalRegistrationServices(c *GlobalTsmV1Client) *globalRegistrationServices { + return &globalRegistrationServices{ + client: c.RESTClient(), + } +} + +// Get takes name of the globalRegistrationService, and returns the corresponding globalRegistrationService object, and an error if there is any. +func (c *globalRegistrationServices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GlobalRegistrationService, err error) { + result = &v1.GlobalRegistrationService{} + err = c.client.Get(). + Resource("globalregistrationservices"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GlobalRegistrationServices that match those selectors. +func (c *globalRegistrationServices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GlobalRegistrationServiceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GlobalRegistrationServiceList{} + err = c.client.Get(). + Resource("globalregistrationservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested globalRegistrationServices. +func (c *globalRegistrationServices) Watch(ctx context.Context, opts metav1.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(). + Resource("globalregistrationservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a globalRegistrationService and creates it. Returns the server's representation of the globalRegistrationService, and an error, if there is any. +func (c *globalRegistrationServices) Create(ctx context.Context, globalRegistrationService *v1.GlobalRegistrationService, opts metav1.CreateOptions) (result *v1.GlobalRegistrationService, err error) { + result = &v1.GlobalRegistrationService{} + err = c.client.Post(). + Resource("globalregistrationservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalRegistrationService). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a globalRegistrationService and updates it. Returns the server's representation of the globalRegistrationService, and an error, if there is any. +func (c *globalRegistrationServices) Update(ctx context.Context, globalRegistrationService *v1.GlobalRegistrationService, opts metav1.UpdateOptions) (result *v1.GlobalRegistrationService, err error) { + result = &v1.GlobalRegistrationService{} + err = c.client.Put(). + Resource("globalregistrationservices"). + Name(globalRegistrationService.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalRegistrationService). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the globalRegistrationService and deletes it. Returns an error if one occurs. +func (c *globalRegistrationServices) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("globalregistrationservices"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *globalRegistrationServices) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("globalregistrationservices"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched globalRegistrationService. +func (c *globalRegistrationServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GlobalRegistrationService, err error) { + result = &v1.GlobalRegistrationService{} + err = c.client.Patch(pt). + Resource("globalregistrationservices"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gns.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gns.go new file mode 100644 index 000000000..5067c6304 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gns.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GNSsGetter has a method to return a GNSInterface. +// A group's client should implement this interface. +type GNSsGetter interface { + GNSs() GNSInterface +} + +// GNSInterface has methods to work with GNS resources. +type GNSInterface interface { + Create(ctx context.Context, gNS *v1.GNS, opts metav1.CreateOptions) (*v1.GNS, error) + Update(ctx context.Context, gNS *v1.GNS, opts metav1.UpdateOptions) (*v1.GNS, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GNS, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GNSList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GNS, err error) + GNSExpansion +} + +// gNSs implements GNSInterface +type gNSs struct { + client rest.Interface +} + +// newGNSs returns a GNSs +func newGNSs(c *GlobalTsmV1Client) *gNSs { + return &gNSs{ + client: c.RESTClient(), + } +} + +// Get takes name of the gNS, and returns the corresponding gNS object, and an error if there is any. +func (c *gNSs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GNS, err error) { + result = &v1.GNS{} + err = c.client.Get(). + Resource("gnss"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GNSs that match those selectors. +func (c *gNSs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GNSList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GNSList{} + err = c.client.Get(). + Resource("gnss"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gNSs. +func (c *gNSs) Watch(ctx context.Context, opts metav1.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(). + Resource("gnss"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gNS and creates it. Returns the server's representation of the gNS, and an error, if there is any. +func (c *gNSs) Create(ctx context.Context, gNS *v1.GNS, opts metav1.CreateOptions) (result *v1.GNS, err error) { + result = &v1.GNS{} + err = c.client.Post(). + Resource("gnss"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gNS). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gNS and updates it. Returns the server's representation of the gNS, and an error, if there is any. +func (c *gNSs) Update(ctx context.Context, gNS *v1.GNS, opts metav1.UpdateOptions) (result *v1.GNS, err error) { + result = &v1.GNS{} + err = c.client.Put(). + Resource("gnss"). + Name(gNS.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gNS). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gNS and deletes it. Returns an error if one occurs. +func (c *gNSs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gnss"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gNSs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gnss"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gNS. +func (c *gNSs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GNS, err error) { + result = &v1.GNS{} + err = c.client.Patch(pt). + Resource("gnss"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicy.go new file mode 100644 index 000000000..8e3743554 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicy.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GnsAccessControlPoliciesGetter has a method to return a GnsAccessControlPolicyInterface. +// A group's client should implement this interface. +type GnsAccessControlPoliciesGetter interface { + GnsAccessControlPolicies() GnsAccessControlPolicyInterface +} + +// GnsAccessControlPolicyInterface has methods to work with GnsAccessControlPolicy resources. +type GnsAccessControlPolicyInterface interface { + Create(ctx context.Context, gnsAccessControlPolicy *v1.GnsAccessControlPolicy, opts metav1.CreateOptions) (*v1.GnsAccessControlPolicy, error) + Update(ctx context.Context, gnsAccessControlPolicy *v1.GnsAccessControlPolicy, opts metav1.UpdateOptions) (*v1.GnsAccessControlPolicy, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GnsAccessControlPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GnsAccessControlPolicyList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsAccessControlPolicy, err error) + GnsAccessControlPolicyExpansion +} + +// gnsAccessControlPolicies implements GnsAccessControlPolicyInterface +type gnsAccessControlPolicies struct { + client rest.Interface +} + +// newGnsAccessControlPolicies returns a GnsAccessControlPolicies +func newGnsAccessControlPolicies(c *GlobalTsmV1Client) *gnsAccessControlPolicies { + return &gnsAccessControlPolicies{ + client: c.RESTClient(), + } +} + +// Get takes name of the gnsAccessControlPolicy, and returns the corresponding gnsAccessControlPolicy object, and an error if there is any. +func (c *gnsAccessControlPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GnsAccessControlPolicy, err error) { + result = &v1.GnsAccessControlPolicy{} + err = c.client.Get(). + Resource("gnsaccesscontrolpolicies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GnsAccessControlPolicies that match those selectors. +func (c *gnsAccessControlPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GnsAccessControlPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GnsAccessControlPolicyList{} + err = c.client.Get(). + Resource("gnsaccesscontrolpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gnsAccessControlPolicies. +func (c *gnsAccessControlPolicies) Watch(ctx context.Context, opts metav1.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(). + Resource("gnsaccesscontrolpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gnsAccessControlPolicy and creates it. Returns the server's representation of the gnsAccessControlPolicy, and an error, if there is any. +func (c *gnsAccessControlPolicies) Create(ctx context.Context, gnsAccessControlPolicy *v1.GnsAccessControlPolicy, opts metav1.CreateOptions) (result *v1.GnsAccessControlPolicy, err error) { + result = &v1.GnsAccessControlPolicy{} + err = c.client.Post(). + Resource("gnsaccesscontrolpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsAccessControlPolicy). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gnsAccessControlPolicy and updates it. Returns the server's representation of the gnsAccessControlPolicy, and an error, if there is any. +func (c *gnsAccessControlPolicies) Update(ctx context.Context, gnsAccessControlPolicy *v1.GnsAccessControlPolicy, opts metav1.UpdateOptions) (result *v1.GnsAccessControlPolicy, err error) { + result = &v1.GnsAccessControlPolicy{} + err = c.client.Put(). + Resource("gnsaccesscontrolpolicies"). + Name(gnsAccessControlPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsAccessControlPolicy). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gnsAccessControlPolicy and deletes it. Returns an error if one occurs. +func (c *gnsAccessControlPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gnsaccesscontrolpolicies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gnsAccessControlPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gnsaccesscontrolpolicies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gnsAccessControlPolicy. +func (c *gnsAccessControlPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsAccessControlPolicy, err error) { + result = &v1.GnsAccessControlPolicy{} + err = c.client.Patch(pt). + Resource("gnsaccesscontrolpolicies"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicyrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicyrt.go new file mode 100644 index 000000000..93fe71a75 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicyrt.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GnsAccessControlPolicyRTsGetter has a method to return a GnsAccessControlPolicyRTInterface. +// A group's client should implement this interface. +type GnsAccessControlPolicyRTsGetter interface { + GnsAccessControlPolicyRTs() GnsAccessControlPolicyRTInterface +} + +// GnsAccessControlPolicyRTInterface has methods to work with GnsAccessControlPolicyRT resources. +type GnsAccessControlPolicyRTInterface interface { + Create(ctx context.Context, gnsAccessControlPolicyRT *v1.GnsAccessControlPolicyRT, opts metav1.CreateOptions) (*v1.GnsAccessControlPolicyRT, error) + Update(ctx context.Context, gnsAccessControlPolicyRT *v1.GnsAccessControlPolicyRT, opts metav1.UpdateOptions) (*v1.GnsAccessControlPolicyRT, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GnsAccessControlPolicyRT, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GnsAccessControlPolicyRTList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsAccessControlPolicyRT, err error) + GnsAccessControlPolicyRTExpansion +} + +// gnsAccessControlPolicyRTs implements GnsAccessControlPolicyRTInterface +type gnsAccessControlPolicyRTs struct { + client rest.Interface +} + +// newGnsAccessControlPolicyRTs returns a GnsAccessControlPolicyRTs +func newGnsAccessControlPolicyRTs(c *GlobalTsmV1Client) *gnsAccessControlPolicyRTs { + return &gnsAccessControlPolicyRTs{ + client: c.RESTClient(), + } +} + +// Get takes name of the gnsAccessControlPolicyRT, and returns the corresponding gnsAccessControlPolicyRT object, and an error if there is any. +func (c *gnsAccessControlPolicyRTs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GnsAccessControlPolicyRT, err error) { + result = &v1.GnsAccessControlPolicyRT{} + err = c.client.Get(). + Resource("gnsaccesscontrolpolicyrts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GnsAccessControlPolicyRTs that match those selectors. +func (c *gnsAccessControlPolicyRTs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GnsAccessControlPolicyRTList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GnsAccessControlPolicyRTList{} + err = c.client.Get(). + Resource("gnsaccesscontrolpolicyrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gnsAccessControlPolicyRTs. +func (c *gnsAccessControlPolicyRTs) Watch(ctx context.Context, opts metav1.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(). + Resource("gnsaccesscontrolpolicyrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gnsAccessControlPolicyRT and creates it. Returns the server's representation of the gnsAccessControlPolicyRT, and an error, if there is any. +func (c *gnsAccessControlPolicyRTs) Create(ctx context.Context, gnsAccessControlPolicyRT *v1.GnsAccessControlPolicyRT, opts metav1.CreateOptions) (result *v1.GnsAccessControlPolicyRT, err error) { + result = &v1.GnsAccessControlPolicyRT{} + err = c.client.Post(). + Resource("gnsaccesscontrolpolicyrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsAccessControlPolicyRT). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gnsAccessControlPolicyRT and updates it. Returns the server's representation of the gnsAccessControlPolicyRT, and an error, if there is any. +func (c *gnsAccessControlPolicyRTs) Update(ctx context.Context, gnsAccessControlPolicyRT *v1.GnsAccessControlPolicyRT, opts metav1.UpdateOptions) (result *v1.GnsAccessControlPolicyRT, err error) { + result = &v1.GnsAccessControlPolicyRT{} + err = c.client.Put(). + Resource("gnsaccesscontrolpolicyrts"). + Name(gnsAccessControlPolicyRT.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsAccessControlPolicyRT). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gnsAccessControlPolicyRT and deletes it. Returns an error if one occurs. +func (c *gnsAccessControlPolicyRTs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gnsaccesscontrolpolicyrts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gnsAccessControlPolicyRTs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gnsaccesscontrolpolicyrts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gnsAccessControlPolicyRT. +func (c *gnsAccessControlPolicyRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsAccessControlPolicyRT, err error) { + result = &v1.GnsAccessControlPolicyRT{} + err = c.client.Patch(pt). + Resource("gnsaccesscontrolpolicyrts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsbindingrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsbindingrt.go new file mode 100644 index 000000000..659bb51d0 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsbindingrt.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GnsBindingRTsGetter has a method to return a GnsBindingRTInterface. +// A group's client should implement this interface. +type GnsBindingRTsGetter interface { + GnsBindingRTs() GnsBindingRTInterface +} + +// GnsBindingRTInterface has methods to work with GnsBindingRT resources. +type GnsBindingRTInterface interface { + Create(ctx context.Context, gnsBindingRT *v1.GnsBindingRT, opts metav1.CreateOptions) (*v1.GnsBindingRT, error) + Update(ctx context.Context, gnsBindingRT *v1.GnsBindingRT, opts metav1.UpdateOptions) (*v1.GnsBindingRT, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GnsBindingRT, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GnsBindingRTList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsBindingRT, err error) + GnsBindingRTExpansion +} + +// gnsBindingRTs implements GnsBindingRTInterface +type gnsBindingRTs struct { + client rest.Interface +} + +// newGnsBindingRTs returns a GnsBindingRTs +func newGnsBindingRTs(c *GlobalTsmV1Client) *gnsBindingRTs { + return &gnsBindingRTs{ + client: c.RESTClient(), + } +} + +// Get takes name of the gnsBindingRT, and returns the corresponding gnsBindingRT object, and an error if there is any. +func (c *gnsBindingRTs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GnsBindingRT, err error) { + result = &v1.GnsBindingRT{} + err = c.client.Get(). + Resource("gnsbindingrts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GnsBindingRTs that match those selectors. +func (c *gnsBindingRTs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GnsBindingRTList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GnsBindingRTList{} + err = c.client.Get(). + Resource("gnsbindingrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gnsBindingRTs. +func (c *gnsBindingRTs) Watch(ctx context.Context, opts metav1.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(). + Resource("gnsbindingrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gnsBindingRT and creates it. Returns the server's representation of the gnsBindingRT, and an error, if there is any. +func (c *gnsBindingRTs) Create(ctx context.Context, gnsBindingRT *v1.GnsBindingRT, opts metav1.CreateOptions) (result *v1.GnsBindingRT, err error) { + result = &v1.GnsBindingRT{} + err = c.client.Post(). + Resource("gnsbindingrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsBindingRT). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gnsBindingRT and updates it. Returns the server's representation of the gnsBindingRT, and an error, if there is any. +func (c *gnsBindingRTs) Update(ctx context.Context, gnsBindingRT *v1.GnsBindingRT, opts metav1.UpdateOptions) (result *v1.GnsBindingRT, err error) { + result = &v1.GnsBindingRT{} + err = c.client.Put(). + Resource("gnsbindingrts"). + Name(gnsBindingRT.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsBindingRT). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gnsBindingRT and deletes it. Returns an error if one occurs. +func (c *gnsBindingRTs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gnsbindingrts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gnsBindingRTs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gnsbindingrts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gnsBindingRT. +func (c *gnsBindingRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsBindingRT, err error) { + result = &v1.GnsBindingRT{} + err = c.client.Patch(pt). + Resource("gnsbindingrts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsendpointsconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsendpointsconfig.go new file mode 100644 index 000000000..1c3739570 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsendpointsconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GnsEndpointsConfigsGetter has a method to return a GnsEndpointsConfigInterface. +// A group's client should implement this interface. +type GnsEndpointsConfigsGetter interface { + GnsEndpointsConfigs() GnsEndpointsConfigInterface +} + +// GnsEndpointsConfigInterface has methods to work with GnsEndpointsConfig resources. +type GnsEndpointsConfigInterface interface { + Create(ctx context.Context, gnsEndpointsConfig *v1.GnsEndpointsConfig, opts metav1.CreateOptions) (*v1.GnsEndpointsConfig, error) + Update(ctx context.Context, gnsEndpointsConfig *v1.GnsEndpointsConfig, opts metav1.UpdateOptions) (*v1.GnsEndpointsConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GnsEndpointsConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GnsEndpointsConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsEndpointsConfig, err error) + GnsEndpointsConfigExpansion +} + +// gnsEndpointsConfigs implements GnsEndpointsConfigInterface +type gnsEndpointsConfigs struct { + client rest.Interface +} + +// newGnsEndpointsConfigs returns a GnsEndpointsConfigs +func newGnsEndpointsConfigs(c *GlobalTsmV1Client) *gnsEndpointsConfigs { + return &gnsEndpointsConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the gnsEndpointsConfig, and returns the corresponding gnsEndpointsConfig object, and an error if there is any. +func (c *gnsEndpointsConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GnsEndpointsConfig, err error) { + result = &v1.GnsEndpointsConfig{} + err = c.client.Get(). + Resource("gnsendpointsconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GnsEndpointsConfigs that match those selectors. +func (c *gnsEndpointsConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GnsEndpointsConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GnsEndpointsConfigList{} + err = c.client.Get(). + Resource("gnsendpointsconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gnsEndpointsConfigs. +func (c *gnsEndpointsConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("gnsendpointsconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gnsEndpointsConfig and creates it. Returns the server's representation of the gnsEndpointsConfig, and an error, if there is any. +func (c *gnsEndpointsConfigs) Create(ctx context.Context, gnsEndpointsConfig *v1.GnsEndpointsConfig, opts metav1.CreateOptions) (result *v1.GnsEndpointsConfig, err error) { + result = &v1.GnsEndpointsConfig{} + err = c.client.Post(). + Resource("gnsendpointsconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsEndpointsConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gnsEndpointsConfig and updates it. Returns the server's representation of the gnsEndpointsConfig, and an error, if there is any. +func (c *gnsEndpointsConfigs) Update(ctx context.Context, gnsEndpointsConfig *v1.GnsEndpointsConfig, opts metav1.UpdateOptions) (result *v1.GnsEndpointsConfig, err error) { + result = &v1.GnsEndpointsConfig{} + err = c.client.Put(). + Resource("gnsendpointsconfigs"). + Name(gnsEndpointsConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsEndpointsConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gnsEndpointsConfig and deletes it. Returns an error if one occurs. +func (c *gnsEndpointsConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gnsendpointsconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gnsEndpointsConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gnsendpointsconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gnsEndpointsConfig. +func (c *gnsEndpointsConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsEndpointsConfig, err error) { + result = &v1.GnsEndpointsConfig{} + err = c.client.Patch(pt). + Resource("gnsendpointsconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsroutingconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsroutingconfig.go new file mode 100644 index 000000000..3a4bcb48d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsroutingconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GNSRoutingConfigsGetter has a method to return a GNSRoutingConfigInterface. +// A group's client should implement this interface. +type GNSRoutingConfigsGetter interface { + GNSRoutingConfigs() GNSRoutingConfigInterface +} + +// GNSRoutingConfigInterface has methods to work with GNSRoutingConfig resources. +type GNSRoutingConfigInterface interface { + Create(ctx context.Context, gNSRoutingConfig *v1.GNSRoutingConfig, opts metav1.CreateOptions) (*v1.GNSRoutingConfig, error) + Update(ctx context.Context, gNSRoutingConfig *v1.GNSRoutingConfig, opts metav1.UpdateOptions) (*v1.GNSRoutingConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GNSRoutingConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GNSRoutingConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GNSRoutingConfig, err error) + GNSRoutingConfigExpansion +} + +// gNSRoutingConfigs implements GNSRoutingConfigInterface +type gNSRoutingConfigs struct { + client rest.Interface +} + +// newGNSRoutingConfigs returns a GNSRoutingConfigs +func newGNSRoutingConfigs(c *GlobalTsmV1Client) *gNSRoutingConfigs { + return &gNSRoutingConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the gNSRoutingConfig, and returns the corresponding gNSRoutingConfig object, and an error if there is any. +func (c *gNSRoutingConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GNSRoutingConfig, err error) { + result = &v1.GNSRoutingConfig{} + err = c.client.Get(). + Resource("gnsroutingconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GNSRoutingConfigs that match those selectors. +func (c *gNSRoutingConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GNSRoutingConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GNSRoutingConfigList{} + err = c.client.Get(). + Resource("gnsroutingconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gNSRoutingConfigs. +func (c *gNSRoutingConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("gnsroutingconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gNSRoutingConfig and creates it. Returns the server's representation of the gNSRoutingConfig, and an error, if there is any. +func (c *gNSRoutingConfigs) Create(ctx context.Context, gNSRoutingConfig *v1.GNSRoutingConfig, opts metav1.CreateOptions) (result *v1.GNSRoutingConfig, err error) { + result = &v1.GNSRoutingConfig{} + err = c.client.Post(). + Resource("gnsroutingconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gNSRoutingConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gNSRoutingConfig and updates it. Returns the server's representation of the gNSRoutingConfig, and an error, if there is any. +func (c *gNSRoutingConfigs) Update(ctx context.Context, gNSRoutingConfig *v1.GNSRoutingConfig, opts metav1.UpdateOptions) (result *v1.GNSRoutingConfig, err error) { + result = &v1.GNSRoutingConfig{} + err = c.client.Put(). + Resource("gnsroutingconfigs"). + Name(gNSRoutingConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gNSRoutingConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gNSRoutingConfig and deletes it. Returns an error if one occurs. +func (c *gNSRoutingConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gnsroutingconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gNSRoutingConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gnsroutingconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gNSRoutingConfig. +func (c *gNSRoutingConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GNSRoutingConfig, err error) { + result = &v1.GNSRoutingConfig{} + err = c.client.Patch(pt). + Resource("gnsroutingconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsroutingruleconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsroutingruleconfig.go new file mode 100644 index 000000000..424de362d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsroutingruleconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GnsRoutingRuleConfigsGetter has a method to return a GnsRoutingRuleConfigInterface. +// A group's client should implement this interface. +type GnsRoutingRuleConfigsGetter interface { + GnsRoutingRuleConfigs() GnsRoutingRuleConfigInterface +} + +// GnsRoutingRuleConfigInterface has methods to work with GnsRoutingRuleConfig resources. +type GnsRoutingRuleConfigInterface interface { + Create(ctx context.Context, gnsRoutingRuleConfig *v1.GnsRoutingRuleConfig, opts metav1.CreateOptions) (*v1.GnsRoutingRuleConfig, error) + Update(ctx context.Context, gnsRoutingRuleConfig *v1.GnsRoutingRuleConfig, opts metav1.UpdateOptions) (*v1.GnsRoutingRuleConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GnsRoutingRuleConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GnsRoutingRuleConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsRoutingRuleConfig, err error) + GnsRoutingRuleConfigExpansion +} + +// gnsRoutingRuleConfigs implements GnsRoutingRuleConfigInterface +type gnsRoutingRuleConfigs struct { + client rest.Interface +} + +// newGnsRoutingRuleConfigs returns a GnsRoutingRuleConfigs +func newGnsRoutingRuleConfigs(c *GlobalTsmV1Client) *gnsRoutingRuleConfigs { + return &gnsRoutingRuleConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the gnsRoutingRuleConfig, and returns the corresponding gnsRoutingRuleConfig object, and an error if there is any. +func (c *gnsRoutingRuleConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GnsRoutingRuleConfig, err error) { + result = &v1.GnsRoutingRuleConfig{} + err = c.client.Get(). + Resource("gnsroutingruleconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GnsRoutingRuleConfigs that match those selectors. +func (c *gnsRoutingRuleConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GnsRoutingRuleConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GnsRoutingRuleConfigList{} + err = c.client.Get(). + Resource("gnsroutingruleconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gnsRoutingRuleConfigs. +func (c *gnsRoutingRuleConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("gnsroutingruleconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gnsRoutingRuleConfig and creates it. Returns the server's representation of the gnsRoutingRuleConfig, and an error, if there is any. +func (c *gnsRoutingRuleConfigs) Create(ctx context.Context, gnsRoutingRuleConfig *v1.GnsRoutingRuleConfig, opts metav1.CreateOptions) (result *v1.GnsRoutingRuleConfig, err error) { + result = &v1.GnsRoutingRuleConfig{} + err = c.client.Post(). + Resource("gnsroutingruleconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsRoutingRuleConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gnsRoutingRuleConfig and updates it. Returns the server's representation of the gnsRoutingRuleConfig, and an error, if there is any. +func (c *gnsRoutingRuleConfigs) Update(ctx context.Context, gnsRoutingRuleConfig *v1.GnsRoutingRuleConfig, opts metav1.UpdateOptions) (result *v1.GnsRoutingRuleConfig, err error) { + result = &v1.GnsRoutingRuleConfig{} + err = c.client.Put(). + Resource("gnsroutingruleconfigs"). + Name(gnsRoutingRuleConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsRoutingRuleConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gnsRoutingRuleConfig and deletes it. Returns an error if one occurs. +func (c *gnsRoutingRuleConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gnsroutingruleconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gnsRoutingRuleConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gnsroutingruleconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gnsRoutingRuleConfig. +func (c *gnsRoutingRuleConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsRoutingRuleConfig, err error) { + result = &v1.GnsRoutingRuleConfig{} + err = c.client.Patch(pt). + Resource("gnsroutingruleconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsschemaviolationdiscovery.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsschemaviolationdiscovery.go new file mode 100644 index 000000000..16559ff94 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsschemaviolationdiscovery.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GnsSchemaViolationDiscoveriesGetter has a method to return a GnsSchemaViolationDiscoveryInterface. +// A group's client should implement this interface. +type GnsSchemaViolationDiscoveriesGetter interface { + GnsSchemaViolationDiscoveries() GnsSchemaViolationDiscoveryInterface +} + +// GnsSchemaViolationDiscoveryInterface has methods to work with GnsSchemaViolationDiscovery resources. +type GnsSchemaViolationDiscoveryInterface interface { + Create(ctx context.Context, gnsSchemaViolationDiscovery *v1.GnsSchemaViolationDiscovery, opts metav1.CreateOptions) (*v1.GnsSchemaViolationDiscovery, error) + Update(ctx context.Context, gnsSchemaViolationDiscovery *v1.GnsSchemaViolationDiscovery, opts metav1.UpdateOptions) (*v1.GnsSchemaViolationDiscovery, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GnsSchemaViolationDiscovery, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GnsSchemaViolationDiscoveryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsSchemaViolationDiscovery, err error) + GnsSchemaViolationDiscoveryExpansion +} + +// gnsSchemaViolationDiscoveries implements GnsSchemaViolationDiscoveryInterface +type gnsSchemaViolationDiscoveries struct { + client rest.Interface +} + +// newGnsSchemaViolationDiscoveries returns a GnsSchemaViolationDiscoveries +func newGnsSchemaViolationDiscoveries(c *GlobalTsmV1Client) *gnsSchemaViolationDiscoveries { + return &gnsSchemaViolationDiscoveries{ + client: c.RESTClient(), + } +} + +// Get takes name of the gnsSchemaViolationDiscovery, and returns the corresponding gnsSchemaViolationDiscovery object, and an error if there is any. +func (c *gnsSchemaViolationDiscoveries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GnsSchemaViolationDiscovery, err error) { + result = &v1.GnsSchemaViolationDiscovery{} + err = c.client.Get(). + Resource("gnsschemaviolationdiscoveries"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GnsSchemaViolationDiscoveries that match those selectors. +func (c *gnsSchemaViolationDiscoveries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GnsSchemaViolationDiscoveryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GnsSchemaViolationDiscoveryList{} + err = c.client.Get(). + Resource("gnsschemaviolationdiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gnsSchemaViolationDiscoveries. +func (c *gnsSchemaViolationDiscoveries) Watch(ctx context.Context, opts metav1.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(). + Resource("gnsschemaviolationdiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gnsSchemaViolationDiscovery and creates it. Returns the server's representation of the gnsSchemaViolationDiscovery, and an error, if there is any. +func (c *gnsSchemaViolationDiscoveries) Create(ctx context.Context, gnsSchemaViolationDiscovery *v1.GnsSchemaViolationDiscovery, opts metav1.CreateOptions) (result *v1.GnsSchemaViolationDiscovery, err error) { + result = &v1.GnsSchemaViolationDiscovery{} + err = c.client.Post(). + Resource("gnsschemaviolationdiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsSchemaViolationDiscovery). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gnsSchemaViolationDiscovery and updates it. Returns the server's representation of the gnsSchemaViolationDiscovery, and an error, if there is any. +func (c *gnsSchemaViolationDiscoveries) Update(ctx context.Context, gnsSchemaViolationDiscovery *v1.GnsSchemaViolationDiscovery, opts metav1.UpdateOptions) (result *v1.GnsSchemaViolationDiscovery, err error) { + result = &v1.GnsSchemaViolationDiscovery{} + err = c.client.Put(). + Resource("gnsschemaviolationdiscoveries"). + Name(gnsSchemaViolationDiscovery.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsSchemaViolationDiscovery). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gnsSchemaViolationDiscovery and deletes it. Returns an error if one occurs. +func (c *gnsSchemaViolationDiscoveries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gnsschemaviolationdiscoveries"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gnsSchemaViolationDiscoveries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gnsschemaviolationdiscoveries"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gnsSchemaViolationDiscovery. +func (c *gnsSchemaViolationDiscoveries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsSchemaViolationDiscovery, err error) { + result = &v1.GnsSchemaViolationDiscovery{} + err = c.client.Patch(pt). + Resource("gnsschemaviolationdiscoveries"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicy.go new file mode 100644 index 000000000..c94950398 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicy.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GnsSegmentationPoliciesGetter has a method to return a GnsSegmentationPolicyInterface. +// A group's client should implement this interface. +type GnsSegmentationPoliciesGetter interface { + GnsSegmentationPolicies() GnsSegmentationPolicyInterface +} + +// GnsSegmentationPolicyInterface has methods to work with GnsSegmentationPolicy resources. +type GnsSegmentationPolicyInterface interface { + Create(ctx context.Context, gnsSegmentationPolicy *v1.GnsSegmentationPolicy, opts metav1.CreateOptions) (*v1.GnsSegmentationPolicy, error) + Update(ctx context.Context, gnsSegmentationPolicy *v1.GnsSegmentationPolicy, opts metav1.UpdateOptions) (*v1.GnsSegmentationPolicy, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GnsSegmentationPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GnsSegmentationPolicyList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsSegmentationPolicy, err error) + GnsSegmentationPolicyExpansion +} + +// gnsSegmentationPolicies implements GnsSegmentationPolicyInterface +type gnsSegmentationPolicies struct { + client rest.Interface +} + +// newGnsSegmentationPolicies returns a GnsSegmentationPolicies +func newGnsSegmentationPolicies(c *GlobalTsmV1Client) *gnsSegmentationPolicies { + return &gnsSegmentationPolicies{ + client: c.RESTClient(), + } +} + +// Get takes name of the gnsSegmentationPolicy, and returns the corresponding gnsSegmentationPolicy object, and an error if there is any. +func (c *gnsSegmentationPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GnsSegmentationPolicy, err error) { + result = &v1.GnsSegmentationPolicy{} + err = c.client.Get(). + Resource("gnssegmentationpolicies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GnsSegmentationPolicies that match those selectors. +func (c *gnsSegmentationPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GnsSegmentationPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GnsSegmentationPolicyList{} + err = c.client.Get(). + Resource("gnssegmentationpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gnsSegmentationPolicies. +func (c *gnsSegmentationPolicies) Watch(ctx context.Context, opts metav1.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(). + Resource("gnssegmentationpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gnsSegmentationPolicy and creates it. Returns the server's representation of the gnsSegmentationPolicy, and an error, if there is any. +func (c *gnsSegmentationPolicies) Create(ctx context.Context, gnsSegmentationPolicy *v1.GnsSegmentationPolicy, opts metav1.CreateOptions) (result *v1.GnsSegmentationPolicy, err error) { + result = &v1.GnsSegmentationPolicy{} + err = c.client.Post(). + Resource("gnssegmentationpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsSegmentationPolicy). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gnsSegmentationPolicy and updates it. Returns the server's representation of the gnsSegmentationPolicy, and an error, if there is any. +func (c *gnsSegmentationPolicies) Update(ctx context.Context, gnsSegmentationPolicy *v1.GnsSegmentationPolicy, opts metav1.UpdateOptions) (result *v1.GnsSegmentationPolicy, err error) { + result = &v1.GnsSegmentationPolicy{} + err = c.client.Put(). + Resource("gnssegmentationpolicies"). + Name(gnsSegmentationPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsSegmentationPolicy). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gnsSegmentationPolicy and deletes it. Returns an error if one occurs. +func (c *gnsSegmentationPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gnssegmentationpolicies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gnsSegmentationPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gnssegmentationpolicies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gnsSegmentationPolicy. +func (c *gnsSegmentationPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsSegmentationPolicy, err error) { + result = &v1.GnsSegmentationPolicy{} + err = c.client.Patch(pt). + Resource("gnssegmentationpolicies"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicyrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicyrt.go new file mode 100644 index 000000000..bd5a24a01 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicyrt.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GnsSegmentationPolicyRTsGetter has a method to return a GnsSegmentationPolicyRTInterface. +// A group's client should implement this interface. +type GnsSegmentationPolicyRTsGetter interface { + GnsSegmentationPolicyRTs() GnsSegmentationPolicyRTInterface +} + +// GnsSegmentationPolicyRTInterface has methods to work with GnsSegmentationPolicyRT resources. +type GnsSegmentationPolicyRTInterface interface { + Create(ctx context.Context, gnsSegmentationPolicyRT *v1.GnsSegmentationPolicyRT, opts metav1.CreateOptions) (*v1.GnsSegmentationPolicyRT, error) + Update(ctx context.Context, gnsSegmentationPolicyRT *v1.GnsSegmentationPolicyRT, opts metav1.UpdateOptions) (*v1.GnsSegmentationPolicyRT, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GnsSegmentationPolicyRT, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GnsSegmentationPolicyRTList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsSegmentationPolicyRT, err error) + GnsSegmentationPolicyRTExpansion +} + +// gnsSegmentationPolicyRTs implements GnsSegmentationPolicyRTInterface +type gnsSegmentationPolicyRTs struct { + client rest.Interface +} + +// newGnsSegmentationPolicyRTs returns a GnsSegmentationPolicyRTs +func newGnsSegmentationPolicyRTs(c *GlobalTsmV1Client) *gnsSegmentationPolicyRTs { + return &gnsSegmentationPolicyRTs{ + client: c.RESTClient(), + } +} + +// Get takes name of the gnsSegmentationPolicyRT, and returns the corresponding gnsSegmentationPolicyRT object, and an error if there is any. +func (c *gnsSegmentationPolicyRTs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GnsSegmentationPolicyRT, err error) { + result = &v1.GnsSegmentationPolicyRT{} + err = c.client.Get(). + Resource("gnssegmentationpolicyrts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GnsSegmentationPolicyRTs that match those selectors. +func (c *gnsSegmentationPolicyRTs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GnsSegmentationPolicyRTList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GnsSegmentationPolicyRTList{} + err = c.client.Get(). + Resource("gnssegmentationpolicyrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gnsSegmentationPolicyRTs. +func (c *gnsSegmentationPolicyRTs) Watch(ctx context.Context, opts metav1.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(). + Resource("gnssegmentationpolicyrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gnsSegmentationPolicyRT and creates it. Returns the server's representation of the gnsSegmentationPolicyRT, and an error, if there is any. +func (c *gnsSegmentationPolicyRTs) Create(ctx context.Context, gnsSegmentationPolicyRT *v1.GnsSegmentationPolicyRT, opts metav1.CreateOptions) (result *v1.GnsSegmentationPolicyRT, err error) { + result = &v1.GnsSegmentationPolicyRT{} + err = c.client.Post(). + Resource("gnssegmentationpolicyrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsSegmentationPolicyRT). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gnsSegmentationPolicyRT and updates it. Returns the server's representation of the gnsSegmentationPolicyRT, and an error, if there is any. +func (c *gnsSegmentationPolicyRTs) Update(ctx context.Context, gnsSegmentationPolicyRT *v1.GnsSegmentationPolicyRT, opts metav1.UpdateOptions) (result *v1.GnsSegmentationPolicyRT, err error) { + result = &v1.GnsSegmentationPolicyRT{} + err = c.client.Put(). + Resource("gnssegmentationpolicyrts"). + Name(gnsSegmentationPolicyRT.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsSegmentationPolicyRT). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gnsSegmentationPolicyRT and deletes it. Returns an error if one occurs. +func (c *gnsSegmentationPolicyRTs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gnssegmentationpolicyrts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gnsSegmentationPolicyRTs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gnssegmentationpolicyrts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gnsSegmentationPolicyRT. +func (c *gnsSegmentationPolicyRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsSegmentationPolicyRT, err error) { + result = &v1.GnsSegmentationPolicyRT{} + err = c.client.Patch(pt). + Resource("gnssegmentationpolicyrts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsserviceentryconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsserviceentryconfig.go new file mode 100644 index 000000000..c831414ec --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnsserviceentryconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GnsServiceEntryConfigsGetter has a method to return a GnsServiceEntryConfigInterface. +// A group's client should implement this interface. +type GnsServiceEntryConfigsGetter interface { + GnsServiceEntryConfigs() GnsServiceEntryConfigInterface +} + +// GnsServiceEntryConfigInterface has methods to work with GnsServiceEntryConfig resources. +type GnsServiceEntryConfigInterface interface { + Create(ctx context.Context, gnsServiceEntryConfig *v1.GnsServiceEntryConfig, opts metav1.CreateOptions) (*v1.GnsServiceEntryConfig, error) + Update(ctx context.Context, gnsServiceEntryConfig *v1.GnsServiceEntryConfig, opts metav1.UpdateOptions) (*v1.GnsServiceEntryConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GnsServiceEntryConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GnsServiceEntryConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsServiceEntryConfig, err error) + GnsServiceEntryConfigExpansion +} + +// gnsServiceEntryConfigs implements GnsServiceEntryConfigInterface +type gnsServiceEntryConfigs struct { + client rest.Interface +} + +// newGnsServiceEntryConfigs returns a GnsServiceEntryConfigs +func newGnsServiceEntryConfigs(c *GlobalTsmV1Client) *gnsServiceEntryConfigs { + return &gnsServiceEntryConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the gnsServiceEntryConfig, and returns the corresponding gnsServiceEntryConfig object, and an error if there is any. +func (c *gnsServiceEntryConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GnsServiceEntryConfig, err error) { + result = &v1.GnsServiceEntryConfig{} + err = c.client.Get(). + Resource("gnsserviceentryconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GnsServiceEntryConfigs that match those selectors. +func (c *gnsServiceEntryConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GnsServiceEntryConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GnsServiceEntryConfigList{} + err = c.client.Get(). + Resource("gnsserviceentryconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gnsServiceEntryConfigs. +func (c *gnsServiceEntryConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("gnsserviceentryconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gnsServiceEntryConfig and creates it. Returns the server's representation of the gnsServiceEntryConfig, and an error, if there is any. +func (c *gnsServiceEntryConfigs) Create(ctx context.Context, gnsServiceEntryConfig *v1.GnsServiceEntryConfig, opts metav1.CreateOptions) (result *v1.GnsServiceEntryConfig, err error) { + result = &v1.GnsServiceEntryConfig{} + err = c.client.Post(). + Resource("gnsserviceentryconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsServiceEntryConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gnsServiceEntryConfig and updates it. Returns the server's representation of the gnsServiceEntryConfig, and an error, if there is any. +func (c *gnsServiceEntryConfigs) Update(ctx context.Context, gnsServiceEntryConfig *v1.GnsServiceEntryConfig, opts metav1.UpdateOptions) (result *v1.GnsServiceEntryConfig, err error) { + result = &v1.GnsServiceEntryConfig{} + err = c.client.Put(). + Resource("gnsserviceentryconfigs"). + Name(gnsServiceEntryConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsServiceEntryConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gnsServiceEntryConfig and deletes it. Returns an error if one occurs. +func (c *gnsServiceEntryConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gnsserviceentryconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gnsServiceEntryConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gnsserviceentryconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gnsServiceEntryConfig. +func (c *gnsServiceEntryConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsServiceEntryConfig, err error) { + result = &v1.GnsServiceEntryConfig{} + err = c.client.Patch(pt). + Resource("gnsserviceentryconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnssvcgroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnssvcgroup.go new file mode 100644 index 000000000..cd5a46167 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnssvcgroup.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GNSSvcGroupsGetter has a method to return a GNSSvcGroupInterface. +// A group's client should implement this interface. +type GNSSvcGroupsGetter interface { + GNSSvcGroups() GNSSvcGroupInterface +} + +// GNSSvcGroupInterface has methods to work with GNSSvcGroup resources. +type GNSSvcGroupInterface interface { + Create(ctx context.Context, gNSSvcGroup *v1.GNSSvcGroup, opts metav1.CreateOptions) (*v1.GNSSvcGroup, error) + Update(ctx context.Context, gNSSvcGroup *v1.GNSSvcGroup, opts metav1.UpdateOptions) (*v1.GNSSvcGroup, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GNSSvcGroup, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GNSSvcGroupList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GNSSvcGroup, err error) + GNSSvcGroupExpansion +} + +// gNSSvcGroups implements GNSSvcGroupInterface +type gNSSvcGroups struct { + client rest.Interface +} + +// newGNSSvcGroups returns a GNSSvcGroups +func newGNSSvcGroups(c *GlobalTsmV1Client) *gNSSvcGroups { + return &gNSSvcGroups{ + client: c.RESTClient(), + } +} + +// Get takes name of the gNSSvcGroup, and returns the corresponding gNSSvcGroup object, and an error if there is any. +func (c *gNSSvcGroups) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GNSSvcGroup, err error) { + result = &v1.GNSSvcGroup{} + err = c.client.Get(). + Resource("gnssvcgroups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GNSSvcGroups that match those selectors. +func (c *gNSSvcGroups) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GNSSvcGroupList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GNSSvcGroupList{} + err = c.client.Get(). + Resource("gnssvcgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gNSSvcGroups. +func (c *gNSSvcGroups) Watch(ctx context.Context, opts metav1.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(). + Resource("gnssvcgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gNSSvcGroup and creates it. Returns the server's representation of the gNSSvcGroup, and an error, if there is any. +func (c *gNSSvcGroups) Create(ctx context.Context, gNSSvcGroup *v1.GNSSvcGroup, opts metav1.CreateOptions) (result *v1.GNSSvcGroup, err error) { + result = &v1.GNSSvcGroup{} + err = c.client.Post(). + Resource("gnssvcgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gNSSvcGroup). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gNSSvcGroup and updates it. Returns the server's representation of the gNSSvcGroup, and an error, if there is any. +func (c *gNSSvcGroups) Update(ctx context.Context, gNSSvcGroup *v1.GNSSvcGroup, opts metav1.UpdateOptions) (result *v1.GNSSvcGroup, err error) { + result = &v1.GNSSvcGroup{} + err = c.client.Put(). + Resource("gnssvcgroups"). + Name(gNSSvcGroup.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gNSSvcGroup). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gNSSvcGroup and deletes it. Returns an error if one occurs. +func (c *gNSSvcGroups) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gnssvcgroups"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gNSSvcGroups) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gnssvcgroups"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gNSSvcGroup. +func (c *gNSSvcGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GNSSvcGroup, err error) { + result = &v1.GNSSvcGroup{} + err = c.client.Patch(pt). + Resource("gnssvcgroups"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnssvcgrouprt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnssvcgrouprt.go new file mode 100644 index 000000000..7a911cfc1 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/gnssvcgrouprt.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// GnsSvcGroupRTsGetter has a method to return a GnsSvcGroupRTInterface. +// A group's client should implement this interface. +type GnsSvcGroupRTsGetter interface { + GnsSvcGroupRTs() GnsSvcGroupRTInterface +} + +// GnsSvcGroupRTInterface has methods to work with GnsSvcGroupRT resources. +type GnsSvcGroupRTInterface interface { + Create(ctx context.Context, gnsSvcGroupRT *v1.GnsSvcGroupRT, opts metav1.CreateOptions) (*v1.GnsSvcGroupRT, error) + Update(ctx context.Context, gnsSvcGroupRT *v1.GnsSvcGroupRT, opts metav1.UpdateOptions) (*v1.GnsSvcGroupRT, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GnsSvcGroupRT, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GnsSvcGroupRTList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsSvcGroupRT, err error) + GnsSvcGroupRTExpansion +} + +// gnsSvcGroupRTs implements GnsSvcGroupRTInterface +type gnsSvcGroupRTs struct { + client rest.Interface +} + +// newGnsSvcGroupRTs returns a GnsSvcGroupRTs +func newGnsSvcGroupRTs(c *GlobalTsmV1Client) *gnsSvcGroupRTs { + return &gnsSvcGroupRTs{ + client: c.RESTClient(), + } +} + +// Get takes name of the gnsSvcGroupRT, and returns the corresponding gnsSvcGroupRT object, and an error if there is any. +func (c *gnsSvcGroupRTs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GnsSvcGroupRT, err error) { + result = &v1.GnsSvcGroupRT{} + err = c.client.Get(). + Resource("gnssvcgrouprts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GnsSvcGroupRTs that match those selectors. +func (c *gnsSvcGroupRTs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GnsSvcGroupRTList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GnsSvcGroupRTList{} + err = c.client.Get(). + Resource("gnssvcgrouprts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gnsSvcGroupRTs. +func (c *gnsSvcGroupRTs) Watch(ctx context.Context, opts metav1.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(). + Resource("gnssvcgrouprts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gnsSvcGroupRT and creates it. Returns the server's representation of the gnsSvcGroupRT, and an error, if there is any. +func (c *gnsSvcGroupRTs) Create(ctx context.Context, gnsSvcGroupRT *v1.GnsSvcGroupRT, opts metav1.CreateOptions) (result *v1.GnsSvcGroupRT, err error) { + result = &v1.GnsSvcGroupRT{} + err = c.client.Post(). + Resource("gnssvcgrouprts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsSvcGroupRT). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gnsSvcGroupRT and updates it. Returns the server's representation of the gnsSvcGroupRT, and an error, if there is any. +func (c *gnsSvcGroupRTs) Update(ctx context.Context, gnsSvcGroupRT *v1.GnsSvcGroupRT, opts metav1.UpdateOptions) (result *v1.GnsSvcGroupRT, err error) { + result = &v1.GnsSvcGroupRT{} + err = c.client.Put(). + Resource("gnssvcgrouprts"). + Name(gnsSvcGroupRT.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gnsSvcGroupRT). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gnsSvcGroupRT and deletes it. Returns an error if one occurs. +func (c *gnsSvcGroupRTs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("gnssvcgrouprts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gnsSvcGroupRTs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("gnssvcgrouprts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gnsSvcGroupRT. +func (c *gnsSvcGroupRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GnsSvcGroupRT, err error) { + result = &v1.GnsSvcGroupRT{} + err = c.client.Patch(pt). + Resource("gnssvcgrouprts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/haconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/haconfig.go new file mode 100644 index 000000000..c367485bf --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/haconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// HaConfigsGetter has a method to return a HaConfigInterface. +// A group's client should implement this interface. +type HaConfigsGetter interface { + HaConfigs() HaConfigInterface +} + +// HaConfigInterface has methods to work with HaConfig resources. +type HaConfigInterface interface { + Create(ctx context.Context, haConfig *v1.HaConfig, opts metav1.CreateOptions) (*v1.HaConfig, error) + Update(ctx context.Context, haConfig *v1.HaConfig, opts metav1.UpdateOptions) (*v1.HaConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.HaConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.HaConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HaConfig, err error) + HaConfigExpansion +} + +// haConfigs implements HaConfigInterface +type haConfigs struct { + client rest.Interface +} + +// newHaConfigs returns a HaConfigs +func newHaConfigs(c *GlobalTsmV1Client) *haConfigs { + return &haConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the haConfig, and returns the corresponding haConfig object, and an error if there is any. +func (c *haConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HaConfig, err error) { + result = &v1.HaConfig{} + err = c.client.Get(). + Resource("haconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of HaConfigs that match those selectors. +func (c *haConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HaConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.HaConfigList{} + err = c.client.Get(). + Resource("haconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested haConfigs. +func (c *haConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("haconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a haConfig and creates it. Returns the server's representation of the haConfig, and an error, if there is any. +func (c *haConfigs) Create(ctx context.Context, haConfig *v1.HaConfig, opts metav1.CreateOptions) (result *v1.HaConfig, err error) { + result = &v1.HaConfig{} + err = c.client.Post(). + Resource("haconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(haConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a haConfig and updates it. Returns the server's representation of the haConfig, and an error, if there is any. +func (c *haConfigs) Update(ctx context.Context, haConfig *v1.HaConfig, opts metav1.UpdateOptions) (result *v1.HaConfig, err error) { + result = &v1.HaConfig{} + err = c.client.Put(). + Resource("haconfigs"). + Name(haConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(haConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the haConfig and deletes it. Returns an error if one occurs. +func (c *haConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("haconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *haConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("haconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched haConfig. +func (c *haConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HaConfig, err error) { + result = &v1.HaConfig{} + err = c.client.Patch(pt). + Resource("haconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/haconfigv2.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/haconfigv2.go new file mode 100644 index 000000000..c92d7b45e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/haconfigv2.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// HaConfigV2sGetter has a method to return a HaConfigV2Interface. +// A group's client should implement this interface. +type HaConfigV2sGetter interface { + HaConfigV2s() HaConfigV2Interface +} + +// HaConfigV2Interface has methods to work with HaConfigV2 resources. +type HaConfigV2Interface interface { + Create(ctx context.Context, haConfigV2 *v1.HaConfigV2, opts metav1.CreateOptions) (*v1.HaConfigV2, error) + Update(ctx context.Context, haConfigV2 *v1.HaConfigV2, opts metav1.UpdateOptions) (*v1.HaConfigV2, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.HaConfigV2, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.HaConfigV2List, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HaConfigV2, err error) + HaConfigV2Expansion +} + +// haConfigV2s implements HaConfigV2Interface +type haConfigV2s struct { + client rest.Interface +} + +// newHaConfigV2s returns a HaConfigV2s +func newHaConfigV2s(c *GlobalTsmV1Client) *haConfigV2s { + return &haConfigV2s{ + client: c.RESTClient(), + } +} + +// Get takes name of the haConfigV2, and returns the corresponding haConfigV2 object, and an error if there is any. +func (c *haConfigV2s) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HaConfigV2, err error) { + result = &v1.HaConfigV2{} + err = c.client.Get(). + Resource("haconfigv2s"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of HaConfigV2s that match those selectors. +func (c *haConfigV2s) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HaConfigV2List, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.HaConfigV2List{} + err = c.client.Get(). + Resource("haconfigv2s"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested haConfigV2s. +func (c *haConfigV2s) Watch(ctx context.Context, opts metav1.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(). + Resource("haconfigv2s"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a haConfigV2 and creates it. Returns the server's representation of the haConfigV2, and an error, if there is any. +func (c *haConfigV2s) Create(ctx context.Context, haConfigV2 *v1.HaConfigV2, opts metav1.CreateOptions) (result *v1.HaConfigV2, err error) { + result = &v1.HaConfigV2{} + err = c.client.Post(). + Resource("haconfigv2s"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(haConfigV2). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a haConfigV2 and updates it. Returns the server's representation of the haConfigV2, and an error, if there is any. +func (c *haConfigV2s) Update(ctx context.Context, haConfigV2 *v1.HaConfigV2, opts metav1.UpdateOptions) (result *v1.HaConfigV2, err error) { + result = &v1.HaConfigV2{} + err = c.client.Put(). + Resource("haconfigv2s"). + Name(haConfigV2.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(haConfigV2). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the haConfigV2 and deletes it. Returns an error if one occurs. +func (c *haConfigV2s) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("haconfigv2s"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *haConfigV2s) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("haconfigv2s"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched haConfigV2. +func (c *haConfigV2s) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HaConfigV2, err error) { + result = &v1.HaConfigV2{} + err = c.client.Patch(pt). + Resource("haconfigv2s"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/healthcheckconfign.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/healthcheckconfign.go new file mode 100644 index 000000000..a5c41fce5 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/healthcheckconfign.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// HealthCheckConfigNsGetter has a method to return a HealthCheckConfigNInterface. +// A group's client should implement this interface. +type HealthCheckConfigNsGetter interface { + HealthCheckConfigNs() HealthCheckConfigNInterface +} + +// HealthCheckConfigNInterface has methods to work with HealthCheckConfigN resources. +type HealthCheckConfigNInterface interface { + Create(ctx context.Context, healthCheckConfigN *v1.HealthCheckConfigN, opts metav1.CreateOptions) (*v1.HealthCheckConfigN, error) + Update(ctx context.Context, healthCheckConfigN *v1.HealthCheckConfigN, opts metav1.UpdateOptions) (*v1.HealthCheckConfigN, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.HealthCheckConfigN, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.HealthCheckConfigNList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HealthCheckConfigN, err error) + HealthCheckConfigNExpansion +} + +// healthCheckConfigNs implements HealthCheckConfigNInterface +type healthCheckConfigNs struct { + client rest.Interface +} + +// newHealthCheckConfigNs returns a HealthCheckConfigNs +func newHealthCheckConfigNs(c *GlobalTsmV1Client) *healthCheckConfigNs { + return &healthCheckConfigNs{ + client: c.RESTClient(), + } +} + +// Get takes name of the healthCheckConfigN, and returns the corresponding healthCheckConfigN object, and an error if there is any. +func (c *healthCheckConfigNs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HealthCheckConfigN, err error) { + result = &v1.HealthCheckConfigN{} + err = c.client.Get(). + Resource("healthcheckconfigns"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of HealthCheckConfigNs that match those selectors. +func (c *healthCheckConfigNs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HealthCheckConfigNList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.HealthCheckConfigNList{} + err = c.client.Get(). + Resource("healthcheckconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested healthCheckConfigNs. +func (c *healthCheckConfigNs) Watch(ctx context.Context, opts metav1.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(). + Resource("healthcheckconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a healthCheckConfigN and creates it. Returns the server's representation of the healthCheckConfigN, and an error, if there is any. +func (c *healthCheckConfigNs) Create(ctx context.Context, healthCheckConfigN *v1.HealthCheckConfigN, opts metav1.CreateOptions) (result *v1.HealthCheckConfigN, err error) { + result = &v1.HealthCheckConfigN{} + err = c.client.Post(). + Resource("healthcheckconfigns"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(healthCheckConfigN). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a healthCheckConfigN and updates it. Returns the server's representation of the healthCheckConfigN, and an error, if there is any. +func (c *healthCheckConfigNs) Update(ctx context.Context, healthCheckConfigN *v1.HealthCheckConfigN, opts metav1.UpdateOptions) (result *v1.HealthCheckConfigN, err error) { + result = &v1.HealthCheckConfigN{} + err = c.client.Put(). + Resource("healthcheckconfigns"). + Name(healthCheckConfigN.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(healthCheckConfigN). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the healthCheckConfigN and deletes it. Returns an error if one occurs. +func (c *healthCheckConfigNs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("healthcheckconfigns"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *healthCheckConfigNs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("healthcheckconfigns"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched healthCheckConfigN. +func (c *healthCheckConfigNs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HealthCheckConfigN, err error) { + result = &v1.HealthCheckConfigN{} + err = c.client.Patch(pt). + Resource("healthcheckconfigns"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/hostconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/hostconfig.go new file mode 100644 index 000000000..8141b9156 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/hostconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// HostConfigsGetter has a method to return a HostConfigInterface. +// A group's client should implement this interface. +type HostConfigsGetter interface { + HostConfigs() HostConfigInterface +} + +// HostConfigInterface has methods to work with HostConfig resources. +type HostConfigInterface interface { + Create(ctx context.Context, hostConfig *v1.HostConfig, opts metav1.CreateOptions) (*v1.HostConfig, error) + Update(ctx context.Context, hostConfig *v1.HostConfig, opts metav1.UpdateOptions) (*v1.HostConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.HostConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.HostConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HostConfig, err error) + HostConfigExpansion +} + +// hostConfigs implements HostConfigInterface +type hostConfigs struct { + client rest.Interface +} + +// newHostConfigs returns a HostConfigs +func newHostConfigs(c *GlobalTsmV1Client) *hostConfigs { + return &hostConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the hostConfig, and returns the corresponding hostConfig object, and an error if there is any. +func (c *hostConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HostConfig, err error) { + result = &v1.HostConfig{} + err = c.client.Get(). + Resource("hostconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of HostConfigs that match those selectors. +func (c *hostConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HostConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.HostConfigList{} + err = c.client.Get(). + Resource("hostconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested hostConfigs. +func (c *hostConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("hostconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a hostConfig and creates it. Returns the server's representation of the hostConfig, and an error, if there is any. +func (c *hostConfigs) Create(ctx context.Context, hostConfig *v1.HostConfig, opts metav1.CreateOptions) (result *v1.HostConfig, err error) { + result = &v1.HostConfig{} + err = c.client.Post(). + Resource("hostconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(hostConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a hostConfig and updates it. Returns the server's representation of the hostConfig, and an error, if there is any. +func (c *hostConfigs) Update(ctx context.Context, hostConfig *v1.HostConfig, opts metav1.UpdateOptions) (result *v1.HostConfig, err error) { + result = &v1.HostConfig{} + err = c.client.Put(). + Resource("hostconfigs"). + Name(hostConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(hostConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the hostConfig and deletes it. Returns an error if one occurs. +func (c *hostConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("hostconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *hostConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("hostconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched hostConfig. +func (c *hostConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HostConfig, err error) { + result = &v1.HostConfig{} + err = c.client.Patch(pt). + Resource("hostconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/hostconfigv2.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/hostconfigv2.go new file mode 100644 index 000000000..10ff5c857 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/hostconfigv2.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// HostConfigV2sGetter has a method to return a HostConfigV2Interface. +// A group's client should implement this interface. +type HostConfigV2sGetter interface { + HostConfigV2s() HostConfigV2Interface +} + +// HostConfigV2Interface has methods to work with HostConfigV2 resources. +type HostConfigV2Interface interface { + Create(ctx context.Context, hostConfigV2 *v1.HostConfigV2, opts metav1.CreateOptions) (*v1.HostConfigV2, error) + Update(ctx context.Context, hostConfigV2 *v1.HostConfigV2, opts metav1.UpdateOptions) (*v1.HostConfigV2, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.HostConfigV2, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.HostConfigV2List, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HostConfigV2, err error) + HostConfigV2Expansion +} + +// hostConfigV2s implements HostConfigV2Interface +type hostConfigV2s struct { + client rest.Interface +} + +// newHostConfigV2s returns a HostConfigV2s +func newHostConfigV2s(c *GlobalTsmV1Client) *hostConfigV2s { + return &hostConfigV2s{ + client: c.RESTClient(), + } +} + +// Get takes name of the hostConfigV2, and returns the corresponding hostConfigV2 object, and an error if there is any. +func (c *hostConfigV2s) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HostConfigV2, err error) { + result = &v1.HostConfigV2{} + err = c.client.Get(). + Resource("hostconfigv2s"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of HostConfigV2s that match those selectors. +func (c *hostConfigV2s) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HostConfigV2List, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.HostConfigV2List{} + err = c.client.Get(). + Resource("hostconfigv2s"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested hostConfigV2s. +func (c *hostConfigV2s) Watch(ctx context.Context, opts metav1.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(). + Resource("hostconfigv2s"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a hostConfigV2 and creates it. Returns the server's representation of the hostConfigV2, and an error, if there is any. +func (c *hostConfigV2s) Create(ctx context.Context, hostConfigV2 *v1.HostConfigV2, opts metav1.CreateOptions) (result *v1.HostConfigV2, err error) { + result = &v1.HostConfigV2{} + err = c.client.Post(). + Resource("hostconfigv2s"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(hostConfigV2). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a hostConfigV2 and updates it. Returns the server's representation of the hostConfigV2, and an error, if there is any. +func (c *hostConfigV2s) Update(ctx context.Context, hostConfigV2 *v1.HostConfigV2, opts metav1.UpdateOptions) (result *v1.HostConfigV2, err error) { + result = &v1.HostConfigV2{} + err = c.client.Put(). + Resource("hostconfigv2s"). + Name(hostConfigV2.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(hostConfigV2). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the hostConfigV2 and deletes it. Returns an error if one occurs. +func (c *hostConfigV2s) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("hostconfigv2s"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *hostConfigV2s) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("hostconfigv2s"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched hostConfigV2. +func (c *hostConfigV2s) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HostConfigV2, err error) { + result = &v1.HostConfigV2{} + err = c.client.Patch(pt). + Resource("hostconfigv2s"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/inboundauthenticationconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/inboundauthenticationconfig.go new file mode 100644 index 000000000..e97094fad --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/inboundauthenticationconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// InboundAuthenticationConfigsGetter has a method to return a InboundAuthenticationConfigInterface. +// A group's client should implement this interface. +type InboundAuthenticationConfigsGetter interface { + InboundAuthenticationConfigs() InboundAuthenticationConfigInterface +} + +// InboundAuthenticationConfigInterface has methods to work with InboundAuthenticationConfig resources. +type InboundAuthenticationConfigInterface interface { + Create(ctx context.Context, inboundAuthenticationConfig *v1.InboundAuthenticationConfig, opts metav1.CreateOptions) (*v1.InboundAuthenticationConfig, error) + Update(ctx context.Context, inboundAuthenticationConfig *v1.InboundAuthenticationConfig, opts metav1.UpdateOptions) (*v1.InboundAuthenticationConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.InboundAuthenticationConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.InboundAuthenticationConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.InboundAuthenticationConfig, err error) + InboundAuthenticationConfigExpansion +} + +// inboundAuthenticationConfigs implements InboundAuthenticationConfigInterface +type inboundAuthenticationConfigs struct { + client rest.Interface +} + +// newInboundAuthenticationConfigs returns a InboundAuthenticationConfigs +func newInboundAuthenticationConfigs(c *GlobalTsmV1Client) *inboundAuthenticationConfigs { + return &inboundAuthenticationConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the inboundAuthenticationConfig, and returns the corresponding inboundAuthenticationConfig object, and an error if there is any. +func (c *inboundAuthenticationConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.InboundAuthenticationConfig, err error) { + result = &v1.InboundAuthenticationConfig{} + err = c.client.Get(). + Resource("inboundauthenticationconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of InboundAuthenticationConfigs that match those selectors. +func (c *inboundAuthenticationConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.InboundAuthenticationConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.InboundAuthenticationConfigList{} + err = c.client.Get(). + Resource("inboundauthenticationconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested inboundAuthenticationConfigs. +func (c *inboundAuthenticationConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("inboundauthenticationconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a inboundAuthenticationConfig and creates it. Returns the server's representation of the inboundAuthenticationConfig, and an error, if there is any. +func (c *inboundAuthenticationConfigs) Create(ctx context.Context, inboundAuthenticationConfig *v1.InboundAuthenticationConfig, opts metav1.CreateOptions) (result *v1.InboundAuthenticationConfig, err error) { + result = &v1.InboundAuthenticationConfig{} + err = c.client.Post(). + Resource("inboundauthenticationconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(inboundAuthenticationConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a inboundAuthenticationConfig and updates it. Returns the server's representation of the inboundAuthenticationConfig, and an error, if there is any. +func (c *inboundAuthenticationConfigs) Update(ctx context.Context, inboundAuthenticationConfig *v1.InboundAuthenticationConfig, opts metav1.UpdateOptions) (result *v1.InboundAuthenticationConfig, err error) { + result = &v1.InboundAuthenticationConfig{} + err = c.client.Put(). + Resource("inboundauthenticationconfigs"). + Name(inboundAuthenticationConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(inboundAuthenticationConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the inboundAuthenticationConfig and deletes it. Returns an error if one occurs. +func (c *inboundAuthenticationConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("inboundauthenticationconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *inboundAuthenticationConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("inboundauthenticationconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched inboundAuthenticationConfig. +func (c *inboundAuthenticationConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.InboundAuthenticationConfig, err error) { + result = &v1.InboundAuthenticationConfig{} + err = c.client.Patch(pt). + Resource("inboundauthenticationconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/inventory.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/inventory.go new file mode 100644 index 000000000..2138b4ab8 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/inventory.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// InventoriesGetter has a method to return a InventoryInterface. +// A group's client should implement this interface. +type InventoriesGetter interface { + Inventories() InventoryInterface +} + +// InventoryInterface has methods to work with Inventory resources. +type InventoryInterface interface { + Create(ctx context.Context, inventory *v1.Inventory, opts metav1.CreateOptions) (*v1.Inventory, error) + Update(ctx context.Context, inventory *v1.Inventory, opts metav1.UpdateOptions) (*v1.Inventory, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Inventory, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.InventoryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Inventory, err error) + InventoryExpansion +} + +// inventories implements InventoryInterface +type inventories struct { + client rest.Interface +} + +// newInventories returns a Inventories +func newInventories(c *GlobalTsmV1Client) *inventories { + return &inventories{ + client: c.RESTClient(), + } +} + +// Get takes name of the inventory, and returns the corresponding inventory object, and an error if there is any. +func (c *inventories) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Inventory, err error) { + result = &v1.Inventory{} + err = c.client.Get(). + Resource("inventories"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Inventories that match those selectors. +func (c *inventories) List(ctx context.Context, opts metav1.ListOptions) (result *v1.InventoryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.InventoryList{} + err = c.client.Get(). + Resource("inventories"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested inventories. +func (c *inventories) Watch(ctx context.Context, opts metav1.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(). + Resource("inventories"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a inventory and creates it. Returns the server's representation of the inventory, and an error, if there is any. +func (c *inventories) Create(ctx context.Context, inventory *v1.Inventory, opts metav1.CreateOptions) (result *v1.Inventory, err error) { + result = &v1.Inventory{} + err = c.client.Post(). + Resource("inventories"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(inventory). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a inventory and updates it. Returns the server's representation of the inventory, and an error, if there is any. +func (c *inventories) Update(ctx context.Context, inventory *v1.Inventory, opts metav1.UpdateOptions) (result *v1.Inventory, err error) { + result = &v1.Inventory{} + err = c.client.Put(). + Resource("inventories"). + Name(inventory.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(inventory). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the inventory and deletes it. Returns an error if one occurs. +func (c *inventories) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("inventories"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *inventories) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("inventories"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched inventory. +func (c *inventories) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Inventory, err error) { + result = &v1.Inventory{} + err = c.client.Patch(pt). + Resource("inventories"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/issuer.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/issuer.go new file mode 100644 index 000000000..147704220 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/issuer.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// IssuersGetter has a method to return a IssuerInterface. +// A group's client should implement this interface. +type IssuersGetter interface { + Issuers() IssuerInterface +} + +// IssuerInterface has methods to work with Issuer resources. +type IssuerInterface interface { + Create(ctx context.Context, issuer *v1.Issuer, opts metav1.CreateOptions) (*v1.Issuer, error) + Update(ctx context.Context, issuer *v1.Issuer, opts metav1.UpdateOptions) (*v1.Issuer, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Issuer, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.IssuerList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Issuer, err error) + IssuerExpansion +} + +// issuers implements IssuerInterface +type issuers struct { + client rest.Interface +} + +// newIssuers returns a Issuers +func newIssuers(c *GlobalTsmV1Client) *issuers { + return &issuers{ + client: c.RESTClient(), + } +} + +// Get takes name of the issuer, and returns the corresponding issuer object, and an error if there is any. +func (c *issuers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Issuer, err error) { + result = &v1.Issuer{} + err = c.client.Get(). + Resource("issuers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Issuers that match those selectors. +func (c *issuers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IssuerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.IssuerList{} + err = c.client.Get(). + Resource("issuers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested issuers. +func (c *issuers) Watch(ctx context.Context, opts metav1.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(). + Resource("issuers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a issuer and creates it. Returns the server's representation of the issuer, and an error, if there is any. +func (c *issuers) Create(ctx context.Context, issuer *v1.Issuer, opts metav1.CreateOptions) (result *v1.Issuer, err error) { + result = &v1.Issuer{} + err = c.client.Post(). + Resource("issuers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(issuer). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a issuer and updates it. Returns the server's representation of the issuer, and an error, if there is any. +func (c *issuers) Update(ctx context.Context, issuer *v1.Issuer, opts metav1.UpdateOptions) (result *v1.Issuer, err error) { + result = &v1.Issuer{} + err = c.client.Put(). + Resource("issuers"). + Name(issuer.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(issuer). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the issuer and deletes it. Returns an error if one occurs. +func (c *issuers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("issuers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *issuers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("issuers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched issuer. +func (c *issuers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Issuer, err error) { + result = &v1.Issuer{} + err = c.client.Patch(pt). + Resource("issuers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/job.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/job.go new file mode 100644 index 000000000..dd114e601 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/job.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// JobsGetter has a method to return a JobInterface. +// A group's client should implement this interface. +type JobsGetter interface { + Jobs() JobInterface +} + +// JobInterface has methods to work with Job resources. +type JobInterface interface { + Create(ctx context.Context, job *v1.Job, opts metav1.CreateOptions) (*v1.Job, error) + Update(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (*v1.Job, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Job, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.JobList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Job, err error) + JobExpansion +} + +// jobs implements JobInterface +type jobs struct { + client rest.Interface +} + +// newJobs returns a Jobs +func newJobs(c *GlobalTsmV1Client) *jobs { + return &jobs{ + client: c.RESTClient(), + } +} + +// Get takes name of the job, and returns the corresponding job object, and an error if there is any. +func (c *jobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Job, err error) { + result = &v1.Job{} + err = c.client.Get(). + Resource("jobs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Jobs that match those selectors. +func (c *jobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.JobList{} + err = c.client.Get(). + Resource("jobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested jobs. +func (c *jobs) Watch(ctx context.Context, opts metav1.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(). + Resource("jobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any. +func (c *jobs) Create(ctx context.Context, job *v1.Job, opts metav1.CreateOptions) (result *v1.Job, err error) { + result = &v1.Job{} + err = c.client.Post(). + Resource("jobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(job). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any. +func (c *jobs) Update(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (result *v1.Job, err error) { + result = &v1.Job{} + err = c.client.Put(). + Resource("jobs"). + Name(job.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(job). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the job and deletes it. Returns an error if one occurs. +func (c *jobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("jobs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *jobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("jobs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched job. +func (c *jobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Job, err error) { + result = &v1.Job{} + err = c.client.Patch(pt). + Resource("jobs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/jobconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/jobconfig.go new file mode 100644 index 000000000..66ce64d6b --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/jobconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// JobConfigsGetter has a method to return a JobConfigInterface. +// A group's client should implement this interface. +type JobConfigsGetter interface { + JobConfigs() JobConfigInterface +} + +// JobConfigInterface has methods to work with JobConfig resources. +type JobConfigInterface interface { + Create(ctx context.Context, jobConfig *v1.JobConfig, opts metav1.CreateOptions) (*v1.JobConfig, error) + Update(ctx context.Context, jobConfig *v1.JobConfig, opts metav1.UpdateOptions) (*v1.JobConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.JobConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.JobConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.JobConfig, err error) + JobConfigExpansion +} + +// jobConfigs implements JobConfigInterface +type jobConfigs struct { + client rest.Interface +} + +// newJobConfigs returns a JobConfigs +func newJobConfigs(c *GlobalTsmV1Client) *jobConfigs { + return &jobConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the jobConfig, and returns the corresponding jobConfig object, and an error if there is any. +func (c *jobConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.JobConfig, err error) { + result = &v1.JobConfig{} + err = c.client.Get(). + Resource("jobconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of JobConfigs that match those selectors. +func (c *jobConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.JobConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.JobConfigList{} + err = c.client.Get(). + Resource("jobconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested jobConfigs. +func (c *jobConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("jobconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a jobConfig and creates it. Returns the server's representation of the jobConfig, and an error, if there is any. +func (c *jobConfigs) Create(ctx context.Context, jobConfig *v1.JobConfig, opts metav1.CreateOptions) (result *v1.JobConfig, err error) { + result = &v1.JobConfig{} + err = c.client.Post(). + Resource("jobconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a jobConfig and updates it. Returns the server's representation of the jobConfig, and an error, if there is any. +func (c *jobConfigs) Update(ctx context.Context, jobConfig *v1.JobConfig, opts metav1.UpdateOptions) (result *v1.JobConfig, err error) { + result = &v1.JobConfig{} + err = c.client.Put(). + Resource("jobconfigs"). + Name(jobConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the jobConfig and deletes it. Returns an error if one occurs. +func (c *jobConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("jobconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *jobConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("jobconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched jobConfig. +func (c *jobConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.JobConfig, err error) { + result = &v1.JobConfig{} + err = c.client.Patch(pt). + Resource("jobconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/jobconfigfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/jobconfigfolder.go new file mode 100644 index 000000000..0ff9b6fd5 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/jobconfigfolder.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// JobConfigFoldersGetter has a method to return a JobConfigFolderInterface. +// A group's client should implement this interface. +type JobConfigFoldersGetter interface { + JobConfigFolders() JobConfigFolderInterface +} + +// JobConfigFolderInterface has methods to work with JobConfigFolder resources. +type JobConfigFolderInterface interface { + Create(ctx context.Context, jobConfigFolder *v1.JobConfigFolder, opts metav1.CreateOptions) (*v1.JobConfigFolder, error) + Update(ctx context.Context, jobConfigFolder *v1.JobConfigFolder, opts metav1.UpdateOptions) (*v1.JobConfigFolder, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.JobConfigFolder, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.JobConfigFolderList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.JobConfigFolder, err error) + JobConfigFolderExpansion +} + +// jobConfigFolders implements JobConfigFolderInterface +type jobConfigFolders struct { + client rest.Interface +} + +// newJobConfigFolders returns a JobConfigFolders +func newJobConfigFolders(c *GlobalTsmV1Client) *jobConfigFolders { + return &jobConfigFolders{ + client: c.RESTClient(), + } +} + +// Get takes name of the jobConfigFolder, and returns the corresponding jobConfigFolder object, and an error if there is any. +func (c *jobConfigFolders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.JobConfigFolder, err error) { + result = &v1.JobConfigFolder{} + err = c.client.Get(). + Resource("jobconfigfolders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of JobConfigFolders that match those selectors. +func (c *jobConfigFolders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.JobConfigFolderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.JobConfigFolderList{} + err = c.client.Get(). + Resource("jobconfigfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested jobConfigFolders. +func (c *jobConfigFolders) Watch(ctx context.Context, opts metav1.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(). + Resource("jobconfigfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a jobConfigFolder and creates it. Returns the server's representation of the jobConfigFolder, and an error, if there is any. +func (c *jobConfigFolders) Create(ctx context.Context, jobConfigFolder *v1.JobConfigFolder, opts metav1.CreateOptions) (result *v1.JobConfigFolder, err error) { + result = &v1.JobConfigFolder{} + err = c.client.Post(). + Resource("jobconfigfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobConfigFolder). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a jobConfigFolder and updates it. Returns the server's representation of the jobConfigFolder, and an error, if there is any. +func (c *jobConfigFolders) Update(ctx context.Context, jobConfigFolder *v1.JobConfigFolder, opts metav1.UpdateOptions) (result *v1.JobConfigFolder, err error) { + result = &v1.JobConfigFolder{} + err = c.client.Put(). + Resource("jobconfigfolders"). + Name(jobConfigFolder.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobConfigFolder). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the jobConfigFolder and deletes it. Returns an error if one occurs. +func (c *jobConfigFolders) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("jobconfigfolders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *jobConfigFolders) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("jobconfigfolders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched jobConfigFolder. +func (c *jobConfigFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.JobConfigFolder, err error) { + result = &v1.JobConfigFolder{} + err = c.client.Patch(pt). + Resource("jobconfigfolders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/jobfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/jobfolder.go new file mode 100644 index 000000000..4c557c695 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/jobfolder.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// JobFoldersGetter has a method to return a JobFolderInterface. +// A group's client should implement this interface. +type JobFoldersGetter interface { + JobFolders() JobFolderInterface +} + +// JobFolderInterface has methods to work with JobFolder resources. +type JobFolderInterface interface { + Create(ctx context.Context, jobFolder *v1.JobFolder, opts metav1.CreateOptions) (*v1.JobFolder, error) + Update(ctx context.Context, jobFolder *v1.JobFolder, opts metav1.UpdateOptions) (*v1.JobFolder, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.JobFolder, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.JobFolderList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.JobFolder, err error) + JobFolderExpansion +} + +// jobFolders implements JobFolderInterface +type jobFolders struct { + client rest.Interface +} + +// newJobFolders returns a JobFolders +func newJobFolders(c *GlobalTsmV1Client) *jobFolders { + return &jobFolders{ + client: c.RESTClient(), + } +} + +// Get takes name of the jobFolder, and returns the corresponding jobFolder object, and an error if there is any. +func (c *jobFolders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.JobFolder, err error) { + result = &v1.JobFolder{} + err = c.client.Get(). + Resource("jobfolders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of JobFolders that match those selectors. +func (c *jobFolders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.JobFolderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.JobFolderList{} + err = c.client.Get(). + Resource("jobfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested jobFolders. +func (c *jobFolders) Watch(ctx context.Context, opts metav1.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(). + Resource("jobfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a jobFolder and creates it. Returns the server's representation of the jobFolder, and an error, if there is any. +func (c *jobFolders) Create(ctx context.Context, jobFolder *v1.JobFolder, opts metav1.CreateOptions) (result *v1.JobFolder, err error) { + result = &v1.JobFolder{} + err = c.client.Post(). + Resource("jobfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobFolder). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a jobFolder and updates it. Returns the server's representation of the jobFolder, and an error, if there is any. +func (c *jobFolders) Update(ctx context.Context, jobFolder *v1.JobFolder, opts metav1.UpdateOptions) (result *v1.JobFolder, err error) { + result = &v1.JobFolder{} + err = c.client.Put(). + Resource("jobfolders"). + Name(jobFolder.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobFolder). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the jobFolder and deletes it. Returns an error if one occurs. +func (c *jobFolders) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("jobfolders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *jobFolders) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("jobfolders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched jobFolder. +func (c *jobFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.JobFolder, err error) { + result = &v1.JobFolder{} + err = c.client.Patch(pt). + Resource("jobfolders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/knativeingress.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/knativeingress.go new file mode 100644 index 000000000..04cf2e897 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/knativeingress.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// KnativeIngressesGetter has a method to return a KnativeIngressInterface. +// A group's client should implement this interface. +type KnativeIngressesGetter interface { + KnativeIngresses() KnativeIngressInterface +} + +// KnativeIngressInterface has methods to work with KnativeIngress resources. +type KnativeIngressInterface interface { + Create(ctx context.Context, knativeIngress *v1.KnativeIngress, opts metav1.CreateOptions) (*v1.KnativeIngress, error) + Update(ctx context.Context, knativeIngress *v1.KnativeIngress, opts metav1.UpdateOptions) (*v1.KnativeIngress, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.KnativeIngress, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.KnativeIngressList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.KnativeIngress, err error) + KnativeIngressExpansion +} + +// knativeIngresses implements KnativeIngressInterface +type knativeIngresses struct { + client rest.Interface +} + +// newKnativeIngresses returns a KnativeIngresses +func newKnativeIngresses(c *GlobalTsmV1Client) *knativeIngresses { + return &knativeIngresses{ + client: c.RESTClient(), + } +} + +// Get takes name of the knativeIngress, and returns the corresponding knativeIngress object, and an error if there is any. +func (c *knativeIngresses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.KnativeIngress, err error) { + result = &v1.KnativeIngress{} + err = c.client.Get(). + Resource("knativeingresses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of KnativeIngresses that match those selectors. +func (c *knativeIngresses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.KnativeIngressList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.KnativeIngressList{} + err = c.client.Get(). + Resource("knativeingresses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested knativeIngresses. +func (c *knativeIngresses) Watch(ctx context.Context, opts metav1.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(). + Resource("knativeingresses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a knativeIngress and creates it. Returns the server's representation of the knativeIngress, and an error, if there is any. +func (c *knativeIngresses) Create(ctx context.Context, knativeIngress *v1.KnativeIngress, opts metav1.CreateOptions) (result *v1.KnativeIngress, err error) { + result = &v1.KnativeIngress{} + err = c.client.Post(). + Resource("knativeingresses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(knativeIngress). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a knativeIngress and updates it. Returns the server's representation of the knativeIngress, and an error, if there is any. +func (c *knativeIngresses) Update(ctx context.Context, knativeIngress *v1.KnativeIngress, opts metav1.UpdateOptions) (result *v1.KnativeIngress, err error) { + result = &v1.KnativeIngress{} + err = c.client.Put(). + Resource("knativeingresses"). + Name(knativeIngress.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(knativeIngress). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the knativeIngress and deletes it. Returns an error if one occurs. +func (c *knativeIngresses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("knativeingresses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *knativeIngresses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("knativeingresses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched knativeIngress. +func (c *knativeIngresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.KnativeIngress, err error) { + result = &v1.KnativeIngress{} + err = c.client.Patch(pt). + Resource("knativeingresses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/labelconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/labelconfig.go new file mode 100644 index 000000000..ffed70b2e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/labelconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// LabelConfigsGetter has a method to return a LabelConfigInterface. +// A group's client should implement this interface. +type LabelConfigsGetter interface { + LabelConfigs() LabelConfigInterface +} + +// LabelConfigInterface has methods to work with LabelConfig resources. +type LabelConfigInterface interface { + Create(ctx context.Context, labelConfig *v1.LabelConfig, opts metav1.CreateOptions) (*v1.LabelConfig, error) + Update(ctx context.Context, labelConfig *v1.LabelConfig, opts metav1.UpdateOptions) (*v1.LabelConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.LabelConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.LabelConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LabelConfig, err error) + LabelConfigExpansion +} + +// labelConfigs implements LabelConfigInterface +type labelConfigs struct { + client rest.Interface +} + +// newLabelConfigs returns a LabelConfigs +func newLabelConfigs(c *GlobalTsmV1Client) *labelConfigs { + return &labelConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the labelConfig, and returns the corresponding labelConfig object, and an error if there is any. +func (c *labelConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LabelConfig, err error) { + result = &v1.LabelConfig{} + err = c.client.Get(). + Resource("labelconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of LabelConfigs that match those selectors. +func (c *labelConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LabelConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.LabelConfigList{} + err = c.client.Get(). + Resource("labelconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested labelConfigs. +func (c *labelConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("labelconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a labelConfig and creates it. Returns the server's representation of the labelConfig, and an error, if there is any. +func (c *labelConfigs) Create(ctx context.Context, labelConfig *v1.LabelConfig, opts metav1.CreateOptions) (result *v1.LabelConfig, err error) { + result = &v1.LabelConfig{} + err = c.client.Post(). + Resource("labelconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(labelConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a labelConfig and updates it. Returns the server's representation of the labelConfig, and an error, if there is any. +func (c *labelConfigs) Update(ctx context.Context, labelConfig *v1.LabelConfig, opts metav1.UpdateOptions) (result *v1.LabelConfig, err error) { + result = &v1.LabelConfig{} + err = c.client.Put(). + Resource("labelconfigs"). + Name(labelConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(labelConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the labelConfig and deletes it. Returns an error if one occurs. +func (c *labelConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("labelconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *labelConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("labelconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched labelConfig. +func (c *labelConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LabelConfig, err error) { + result = &v1.LabelConfig{} + err = c.client.Patch(pt). + Resource("labelconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/localregistrationservice.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/localregistrationservice.go new file mode 100644 index 000000000..99b95448e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/localregistrationservice.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// LocalRegistrationServicesGetter has a method to return a LocalRegistrationServiceInterface. +// A group's client should implement this interface. +type LocalRegistrationServicesGetter interface { + LocalRegistrationServices() LocalRegistrationServiceInterface +} + +// LocalRegistrationServiceInterface has methods to work with LocalRegistrationService resources. +type LocalRegistrationServiceInterface interface { + Create(ctx context.Context, localRegistrationService *v1.LocalRegistrationService, opts metav1.CreateOptions) (*v1.LocalRegistrationService, error) + Update(ctx context.Context, localRegistrationService *v1.LocalRegistrationService, opts metav1.UpdateOptions) (*v1.LocalRegistrationService, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.LocalRegistrationService, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.LocalRegistrationServiceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LocalRegistrationService, err error) + LocalRegistrationServiceExpansion +} + +// localRegistrationServices implements LocalRegistrationServiceInterface +type localRegistrationServices struct { + client rest.Interface +} + +// newLocalRegistrationServices returns a LocalRegistrationServices +func newLocalRegistrationServices(c *GlobalTsmV1Client) *localRegistrationServices { + return &localRegistrationServices{ + client: c.RESTClient(), + } +} + +// Get takes name of the localRegistrationService, and returns the corresponding localRegistrationService object, and an error if there is any. +func (c *localRegistrationServices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LocalRegistrationService, err error) { + result = &v1.LocalRegistrationService{} + err = c.client.Get(). + Resource("localregistrationservices"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of LocalRegistrationServices that match those selectors. +func (c *localRegistrationServices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LocalRegistrationServiceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.LocalRegistrationServiceList{} + err = c.client.Get(). + Resource("localregistrationservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested localRegistrationServices. +func (c *localRegistrationServices) Watch(ctx context.Context, opts metav1.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(). + Resource("localregistrationservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a localRegistrationService and creates it. Returns the server's representation of the localRegistrationService, and an error, if there is any. +func (c *localRegistrationServices) Create(ctx context.Context, localRegistrationService *v1.LocalRegistrationService, opts metav1.CreateOptions) (result *v1.LocalRegistrationService, err error) { + result = &v1.LocalRegistrationService{} + err = c.client.Post(). + Resource("localregistrationservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localRegistrationService). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a localRegistrationService and updates it. Returns the server's representation of the localRegistrationService, and an error, if there is any. +func (c *localRegistrationServices) Update(ctx context.Context, localRegistrationService *v1.LocalRegistrationService, opts metav1.UpdateOptions) (result *v1.LocalRegistrationService, err error) { + result = &v1.LocalRegistrationService{} + err = c.client.Put(). + Resource("localregistrationservices"). + Name(localRegistrationService.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localRegistrationService). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the localRegistrationService and deletes it. Returns an error if one occurs. +func (c *localRegistrationServices) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("localregistrationservices"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *localRegistrationServices) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("localregistrationservices"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched localRegistrationService. +func (c *localRegistrationServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LocalRegistrationService, err error) { + result = &v1.LocalRegistrationService{} + err = c.client.Patch(pt). + Resource("localregistrationservices"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/localregistrationservicecluster.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/localregistrationservicecluster.go new file mode 100644 index 000000000..6d339132c --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/localregistrationservicecluster.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// LocalRegistrationServiceClustersGetter has a method to return a LocalRegistrationServiceClusterInterface. +// A group's client should implement this interface. +type LocalRegistrationServiceClustersGetter interface { + LocalRegistrationServiceClusters() LocalRegistrationServiceClusterInterface +} + +// LocalRegistrationServiceClusterInterface has methods to work with LocalRegistrationServiceCluster resources. +type LocalRegistrationServiceClusterInterface interface { + Create(ctx context.Context, localRegistrationServiceCluster *v1.LocalRegistrationServiceCluster, opts metav1.CreateOptions) (*v1.LocalRegistrationServiceCluster, error) + Update(ctx context.Context, localRegistrationServiceCluster *v1.LocalRegistrationServiceCluster, opts metav1.UpdateOptions) (*v1.LocalRegistrationServiceCluster, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.LocalRegistrationServiceCluster, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.LocalRegistrationServiceClusterList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LocalRegistrationServiceCluster, err error) + LocalRegistrationServiceClusterExpansion +} + +// localRegistrationServiceClusters implements LocalRegistrationServiceClusterInterface +type localRegistrationServiceClusters struct { + client rest.Interface +} + +// newLocalRegistrationServiceClusters returns a LocalRegistrationServiceClusters +func newLocalRegistrationServiceClusters(c *GlobalTsmV1Client) *localRegistrationServiceClusters { + return &localRegistrationServiceClusters{ + client: c.RESTClient(), + } +} + +// Get takes name of the localRegistrationServiceCluster, and returns the corresponding localRegistrationServiceCluster object, and an error if there is any. +func (c *localRegistrationServiceClusters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LocalRegistrationServiceCluster, err error) { + result = &v1.LocalRegistrationServiceCluster{} + err = c.client.Get(). + Resource("localregistrationserviceclusters"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of LocalRegistrationServiceClusters that match those selectors. +func (c *localRegistrationServiceClusters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LocalRegistrationServiceClusterList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.LocalRegistrationServiceClusterList{} + err = c.client.Get(). + Resource("localregistrationserviceclusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested localRegistrationServiceClusters. +func (c *localRegistrationServiceClusters) Watch(ctx context.Context, opts metav1.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(). + Resource("localregistrationserviceclusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a localRegistrationServiceCluster and creates it. Returns the server's representation of the localRegistrationServiceCluster, and an error, if there is any. +func (c *localRegistrationServiceClusters) Create(ctx context.Context, localRegistrationServiceCluster *v1.LocalRegistrationServiceCluster, opts metav1.CreateOptions) (result *v1.LocalRegistrationServiceCluster, err error) { + result = &v1.LocalRegistrationServiceCluster{} + err = c.client.Post(). + Resource("localregistrationserviceclusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localRegistrationServiceCluster). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a localRegistrationServiceCluster and updates it. Returns the server's representation of the localRegistrationServiceCluster, and an error, if there is any. +func (c *localRegistrationServiceClusters) Update(ctx context.Context, localRegistrationServiceCluster *v1.LocalRegistrationServiceCluster, opts metav1.UpdateOptions) (result *v1.LocalRegistrationServiceCluster, err error) { + result = &v1.LocalRegistrationServiceCluster{} + err = c.client.Put(). + Resource("localregistrationserviceclusters"). + Name(localRegistrationServiceCluster.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localRegistrationServiceCluster). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the localRegistrationServiceCluster and deletes it. Returns an error if one occurs. +func (c *localRegistrationServiceClusters) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("localregistrationserviceclusters"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *localRegistrationServiceClusters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("localregistrationserviceclusters"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched localRegistrationServiceCluster. +func (c *localRegistrationServiceClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LocalRegistrationServiceCluster, err error) { + result = &v1.LocalRegistrationServiceCluster{} + err = c.client.Patch(pt). + Resource("localregistrationserviceclusters"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/localregistrationserviceresource.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/localregistrationserviceresource.go new file mode 100644 index 000000000..d9b3a4ca0 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/localregistrationserviceresource.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// LocalRegistrationServiceResourcesGetter has a method to return a LocalRegistrationServiceResourceInterface. +// A group's client should implement this interface. +type LocalRegistrationServiceResourcesGetter interface { + LocalRegistrationServiceResources() LocalRegistrationServiceResourceInterface +} + +// LocalRegistrationServiceResourceInterface has methods to work with LocalRegistrationServiceResource resources. +type LocalRegistrationServiceResourceInterface interface { + Create(ctx context.Context, localRegistrationServiceResource *v1.LocalRegistrationServiceResource, opts metav1.CreateOptions) (*v1.LocalRegistrationServiceResource, error) + Update(ctx context.Context, localRegistrationServiceResource *v1.LocalRegistrationServiceResource, opts metav1.UpdateOptions) (*v1.LocalRegistrationServiceResource, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.LocalRegistrationServiceResource, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.LocalRegistrationServiceResourceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LocalRegistrationServiceResource, err error) + LocalRegistrationServiceResourceExpansion +} + +// localRegistrationServiceResources implements LocalRegistrationServiceResourceInterface +type localRegistrationServiceResources struct { + client rest.Interface +} + +// newLocalRegistrationServiceResources returns a LocalRegistrationServiceResources +func newLocalRegistrationServiceResources(c *GlobalTsmV1Client) *localRegistrationServiceResources { + return &localRegistrationServiceResources{ + client: c.RESTClient(), + } +} + +// Get takes name of the localRegistrationServiceResource, and returns the corresponding localRegistrationServiceResource object, and an error if there is any. +func (c *localRegistrationServiceResources) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LocalRegistrationServiceResource, err error) { + result = &v1.LocalRegistrationServiceResource{} + err = c.client.Get(). + Resource("localregistrationserviceresources"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of LocalRegistrationServiceResources that match those selectors. +func (c *localRegistrationServiceResources) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LocalRegistrationServiceResourceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.LocalRegistrationServiceResourceList{} + err = c.client.Get(). + Resource("localregistrationserviceresources"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested localRegistrationServiceResources. +func (c *localRegistrationServiceResources) Watch(ctx context.Context, opts metav1.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(). + Resource("localregistrationserviceresources"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a localRegistrationServiceResource and creates it. Returns the server's representation of the localRegistrationServiceResource, and an error, if there is any. +func (c *localRegistrationServiceResources) Create(ctx context.Context, localRegistrationServiceResource *v1.LocalRegistrationServiceResource, opts metav1.CreateOptions) (result *v1.LocalRegistrationServiceResource, err error) { + result = &v1.LocalRegistrationServiceResource{} + err = c.client.Post(). + Resource("localregistrationserviceresources"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localRegistrationServiceResource). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a localRegistrationServiceResource and updates it. Returns the server's representation of the localRegistrationServiceResource, and an error, if there is any. +func (c *localRegistrationServiceResources) Update(ctx context.Context, localRegistrationServiceResource *v1.LocalRegistrationServiceResource, opts metav1.UpdateOptions) (result *v1.LocalRegistrationServiceResource, err error) { + result = &v1.LocalRegistrationServiceResource{} + err = c.client.Put(). + Resource("localregistrationserviceresources"). + Name(localRegistrationServiceResource.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localRegistrationServiceResource). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the localRegistrationServiceResource and deletes it. Returns an error if one occurs. +func (c *localRegistrationServiceResources) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("localregistrationserviceresources"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *localRegistrationServiceResources) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("localregistrationserviceresources"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched localRegistrationServiceResource. +func (c *localRegistrationServiceResources) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LocalRegistrationServiceResource, err error) { + result = &v1.LocalRegistrationServiceResource{} + err = c.client.Patch(pt). + Resource("localregistrationserviceresources"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/log.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/log.go new file mode 100644 index 000000000..0d24c607a --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/log.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// LogsGetter has a method to return a LogInterface. +// A group's client should implement this interface. +type LogsGetter interface { + Logs() LogInterface +} + +// LogInterface has methods to work with Log resources. +type LogInterface interface { + Create(ctx context.Context, log *v1.Log, opts metav1.CreateOptions) (*v1.Log, error) + Update(ctx context.Context, log *v1.Log, opts metav1.UpdateOptions) (*v1.Log, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Log, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.LogList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Log, err error) + LogExpansion +} + +// logs implements LogInterface +type logs struct { + client rest.Interface +} + +// newLogs returns a Logs +func newLogs(c *GlobalTsmV1Client) *logs { + return &logs{ + client: c.RESTClient(), + } +} + +// Get takes name of the log, and returns the corresponding log object, and an error if there is any. +func (c *logs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Log, err error) { + result = &v1.Log{} + err = c.client.Get(). + Resource("logs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Logs that match those selectors. +func (c *logs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LogList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.LogList{} + err = c.client.Get(). + Resource("logs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested logs. +func (c *logs) Watch(ctx context.Context, opts metav1.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(). + Resource("logs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a log and creates it. Returns the server's representation of the log, and an error, if there is any. +func (c *logs) Create(ctx context.Context, log *v1.Log, opts metav1.CreateOptions) (result *v1.Log, err error) { + result = &v1.Log{} + err = c.client.Post(). + Resource("logs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(log). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a log and updates it. Returns the server's representation of the log, and an error, if there is any. +func (c *logs) Update(ctx context.Context, log *v1.Log, opts metav1.UpdateOptions) (result *v1.Log, err error) { + result = &v1.Log{} + err = c.client.Put(). + Resource("logs"). + Name(log.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(log). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the log and deletes it. Returns an error if one occurs. +func (c *logs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("logs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *logs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("logs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched log. +func (c *logs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Log, err error) { + result = &v1.Log{} + err = c.client.Patch(pt). + Resource("logs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/logfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/logfolder.go new file mode 100644 index 000000000..ef19d7a26 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/logfolder.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// LogFoldersGetter has a method to return a LogFolderInterface. +// A group's client should implement this interface. +type LogFoldersGetter interface { + LogFolders() LogFolderInterface +} + +// LogFolderInterface has methods to work with LogFolder resources. +type LogFolderInterface interface { + Create(ctx context.Context, logFolder *v1.LogFolder, opts metav1.CreateOptions) (*v1.LogFolder, error) + Update(ctx context.Context, logFolder *v1.LogFolder, opts metav1.UpdateOptions) (*v1.LogFolder, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.LogFolder, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.LogFolderList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LogFolder, err error) + LogFolderExpansion +} + +// logFolders implements LogFolderInterface +type logFolders struct { + client rest.Interface +} + +// newLogFolders returns a LogFolders +func newLogFolders(c *GlobalTsmV1Client) *logFolders { + return &logFolders{ + client: c.RESTClient(), + } +} + +// Get takes name of the logFolder, and returns the corresponding logFolder object, and an error if there is any. +func (c *logFolders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LogFolder, err error) { + result = &v1.LogFolder{} + err = c.client.Get(). + Resource("logfolders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of LogFolders that match those selectors. +func (c *logFolders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LogFolderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.LogFolderList{} + err = c.client.Get(). + Resource("logfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested logFolders. +func (c *logFolders) Watch(ctx context.Context, opts metav1.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(). + Resource("logfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a logFolder and creates it. Returns the server's representation of the logFolder, and an error, if there is any. +func (c *logFolders) Create(ctx context.Context, logFolder *v1.LogFolder, opts metav1.CreateOptions) (result *v1.LogFolder, err error) { + result = &v1.LogFolder{} + err = c.client.Post(). + Resource("logfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(logFolder). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a logFolder and updates it. Returns the server's representation of the logFolder, and an error, if there is any. +func (c *logFolders) Update(ctx context.Context, logFolder *v1.LogFolder, opts metav1.UpdateOptions) (result *v1.LogFolder, err error) { + result = &v1.LogFolder{} + err = c.client.Put(). + Resource("logfolders"). + Name(logFolder.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(logFolder). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the logFolder and deletes it. Returns an error if one occurs. +func (c *logFolders) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("logfolders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *logFolders) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("logfolders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched logFolder. +func (c *logFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LogFolder, err error) { + result = &v1.LogFolder{} + err = c.client.Patch(pt). + Resource("logfolders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/metricmonitor.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/metricmonitor.go new file mode 100644 index 000000000..af64973b1 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/metricmonitor.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// MetricMonitorsGetter has a method to return a MetricMonitorInterface. +// A group's client should implement this interface. +type MetricMonitorsGetter interface { + MetricMonitors() MetricMonitorInterface +} + +// MetricMonitorInterface has methods to work with MetricMonitor resources. +type MetricMonitorInterface interface { + Create(ctx context.Context, metricMonitor *v1.MetricMonitor, opts metav1.CreateOptions) (*v1.MetricMonitor, error) + Update(ctx context.Context, metricMonitor *v1.MetricMonitor, opts metav1.UpdateOptions) (*v1.MetricMonitor, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.MetricMonitor, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.MetricMonitorList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MetricMonitor, err error) + MetricMonitorExpansion +} + +// metricMonitors implements MetricMonitorInterface +type metricMonitors struct { + client rest.Interface +} + +// newMetricMonitors returns a MetricMonitors +func newMetricMonitors(c *GlobalTsmV1Client) *metricMonitors { + return &metricMonitors{ + client: c.RESTClient(), + } +} + +// Get takes name of the metricMonitor, and returns the corresponding metricMonitor object, and an error if there is any. +func (c *metricMonitors) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.MetricMonitor, err error) { + result = &v1.MetricMonitor{} + err = c.client.Get(). + Resource("metricmonitors"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of MetricMonitors that match those selectors. +func (c *metricMonitors) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MetricMonitorList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.MetricMonitorList{} + err = c.client.Get(). + Resource("metricmonitors"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested metricMonitors. +func (c *metricMonitors) Watch(ctx context.Context, opts metav1.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(). + Resource("metricmonitors"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a metricMonitor and creates it. Returns the server's representation of the metricMonitor, and an error, if there is any. +func (c *metricMonitors) Create(ctx context.Context, metricMonitor *v1.MetricMonitor, opts metav1.CreateOptions) (result *v1.MetricMonitor, err error) { + result = &v1.MetricMonitor{} + err = c.client.Post(). + Resource("metricmonitors"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(metricMonitor). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a metricMonitor and updates it. Returns the server's representation of the metricMonitor, and an error, if there is any. +func (c *metricMonitors) Update(ctx context.Context, metricMonitor *v1.MetricMonitor, opts metav1.UpdateOptions) (result *v1.MetricMonitor, err error) { + result = &v1.MetricMonitor{} + err = c.client.Put(). + Resource("metricmonitors"). + Name(metricMonitor.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(metricMonitor). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the metricMonitor and deletes it. Returns an error if one occurs. +func (c *metricMonitors) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("metricmonitors"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *metricMonitors) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("metricmonitors"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched metricMonitor. +func (c *metricMonitors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MetricMonitor, err error) { + result = &v1.MetricMonitor{} + err = c.client.Patch(pt). + Resource("metricmonitors"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinition.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinition.go new file mode 100644 index 000000000..1d210ce62 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinition.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// NetworkAttachmentDefinitionsGetter has a method to return a NetworkAttachmentDefinitionInterface. +// A group's client should implement this interface. +type NetworkAttachmentDefinitionsGetter interface { + NetworkAttachmentDefinitions() NetworkAttachmentDefinitionInterface +} + +// NetworkAttachmentDefinitionInterface has methods to work with NetworkAttachmentDefinition resources. +type NetworkAttachmentDefinitionInterface interface { + Create(ctx context.Context, networkAttachmentDefinition *v1.NetworkAttachmentDefinition, opts metav1.CreateOptions) (*v1.NetworkAttachmentDefinition, error) + Update(ctx context.Context, networkAttachmentDefinition *v1.NetworkAttachmentDefinition, opts metav1.UpdateOptions) (*v1.NetworkAttachmentDefinition, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.NetworkAttachmentDefinition, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.NetworkAttachmentDefinitionList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkAttachmentDefinition, err error) + NetworkAttachmentDefinitionExpansion +} + +// networkAttachmentDefinitions implements NetworkAttachmentDefinitionInterface +type networkAttachmentDefinitions struct { + client rest.Interface +} + +// newNetworkAttachmentDefinitions returns a NetworkAttachmentDefinitions +func newNetworkAttachmentDefinitions(c *GlobalTsmV1Client) *networkAttachmentDefinitions { + return &networkAttachmentDefinitions{ + client: c.RESTClient(), + } +} + +// Get takes name of the networkAttachmentDefinition, and returns the corresponding networkAttachmentDefinition object, and an error if there is any. +func (c *networkAttachmentDefinitions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.NetworkAttachmentDefinition, err error) { + result = &v1.NetworkAttachmentDefinition{} + err = c.client.Get(). + Resource("networkattachmentdefinitions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of NetworkAttachmentDefinitions that match those selectors. +func (c *networkAttachmentDefinitions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkAttachmentDefinitionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.NetworkAttachmentDefinitionList{} + err = c.client.Get(). + Resource("networkattachmentdefinitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested networkAttachmentDefinitions. +func (c *networkAttachmentDefinitions) Watch(ctx context.Context, opts metav1.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(). + Resource("networkattachmentdefinitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a networkAttachmentDefinition and creates it. Returns the server's representation of the networkAttachmentDefinition, and an error, if there is any. +func (c *networkAttachmentDefinitions) Create(ctx context.Context, networkAttachmentDefinition *v1.NetworkAttachmentDefinition, opts metav1.CreateOptions) (result *v1.NetworkAttachmentDefinition, err error) { + result = &v1.NetworkAttachmentDefinition{} + err = c.client.Post(). + Resource("networkattachmentdefinitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(networkAttachmentDefinition). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a networkAttachmentDefinition and updates it. Returns the server's representation of the networkAttachmentDefinition, and an error, if there is any. +func (c *networkAttachmentDefinitions) Update(ctx context.Context, networkAttachmentDefinition *v1.NetworkAttachmentDefinition, opts metav1.UpdateOptions) (result *v1.NetworkAttachmentDefinition, err error) { + result = &v1.NetworkAttachmentDefinition{} + err = c.client.Put(). + Resource("networkattachmentdefinitions"). + Name(networkAttachmentDefinition.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(networkAttachmentDefinition). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the networkAttachmentDefinition and deletes it. Returns an error if one occurs. +func (c *networkAttachmentDefinitions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("networkattachmentdefinitions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *networkAttachmentDefinitions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("networkattachmentdefinitions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched networkAttachmentDefinition. +func (c *networkAttachmentDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkAttachmentDefinition, err error) { + result = &v1.NetworkAttachmentDefinition{} + err = c.client.Patch(pt). + Resource("networkattachmentdefinitions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinitionconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinitionconfig.go new file mode 100644 index 000000000..eec947963 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinitionconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// NetworkAttachmentDefinitionConfigsGetter has a method to return a NetworkAttachmentDefinitionConfigInterface. +// A group's client should implement this interface. +type NetworkAttachmentDefinitionConfigsGetter interface { + NetworkAttachmentDefinitionConfigs() NetworkAttachmentDefinitionConfigInterface +} + +// NetworkAttachmentDefinitionConfigInterface has methods to work with NetworkAttachmentDefinitionConfig resources. +type NetworkAttachmentDefinitionConfigInterface interface { + Create(ctx context.Context, networkAttachmentDefinitionConfig *v1.NetworkAttachmentDefinitionConfig, opts metav1.CreateOptions) (*v1.NetworkAttachmentDefinitionConfig, error) + Update(ctx context.Context, networkAttachmentDefinitionConfig *v1.NetworkAttachmentDefinitionConfig, opts metav1.UpdateOptions) (*v1.NetworkAttachmentDefinitionConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.NetworkAttachmentDefinitionConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.NetworkAttachmentDefinitionConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkAttachmentDefinitionConfig, err error) + NetworkAttachmentDefinitionConfigExpansion +} + +// networkAttachmentDefinitionConfigs implements NetworkAttachmentDefinitionConfigInterface +type networkAttachmentDefinitionConfigs struct { + client rest.Interface +} + +// newNetworkAttachmentDefinitionConfigs returns a NetworkAttachmentDefinitionConfigs +func newNetworkAttachmentDefinitionConfigs(c *GlobalTsmV1Client) *networkAttachmentDefinitionConfigs { + return &networkAttachmentDefinitionConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the networkAttachmentDefinitionConfig, and returns the corresponding networkAttachmentDefinitionConfig object, and an error if there is any. +func (c *networkAttachmentDefinitionConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.NetworkAttachmentDefinitionConfig, err error) { + result = &v1.NetworkAttachmentDefinitionConfig{} + err = c.client.Get(). + Resource("networkattachmentdefinitionconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of NetworkAttachmentDefinitionConfigs that match those selectors. +func (c *networkAttachmentDefinitionConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkAttachmentDefinitionConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.NetworkAttachmentDefinitionConfigList{} + err = c.client.Get(). + Resource("networkattachmentdefinitionconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested networkAttachmentDefinitionConfigs. +func (c *networkAttachmentDefinitionConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("networkattachmentdefinitionconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a networkAttachmentDefinitionConfig and creates it. Returns the server's representation of the networkAttachmentDefinitionConfig, and an error, if there is any. +func (c *networkAttachmentDefinitionConfigs) Create(ctx context.Context, networkAttachmentDefinitionConfig *v1.NetworkAttachmentDefinitionConfig, opts metav1.CreateOptions) (result *v1.NetworkAttachmentDefinitionConfig, err error) { + result = &v1.NetworkAttachmentDefinitionConfig{} + err = c.client.Post(). + Resource("networkattachmentdefinitionconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(networkAttachmentDefinitionConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a networkAttachmentDefinitionConfig and updates it. Returns the server's representation of the networkAttachmentDefinitionConfig, and an error, if there is any. +func (c *networkAttachmentDefinitionConfigs) Update(ctx context.Context, networkAttachmentDefinitionConfig *v1.NetworkAttachmentDefinitionConfig, opts metav1.UpdateOptions) (result *v1.NetworkAttachmentDefinitionConfig, err error) { + result = &v1.NetworkAttachmentDefinitionConfig{} + err = c.client.Put(). + Resource("networkattachmentdefinitionconfigs"). + Name(networkAttachmentDefinitionConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(networkAttachmentDefinitionConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the networkAttachmentDefinitionConfig and deletes it. Returns an error if one occurs. +func (c *networkAttachmentDefinitionConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("networkattachmentdefinitionconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *networkAttachmentDefinitionConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("networkattachmentdefinitionconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched networkAttachmentDefinitionConfig. +func (c *networkAttachmentDefinitionConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkAttachmentDefinitionConfig, err error) { + result = &v1.NetworkAttachmentDefinitionConfig{} + err = c.client.Patch(pt). + Resource("networkattachmentdefinitionconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/node.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/node.go new file mode 100644 index 000000000..b84bf1cb3 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/node.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// NodesGetter has a method to return a NodeInterface. +// A group's client should implement this interface. +type NodesGetter interface { + Nodes() NodeInterface +} + +// NodeInterface has methods to work with Node resources. +type NodeInterface interface { + Create(ctx context.Context, node *v1.Node, opts metav1.CreateOptions) (*v1.Node, error) + Update(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (*v1.Node, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Node, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.NodeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Node, err error) + NodeExpansion +} + +// nodes implements NodeInterface +type nodes struct { + client rest.Interface +} + +// newNodes returns a Nodes +func newNodes(c *GlobalTsmV1Client) *nodes { + return &nodes{ + client: c.RESTClient(), + } +} + +// Get takes name of the node, and returns the corresponding node object, and an error if there is any. +func (c *nodes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Node, err error) { + result = &v1.Node{} + err = c.client.Get(). + Resource("nodes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Nodes that match those selectors. +func (c *nodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.NodeList{} + err = c.client.Get(). + Resource("nodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested nodes. +func (c *nodes) Watch(ctx context.Context, opts metav1.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(). + Resource("nodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a node and creates it. Returns the server's representation of the node, and an error, if there is any. +func (c *nodes) Create(ctx context.Context, node *v1.Node, opts metav1.CreateOptions) (result *v1.Node, err error) { + result = &v1.Node{} + err = c.client.Post(). + Resource("nodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(node). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a node and updates it. Returns the server's representation of the node, and an error, if there is any. +func (c *nodes) Update(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (result *v1.Node, err error) { + result = &v1.Node{} + err = c.client.Put(). + Resource("nodes"). + Name(node.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(node). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the node and deletes it. Returns an error if one occurs. +func (c *nodes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("nodes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *nodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("nodes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched node. +func (c *nodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Node, err error) { + result = &v1.Node{} + err = c.client.Patch(pt). + Resource("nodes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodedefinition.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodedefinition.go new file mode 100644 index 000000000..29b43c916 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodedefinition.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// NodeDefinitionsGetter has a method to return a NodeDefinitionInterface. +// A group's client should implement this interface. +type NodeDefinitionsGetter interface { + NodeDefinitions() NodeDefinitionInterface +} + +// NodeDefinitionInterface has methods to work with NodeDefinition resources. +type NodeDefinitionInterface interface { + Create(ctx context.Context, nodeDefinition *v1.NodeDefinition, opts metav1.CreateOptions) (*v1.NodeDefinition, error) + Update(ctx context.Context, nodeDefinition *v1.NodeDefinition, opts metav1.UpdateOptions) (*v1.NodeDefinition, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.NodeDefinition, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.NodeDefinitionList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NodeDefinition, err error) + NodeDefinitionExpansion +} + +// nodeDefinitions implements NodeDefinitionInterface +type nodeDefinitions struct { + client rest.Interface +} + +// newNodeDefinitions returns a NodeDefinitions +func newNodeDefinitions(c *GlobalTsmV1Client) *nodeDefinitions { + return &nodeDefinitions{ + client: c.RESTClient(), + } +} + +// Get takes name of the nodeDefinition, and returns the corresponding nodeDefinition object, and an error if there is any. +func (c *nodeDefinitions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.NodeDefinition, err error) { + result = &v1.NodeDefinition{} + err = c.client.Get(). + Resource("nodedefinitions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of NodeDefinitions that match those selectors. +func (c *nodeDefinitions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeDefinitionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.NodeDefinitionList{} + err = c.client.Get(). + Resource("nodedefinitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested nodeDefinitions. +func (c *nodeDefinitions) Watch(ctx context.Context, opts metav1.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(). + Resource("nodedefinitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a nodeDefinition and creates it. Returns the server's representation of the nodeDefinition, and an error, if there is any. +func (c *nodeDefinitions) Create(ctx context.Context, nodeDefinition *v1.NodeDefinition, opts metav1.CreateOptions) (result *v1.NodeDefinition, err error) { + result = &v1.NodeDefinition{} + err = c.client.Post(). + Resource("nodedefinitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeDefinition). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a nodeDefinition and updates it. Returns the server's representation of the nodeDefinition, and an error, if there is any. +func (c *nodeDefinitions) Update(ctx context.Context, nodeDefinition *v1.NodeDefinition, opts metav1.UpdateOptions) (result *v1.NodeDefinition, err error) { + result = &v1.NodeDefinition{} + err = c.client.Put(). + Resource("nodedefinitions"). + Name(nodeDefinition.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeDefinition). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the nodeDefinition and deletes it. Returns an error if one occurs. +func (c *nodeDefinitions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("nodedefinitions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *nodeDefinitions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("nodedefinitions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched nodeDefinition. +func (c *nodeDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NodeDefinition, err error) { + result = &v1.NodeDefinition{} + err = c.client.Patch(pt). + Resource("nodedefinitions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodefolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodefolder.go new file mode 100644 index 000000000..f659a67bd --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodefolder.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// NodeFoldersGetter has a method to return a NodeFolderInterface. +// A group's client should implement this interface. +type NodeFoldersGetter interface { + NodeFolders() NodeFolderInterface +} + +// NodeFolderInterface has methods to work with NodeFolder resources. +type NodeFolderInterface interface { + Create(ctx context.Context, nodeFolder *v1.NodeFolder, opts metav1.CreateOptions) (*v1.NodeFolder, error) + Update(ctx context.Context, nodeFolder *v1.NodeFolder, opts metav1.UpdateOptions) (*v1.NodeFolder, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.NodeFolder, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.NodeFolderList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NodeFolder, err error) + NodeFolderExpansion +} + +// nodeFolders implements NodeFolderInterface +type nodeFolders struct { + client rest.Interface +} + +// newNodeFolders returns a NodeFolders +func newNodeFolders(c *GlobalTsmV1Client) *nodeFolders { + return &nodeFolders{ + client: c.RESTClient(), + } +} + +// Get takes name of the nodeFolder, and returns the corresponding nodeFolder object, and an error if there is any. +func (c *nodeFolders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.NodeFolder, err error) { + result = &v1.NodeFolder{} + err = c.client.Get(). + Resource("nodefolders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of NodeFolders that match those selectors. +func (c *nodeFolders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeFolderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.NodeFolderList{} + err = c.client.Get(). + Resource("nodefolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested nodeFolders. +func (c *nodeFolders) Watch(ctx context.Context, opts metav1.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(). + Resource("nodefolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a nodeFolder and creates it. Returns the server's representation of the nodeFolder, and an error, if there is any. +func (c *nodeFolders) Create(ctx context.Context, nodeFolder *v1.NodeFolder, opts metav1.CreateOptions) (result *v1.NodeFolder, err error) { + result = &v1.NodeFolder{} + err = c.client.Post(). + Resource("nodefolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeFolder). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a nodeFolder and updates it. Returns the server's representation of the nodeFolder, and an error, if there is any. +func (c *nodeFolders) Update(ctx context.Context, nodeFolder *v1.NodeFolder, opts metav1.UpdateOptions) (result *v1.NodeFolder, err error) { + result = &v1.NodeFolder{} + err = c.client.Put(). + Resource("nodefolders"). + Name(nodeFolder.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeFolder). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the nodeFolder and deletes it. Returns an error if one occurs. +func (c *nodeFolders) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("nodefolders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *nodeFolders) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("nodefolders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched nodeFolder. +func (c *nodeFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NodeFolder, err error) { + result = &v1.NodeFolder{} + err = c.client.Patch(pt). + Resource("nodefolders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodefoldercluster.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodefoldercluster.go new file mode 100644 index 000000000..22c43a97b --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodefoldercluster.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// NodeFolderClustersGetter has a method to return a NodeFolderClusterInterface. +// A group's client should implement this interface. +type NodeFolderClustersGetter interface { + NodeFolderClusters() NodeFolderClusterInterface +} + +// NodeFolderClusterInterface has methods to work with NodeFolderCluster resources. +type NodeFolderClusterInterface interface { + Create(ctx context.Context, nodeFolderCluster *v1.NodeFolderCluster, opts metav1.CreateOptions) (*v1.NodeFolderCluster, error) + Update(ctx context.Context, nodeFolderCluster *v1.NodeFolderCluster, opts metav1.UpdateOptions) (*v1.NodeFolderCluster, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.NodeFolderCluster, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.NodeFolderClusterList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NodeFolderCluster, err error) + NodeFolderClusterExpansion +} + +// nodeFolderClusters implements NodeFolderClusterInterface +type nodeFolderClusters struct { + client rest.Interface +} + +// newNodeFolderClusters returns a NodeFolderClusters +func newNodeFolderClusters(c *GlobalTsmV1Client) *nodeFolderClusters { + return &nodeFolderClusters{ + client: c.RESTClient(), + } +} + +// Get takes name of the nodeFolderCluster, and returns the corresponding nodeFolderCluster object, and an error if there is any. +func (c *nodeFolderClusters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.NodeFolderCluster, err error) { + result = &v1.NodeFolderCluster{} + err = c.client.Get(). + Resource("nodefolderclusters"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of NodeFolderClusters that match those selectors. +func (c *nodeFolderClusters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeFolderClusterList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.NodeFolderClusterList{} + err = c.client.Get(). + Resource("nodefolderclusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested nodeFolderClusters. +func (c *nodeFolderClusters) Watch(ctx context.Context, opts metav1.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(). + Resource("nodefolderclusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a nodeFolderCluster and creates it. Returns the server's representation of the nodeFolderCluster, and an error, if there is any. +func (c *nodeFolderClusters) Create(ctx context.Context, nodeFolderCluster *v1.NodeFolderCluster, opts metav1.CreateOptions) (result *v1.NodeFolderCluster, err error) { + result = &v1.NodeFolderCluster{} + err = c.client.Post(). + Resource("nodefolderclusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeFolderCluster). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a nodeFolderCluster and updates it. Returns the server's representation of the nodeFolderCluster, and an error, if there is any. +func (c *nodeFolderClusters) Update(ctx context.Context, nodeFolderCluster *v1.NodeFolderCluster, opts metav1.UpdateOptions) (result *v1.NodeFolderCluster, err error) { + result = &v1.NodeFolderCluster{} + err = c.client.Put(). + Resource("nodefolderclusters"). + Name(nodeFolderCluster.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeFolderCluster). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the nodeFolderCluster and deletes it. Returns an error if one occurs. +func (c *nodeFolderClusters) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("nodefolderclusters"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *nodeFolderClusters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("nodefolderclusters"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched nodeFolderCluster. +func (c *nodeFolderClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NodeFolderCluster, err error) { + result = &v1.NodeFolderCluster{} + err = c.client.Patch(pt). + Resource("nodefolderclusters"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodegroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodegroup.go new file mode 100644 index 000000000..ce6bfcaae --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodegroup.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// NodeGroupsGetter has a method to return a NodeGroupInterface. +// A group's client should implement this interface. +type NodeGroupsGetter interface { + NodeGroups() NodeGroupInterface +} + +// NodeGroupInterface has methods to work with NodeGroup resources. +type NodeGroupInterface interface { + Create(ctx context.Context, nodeGroup *v1.NodeGroup, opts metav1.CreateOptions) (*v1.NodeGroup, error) + Update(ctx context.Context, nodeGroup *v1.NodeGroup, opts metav1.UpdateOptions) (*v1.NodeGroup, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.NodeGroup, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.NodeGroupList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NodeGroup, err error) + NodeGroupExpansion +} + +// nodeGroups implements NodeGroupInterface +type nodeGroups struct { + client rest.Interface +} + +// newNodeGroups returns a NodeGroups +func newNodeGroups(c *GlobalTsmV1Client) *nodeGroups { + return &nodeGroups{ + client: c.RESTClient(), + } +} + +// Get takes name of the nodeGroup, and returns the corresponding nodeGroup object, and an error if there is any. +func (c *nodeGroups) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.NodeGroup, err error) { + result = &v1.NodeGroup{} + err = c.client.Get(). + Resource("nodegroups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of NodeGroups that match those selectors. +func (c *nodeGroups) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeGroupList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.NodeGroupList{} + err = c.client.Get(). + Resource("nodegroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested nodeGroups. +func (c *nodeGroups) Watch(ctx context.Context, opts metav1.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(). + Resource("nodegroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a nodeGroup and creates it. Returns the server's representation of the nodeGroup, and an error, if there is any. +func (c *nodeGroups) Create(ctx context.Context, nodeGroup *v1.NodeGroup, opts metav1.CreateOptions) (result *v1.NodeGroup, err error) { + result = &v1.NodeGroup{} + err = c.client.Post(). + Resource("nodegroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeGroup). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a nodeGroup and updates it. Returns the server's representation of the nodeGroup, and an error, if there is any. +func (c *nodeGroups) Update(ctx context.Context, nodeGroup *v1.NodeGroup, opts metav1.UpdateOptions) (result *v1.NodeGroup, err error) { + result = &v1.NodeGroup{} + err = c.client.Put(). + Resource("nodegroups"). + Name(nodeGroup.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeGroup). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the nodeGroup and deletes it. Returns an error if one occurs. +func (c *nodeGroups) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("nodegroups"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *nodeGroups) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("nodegroups"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched nodeGroup. +func (c *nodeGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NodeGroup, err error) { + result = &v1.NodeGroup{} + err = c.client.Patch(pt). + Resource("nodegroups"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodestatus.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodestatus.go new file mode 100644 index 000000000..6d1968a68 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodestatus.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// NodeStatusesGetter has a method to return a NodeStatusInterface. +// A group's client should implement this interface. +type NodeStatusesGetter interface { + NodeStatuses() NodeStatusInterface +} + +// NodeStatusInterface has methods to work with NodeStatus resources. +type NodeStatusInterface interface { + Create(ctx context.Context, nodeStatus *v1.NodeStatus, opts metav1.CreateOptions) (*v1.NodeStatus, error) + Update(ctx context.Context, nodeStatus *v1.NodeStatus, opts metav1.UpdateOptions) (*v1.NodeStatus, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.NodeStatus, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.NodeStatusList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NodeStatus, err error) + NodeStatusExpansion +} + +// nodeStatuses implements NodeStatusInterface +type nodeStatuses struct { + client rest.Interface +} + +// newNodeStatuses returns a NodeStatuses +func newNodeStatuses(c *GlobalTsmV1Client) *nodeStatuses { + return &nodeStatuses{ + client: c.RESTClient(), + } +} + +// Get takes name of the nodeStatus, and returns the corresponding nodeStatus object, and an error if there is any. +func (c *nodeStatuses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.NodeStatus, err error) { + result = &v1.NodeStatus{} + err = c.client.Get(). + Resource("nodestatuses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of NodeStatuses that match those selectors. +func (c *nodeStatuses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeStatusList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.NodeStatusList{} + err = c.client.Get(). + Resource("nodestatuses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested nodeStatuses. +func (c *nodeStatuses) Watch(ctx context.Context, opts metav1.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(). + Resource("nodestatuses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a nodeStatus and creates it. Returns the server's representation of the nodeStatus, and an error, if there is any. +func (c *nodeStatuses) Create(ctx context.Context, nodeStatus *v1.NodeStatus, opts metav1.CreateOptions) (result *v1.NodeStatus, err error) { + result = &v1.NodeStatus{} + err = c.client.Post(). + Resource("nodestatuses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeStatus). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a nodeStatus and updates it. Returns the server's representation of the nodeStatus, and an error, if there is any. +func (c *nodeStatuses) Update(ctx context.Context, nodeStatus *v1.NodeStatus, opts metav1.UpdateOptions) (result *v1.NodeStatus, err error) { + result = &v1.NodeStatus{} + err = c.client.Put(). + Resource("nodestatuses"). + Name(nodeStatus.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeStatus). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the nodeStatus and deletes it. Returns an error if one occurs. +func (c *nodeStatuses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("nodestatuses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *nodeStatuses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("nodestatuses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched nodeStatus. +func (c *nodeStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NodeStatus, err error) { + result = &v1.NodeStatus{} + err = c.client.Patch(pt). + Resource("nodestatuses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodetemplate.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodetemplate.go new file mode 100644 index 000000000..1aba3d350 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/nodetemplate.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// NodeTemplatesGetter has a method to return a NodeTemplateInterface. +// A group's client should implement this interface. +type NodeTemplatesGetter interface { + NodeTemplates() NodeTemplateInterface +} + +// NodeTemplateInterface has methods to work with NodeTemplate resources. +type NodeTemplateInterface interface { + Create(ctx context.Context, nodeTemplate *v1.NodeTemplate, opts metav1.CreateOptions) (*v1.NodeTemplate, error) + Update(ctx context.Context, nodeTemplate *v1.NodeTemplate, opts metav1.UpdateOptions) (*v1.NodeTemplate, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.NodeTemplate, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.NodeTemplateList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NodeTemplate, err error) + NodeTemplateExpansion +} + +// nodeTemplates implements NodeTemplateInterface +type nodeTemplates struct { + client rest.Interface +} + +// newNodeTemplates returns a NodeTemplates +func newNodeTemplates(c *GlobalTsmV1Client) *nodeTemplates { + return &nodeTemplates{ + client: c.RESTClient(), + } +} + +// Get takes name of the nodeTemplate, and returns the corresponding nodeTemplate object, and an error if there is any. +func (c *nodeTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.NodeTemplate, err error) { + result = &v1.NodeTemplate{} + err = c.client.Get(). + Resource("nodetemplates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of NodeTemplates that match those selectors. +func (c *nodeTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeTemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.NodeTemplateList{} + err = c.client.Get(). + Resource("nodetemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested nodeTemplates. +func (c *nodeTemplates) Watch(ctx context.Context, opts metav1.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(). + Resource("nodetemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a nodeTemplate and creates it. Returns the server's representation of the nodeTemplate, and an error, if there is any. +func (c *nodeTemplates) Create(ctx context.Context, nodeTemplate *v1.NodeTemplate, opts metav1.CreateOptions) (result *v1.NodeTemplate, err error) { + result = &v1.NodeTemplate{} + err = c.client.Post(). + Resource("nodetemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeTemplate). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a nodeTemplate and updates it. Returns the server's representation of the nodeTemplate, and an error, if there is any. +func (c *nodeTemplates) Update(ctx context.Context, nodeTemplate *v1.NodeTemplate, opts metav1.UpdateOptions) (result *v1.NodeTemplate, err error) { + result = &v1.NodeTemplate{} + err = c.client.Put(). + Resource("nodetemplates"). + Name(nodeTemplate.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeTemplate). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the nodeTemplate and deletes it. Returns an error if one occurs. +func (c *nodeTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("nodetemplates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *nodeTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("nodetemplates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched nodeTemplate. +func (c *nodeTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NodeTemplate, err error) { + result = &v1.NodeTemplate{} + err = c.client.Patch(pt). + Resource("nodetemplates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/outboundauthenticationmode.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/outboundauthenticationmode.go new file mode 100644 index 000000000..623dc0f8f --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/outboundauthenticationmode.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// OutboundAuthenticationModesGetter has a method to return a OutboundAuthenticationModeInterface. +// A group's client should implement this interface. +type OutboundAuthenticationModesGetter interface { + OutboundAuthenticationModes() OutboundAuthenticationModeInterface +} + +// OutboundAuthenticationModeInterface has methods to work with OutboundAuthenticationMode resources. +type OutboundAuthenticationModeInterface interface { + Create(ctx context.Context, outboundAuthenticationMode *v1.OutboundAuthenticationMode, opts metav1.CreateOptions) (*v1.OutboundAuthenticationMode, error) + Update(ctx context.Context, outboundAuthenticationMode *v1.OutboundAuthenticationMode, opts metav1.UpdateOptions) (*v1.OutboundAuthenticationMode, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.OutboundAuthenticationMode, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.OutboundAuthenticationModeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OutboundAuthenticationMode, err error) + OutboundAuthenticationModeExpansion +} + +// outboundAuthenticationModes implements OutboundAuthenticationModeInterface +type outboundAuthenticationModes struct { + client rest.Interface +} + +// newOutboundAuthenticationModes returns a OutboundAuthenticationModes +func newOutboundAuthenticationModes(c *GlobalTsmV1Client) *outboundAuthenticationModes { + return &outboundAuthenticationModes{ + client: c.RESTClient(), + } +} + +// Get takes name of the outboundAuthenticationMode, and returns the corresponding outboundAuthenticationMode object, and an error if there is any. +func (c *outboundAuthenticationModes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.OutboundAuthenticationMode, err error) { + result = &v1.OutboundAuthenticationMode{} + err = c.client.Get(). + Resource("outboundauthenticationmodes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of OutboundAuthenticationModes that match those selectors. +func (c *outboundAuthenticationModes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.OutboundAuthenticationModeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.OutboundAuthenticationModeList{} + err = c.client.Get(). + Resource("outboundauthenticationmodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested outboundAuthenticationModes. +func (c *outboundAuthenticationModes) Watch(ctx context.Context, opts metav1.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(). + Resource("outboundauthenticationmodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a outboundAuthenticationMode and creates it. Returns the server's representation of the outboundAuthenticationMode, and an error, if there is any. +func (c *outboundAuthenticationModes) Create(ctx context.Context, outboundAuthenticationMode *v1.OutboundAuthenticationMode, opts metav1.CreateOptions) (result *v1.OutboundAuthenticationMode, err error) { + result = &v1.OutboundAuthenticationMode{} + err = c.client.Post(). + Resource("outboundauthenticationmodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(outboundAuthenticationMode). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a outboundAuthenticationMode and updates it. Returns the server's representation of the outboundAuthenticationMode, and an error, if there is any. +func (c *outboundAuthenticationModes) Update(ctx context.Context, outboundAuthenticationMode *v1.OutboundAuthenticationMode, opts metav1.UpdateOptions) (result *v1.OutboundAuthenticationMode, err error) { + result = &v1.OutboundAuthenticationMode{} + err = c.client.Put(). + Resource("outboundauthenticationmodes"). + Name(outboundAuthenticationMode.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(outboundAuthenticationMode). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the outboundAuthenticationMode and deletes it. Returns an error if one occurs. +func (c *outboundAuthenticationModes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("outboundauthenticationmodes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *outboundAuthenticationModes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("outboundauthenticationmodes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched outboundAuthenticationMode. +func (c *outboundAuthenticationModes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OutboundAuthenticationMode, err error) { + result = &v1.OutboundAuthenticationMode{} + err = c.client.Patch(pt). + Resource("outboundauthenticationmodes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/peerauthentication.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/peerauthentication.go new file mode 100644 index 000000000..91c513ac9 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/peerauthentication.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// PeerAuthenticationsGetter has a method to return a PeerAuthenticationInterface. +// A group's client should implement this interface. +type PeerAuthenticationsGetter interface { + PeerAuthentications() PeerAuthenticationInterface +} + +// PeerAuthenticationInterface has methods to work with PeerAuthentication resources. +type PeerAuthenticationInterface interface { + Create(ctx context.Context, peerAuthentication *v1.PeerAuthentication, opts metav1.CreateOptions) (*v1.PeerAuthentication, error) + Update(ctx context.Context, peerAuthentication *v1.PeerAuthentication, opts metav1.UpdateOptions) (*v1.PeerAuthentication, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PeerAuthentication, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PeerAuthenticationList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PeerAuthentication, err error) + PeerAuthenticationExpansion +} + +// peerAuthentications implements PeerAuthenticationInterface +type peerAuthentications struct { + client rest.Interface +} + +// newPeerAuthentications returns a PeerAuthentications +func newPeerAuthentications(c *GlobalTsmV1Client) *peerAuthentications { + return &peerAuthentications{ + client: c.RESTClient(), + } +} + +// Get takes name of the peerAuthentication, and returns the corresponding peerAuthentication object, and an error if there is any. +func (c *peerAuthentications) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PeerAuthentication, err error) { + result = &v1.PeerAuthentication{} + err = c.client.Get(). + Resource("peerauthentications"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PeerAuthentications that match those selectors. +func (c *peerAuthentications) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PeerAuthenticationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PeerAuthenticationList{} + err = c.client.Get(). + Resource("peerauthentications"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested peerAuthentications. +func (c *peerAuthentications) Watch(ctx context.Context, opts metav1.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(). + Resource("peerauthentications"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a peerAuthentication and creates it. Returns the server's representation of the peerAuthentication, and an error, if there is any. +func (c *peerAuthentications) Create(ctx context.Context, peerAuthentication *v1.PeerAuthentication, opts metav1.CreateOptions) (result *v1.PeerAuthentication, err error) { + result = &v1.PeerAuthentication{} + err = c.client.Post(). + Resource("peerauthentications"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(peerAuthentication). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a peerAuthentication and updates it. Returns the server's representation of the peerAuthentication, and an error, if there is any. +func (c *peerAuthentications) Update(ctx context.Context, peerAuthentication *v1.PeerAuthentication, opts metav1.UpdateOptions) (result *v1.PeerAuthentication, err error) { + result = &v1.PeerAuthentication{} + err = c.client.Put(). + Resource("peerauthentications"). + Name(peerAuthentication.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(peerAuthentication). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the peerAuthentication and deletes it. Returns an error if one occurs. +func (c *peerAuthentications) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("peerauthentications"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *peerAuthentications) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("peerauthentications"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched peerAuthentication. +func (c *peerAuthentications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PeerAuthentication, err error) { + result = &v1.PeerAuthentication{} + err = c.client.Patch(pt). + Resource("peerauthentications"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/piidiscovery.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/piidiscovery.go new file mode 100644 index 000000000..3200cbac7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/piidiscovery.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// PiiDiscoveriesGetter has a method to return a PiiDiscoveryInterface. +// A group's client should implement this interface. +type PiiDiscoveriesGetter interface { + PiiDiscoveries() PiiDiscoveryInterface +} + +// PiiDiscoveryInterface has methods to work with PiiDiscovery resources. +type PiiDiscoveryInterface interface { + Create(ctx context.Context, piiDiscovery *v1.PiiDiscovery, opts metav1.CreateOptions) (*v1.PiiDiscovery, error) + Update(ctx context.Context, piiDiscovery *v1.PiiDiscovery, opts metav1.UpdateOptions) (*v1.PiiDiscovery, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PiiDiscovery, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PiiDiscoveryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PiiDiscovery, err error) + PiiDiscoveryExpansion +} + +// piiDiscoveries implements PiiDiscoveryInterface +type piiDiscoveries struct { + client rest.Interface +} + +// newPiiDiscoveries returns a PiiDiscoveries +func newPiiDiscoveries(c *GlobalTsmV1Client) *piiDiscoveries { + return &piiDiscoveries{ + client: c.RESTClient(), + } +} + +// Get takes name of the piiDiscovery, and returns the corresponding piiDiscovery object, and an error if there is any. +func (c *piiDiscoveries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PiiDiscovery, err error) { + result = &v1.PiiDiscovery{} + err = c.client.Get(). + Resource("piidiscoveries"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PiiDiscoveries that match those selectors. +func (c *piiDiscoveries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PiiDiscoveryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PiiDiscoveryList{} + err = c.client.Get(). + Resource("piidiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested piiDiscoveries. +func (c *piiDiscoveries) Watch(ctx context.Context, opts metav1.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(). + Resource("piidiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a piiDiscovery and creates it. Returns the server's representation of the piiDiscovery, and an error, if there is any. +func (c *piiDiscoveries) Create(ctx context.Context, piiDiscovery *v1.PiiDiscovery, opts metav1.CreateOptions) (result *v1.PiiDiscovery, err error) { + result = &v1.PiiDiscovery{} + err = c.client.Post(). + Resource("piidiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(piiDiscovery). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a piiDiscovery and updates it. Returns the server's representation of the piiDiscovery, and an error, if there is any. +func (c *piiDiscoveries) Update(ctx context.Context, piiDiscovery *v1.PiiDiscovery, opts metav1.UpdateOptions) (result *v1.PiiDiscovery, err error) { + result = &v1.PiiDiscovery{} + err = c.client.Put(). + Resource("piidiscoveries"). + Name(piiDiscovery.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(piiDiscovery). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the piiDiscovery and deletes it. Returns an error if one occurs. +func (c *piiDiscoveries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("piidiscoveries"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *piiDiscoveries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("piidiscoveries"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched piiDiscovery. +func (c *piiDiscoveries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PiiDiscovery, err error) { + result = &v1.PiiDiscovery{} + err = c.client.Patch(pt). + Resource("piidiscoveries"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/piidiscoveryrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/piidiscoveryrt.go new file mode 100644 index 000000000..301641ae0 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/piidiscoveryrt.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// PiiDiscoveryRTsGetter has a method to return a PiiDiscoveryRTInterface. +// A group's client should implement this interface. +type PiiDiscoveryRTsGetter interface { + PiiDiscoveryRTs() PiiDiscoveryRTInterface +} + +// PiiDiscoveryRTInterface has methods to work with PiiDiscoveryRT resources. +type PiiDiscoveryRTInterface interface { + Create(ctx context.Context, piiDiscoveryRT *v1.PiiDiscoveryRT, opts metav1.CreateOptions) (*v1.PiiDiscoveryRT, error) + Update(ctx context.Context, piiDiscoveryRT *v1.PiiDiscoveryRT, opts metav1.UpdateOptions) (*v1.PiiDiscoveryRT, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PiiDiscoveryRT, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PiiDiscoveryRTList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PiiDiscoveryRT, err error) + PiiDiscoveryRTExpansion +} + +// piiDiscoveryRTs implements PiiDiscoveryRTInterface +type piiDiscoveryRTs struct { + client rest.Interface +} + +// newPiiDiscoveryRTs returns a PiiDiscoveryRTs +func newPiiDiscoveryRTs(c *GlobalTsmV1Client) *piiDiscoveryRTs { + return &piiDiscoveryRTs{ + client: c.RESTClient(), + } +} + +// Get takes name of the piiDiscoveryRT, and returns the corresponding piiDiscoveryRT object, and an error if there is any. +func (c *piiDiscoveryRTs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PiiDiscoveryRT, err error) { + result = &v1.PiiDiscoveryRT{} + err = c.client.Get(). + Resource("piidiscoveryrts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PiiDiscoveryRTs that match those selectors. +func (c *piiDiscoveryRTs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PiiDiscoveryRTList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PiiDiscoveryRTList{} + err = c.client.Get(). + Resource("piidiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested piiDiscoveryRTs. +func (c *piiDiscoveryRTs) Watch(ctx context.Context, opts metav1.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(). + Resource("piidiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a piiDiscoveryRT and creates it. Returns the server's representation of the piiDiscoveryRT, and an error, if there is any. +func (c *piiDiscoveryRTs) Create(ctx context.Context, piiDiscoveryRT *v1.PiiDiscoveryRT, opts metav1.CreateOptions) (result *v1.PiiDiscoveryRT, err error) { + result = &v1.PiiDiscoveryRT{} + err = c.client.Post(). + Resource("piidiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(piiDiscoveryRT). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a piiDiscoveryRT and updates it. Returns the server's representation of the piiDiscoveryRT, and an error, if there is any. +func (c *piiDiscoveryRTs) Update(ctx context.Context, piiDiscoveryRT *v1.PiiDiscoveryRT, opts metav1.UpdateOptions) (result *v1.PiiDiscoveryRT, err error) { + result = &v1.PiiDiscoveryRT{} + err = c.client.Put(). + Resource("piidiscoveryrts"). + Name(piiDiscoveryRT.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(piiDiscoveryRT). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the piiDiscoveryRT and deletes it. Returns an error if one occurs. +func (c *piiDiscoveryRTs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("piidiscoveryrts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *piiDiscoveryRTs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("piidiscoveryrts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched piiDiscoveryRT. +func (c *piiDiscoveryRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PiiDiscoveryRT, err error) { + result = &v1.PiiDiscoveryRT{} + err = c.client.Patch(pt). + Resource("piidiscoveryrts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/policyconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/policyconfig.go new file mode 100644 index 000000000..8f73c2d82 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/policyconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// PolicyConfigsGetter has a method to return a PolicyConfigInterface. +// A group's client should implement this interface. +type PolicyConfigsGetter interface { + PolicyConfigs() PolicyConfigInterface +} + +// PolicyConfigInterface has methods to work with PolicyConfig resources. +type PolicyConfigInterface interface { + Create(ctx context.Context, policyConfig *v1.PolicyConfig, opts metav1.CreateOptions) (*v1.PolicyConfig, error) + Update(ctx context.Context, policyConfig *v1.PolicyConfig, opts metav1.UpdateOptions) (*v1.PolicyConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PolicyConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PolicyConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PolicyConfig, err error) + PolicyConfigExpansion +} + +// policyConfigs implements PolicyConfigInterface +type policyConfigs struct { + client rest.Interface +} + +// newPolicyConfigs returns a PolicyConfigs +func newPolicyConfigs(c *GlobalTsmV1Client) *policyConfigs { + return &policyConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the policyConfig, and returns the corresponding policyConfig object, and an error if there is any. +func (c *policyConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PolicyConfig, err error) { + result = &v1.PolicyConfig{} + err = c.client.Get(). + Resource("policyconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PolicyConfigs that match those selectors. +func (c *policyConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PolicyConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PolicyConfigList{} + err = c.client.Get(). + Resource("policyconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested policyConfigs. +func (c *policyConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("policyconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a policyConfig and creates it. Returns the server's representation of the policyConfig, and an error, if there is any. +func (c *policyConfigs) Create(ctx context.Context, policyConfig *v1.PolicyConfig, opts metav1.CreateOptions) (result *v1.PolicyConfig, err error) { + result = &v1.PolicyConfig{} + err = c.client.Post(). + Resource("policyconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(policyConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a policyConfig and updates it. Returns the server's representation of the policyConfig, and an error, if there is any. +func (c *policyConfigs) Update(ctx context.Context, policyConfig *v1.PolicyConfig, opts metav1.UpdateOptions) (result *v1.PolicyConfig, err error) { + result = &v1.PolicyConfig{} + err = c.client.Put(). + Resource("policyconfigs"). + Name(policyConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(policyConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the policyConfig and deletes it. Returns an error if one occurs. +func (c *policyConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("policyconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *policyConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("policyconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched policyConfig. +func (c *policyConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PolicyConfig, err error) { + result = &v1.PolicyConfig{} + err = c.client.Patch(pt). + Resource("policyconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/policytemplate.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/policytemplate.go new file mode 100644 index 000000000..e4336f4b5 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/policytemplate.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// PolicyTemplatesGetter has a method to return a PolicyTemplateInterface. +// A group's client should implement this interface. +type PolicyTemplatesGetter interface { + PolicyTemplates() PolicyTemplateInterface +} + +// PolicyTemplateInterface has methods to work with PolicyTemplate resources. +type PolicyTemplateInterface interface { + Create(ctx context.Context, policyTemplate *v1.PolicyTemplate, opts metav1.CreateOptions) (*v1.PolicyTemplate, error) + Update(ctx context.Context, policyTemplate *v1.PolicyTemplate, opts metav1.UpdateOptions) (*v1.PolicyTemplate, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PolicyTemplate, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PolicyTemplateList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PolicyTemplate, err error) + PolicyTemplateExpansion +} + +// policyTemplates implements PolicyTemplateInterface +type policyTemplates struct { + client rest.Interface +} + +// newPolicyTemplates returns a PolicyTemplates +func newPolicyTemplates(c *GlobalTsmV1Client) *policyTemplates { + return &policyTemplates{ + client: c.RESTClient(), + } +} + +// Get takes name of the policyTemplate, and returns the corresponding policyTemplate object, and an error if there is any. +func (c *policyTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PolicyTemplate, err error) { + result = &v1.PolicyTemplate{} + err = c.client.Get(). + Resource("policytemplates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PolicyTemplates that match those selectors. +func (c *policyTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PolicyTemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PolicyTemplateList{} + err = c.client.Get(). + Resource("policytemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested policyTemplates. +func (c *policyTemplates) Watch(ctx context.Context, opts metav1.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(). + Resource("policytemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a policyTemplate and creates it. Returns the server's representation of the policyTemplate, and an error, if there is any. +func (c *policyTemplates) Create(ctx context.Context, policyTemplate *v1.PolicyTemplate, opts metav1.CreateOptions) (result *v1.PolicyTemplate, err error) { + result = &v1.PolicyTemplate{} + err = c.client.Post(). + Resource("policytemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(policyTemplate). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a policyTemplate and updates it. Returns the server's representation of the policyTemplate, and an error, if there is any. +func (c *policyTemplates) Update(ctx context.Context, policyTemplate *v1.PolicyTemplate, opts metav1.UpdateOptions) (result *v1.PolicyTemplate, err error) { + result = &v1.PolicyTemplate{} + err = c.client.Put(). + Resource("policytemplates"). + Name(policyTemplate.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(policyTemplate). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the policyTemplate and deletes it. Returns an error if one occurs. +func (c *policyTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("policytemplates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *policyTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("policytemplates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched policyTemplate. +func (c *policyTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PolicyTemplate, err error) { + result = &v1.PolicyTemplate{} + err = c.client.Patch(pt). + Resource("policytemplates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/progressiveupgrade.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/progressiveupgrade.go new file mode 100644 index 000000000..8abc62125 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/progressiveupgrade.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ProgressiveUpgradesGetter has a method to return a ProgressiveUpgradeInterface. +// A group's client should implement this interface. +type ProgressiveUpgradesGetter interface { + ProgressiveUpgrades() ProgressiveUpgradeInterface +} + +// ProgressiveUpgradeInterface has methods to work with ProgressiveUpgrade resources. +type ProgressiveUpgradeInterface interface { + Create(ctx context.Context, progressiveUpgrade *v1.ProgressiveUpgrade, opts metav1.CreateOptions) (*v1.ProgressiveUpgrade, error) + Update(ctx context.Context, progressiveUpgrade *v1.ProgressiveUpgrade, opts metav1.UpdateOptions) (*v1.ProgressiveUpgrade, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ProgressiveUpgrade, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ProgressiveUpgradeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ProgressiveUpgrade, err error) + ProgressiveUpgradeExpansion +} + +// progressiveUpgrades implements ProgressiveUpgradeInterface +type progressiveUpgrades struct { + client rest.Interface +} + +// newProgressiveUpgrades returns a ProgressiveUpgrades +func newProgressiveUpgrades(c *GlobalTsmV1Client) *progressiveUpgrades { + return &progressiveUpgrades{ + client: c.RESTClient(), + } +} + +// Get takes name of the progressiveUpgrade, and returns the corresponding progressiveUpgrade object, and an error if there is any. +func (c *progressiveUpgrades) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ProgressiveUpgrade, err error) { + result = &v1.ProgressiveUpgrade{} + err = c.client.Get(). + Resource("progressiveupgrades"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ProgressiveUpgrades that match those selectors. +func (c *progressiveUpgrades) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProgressiveUpgradeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ProgressiveUpgradeList{} + err = c.client.Get(). + Resource("progressiveupgrades"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested progressiveUpgrades. +func (c *progressiveUpgrades) Watch(ctx context.Context, opts metav1.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(). + Resource("progressiveupgrades"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a progressiveUpgrade and creates it. Returns the server's representation of the progressiveUpgrade, and an error, if there is any. +func (c *progressiveUpgrades) Create(ctx context.Context, progressiveUpgrade *v1.ProgressiveUpgrade, opts metav1.CreateOptions) (result *v1.ProgressiveUpgrade, err error) { + result = &v1.ProgressiveUpgrade{} + err = c.client.Post(). + Resource("progressiveupgrades"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(progressiveUpgrade). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a progressiveUpgrade and updates it. Returns the server's representation of the progressiveUpgrade, and an error, if there is any. +func (c *progressiveUpgrades) Update(ctx context.Context, progressiveUpgrade *v1.ProgressiveUpgrade, opts metav1.UpdateOptions) (result *v1.ProgressiveUpgrade, err error) { + result = &v1.ProgressiveUpgrade{} + err = c.client.Put(). + Resource("progressiveupgrades"). + Name(progressiveUpgrade.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(progressiveUpgrade). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the progressiveUpgrade and deletes it. Returns an error if one occurs. +func (c *progressiveUpgrades) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("progressiveupgrades"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *progressiveUpgrades) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("progressiveupgrades"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched progressiveUpgrade. +func (c *progressiveUpgrades) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ProgressiveUpgrade, err error) { + result = &v1.ProgressiveUpgrade{} + err = c.client.Patch(pt). + Resource("progressiveupgrades"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/progressiveupgradeconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/progressiveupgradeconfig.go new file mode 100644 index 000000000..e56b45e0f --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/progressiveupgradeconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ProgressiveUpgradeConfigsGetter has a method to return a ProgressiveUpgradeConfigInterface. +// A group's client should implement this interface. +type ProgressiveUpgradeConfigsGetter interface { + ProgressiveUpgradeConfigs() ProgressiveUpgradeConfigInterface +} + +// ProgressiveUpgradeConfigInterface has methods to work with ProgressiveUpgradeConfig resources. +type ProgressiveUpgradeConfigInterface interface { + Create(ctx context.Context, progressiveUpgradeConfig *v1.ProgressiveUpgradeConfig, opts metav1.CreateOptions) (*v1.ProgressiveUpgradeConfig, error) + Update(ctx context.Context, progressiveUpgradeConfig *v1.ProgressiveUpgradeConfig, opts metav1.UpdateOptions) (*v1.ProgressiveUpgradeConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ProgressiveUpgradeConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ProgressiveUpgradeConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ProgressiveUpgradeConfig, err error) + ProgressiveUpgradeConfigExpansion +} + +// progressiveUpgradeConfigs implements ProgressiveUpgradeConfigInterface +type progressiveUpgradeConfigs struct { + client rest.Interface +} + +// newProgressiveUpgradeConfigs returns a ProgressiveUpgradeConfigs +func newProgressiveUpgradeConfigs(c *GlobalTsmV1Client) *progressiveUpgradeConfigs { + return &progressiveUpgradeConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the progressiveUpgradeConfig, and returns the corresponding progressiveUpgradeConfig object, and an error if there is any. +func (c *progressiveUpgradeConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ProgressiveUpgradeConfig, err error) { + result = &v1.ProgressiveUpgradeConfig{} + err = c.client.Get(). + Resource("progressiveupgradeconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ProgressiveUpgradeConfigs that match those selectors. +func (c *progressiveUpgradeConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProgressiveUpgradeConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ProgressiveUpgradeConfigList{} + err = c.client.Get(). + Resource("progressiveupgradeconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested progressiveUpgradeConfigs. +func (c *progressiveUpgradeConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("progressiveupgradeconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a progressiveUpgradeConfig and creates it. Returns the server's representation of the progressiveUpgradeConfig, and an error, if there is any. +func (c *progressiveUpgradeConfigs) Create(ctx context.Context, progressiveUpgradeConfig *v1.ProgressiveUpgradeConfig, opts metav1.CreateOptions) (result *v1.ProgressiveUpgradeConfig, err error) { + result = &v1.ProgressiveUpgradeConfig{} + err = c.client.Post(). + Resource("progressiveupgradeconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(progressiveUpgradeConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a progressiveUpgradeConfig and updates it. Returns the server's representation of the progressiveUpgradeConfig, and an error, if there is any. +func (c *progressiveUpgradeConfigs) Update(ctx context.Context, progressiveUpgradeConfig *v1.ProgressiveUpgradeConfig, opts metav1.UpdateOptions) (result *v1.ProgressiveUpgradeConfig, err error) { + result = &v1.ProgressiveUpgradeConfig{} + err = c.client.Put(). + Resource("progressiveupgradeconfigs"). + Name(progressiveUpgradeConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(progressiveUpgradeConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the progressiveUpgradeConfig and deletes it. Returns an error if one occurs. +func (c *progressiveUpgradeConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("progressiveupgradeconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *progressiveUpgradeConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("progressiveupgradeconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched progressiveUpgradeConfig. +func (c *progressiveUpgradeConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ProgressiveUpgradeConfig, err error) { + result = &v1.ProgressiveUpgradeConfig{} + err = c.client.Patch(pt). + Resource("progressiveupgradeconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/progressiveupgradefolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/progressiveupgradefolder.go new file mode 100644 index 000000000..cfe169ae1 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/progressiveupgradefolder.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ProgressiveUpgradeFoldersGetter has a method to return a ProgressiveUpgradeFolderInterface. +// A group's client should implement this interface. +type ProgressiveUpgradeFoldersGetter interface { + ProgressiveUpgradeFolders() ProgressiveUpgradeFolderInterface +} + +// ProgressiveUpgradeFolderInterface has methods to work with ProgressiveUpgradeFolder resources. +type ProgressiveUpgradeFolderInterface interface { + Create(ctx context.Context, progressiveUpgradeFolder *v1.ProgressiveUpgradeFolder, opts metav1.CreateOptions) (*v1.ProgressiveUpgradeFolder, error) + Update(ctx context.Context, progressiveUpgradeFolder *v1.ProgressiveUpgradeFolder, opts metav1.UpdateOptions) (*v1.ProgressiveUpgradeFolder, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ProgressiveUpgradeFolder, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ProgressiveUpgradeFolderList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ProgressiveUpgradeFolder, err error) + ProgressiveUpgradeFolderExpansion +} + +// progressiveUpgradeFolders implements ProgressiveUpgradeFolderInterface +type progressiveUpgradeFolders struct { + client rest.Interface +} + +// newProgressiveUpgradeFolders returns a ProgressiveUpgradeFolders +func newProgressiveUpgradeFolders(c *GlobalTsmV1Client) *progressiveUpgradeFolders { + return &progressiveUpgradeFolders{ + client: c.RESTClient(), + } +} + +// Get takes name of the progressiveUpgradeFolder, and returns the corresponding progressiveUpgradeFolder object, and an error if there is any. +func (c *progressiveUpgradeFolders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ProgressiveUpgradeFolder, err error) { + result = &v1.ProgressiveUpgradeFolder{} + err = c.client.Get(). + Resource("progressiveupgradefolders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ProgressiveUpgradeFolders that match those selectors. +func (c *progressiveUpgradeFolders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProgressiveUpgradeFolderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ProgressiveUpgradeFolderList{} + err = c.client.Get(). + Resource("progressiveupgradefolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested progressiveUpgradeFolders. +func (c *progressiveUpgradeFolders) Watch(ctx context.Context, opts metav1.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(). + Resource("progressiveupgradefolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a progressiveUpgradeFolder and creates it. Returns the server's representation of the progressiveUpgradeFolder, and an error, if there is any. +func (c *progressiveUpgradeFolders) Create(ctx context.Context, progressiveUpgradeFolder *v1.ProgressiveUpgradeFolder, opts metav1.CreateOptions) (result *v1.ProgressiveUpgradeFolder, err error) { + result = &v1.ProgressiveUpgradeFolder{} + err = c.client.Post(). + Resource("progressiveupgradefolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(progressiveUpgradeFolder). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a progressiveUpgradeFolder and updates it. Returns the server's representation of the progressiveUpgradeFolder, and an error, if there is any. +func (c *progressiveUpgradeFolders) Update(ctx context.Context, progressiveUpgradeFolder *v1.ProgressiveUpgradeFolder, opts metav1.UpdateOptions) (result *v1.ProgressiveUpgradeFolder, err error) { + result = &v1.ProgressiveUpgradeFolder{} + err = c.client.Put(). + Resource("progressiveupgradefolders"). + Name(progressiveUpgradeFolder.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(progressiveUpgradeFolder). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the progressiveUpgradeFolder and deletes it. Returns an error if one occurs. +func (c *progressiveUpgradeFolders) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("progressiveupgradefolders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *progressiveUpgradeFolders) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("progressiveupgradefolders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched progressiveUpgradeFolder. +func (c *progressiveUpgradeFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ProgressiveUpgradeFolder, err error) { + result = &v1.ProgressiveUpgradeFolder{} + err = c.client.Patch(pt). + Resource("progressiveupgradefolders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/progressiveupgraderuntime.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/progressiveupgraderuntime.go new file mode 100644 index 000000000..bd3a2009f --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/progressiveupgraderuntime.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ProgressiveUpgradeRuntimesGetter has a method to return a ProgressiveUpgradeRuntimeInterface. +// A group's client should implement this interface. +type ProgressiveUpgradeRuntimesGetter interface { + ProgressiveUpgradeRuntimes() ProgressiveUpgradeRuntimeInterface +} + +// ProgressiveUpgradeRuntimeInterface has methods to work with ProgressiveUpgradeRuntime resources. +type ProgressiveUpgradeRuntimeInterface interface { + Create(ctx context.Context, progressiveUpgradeRuntime *v1.ProgressiveUpgradeRuntime, opts metav1.CreateOptions) (*v1.ProgressiveUpgradeRuntime, error) + Update(ctx context.Context, progressiveUpgradeRuntime *v1.ProgressiveUpgradeRuntime, opts metav1.UpdateOptions) (*v1.ProgressiveUpgradeRuntime, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ProgressiveUpgradeRuntime, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ProgressiveUpgradeRuntimeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ProgressiveUpgradeRuntime, err error) + ProgressiveUpgradeRuntimeExpansion +} + +// progressiveUpgradeRuntimes implements ProgressiveUpgradeRuntimeInterface +type progressiveUpgradeRuntimes struct { + client rest.Interface +} + +// newProgressiveUpgradeRuntimes returns a ProgressiveUpgradeRuntimes +func newProgressiveUpgradeRuntimes(c *GlobalTsmV1Client) *progressiveUpgradeRuntimes { + return &progressiveUpgradeRuntimes{ + client: c.RESTClient(), + } +} + +// Get takes name of the progressiveUpgradeRuntime, and returns the corresponding progressiveUpgradeRuntime object, and an error if there is any. +func (c *progressiveUpgradeRuntimes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ProgressiveUpgradeRuntime, err error) { + result = &v1.ProgressiveUpgradeRuntime{} + err = c.client.Get(). + Resource("progressiveupgraderuntimes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ProgressiveUpgradeRuntimes that match those selectors. +func (c *progressiveUpgradeRuntimes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProgressiveUpgradeRuntimeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ProgressiveUpgradeRuntimeList{} + err = c.client.Get(). + Resource("progressiveupgraderuntimes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested progressiveUpgradeRuntimes. +func (c *progressiveUpgradeRuntimes) Watch(ctx context.Context, opts metav1.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(). + Resource("progressiveupgraderuntimes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a progressiveUpgradeRuntime and creates it. Returns the server's representation of the progressiveUpgradeRuntime, and an error, if there is any. +func (c *progressiveUpgradeRuntimes) Create(ctx context.Context, progressiveUpgradeRuntime *v1.ProgressiveUpgradeRuntime, opts metav1.CreateOptions) (result *v1.ProgressiveUpgradeRuntime, err error) { + result = &v1.ProgressiveUpgradeRuntime{} + err = c.client.Post(). + Resource("progressiveupgraderuntimes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(progressiveUpgradeRuntime). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a progressiveUpgradeRuntime and updates it. Returns the server's representation of the progressiveUpgradeRuntime, and an error, if there is any. +func (c *progressiveUpgradeRuntimes) Update(ctx context.Context, progressiveUpgradeRuntime *v1.ProgressiveUpgradeRuntime, opts metav1.UpdateOptions) (result *v1.ProgressiveUpgradeRuntime, err error) { + result = &v1.ProgressiveUpgradeRuntime{} + err = c.client.Put(). + Resource("progressiveupgraderuntimes"). + Name(progressiveUpgradeRuntime.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(progressiveUpgradeRuntime). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the progressiveUpgradeRuntime and deletes it. Returns an error if one occurs. +func (c *progressiveUpgradeRuntimes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("progressiveupgraderuntimes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *progressiveUpgradeRuntimes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("progressiveupgraderuntimes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched progressiveUpgradeRuntime. +func (c *progressiveUpgradeRuntimes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ProgressiveUpgradeRuntime, err error) { + result = &v1.ProgressiveUpgradeRuntime{} + err = c.client.Patch(pt). + Resource("progressiveupgraderuntimes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/project.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/project.go new file mode 100644 index 000000000..f9891362a --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/project.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ProjectsGetter has a method to return a ProjectInterface. +// A group's client should implement this interface. +type ProjectsGetter interface { + Projects() ProjectInterface +} + +// ProjectInterface has methods to work with Project resources. +type ProjectInterface interface { + Create(ctx context.Context, project *v1.Project, opts metav1.CreateOptions) (*v1.Project, error) + Update(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (*v1.Project, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Project, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ProjectList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Project, err error) + ProjectExpansion +} + +// projects implements ProjectInterface +type projects struct { + client rest.Interface +} + +// newProjects returns a Projects +func newProjects(c *GlobalTsmV1Client) *projects { + return &projects{ + client: c.RESTClient(), + } +} + +// Get takes name of the project, and returns the corresponding project object, and an error if there is any. +func (c *projects) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Project, err error) { + result = &v1.Project{} + err = c.client.Get(). + Resource("projects"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Projects that match those selectors. +func (c *projects) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProjectList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ProjectList{} + err = c.client.Get(). + Resource("projects"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested projects. +func (c *projects) Watch(ctx context.Context, opts metav1.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(). + Resource("projects"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a project and creates it. Returns the server's representation of the project, and an error, if there is any. +func (c *projects) Create(ctx context.Context, project *v1.Project, opts metav1.CreateOptions) (result *v1.Project, err error) { + result = &v1.Project{} + err = c.client.Post(). + Resource("projects"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(project). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a project and updates it. Returns the server's representation of the project, and an error, if there is any. +func (c *projects) Update(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (result *v1.Project, err error) { + result = &v1.Project{} + err = c.client.Put(). + Resource("projects"). + Name(project.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(project). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the project and deletes it. Returns an error if one occurs. +func (c *projects) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("projects"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *projects) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("projects"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched project. +func (c *projects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Project, err error) { + result = &v1.Project{} + err = c.client.Patch(pt). + Resource("projects"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/projectconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/projectconfig.go new file mode 100644 index 000000000..e48e8bb58 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/projectconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ProjectConfigsGetter has a method to return a ProjectConfigInterface. +// A group's client should implement this interface. +type ProjectConfigsGetter interface { + ProjectConfigs() ProjectConfigInterface +} + +// ProjectConfigInterface has methods to work with ProjectConfig resources. +type ProjectConfigInterface interface { + Create(ctx context.Context, projectConfig *v1.ProjectConfig, opts metav1.CreateOptions) (*v1.ProjectConfig, error) + Update(ctx context.Context, projectConfig *v1.ProjectConfig, opts metav1.UpdateOptions) (*v1.ProjectConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ProjectConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ProjectConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ProjectConfig, err error) + ProjectConfigExpansion +} + +// projectConfigs implements ProjectConfigInterface +type projectConfigs struct { + client rest.Interface +} + +// newProjectConfigs returns a ProjectConfigs +func newProjectConfigs(c *GlobalTsmV1Client) *projectConfigs { + return &projectConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the projectConfig, and returns the corresponding projectConfig object, and an error if there is any. +func (c *projectConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ProjectConfig, err error) { + result = &v1.ProjectConfig{} + err = c.client.Get(). + Resource("projectconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ProjectConfigs that match those selectors. +func (c *projectConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProjectConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ProjectConfigList{} + err = c.client.Get(). + Resource("projectconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested projectConfigs. +func (c *projectConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("projectconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a projectConfig and creates it. Returns the server's representation of the projectConfig, and an error, if there is any. +func (c *projectConfigs) Create(ctx context.Context, projectConfig *v1.ProjectConfig, opts metav1.CreateOptions) (result *v1.ProjectConfig, err error) { + result = &v1.ProjectConfig{} + err = c.client.Post(). + Resource("projectconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a projectConfig and updates it. Returns the server's representation of the projectConfig, and an error, if there is any. +func (c *projectConfigs) Update(ctx context.Context, projectConfig *v1.ProjectConfig, opts metav1.UpdateOptions) (result *v1.ProjectConfig, err error) { + result = &v1.ProjectConfig{} + err = c.client.Put(). + Resource("projectconfigs"). + Name(projectConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the projectConfig and deletes it. Returns an error if one occurs. +func (c *projectConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("projectconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *projectConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("projectconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched projectConfig. +func (c *projectConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ProjectConfig, err error) { + result = &v1.ProjectConfig{} + err = c.client.Patch(pt). + Resource("projectconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/projectinventory.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/projectinventory.go new file mode 100644 index 000000000..203a0b417 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/projectinventory.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ProjectInventoriesGetter has a method to return a ProjectInventoryInterface. +// A group's client should implement this interface. +type ProjectInventoriesGetter interface { + ProjectInventories() ProjectInventoryInterface +} + +// ProjectInventoryInterface has methods to work with ProjectInventory resources. +type ProjectInventoryInterface interface { + Create(ctx context.Context, projectInventory *v1.ProjectInventory, opts metav1.CreateOptions) (*v1.ProjectInventory, error) + Update(ctx context.Context, projectInventory *v1.ProjectInventory, opts metav1.UpdateOptions) (*v1.ProjectInventory, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ProjectInventory, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ProjectInventoryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ProjectInventory, err error) + ProjectInventoryExpansion +} + +// projectInventories implements ProjectInventoryInterface +type projectInventories struct { + client rest.Interface +} + +// newProjectInventories returns a ProjectInventories +func newProjectInventories(c *GlobalTsmV1Client) *projectInventories { + return &projectInventories{ + client: c.RESTClient(), + } +} + +// Get takes name of the projectInventory, and returns the corresponding projectInventory object, and an error if there is any. +func (c *projectInventories) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ProjectInventory, err error) { + result = &v1.ProjectInventory{} + err = c.client.Get(). + Resource("projectinventories"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ProjectInventories that match those selectors. +func (c *projectInventories) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProjectInventoryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ProjectInventoryList{} + err = c.client.Get(). + Resource("projectinventories"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested projectInventories. +func (c *projectInventories) Watch(ctx context.Context, opts metav1.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(). + Resource("projectinventories"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a projectInventory and creates it. Returns the server's representation of the projectInventory, and an error, if there is any. +func (c *projectInventories) Create(ctx context.Context, projectInventory *v1.ProjectInventory, opts metav1.CreateOptions) (result *v1.ProjectInventory, err error) { + result = &v1.ProjectInventory{} + err = c.client.Post(). + Resource("projectinventories"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectInventory). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a projectInventory and updates it. Returns the server's representation of the projectInventory, and an error, if there is any. +func (c *projectInventories) Update(ctx context.Context, projectInventory *v1.ProjectInventory, opts metav1.UpdateOptions) (result *v1.ProjectInventory, err error) { + result = &v1.ProjectInventory{} + err = c.client.Put(). + Resource("projectinventories"). + Name(projectInventory.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectInventory). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the projectInventory and deletes it. Returns an error if one occurs. +func (c *projectInventories) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("projectinventories"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *projectInventories) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("projectinventories"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched projectInventory. +func (c *projectInventories) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ProjectInventory, err error) { + result = &v1.ProjectInventory{} + err = c.client.Patch(pt). + Resource("projectinventories"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/projectquery.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/projectquery.go new file mode 100644 index 000000000..bd8f49372 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/projectquery.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ProjectQueriesGetter has a method to return a ProjectQueryInterface. +// A group's client should implement this interface. +type ProjectQueriesGetter interface { + ProjectQueries() ProjectQueryInterface +} + +// ProjectQueryInterface has methods to work with ProjectQuery resources. +type ProjectQueryInterface interface { + Create(ctx context.Context, projectQuery *v1.ProjectQuery, opts metav1.CreateOptions) (*v1.ProjectQuery, error) + Update(ctx context.Context, projectQuery *v1.ProjectQuery, opts metav1.UpdateOptions) (*v1.ProjectQuery, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ProjectQuery, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ProjectQueryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ProjectQuery, err error) + ProjectQueryExpansion +} + +// projectQueries implements ProjectQueryInterface +type projectQueries struct { + client rest.Interface +} + +// newProjectQueries returns a ProjectQueries +func newProjectQueries(c *GlobalTsmV1Client) *projectQueries { + return &projectQueries{ + client: c.RESTClient(), + } +} + +// Get takes name of the projectQuery, and returns the corresponding projectQuery object, and an error if there is any. +func (c *projectQueries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ProjectQuery, err error) { + result = &v1.ProjectQuery{} + err = c.client.Get(). + Resource("projectqueries"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ProjectQueries that match those selectors. +func (c *projectQueries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProjectQueryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ProjectQueryList{} + err = c.client.Get(). + Resource("projectqueries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested projectQueries. +func (c *projectQueries) Watch(ctx context.Context, opts metav1.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(). + Resource("projectqueries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a projectQuery and creates it. Returns the server's representation of the projectQuery, and an error, if there is any. +func (c *projectQueries) Create(ctx context.Context, projectQuery *v1.ProjectQuery, opts metav1.CreateOptions) (result *v1.ProjectQuery, err error) { + result = &v1.ProjectQuery{} + err = c.client.Post(). + Resource("projectqueries"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectQuery). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a projectQuery and updates it. Returns the server's representation of the projectQuery, and an error, if there is any. +func (c *projectQueries) Update(ctx context.Context, projectQuery *v1.ProjectQuery, opts metav1.UpdateOptions) (result *v1.ProjectQuery, err error) { + result = &v1.ProjectQuery{} + err = c.client.Put(). + Resource("projectqueries"). + Name(projectQuery.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectQuery). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the projectQuery and deletes it. Returns an error if one occurs. +func (c *projectQueries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("projectqueries"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *projectQueries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("projectqueries"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched projectQuery. +func (c *projectQueries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ProjectQuery, err error) { + result = &v1.ProjectQuery{} + err = c.client.Patch(pt). + Resource("projectqueries"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/publicserviceconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/publicserviceconfig.go new file mode 100644 index 000000000..ae29c2025 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/publicserviceconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// PublicServiceConfigsGetter has a method to return a PublicServiceConfigInterface. +// A group's client should implement this interface. +type PublicServiceConfigsGetter interface { + PublicServiceConfigs() PublicServiceConfigInterface +} + +// PublicServiceConfigInterface has methods to work with PublicServiceConfig resources. +type PublicServiceConfigInterface interface { + Create(ctx context.Context, publicServiceConfig *v1.PublicServiceConfig, opts metav1.CreateOptions) (*v1.PublicServiceConfig, error) + Update(ctx context.Context, publicServiceConfig *v1.PublicServiceConfig, opts metav1.UpdateOptions) (*v1.PublicServiceConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PublicServiceConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PublicServiceConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PublicServiceConfig, err error) + PublicServiceConfigExpansion +} + +// publicServiceConfigs implements PublicServiceConfigInterface +type publicServiceConfigs struct { + client rest.Interface +} + +// newPublicServiceConfigs returns a PublicServiceConfigs +func newPublicServiceConfigs(c *GlobalTsmV1Client) *publicServiceConfigs { + return &publicServiceConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the publicServiceConfig, and returns the corresponding publicServiceConfig object, and an error if there is any. +func (c *publicServiceConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PublicServiceConfig, err error) { + result = &v1.PublicServiceConfig{} + err = c.client.Get(). + Resource("publicserviceconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PublicServiceConfigs that match those selectors. +func (c *publicServiceConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PublicServiceConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PublicServiceConfigList{} + err = c.client.Get(). + Resource("publicserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested publicServiceConfigs. +func (c *publicServiceConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("publicserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a publicServiceConfig and creates it. Returns the server's representation of the publicServiceConfig, and an error, if there is any. +func (c *publicServiceConfigs) Create(ctx context.Context, publicServiceConfig *v1.PublicServiceConfig, opts metav1.CreateOptions) (result *v1.PublicServiceConfig, err error) { + result = &v1.PublicServiceConfig{} + err = c.client.Post(). + Resource("publicserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(publicServiceConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a publicServiceConfig and updates it. Returns the server's representation of the publicServiceConfig, and an error, if there is any. +func (c *publicServiceConfigs) Update(ctx context.Context, publicServiceConfig *v1.PublicServiceConfig, opts metav1.UpdateOptions) (result *v1.PublicServiceConfig, err error) { + result = &v1.PublicServiceConfig{} + err = c.client.Put(). + Resource("publicserviceconfigs"). + Name(publicServiceConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(publicServiceConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the publicServiceConfig and deletes it. Returns an error if one occurs. +func (c *publicServiceConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("publicserviceconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *publicServiceConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("publicserviceconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched publicServiceConfig. +func (c *publicServiceConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PublicServiceConfig, err error) { + result = &v1.PublicServiceConfig{} + err = c.client.Patch(pt). + Resource("publicserviceconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/publicservicerouteconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/publicservicerouteconfig.go new file mode 100644 index 000000000..ff58d5d4f --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/publicservicerouteconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// PublicServiceRouteConfigsGetter has a method to return a PublicServiceRouteConfigInterface. +// A group's client should implement this interface. +type PublicServiceRouteConfigsGetter interface { + PublicServiceRouteConfigs() PublicServiceRouteConfigInterface +} + +// PublicServiceRouteConfigInterface has methods to work with PublicServiceRouteConfig resources. +type PublicServiceRouteConfigInterface interface { + Create(ctx context.Context, publicServiceRouteConfig *v1.PublicServiceRouteConfig, opts metav1.CreateOptions) (*v1.PublicServiceRouteConfig, error) + Update(ctx context.Context, publicServiceRouteConfig *v1.PublicServiceRouteConfig, opts metav1.UpdateOptions) (*v1.PublicServiceRouteConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PublicServiceRouteConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PublicServiceRouteConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PublicServiceRouteConfig, err error) + PublicServiceRouteConfigExpansion +} + +// publicServiceRouteConfigs implements PublicServiceRouteConfigInterface +type publicServiceRouteConfigs struct { + client rest.Interface +} + +// newPublicServiceRouteConfigs returns a PublicServiceRouteConfigs +func newPublicServiceRouteConfigs(c *GlobalTsmV1Client) *publicServiceRouteConfigs { + return &publicServiceRouteConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the publicServiceRouteConfig, and returns the corresponding publicServiceRouteConfig object, and an error if there is any. +func (c *publicServiceRouteConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PublicServiceRouteConfig, err error) { + result = &v1.PublicServiceRouteConfig{} + err = c.client.Get(). + Resource("publicservicerouteconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PublicServiceRouteConfigs that match those selectors. +func (c *publicServiceRouteConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PublicServiceRouteConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PublicServiceRouteConfigList{} + err = c.client.Get(). + Resource("publicservicerouteconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested publicServiceRouteConfigs. +func (c *publicServiceRouteConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("publicservicerouteconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a publicServiceRouteConfig and creates it. Returns the server's representation of the publicServiceRouteConfig, and an error, if there is any. +func (c *publicServiceRouteConfigs) Create(ctx context.Context, publicServiceRouteConfig *v1.PublicServiceRouteConfig, opts metav1.CreateOptions) (result *v1.PublicServiceRouteConfig, err error) { + result = &v1.PublicServiceRouteConfig{} + err = c.client.Post(). + Resource("publicservicerouteconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(publicServiceRouteConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a publicServiceRouteConfig and updates it. Returns the server's representation of the publicServiceRouteConfig, and an error, if there is any. +func (c *publicServiceRouteConfigs) Update(ctx context.Context, publicServiceRouteConfig *v1.PublicServiceRouteConfig, opts metav1.UpdateOptions) (result *v1.PublicServiceRouteConfig, err error) { + result = &v1.PublicServiceRouteConfig{} + err = c.client.Put(). + Resource("publicservicerouteconfigs"). + Name(publicServiceRouteConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(publicServiceRouteConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the publicServiceRouteConfig and deletes it. Returns an error if one occurs. +func (c *publicServiceRouteConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("publicservicerouteconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *publicServiceRouteConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("publicservicerouteconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched publicServiceRouteConfig. +func (c *publicServiceRouteConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PublicServiceRouteConfig, err error) { + result = &v1.PublicServiceRouteConfig{} + err = c.client.Patch(pt). + Resource("publicservicerouteconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/publicservicert.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/publicservicert.go new file mode 100644 index 000000000..b34479528 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/publicservicert.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// PublicServiceRTsGetter has a method to return a PublicServiceRTInterface. +// A group's client should implement this interface. +type PublicServiceRTsGetter interface { + PublicServiceRTs() PublicServiceRTInterface +} + +// PublicServiceRTInterface has methods to work with PublicServiceRT resources. +type PublicServiceRTInterface interface { + Create(ctx context.Context, publicServiceRT *v1.PublicServiceRT, opts metav1.CreateOptions) (*v1.PublicServiceRT, error) + Update(ctx context.Context, publicServiceRT *v1.PublicServiceRT, opts metav1.UpdateOptions) (*v1.PublicServiceRT, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PublicServiceRT, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PublicServiceRTList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PublicServiceRT, err error) + PublicServiceRTExpansion +} + +// publicServiceRTs implements PublicServiceRTInterface +type publicServiceRTs struct { + client rest.Interface +} + +// newPublicServiceRTs returns a PublicServiceRTs +func newPublicServiceRTs(c *GlobalTsmV1Client) *publicServiceRTs { + return &publicServiceRTs{ + client: c.RESTClient(), + } +} + +// Get takes name of the publicServiceRT, and returns the corresponding publicServiceRT object, and an error if there is any. +func (c *publicServiceRTs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PublicServiceRT, err error) { + result = &v1.PublicServiceRT{} + err = c.client.Get(). + Resource("publicservicerts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PublicServiceRTs that match those selectors. +func (c *publicServiceRTs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PublicServiceRTList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PublicServiceRTList{} + err = c.client.Get(). + Resource("publicservicerts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested publicServiceRTs. +func (c *publicServiceRTs) Watch(ctx context.Context, opts metav1.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(). + Resource("publicservicerts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a publicServiceRT and creates it. Returns the server's representation of the publicServiceRT, and an error, if there is any. +func (c *publicServiceRTs) Create(ctx context.Context, publicServiceRT *v1.PublicServiceRT, opts metav1.CreateOptions) (result *v1.PublicServiceRT, err error) { + result = &v1.PublicServiceRT{} + err = c.client.Post(). + Resource("publicservicerts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(publicServiceRT). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a publicServiceRT and updates it. Returns the server's representation of the publicServiceRT, and an error, if there is any. +func (c *publicServiceRTs) Update(ctx context.Context, publicServiceRT *v1.PublicServiceRT, opts metav1.UpdateOptions) (result *v1.PublicServiceRT, err error) { + result = &v1.PublicServiceRT{} + err = c.client.Put(). + Resource("publicservicerts"). + Name(publicServiceRT.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(publicServiceRT). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the publicServiceRT and deletes it. Returns an error if one occurs. +func (c *publicServiceRTs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("publicservicerts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *publicServiceRTs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("publicservicerts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched publicServiceRT. +func (c *publicServiceRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PublicServiceRT, err error) { + result = &v1.PublicServiceRT{} + err = c.client.Patch(pt). + Resource("publicservicerts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/remotegatewayserviceconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/remotegatewayserviceconfig.go new file mode 100644 index 000000000..9fbb72bca --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/remotegatewayserviceconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// RemoteGatewayServiceConfigsGetter has a method to return a RemoteGatewayServiceConfigInterface. +// A group's client should implement this interface. +type RemoteGatewayServiceConfigsGetter interface { + RemoteGatewayServiceConfigs() RemoteGatewayServiceConfigInterface +} + +// RemoteGatewayServiceConfigInterface has methods to work with RemoteGatewayServiceConfig resources. +type RemoteGatewayServiceConfigInterface interface { + Create(ctx context.Context, remoteGatewayServiceConfig *v1.RemoteGatewayServiceConfig, opts metav1.CreateOptions) (*v1.RemoteGatewayServiceConfig, error) + Update(ctx context.Context, remoteGatewayServiceConfig *v1.RemoteGatewayServiceConfig, opts metav1.UpdateOptions) (*v1.RemoteGatewayServiceConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.RemoteGatewayServiceConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.RemoteGatewayServiceConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RemoteGatewayServiceConfig, err error) + RemoteGatewayServiceConfigExpansion +} + +// remoteGatewayServiceConfigs implements RemoteGatewayServiceConfigInterface +type remoteGatewayServiceConfigs struct { + client rest.Interface +} + +// newRemoteGatewayServiceConfigs returns a RemoteGatewayServiceConfigs +func newRemoteGatewayServiceConfigs(c *GlobalTsmV1Client) *remoteGatewayServiceConfigs { + return &remoteGatewayServiceConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the remoteGatewayServiceConfig, and returns the corresponding remoteGatewayServiceConfig object, and an error if there is any. +func (c *remoteGatewayServiceConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RemoteGatewayServiceConfig, err error) { + result = &v1.RemoteGatewayServiceConfig{} + err = c.client.Get(). + Resource("remotegatewayserviceconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of RemoteGatewayServiceConfigs that match those selectors. +func (c *remoteGatewayServiceConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RemoteGatewayServiceConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.RemoteGatewayServiceConfigList{} + err = c.client.Get(). + Resource("remotegatewayserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested remoteGatewayServiceConfigs. +func (c *remoteGatewayServiceConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("remotegatewayserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a remoteGatewayServiceConfig and creates it. Returns the server's representation of the remoteGatewayServiceConfig, and an error, if there is any. +func (c *remoteGatewayServiceConfigs) Create(ctx context.Context, remoteGatewayServiceConfig *v1.RemoteGatewayServiceConfig, opts metav1.CreateOptions) (result *v1.RemoteGatewayServiceConfig, err error) { + result = &v1.RemoteGatewayServiceConfig{} + err = c.client.Post(). + Resource("remotegatewayserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(remoteGatewayServiceConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a remoteGatewayServiceConfig and updates it. Returns the server's representation of the remoteGatewayServiceConfig, and an error, if there is any. +func (c *remoteGatewayServiceConfigs) Update(ctx context.Context, remoteGatewayServiceConfig *v1.RemoteGatewayServiceConfig, opts metav1.UpdateOptions) (result *v1.RemoteGatewayServiceConfig, err error) { + result = &v1.RemoteGatewayServiceConfig{} + err = c.client.Put(). + Resource("remotegatewayserviceconfigs"). + Name(remoteGatewayServiceConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(remoteGatewayServiceConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the remoteGatewayServiceConfig and deletes it. Returns an error if one occurs. +func (c *remoteGatewayServiceConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("remotegatewayserviceconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *remoteGatewayServiceConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("remotegatewayserviceconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched remoteGatewayServiceConfig. +func (c *remoteGatewayServiceConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RemoteGatewayServiceConfig, err error) { + result = &v1.RemoteGatewayServiceConfig{} + err = c.client.Patch(pt). + Resource("remotegatewayserviceconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/resourcegroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/resourcegroup.go new file mode 100644 index 000000000..bc1d01667 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/resourcegroup.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ResourceGroupsGetter has a method to return a ResourceGroupInterface. +// A group's client should implement this interface. +type ResourceGroupsGetter interface { + ResourceGroups() ResourceGroupInterface +} + +// ResourceGroupInterface has methods to work with ResourceGroup resources. +type ResourceGroupInterface interface { + Create(ctx context.Context, resourceGroup *v1.ResourceGroup, opts metav1.CreateOptions) (*v1.ResourceGroup, error) + Update(ctx context.Context, resourceGroup *v1.ResourceGroup, opts metav1.UpdateOptions) (*v1.ResourceGroup, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ResourceGroup, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ResourceGroupList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ResourceGroup, err error) + ResourceGroupExpansion +} + +// resourceGroups implements ResourceGroupInterface +type resourceGroups struct { + client rest.Interface +} + +// newResourceGroups returns a ResourceGroups +func newResourceGroups(c *GlobalTsmV1Client) *resourceGroups { + return &resourceGroups{ + client: c.RESTClient(), + } +} + +// Get takes name of the resourceGroup, and returns the corresponding resourceGroup object, and an error if there is any. +func (c *resourceGroups) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ResourceGroup, err error) { + result = &v1.ResourceGroup{} + err = c.client.Get(). + Resource("resourcegroups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ResourceGroups that match those selectors. +func (c *resourceGroups) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ResourceGroupList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ResourceGroupList{} + err = c.client.Get(). + Resource("resourcegroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested resourceGroups. +func (c *resourceGroups) Watch(ctx context.Context, opts metav1.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(). + Resource("resourcegroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a resourceGroup and creates it. Returns the server's representation of the resourceGroup, and an error, if there is any. +func (c *resourceGroups) Create(ctx context.Context, resourceGroup *v1.ResourceGroup, opts metav1.CreateOptions) (result *v1.ResourceGroup, err error) { + result = &v1.ResourceGroup{} + err = c.client.Post(). + Resource("resourcegroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(resourceGroup). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a resourceGroup and updates it. Returns the server's representation of the resourceGroup, and an error, if there is any. +func (c *resourceGroups) Update(ctx context.Context, resourceGroup *v1.ResourceGroup, opts metav1.UpdateOptions) (result *v1.ResourceGroup, err error) { + result = &v1.ResourceGroup{} + err = c.client.Put(). + Resource("resourcegroups"). + Name(resourceGroup.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(resourceGroup). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the resourceGroup and deletes it. Returns an error if one occurs. +func (c *resourceGroups) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("resourcegroups"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *resourceGroups) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("resourcegroups"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched resourceGroup. +func (c *resourceGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ResourceGroup, err error) { + result = &v1.ResourceGroup{} + err = c.client.Patch(pt). + Resource("resourcegroups"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/resourcegrouprt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/resourcegrouprt.go new file mode 100644 index 000000000..dcccf3bcd --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/resourcegrouprt.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ResourceGroupRTsGetter has a method to return a ResourceGroupRTInterface. +// A group's client should implement this interface. +type ResourceGroupRTsGetter interface { + ResourceGroupRTs() ResourceGroupRTInterface +} + +// ResourceGroupRTInterface has methods to work with ResourceGroupRT resources. +type ResourceGroupRTInterface interface { + Create(ctx context.Context, resourceGroupRT *v1.ResourceGroupRT, opts metav1.CreateOptions) (*v1.ResourceGroupRT, error) + Update(ctx context.Context, resourceGroupRT *v1.ResourceGroupRT, opts metav1.UpdateOptions) (*v1.ResourceGroupRT, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ResourceGroupRT, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ResourceGroupRTList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ResourceGroupRT, err error) + ResourceGroupRTExpansion +} + +// resourceGroupRTs implements ResourceGroupRTInterface +type resourceGroupRTs struct { + client rest.Interface +} + +// newResourceGroupRTs returns a ResourceGroupRTs +func newResourceGroupRTs(c *GlobalTsmV1Client) *resourceGroupRTs { + return &resourceGroupRTs{ + client: c.RESTClient(), + } +} + +// Get takes name of the resourceGroupRT, and returns the corresponding resourceGroupRT object, and an error if there is any. +func (c *resourceGroupRTs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ResourceGroupRT, err error) { + result = &v1.ResourceGroupRT{} + err = c.client.Get(). + Resource("resourcegrouprts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ResourceGroupRTs that match those selectors. +func (c *resourceGroupRTs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ResourceGroupRTList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ResourceGroupRTList{} + err = c.client.Get(). + Resource("resourcegrouprts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested resourceGroupRTs. +func (c *resourceGroupRTs) Watch(ctx context.Context, opts metav1.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(). + Resource("resourcegrouprts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a resourceGroupRT and creates it. Returns the server's representation of the resourceGroupRT, and an error, if there is any. +func (c *resourceGroupRTs) Create(ctx context.Context, resourceGroupRT *v1.ResourceGroupRT, opts metav1.CreateOptions) (result *v1.ResourceGroupRT, err error) { + result = &v1.ResourceGroupRT{} + err = c.client.Post(). + Resource("resourcegrouprts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(resourceGroupRT). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a resourceGroupRT and updates it. Returns the server's representation of the resourceGroupRT, and an error, if there is any. +func (c *resourceGroupRTs) Update(ctx context.Context, resourceGroupRT *v1.ResourceGroupRT, opts metav1.UpdateOptions) (result *v1.ResourceGroupRT, err error) { + result = &v1.ResourceGroupRT{} + err = c.client.Put(). + Resource("resourcegrouprts"). + Name(resourceGroupRT.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(resourceGroupRT). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the resourceGroupRT and deletes it. Returns an error if one occurs. +func (c *resourceGroupRTs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("resourcegrouprts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *resourceGroupRTs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("resourcegrouprts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched resourceGroupRT. +func (c *resourceGroupRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ResourceGroupRT, err error) { + result = &v1.ResourceGroupRT{} + err = c.client.Patch(pt). + Resource("resourcegrouprts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/root.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/root.go new file mode 100644 index 000000000..016f814df --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/root.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// RootsGetter has a method to return a RootInterface. +// A group's client should implement this interface. +type RootsGetter interface { + Roots() RootInterface +} + +// RootInterface has methods to work with Root resources. +type RootInterface interface { + Create(ctx context.Context, root *v1.Root, opts metav1.CreateOptions) (*v1.Root, error) + Update(ctx context.Context, root *v1.Root, opts metav1.UpdateOptions) (*v1.Root, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Root, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.RootList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Root, err error) + RootExpansion +} + +// roots implements RootInterface +type roots struct { + client rest.Interface +} + +// newRoots returns a Roots +func newRoots(c *GlobalTsmV1Client) *roots { + return &roots{ + client: c.RESTClient(), + } +} + +// Get takes name of the root, and returns the corresponding root object, and an error if there is any. +func (c *roots) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Root, err error) { + result = &v1.Root{} + err = c.client.Get(). + Resource("roots"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Roots that match those selectors. +func (c *roots) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RootList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.RootList{} + err = c.client.Get(). + Resource("roots"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested roots. +func (c *roots) Watch(ctx context.Context, opts metav1.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(). + Resource("roots"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a root and creates it. Returns the server's representation of the root, and an error, if there is any. +func (c *roots) Create(ctx context.Context, root *v1.Root, opts metav1.CreateOptions) (result *v1.Root, err error) { + result = &v1.Root{} + err = c.client.Post(). + Resource("roots"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(root). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a root and updates it. Returns the server's representation of the root, and an error, if there is any. +func (c *roots) Update(ctx context.Context, root *v1.Root, opts metav1.UpdateOptions) (result *v1.Root, err error) { + result = &v1.Root{} + err = c.client.Put(). + Resource("roots"). + Name(root.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(root). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the root and deletes it. Returns an error if one occurs. +func (c *roots) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("roots"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *roots) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("roots"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched root. +func (c *roots) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Root, err error) { + result = &v1.Root{} + err = c.client.Patch(pt). + Resource("roots"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/rpolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/rpolicy.go new file mode 100644 index 000000000..cfed91b77 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/rpolicy.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// RPoliciesGetter has a method to return a RPolicyInterface. +// A group's client should implement this interface. +type RPoliciesGetter interface { + RPolicies() RPolicyInterface +} + +// RPolicyInterface has methods to work with RPolicy resources. +type RPolicyInterface interface { + Create(ctx context.Context, rPolicy *v1.RPolicy, opts metav1.CreateOptions) (*v1.RPolicy, error) + Update(ctx context.Context, rPolicy *v1.RPolicy, opts metav1.UpdateOptions) (*v1.RPolicy, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.RPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.RPolicyList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RPolicy, err error) + RPolicyExpansion +} + +// rPolicies implements RPolicyInterface +type rPolicies struct { + client rest.Interface +} + +// newRPolicies returns a RPolicies +func newRPolicies(c *GlobalTsmV1Client) *rPolicies { + return &rPolicies{ + client: c.RESTClient(), + } +} + +// Get takes name of the rPolicy, and returns the corresponding rPolicy object, and an error if there is any. +func (c *rPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RPolicy, err error) { + result = &v1.RPolicy{} + err = c.client.Get(). + Resource("rpolicies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of RPolicies that match those selectors. +func (c *rPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.RPolicyList{} + err = c.client.Get(). + Resource("rpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested rPolicies. +func (c *rPolicies) Watch(ctx context.Context, opts metav1.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(). + Resource("rpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a rPolicy and creates it. Returns the server's representation of the rPolicy, and an error, if there is any. +func (c *rPolicies) Create(ctx context.Context, rPolicy *v1.RPolicy, opts metav1.CreateOptions) (result *v1.RPolicy, err error) { + result = &v1.RPolicy{} + err = c.client.Post(). + Resource("rpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(rPolicy). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a rPolicy and updates it. Returns the server's representation of the rPolicy, and an error, if there is any. +func (c *rPolicies) Update(ctx context.Context, rPolicy *v1.RPolicy, opts metav1.UpdateOptions) (result *v1.RPolicy, err error) { + result = &v1.RPolicy{} + err = c.client.Put(). + Resource("rpolicies"). + Name(rPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(rPolicy). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the rPolicy and deletes it. Returns an error if one occurs. +func (c *rPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("rpolicies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *rPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("rpolicies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched rPolicy. +func (c *rPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RPolicy, err error) { + result = &v1.RPolicy{} + err = c.client.Patch(pt). + Resource("rpolicies"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/runtime.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/runtime.go new file mode 100644 index 000000000..22391e6a4 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/runtime.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// RuntimesGetter has a method to return a RuntimeInterface. +// A group's client should implement this interface. +type RuntimesGetter interface { + Runtimes() RuntimeInterface +} + +// RuntimeInterface has methods to work with Runtime resources. +type RuntimeInterface interface { + Create(ctx context.Context, runtime *v1.Runtime, opts metav1.CreateOptions) (*v1.Runtime, error) + Update(ctx context.Context, runtime *v1.Runtime, opts metav1.UpdateOptions) (*v1.Runtime, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Runtime, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.RuntimeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Runtime, err error) + RuntimeExpansion +} + +// runtimes implements RuntimeInterface +type runtimes struct { + client rest.Interface +} + +// newRuntimes returns a Runtimes +func newRuntimes(c *GlobalTsmV1Client) *runtimes { + return &runtimes{ + client: c.RESTClient(), + } +} + +// Get takes name of the runtime, and returns the corresponding runtime object, and an error if there is any. +func (c *runtimes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Runtime, err error) { + result = &v1.Runtime{} + err = c.client.Get(). + Resource("runtimes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Runtimes that match those selectors. +func (c *runtimes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RuntimeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.RuntimeList{} + err = c.client.Get(). + Resource("runtimes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested runtimes. +func (c *runtimes) Watch(ctx context.Context, opts metav1.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(). + Resource("runtimes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a runtime and creates it. Returns the server's representation of the runtime, and an error, if there is any. +func (c *runtimes) Create(ctx context.Context, runtime *v1.Runtime, opts metav1.CreateOptions) (result *v1.Runtime, err error) { + result = &v1.Runtime{} + err = c.client.Post(). + Resource("runtimes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(runtime). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a runtime and updates it. Returns the server's representation of the runtime, and an error, if there is any. +func (c *runtimes) Update(ctx context.Context, runtime *v1.Runtime, opts metav1.UpdateOptions) (result *v1.Runtime, err error) { + result = &v1.Runtime{} + err = c.client.Put(). + Resource("runtimes"). + Name(runtime.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(runtime). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the runtime and deletes it. Returns an error if one occurs. +func (c *runtimes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("runtimes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *runtimes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("runtimes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched runtime. +func (c *runtimes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Runtime, err error) { + result = &v1.Runtime{} + err = c.client.Patch(pt). + Resource("runtimes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/schemaviolationdiscoveryrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/schemaviolationdiscoveryrt.go new file mode 100644 index 000000000..513898a64 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/schemaviolationdiscoveryrt.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// SchemaViolationDiscoveryRTsGetter has a method to return a SchemaViolationDiscoveryRTInterface. +// A group's client should implement this interface. +type SchemaViolationDiscoveryRTsGetter interface { + SchemaViolationDiscoveryRTs() SchemaViolationDiscoveryRTInterface +} + +// SchemaViolationDiscoveryRTInterface has methods to work with SchemaViolationDiscoveryRT resources. +type SchemaViolationDiscoveryRTInterface interface { + Create(ctx context.Context, schemaViolationDiscoveryRT *v1.SchemaViolationDiscoveryRT, opts metav1.CreateOptions) (*v1.SchemaViolationDiscoveryRT, error) + Update(ctx context.Context, schemaViolationDiscoveryRT *v1.SchemaViolationDiscoveryRT, opts metav1.UpdateOptions) (*v1.SchemaViolationDiscoveryRT, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.SchemaViolationDiscoveryRT, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SchemaViolationDiscoveryRTList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SchemaViolationDiscoveryRT, err error) + SchemaViolationDiscoveryRTExpansion +} + +// schemaViolationDiscoveryRTs implements SchemaViolationDiscoveryRTInterface +type schemaViolationDiscoveryRTs struct { + client rest.Interface +} + +// newSchemaViolationDiscoveryRTs returns a SchemaViolationDiscoveryRTs +func newSchemaViolationDiscoveryRTs(c *GlobalTsmV1Client) *schemaViolationDiscoveryRTs { + return &schemaViolationDiscoveryRTs{ + client: c.RESTClient(), + } +} + +// Get takes name of the schemaViolationDiscoveryRT, and returns the corresponding schemaViolationDiscoveryRT object, and an error if there is any. +func (c *schemaViolationDiscoveryRTs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SchemaViolationDiscoveryRT, err error) { + result = &v1.SchemaViolationDiscoveryRT{} + err = c.client.Get(). + Resource("schemaviolationdiscoveryrts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SchemaViolationDiscoveryRTs that match those selectors. +func (c *schemaViolationDiscoveryRTs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SchemaViolationDiscoveryRTList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SchemaViolationDiscoveryRTList{} + err = c.client.Get(). + Resource("schemaviolationdiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested schemaViolationDiscoveryRTs. +func (c *schemaViolationDiscoveryRTs) Watch(ctx context.Context, opts metav1.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(). + Resource("schemaviolationdiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a schemaViolationDiscoveryRT and creates it. Returns the server's representation of the schemaViolationDiscoveryRT, and an error, if there is any. +func (c *schemaViolationDiscoveryRTs) Create(ctx context.Context, schemaViolationDiscoveryRT *v1.SchemaViolationDiscoveryRT, opts metav1.CreateOptions) (result *v1.SchemaViolationDiscoveryRT, err error) { + result = &v1.SchemaViolationDiscoveryRT{} + err = c.client.Post(). + Resource("schemaviolationdiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(schemaViolationDiscoveryRT). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a schemaViolationDiscoveryRT and updates it. Returns the server's representation of the schemaViolationDiscoveryRT, and an error, if there is any. +func (c *schemaViolationDiscoveryRTs) Update(ctx context.Context, schemaViolationDiscoveryRT *v1.SchemaViolationDiscoveryRT, opts metav1.UpdateOptions) (result *v1.SchemaViolationDiscoveryRT, err error) { + result = &v1.SchemaViolationDiscoveryRT{} + err = c.client.Put(). + Resource("schemaviolationdiscoveryrts"). + Name(schemaViolationDiscoveryRT.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(schemaViolationDiscoveryRT). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the schemaViolationDiscoveryRT and deletes it. Returns an error if one occurs. +func (c *schemaViolationDiscoveryRTs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("schemaviolationdiscoveryrts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *schemaViolationDiscoveryRTs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("schemaviolationdiscoveryrts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched schemaViolationDiscoveryRT. +func (c *schemaViolationDiscoveryRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SchemaViolationDiscoveryRT, err error) { + result = &v1.SchemaViolationDiscoveryRT{} + err = c.client.Patch(pt). + Resource("schemaviolationdiscoveryrts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/secrethash.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/secrethash.go new file mode 100644 index 000000000..b9b7fc3a1 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/secrethash.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// SecretHashesGetter has a method to return a SecretHashInterface. +// A group's client should implement this interface. +type SecretHashesGetter interface { + SecretHashes() SecretHashInterface +} + +// SecretHashInterface has methods to work with SecretHash resources. +type SecretHashInterface interface { + Create(ctx context.Context, secretHash *v1.SecretHash, opts metav1.CreateOptions) (*v1.SecretHash, error) + Update(ctx context.Context, secretHash *v1.SecretHash, opts metav1.UpdateOptions) (*v1.SecretHash, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.SecretHash, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SecretHashList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SecretHash, err error) + SecretHashExpansion +} + +// secretHashes implements SecretHashInterface +type secretHashes struct { + client rest.Interface +} + +// newSecretHashes returns a SecretHashes +func newSecretHashes(c *GlobalTsmV1Client) *secretHashes { + return &secretHashes{ + client: c.RESTClient(), + } +} + +// Get takes name of the secretHash, and returns the corresponding secretHash object, and an error if there is any. +func (c *secretHashes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SecretHash, err error) { + result = &v1.SecretHash{} + err = c.client.Get(). + Resource("secrethashes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SecretHashes that match those selectors. +func (c *secretHashes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SecretHashList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SecretHashList{} + err = c.client.Get(). + Resource("secrethashes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested secretHashes. +func (c *secretHashes) Watch(ctx context.Context, opts metav1.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(). + Resource("secrethashes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a secretHash and creates it. Returns the server's representation of the secretHash, and an error, if there is any. +func (c *secretHashes) Create(ctx context.Context, secretHash *v1.SecretHash, opts metav1.CreateOptions) (result *v1.SecretHash, err error) { + result = &v1.SecretHash{} + err = c.client.Post(). + Resource("secrethashes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(secretHash). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a secretHash and updates it. Returns the server's representation of the secretHash, and an error, if there is any. +func (c *secretHashes) Update(ctx context.Context, secretHash *v1.SecretHash, opts metav1.UpdateOptions) (result *v1.SecretHash, err error) { + result = &v1.SecretHash{} + err = c.client.Put(). + Resource("secrethashes"). + Name(secretHash.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(secretHash). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the secretHash and deletes it. Returns an error if one occurs. +func (c *secretHashes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("secrethashes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *secretHashes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("secrethashes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched secretHash. +func (c *secretHashes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SecretHash, err error) { + result = &v1.SecretHash{} + err = c.client.Patch(pt). + Resource("secrethashes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/secretrtconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/secretrtconfig.go new file mode 100644 index 000000000..fa6a48d33 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/secretrtconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// SecretRTConfigsGetter has a method to return a SecretRTConfigInterface. +// A group's client should implement this interface. +type SecretRTConfigsGetter interface { + SecretRTConfigs() SecretRTConfigInterface +} + +// SecretRTConfigInterface has methods to work with SecretRTConfig resources. +type SecretRTConfigInterface interface { + Create(ctx context.Context, secretRTConfig *v1.SecretRTConfig, opts metav1.CreateOptions) (*v1.SecretRTConfig, error) + Update(ctx context.Context, secretRTConfig *v1.SecretRTConfig, opts metav1.UpdateOptions) (*v1.SecretRTConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.SecretRTConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SecretRTConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SecretRTConfig, err error) + SecretRTConfigExpansion +} + +// secretRTConfigs implements SecretRTConfigInterface +type secretRTConfigs struct { + client rest.Interface +} + +// newSecretRTConfigs returns a SecretRTConfigs +func newSecretRTConfigs(c *GlobalTsmV1Client) *secretRTConfigs { + return &secretRTConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the secretRTConfig, and returns the corresponding secretRTConfig object, and an error if there is any. +func (c *secretRTConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SecretRTConfig, err error) { + result = &v1.SecretRTConfig{} + err = c.client.Get(). + Resource("secretrtconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SecretRTConfigs that match those selectors. +func (c *secretRTConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SecretRTConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SecretRTConfigList{} + err = c.client.Get(). + Resource("secretrtconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested secretRTConfigs. +func (c *secretRTConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("secretrtconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a secretRTConfig and creates it. Returns the server's representation of the secretRTConfig, and an error, if there is any. +func (c *secretRTConfigs) Create(ctx context.Context, secretRTConfig *v1.SecretRTConfig, opts metav1.CreateOptions) (result *v1.SecretRTConfig, err error) { + result = &v1.SecretRTConfig{} + err = c.client.Post(). + Resource("secretrtconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(secretRTConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a secretRTConfig and updates it. Returns the server's representation of the secretRTConfig, and an error, if there is any. +func (c *secretRTConfigs) Update(ctx context.Context, secretRTConfig *v1.SecretRTConfig, opts metav1.UpdateOptions) (result *v1.SecretRTConfig, err error) { + result = &v1.SecretRTConfig{} + err = c.client.Put(). + Resource("secretrtconfigs"). + Name(secretRTConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(secretRTConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the secretRTConfig and deletes it. Returns an error if one occurs. +func (c *secretRTConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("secretrtconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *secretRTConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("secretrtconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched secretRTConfig. +func (c *secretRTConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SecretRTConfig, err error) { + result = &v1.SecretRTConfig{} + err = c.client.Patch(pt). + Resource("secretrtconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/securitycontextconstraints.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/securitycontextconstraints.go new file mode 100644 index 000000000..2c2ad03a7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/securitycontextconstraints.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// SecurityContextConstraintsesGetter has a method to return a SecurityContextConstraintsInterface. +// A group's client should implement this interface. +type SecurityContextConstraintsesGetter interface { + SecurityContextConstraintses() SecurityContextConstraintsInterface +} + +// SecurityContextConstraintsInterface has methods to work with SecurityContextConstraints resources. +type SecurityContextConstraintsInterface interface { + Create(ctx context.Context, securityContextConstraints *v1.SecurityContextConstraints, opts metav1.CreateOptions) (*v1.SecurityContextConstraints, error) + Update(ctx context.Context, securityContextConstraints *v1.SecurityContextConstraints, opts metav1.UpdateOptions) (*v1.SecurityContextConstraints, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.SecurityContextConstraints, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SecurityContextConstraintsList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SecurityContextConstraints, err error) + SecurityContextConstraintsExpansion +} + +// securityContextConstraintses implements SecurityContextConstraintsInterface +type securityContextConstraintses struct { + client rest.Interface +} + +// newSecurityContextConstraintses returns a SecurityContextConstraintses +func newSecurityContextConstraintses(c *GlobalTsmV1Client) *securityContextConstraintses { + return &securityContextConstraintses{ + client: c.RESTClient(), + } +} + +// Get takes name of the securityContextConstraints, and returns the corresponding securityContextConstraints object, and an error if there is any. +func (c *securityContextConstraintses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SecurityContextConstraints, err error) { + result = &v1.SecurityContextConstraints{} + err = c.client.Get(). + Resource("securitycontextconstraintses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SecurityContextConstraintses that match those selectors. +func (c *securityContextConstraintses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SecurityContextConstraintsList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SecurityContextConstraintsList{} + err = c.client.Get(). + Resource("securitycontextconstraintses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested securityContextConstraintses. +func (c *securityContextConstraintses) Watch(ctx context.Context, opts metav1.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(). + Resource("securitycontextconstraintses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a securityContextConstraints and creates it. Returns the server's representation of the securityContextConstraints, and an error, if there is any. +func (c *securityContextConstraintses) Create(ctx context.Context, securityContextConstraints *v1.SecurityContextConstraints, opts metav1.CreateOptions) (result *v1.SecurityContextConstraints, err error) { + result = &v1.SecurityContextConstraints{} + err = c.client.Post(). + Resource("securitycontextconstraintses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(securityContextConstraints). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a securityContextConstraints and updates it. Returns the server's representation of the securityContextConstraints, and an error, if there is any. +func (c *securityContextConstraintses) Update(ctx context.Context, securityContextConstraints *v1.SecurityContextConstraints, opts metav1.UpdateOptions) (result *v1.SecurityContextConstraints, err error) { + result = &v1.SecurityContextConstraints{} + err = c.client.Put(). + Resource("securitycontextconstraintses"). + Name(securityContextConstraints.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(securityContextConstraints). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the securityContextConstraints and deletes it. Returns an error if one occurs. +func (c *securityContextConstraintses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("securitycontextconstraintses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *securityContextConstraintses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("securitycontextconstraintses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched securityContextConstraints. +func (c *securityContextConstraintses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SecurityContextConstraints, err error) { + result = &v1.SecurityContextConstraints{} + err = c.client.Patch(pt). + Resource("securitycontextconstraintses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/securitycontextconstraintsconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/securitycontextconstraintsconfig.go new file mode 100644 index 000000000..a35476b97 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/securitycontextconstraintsconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// SecurityContextConstraintsConfigsGetter has a method to return a SecurityContextConstraintsConfigInterface. +// A group's client should implement this interface. +type SecurityContextConstraintsConfigsGetter interface { + SecurityContextConstraintsConfigs() SecurityContextConstraintsConfigInterface +} + +// SecurityContextConstraintsConfigInterface has methods to work with SecurityContextConstraintsConfig resources. +type SecurityContextConstraintsConfigInterface interface { + Create(ctx context.Context, securityContextConstraintsConfig *v1.SecurityContextConstraintsConfig, opts metav1.CreateOptions) (*v1.SecurityContextConstraintsConfig, error) + Update(ctx context.Context, securityContextConstraintsConfig *v1.SecurityContextConstraintsConfig, opts metav1.UpdateOptions) (*v1.SecurityContextConstraintsConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.SecurityContextConstraintsConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SecurityContextConstraintsConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SecurityContextConstraintsConfig, err error) + SecurityContextConstraintsConfigExpansion +} + +// securityContextConstraintsConfigs implements SecurityContextConstraintsConfigInterface +type securityContextConstraintsConfigs struct { + client rest.Interface +} + +// newSecurityContextConstraintsConfigs returns a SecurityContextConstraintsConfigs +func newSecurityContextConstraintsConfigs(c *GlobalTsmV1Client) *securityContextConstraintsConfigs { + return &securityContextConstraintsConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the securityContextConstraintsConfig, and returns the corresponding securityContextConstraintsConfig object, and an error if there is any. +func (c *securityContextConstraintsConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SecurityContextConstraintsConfig, err error) { + result = &v1.SecurityContextConstraintsConfig{} + err = c.client.Get(). + Resource("securitycontextconstraintsconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SecurityContextConstraintsConfigs that match those selectors. +func (c *securityContextConstraintsConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SecurityContextConstraintsConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SecurityContextConstraintsConfigList{} + err = c.client.Get(). + Resource("securitycontextconstraintsconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested securityContextConstraintsConfigs. +func (c *securityContextConstraintsConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("securitycontextconstraintsconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a securityContextConstraintsConfig and creates it. Returns the server's representation of the securityContextConstraintsConfig, and an error, if there is any. +func (c *securityContextConstraintsConfigs) Create(ctx context.Context, securityContextConstraintsConfig *v1.SecurityContextConstraintsConfig, opts metav1.CreateOptions) (result *v1.SecurityContextConstraintsConfig, err error) { + result = &v1.SecurityContextConstraintsConfig{} + err = c.client.Post(). + Resource("securitycontextconstraintsconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(securityContextConstraintsConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a securityContextConstraintsConfig and updates it. Returns the server's representation of the securityContextConstraintsConfig, and an error, if there is any. +func (c *securityContextConstraintsConfigs) Update(ctx context.Context, securityContextConstraintsConfig *v1.SecurityContextConstraintsConfig, opts metav1.UpdateOptions) (result *v1.SecurityContextConstraintsConfig, err error) { + result = &v1.SecurityContextConstraintsConfig{} + err = c.client.Put(). + Resource("securitycontextconstraintsconfigs"). + Name(securityContextConstraintsConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(securityContextConstraintsConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the securityContextConstraintsConfig and deletes it. Returns an error if one occurs. +func (c *securityContextConstraintsConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("securitycontextconstraintsconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *securityContextConstraintsConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("securitycontextconstraintsconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched securityContextConstraintsConfig. +func (c *securityContextConstraintsConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SecurityContextConstraintsConfig, err error) { + result = &v1.SecurityContextConstraintsConfig{} + err = c.client.Patch(pt). + Resource("securitycontextconstraintsconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/service.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/service.go new file mode 100644 index 000000000..d98b9c253 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/service.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServicesGetter has a method to return a ServiceInterface. +// A group's client should implement this interface. +type ServicesGetter interface { + Services() ServiceInterface +} + +// ServiceInterface has methods to work with Service resources. +type ServiceInterface interface { + Create(ctx context.Context, service *v1.Service, opts metav1.CreateOptions) (*v1.Service, error) + Update(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (*v1.Service, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Service, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Service, err error) + ServiceExpansion +} + +// services implements ServiceInterface +type services struct { + client rest.Interface +} + +// newServices returns a Services +func newServices(c *GlobalTsmV1Client) *services { + return &services{ + client: c.RESTClient(), + } +} + +// Get takes name of the service, and returns the corresponding service object, and an error if there is any. +func (c *services) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Service, err error) { + result = &v1.Service{} + err = c.client.Get(). + Resource("services"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Services that match those selectors. +func (c *services) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceList{} + err = c.client.Get(). + Resource("services"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested services. +func (c *services) Watch(ctx context.Context, opts metav1.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(). + Resource("services"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a service and creates it. Returns the server's representation of the service, and an error, if there is any. +func (c *services) Create(ctx context.Context, service *v1.Service, opts metav1.CreateOptions) (result *v1.Service, err error) { + result = &v1.Service{} + err = c.client.Post(). + Resource("services"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(service). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a service and updates it. Returns the server's representation of the service, and an error, if there is any. +func (c *services) Update(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (result *v1.Service, err error) { + result = &v1.Service{} + err = c.client.Put(). + Resource("services"). + Name(service.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(service). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the service and deletes it. Returns an error if one occurs. +func (c *services) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("services"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *services) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("services"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched service. +func (c *services) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Service, err error) { + result = &v1.Service{} + err = c.client.Patch(pt). + Resource("services"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceconfig.go new file mode 100644 index 000000000..eac982953 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceConfigsGetter has a method to return a ServiceConfigInterface. +// A group's client should implement this interface. +type ServiceConfigsGetter interface { + ServiceConfigs() ServiceConfigInterface +} + +// ServiceConfigInterface has methods to work with ServiceConfig resources. +type ServiceConfigInterface interface { + Create(ctx context.Context, serviceConfig *v1.ServiceConfig, opts metav1.CreateOptions) (*v1.ServiceConfig, error) + Update(ctx context.Context, serviceConfig *v1.ServiceConfig, opts metav1.UpdateOptions) (*v1.ServiceConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceConfig, err error) + ServiceConfigExpansion +} + +// serviceConfigs implements ServiceConfigInterface +type serviceConfigs struct { + client rest.Interface +} + +// newServiceConfigs returns a ServiceConfigs +func newServiceConfigs(c *GlobalTsmV1Client) *serviceConfigs { + return &serviceConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceConfig, and returns the corresponding serviceConfig object, and an error if there is any. +func (c *serviceConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceConfig, err error) { + result = &v1.ServiceConfig{} + err = c.client.Get(). + Resource("serviceconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceConfigs that match those selectors. +func (c *serviceConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceConfigList{} + err = c.client.Get(). + Resource("serviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceConfigs. +func (c *serviceConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("serviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceConfig and creates it. Returns the server's representation of the serviceConfig, and an error, if there is any. +func (c *serviceConfigs) Create(ctx context.Context, serviceConfig *v1.ServiceConfig, opts metav1.CreateOptions) (result *v1.ServiceConfig, err error) { + result = &v1.ServiceConfig{} + err = c.client.Post(). + Resource("serviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceConfig and updates it. Returns the server's representation of the serviceConfig, and an error, if there is any. +func (c *serviceConfigs) Update(ctx context.Context, serviceConfig *v1.ServiceConfig, opts metav1.UpdateOptions) (result *v1.ServiceConfig, err error) { + result = &v1.ServiceConfig{} + err = c.client.Put(). + Resource("serviceconfigs"). + Name(serviceConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceConfig and deletes it. Returns an error if one occurs. +func (c *serviceConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("serviceconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("serviceconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceConfig. +func (c *serviceConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceConfig, err error) { + result = &v1.ServiceConfig{} + err = c.client.Patch(pt). + Resource("serviceconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicecronjob.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicecronjob.go new file mode 100644 index 000000000..c9eab1458 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicecronjob.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceCronJobsGetter has a method to return a ServiceCronJobInterface. +// A group's client should implement this interface. +type ServiceCronJobsGetter interface { + ServiceCronJobs() ServiceCronJobInterface +} + +// ServiceCronJobInterface has methods to work with ServiceCronJob resources. +type ServiceCronJobInterface interface { + Create(ctx context.Context, serviceCronJob *v1.ServiceCronJob, opts metav1.CreateOptions) (*v1.ServiceCronJob, error) + Update(ctx context.Context, serviceCronJob *v1.ServiceCronJob, opts metav1.UpdateOptions) (*v1.ServiceCronJob, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceCronJob, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceCronJobList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceCronJob, err error) + ServiceCronJobExpansion +} + +// serviceCronJobs implements ServiceCronJobInterface +type serviceCronJobs struct { + client rest.Interface +} + +// newServiceCronJobs returns a ServiceCronJobs +func newServiceCronJobs(c *GlobalTsmV1Client) *serviceCronJobs { + return &serviceCronJobs{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceCronJob, and returns the corresponding serviceCronJob object, and an error if there is any. +func (c *serviceCronJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceCronJob, err error) { + result = &v1.ServiceCronJob{} + err = c.client.Get(). + Resource("servicecronjobs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceCronJobs that match those selectors. +func (c *serviceCronJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceCronJobList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceCronJobList{} + err = c.client.Get(). + Resource("servicecronjobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceCronJobs. +func (c *serviceCronJobs) Watch(ctx context.Context, opts metav1.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(). + Resource("servicecronjobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceCronJob and creates it. Returns the server's representation of the serviceCronJob, and an error, if there is any. +func (c *serviceCronJobs) Create(ctx context.Context, serviceCronJob *v1.ServiceCronJob, opts metav1.CreateOptions) (result *v1.ServiceCronJob, err error) { + result = &v1.ServiceCronJob{} + err = c.client.Post(). + Resource("servicecronjobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceCronJob). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceCronJob and updates it. Returns the server's representation of the serviceCronJob, and an error, if there is any. +func (c *serviceCronJobs) Update(ctx context.Context, serviceCronJob *v1.ServiceCronJob, opts metav1.UpdateOptions) (result *v1.ServiceCronJob, err error) { + result = &v1.ServiceCronJob{} + err = c.client.Put(). + Resource("servicecronjobs"). + Name(serviceCronJob.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceCronJob). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceCronJob and deletes it. Returns an error if one occurs. +func (c *serviceCronJobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicecronjobs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceCronJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("servicecronjobs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceCronJob. +func (c *serviceCronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceCronJob, err error) { + result = &v1.ServiceCronJob{} + err = c.client.Patch(pt). + Resource("servicecronjobs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedaemonset.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedaemonset.go new file mode 100644 index 000000000..2fd47ad34 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedaemonset.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceDaemonSetsGetter has a method to return a ServiceDaemonSetInterface. +// A group's client should implement this interface. +type ServiceDaemonSetsGetter interface { + ServiceDaemonSets() ServiceDaemonSetInterface +} + +// ServiceDaemonSetInterface has methods to work with ServiceDaemonSet resources. +type ServiceDaemonSetInterface interface { + Create(ctx context.Context, serviceDaemonSet *v1.ServiceDaemonSet, opts metav1.CreateOptions) (*v1.ServiceDaemonSet, error) + Update(ctx context.Context, serviceDaemonSet *v1.ServiceDaemonSet, opts metav1.UpdateOptions) (*v1.ServiceDaemonSet, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceDaemonSet, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceDaemonSetList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceDaemonSet, err error) + ServiceDaemonSetExpansion +} + +// serviceDaemonSets implements ServiceDaemonSetInterface +type serviceDaemonSets struct { + client rest.Interface +} + +// newServiceDaemonSets returns a ServiceDaemonSets +func newServiceDaemonSets(c *GlobalTsmV1Client) *serviceDaemonSets { + return &serviceDaemonSets{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceDaemonSet, and returns the corresponding serviceDaemonSet object, and an error if there is any. +func (c *serviceDaemonSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceDaemonSet, err error) { + result = &v1.ServiceDaemonSet{} + err = c.client.Get(). + Resource("servicedaemonsets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceDaemonSets that match those selectors. +func (c *serviceDaemonSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceDaemonSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceDaemonSetList{} + err = c.client.Get(). + Resource("servicedaemonsets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceDaemonSets. +func (c *serviceDaemonSets) Watch(ctx context.Context, opts metav1.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(). + Resource("servicedaemonsets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceDaemonSet and creates it. Returns the server's representation of the serviceDaemonSet, and an error, if there is any. +func (c *serviceDaemonSets) Create(ctx context.Context, serviceDaemonSet *v1.ServiceDaemonSet, opts metav1.CreateOptions) (result *v1.ServiceDaemonSet, err error) { + result = &v1.ServiceDaemonSet{} + err = c.client.Post(). + Resource("servicedaemonsets"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceDaemonSet). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceDaemonSet and updates it. Returns the server's representation of the serviceDaemonSet, and an error, if there is any. +func (c *serviceDaemonSets) Update(ctx context.Context, serviceDaemonSet *v1.ServiceDaemonSet, opts metav1.UpdateOptions) (result *v1.ServiceDaemonSet, err error) { + result = &v1.ServiceDaemonSet{} + err = c.client.Put(). + Resource("servicedaemonsets"). + Name(serviceDaemonSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceDaemonSet). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceDaemonSet and deletes it. Returns an error if one occurs. +func (c *serviceDaemonSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicedaemonsets"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceDaemonSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("servicedaemonsets"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceDaemonSet. +func (c *serviceDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceDaemonSet, err error) { + result = &v1.ServiceDaemonSet{} + err = c.client.Patch(pt). + Resource("servicedaemonsets"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedeployment.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedeployment.go new file mode 100644 index 000000000..d83f4d1b3 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedeployment.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceDeploymentsGetter has a method to return a ServiceDeploymentInterface. +// A group's client should implement this interface. +type ServiceDeploymentsGetter interface { + ServiceDeployments() ServiceDeploymentInterface +} + +// ServiceDeploymentInterface has methods to work with ServiceDeployment resources. +type ServiceDeploymentInterface interface { + Create(ctx context.Context, serviceDeployment *v1.ServiceDeployment, opts metav1.CreateOptions) (*v1.ServiceDeployment, error) + Update(ctx context.Context, serviceDeployment *v1.ServiceDeployment, opts metav1.UpdateOptions) (*v1.ServiceDeployment, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceDeployment, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceDeploymentList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceDeployment, err error) + ServiceDeploymentExpansion +} + +// serviceDeployments implements ServiceDeploymentInterface +type serviceDeployments struct { + client rest.Interface +} + +// newServiceDeployments returns a ServiceDeployments +func newServiceDeployments(c *GlobalTsmV1Client) *serviceDeployments { + return &serviceDeployments{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceDeployment, and returns the corresponding serviceDeployment object, and an error if there is any. +func (c *serviceDeployments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceDeployment, err error) { + result = &v1.ServiceDeployment{} + err = c.client.Get(). + Resource("servicedeployments"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceDeployments that match those selectors. +func (c *serviceDeployments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceDeploymentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceDeploymentList{} + err = c.client.Get(). + Resource("servicedeployments"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceDeployments. +func (c *serviceDeployments) Watch(ctx context.Context, opts metav1.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(). + Resource("servicedeployments"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceDeployment and creates it. Returns the server's representation of the serviceDeployment, and an error, if there is any. +func (c *serviceDeployments) Create(ctx context.Context, serviceDeployment *v1.ServiceDeployment, opts metav1.CreateOptions) (result *v1.ServiceDeployment, err error) { + result = &v1.ServiceDeployment{} + err = c.client.Post(). + Resource("servicedeployments"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceDeployment). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceDeployment and updates it. Returns the server's representation of the serviceDeployment, and an error, if there is any. +func (c *serviceDeployments) Update(ctx context.Context, serviceDeployment *v1.ServiceDeployment, opts metav1.UpdateOptions) (result *v1.ServiceDeployment, err error) { + result = &v1.ServiceDeployment{} + err = c.client.Put(). + Resource("servicedeployments"). + Name(serviceDeployment.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceDeployment). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceDeployment and deletes it. Returns an error if one occurs. +func (c *serviceDeployments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicedeployments"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceDeployments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("servicedeployments"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceDeployment. +func (c *serviceDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceDeployment, err error) { + result = &v1.ServiceDeployment{} + err = c.client.Patch(pt). + Resource("servicedeployments"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedeploymentcontainer.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedeploymentcontainer.go new file mode 100644 index 000000000..14fbb811d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedeploymentcontainer.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceDeploymentContainersGetter has a method to return a ServiceDeploymentContainerInterface. +// A group's client should implement this interface. +type ServiceDeploymentContainersGetter interface { + ServiceDeploymentContainers() ServiceDeploymentContainerInterface +} + +// ServiceDeploymentContainerInterface has methods to work with ServiceDeploymentContainer resources. +type ServiceDeploymentContainerInterface interface { + Create(ctx context.Context, serviceDeploymentContainer *v1.ServiceDeploymentContainer, opts metav1.CreateOptions) (*v1.ServiceDeploymentContainer, error) + Update(ctx context.Context, serviceDeploymentContainer *v1.ServiceDeploymentContainer, opts metav1.UpdateOptions) (*v1.ServiceDeploymentContainer, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceDeploymentContainer, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceDeploymentContainerList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceDeploymentContainer, err error) + ServiceDeploymentContainerExpansion +} + +// serviceDeploymentContainers implements ServiceDeploymentContainerInterface +type serviceDeploymentContainers struct { + client rest.Interface +} + +// newServiceDeploymentContainers returns a ServiceDeploymentContainers +func newServiceDeploymentContainers(c *GlobalTsmV1Client) *serviceDeploymentContainers { + return &serviceDeploymentContainers{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceDeploymentContainer, and returns the corresponding serviceDeploymentContainer object, and an error if there is any. +func (c *serviceDeploymentContainers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceDeploymentContainer, err error) { + result = &v1.ServiceDeploymentContainer{} + err = c.client.Get(). + Resource("servicedeploymentcontainers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceDeploymentContainers that match those selectors. +func (c *serviceDeploymentContainers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceDeploymentContainerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceDeploymentContainerList{} + err = c.client.Get(). + Resource("servicedeploymentcontainers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceDeploymentContainers. +func (c *serviceDeploymentContainers) Watch(ctx context.Context, opts metav1.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(). + Resource("servicedeploymentcontainers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceDeploymentContainer and creates it. Returns the server's representation of the serviceDeploymentContainer, and an error, if there is any. +func (c *serviceDeploymentContainers) Create(ctx context.Context, serviceDeploymentContainer *v1.ServiceDeploymentContainer, opts metav1.CreateOptions) (result *v1.ServiceDeploymentContainer, err error) { + result = &v1.ServiceDeploymentContainer{} + err = c.client.Post(). + Resource("servicedeploymentcontainers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceDeploymentContainer). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceDeploymentContainer and updates it. Returns the server's representation of the serviceDeploymentContainer, and an error, if there is any. +func (c *serviceDeploymentContainers) Update(ctx context.Context, serviceDeploymentContainer *v1.ServiceDeploymentContainer, opts metav1.UpdateOptions) (result *v1.ServiceDeploymentContainer, err error) { + result = &v1.ServiceDeploymentContainer{} + err = c.client.Put(). + Resource("servicedeploymentcontainers"). + Name(serviceDeploymentContainer.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceDeploymentContainer). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceDeploymentContainer and deletes it. Returns an error if one occurs. +func (c *serviceDeploymentContainers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicedeploymentcontainers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceDeploymentContainers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("servicedeploymentcontainers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceDeploymentContainer. +func (c *serviceDeploymentContainers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceDeploymentContainer, err error) { + result = &v1.ServiceDeploymentContainer{} + err = c.client.Patch(pt). + Resource("servicedeploymentcontainers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedirectoryentryconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedirectoryentryconfig.go new file mode 100644 index 000000000..861852584 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedirectoryentryconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceDirectoryEntryConfigsGetter has a method to return a ServiceDirectoryEntryConfigInterface. +// A group's client should implement this interface. +type ServiceDirectoryEntryConfigsGetter interface { + ServiceDirectoryEntryConfigs() ServiceDirectoryEntryConfigInterface +} + +// ServiceDirectoryEntryConfigInterface has methods to work with ServiceDirectoryEntryConfig resources. +type ServiceDirectoryEntryConfigInterface interface { + Create(ctx context.Context, serviceDirectoryEntryConfig *v1.ServiceDirectoryEntryConfig, opts metav1.CreateOptions) (*v1.ServiceDirectoryEntryConfig, error) + Update(ctx context.Context, serviceDirectoryEntryConfig *v1.ServiceDirectoryEntryConfig, opts metav1.UpdateOptions) (*v1.ServiceDirectoryEntryConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceDirectoryEntryConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceDirectoryEntryConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceDirectoryEntryConfig, err error) + ServiceDirectoryEntryConfigExpansion +} + +// serviceDirectoryEntryConfigs implements ServiceDirectoryEntryConfigInterface +type serviceDirectoryEntryConfigs struct { + client rest.Interface +} + +// newServiceDirectoryEntryConfigs returns a ServiceDirectoryEntryConfigs +func newServiceDirectoryEntryConfigs(c *GlobalTsmV1Client) *serviceDirectoryEntryConfigs { + return &serviceDirectoryEntryConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceDirectoryEntryConfig, and returns the corresponding serviceDirectoryEntryConfig object, and an error if there is any. +func (c *serviceDirectoryEntryConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceDirectoryEntryConfig, err error) { + result = &v1.ServiceDirectoryEntryConfig{} + err = c.client.Get(). + Resource("servicedirectoryentryconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceDirectoryEntryConfigs that match those selectors. +func (c *serviceDirectoryEntryConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceDirectoryEntryConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceDirectoryEntryConfigList{} + err = c.client.Get(). + Resource("servicedirectoryentryconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceDirectoryEntryConfigs. +func (c *serviceDirectoryEntryConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("servicedirectoryentryconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceDirectoryEntryConfig and creates it. Returns the server's representation of the serviceDirectoryEntryConfig, and an error, if there is any. +func (c *serviceDirectoryEntryConfigs) Create(ctx context.Context, serviceDirectoryEntryConfig *v1.ServiceDirectoryEntryConfig, opts metav1.CreateOptions) (result *v1.ServiceDirectoryEntryConfig, err error) { + result = &v1.ServiceDirectoryEntryConfig{} + err = c.client.Post(). + Resource("servicedirectoryentryconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceDirectoryEntryConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceDirectoryEntryConfig and updates it. Returns the server's representation of the serviceDirectoryEntryConfig, and an error, if there is any. +func (c *serviceDirectoryEntryConfigs) Update(ctx context.Context, serviceDirectoryEntryConfig *v1.ServiceDirectoryEntryConfig, opts metav1.UpdateOptions) (result *v1.ServiceDirectoryEntryConfig, err error) { + result = &v1.ServiceDirectoryEntryConfig{} + err = c.client.Put(). + Resource("servicedirectoryentryconfigs"). + Name(serviceDirectoryEntryConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceDirectoryEntryConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceDirectoryEntryConfig and deletes it. Returns an error if one occurs. +func (c *serviceDirectoryEntryConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicedirectoryentryconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceDirectoryEntryConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("servicedirectoryentryconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceDirectoryEntryConfig. +func (c *serviceDirectoryEntryConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceDirectoryEntryConfig, err error) { + result = &v1.ServiceDirectoryEntryConfig{} + err = c.client.Patch(pt). + Resource("servicedirectoryentryconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedirectoryn.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedirectoryn.go new file mode 100644 index 000000000..4cba01747 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedirectoryn.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceDirectoryNsGetter has a method to return a ServiceDirectoryNInterface. +// A group's client should implement this interface. +type ServiceDirectoryNsGetter interface { + ServiceDirectoryNs() ServiceDirectoryNInterface +} + +// ServiceDirectoryNInterface has methods to work with ServiceDirectoryN resources. +type ServiceDirectoryNInterface interface { + Create(ctx context.Context, serviceDirectoryN *v1.ServiceDirectoryN, opts metav1.CreateOptions) (*v1.ServiceDirectoryN, error) + Update(ctx context.Context, serviceDirectoryN *v1.ServiceDirectoryN, opts metav1.UpdateOptions) (*v1.ServiceDirectoryN, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceDirectoryN, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceDirectoryNList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceDirectoryN, err error) + ServiceDirectoryNExpansion +} + +// serviceDirectoryNs implements ServiceDirectoryNInterface +type serviceDirectoryNs struct { + client rest.Interface +} + +// newServiceDirectoryNs returns a ServiceDirectoryNs +func newServiceDirectoryNs(c *GlobalTsmV1Client) *serviceDirectoryNs { + return &serviceDirectoryNs{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceDirectoryN, and returns the corresponding serviceDirectoryN object, and an error if there is any. +func (c *serviceDirectoryNs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceDirectoryN, err error) { + result = &v1.ServiceDirectoryN{} + err = c.client.Get(). + Resource("servicedirectoryns"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceDirectoryNs that match those selectors. +func (c *serviceDirectoryNs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceDirectoryNList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceDirectoryNList{} + err = c.client.Get(). + Resource("servicedirectoryns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceDirectoryNs. +func (c *serviceDirectoryNs) Watch(ctx context.Context, opts metav1.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(). + Resource("servicedirectoryns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceDirectoryN and creates it. Returns the server's representation of the serviceDirectoryN, and an error, if there is any. +func (c *serviceDirectoryNs) Create(ctx context.Context, serviceDirectoryN *v1.ServiceDirectoryN, opts metav1.CreateOptions) (result *v1.ServiceDirectoryN, err error) { + result = &v1.ServiceDirectoryN{} + err = c.client.Post(). + Resource("servicedirectoryns"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceDirectoryN). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceDirectoryN and updates it. Returns the server's representation of the serviceDirectoryN, and an error, if there is any. +func (c *serviceDirectoryNs) Update(ctx context.Context, serviceDirectoryN *v1.ServiceDirectoryN, opts metav1.UpdateOptions) (result *v1.ServiceDirectoryN, err error) { + result = &v1.ServiceDirectoryN{} + err = c.client.Put(). + Resource("servicedirectoryns"). + Name(serviceDirectoryN.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceDirectoryN). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceDirectoryN and deletes it. Returns an error if one occurs. +func (c *serviceDirectoryNs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicedirectoryns"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceDirectoryNs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("servicedirectoryns"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceDirectoryN. +func (c *serviceDirectoryNs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceDirectoryN, err error) { + result = &v1.ServiceDirectoryN{} + err = c.client.Patch(pt). + Resource("servicedirectoryns"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedirectoryrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedirectoryrt.go new file mode 100644 index 000000000..301371869 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedirectoryrt.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceDirectoryRTsGetter has a method to return a ServiceDirectoryRTInterface. +// A group's client should implement this interface. +type ServiceDirectoryRTsGetter interface { + ServiceDirectoryRTs() ServiceDirectoryRTInterface +} + +// ServiceDirectoryRTInterface has methods to work with ServiceDirectoryRT resources. +type ServiceDirectoryRTInterface interface { + Create(ctx context.Context, serviceDirectoryRT *v1.ServiceDirectoryRT, opts metav1.CreateOptions) (*v1.ServiceDirectoryRT, error) + Update(ctx context.Context, serviceDirectoryRT *v1.ServiceDirectoryRT, opts metav1.UpdateOptions) (*v1.ServiceDirectoryRT, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceDirectoryRT, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceDirectoryRTList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceDirectoryRT, err error) + ServiceDirectoryRTExpansion +} + +// serviceDirectoryRTs implements ServiceDirectoryRTInterface +type serviceDirectoryRTs struct { + client rest.Interface +} + +// newServiceDirectoryRTs returns a ServiceDirectoryRTs +func newServiceDirectoryRTs(c *GlobalTsmV1Client) *serviceDirectoryRTs { + return &serviceDirectoryRTs{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceDirectoryRT, and returns the corresponding serviceDirectoryRT object, and an error if there is any. +func (c *serviceDirectoryRTs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceDirectoryRT, err error) { + result = &v1.ServiceDirectoryRT{} + err = c.client.Get(). + Resource("servicedirectoryrts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceDirectoryRTs that match those selectors. +func (c *serviceDirectoryRTs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceDirectoryRTList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceDirectoryRTList{} + err = c.client.Get(). + Resource("servicedirectoryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceDirectoryRTs. +func (c *serviceDirectoryRTs) Watch(ctx context.Context, opts metav1.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(). + Resource("servicedirectoryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceDirectoryRT and creates it. Returns the server's representation of the serviceDirectoryRT, and an error, if there is any. +func (c *serviceDirectoryRTs) Create(ctx context.Context, serviceDirectoryRT *v1.ServiceDirectoryRT, opts metav1.CreateOptions) (result *v1.ServiceDirectoryRT, err error) { + result = &v1.ServiceDirectoryRT{} + err = c.client.Post(). + Resource("servicedirectoryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceDirectoryRT). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceDirectoryRT and updates it. Returns the server's representation of the serviceDirectoryRT, and an error, if there is any. +func (c *serviceDirectoryRTs) Update(ctx context.Context, serviceDirectoryRT *v1.ServiceDirectoryRT, opts metav1.UpdateOptions) (result *v1.ServiceDirectoryRT, err error) { + result = &v1.ServiceDirectoryRT{} + err = c.client.Put(). + Resource("servicedirectoryrts"). + Name(serviceDirectoryRT.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceDirectoryRT). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceDirectoryRT and deletes it. Returns an error if one occurs. +func (c *serviceDirectoryRTs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicedirectoryrts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceDirectoryRTs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("servicedirectoryrts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceDirectoryRT. +func (c *serviceDirectoryRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceDirectoryRT, err error) { + result = &v1.ServiceDirectoryRT{} + err = c.client.Patch(pt). + Resource("servicedirectoryrts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolder.go new file mode 100644 index 000000000..98e94d171 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolder.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceDirectoryRTFoldersGetter has a method to return a ServiceDirectoryRTFolderInterface. +// A group's client should implement this interface. +type ServiceDirectoryRTFoldersGetter interface { + ServiceDirectoryRTFolders() ServiceDirectoryRTFolderInterface +} + +// ServiceDirectoryRTFolderInterface has methods to work with ServiceDirectoryRTFolder resources. +type ServiceDirectoryRTFolderInterface interface { + Create(ctx context.Context, serviceDirectoryRTFolder *v1.ServiceDirectoryRTFolder, opts metav1.CreateOptions) (*v1.ServiceDirectoryRTFolder, error) + Update(ctx context.Context, serviceDirectoryRTFolder *v1.ServiceDirectoryRTFolder, opts metav1.UpdateOptions) (*v1.ServiceDirectoryRTFolder, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceDirectoryRTFolder, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceDirectoryRTFolderList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceDirectoryRTFolder, err error) + ServiceDirectoryRTFolderExpansion +} + +// serviceDirectoryRTFolders implements ServiceDirectoryRTFolderInterface +type serviceDirectoryRTFolders struct { + client rest.Interface +} + +// newServiceDirectoryRTFolders returns a ServiceDirectoryRTFolders +func newServiceDirectoryRTFolders(c *GlobalTsmV1Client) *serviceDirectoryRTFolders { + return &serviceDirectoryRTFolders{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceDirectoryRTFolder, and returns the corresponding serviceDirectoryRTFolder object, and an error if there is any. +func (c *serviceDirectoryRTFolders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceDirectoryRTFolder, err error) { + result = &v1.ServiceDirectoryRTFolder{} + err = c.client.Get(). + Resource("servicedirectoryrtfolders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceDirectoryRTFolders that match those selectors. +func (c *serviceDirectoryRTFolders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceDirectoryRTFolderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceDirectoryRTFolderList{} + err = c.client.Get(). + Resource("servicedirectoryrtfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceDirectoryRTFolders. +func (c *serviceDirectoryRTFolders) Watch(ctx context.Context, opts metav1.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(). + Resource("servicedirectoryrtfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceDirectoryRTFolder and creates it. Returns the server's representation of the serviceDirectoryRTFolder, and an error, if there is any. +func (c *serviceDirectoryRTFolders) Create(ctx context.Context, serviceDirectoryRTFolder *v1.ServiceDirectoryRTFolder, opts metav1.CreateOptions) (result *v1.ServiceDirectoryRTFolder, err error) { + result = &v1.ServiceDirectoryRTFolder{} + err = c.client.Post(). + Resource("servicedirectoryrtfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceDirectoryRTFolder). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceDirectoryRTFolder and updates it. Returns the server's representation of the serviceDirectoryRTFolder, and an error, if there is any. +func (c *serviceDirectoryRTFolders) Update(ctx context.Context, serviceDirectoryRTFolder *v1.ServiceDirectoryRTFolder, opts metav1.UpdateOptions) (result *v1.ServiceDirectoryRTFolder, err error) { + result = &v1.ServiceDirectoryRTFolder{} + err = c.client.Put(). + Resource("servicedirectoryrtfolders"). + Name(serviceDirectoryRTFolder.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceDirectoryRTFolder). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceDirectoryRTFolder and deletes it. Returns an error if one occurs. +func (c *serviceDirectoryRTFolders) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicedirectoryrtfolders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceDirectoryRTFolders) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("servicedirectoryrtfolders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceDirectoryRTFolder. +func (c *serviceDirectoryRTFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceDirectoryRTFolder, err error) { + result = &v1.ServiceDirectoryRTFolder{} + err = c.client.Patch(pt). + Resource("servicedirectoryrtfolders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolderentry.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolderentry.go new file mode 100644 index 000000000..ee9ef667e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolderentry.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceDirectoryRTFolderEntriesGetter has a method to return a ServiceDirectoryRTFolderEntryInterface. +// A group's client should implement this interface. +type ServiceDirectoryRTFolderEntriesGetter interface { + ServiceDirectoryRTFolderEntries() ServiceDirectoryRTFolderEntryInterface +} + +// ServiceDirectoryRTFolderEntryInterface has methods to work with ServiceDirectoryRTFolderEntry resources. +type ServiceDirectoryRTFolderEntryInterface interface { + Create(ctx context.Context, serviceDirectoryRTFolderEntry *v1.ServiceDirectoryRTFolderEntry, opts metav1.CreateOptions) (*v1.ServiceDirectoryRTFolderEntry, error) + Update(ctx context.Context, serviceDirectoryRTFolderEntry *v1.ServiceDirectoryRTFolderEntry, opts metav1.UpdateOptions) (*v1.ServiceDirectoryRTFolderEntry, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceDirectoryRTFolderEntry, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceDirectoryRTFolderEntryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceDirectoryRTFolderEntry, err error) + ServiceDirectoryRTFolderEntryExpansion +} + +// serviceDirectoryRTFolderEntries implements ServiceDirectoryRTFolderEntryInterface +type serviceDirectoryRTFolderEntries struct { + client rest.Interface +} + +// newServiceDirectoryRTFolderEntries returns a ServiceDirectoryRTFolderEntries +func newServiceDirectoryRTFolderEntries(c *GlobalTsmV1Client) *serviceDirectoryRTFolderEntries { + return &serviceDirectoryRTFolderEntries{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceDirectoryRTFolderEntry, and returns the corresponding serviceDirectoryRTFolderEntry object, and an error if there is any. +func (c *serviceDirectoryRTFolderEntries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceDirectoryRTFolderEntry, err error) { + result = &v1.ServiceDirectoryRTFolderEntry{} + err = c.client.Get(). + Resource("servicedirectoryrtfolderentries"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceDirectoryRTFolderEntries that match those selectors. +func (c *serviceDirectoryRTFolderEntries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceDirectoryRTFolderEntryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceDirectoryRTFolderEntryList{} + err = c.client.Get(). + Resource("servicedirectoryrtfolderentries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceDirectoryRTFolderEntries. +func (c *serviceDirectoryRTFolderEntries) Watch(ctx context.Context, opts metav1.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(). + Resource("servicedirectoryrtfolderentries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceDirectoryRTFolderEntry and creates it. Returns the server's representation of the serviceDirectoryRTFolderEntry, and an error, if there is any. +func (c *serviceDirectoryRTFolderEntries) Create(ctx context.Context, serviceDirectoryRTFolderEntry *v1.ServiceDirectoryRTFolderEntry, opts metav1.CreateOptions) (result *v1.ServiceDirectoryRTFolderEntry, err error) { + result = &v1.ServiceDirectoryRTFolderEntry{} + err = c.client.Post(). + Resource("servicedirectoryrtfolderentries"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceDirectoryRTFolderEntry). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceDirectoryRTFolderEntry and updates it. Returns the server's representation of the serviceDirectoryRTFolderEntry, and an error, if there is any. +func (c *serviceDirectoryRTFolderEntries) Update(ctx context.Context, serviceDirectoryRTFolderEntry *v1.ServiceDirectoryRTFolderEntry, opts metav1.UpdateOptions) (result *v1.ServiceDirectoryRTFolderEntry, err error) { + result = &v1.ServiceDirectoryRTFolderEntry{} + err = c.client.Put(). + Resource("servicedirectoryrtfolderentries"). + Name(serviceDirectoryRTFolderEntry.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceDirectoryRTFolderEntry). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceDirectoryRTFolderEntry and deletes it. Returns an error if one occurs. +func (c *serviceDirectoryRTFolderEntries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicedirectoryrtfolderentries"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceDirectoryRTFolderEntries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("servicedirectoryrtfolderentries"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceDirectoryRTFolderEntry. +func (c *serviceDirectoryRTFolderEntries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceDirectoryRTFolderEntry, err error) { + result = &v1.ServiceDirectoryRTFolderEntry{} + err = c.client.Patch(pt). + Resource("servicedirectoryrtfolderentries"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceentry.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceentry.go new file mode 100644 index 000000000..bb4b325c4 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceentry.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceEntriesGetter has a method to return a ServiceEntryInterface. +// A group's client should implement this interface. +type ServiceEntriesGetter interface { + ServiceEntries() ServiceEntryInterface +} + +// ServiceEntryInterface has methods to work with ServiceEntry resources. +type ServiceEntryInterface interface { + Create(ctx context.Context, serviceEntry *v1.ServiceEntry, opts metav1.CreateOptions) (*v1.ServiceEntry, error) + Update(ctx context.Context, serviceEntry *v1.ServiceEntry, opts metav1.UpdateOptions) (*v1.ServiceEntry, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceEntry, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceEntryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceEntry, err error) + ServiceEntryExpansion +} + +// serviceEntries implements ServiceEntryInterface +type serviceEntries struct { + client rest.Interface +} + +// newServiceEntries returns a ServiceEntries +func newServiceEntries(c *GlobalTsmV1Client) *serviceEntries { + return &serviceEntries{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceEntry, and returns the corresponding serviceEntry object, and an error if there is any. +func (c *serviceEntries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceEntry, err error) { + result = &v1.ServiceEntry{} + err = c.client.Get(). + Resource("serviceentries"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceEntries that match those selectors. +func (c *serviceEntries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceEntryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceEntryList{} + err = c.client.Get(). + Resource("serviceentries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceEntries. +func (c *serviceEntries) Watch(ctx context.Context, opts metav1.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(). + Resource("serviceentries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceEntry and creates it. Returns the server's representation of the serviceEntry, and an error, if there is any. +func (c *serviceEntries) Create(ctx context.Context, serviceEntry *v1.ServiceEntry, opts metav1.CreateOptions) (result *v1.ServiceEntry, err error) { + result = &v1.ServiceEntry{} + err = c.client.Post(). + Resource("serviceentries"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceEntry). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceEntry and updates it. Returns the server's representation of the serviceEntry, and an error, if there is any. +func (c *serviceEntries) Update(ctx context.Context, serviceEntry *v1.ServiceEntry, opts metav1.UpdateOptions) (result *v1.ServiceEntry, err error) { + result = &v1.ServiceEntry{} + err = c.client.Put(). + Resource("serviceentries"). + Name(serviceEntry.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceEntry). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceEntry and deletes it. Returns an error if one occurs. +func (c *serviceEntries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("serviceentries"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceEntries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("serviceentries"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceEntry. +func (c *serviceEntries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceEntry, err error) { + result = &v1.ServiceEntry{} + err = c.client.Patch(pt). + Resource("serviceentries"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceentryconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceentryconfig.go new file mode 100644 index 000000000..e0fec0e0d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceentryconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceEntryConfigsGetter has a method to return a ServiceEntryConfigInterface. +// A group's client should implement this interface. +type ServiceEntryConfigsGetter interface { + ServiceEntryConfigs() ServiceEntryConfigInterface +} + +// ServiceEntryConfigInterface has methods to work with ServiceEntryConfig resources. +type ServiceEntryConfigInterface interface { + Create(ctx context.Context, serviceEntryConfig *v1.ServiceEntryConfig, opts metav1.CreateOptions) (*v1.ServiceEntryConfig, error) + Update(ctx context.Context, serviceEntryConfig *v1.ServiceEntryConfig, opts metav1.UpdateOptions) (*v1.ServiceEntryConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceEntryConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceEntryConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceEntryConfig, err error) + ServiceEntryConfigExpansion +} + +// serviceEntryConfigs implements ServiceEntryConfigInterface +type serviceEntryConfigs struct { + client rest.Interface +} + +// newServiceEntryConfigs returns a ServiceEntryConfigs +func newServiceEntryConfigs(c *GlobalTsmV1Client) *serviceEntryConfigs { + return &serviceEntryConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceEntryConfig, and returns the corresponding serviceEntryConfig object, and an error if there is any. +func (c *serviceEntryConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceEntryConfig, err error) { + result = &v1.ServiceEntryConfig{} + err = c.client.Get(). + Resource("serviceentryconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceEntryConfigs that match those selectors. +func (c *serviceEntryConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceEntryConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceEntryConfigList{} + err = c.client.Get(). + Resource("serviceentryconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceEntryConfigs. +func (c *serviceEntryConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("serviceentryconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceEntryConfig and creates it. Returns the server's representation of the serviceEntryConfig, and an error, if there is any. +func (c *serviceEntryConfigs) Create(ctx context.Context, serviceEntryConfig *v1.ServiceEntryConfig, opts metav1.CreateOptions) (result *v1.ServiceEntryConfig, err error) { + result = &v1.ServiceEntryConfig{} + err = c.client.Post(). + Resource("serviceentryconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceEntryConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceEntryConfig and updates it. Returns the server's representation of the serviceEntryConfig, and an error, if there is any. +func (c *serviceEntryConfigs) Update(ctx context.Context, serviceEntryConfig *v1.ServiceEntryConfig, opts metav1.UpdateOptions) (result *v1.ServiceEntryConfig, err error) { + result = &v1.ServiceEntryConfig{} + err = c.client.Put(). + Resource("serviceentryconfigs"). + Name(serviceEntryConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceEntryConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceEntryConfig and deletes it. Returns an error if one occurs. +func (c *serviceEntryConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("serviceentryconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceEntryConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("serviceentryconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceEntryConfig. +func (c *serviceEntryConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceEntryConfig, err error) { + result = &v1.ServiceEntryConfig{} + err = c.client.Patch(pt). + Resource("serviceentryconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceinstance.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceinstance.go new file mode 100644 index 000000000..3df329a90 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceinstance.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceInstancesGetter has a method to return a ServiceInstanceInterface. +// A group's client should implement this interface. +type ServiceInstancesGetter interface { + ServiceInstances() ServiceInstanceInterface +} + +// ServiceInstanceInterface has methods to work with ServiceInstance resources. +type ServiceInstanceInterface interface { + Create(ctx context.Context, serviceInstance *v1.ServiceInstance, opts metav1.CreateOptions) (*v1.ServiceInstance, error) + Update(ctx context.Context, serviceInstance *v1.ServiceInstance, opts metav1.UpdateOptions) (*v1.ServiceInstance, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceInstance, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceInstanceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceInstance, err error) + ServiceInstanceExpansion +} + +// serviceInstances implements ServiceInstanceInterface +type serviceInstances struct { + client rest.Interface +} + +// newServiceInstances returns a ServiceInstances +func newServiceInstances(c *GlobalTsmV1Client) *serviceInstances { + return &serviceInstances{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceInstance, and returns the corresponding serviceInstance object, and an error if there is any. +func (c *serviceInstances) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceInstance, err error) { + result = &v1.ServiceInstance{} + err = c.client.Get(). + Resource("serviceinstances"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceInstances that match those selectors. +func (c *serviceInstances) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceInstanceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceInstanceList{} + err = c.client.Get(). + Resource("serviceinstances"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceInstances. +func (c *serviceInstances) Watch(ctx context.Context, opts metav1.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(). + Resource("serviceinstances"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceInstance and creates it. Returns the server's representation of the serviceInstance, and an error, if there is any. +func (c *serviceInstances) Create(ctx context.Context, serviceInstance *v1.ServiceInstance, opts metav1.CreateOptions) (result *v1.ServiceInstance, err error) { + result = &v1.ServiceInstance{} + err = c.client.Post(). + Resource("serviceinstances"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceInstance). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceInstance and updates it. Returns the server's representation of the serviceInstance, and an error, if there is any. +func (c *serviceInstances) Update(ctx context.Context, serviceInstance *v1.ServiceInstance, opts metav1.UpdateOptions) (result *v1.ServiceInstance, err error) { + result = &v1.ServiceInstance{} + err = c.client.Put(). + Resource("serviceinstances"). + Name(serviceInstance.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceInstance). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceInstance and deletes it. Returns an error if one occurs. +func (c *serviceInstances) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("serviceinstances"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceInstances) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("serviceinstances"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceInstance. +func (c *serviceInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceInstance, err error) { + result = &v1.ServiceInstance{} + err = c.client.Patch(pt). + Resource("serviceinstances"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceinstancecontainer.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceinstancecontainer.go new file mode 100644 index 000000000..480c2328a --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceinstancecontainer.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceInstanceContainersGetter has a method to return a ServiceInstanceContainerInterface. +// A group's client should implement this interface. +type ServiceInstanceContainersGetter interface { + ServiceInstanceContainers() ServiceInstanceContainerInterface +} + +// ServiceInstanceContainerInterface has methods to work with ServiceInstanceContainer resources. +type ServiceInstanceContainerInterface interface { + Create(ctx context.Context, serviceInstanceContainer *v1.ServiceInstanceContainer, opts metav1.CreateOptions) (*v1.ServiceInstanceContainer, error) + Update(ctx context.Context, serviceInstanceContainer *v1.ServiceInstanceContainer, opts metav1.UpdateOptions) (*v1.ServiceInstanceContainer, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceInstanceContainer, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceInstanceContainerList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceInstanceContainer, err error) + ServiceInstanceContainerExpansion +} + +// serviceInstanceContainers implements ServiceInstanceContainerInterface +type serviceInstanceContainers struct { + client rest.Interface +} + +// newServiceInstanceContainers returns a ServiceInstanceContainers +func newServiceInstanceContainers(c *GlobalTsmV1Client) *serviceInstanceContainers { + return &serviceInstanceContainers{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceInstanceContainer, and returns the corresponding serviceInstanceContainer object, and an error if there is any. +func (c *serviceInstanceContainers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceInstanceContainer, err error) { + result = &v1.ServiceInstanceContainer{} + err = c.client.Get(). + Resource("serviceinstancecontainers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceInstanceContainers that match those selectors. +func (c *serviceInstanceContainers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceInstanceContainerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceInstanceContainerList{} + err = c.client.Get(). + Resource("serviceinstancecontainers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceInstanceContainers. +func (c *serviceInstanceContainers) Watch(ctx context.Context, opts metav1.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(). + Resource("serviceinstancecontainers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceInstanceContainer and creates it. Returns the server's representation of the serviceInstanceContainer, and an error, if there is any. +func (c *serviceInstanceContainers) Create(ctx context.Context, serviceInstanceContainer *v1.ServiceInstanceContainer, opts metav1.CreateOptions) (result *v1.ServiceInstanceContainer, err error) { + result = &v1.ServiceInstanceContainer{} + err = c.client.Post(). + Resource("serviceinstancecontainers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceInstanceContainer). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceInstanceContainer and updates it. Returns the server's representation of the serviceInstanceContainer, and an error, if there is any. +func (c *serviceInstanceContainers) Update(ctx context.Context, serviceInstanceContainer *v1.ServiceInstanceContainer, opts metav1.UpdateOptions) (result *v1.ServiceInstanceContainer, err error) { + result = &v1.ServiceInstanceContainer{} + err = c.client.Put(). + Resource("serviceinstancecontainers"). + Name(serviceInstanceContainer.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceInstanceContainer). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceInstanceContainer and deletes it. Returns an error if one occurs. +func (c *serviceInstanceContainers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("serviceinstancecontainers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceInstanceContainers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("serviceinstancecontainers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceInstanceContainer. +func (c *serviceInstanceContainers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceInstanceContainer, err error) { + result = &v1.ServiceInstanceContainer{} + err = c.client.Patch(pt). + Resource("serviceinstancecontainers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicejob.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicejob.go new file mode 100644 index 000000000..b56e76704 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicejob.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceJobsGetter has a method to return a ServiceJobInterface. +// A group's client should implement this interface. +type ServiceJobsGetter interface { + ServiceJobs() ServiceJobInterface +} + +// ServiceJobInterface has methods to work with ServiceJob resources. +type ServiceJobInterface interface { + Create(ctx context.Context, serviceJob *v1.ServiceJob, opts metav1.CreateOptions) (*v1.ServiceJob, error) + Update(ctx context.Context, serviceJob *v1.ServiceJob, opts metav1.UpdateOptions) (*v1.ServiceJob, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceJob, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceJobList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceJob, err error) + ServiceJobExpansion +} + +// serviceJobs implements ServiceJobInterface +type serviceJobs struct { + client rest.Interface +} + +// newServiceJobs returns a ServiceJobs +func newServiceJobs(c *GlobalTsmV1Client) *serviceJobs { + return &serviceJobs{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceJob, and returns the corresponding serviceJob object, and an error if there is any. +func (c *serviceJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceJob, err error) { + result = &v1.ServiceJob{} + err = c.client.Get(). + Resource("servicejobs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceJobs that match those selectors. +func (c *serviceJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceJobList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceJobList{} + err = c.client.Get(). + Resource("servicejobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceJobs. +func (c *serviceJobs) Watch(ctx context.Context, opts metav1.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(). + Resource("servicejobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceJob and creates it. Returns the server's representation of the serviceJob, and an error, if there is any. +func (c *serviceJobs) Create(ctx context.Context, serviceJob *v1.ServiceJob, opts metav1.CreateOptions) (result *v1.ServiceJob, err error) { + result = &v1.ServiceJob{} + err = c.client.Post(). + Resource("servicejobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceJob). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceJob and updates it. Returns the server's representation of the serviceJob, and an error, if there is any. +func (c *serviceJobs) Update(ctx context.Context, serviceJob *v1.ServiceJob, opts metav1.UpdateOptions) (result *v1.ServiceJob, err error) { + result = &v1.ServiceJob{} + err = c.client.Put(). + Resource("servicejobs"). + Name(serviceJob.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceJob). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceJob and deletes it. Returns an error if one occurs. +func (c *serviceJobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicejobs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("servicejobs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceJob. +func (c *serviceJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceJob, err error) { + result = &v1.ServiceJob{} + err = c.client.Patch(pt). + Resource("servicejobs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicelevelobjective.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicelevelobjective.go new file mode 100644 index 000000000..36fe87871 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicelevelobjective.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceLevelObjectivesGetter has a method to return a ServiceLevelObjectiveInterface. +// A group's client should implement this interface. +type ServiceLevelObjectivesGetter interface { + ServiceLevelObjectives() ServiceLevelObjectiveInterface +} + +// ServiceLevelObjectiveInterface has methods to work with ServiceLevelObjective resources. +type ServiceLevelObjectiveInterface interface { + Create(ctx context.Context, serviceLevelObjective *v1.ServiceLevelObjective, opts metav1.CreateOptions) (*v1.ServiceLevelObjective, error) + Update(ctx context.Context, serviceLevelObjective *v1.ServiceLevelObjective, opts metav1.UpdateOptions) (*v1.ServiceLevelObjective, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceLevelObjective, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceLevelObjectiveList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceLevelObjective, err error) + ServiceLevelObjectiveExpansion +} + +// serviceLevelObjectives implements ServiceLevelObjectiveInterface +type serviceLevelObjectives struct { + client rest.Interface +} + +// newServiceLevelObjectives returns a ServiceLevelObjectives +func newServiceLevelObjectives(c *GlobalTsmV1Client) *serviceLevelObjectives { + return &serviceLevelObjectives{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceLevelObjective, and returns the corresponding serviceLevelObjective object, and an error if there is any. +func (c *serviceLevelObjectives) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceLevelObjective, err error) { + result = &v1.ServiceLevelObjective{} + err = c.client.Get(). + Resource("servicelevelobjectives"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceLevelObjectives that match those selectors. +func (c *serviceLevelObjectives) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceLevelObjectiveList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceLevelObjectiveList{} + err = c.client.Get(). + Resource("servicelevelobjectives"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceLevelObjectives. +func (c *serviceLevelObjectives) Watch(ctx context.Context, opts metav1.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(). + Resource("servicelevelobjectives"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceLevelObjective and creates it. Returns the server's representation of the serviceLevelObjective, and an error, if there is any. +func (c *serviceLevelObjectives) Create(ctx context.Context, serviceLevelObjective *v1.ServiceLevelObjective, opts metav1.CreateOptions) (result *v1.ServiceLevelObjective, err error) { + result = &v1.ServiceLevelObjective{} + err = c.client.Post(). + Resource("servicelevelobjectives"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceLevelObjective). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceLevelObjective and updates it. Returns the server's representation of the serviceLevelObjective, and an error, if there is any. +func (c *serviceLevelObjectives) Update(ctx context.Context, serviceLevelObjective *v1.ServiceLevelObjective, opts metav1.UpdateOptions) (result *v1.ServiceLevelObjective, err error) { + result = &v1.ServiceLevelObjective{} + err = c.client.Put(). + Resource("servicelevelobjectives"). + Name(serviceLevelObjective.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceLevelObjective). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceLevelObjective and deletes it. Returns an error if one occurs. +func (c *serviceLevelObjectives) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicelevelobjectives"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceLevelObjectives) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("servicelevelobjectives"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceLevelObjective. +func (c *serviceLevelObjectives) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceLevelObjective, err error) { + result = &v1.ServiceLevelObjective{} + err = c.client.Patch(pt). + Resource("servicelevelobjectives"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicelevelobjectivefolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicelevelobjectivefolder.go new file mode 100644 index 000000000..c05ac7e59 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicelevelobjectivefolder.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceLevelObjectiveFoldersGetter has a method to return a ServiceLevelObjectiveFolderInterface. +// A group's client should implement this interface. +type ServiceLevelObjectiveFoldersGetter interface { + ServiceLevelObjectiveFolders() ServiceLevelObjectiveFolderInterface +} + +// ServiceLevelObjectiveFolderInterface has methods to work with ServiceLevelObjectiveFolder resources. +type ServiceLevelObjectiveFolderInterface interface { + Create(ctx context.Context, serviceLevelObjectiveFolder *v1.ServiceLevelObjectiveFolder, opts metav1.CreateOptions) (*v1.ServiceLevelObjectiveFolder, error) + Update(ctx context.Context, serviceLevelObjectiveFolder *v1.ServiceLevelObjectiveFolder, opts metav1.UpdateOptions) (*v1.ServiceLevelObjectiveFolder, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceLevelObjectiveFolder, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceLevelObjectiveFolderList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceLevelObjectiveFolder, err error) + ServiceLevelObjectiveFolderExpansion +} + +// serviceLevelObjectiveFolders implements ServiceLevelObjectiveFolderInterface +type serviceLevelObjectiveFolders struct { + client rest.Interface +} + +// newServiceLevelObjectiveFolders returns a ServiceLevelObjectiveFolders +func newServiceLevelObjectiveFolders(c *GlobalTsmV1Client) *serviceLevelObjectiveFolders { + return &serviceLevelObjectiveFolders{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceLevelObjectiveFolder, and returns the corresponding serviceLevelObjectiveFolder object, and an error if there is any. +func (c *serviceLevelObjectiveFolders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceLevelObjectiveFolder, err error) { + result = &v1.ServiceLevelObjectiveFolder{} + err = c.client.Get(). + Resource("servicelevelobjectivefolders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceLevelObjectiveFolders that match those selectors. +func (c *serviceLevelObjectiveFolders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceLevelObjectiveFolderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceLevelObjectiveFolderList{} + err = c.client.Get(). + Resource("servicelevelobjectivefolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceLevelObjectiveFolders. +func (c *serviceLevelObjectiveFolders) Watch(ctx context.Context, opts metav1.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(). + Resource("servicelevelobjectivefolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceLevelObjectiveFolder and creates it. Returns the server's representation of the serviceLevelObjectiveFolder, and an error, if there is any. +func (c *serviceLevelObjectiveFolders) Create(ctx context.Context, serviceLevelObjectiveFolder *v1.ServiceLevelObjectiveFolder, opts metav1.CreateOptions) (result *v1.ServiceLevelObjectiveFolder, err error) { + result = &v1.ServiceLevelObjectiveFolder{} + err = c.client.Post(). + Resource("servicelevelobjectivefolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceLevelObjectiveFolder). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceLevelObjectiveFolder and updates it. Returns the server's representation of the serviceLevelObjectiveFolder, and an error, if there is any. +func (c *serviceLevelObjectiveFolders) Update(ctx context.Context, serviceLevelObjectiveFolder *v1.ServiceLevelObjectiveFolder, opts metav1.UpdateOptions) (result *v1.ServiceLevelObjectiveFolder, err error) { + result = &v1.ServiceLevelObjectiveFolder{} + err = c.client.Put(). + Resource("servicelevelobjectivefolders"). + Name(serviceLevelObjectiveFolder.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceLevelObjectiveFolder). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceLevelObjectiveFolder and deletes it. Returns an error if one occurs. +func (c *serviceLevelObjectiveFolders) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicelevelobjectivefolders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceLevelObjectiveFolders) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("servicelevelobjectivefolders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceLevelObjectiveFolder. +func (c *serviceLevelObjectiveFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceLevelObjectiveFolder, err error) { + result = &v1.ServiceLevelObjectiveFolder{} + err = c.client.Patch(pt). + Resource("servicelevelobjectivefolders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicereplicaset.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicereplicaset.go new file mode 100644 index 000000000..bf81f5534 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicereplicaset.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceReplicaSetsGetter has a method to return a ServiceReplicaSetInterface. +// A group's client should implement this interface. +type ServiceReplicaSetsGetter interface { + ServiceReplicaSets() ServiceReplicaSetInterface +} + +// ServiceReplicaSetInterface has methods to work with ServiceReplicaSet resources. +type ServiceReplicaSetInterface interface { + Create(ctx context.Context, serviceReplicaSet *v1.ServiceReplicaSet, opts metav1.CreateOptions) (*v1.ServiceReplicaSet, error) + Update(ctx context.Context, serviceReplicaSet *v1.ServiceReplicaSet, opts metav1.UpdateOptions) (*v1.ServiceReplicaSet, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceReplicaSet, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceReplicaSetList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceReplicaSet, err error) + ServiceReplicaSetExpansion +} + +// serviceReplicaSets implements ServiceReplicaSetInterface +type serviceReplicaSets struct { + client rest.Interface +} + +// newServiceReplicaSets returns a ServiceReplicaSets +func newServiceReplicaSets(c *GlobalTsmV1Client) *serviceReplicaSets { + return &serviceReplicaSets{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceReplicaSet, and returns the corresponding serviceReplicaSet object, and an error if there is any. +func (c *serviceReplicaSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceReplicaSet, err error) { + result = &v1.ServiceReplicaSet{} + err = c.client.Get(). + Resource("servicereplicasets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceReplicaSets that match those selectors. +func (c *serviceReplicaSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceReplicaSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceReplicaSetList{} + err = c.client.Get(). + Resource("servicereplicasets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceReplicaSets. +func (c *serviceReplicaSets) Watch(ctx context.Context, opts metav1.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(). + Resource("servicereplicasets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceReplicaSet and creates it. Returns the server's representation of the serviceReplicaSet, and an error, if there is any. +func (c *serviceReplicaSets) Create(ctx context.Context, serviceReplicaSet *v1.ServiceReplicaSet, opts metav1.CreateOptions) (result *v1.ServiceReplicaSet, err error) { + result = &v1.ServiceReplicaSet{} + err = c.client.Post(). + Resource("servicereplicasets"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceReplicaSet). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceReplicaSet and updates it. Returns the server's representation of the serviceReplicaSet, and an error, if there is any. +func (c *serviceReplicaSets) Update(ctx context.Context, serviceReplicaSet *v1.ServiceReplicaSet, opts metav1.UpdateOptions) (result *v1.ServiceReplicaSet, err error) { + result = &v1.ServiceReplicaSet{} + err = c.client.Put(). + Resource("servicereplicasets"). + Name(serviceReplicaSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceReplicaSet). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceReplicaSet and deletes it. Returns an error if one occurs. +func (c *serviceReplicaSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicereplicasets"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceReplicaSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("servicereplicasets"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceReplicaSet. +func (c *serviceReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceReplicaSet, err error) { + result = &v1.ServiceReplicaSet{} + err = c.client.Patch(pt). + Resource("servicereplicasets"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicestatefulset.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicestatefulset.go new file mode 100644 index 000000000..1c38b58ac --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicestatefulset.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceStatefulSetsGetter has a method to return a ServiceStatefulSetInterface. +// A group's client should implement this interface. +type ServiceStatefulSetsGetter interface { + ServiceStatefulSets() ServiceStatefulSetInterface +} + +// ServiceStatefulSetInterface has methods to work with ServiceStatefulSet resources. +type ServiceStatefulSetInterface interface { + Create(ctx context.Context, serviceStatefulSet *v1.ServiceStatefulSet, opts metav1.CreateOptions) (*v1.ServiceStatefulSet, error) + Update(ctx context.Context, serviceStatefulSet *v1.ServiceStatefulSet, opts metav1.UpdateOptions) (*v1.ServiceStatefulSet, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceStatefulSet, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceStatefulSetList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceStatefulSet, err error) + ServiceStatefulSetExpansion +} + +// serviceStatefulSets implements ServiceStatefulSetInterface +type serviceStatefulSets struct { + client rest.Interface +} + +// newServiceStatefulSets returns a ServiceStatefulSets +func newServiceStatefulSets(c *GlobalTsmV1Client) *serviceStatefulSets { + return &serviceStatefulSets{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceStatefulSet, and returns the corresponding serviceStatefulSet object, and an error if there is any. +func (c *serviceStatefulSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceStatefulSet, err error) { + result = &v1.ServiceStatefulSet{} + err = c.client.Get(). + Resource("servicestatefulsets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceStatefulSets that match those selectors. +func (c *serviceStatefulSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceStatefulSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceStatefulSetList{} + err = c.client.Get(). + Resource("servicestatefulsets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceStatefulSets. +func (c *serviceStatefulSets) Watch(ctx context.Context, opts metav1.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(). + Resource("servicestatefulsets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceStatefulSet and creates it. Returns the server's representation of the serviceStatefulSet, and an error, if there is any. +func (c *serviceStatefulSets) Create(ctx context.Context, serviceStatefulSet *v1.ServiceStatefulSet, opts metav1.CreateOptions) (result *v1.ServiceStatefulSet, err error) { + result = &v1.ServiceStatefulSet{} + err = c.client.Post(). + Resource("servicestatefulsets"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceStatefulSet). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceStatefulSet and updates it. Returns the server's representation of the serviceStatefulSet, and an error, if there is any. +func (c *serviceStatefulSets) Update(ctx context.Context, serviceStatefulSet *v1.ServiceStatefulSet, opts metav1.UpdateOptions) (result *v1.ServiceStatefulSet, err error) { + result = &v1.ServiceStatefulSet{} + err = c.client.Put(). + Resource("servicestatefulsets"). + Name(serviceStatefulSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceStatefulSet). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceStatefulSet and deletes it. Returns an error if one occurs. +func (c *serviceStatefulSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicestatefulsets"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceStatefulSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("servicestatefulsets"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceStatefulSet. +func (c *serviceStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceStatefulSet, err error) { + result = &v1.ServiceStatefulSet{} + err = c.client.Patch(pt). + Resource("servicestatefulsets"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicetemplate.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicetemplate.go new file mode 100644 index 000000000..d57cc0bdb --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicetemplate.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceTemplatesGetter has a method to return a ServiceTemplateInterface. +// A group's client should implement this interface. +type ServiceTemplatesGetter interface { + ServiceTemplates() ServiceTemplateInterface +} + +// ServiceTemplateInterface has methods to work with ServiceTemplate resources. +type ServiceTemplateInterface interface { + Create(ctx context.Context, serviceTemplate *v1.ServiceTemplate, opts metav1.CreateOptions) (*v1.ServiceTemplate, error) + Update(ctx context.Context, serviceTemplate *v1.ServiceTemplate, opts metav1.UpdateOptions) (*v1.ServiceTemplate, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceTemplate, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceTemplateList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceTemplate, err error) + ServiceTemplateExpansion +} + +// serviceTemplates implements ServiceTemplateInterface +type serviceTemplates struct { + client rest.Interface +} + +// newServiceTemplates returns a ServiceTemplates +func newServiceTemplates(c *GlobalTsmV1Client) *serviceTemplates { + return &serviceTemplates{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceTemplate, and returns the corresponding serviceTemplate object, and an error if there is any. +func (c *serviceTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceTemplate, err error) { + result = &v1.ServiceTemplate{} + err = c.client.Get(). + Resource("servicetemplates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceTemplates that match those selectors. +func (c *serviceTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceTemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceTemplateList{} + err = c.client.Get(). + Resource("servicetemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceTemplates. +func (c *serviceTemplates) Watch(ctx context.Context, opts metav1.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(). + Resource("servicetemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceTemplate and creates it. Returns the server's representation of the serviceTemplate, and an error, if there is any. +func (c *serviceTemplates) Create(ctx context.Context, serviceTemplate *v1.ServiceTemplate, opts metav1.CreateOptions) (result *v1.ServiceTemplate, err error) { + result = &v1.ServiceTemplate{} + err = c.client.Post(). + Resource("servicetemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceTemplate). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceTemplate and updates it. Returns the server's representation of the serviceTemplate, and an error, if there is any. +func (c *serviceTemplates) Update(ctx context.Context, serviceTemplate *v1.ServiceTemplate, opts metav1.UpdateOptions) (result *v1.ServiceTemplate, err error) { + result = &v1.ServiceTemplate{} + err = c.client.Put(). + Resource("servicetemplates"). + Name(serviceTemplate.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceTemplate). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceTemplate and deletes it. Returns an error if one occurs. +func (c *serviceTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicetemplates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("servicetemplates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceTemplate. +func (c *serviceTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceTemplate, err error) { + result = &v1.ServiceTemplate{} + err = c.client.Patch(pt). + Resource("servicetemplates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicetemplateservicedefinition.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicetemplateservicedefinition.go new file mode 100644 index 000000000..32f265e96 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/servicetemplateservicedefinition.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceTemplateServiceDefinitionsGetter has a method to return a ServiceTemplateServiceDefinitionInterface. +// A group's client should implement this interface. +type ServiceTemplateServiceDefinitionsGetter interface { + ServiceTemplateServiceDefinitions() ServiceTemplateServiceDefinitionInterface +} + +// ServiceTemplateServiceDefinitionInterface has methods to work with ServiceTemplateServiceDefinition resources. +type ServiceTemplateServiceDefinitionInterface interface { + Create(ctx context.Context, serviceTemplateServiceDefinition *v1.ServiceTemplateServiceDefinition, opts metav1.CreateOptions) (*v1.ServiceTemplateServiceDefinition, error) + Update(ctx context.Context, serviceTemplateServiceDefinition *v1.ServiceTemplateServiceDefinition, opts metav1.UpdateOptions) (*v1.ServiceTemplateServiceDefinition, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceTemplateServiceDefinition, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceTemplateServiceDefinitionList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceTemplateServiceDefinition, err error) + ServiceTemplateServiceDefinitionExpansion +} + +// serviceTemplateServiceDefinitions implements ServiceTemplateServiceDefinitionInterface +type serviceTemplateServiceDefinitions struct { + client rest.Interface +} + +// newServiceTemplateServiceDefinitions returns a ServiceTemplateServiceDefinitions +func newServiceTemplateServiceDefinitions(c *GlobalTsmV1Client) *serviceTemplateServiceDefinitions { + return &serviceTemplateServiceDefinitions{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceTemplateServiceDefinition, and returns the corresponding serviceTemplateServiceDefinition object, and an error if there is any. +func (c *serviceTemplateServiceDefinitions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceTemplateServiceDefinition, err error) { + result = &v1.ServiceTemplateServiceDefinition{} + err = c.client.Get(). + Resource("servicetemplateservicedefinitions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceTemplateServiceDefinitions that match those selectors. +func (c *serviceTemplateServiceDefinitions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceTemplateServiceDefinitionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceTemplateServiceDefinitionList{} + err = c.client.Get(). + Resource("servicetemplateservicedefinitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceTemplateServiceDefinitions. +func (c *serviceTemplateServiceDefinitions) Watch(ctx context.Context, opts metav1.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(). + Resource("servicetemplateservicedefinitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceTemplateServiceDefinition and creates it. Returns the server's representation of the serviceTemplateServiceDefinition, and an error, if there is any. +func (c *serviceTemplateServiceDefinitions) Create(ctx context.Context, serviceTemplateServiceDefinition *v1.ServiceTemplateServiceDefinition, opts metav1.CreateOptions) (result *v1.ServiceTemplateServiceDefinition, err error) { + result = &v1.ServiceTemplateServiceDefinition{} + err = c.client.Post(). + Resource("servicetemplateservicedefinitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceTemplateServiceDefinition). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceTemplateServiceDefinition and updates it. Returns the server's representation of the serviceTemplateServiceDefinition, and an error, if there is any. +func (c *serviceTemplateServiceDefinitions) Update(ctx context.Context, serviceTemplateServiceDefinition *v1.ServiceTemplateServiceDefinition, opts metav1.UpdateOptions) (result *v1.ServiceTemplateServiceDefinition, err error) { + result = &v1.ServiceTemplateServiceDefinition{} + err = c.client.Put(). + Resource("servicetemplateservicedefinitions"). + Name(serviceTemplateServiceDefinition.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceTemplateServiceDefinition). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceTemplateServiceDefinition and deletes it. Returns an error if one occurs. +func (c *serviceTemplateServiceDefinitions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicetemplateservicedefinitions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceTemplateServiceDefinitions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("servicetemplateservicedefinitions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceTemplateServiceDefinition. +func (c *serviceTemplateServiceDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceTemplateServiceDefinition, err error) { + result = &v1.ServiceTemplateServiceDefinition{} + err = c.client.Patch(pt). + Resource("servicetemplateservicedefinitions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceversion.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceversion.go new file mode 100644 index 000000000..f943c048e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceversion.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceVersionsGetter has a method to return a ServiceVersionInterface. +// A group's client should implement this interface. +type ServiceVersionsGetter interface { + ServiceVersions() ServiceVersionInterface +} + +// ServiceVersionInterface has methods to work with ServiceVersion resources. +type ServiceVersionInterface interface { + Create(ctx context.Context, serviceVersion *v1.ServiceVersion, opts metav1.CreateOptions) (*v1.ServiceVersion, error) + Update(ctx context.Context, serviceVersion *v1.ServiceVersion, opts metav1.UpdateOptions) (*v1.ServiceVersion, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceVersion, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceVersionList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceVersion, err error) + ServiceVersionExpansion +} + +// serviceVersions implements ServiceVersionInterface +type serviceVersions struct { + client rest.Interface +} + +// newServiceVersions returns a ServiceVersions +func newServiceVersions(c *GlobalTsmV1Client) *serviceVersions { + return &serviceVersions{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceVersion, and returns the corresponding serviceVersion object, and an error if there is any. +func (c *serviceVersions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceVersion, err error) { + result = &v1.ServiceVersion{} + err = c.client.Get(). + Resource("serviceversions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceVersions that match those selectors. +func (c *serviceVersions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceVersionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceVersionList{} + err = c.client.Get(). + Resource("serviceversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceVersions. +func (c *serviceVersions) Watch(ctx context.Context, opts metav1.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(). + Resource("serviceversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceVersion and creates it. Returns the server's representation of the serviceVersion, and an error, if there is any. +func (c *serviceVersions) Create(ctx context.Context, serviceVersion *v1.ServiceVersion, opts metav1.CreateOptions) (result *v1.ServiceVersion, err error) { + result = &v1.ServiceVersion{} + err = c.client.Post(). + Resource("serviceversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceVersion). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceVersion and updates it. Returns the server's representation of the serviceVersion, and an error, if there is any. +func (c *serviceVersions) Update(ctx context.Context, serviceVersion *v1.ServiceVersion, opts metav1.UpdateOptions) (result *v1.ServiceVersion, err error) { + result = &v1.ServiceVersion{} + err = c.client.Put(). + Resource("serviceversions"). + Name(serviceVersion.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceVersion). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceVersion and deletes it. Returns an error if one occurs. +func (c *serviceVersions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("serviceversions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceVersions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("serviceversions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceVersion. +func (c *serviceVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceVersion, err error) { + result = &v1.ServiceVersion{} + err = c.client.Patch(pt). + Resource("serviceversions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceversionconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceversionconfig.go new file mode 100644 index 000000000..60b39a5bc --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/serviceversionconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// ServiceVersionConfigsGetter has a method to return a ServiceVersionConfigInterface. +// A group's client should implement this interface. +type ServiceVersionConfigsGetter interface { + ServiceVersionConfigs() ServiceVersionConfigInterface +} + +// ServiceVersionConfigInterface has methods to work with ServiceVersionConfig resources. +type ServiceVersionConfigInterface interface { + Create(ctx context.Context, serviceVersionConfig *v1.ServiceVersionConfig, opts metav1.CreateOptions) (*v1.ServiceVersionConfig, error) + Update(ctx context.Context, serviceVersionConfig *v1.ServiceVersionConfig, opts metav1.UpdateOptions) (*v1.ServiceVersionConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceVersionConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceVersionConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceVersionConfig, err error) + ServiceVersionConfigExpansion +} + +// serviceVersionConfigs implements ServiceVersionConfigInterface +type serviceVersionConfigs struct { + client rest.Interface +} + +// newServiceVersionConfigs returns a ServiceVersionConfigs +func newServiceVersionConfigs(c *GlobalTsmV1Client) *serviceVersionConfigs { + return &serviceVersionConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceVersionConfig, and returns the corresponding serviceVersionConfig object, and an error if there is any. +func (c *serviceVersionConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceVersionConfig, err error) { + result = &v1.ServiceVersionConfig{} + err = c.client.Get(). + Resource("serviceversionconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceVersionConfigs that match those selectors. +func (c *serviceVersionConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceVersionConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceVersionConfigList{} + err = c.client.Get(). + Resource("serviceversionconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceVersionConfigs. +func (c *serviceVersionConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("serviceversionconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceVersionConfig and creates it. Returns the server's representation of the serviceVersionConfig, and an error, if there is any. +func (c *serviceVersionConfigs) Create(ctx context.Context, serviceVersionConfig *v1.ServiceVersionConfig, opts metav1.CreateOptions) (result *v1.ServiceVersionConfig, err error) { + result = &v1.ServiceVersionConfig{} + err = c.client.Post(). + Resource("serviceversionconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceVersionConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceVersionConfig and updates it. Returns the server's representation of the serviceVersionConfig, and an error, if there is any. +func (c *serviceVersionConfigs) Update(ctx context.Context, serviceVersionConfig *v1.ServiceVersionConfig, opts metav1.UpdateOptions) (result *v1.ServiceVersionConfig, err error) { + result = &v1.ServiceVersionConfig{} + err = c.client.Put(). + Resource("serviceversionconfigs"). + Name(serviceVersionConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceVersionConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceVersionConfig and deletes it. Returns an error if one occurs. +func (c *serviceVersionConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("serviceversionconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceVersionConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("serviceversionconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceVersionConfig. +func (c *serviceVersionConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceVersionConfig, err error) { + result = &v1.ServiceVersionConfig{} + err = c.client.Patch(pt). + Resource("serviceversionconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/sharedserviceconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/sharedserviceconfig.go new file mode 100644 index 000000000..d98bb9324 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/sharedserviceconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// SharedServiceConfigsGetter has a method to return a SharedServiceConfigInterface. +// A group's client should implement this interface. +type SharedServiceConfigsGetter interface { + SharedServiceConfigs() SharedServiceConfigInterface +} + +// SharedServiceConfigInterface has methods to work with SharedServiceConfig resources. +type SharedServiceConfigInterface interface { + Create(ctx context.Context, sharedServiceConfig *v1.SharedServiceConfig, opts metav1.CreateOptions) (*v1.SharedServiceConfig, error) + Update(ctx context.Context, sharedServiceConfig *v1.SharedServiceConfig, opts metav1.UpdateOptions) (*v1.SharedServiceConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.SharedServiceConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SharedServiceConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SharedServiceConfig, err error) + SharedServiceConfigExpansion +} + +// sharedServiceConfigs implements SharedServiceConfigInterface +type sharedServiceConfigs struct { + client rest.Interface +} + +// newSharedServiceConfigs returns a SharedServiceConfigs +func newSharedServiceConfigs(c *GlobalTsmV1Client) *sharedServiceConfigs { + return &sharedServiceConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the sharedServiceConfig, and returns the corresponding sharedServiceConfig object, and an error if there is any. +func (c *sharedServiceConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SharedServiceConfig, err error) { + result = &v1.SharedServiceConfig{} + err = c.client.Get(). + Resource("sharedserviceconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SharedServiceConfigs that match those selectors. +func (c *sharedServiceConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SharedServiceConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SharedServiceConfigList{} + err = c.client.Get(). + Resource("sharedserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sharedServiceConfigs. +func (c *sharedServiceConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("sharedserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a sharedServiceConfig and creates it. Returns the server's representation of the sharedServiceConfig, and an error, if there is any. +func (c *sharedServiceConfigs) Create(ctx context.Context, sharedServiceConfig *v1.SharedServiceConfig, opts metav1.CreateOptions) (result *v1.SharedServiceConfig, err error) { + result = &v1.SharedServiceConfig{} + err = c.client.Post(). + Resource("sharedserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(sharedServiceConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a sharedServiceConfig and updates it. Returns the server's representation of the sharedServiceConfig, and an error, if there is any. +func (c *sharedServiceConfigs) Update(ctx context.Context, sharedServiceConfig *v1.SharedServiceConfig, opts metav1.UpdateOptions) (result *v1.SharedServiceConfig, err error) { + result = &v1.SharedServiceConfig{} + err = c.client.Put(). + Resource("sharedserviceconfigs"). + Name(sharedServiceConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(sharedServiceConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the sharedServiceConfig and deletes it. Returns an error if one occurs. +func (c *sharedServiceConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("sharedserviceconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sharedServiceConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("sharedserviceconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched sharedServiceConfig. +func (c *sharedServiceConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SharedServiceConfig, err error) { + result = &v1.SharedServiceConfig{} + err = c.client.Patch(pt). + Resource("sharedserviceconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/sloconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/sloconfig.go new file mode 100644 index 000000000..355fe3ad3 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/sloconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// SloConfigsGetter has a method to return a SloConfigInterface. +// A group's client should implement this interface. +type SloConfigsGetter interface { + SloConfigs() SloConfigInterface +} + +// SloConfigInterface has methods to work with SloConfig resources. +type SloConfigInterface interface { + Create(ctx context.Context, sloConfig *v1.SloConfig, opts metav1.CreateOptions) (*v1.SloConfig, error) + Update(ctx context.Context, sloConfig *v1.SloConfig, opts metav1.UpdateOptions) (*v1.SloConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.SloConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SloConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SloConfig, err error) + SloConfigExpansion +} + +// sloConfigs implements SloConfigInterface +type sloConfigs struct { + client rest.Interface +} + +// newSloConfigs returns a SloConfigs +func newSloConfigs(c *GlobalTsmV1Client) *sloConfigs { + return &sloConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the sloConfig, and returns the corresponding sloConfig object, and an error if there is any. +func (c *sloConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SloConfig, err error) { + result = &v1.SloConfig{} + err = c.client.Get(). + Resource("sloconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SloConfigs that match those selectors. +func (c *sloConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SloConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SloConfigList{} + err = c.client.Get(). + Resource("sloconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sloConfigs. +func (c *sloConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("sloconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a sloConfig and creates it. Returns the server's representation of the sloConfig, and an error, if there is any. +func (c *sloConfigs) Create(ctx context.Context, sloConfig *v1.SloConfig, opts metav1.CreateOptions) (result *v1.SloConfig, err error) { + result = &v1.SloConfig{} + err = c.client.Post(). + Resource("sloconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(sloConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a sloConfig and updates it. Returns the server's representation of the sloConfig, and an error, if there is any. +func (c *sloConfigs) Update(ctx context.Context, sloConfig *v1.SloConfig, opts metav1.UpdateOptions) (result *v1.SloConfig, err error) { + result = &v1.SloConfig{} + err = c.client.Put(). + Resource("sloconfigs"). + Name(sloConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(sloConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the sloConfig and deletes it. Returns an error if one occurs. +func (c *sloConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("sloconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sloConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("sloconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched sloConfig. +func (c *sloConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SloConfig, err error) { + result = &v1.SloConfig{} + err = c.client.Patch(pt). + Resource("sloconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/slofolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/slofolder.go new file mode 100644 index 000000000..218a928f4 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/slofolder.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// SLOFoldersGetter has a method to return a SLOFolderInterface. +// A group's client should implement this interface. +type SLOFoldersGetter interface { + SLOFolders() SLOFolderInterface +} + +// SLOFolderInterface has methods to work with SLOFolder resources. +type SLOFolderInterface interface { + Create(ctx context.Context, sLOFolder *v1.SLOFolder, opts metav1.CreateOptions) (*v1.SLOFolder, error) + Update(ctx context.Context, sLOFolder *v1.SLOFolder, opts metav1.UpdateOptions) (*v1.SLOFolder, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.SLOFolder, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SLOFolderList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SLOFolder, err error) + SLOFolderExpansion +} + +// sLOFolders implements SLOFolderInterface +type sLOFolders struct { + client rest.Interface +} + +// newSLOFolders returns a SLOFolders +func newSLOFolders(c *GlobalTsmV1Client) *sLOFolders { + return &sLOFolders{ + client: c.RESTClient(), + } +} + +// Get takes name of the sLOFolder, and returns the corresponding sLOFolder object, and an error if there is any. +func (c *sLOFolders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SLOFolder, err error) { + result = &v1.SLOFolder{} + err = c.client.Get(). + Resource("slofolders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SLOFolders that match those selectors. +func (c *sLOFolders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SLOFolderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SLOFolderList{} + err = c.client.Get(). + Resource("slofolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sLOFolders. +func (c *sLOFolders) Watch(ctx context.Context, opts metav1.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(). + Resource("slofolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a sLOFolder and creates it. Returns the server's representation of the sLOFolder, and an error, if there is any. +func (c *sLOFolders) Create(ctx context.Context, sLOFolder *v1.SLOFolder, opts metav1.CreateOptions) (result *v1.SLOFolder, err error) { + result = &v1.SLOFolder{} + err = c.client.Post(). + Resource("slofolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(sLOFolder). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a sLOFolder and updates it. Returns the server's representation of the sLOFolder, and an error, if there is any. +func (c *sLOFolders) Update(ctx context.Context, sLOFolder *v1.SLOFolder, opts metav1.UpdateOptions) (result *v1.SLOFolder, err error) { + result = &v1.SLOFolder{} + err = c.client.Put(). + Resource("slofolders"). + Name(sLOFolder.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(sLOFolder). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the sLOFolder and deletes it. Returns an error if one occurs. +func (c *sLOFolders) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("slofolders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sLOFolders) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("slofolders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched sLOFolder. +func (c *sLOFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SLOFolder, err error) { + result = &v1.SLOFolder{} + err = c.client.Patch(pt). + Resource("slofolders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/slopolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/slopolicy.go new file mode 100644 index 000000000..42e0c5155 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/slopolicy.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// SLOPoliciesGetter has a method to return a SLOPolicyInterface. +// A group's client should implement this interface. +type SLOPoliciesGetter interface { + SLOPolicies() SLOPolicyInterface +} + +// SLOPolicyInterface has methods to work with SLOPolicy resources. +type SLOPolicyInterface interface { + Create(ctx context.Context, sLOPolicy *v1.SLOPolicy, opts metav1.CreateOptions) (*v1.SLOPolicy, error) + Update(ctx context.Context, sLOPolicy *v1.SLOPolicy, opts metav1.UpdateOptions) (*v1.SLOPolicy, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.SLOPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SLOPolicyList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SLOPolicy, err error) + SLOPolicyExpansion +} + +// sLOPolicies implements SLOPolicyInterface +type sLOPolicies struct { + client rest.Interface +} + +// newSLOPolicies returns a SLOPolicies +func newSLOPolicies(c *GlobalTsmV1Client) *sLOPolicies { + return &sLOPolicies{ + client: c.RESTClient(), + } +} + +// Get takes name of the sLOPolicy, and returns the corresponding sLOPolicy object, and an error if there is any. +func (c *sLOPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SLOPolicy, err error) { + result = &v1.SLOPolicy{} + err = c.client.Get(). + Resource("slopolicies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SLOPolicies that match those selectors. +func (c *sLOPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SLOPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SLOPolicyList{} + err = c.client.Get(). + Resource("slopolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sLOPolicies. +func (c *sLOPolicies) Watch(ctx context.Context, opts metav1.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(). + Resource("slopolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a sLOPolicy and creates it. Returns the server's representation of the sLOPolicy, and an error, if there is any. +func (c *sLOPolicies) Create(ctx context.Context, sLOPolicy *v1.SLOPolicy, opts metav1.CreateOptions) (result *v1.SLOPolicy, err error) { + result = &v1.SLOPolicy{} + err = c.client.Post(). + Resource("slopolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(sLOPolicy). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a sLOPolicy and updates it. Returns the server's representation of the sLOPolicy, and an error, if there is any. +func (c *sLOPolicies) Update(ctx context.Context, sLOPolicy *v1.SLOPolicy, opts metav1.UpdateOptions) (result *v1.SLOPolicy, err error) { + result = &v1.SLOPolicy{} + err = c.client.Put(). + Resource("slopolicies"). + Name(sLOPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(sLOPolicy). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the sLOPolicy and deletes it. Returns an error if one occurs. +func (c *sLOPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("slopolicies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sLOPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("slopolicies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched sLOPolicy. +func (c *sLOPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SLOPolicy, err error) { + result = &v1.SLOPolicy{} + err = c.client.Patch(pt). + Resource("slopolicies"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/sloserviceconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/sloserviceconfig.go new file mode 100644 index 000000000..4c59cc216 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/sloserviceconfig.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// SloServiceConfigsGetter has a method to return a SloServiceConfigInterface. +// A group's client should implement this interface. +type SloServiceConfigsGetter interface { + SloServiceConfigs() SloServiceConfigInterface +} + +// SloServiceConfigInterface has methods to work with SloServiceConfig resources. +type SloServiceConfigInterface interface { + Create(ctx context.Context, sloServiceConfig *v1.SloServiceConfig, opts metav1.CreateOptions) (*v1.SloServiceConfig, error) + Update(ctx context.Context, sloServiceConfig *v1.SloServiceConfig, opts metav1.UpdateOptions) (*v1.SloServiceConfig, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.SloServiceConfig, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SloServiceConfigList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SloServiceConfig, err error) + SloServiceConfigExpansion +} + +// sloServiceConfigs implements SloServiceConfigInterface +type sloServiceConfigs struct { + client rest.Interface +} + +// newSloServiceConfigs returns a SloServiceConfigs +func newSloServiceConfigs(c *GlobalTsmV1Client) *sloServiceConfigs { + return &sloServiceConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the sloServiceConfig, and returns the corresponding sloServiceConfig object, and an error if there is any. +func (c *sloServiceConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SloServiceConfig, err error) { + result = &v1.SloServiceConfig{} + err = c.client.Get(). + Resource("sloserviceconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SloServiceConfigs that match those selectors. +func (c *sloServiceConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SloServiceConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SloServiceConfigList{} + err = c.client.Get(). + Resource("sloserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sloServiceConfigs. +func (c *sloServiceConfigs) Watch(ctx context.Context, opts metav1.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(). + Resource("sloserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a sloServiceConfig and creates it. Returns the server's representation of the sloServiceConfig, and an error, if there is any. +func (c *sloServiceConfigs) Create(ctx context.Context, sloServiceConfig *v1.SloServiceConfig, opts metav1.CreateOptions) (result *v1.SloServiceConfig, err error) { + result = &v1.SloServiceConfig{} + err = c.client.Post(). + Resource("sloserviceconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(sloServiceConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a sloServiceConfig and updates it. Returns the server's representation of the sloServiceConfig, and an error, if there is any. +func (c *sloServiceConfigs) Update(ctx context.Context, sloServiceConfig *v1.SloServiceConfig, opts metav1.UpdateOptions) (result *v1.SloServiceConfig, err error) { + result = &v1.SloServiceConfig{} + err = c.client.Put(). + Resource("sloserviceconfigs"). + Name(sloServiceConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(sloServiceConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the sloServiceConfig and deletes it. Returns an error if one occurs. +func (c *sloServiceConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("sloserviceconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sloServiceConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("sloserviceconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched sloServiceConfig. +func (c *sloServiceConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SloServiceConfig, err error) { + result = &v1.SloServiceConfig{} + err = c.client.Patch(pt). + Resource("sloserviceconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/svcgroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/svcgroup.go new file mode 100644 index 000000000..2d1f05420 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/svcgroup.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// SvcGroupsGetter has a method to return a SvcGroupInterface. +// A group's client should implement this interface. +type SvcGroupsGetter interface { + SvcGroups() SvcGroupInterface +} + +// SvcGroupInterface has methods to work with SvcGroup resources. +type SvcGroupInterface interface { + Create(ctx context.Context, svcGroup *v1.SvcGroup, opts metav1.CreateOptions) (*v1.SvcGroup, error) + Update(ctx context.Context, svcGroup *v1.SvcGroup, opts metav1.UpdateOptions) (*v1.SvcGroup, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.SvcGroup, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SvcGroupList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SvcGroup, err error) + SvcGroupExpansion +} + +// svcGroups implements SvcGroupInterface +type svcGroups struct { + client rest.Interface +} + +// newSvcGroups returns a SvcGroups +func newSvcGroups(c *GlobalTsmV1Client) *svcGroups { + return &svcGroups{ + client: c.RESTClient(), + } +} + +// Get takes name of the svcGroup, and returns the corresponding svcGroup object, and an error if there is any. +func (c *svcGroups) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SvcGroup, err error) { + result = &v1.SvcGroup{} + err = c.client.Get(). + Resource("svcgroups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SvcGroups that match those selectors. +func (c *svcGroups) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SvcGroupList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SvcGroupList{} + err = c.client.Get(). + Resource("svcgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested svcGroups. +func (c *svcGroups) Watch(ctx context.Context, opts metav1.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(). + Resource("svcgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a svcGroup and creates it. Returns the server's representation of the svcGroup, and an error, if there is any. +func (c *svcGroups) Create(ctx context.Context, svcGroup *v1.SvcGroup, opts metav1.CreateOptions) (result *v1.SvcGroup, err error) { + result = &v1.SvcGroup{} + err = c.client.Post(). + Resource("svcgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(svcGroup). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a svcGroup and updates it. Returns the server's representation of the svcGroup, and an error, if there is any. +func (c *svcGroups) Update(ctx context.Context, svcGroup *v1.SvcGroup, opts metav1.UpdateOptions) (result *v1.SvcGroup, err error) { + result = &v1.SvcGroup{} + err = c.client.Put(). + Resource("svcgroups"). + Name(svcGroup.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(svcGroup). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the svcGroup and deletes it. Returns an error if one occurs. +func (c *svcGroups) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("svcgroups"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *svcGroups) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("svcgroups"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched svcGroup. +func (c *svcGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SvcGroup, err error) { + result = &v1.SvcGroup{} + err = c.client.Patch(pt). + Resource("svcgroups"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/svcgrouprt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/svcgrouprt.go new file mode 100644 index 000000000..238735a7c --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/svcgrouprt.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// SvcGroupRTsGetter has a method to return a SvcGroupRTInterface. +// A group's client should implement this interface. +type SvcGroupRTsGetter interface { + SvcGroupRTs() SvcGroupRTInterface +} + +// SvcGroupRTInterface has methods to work with SvcGroupRT resources. +type SvcGroupRTInterface interface { + Create(ctx context.Context, svcGroupRT *v1.SvcGroupRT, opts metav1.CreateOptions) (*v1.SvcGroupRT, error) + Update(ctx context.Context, svcGroupRT *v1.SvcGroupRT, opts metav1.UpdateOptions) (*v1.SvcGroupRT, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.SvcGroupRT, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SvcGroupRTList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SvcGroupRT, err error) + SvcGroupRTExpansion +} + +// svcGroupRTs implements SvcGroupRTInterface +type svcGroupRTs struct { + client rest.Interface +} + +// newSvcGroupRTs returns a SvcGroupRTs +func newSvcGroupRTs(c *GlobalTsmV1Client) *svcGroupRTs { + return &svcGroupRTs{ + client: c.RESTClient(), + } +} + +// Get takes name of the svcGroupRT, and returns the corresponding svcGroupRT object, and an error if there is any. +func (c *svcGroupRTs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SvcGroupRT, err error) { + result = &v1.SvcGroupRT{} + err = c.client.Get(). + Resource("svcgrouprts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SvcGroupRTs that match those selectors. +func (c *svcGroupRTs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SvcGroupRTList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SvcGroupRTList{} + err = c.client.Get(). + Resource("svcgrouprts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested svcGroupRTs. +func (c *svcGroupRTs) Watch(ctx context.Context, opts metav1.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(). + Resource("svcgrouprts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a svcGroupRT and creates it. Returns the server's representation of the svcGroupRT, and an error, if there is any. +func (c *svcGroupRTs) Create(ctx context.Context, svcGroupRT *v1.SvcGroupRT, opts metav1.CreateOptions) (result *v1.SvcGroupRT, err error) { + result = &v1.SvcGroupRT{} + err = c.client.Post(). + Resource("svcgrouprts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(svcGroupRT). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a svcGroupRT and updates it. Returns the server's representation of the svcGroupRT, and an error, if there is any. +func (c *svcGroupRTs) Update(ctx context.Context, svcGroupRT *v1.SvcGroupRT, opts metav1.UpdateOptions) (result *v1.SvcGroupRT, err error) { + result = &v1.SvcGroupRT{} + err = c.client.Put(). + Resource("svcgrouprts"). + Name(svcGroupRT.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(svcGroupRT). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the svcGroupRT and deletes it. Returns an error if one occurs. +func (c *svcGroupRTs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("svcgrouprts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *svcGroupRTs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("svcgrouprts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched svcGroupRT. +func (c *svcGroupRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SvcGroupRT, err error) { + result = &v1.SvcGroupRT{} + err = c.client.Patch(pt). + Resource("svcgrouprts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/table.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/table.go new file mode 100644 index 000000000..3ccd45337 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/table.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// TablesGetter has a method to return a TableInterface. +// A group's client should implement this interface. +type TablesGetter interface { + Tables() TableInterface +} + +// TableInterface has methods to work with Table resources. +type TableInterface interface { + Create(ctx context.Context, table *v1.Table, opts metav1.CreateOptions) (*v1.Table, error) + Update(ctx context.Context, table *v1.Table, opts metav1.UpdateOptions) (*v1.Table, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Table, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.TableList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Table, err error) + TableExpansion +} + +// tables implements TableInterface +type tables struct { + client rest.Interface +} + +// newTables returns a Tables +func newTables(c *GlobalTsmV1Client) *tables { + return &tables{ + client: c.RESTClient(), + } +} + +// Get takes name of the table, and returns the corresponding table object, and an error if there is any. +func (c *tables) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Table, err error) { + result = &v1.Table{} + err = c.client.Get(). + Resource("tables"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Tables that match those selectors. +func (c *tables) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TableList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.TableList{} + err = c.client.Get(). + Resource("tables"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested tables. +func (c *tables) Watch(ctx context.Context, opts metav1.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(). + Resource("tables"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a table and creates it. Returns the server's representation of the table, and an error, if there is any. +func (c *tables) Create(ctx context.Context, table *v1.Table, opts metav1.CreateOptions) (result *v1.Table, err error) { + result = &v1.Table{} + err = c.client.Post(). + Resource("tables"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(table). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a table and updates it. Returns the server's representation of the table, and an error, if there is any. +func (c *tables) Update(ctx context.Context, table *v1.Table, opts metav1.UpdateOptions) (result *v1.Table, err error) { + result = &v1.Table{} + err = c.client.Put(). + Resource("tables"). + Name(table.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(table). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the table and deletes it. Returns an error if one occurs. +func (c *tables) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("tables"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *tables) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("tables"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched table. +func (c *tables) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Table, err error) { + result = &v1.Table{} + err = c.client.Patch(pt). + Resource("tables"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/template.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/template.go new file mode 100644 index 000000000..25ceb8315 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/template.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// TemplatesGetter has a method to return a TemplateInterface. +// A group's client should implement this interface. +type TemplatesGetter interface { + Templates() TemplateInterface +} + +// TemplateInterface has methods to work with Template resources. +type TemplateInterface interface { + Create(ctx context.Context, template *v1.Template, opts metav1.CreateOptions) (*v1.Template, error) + Update(ctx context.Context, template *v1.Template, opts metav1.UpdateOptions) (*v1.Template, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Template, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.TemplateList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Template, err error) + TemplateExpansion +} + +// templates implements TemplateInterface +type templates struct { + client rest.Interface +} + +// newTemplates returns a Templates +func newTemplates(c *GlobalTsmV1Client) *templates { + return &templates{ + client: c.RESTClient(), + } +} + +// Get takes name of the template, and returns the corresponding template object, and an error if there is any. +func (c *templates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Template, err error) { + result = &v1.Template{} + err = c.client.Get(). + Resource("templates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Templates that match those selectors. +func (c *templates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.TemplateList{} + err = c.client.Get(). + Resource("templates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested templates. +func (c *templates) Watch(ctx context.Context, opts metav1.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(). + Resource("templates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a template and creates it. Returns the server's representation of the template, and an error, if there is any. +func (c *templates) Create(ctx context.Context, template *v1.Template, opts metav1.CreateOptions) (result *v1.Template, err error) { + result = &v1.Template{} + err = c.client.Post(). + Resource("templates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(template). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a template and updates it. Returns the server's representation of the template, and an error, if there is any. +func (c *templates) Update(ctx context.Context, template *v1.Template, opts metav1.UpdateOptions) (result *v1.Template, err error) { + result = &v1.Template{} + err = c.client.Put(). + Resource("templates"). + Name(template.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(template). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the template and deletes it. Returns an error if one occurs. +func (c *templates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("templates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *templates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("templates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched template. +func (c *templates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Template, err error) { + result = &v1.Template{} + err = c.client.Patch(pt). + Resource("templates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/templategroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/templategroup.go new file mode 100644 index 000000000..8194979c9 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/templategroup.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// TemplateGroupsGetter has a method to return a TemplateGroupInterface. +// A group's client should implement this interface. +type TemplateGroupsGetter interface { + TemplateGroups() TemplateGroupInterface +} + +// TemplateGroupInterface has methods to work with TemplateGroup resources. +type TemplateGroupInterface interface { + Create(ctx context.Context, templateGroup *v1.TemplateGroup, opts metav1.CreateOptions) (*v1.TemplateGroup, error) + Update(ctx context.Context, templateGroup *v1.TemplateGroup, opts metav1.UpdateOptions) (*v1.TemplateGroup, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TemplateGroup, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.TemplateGroupList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TemplateGroup, err error) + TemplateGroupExpansion +} + +// templateGroups implements TemplateGroupInterface +type templateGroups struct { + client rest.Interface +} + +// newTemplateGroups returns a TemplateGroups +func newTemplateGroups(c *GlobalTsmV1Client) *templateGroups { + return &templateGroups{ + client: c.RESTClient(), + } +} + +// Get takes name of the templateGroup, and returns the corresponding templateGroup object, and an error if there is any. +func (c *templateGroups) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TemplateGroup, err error) { + result = &v1.TemplateGroup{} + err = c.client.Get(). + Resource("templategroups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TemplateGroups that match those selectors. +func (c *templateGroups) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TemplateGroupList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.TemplateGroupList{} + err = c.client.Get(). + Resource("templategroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested templateGroups. +func (c *templateGroups) Watch(ctx context.Context, opts metav1.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(). + Resource("templategroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a templateGroup and creates it. Returns the server's representation of the templateGroup, and an error, if there is any. +func (c *templateGroups) Create(ctx context.Context, templateGroup *v1.TemplateGroup, opts metav1.CreateOptions) (result *v1.TemplateGroup, err error) { + result = &v1.TemplateGroup{} + err = c.client.Post(). + Resource("templategroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(templateGroup). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a templateGroup and updates it. Returns the server's representation of the templateGroup, and an error, if there is any. +func (c *templateGroups) Update(ctx context.Context, templateGroup *v1.TemplateGroup, opts metav1.UpdateOptions) (result *v1.TemplateGroup, err error) { + result = &v1.TemplateGroup{} + err = c.client.Put(). + Resource("templategroups"). + Name(templateGroup.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(templateGroup). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the templateGroup and deletes it. Returns an error if one occurs. +func (c *templateGroups) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("templategroups"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *templateGroups) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("templategroups"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched templateGroup. +func (c *templateGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TemplateGroup, err error) { + result = &v1.TemplateGroup{} + err = c.client.Patch(pt). + Resource("templategroups"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/tenant.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/tenant.go new file mode 100644 index 000000000..00c4cdd6e --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/tenant.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// TenantsGetter has a method to return a TenantInterface. +// A group's client should implement this interface. +type TenantsGetter interface { + Tenants() TenantInterface +} + +// TenantInterface has methods to work with Tenant resources. +type TenantInterface interface { + Create(ctx context.Context, tenant *v1.Tenant, opts metav1.CreateOptions) (*v1.Tenant, error) + Update(ctx context.Context, tenant *v1.Tenant, opts metav1.UpdateOptions) (*v1.Tenant, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Tenant, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.TenantList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Tenant, err error) + TenantExpansion +} + +// tenants implements TenantInterface +type tenants struct { + client rest.Interface +} + +// newTenants returns a Tenants +func newTenants(c *GlobalTsmV1Client) *tenants { + return &tenants{ + client: c.RESTClient(), + } +} + +// Get takes name of the tenant, and returns the corresponding tenant object, and an error if there is any. +func (c *tenants) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Tenant, err error) { + result = &v1.Tenant{} + err = c.client.Get(). + Resource("tenants"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Tenants that match those selectors. +func (c *tenants) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TenantList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.TenantList{} + err = c.client.Get(). + Resource("tenants"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested tenants. +func (c *tenants) Watch(ctx context.Context, opts metav1.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(). + Resource("tenants"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a tenant and creates it. Returns the server's representation of the tenant, and an error, if there is any. +func (c *tenants) Create(ctx context.Context, tenant *v1.Tenant, opts metav1.CreateOptions) (result *v1.Tenant, err error) { + result = &v1.Tenant{} + err = c.client.Post(). + Resource("tenants"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(tenant). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a tenant and updates it. Returns the server's representation of the tenant, and an error, if there is any. +func (c *tenants) Update(ctx context.Context, tenant *v1.Tenant, opts metav1.UpdateOptions) (result *v1.Tenant, err error) { + result = &v1.Tenant{} + err = c.client.Put(). + Resource("tenants"). + Name(tenant.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(tenant). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the tenant and deletes it. Returns an error if one occurs. +func (c *tenants) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("tenants"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *tenants) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("tenants"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched tenant. +func (c *tenants) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Tenant, err error) { + result = &v1.Tenant{} + err = c.client.Patch(pt). + Resource("tenants"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/tenantresource.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/tenantresource.go new file mode 100644 index 000000000..464fe11ac --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/tenantresource.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// TenantResourcesGetter has a method to return a TenantResourceInterface. +// A group's client should implement this interface. +type TenantResourcesGetter interface { + TenantResources() TenantResourceInterface +} + +// TenantResourceInterface has methods to work with TenantResource resources. +type TenantResourceInterface interface { + Create(ctx context.Context, tenantResource *v1.TenantResource, opts metav1.CreateOptions) (*v1.TenantResource, error) + Update(ctx context.Context, tenantResource *v1.TenantResource, opts metav1.UpdateOptions) (*v1.TenantResource, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TenantResource, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.TenantResourceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TenantResource, err error) + TenantResourceExpansion +} + +// tenantResources implements TenantResourceInterface +type tenantResources struct { + client rest.Interface +} + +// newTenantResources returns a TenantResources +func newTenantResources(c *GlobalTsmV1Client) *tenantResources { + return &tenantResources{ + client: c.RESTClient(), + } +} + +// Get takes name of the tenantResource, and returns the corresponding tenantResource object, and an error if there is any. +func (c *tenantResources) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TenantResource, err error) { + result = &v1.TenantResource{} + err = c.client.Get(). + Resource("tenantresources"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TenantResources that match those selectors. +func (c *tenantResources) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TenantResourceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.TenantResourceList{} + err = c.client.Get(). + Resource("tenantresources"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested tenantResources. +func (c *tenantResources) Watch(ctx context.Context, opts metav1.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(). + Resource("tenantresources"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a tenantResource and creates it. Returns the server's representation of the tenantResource, and an error, if there is any. +func (c *tenantResources) Create(ctx context.Context, tenantResource *v1.TenantResource, opts metav1.CreateOptions) (result *v1.TenantResource, err error) { + result = &v1.TenantResource{} + err = c.client.Post(). + Resource("tenantresources"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(tenantResource). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a tenantResource and updates it. Returns the server's representation of the tenantResource, and an error, if there is any. +func (c *tenantResources) Update(ctx context.Context, tenantResource *v1.TenantResource, opts metav1.UpdateOptions) (result *v1.TenantResource, err error) { + result = &v1.TenantResource{} + err = c.client.Put(). + Resource("tenantresources"). + Name(tenantResource.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(tenantResource). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the tenantResource and deletes it. Returns an error if one occurs. +func (c *tenantResources) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("tenantresources"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *tenantResources) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("tenantresources"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched tenantResource. +func (c *tenantResources) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TenantResource, err error) { + result = &v1.TenantResource{} + err = c.client.Patch(pt). + Resource("tenantresources"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/tenanttoken.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/tenanttoken.go new file mode 100644 index 000000000..536e7aa5b --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/tenanttoken.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// TenantTokensGetter has a method to return a TenantTokenInterface. +// A group's client should implement this interface. +type TenantTokensGetter interface { + TenantTokens() TenantTokenInterface +} + +// TenantTokenInterface has methods to work with TenantToken resources. +type TenantTokenInterface interface { + Create(ctx context.Context, tenantToken *v1.TenantToken, opts metav1.CreateOptions) (*v1.TenantToken, error) + Update(ctx context.Context, tenantToken *v1.TenantToken, opts metav1.UpdateOptions) (*v1.TenantToken, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TenantToken, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.TenantTokenList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TenantToken, err error) + TenantTokenExpansion +} + +// tenantTokens implements TenantTokenInterface +type tenantTokens struct { + client rest.Interface +} + +// newTenantTokens returns a TenantTokens +func newTenantTokens(c *GlobalTsmV1Client) *tenantTokens { + return &tenantTokens{ + client: c.RESTClient(), + } +} + +// Get takes name of the tenantToken, and returns the corresponding tenantToken object, and an error if there is any. +func (c *tenantTokens) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TenantToken, err error) { + result = &v1.TenantToken{} + err = c.client.Get(). + Resource("tenanttokens"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TenantTokens that match those selectors. +func (c *tenantTokens) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TenantTokenList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.TenantTokenList{} + err = c.client.Get(). + Resource("tenanttokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested tenantTokens. +func (c *tenantTokens) Watch(ctx context.Context, opts metav1.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(). + Resource("tenanttokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a tenantToken and creates it. Returns the server's representation of the tenantToken, and an error, if there is any. +func (c *tenantTokens) Create(ctx context.Context, tenantToken *v1.TenantToken, opts metav1.CreateOptions) (result *v1.TenantToken, err error) { + result = &v1.TenantToken{} + err = c.client.Post(). + Resource("tenanttokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(tenantToken). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a tenantToken and updates it. Returns the server's representation of the tenantToken, and an error, if there is any. +func (c *tenantTokens) Update(ctx context.Context, tenantToken *v1.TenantToken, opts metav1.UpdateOptions) (result *v1.TenantToken, err error) { + result = &v1.TenantToken{} + err = c.client.Put(). + Resource("tenanttokens"). + Name(tenantToken.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(tenantToken). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the tenantToken and deletes it. Returns an error if one occurs. +func (c *tenantTokens) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("tenanttokens"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *tenantTokens) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("tenanttokens"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched tenantToken. +func (c *tenantTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TenantToken, err error) { + result = &v1.TenantToken{} + err = c.client.Patch(pt). + Resource("tenanttokens"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/user.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/user.go new file mode 100644 index 000000000..b26ba4186 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/user.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// UsersGetter has a method to return a UserInterface. +// A group's client should implement this interface. +type UsersGetter interface { + Users() UserInterface +} + +// UserInterface has methods to work with User resources. +type UserInterface interface { + Create(ctx context.Context, user *v1.User, opts metav1.CreateOptions) (*v1.User, error) + Update(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (*v1.User, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.User, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.UserList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.User, err error) + UserExpansion +} + +// users implements UserInterface +type users struct { + client rest.Interface +} + +// newUsers returns a Users +func newUsers(c *GlobalTsmV1Client) *users { + return &users{ + client: c.RESTClient(), + } +} + +// Get takes name of the user, and returns the corresponding user object, and an error if there is any. +func (c *users) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.User, err error) { + result = &v1.User{} + err = c.client.Get(). + Resource("users"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Users that match those selectors. +func (c *users) List(ctx context.Context, opts metav1.ListOptions) (result *v1.UserList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.UserList{} + err = c.client.Get(). + Resource("users"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested users. +func (c *users) Watch(ctx context.Context, opts metav1.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(). + Resource("users"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a user and creates it. Returns the server's representation of the user, and an error, if there is any. +func (c *users) Create(ctx context.Context, user *v1.User, opts metav1.CreateOptions) (result *v1.User, err error) { + result = &v1.User{} + err = c.client.Post(). + Resource("users"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(user). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a user and updates it. Returns the server's representation of the user, and an error, if there is any. +func (c *users) Update(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (result *v1.User, err error) { + result = &v1.User{} + err = c.client.Put(). + Resource("users"). + Name(user.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(user). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the user and deletes it. Returns an error if one occurs. +func (c *users) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("users"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *users) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("users"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched user. +func (c *users) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.User, err error) { + result = &v1.User{} + err = c.client.Patch(pt). + Resource("users"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/userdiscovery.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/userdiscovery.go new file mode 100644 index 000000000..0067ddcdb --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/userdiscovery.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// UserDiscoveriesGetter has a method to return a UserDiscoveryInterface. +// A group's client should implement this interface. +type UserDiscoveriesGetter interface { + UserDiscoveries() UserDiscoveryInterface +} + +// UserDiscoveryInterface has methods to work with UserDiscovery resources. +type UserDiscoveryInterface interface { + Create(ctx context.Context, userDiscovery *v1.UserDiscovery, opts metav1.CreateOptions) (*v1.UserDiscovery, error) + Update(ctx context.Context, userDiscovery *v1.UserDiscovery, opts metav1.UpdateOptions) (*v1.UserDiscovery, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.UserDiscovery, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.UserDiscoveryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.UserDiscovery, err error) + UserDiscoveryExpansion +} + +// userDiscoveries implements UserDiscoveryInterface +type userDiscoveries struct { + client rest.Interface +} + +// newUserDiscoveries returns a UserDiscoveries +func newUserDiscoveries(c *GlobalTsmV1Client) *userDiscoveries { + return &userDiscoveries{ + client: c.RESTClient(), + } +} + +// Get takes name of the userDiscovery, and returns the corresponding userDiscovery object, and an error if there is any. +func (c *userDiscoveries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.UserDiscovery, err error) { + result = &v1.UserDiscovery{} + err = c.client.Get(). + Resource("userdiscoveries"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of UserDiscoveries that match those selectors. +func (c *userDiscoveries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.UserDiscoveryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.UserDiscoveryList{} + err = c.client.Get(). + Resource("userdiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested userDiscoveries. +func (c *userDiscoveries) Watch(ctx context.Context, opts metav1.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(). + Resource("userdiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a userDiscovery and creates it. Returns the server's representation of the userDiscovery, and an error, if there is any. +func (c *userDiscoveries) Create(ctx context.Context, userDiscovery *v1.UserDiscovery, opts metav1.CreateOptions) (result *v1.UserDiscovery, err error) { + result = &v1.UserDiscovery{} + err = c.client.Post(). + Resource("userdiscoveries"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(userDiscovery). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a userDiscovery and updates it. Returns the server's representation of the userDiscovery, and an error, if there is any. +func (c *userDiscoveries) Update(ctx context.Context, userDiscovery *v1.UserDiscovery, opts metav1.UpdateOptions) (result *v1.UserDiscovery, err error) { + result = &v1.UserDiscovery{} + err = c.client.Put(). + Resource("userdiscoveries"). + Name(userDiscovery.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(userDiscovery). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the userDiscovery and deletes it. Returns an error if one occurs. +func (c *userDiscoveries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("userdiscoveries"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *userDiscoveries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("userdiscoveries"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched userDiscovery. +func (c *userDiscoveries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.UserDiscovery, err error) { + result = &v1.UserDiscovery{} + err = c.client.Patch(pt). + Resource("userdiscoveries"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/userdiscoveryrt.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/userdiscoveryrt.go new file mode 100644 index 000000000..ae4170282 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/userdiscoveryrt.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// UserDiscoveryRTsGetter has a method to return a UserDiscoveryRTInterface. +// A group's client should implement this interface. +type UserDiscoveryRTsGetter interface { + UserDiscoveryRTs() UserDiscoveryRTInterface +} + +// UserDiscoveryRTInterface has methods to work with UserDiscoveryRT resources. +type UserDiscoveryRTInterface interface { + Create(ctx context.Context, userDiscoveryRT *v1.UserDiscoveryRT, opts metav1.CreateOptions) (*v1.UserDiscoveryRT, error) + Update(ctx context.Context, userDiscoveryRT *v1.UserDiscoveryRT, opts metav1.UpdateOptions) (*v1.UserDiscoveryRT, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.UserDiscoveryRT, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.UserDiscoveryRTList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.UserDiscoveryRT, err error) + UserDiscoveryRTExpansion +} + +// userDiscoveryRTs implements UserDiscoveryRTInterface +type userDiscoveryRTs struct { + client rest.Interface +} + +// newUserDiscoveryRTs returns a UserDiscoveryRTs +func newUserDiscoveryRTs(c *GlobalTsmV1Client) *userDiscoveryRTs { + return &userDiscoveryRTs{ + client: c.RESTClient(), + } +} + +// Get takes name of the userDiscoveryRT, and returns the corresponding userDiscoveryRT object, and an error if there is any. +func (c *userDiscoveryRTs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.UserDiscoveryRT, err error) { + result = &v1.UserDiscoveryRT{} + err = c.client.Get(). + Resource("userdiscoveryrts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of UserDiscoveryRTs that match those selectors. +func (c *userDiscoveryRTs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.UserDiscoveryRTList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.UserDiscoveryRTList{} + err = c.client.Get(). + Resource("userdiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested userDiscoveryRTs. +func (c *userDiscoveryRTs) Watch(ctx context.Context, opts metav1.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(). + Resource("userdiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a userDiscoveryRT and creates it. Returns the server's representation of the userDiscoveryRT, and an error, if there is any. +func (c *userDiscoveryRTs) Create(ctx context.Context, userDiscoveryRT *v1.UserDiscoveryRT, opts metav1.CreateOptions) (result *v1.UserDiscoveryRT, err error) { + result = &v1.UserDiscoveryRT{} + err = c.client.Post(). + Resource("userdiscoveryrts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(userDiscoveryRT). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a userDiscoveryRT and updates it. Returns the server's representation of the userDiscoveryRT, and an error, if there is any. +func (c *userDiscoveryRTs) Update(ctx context.Context, userDiscoveryRT *v1.UserDiscoveryRT, opts metav1.UpdateOptions) (result *v1.UserDiscoveryRT, err error) { + result = &v1.UserDiscoveryRT{} + err = c.client.Put(). + Resource("userdiscoveryrts"). + Name(userDiscoveryRT.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(userDiscoveryRT). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the userDiscoveryRT and deletes it. Returns an error if one occurs. +func (c *userDiscoveryRTs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("userdiscoveryrts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *userDiscoveryRTs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("userdiscoveryrts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched userDiscoveryRT. +func (c *userDiscoveryRTs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.UserDiscoveryRT, err error) { + result = &v1.UserDiscoveryRT{} + err = c.client.Patch(pt). + Resource("userdiscoveryrts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/userfolder.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/userfolder.go new file mode 100644 index 000000000..a222de790 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/userfolder.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// UserFoldersGetter has a method to return a UserFolderInterface. +// A group's client should implement this interface. +type UserFoldersGetter interface { + UserFolders() UserFolderInterface +} + +// UserFolderInterface has methods to work with UserFolder resources. +type UserFolderInterface interface { + Create(ctx context.Context, userFolder *v1.UserFolder, opts metav1.CreateOptions) (*v1.UserFolder, error) + Update(ctx context.Context, userFolder *v1.UserFolder, opts metav1.UpdateOptions) (*v1.UserFolder, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.UserFolder, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.UserFolderList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.UserFolder, err error) + UserFolderExpansion +} + +// userFolders implements UserFolderInterface +type userFolders struct { + client rest.Interface +} + +// newUserFolders returns a UserFolders +func newUserFolders(c *GlobalTsmV1Client) *userFolders { + return &userFolders{ + client: c.RESTClient(), + } +} + +// Get takes name of the userFolder, and returns the corresponding userFolder object, and an error if there is any. +func (c *userFolders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.UserFolder, err error) { + result = &v1.UserFolder{} + err = c.client.Get(). + Resource("userfolders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of UserFolders that match those selectors. +func (c *userFolders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.UserFolderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.UserFolderList{} + err = c.client.Get(). + Resource("userfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested userFolders. +func (c *userFolders) Watch(ctx context.Context, opts metav1.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(). + Resource("userfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a userFolder and creates it. Returns the server's representation of the userFolder, and an error, if there is any. +func (c *userFolders) Create(ctx context.Context, userFolder *v1.UserFolder, opts metav1.CreateOptions) (result *v1.UserFolder, err error) { + result = &v1.UserFolder{} + err = c.client.Post(). + Resource("userfolders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(userFolder). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a userFolder and updates it. Returns the server's representation of the userFolder, and an error, if there is any. +func (c *userFolders) Update(ctx context.Context, userFolder *v1.UserFolder, opts metav1.UpdateOptions) (result *v1.UserFolder, err error) { + result = &v1.UserFolder{} + err = c.client.Put(). + Resource("userfolders"). + Name(userFolder.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(userFolder). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the userFolder and deletes it. Returns an error if one occurs. +func (c *userFolders) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("userfolders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *userFolders) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("userfolders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched userFolder. +func (c *userFolders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.UserFolder, err error) { + result = &v1.UserFolder{} + err = c.client.Patch(pt). + Resource("userfolders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/usergroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/usergroup.go new file mode 100644 index 000000000..747419cf9 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/usergroup.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// UserGroupsGetter has a method to return a UserGroupInterface. +// A group's client should implement this interface. +type UserGroupsGetter interface { + UserGroups() UserGroupInterface +} + +// UserGroupInterface has methods to work with UserGroup resources. +type UserGroupInterface interface { + Create(ctx context.Context, userGroup *v1.UserGroup, opts metav1.CreateOptions) (*v1.UserGroup, error) + Update(ctx context.Context, userGroup *v1.UserGroup, opts metav1.UpdateOptions) (*v1.UserGroup, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.UserGroup, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.UserGroupList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.UserGroup, err error) + UserGroupExpansion +} + +// userGroups implements UserGroupInterface +type userGroups struct { + client rest.Interface +} + +// newUserGroups returns a UserGroups +func newUserGroups(c *GlobalTsmV1Client) *userGroups { + return &userGroups{ + client: c.RESTClient(), + } +} + +// Get takes name of the userGroup, and returns the corresponding userGroup object, and an error if there is any. +func (c *userGroups) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.UserGroup, err error) { + result = &v1.UserGroup{} + err = c.client.Get(). + Resource("usergroups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of UserGroups that match those selectors. +func (c *userGroups) List(ctx context.Context, opts metav1.ListOptions) (result *v1.UserGroupList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.UserGroupList{} + err = c.client.Get(). + Resource("usergroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested userGroups. +func (c *userGroups) Watch(ctx context.Context, opts metav1.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(). + Resource("usergroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a userGroup and creates it. Returns the server's representation of the userGroup, and an error, if there is any. +func (c *userGroups) Create(ctx context.Context, userGroup *v1.UserGroup, opts metav1.CreateOptions) (result *v1.UserGroup, err error) { + result = &v1.UserGroup{} + err = c.client.Post(). + Resource("usergroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(userGroup). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a userGroup and updates it. Returns the server's representation of the userGroup, and an error, if there is any. +func (c *userGroups) Update(ctx context.Context, userGroup *v1.UserGroup, opts metav1.UpdateOptions) (result *v1.UserGroup, err error) { + result = &v1.UserGroup{} + err = c.client.Put(). + Resource("usergroups"). + Name(userGroup.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(userGroup). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the userGroup and deletes it. Returns an error if one occurs. +func (c *userGroups) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("usergroups"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *userGroups) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("usergroups"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched userGroup. +func (c *userGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.UserGroup, err error) { + result = &v1.UserGroup{} + err = c.client.Patch(pt). + Resource("usergroups"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/userpreference.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/userpreference.go new file mode 100644 index 000000000..d7a174503 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/userpreference.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// UserPreferencesGetter has a method to return a UserPreferenceInterface. +// A group's client should implement this interface. +type UserPreferencesGetter interface { + UserPreferences() UserPreferenceInterface +} + +// UserPreferenceInterface has methods to work with UserPreference resources. +type UserPreferenceInterface interface { + Create(ctx context.Context, userPreference *v1.UserPreference, opts metav1.CreateOptions) (*v1.UserPreference, error) + Update(ctx context.Context, userPreference *v1.UserPreference, opts metav1.UpdateOptions) (*v1.UserPreference, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.UserPreference, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.UserPreferenceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.UserPreference, err error) + UserPreferenceExpansion +} + +// userPreferences implements UserPreferenceInterface +type userPreferences struct { + client rest.Interface +} + +// newUserPreferences returns a UserPreferences +func newUserPreferences(c *GlobalTsmV1Client) *userPreferences { + return &userPreferences{ + client: c.RESTClient(), + } +} + +// Get takes name of the userPreference, and returns the corresponding userPreference object, and an error if there is any. +func (c *userPreferences) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.UserPreference, err error) { + result = &v1.UserPreference{} + err = c.client.Get(). + Resource("userpreferences"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of UserPreferences that match those selectors. +func (c *userPreferences) List(ctx context.Context, opts metav1.ListOptions) (result *v1.UserPreferenceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.UserPreferenceList{} + err = c.client.Get(). + Resource("userpreferences"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested userPreferences. +func (c *userPreferences) Watch(ctx context.Context, opts metav1.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(). + Resource("userpreferences"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a userPreference and creates it. Returns the server's representation of the userPreference, and an error, if there is any. +func (c *userPreferences) Create(ctx context.Context, userPreference *v1.UserPreference, opts metav1.CreateOptions) (result *v1.UserPreference, err error) { + result = &v1.UserPreference{} + err = c.client.Post(). + Resource("userpreferences"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(userPreference). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a userPreference and updates it. Returns the server's representation of the userPreference, and an error, if there is any. +func (c *userPreferences) Update(ctx context.Context, userPreference *v1.UserPreference, opts metav1.UpdateOptions) (result *v1.UserPreference, err error) { + result = &v1.UserPreference{} + err = c.client.Put(). + Resource("userpreferences"). + Name(userPreference.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(userPreference). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the userPreference and deletes it. Returns an error if one occurs. +func (c *userPreferences) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("userpreferences"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *userPreferences) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("userpreferences"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched userPreference. +func (c *userPreferences) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.UserPreference, err error) { + result = &v1.UserPreference{} + err = c.client.Patch(pt). + Resource("userpreferences"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/virtualservice.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/virtualservice.go new file mode 100644 index 000000000..69acc4cf7 --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/virtualservice.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// VirtualServicesGetter has a method to return a VirtualServiceInterface. +// A group's client should implement this interface. +type VirtualServicesGetter interface { + VirtualServices() VirtualServiceInterface +} + +// VirtualServiceInterface has methods to work with VirtualService resources. +type VirtualServiceInterface interface { + Create(ctx context.Context, virtualService *v1.VirtualService, opts metav1.CreateOptions) (*v1.VirtualService, error) + Update(ctx context.Context, virtualService *v1.VirtualService, opts metav1.UpdateOptions) (*v1.VirtualService, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.VirtualService, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.VirtualServiceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualService, err error) + VirtualServiceExpansion +} + +// virtualServices implements VirtualServiceInterface +type virtualServices struct { + client rest.Interface +} + +// newVirtualServices returns a VirtualServices +func newVirtualServices(c *GlobalTsmV1Client) *virtualServices { + return &virtualServices{ + client: c.RESTClient(), + } +} + +// Get takes name of the virtualService, and returns the corresponding virtualService object, and an error if there is any. +func (c *virtualServices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualService, err error) { + result = &v1.VirtualService{} + err = c.client.Get(). + Resource("virtualservices"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VirtualServices that match those selectors. +func (c *virtualServices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualServiceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.VirtualServiceList{} + err = c.client.Get(). + Resource("virtualservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested virtualServices. +func (c *virtualServices) Watch(ctx context.Context, opts metav1.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(). + Resource("virtualservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a virtualService and creates it. Returns the server's representation of the virtualService, and an error, if there is any. +func (c *virtualServices) Create(ctx context.Context, virtualService *v1.VirtualService, opts metav1.CreateOptions) (result *v1.VirtualService, err error) { + result = &v1.VirtualService{} + err = c.client.Post(). + Resource("virtualservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualService). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a virtualService and updates it. Returns the server's representation of the virtualService, and an error, if there is any. +func (c *virtualServices) Update(ctx context.Context, virtualService *v1.VirtualService, opts metav1.UpdateOptions) (result *v1.VirtualService, err error) { + result = &v1.VirtualService{} + err = c.client.Put(). + Resource("virtualservices"). + Name(virtualService.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualService). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the virtualService and deletes it. Returns an error if one occurs. +func (c *virtualServices) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("virtualservices"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *virtualServices) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("virtualservices"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched virtualService. +func (c *virtualServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualService, err error) { + result = &v1.VirtualService{} + err = c.client.Patch(pt). + Resource("virtualservices"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/workloadentry.go b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/workloadentry.go new file mode 100644 index 000000000..e9507217d --- /dev/null +++ b/compiler/example/output/generated/client/clientset/versioned/typed/global.tsm.tanzu.vmware.com/v1/workloadentry.go @@ -0,0 +1,168 @@ +/* +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 v1 + +import ( + "context" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + scheme "nexustempmodule/client/clientset/versioned/scheme" + "time" + + metav1 "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" +) + +// WorkloadEntriesGetter has a method to return a WorkloadEntryInterface. +// A group's client should implement this interface. +type WorkloadEntriesGetter interface { + WorkloadEntries() WorkloadEntryInterface +} + +// WorkloadEntryInterface has methods to work with WorkloadEntry resources. +type WorkloadEntryInterface interface { + Create(ctx context.Context, workloadEntry *v1.WorkloadEntry, opts metav1.CreateOptions) (*v1.WorkloadEntry, error) + Update(ctx context.Context, workloadEntry *v1.WorkloadEntry, opts metav1.UpdateOptions) (*v1.WorkloadEntry, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.WorkloadEntry, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.WorkloadEntryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.WorkloadEntry, err error) + WorkloadEntryExpansion +} + +// workloadEntries implements WorkloadEntryInterface +type workloadEntries struct { + client rest.Interface +} + +// newWorkloadEntries returns a WorkloadEntries +func newWorkloadEntries(c *GlobalTsmV1Client) *workloadEntries { + return &workloadEntries{ + client: c.RESTClient(), + } +} + +// Get takes name of the workloadEntry, and returns the corresponding workloadEntry object, and an error if there is any. +func (c *workloadEntries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.WorkloadEntry, err error) { + result = &v1.WorkloadEntry{} + err = c.client.Get(). + Resource("workloadentries"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of WorkloadEntries that match those selectors. +func (c *workloadEntries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.WorkloadEntryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.WorkloadEntryList{} + err = c.client.Get(). + Resource("workloadentries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested workloadEntries. +func (c *workloadEntries) Watch(ctx context.Context, opts metav1.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(). + Resource("workloadentries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a workloadEntry and creates it. Returns the server's representation of the workloadEntry, and an error, if there is any. +func (c *workloadEntries) Create(ctx context.Context, workloadEntry *v1.WorkloadEntry, opts metav1.CreateOptions) (result *v1.WorkloadEntry, err error) { + result = &v1.WorkloadEntry{} + err = c.client.Post(). + Resource("workloadentries"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(workloadEntry). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a workloadEntry and updates it. Returns the server's representation of the workloadEntry, and an error, if there is any. +func (c *workloadEntries) Update(ctx context.Context, workloadEntry *v1.WorkloadEntry, opts metav1.UpdateOptions) (result *v1.WorkloadEntry, err error) { + result = &v1.WorkloadEntry{} + err = c.client.Put(). + Resource("workloadentries"). + Name(workloadEntry.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(workloadEntry). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the workloadEntry and deletes it. Returns an error if one occurs. +func (c *workloadEntries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("workloadentries"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *workloadEntries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("workloadentries"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched workloadEntry. +func (c *workloadEntries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.WorkloadEntry, err error) { + result = &v1.WorkloadEntry{} + err = c.client.Patch(pt). + Resource("workloadentries"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/additionalgnsdata.go b/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/additionalgnsdata.go deleted file mode 100644 index 1ed01c84e..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/additionalgnsdata.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// AdditionalGnsDatasGetter has a method to return a AdditionalGnsDataInterface. -// A group's client should implement this interface. -type AdditionalGnsDatasGetter interface { - AdditionalGnsDatas() AdditionalGnsDataInterface -} - -// AdditionalGnsDataInterface has methods to work with AdditionalGnsData resources. -type AdditionalGnsDataInterface interface { - Create(ctx context.Context, additionalGnsData *v1.AdditionalGnsData, opts metav1.CreateOptions) (*v1.AdditionalGnsData, error) - Update(ctx context.Context, additionalGnsData *v1.AdditionalGnsData, opts metav1.UpdateOptions) (*v1.AdditionalGnsData, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AdditionalGnsData, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.AdditionalGnsDataList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AdditionalGnsData, err error) - AdditionalGnsDataExpansion -} - -// additionalGnsDatas implements AdditionalGnsDataInterface -type additionalGnsDatas struct { - client rest.Interface -} - -// newAdditionalGnsDatas returns a AdditionalGnsDatas -func newAdditionalGnsDatas(c *GnsTsmV1Client) *additionalGnsDatas { - return &additionalGnsDatas{ - client: c.RESTClient(), - } -} - -// Get takes name of the additionalGnsData, and returns the corresponding additionalGnsData object, and an error if there is any. -func (c *additionalGnsDatas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AdditionalGnsData, err error) { - result = &v1.AdditionalGnsData{} - err = c.client.Get(). - Resource("additionalgnsdatas"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of AdditionalGnsDatas that match those selectors. -func (c *additionalGnsDatas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AdditionalGnsDataList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.AdditionalGnsDataList{} - err = c.client.Get(). - Resource("additionalgnsdatas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested additionalGnsDatas. -func (c *additionalGnsDatas) Watch(ctx context.Context, opts metav1.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(). - Resource("additionalgnsdatas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a additionalGnsData and creates it. Returns the server's representation of the additionalGnsData, and an error, if there is any. -func (c *additionalGnsDatas) Create(ctx context.Context, additionalGnsData *v1.AdditionalGnsData, opts metav1.CreateOptions) (result *v1.AdditionalGnsData, err error) { - result = &v1.AdditionalGnsData{} - err = c.client.Post(). - Resource("additionalgnsdatas"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(additionalGnsData). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a additionalGnsData and updates it. Returns the server's representation of the additionalGnsData, and an error, if there is any. -func (c *additionalGnsDatas) Update(ctx context.Context, additionalGnsData *v1.AdditionalGnsData, opts metav1.UpdateOptions) (result *v1.AdditionalGnsData, err error) { - result = &v1.AdditionalGnsData{} - err = c.client.Put(). - Resource("additionalgnsdatas"). - Name(additionalGnsData.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(additionalGnsData). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the additionalGnsData and deletes it. Returns an error if one occurs. -func (c *additionalGnsDatas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("additionalgnsdatas"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *additionalGnsDatas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("additionalgnsdatas"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched additionalGnsData. -func (c *additionalGnsDatas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AdditionalGnsData, err error) { - result = &v1.AdditionalGnsData{} - err = c.client.Patch(pt). - Resource("additionalgnsdatas"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/barchild.go b/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/barchild.go deleted file mode 100644 index 5811268ef..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/barchild.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// BarChildsGetter has a method to return a BarChildInterface. -// A group's client should implement this interface. -type BarChildsGetter interface { - BarChilds() BarChildInterface -} - -// BarChildInterface has methods to work with BarChild resources. -type BarChildInterface interface { - Create(ctx context.Context, barChild *v1.BarChild, opts metav1.CreateOptions) (*v1.BarChild, error) - Update(ctx context.Context, barChild *v1.BarChild, opts metav1.UpdateOptions) (*v1.BarChild, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.BarChild, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.BarChildList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.BarChild, err error) - BarChildExpansion -} - -// barChilds implements BarChildInterface -type barChilds struct { - client rest.Interface -} - -// newBarChilds returns a BarChilds -func newBarChilds(c *GnsTsmV1Client) *barChilds { - return &barChilds{ - client: c.RESTClient(), - } -} - -// Get takes name of the barChild, and returns the corresponding barChild object, and an error if there is any. -func (c *barChilds) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.BarChild, err error) { - result = &v1.BarChild{} - err = c.client.Get(). - Resource("barchilds"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of BarChilds that match those selectors. -func (c *barChilds) List(ctx context.Context, opts metav1.ListOptions) (result *v1.BarChildList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.BarChildList{} - err = c.client.Get(). - Resource("barchilds"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested barChilds. -func (c *barChilds) Watch(ctx context.Context, opts metav1.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(). - Resource("barchilds"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a barChild and creates it. Returns the server's representation of the barChild, and an error, if there is any. -func (c *barChilds) Create(ctx context.Context, barChild *v1.BarChild, opts metav1.CreateOptions) (result *v1.BarChild, err error) { - result = &v1.BarChild{} - err = c.client.Post(). - Resource("barchilds"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(barChild). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a barChild and updates it. Returns the server's representation of the barChild, and an error, if there is any. -func (c *barChilds) Update(ctx context.Context, barChild *v1.BarChild, opts metav1.UpdateOptions) (result *v1.BarChild, err error) { - result = &v1.BarChild{} - err = c.client.Put(). - Resource("barchilds"). - Name(barChild.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(barChild). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the barChild and deletes it. Returns an error if one occurs. -func (c *barChilds) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("barchilds"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *barChilds) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("barchilds"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched barChild. -func (c *barChilds) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.BarChild, err error) { - result = &v1.BarChild{} - err = c.client.Patch(pt). - Resource("barchilds"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/dns.go b/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/dns.go deleted file mode 100644 index 0ea8be58c..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/dns.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// DnsesGetter has a method to return a DnsInterface. -// A group's client should implement this interface. -type DnsesGetter interface { - Dnses() DnsInterface -} - -// DnsInterface has methods to work with Dns resources. -type DnsInterface interface { - Create(ctx context.Context, dns *v1.Dns, opts metav1.CreateOptions) (*v1.Dns, error) - Update(ctx context.Context, dns *v1.Dns, opts metav1.UpdateOptions) (*v1.Dns, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Dns, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.DnsList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Dns, err error) - DnsExpansion -} - -// dnses implements DnsInterface -type dnses struct { - client rest.Interface -} - -// newDnses returns a Dnses -func newDnses(c *GnsTsmV1Client) *dnses { - return &dnses{ - client: c.RESTClient(), - } -} - -// Get takes name of the dns, and returns the corresponding dns object, and an error if there is any. -func (c *dnses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Dns, err error) { - result = &v1.Dns{} - err = c.client.Get(). - Resource("dnses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Dnses that match those selectors. -func (c *dnses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DnsList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.DnsList{} - err = c.client.Get(). - Resource("dnses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested dnses. -func (c *dnses) Watch(ctx context.Context, opts metav1.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(). - Resource("dnses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a dns and creates it. Returns the server's representation of the dns, and an error, if there is any. -func (c *dnses) Create(ctx context.Context, dns *v1.Dns, opts metav1.CreateOptions) (result *v1.Dns, err error) { - result = &v1.Dns{} - err = c.client.Post(). - Resource("dnses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(dns). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a dns and updates it. Returns the server's representation of the dns, and an error, if there is any. -func (c *dnses) Update(ctx context.Context, dns *v1.Dns, opts metav1.UpdateOptions) (result *v1.Dns, err error) { - result = &v1.Dns{} - err = c.client.Put(). - Resource("dnses"). - Name(dns.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(dns). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the dns and deletes it. Returns an error if one occurs. -func (c *dnses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("dnses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *dnses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("dnses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched dns. -func (c *dnses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Dns, err error) { - result = &v1.Dns{} - err = c.client.Patch(pt). - Resource("dnses"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_additionalgnsdata.go b/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_additionalgnsdata.go deleted file mode 100644 index 8862a801f..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_additionalgnsdata.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - gnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeAdditionalGnsDatas implements AdditionalGnsDataInterface -type FakeAdditionalGnsDatas struct { - Fake *FakeGnsTsmV1 -} - -var additionalgnsdatasResource = schema.GroupVersionResource{Group: "gns.tsm.tanzu.vmware.com", Version: "v1", Resource: "additionalgnsdatas"} - -var additionalgnsdatasKind = schema.GroupVersionKind{Group: "gns.tsm.tanzu.vmware.com", Version: "v1", Kind: "AdditionalGnsData"} - -// Get takes name of the additionalGnsData, and returns the corresponding additionalGnsData object, and an error if there is any. -func (c *FakeAdditionalGnsDatas) Get(ctx context.Context, name string, options v1.GetOptions) (result *gnstsmtanzuvmwarecomv1.AdditionalGnsData, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(additionalgnsdatasResource, name), &gnstsmtanzuvmwarecomv1.AdditionalGnsData{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.AdditionalGnsData), err -} - -// List takes label and field selectors, and returns the list of AdditionalGnsDatas that match those selectors. -func (c *FakeAdditionalGnsDatas) List(ctx context.Context, opts v1.ListOptions) (result *gnstsmtanzuvmwarecomv1.AdditionalGnsDataList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(additionalgnsdatasResource, additionalgnsdatasKind, opts), &gnstsmtanzuvmwarecomv1.AdditionalGnsDataList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &gnstsmtanzuvmwarecomv1.AdditionalGnsDataList{ListMeta: obj.(*gnstsmtanzuvmwarecomv1.AdditionalGnsDataList).ListMeta} - for _, item := range obj.(*gnstsmtanzuvmwarecomv1.AdditionalGnsDataList).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 additionalGnsDatas. -func (c *FakeAdditionalGnsDatas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(additionalgnsdatasResource, opts)) -} - -// Create takes the representation of a additionalGnsData and creates it. Returns the server's representation of the additionalGnsData, and an error, if there is any. -func (c *FakeAdditionalGnsDatas) Create(ctx context.Context, additionalGnsData *gnstsmtanzuvmwarecomv1.AdditionalGnsData, opts v1.CreateOptions) (result *gnstsmtanzuvmwarecomv1.AdditionalGnsData, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(additionalgnsdatasResource, additionalGnsData), &gnstsmtanzuvmwarecomv1.AdditionalGnsData{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.AdditionalGnsData), err -} - -// Update takes the representation of a additionalGnsData and updates it. Returns the server's representation of the additionalGnsData, and an error, if there is any. -func (c *FakeAdditionalGnsDatas) Update(ctx context.Context, additionalGnsData *gnstsmtanzuvmwarecomv1.AdditionalGnsData, opts v1.UpdateOptions) (result *gnstsmtanzuvmwarecomv1.AdditionalGnsData, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(additionalgnsdatasResource, additionalGnsData), &gnstsmtanzuvmwarecomv1.AdditionalGnsData{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.AdditionalGnsData), err -} - -// Delete takes name of the additionalGnsData and deletes it. Returns an error if one occurs. -func (c *FakeAdditionalGnsDatas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(additionalgnsdatasResource, name), &gnstsmtanzuvmwarecomv1.AdditionalGnsData{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeAdditionalGnsDatas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(additionalgnsdatasResource, listOpts) - - _, err := c.Fake.Invokes(action, &gnstsmtanzuvmwarecomv1.AdditionalGnsDataList{}) - return err -} - -// Patch applies the patch and returns the patched additionalGnsData. -func (c *FakeAdditionalGnsDatas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *gnstsmtanzuvmwarecomv1.AdditionalGnsData, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(additionalgnsdatasResource, name, pt, data, subresources...), &gnstsmtanzuvmwarecomv1.AdditionalGnsData{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.AdditionalGnsData), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_barchild.go b/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_barchild.go deleted file mode 100644 index 8559954bb..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_barchild.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - gnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeBarChilds implements BarChildInterface -type FakeBarChilds struct { - Fake *FakeGnsTsmV1 -} - -var barchildsResource = schema.GroupVersionResource{Group: "gns.tsm.tanzu.vmware.com", Version: "v1", Resource: "barchilds"} - -var barchildsKind = schema.GroupVersionKind{Group: "gns.tsm.tanzu.vmware.com", Version: "v1", Kind: "BarChild"} - -// Get takes name of the barChild, and returns the corresponding barChild object, and an error if there is any. -func (c *FakeBarChilds) Get(ctx context.Context, name string, options v1.GetOptions) (result *gnstsmtanzuvmwarecomv1.BarChild, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(barchildsResource, name), &gnstsmtanzuvmwarecomv1.BarChild{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.BarChild), err -} - -// List takes label and field selectors, and returns the list of BarChilds that match those selectors. -func (c *FakeBarChilds) List(ctx context.Context, opts v1.ListOptions) (result *gnstsmtanzuvmwarecomv1.BarChildList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(barchildsResource, barchildsKind, opts), &gnstsmtanzuvmwarecomv1.BarChildList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &gnstsmtanzuvmwarecomv1.BarChildList{ListMeta: obj.(*gnstsmtanzuvmwarecomv1.BarChildList).ListMeta} - for _, item := range obj.(*gnstsmtanzuvmwarecomv1.BarChildList).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 barChilds. -func (c *FakeBarChilds) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(barchildsResource, opts)) -} - -// Create takes the representation of a barChild and creates it. Returns the server's representation of the barChild, and an error, if there is any. -func (c *FakeBarChilds) Create(ctx context.Context, barChild *gnstsmtanzuvmwarecomv1.BarChild, opts v1.CreateOptions) (result *gnstsmtanzuvmwarecomv1.BarChild, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(barchildsResource, barChild), &gnstsmtanzuvmwarecomv1.BarChild{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.BarChild), err -} - -// Update takes the representation of a barChild and updates it. Returns the server's representation of the barChild, and an error, if there is any. -func (c *FakeBarChilds) Update(ctx context.Context, barChild *gnstsmtanzuvmwarecomv1.BarChild, opts v1.UpdateOptions) (result *gnstsmtanzuvmwarecomv1.BarChild, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(barchildsResource, barChild), &gnstsmtanzuvmwarecomv1.BarChild{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.BarChild), err -} - -// Delete takes name of the barChild and deletes it. Returns an error if one occurs. -func (c *FakeBarChilds) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(barchildsResource, name), &gnstsmtanzuvmwarecomv1.BarChild{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeBarChilds) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(barchildsResource, listOpts) - - _, err := c.Fake.Invokes(action, &gnstsmtanzuvmwarecomv1.BarChildList{}) - return err -} - -// Patch applies the patch and returns the patched barChild. -func (c *FakeBarChilds) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *gnstsmtanzuvmwarecomv1.BarChild, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(barchildsResource, name, pt, data, subresources...), &gnstsmtanzuvmwarecomv1.BarChild{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.BarChild), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_dns.go b/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_dns.go deleted file mode 100644 index aae1984ac..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_dns.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - gnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeDnses implements DnsInterface -type FakeDnses struct { - Fake *FakeGnsTsmV1 -} - -var dnsesResource = schema.GroupVersionResource{Group: "gns.tsm.tanzu.vmware.com", Version: "v1", Resource: "dnses"} - -var dnsesKind = schema.GroupVersionKind{Group: "gns.tsm.tanzu.vmware.com", Version: "v1", Kind: "Dns"} - -// Get takes name of the dns, and returns the corresponding dns object, and an error if there is any. -func (c *FakeDnses) Get(ctx context.Context, name string, options v1.GetOptions) (result *gnstsmtanzuvmwarecomv1.Dns, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(dnsesResource, name), &gnstsmtanzuvmwarecomv1.Dns{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.Dns), err -} - -// List takes label and field selectors, and returns the list of Dnses that match those selectors. -func (c *FakeDnses) List(ctx context.Context, opts v1.ListOptions) (result *gnstsmtanzuvmwarecomv1.DnsList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(dnsesResource, dnsesKind, opts), &gnstsmtanzuvmwarecomv1.DnsList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &gnstsmtanzuvmwarecomv1.DnsList{ListMeta: obj.(*gnstsmtanzuvmwarecomv1.DnsList).ListMeta} - for _, item := range obj.(*gnstsmtanzuvmwarecomv1.DnsList).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 dnses. -func (c *FakeDnses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(dnsesResource, opts)) -} - -// Create takes the representation of a dns and creates it. Returns the server's representation of the dns, and an error, if there is any. -func (c *FakeDnses) Create(ctx context.Context, dns *gnstsmtanzuvmwarecomv1.Dns, opts v1.CreateOptions) (result *gnstsmtanzuvmwarecomv1.Dns, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(dnsesResource, dns), &gnstsmtanzuvmwarecomv1.Dns{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.Dns), err -} - -// Update takes the representation of a dns and updates it. Returns the server's representation of the dns, and an error, if there is any. -func (c *FakeDnses) Update(ctx context.Context, dns *gnstsmtanzuvmwarecomv1.Dns, opts v1.UpdateOptions) (result *gnstsmtanzuvmwarecomv1.Dns, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(dnsesResource, dns), &gnstsmtanzuvmwarecomv1.Dns{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.Dns), err -} - -// Delete takes name of the dns and deletes it. Returns an error if one occurs. -func (c *FakeDnses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(dnsesResource, name), &gnstsmtanzuvmwarecomv1.Dns{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeDnses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(dnsesResource, listOpts) - - _, err := c.Fake.Invokes(action, &gnstsmtanzuvmwarecomv1.DnsList{}) - return err -} - -// Patch applies the patch and returns the patched dns. -func (c *FakeDnses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *gnstsmtanzuvmwarecomv1.Dns, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(dnsesResource, name, pt, data, subresources...), &gnstsmtanzuvmwarecomv1.Dns{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.Dns), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_foo.go b/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_foo.go deleted file mode 100644 index f1ddbc07d..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_foo.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - gnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeFoos implements FooInterface -type FakeFoos struct { - Fake *FakeGnsTsmV1 -} - -var foosResource = schema.GroupVersionResource{Group: "gns.tsm.tanzu.vmware.com", Version: "v1", Resource: "foos"} - -var foosKind = schema.GroupVersionKind{Group: "gns.tsm.tanzu.vmware.com", Version: "v1", Kind: "Foo"} - -// Get takes name of the foo, and returns the corresponding foo object, and an error if there is any. -func (c *FakeFoos) Get(ctx context.Context, name string, options v1.GetOptions) (result *gnstsmtanzuvmwarecomv1.Foo, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(foosResource, name), &gnstsmtanzuvmwarecomv1.Foo{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.Foo), err -} - -// List takes label and field selectors, and returns the list of Foos that match those selectors. -func (c *FakeFoos) List(ctx context.Context, opts v1.ListOptions) (result *gnstsmtanzuvmwarecomv1.FooList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(foosResource, foosKind, opts), &gnstsmtanzuvmwarecomv1.FooList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &gnstsmtanzuvmwarecomv1.FooList{ListMeta: obj.(*gnstsmtanzuvmwarecomv1.FooList).ListMeta} - for _, item := range obj.(*gnstsmtanzuvmwarecomv1.FooList).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 foos. -func (c *FakeFoos) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(foosResource, opts)) -} - -// Create takes the representation of a foo and creates it. Returns the server's representation of the foo, and an error, if there is any. -func (c *FakeFoos) Create(ctx context.Context, foo *gnstsmtanzuvmwarecomv1.Foo, opts v1.CreateOptions) (result *gnstsmtanzuvmwarecomv1.Foo, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(foosResource, foo), &gnstsmtanzuvmwarecomv1.Foo{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.Foo), err -} - -// Update takes the representation of a foo and updates it. Returns the server's representation of the foo, and an error, if there is any. -func (c *FakeFoos) Update(ctx context.Context, foo *gnstsmtanzuvmwarecomv1.Foo, opts v1.UpdateOptions) (result *gnstsmtanzuvmwarecomv1.Foo, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(foosResource, foo), &gnstsmtanzuvmwarecomv1.Foo{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.Foo), err -} - -// Delete takes name of the foo and deletes it. Returns an error if one occurs. -func (c *FakeFoos) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(foosResource, name), &gnstsmtanzuvmwarecomv1.Foo{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeFoos) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(foosResource, listOpts) - - _, err := c.Fake.Invokes(action, &gnstsmtanzuvmwarecomv1.FooList{}) - return err -} - -// Patch applies the patch and returns the patched foo. -func (c *FakeFoos) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *gnstsmtanzuvmwarecomv1.Foo, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(foosResource, name, pt, data, subresources...), &gnstsmtanzuvmwarecomv1.Foo{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.Foo), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_gns.go b/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_gns.go deleted file mode 100644 index 700e69c97..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_gns.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - gnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeGnses implements GnsInterface -type FakeGnses struct { - Fake *FakeGnsTsmV1 -} - -var gnsesResource = schema.GroupVersionResource{Group: "gns.tsm.tanzu.vmware.com", Version: "v1", Resource: "gnses"} - -var gnsesKind = schema.GroupVersionKind{Group: "gns.tsm.tanzu.vmware.com", Version: "v1", Kind: "Gns"} - -// Get takes name of the gns, and returns the corresponding gns object, and an error if there is any. -func (c *FakeGnses) Get(ctx context.Context, name string, options v1.GetOptions) (result *gnstsmtanzuvmwarecomv1.Gns, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(gnsesResource, name), &gnstsmtanzuvmwarecomv1.Gns{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.Gns), err -} - -// List takes label and field selectors, and returns the list of Gnses that match those selectors. -func (c *FakeGnses) List(ctx context.Context, opts v1.ListOptions) (result *gnstsmtanzuvmwarecomv1.GnsList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(gnsesResource, gnsesKind, opts), &gnstsmtanzuvmwarecomv1.GnsList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &gnstsmtanzuvmwarecomv1.GnsList{ListMeta: obj.(*gnstsmtanzuvmwarecomv1.GnsList).ListMeta} - for _, item := range obj.(*gnstsmtanzuvmwarecomv1.GnsList).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 gnses. -func (c *FakeGnses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(gnsesResource, opts)) -} - -// Create takes the representation of a gns and creates it. Returns the server's representation of the gns, and an error, if there is any. -func (c *FakeGnses) Create(ctx context.Context, gns *gnstsmtanzuvmwarecomv1.Gns, opts v1.CreateOptions) (result *gnstsmtanzuvmwarecomv1.Gns, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(gnsesResource, gns), &gnstsmtanzuvmwarecomv1.Gns{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.Gns), err -} - -// Update takes the representation of a gns and updates it. Returns the server's representation of the gns, and an error, if there is any. -func (c *FakeGnses) Update(ctx context.Context, gns *gnstsmtanzuvmwarecomv1.Gns, opts v1.UpdateOptions) (result *gnstsmtanzuvmwarecomv1.Gns, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(gnsesResource, gns), &gnstsmtanzuvmwarecomv1.Gns{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.Gns), err -} - -// Delete takes name of the gns and deletes it. Returns an error if one occurs. -func (c *FakeGnses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(gnsesResource, name), &gnstsmtanzuvmwarecomv1.Gns{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeGnses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(gnsesResource, listOpts) - - _, err := c.Fake.Invokes(action, &gnstsmtanzuvmwarecomv1.GnsList{}) - return err -} - -// Patch applies the patch and returns the patched gns. -func (c *FakeGnses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *gnstsmtanzuvmwarecomv1.Gns, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(gnsesResource, name, pt, data, subresources...), &gnstsmtanzuvmwarecomv1.Gns{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.Gns), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_gns.tsm.tanzu.vmware.com_client.go b/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_gns.tsm.tanzu.vmware.com_client.go deleted file mode 100644 index 85a1e846d..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_gns.tsm.tanzu.vmware.com_client.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -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 ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1" - - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeGnsTsmV1 struct { - *testing.Fake -} - -func (c *FakeGnsTsmV1) AdditionalGnsDatas() v1.AdditionalGnsDataInterface { - return &FakeAdditionalGnsDatas{c} -} - -func (c *FakeGnsTsmV1) BarChilds() v1.BarChildInterface { - return &FakeBarChilds{c} -} - -func (c *FakeGnsTsmV1) Dnses() v1.DnsInterface { - return &FakeDnses{c} -} - -func (c *FakeGnsTsmV1) Foos() v1.FooInterface { - return &FakeFoos{c} -} - -func (c *FakeGnsTsmV1) Gnses() v1.GnsInterface { - return &FakeGnses{c} -} - -func (c *FakeGnsTsmV1) IgnoreChilds() v1.IgnoreChildInterface { - return &FakeIgnoreChilds{c} -} - -func (c *FakeGnsTsmV1) RandomGnsDatas() v1.RandomGnsDataInterface { - return &FakeRandomGnsDatas{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeGnsTsmV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_ignorechild.go b/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_ignorechild.go deleted file mode 100644 index 56a6d001e..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_ignorechild.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - gnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeIgnoreChilds implements IgnoreChildInterface -type FakeIgnoreChilds struct { - Fake *FakeGnsTsmV1 -} - -var ignorechildsResource = schema.GroupVersionResource{Group: "gns.tsm.tanzu.vmware.com", Version: "v1", Resource: "ignorechilds"} - -var ignorechildsKind = schema.GroupVersionKind{Group: "gns.tsm.tanzu.vmware.com", Version: "v1", Kind: "IgnoreChild"} - -// Get takes name of the ignoreChild, and returns the corresponding ignoreChild object, and an error if there is any. -func (c *FakeIgnoreChilds) Get(ctx context.Context, name string, options v1.GetOptions) (result *gnstsmtanzuvmwarecomv1.IgnoreChild, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(ignorechildsResource, name), &gnstsmtanzuvmwarecomv1.IgnoreChild{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.IgnoreChild), err -} - -// List takes label and field selectors, and returns the list of IgnoreChilds that match those selectors. -func (c *FakeIgnoreChilds) List(ctx context.Context, opts v1.ListOptions) (result *gnstsmtanzuvmwarecomv1.IgnoreChildList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(ignorechildsResource, ignorechildsKind, opts), &gnstsmtanzuvmwarecomv1.IgnoreChildList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &gnstsmtanzuvmwarecomv1.IgnoreChildList{ListMeta: obj.(*gnstsmtanzuvmwarecomv1.IgnoreChildList).ListMeta} - for _, item := range obj.(*gnstsmtanzuvmwarecomv1.IgnoreChildList).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 ignoreChilds. -func (c *FakeIgnoreChilds) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(ignorechildsResource, opts)) -} - -// Create takes the representation of a ignoreChild and creates it. Returns the server's representation of the ignoreChild, and an error, if there is any. -func (c *FakeIgnoreChilds) Create(ctx context.Context, ignoreChild *gnstsmtanzuvmwarecomv1.IgnoreChild, opts v1.CreateOptions) (result *gnstsmtanzuvmwarecomv1.IgnoreChild, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(ignorechildsResource, ignoreChild), &gnstsmtanzuvmwarecomv1.IgnoreChild{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.IgnoreChild), err -} - -// Update takes the representation of a ignoreChild and updates it. Returns the server's representation of the ignoreChild, and an error, if there is any. -func (c *FakeIgnoreChilds) Update(ctx context.Context, ignoreChild *gnstsmtanzuvmwarecomv1.IgnoreChild, opts v1.UpdateOptions) (result *gnstsmtanzuvmwarecomv1.IgnoreChild, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(ignorechildsResource, ignoreChild), &gnstsmtanzuvmwarecomv1.IgnoreChild{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.IgnoreChild), err -} - -// Delete takes name of the ignoreChild and deletes it. Returns an error if one occurs. -func (c *FakeIgnoreChilds) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(ignorechildsResource, name), &gnstsmtanzuvmwarecomv1.IgnoreChild{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeIgnoreChilds) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(ignorechildsResource, listOpts) - - _, err := c.Fake.Invokes(action, &gnstsmtanzuvmwarecomv1.IgnoreChildList{}) - return err -} - -// Patch applies the patch and returns the patched ignoreChild. -func (c *FakeIgnoreChilds) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *gnstsmtanzuvmwarecomv1.IgnoreChild, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(ignorechildsResource, name, pt, data, subresources...), &gnstsmtanzuvmwarecomv1.IgnoreChild{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.IgnoreChild), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_randomgnsdata.go b/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_randomgnsdata.go deleted file mode 100644 index 7b21c25b0..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/fake/fake_randomgnsdata.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - gnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeRandomGnsDatas implements RandomGnsDataInterface -type FakeRandomGnsDatas struct { - Fake *FakeGnsTsmV1 -} - -var randomgnsdatasResource = schema.GroupVersionResource{Group: "gns.tsm.tanzu.vmware.com", Version: "v1", Resource: "randomgnsdatas"} - -var randomgnsdatasKind = schema.GroupVersionKind{Group: "gns.tsm.tanzu.vmware.com", Version: "v1", Kind: "RandomGnsData"} - -// Get takes name of the randomGnsData, and returns the corresponding randomGnsData object, and an error if there is any. -func (c *FakeRandomGnsDatas) Get(ctx context.Context, name string, options v1.GetOptions) (result *gnstsmtanzuvmwarecomv1.RandomGnsData, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(randomgnsdatasResource, name), &gnstsmtanzuvmwarecomv1.RandomGnsData{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.RandomGnsData), err -} - -// List takes label and field selectors, and returns the list of RandomGnsDatas that match those selectors. -func (c *FakeRandomGnsDatas) List(ctx context.Context, opts v1.ListOptions) (result *gnstsmtanzuvmwarecomv1.RandomGnsDataList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(randomgnsdatasResource, randomgnsdatasKind, opts), &gnstsmtanzuvmwarecomv1.RandomGnsDataList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &gnstsmtanzuvmwarecomv1.RandomGnsDataList{ListMeta: obj.(*gnstsmtanzuvmwarecomv1.RandomGnsDataList).ListMeta} - for _, item := range obj.(*gnstsmtanzuvmwarecomv1.RandomGnsDataList).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 randomGnsDatas. -func (c *FakeRandomGnsDatas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(randomgnsdatasResource, opts)) -} - -// Create takes the representation of a randomGnsData and creates it. Returns the server's representation of the randomGnsData, and an error, if there is any. -func (c *FakeRandomGnsDatas) Create(ctx context.Context, randomGnsData *gnstsmtanzuvmwarecomv1.RandomGnsData, opts v1.CreateOptions) (result *gnstsmtanzuvmwarecomv1.RandomGnsData, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(randomgnsdatasResource, randomGnsData), &gnstsmtanzuvmwarecomv1.RandomGnsData{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.RandomGnsData), err -} - -// Update takes the representation of a randomGnsData and updates it. Returns the server's representation of the randomGnsData, and an error, if there is any. -func (c *FakeRandomGnsDatas) Update(ctx context.Context, randomGnsData *gnstsmtanzuvmwarecomv1.RandomGnsData, opts v1.UpdateOptions) (result *gnstsmtanzuvmwarecomv1.RandomGnsData, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(randomgnsdatasResource, randomGnsData), &gnstsmtanzuvmwarecomv1.RandomGnsData{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.RandomGnsData), err -} - -// Delete takes name of the randomGnsData and deletes it. Returns an error if one occurs. -func (c *FakeRandomGnsDatas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(randomgnsdatasResource, name), &gnstsmtanzuvmwarecomv1.RandomGnsData{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeRandomGnsDatas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(randomgnsdatasResource, listOpts) - - _, err := c.Fake.Invokes(action, &gnstsmtanzuvmwarecomv1.RandomGnsDataList{}) - return err -} - -// Patch applies the patch and returns the patched randomGnsData. -func (c *FakeRandomGnsDatas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *gnstsmtanzuvmwarecomv1.RandomGnsData, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(randomgnsdatasResource, name, pt, data, subresources...), &gnstsmtanzuvmwarecomv1.RandomGnsData{}) - if obj == nil { - return nil, err - } - return obj.(*gnstsmtanzuvmwarecomv1.RandomGnsData), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/foo.go b/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/foo.go deleted file mode 100644 index eb9b678d2..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/foo.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// FoosGetter has a method to return a FooInterface. -// A group's client should implement this interface. -type FoosGetter interface { - Foos() FooInterface -} - -// FooInterface has methods to work with Foo resources. -type FooInterface interface { - Create(ctx context.Context, foo *v1.Foo, opts metav1.CreateOptions) (*v1.Foo, error) - Update(ctx context.Context, foo *v1.Foo, opts metav1.UpdateOptions) (*v1.Foo, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Foo, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.FooList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Foo, err error) - FooExpansion -} - -// foos implements FooInterface -type foos struct { - client rest.Interface -} - -// newFoos returns a Foos -func newFoos(c *GnsTsmV1Client) *foos { - return &foos{ - client: c.RESTClient(), - } -} - -// Get takes name of the foo, and returns the corresponding foo object, and an error if there is any. -func (c *foos) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Foo, err error) { - result = &v1.Foo{} - err = c.client.Get(). - Resource("foos"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Foos that match those selectors. -func (c *foos) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FooList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.FooList{} - err = c.client.Get(). - Resource("foos"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested foos. -func (c *foos) Watch(ctx context.Context, opts metav1.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(). - Resource("foos"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a foo and creates it. Returns the server's representation of the foo, and an error, if there is any. -func (c *foos) Create(ctx context.Context, foo *v1.Foo, opts metav1.CreateOptions) (result *v1.Foo, err error) { - result = &v1.Foo{} - err = c.client.Post(). - Resource("foos"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(foo). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a foo and updates it. Returns the server's representation of the foo, and an error, if there is any. -func (c *foos) Update(ctx context.Context, foo *v1.Foo, opts metav1.UpdateOptions) (result *v1.Foo, err error) { - result = &v1.Foo{} - err = c.client.Put(). - Resource("foos"). - Name(foo.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(foo). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the foo and deletes it. Returns an error if one occurs. -func (c *foos) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("foos"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *foos) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("foos"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched foo. -func (c *foos) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Foo, err error) { - result = &v1.Foo{} - err = c.client.Patch(pt). - Resource("foos"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/generated_expansion.go b/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/generated_expansion.go deleted file mode 100644 index 032506ab5..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/generated_expansion.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -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 v1 - -type AdditionalGnsDataExpansion interface{} - -type BarChildExpansion interface{} - -type DnsExpansion interface{} - -type FooExpansion interface{} - -type GnsExpansion interface{} - -type IgnoreChildExpansion interface{} - -type RandomGnsDataExpansion interface{} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/gns.go b/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/gns.go deleted file mode 100644 index b8d77beef..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/gns.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// GnsesGetter has a method to return a GnsInterface. -// A group's client should implement this interface. -type GnsesGetter interface { - Gnses() GnsInterface -} - -// GnsInterface has methods to work with Gns resources. -type GnsInterface interface { - Create(ctx context.Context, gns *v1.Gns, opts metav1.CreateOptions) (*v1.Gns, error) - Update(ctx context.Context, gns *v1.Gns, opts metav1.UpdateOptions) (*v1.Gns, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Gns, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.GnsList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Gns, err error) - GnsExpansion -} - -// gnses implements GnsInterface -type gnses struct { - client rest.Interface -} - -// newGnses returns a Gnses -func newGnses(c *GnsTsmV1Client) *gnses { - return &gnses{ - client: c.RESTClient(), - } -} - -// Get takes name of the gns, and returns the corresponding gns object, and an error if there is any. -func (c *gnses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Gns, err error) { - result = &v1.Gns{} - err = c.client.Get(). - Resource("gnses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Gnses that match those selectors. -func (c *gnses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GnsList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.GnsList{} - err = c.client.Get(). - Resource("gnses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested gnses. -func (c *gnses) Watch(ctx context.Context, opts metav1.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(). - Resource("gnses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a gns and creates it. Returns the server's representation of the gns, and an error, if there is any. -func (c *gnses) Create(ctx context.Context, gns *v1.Gns, opts metav1.CreateOptions) (result *v1.Gns, err error) { - result = &v1.Gns{} - err = c.client.Post(). - Resource("gnses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gns). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a gns and updates it. Returns the server's representation of the gns, and an error, if there is any. -func (c *gnses) Update(ctx context.Context, gns *v1.Gns, opts metav1.UpdateOptions) (result *v1.Gns, err error) { - result = &v1.Gns{} - err = c.client.Put(). - Resource("gnses"). - Name(gns.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gns). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the gns and deletes it. Returns an error if one occurs. -func (c *gnses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("gnses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *gnses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("gnses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched gns. -func (c *gnses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Gns, err error) { - result = &v1.Gns{} - err = c.client.Patch(pt). - Resource("gnses"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/gns.tsm.tanzu.vmware.com_client.go b/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/gns.tsm.tanzu.vmware.com_client.go deleted file mode 100644 index 7920829af..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/gns.tsm.tanzu.vmware.com_client.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -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 v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - rest "k8s.io/client-go/rest" -) - -type GnsTsmV1Interface interface { - RESTClient() rest.Interface - AdditionalGnsDatasGetter - BarChildsGetter - DnsesGetter - FoosGetter - GnsesGetter - IgnoreChildsGetter - RandomGnsDatasGetter -} - -// GnsTsmV1Client is used to interact with features provided by the gns.tsm.tanzu.vmware.com group. -type GnsTsmV1Client struct { - restClient rest.Interface -} - -func (c *GnsTsmV1Client) AdditionalGnsDatas() AdditionalGnsDataInterface { - return newAdditionalGnsDatas(c) -} - -func (c *GnsTsmV1Client) BarChilds() BarChildInterface { - return newBarChilds(c) -} - -func (c *GnsTsmV1Client) Dnses() DnsInterface { - return newDnses(c) -} - -func (c *GnsTsmV1Client) Foos() FooInterface { - return newFoos(c) -} - -func (c *GnsTsmV1Client) Gnses() GnsInterface { - return newGnses(c) -} - -func (c *GnsTsmV1Client) IgnoreChilds() IgnoreChildInterface { - return newIgnoreChilds(c) -} - -func (c *GnsTsmV1Client) RandomGnsDatas() RandomGnsDataInterface { - return newRandomGnsDatas(c) -} - -// NewForConfig creates a new GnsTsmV1Client for the given config. -func NewForConfig(c *rest.Config) (*GnsTsmV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &GnsTsmV1Client{client}, nil -} - -// NewForConfigOrDie creates a new GnsTsmV1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *GnsTsmV1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new GnsTsmV1Client for the given RESTClient. -func New(c rest.Interface) *GnsTsmV1Client { - return &GnsTsmV1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1.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 *GnsTsmV1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/ignorechild.go b/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/ignorechild.go deleted file mode 100644 index 0d5e6870a..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/ignorechild.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// IgnoreChildsGetter has a method to return a IgnoreChildInterface. -// A group's client should implement this interface. -type IgnoreChildsGetter interface { - IgnoreChilds() IgnoreChildInterface -} - -// IgnoreChildInterface has methods to work with IgnoreChild resources. -type IgnoreChildInterface interface { - Create(ctx context.Context, ignoreChild *v1.IgnoreChild, opts metav1.CreateOptions) (*v1.IgnoreChild, error) - Update(ctx context.Context, ignoreChild *v1.IgnoreChild, opts metav1.UpdateOptions) (*v1.IgnoreChild, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.IgnoreChild, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.IgnoreChildList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IgnoreChild, err error) - IgnoreChildExpansion -} - -// ignoreChilds implements IgnoreChildInterface -type ignoreChilds struct { - client rest.Interface -} - -// newIgnoreChilds returns a IgnoreChilds -func newIgnoreChilds(c *GnsTsmV1Client) *ignoreChilds { - return &ignoreChilds{ - client: c.RESTClient(), - } -} - -// Get takes name of the ignoreChild, and returns the corresponding ignoreChild object, and an error if there is any. -func (c *ignoreChilds) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.IgnoreChild, err error) { - result = &v1.IgnoreChild{} - err = c.client.Get(). - Resource("ignorechilds"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of IgnoreChilds that match those selectors. -func (c *ignoreChilds) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IgnoreChildList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.IgnoreChildList{} - err = c.client.Get(). - Resource("ignorechilds"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested ignoreChilds. -func (c *ignoreChilds) Watch(ctx context.Context, opts metav1.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(). - Resource("ignorechilds"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a ignoreChild and creates it. Returns the server's representation of the ignoreChild, and an error, if there is any. -func (c *ignoreChilds) Create(ctx context.Context, ignoreChild *v1.IgnoreChild, opts metav1.CreateOptions) (result *v1.IgnoreChild, err error) { - result = &v1.IgnoreChild{} - err = c.client.Post(). - Resource("ignorechilds"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ignoreChild). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a ignoreChild and updates it. Returns the server's representation of the ignoreChild, and an error, if there is any. -func (c *ignoreChilds) Update(ctx context.Context, ignoreChild *v1.IgnoreChild, opts metav1.UpdateOptions) (result *v1.IgnoreChild, err error) { - result = &v1.IgnoreChild{} - err = c.client.Put(). - Resource("ignorechilds"). - Name(ignoreChild.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ignoreChild). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the ignoreChild and deletes it. Returns an error if one occurs. -func (c *ignoreChilds) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("ignorechilds"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *ignoreChilds) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("ignorechilds"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched ignoreChild. -func (c *ignoreChilds) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IgnoreChild, err error) { - result = &v1.IgnoreChild{} - err = c.client.Patch(pt). - Resource("ignorechilds"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/randomgnsdata.go b/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/randomgnsdata.go deleted file mode 100644 index 874cd0135..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/gns.tsm.tanzu.vmware.com/v1/randomgnsdata.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// RandomGnsDatasGetter has a method to return a RandomGnsDataInterface. -// A group's client should implement this interface. -type RandomGnsDatasGetter interface { - RandomGnsDatas() RandomGnsDataInterface -} - -// RandomGnsDataInterface has methods to work with RandomGnsData resources. -type RandomGnsDataInterface interface { - Create(ctx context.Context, randomGnsData *v1.RandomGnsData, opts metav1.CreateOptions) (*v1.RandomGnsData, error) - Update(ctx context.Context, randomGnsData *v1.RandomGnsData, opts metav1.UpdateOptions) (*v1.RandomGnsData, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.RandomGnsData, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.RandomGnsDataList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RandomGnsData, err error) - RandomGnsDataExpansion -} - -// randomGnsDatas implements RandomGnsDataInterface -type randomGnsDatas struct { - client rest.Interface -} - -// newRandomGnsDatas returns a RandomGnsDatas -func newRandomGnsDatas(c *GnsTsmV1Client) *randomGnsDatas { - return &randomGnsDatas{ - client: c.RESTClient(), - } -} - -// Get takes name of the randomGnsData, and returns the corresponding randomGnsData object, and an error if there is any. -func (c *randomGnsDatas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RandomGnsData, err error) { - result = &v1.RandomGnsData{} - err = c.client.Get(). - Resource("randomgnsdatas"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RandomGnsDatas that match those selectors. -func (c *randomGnsDatas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RandomGnsDataList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RandomGnsDataList{} - err = c.client.Get(). - Resource("randomgnsdatas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested randomGnsDatas. -func (c *randomGnsDatas) Watch(ctx context.Context, opts metav1.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(). - Resource("randomgnsdatas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a randomGnsData and creates it. Returns the server's representation of the randomGnsData, and an error, if there is any. -func (c *randomGnsDatas) Create(ctx context.Context, randomGnsData *v1.RandomGnsData, opts metav1.CreateOptions) (result *v1.RandomGnsData, err error) { - result = &v1.RandomGnsData{} - err = c.client.Post(). - Resource("randomgnsdatas"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(randomGnsData). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a randomGnsData and updates it. Returns the server's representation of the randomGnsData, and an error, if there is any. -func (c *randomGnsDatas) Update(ctx context.Context, randomGnsData *v1.RandomGnsData, opts metav1.UpdateOptions) (result *v1.RandomGnsData, err error) { - result = &v1.RandomGnsData{} - err = c.client.Put(). - Resource("randomgnsdatas"). - Name(randomGnsData.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(randomGnsData). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the randomGnsData and deletes it. Returns an error if one occurs. -func (c *randomGnsDatas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("randomgnsdatas"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *randomGnsDatas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("randomgnsdatas"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched randomGnsData. -func (c *randomGnsDatas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RandomGnsData, err error) { - result = &v1.RandomGnsData{} - err = c.client.Patch(pt). - Resource("randomgnsdatas"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go deleted file mode 100644 index 1a5c7dc6d..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// AccessControlPoliciesGetter has a method to return a AccessControlPolicyInterface. -// A group's client should implement this interface. -type AccessControlPoliciesGetter interface { - AccessControlPolicies() AccessControlPolicyInterface -} - -// AccessControlPolicyInterface has methods to work with AccessControlPolicy resources. -type AccessControlPolicyInterface interface { - Create(ctx context.Context, accessControlPolicy *v1.AccessControlPolicy, opts metav1.CreateOptions) (*v1.AccessControlPolicy, error) - Update(ctx context.Context, accessControlPolicy *v1.AccessControlPolicy, opts metav1.UpdateOptions) (*v1.AccessControlPolicy, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AccessControlPolicy, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.AccessControlPolicyList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AccessControlPolicy, err error) - AccessControlPolicyExpansion -} - -// accessControlPolicies implements AccessControlPolicyInterface -type accessControlPolicies struct { - client rest.Interface -} - -// newAccessControlPolicies returns a AccessControlPolicies -func newAccessControlPolicies(c *PolicypkgTsmV1Client) *accessControlPolicies { - return &accessControlPolicies{ - client: c.RESTClient(), - } -} - -// Get takes name of the accessControlPolicy, and returns the corresponding accessControlPolicy object, and an error if there is any. -func (c *accessControlPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AccessControlPolicy, err error) { - result = &v1.AccessControlPolicy{} - err = c.client.Get(). - Resource("accesscontrolpolicies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of AccessControlPolicies that match those selectors. -func (c *accessControlPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AccessControlPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.AccessControlPolicyList{} - err = c.client.Get(). - Resource("accesscontrolpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested accessControlPolicies. -func (c *accessControlPolicies) Watch(ctx context.Context, opts metav1.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(). - Resource("accesscontrolpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a accessControlPolicy and creates it. Returns the server's representation of the accessControlPolicy, and an error, if there is any. -func (c *accessControlPolicies) Create(ctx context.Context, accessControlPolicy *v1.AccessControlPolicy, opts metav1.CreateOptions) (result *v1.AccessControlPolicy, err error) { - result = &v1.AccessControlPolicy{} - err = c.client.Post(). - Resource("accesscontrolpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(accessControlPolicy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a accessControlPolicy and updates it. Returns the server's representation of the accessControlPolicy, and an error, if there is any. -func (c *accessControlPolicies) Update(ctx context.Context, accessControlPolicy *v1.AccessControlPolicy, opts metav1.UpdateOptions) (result *v1.AccessControlPolicy, err error) { - result = &v1.AccessControlPolicy{} - err = c.client.Put(). - Resource("accesscontrolpolicies"). - Name(accessControlPolicy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(accessControlPolicy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the accessControlPolicy and deletes it. Returns an error if one occurs. -func (c *accessControlPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("accesscontrolpolicies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *accessControlPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("accesscontrolpolicies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched accessControlPolicy. -func (c *accessControlPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AccessControlPolicy, err error) { - result = &v1.AccessControlPolicy{} - err = c.client.Patch(pt). - Resource("accesscontrolpolicies"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/acpconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/acpconfig.go deleted file mode 100644 index e0c5a0291..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/acpconfig.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// ACPConfigsGetter has a method to return a ACPConfigInterface. -// A group's client should implement this interface. -type ACPConfigsGetter interface { - ACPConfigs() ACPConfigInterface -} - -// ACPConfigInterface has methods to work with ACPConfig resources. -type ACPConfigInterface interface { - Create(ctx context.Context, aCPConfig *v1.ACPConfig, opts metav1.CreateOptions) (*v1.ACPConfig, error) - Update(ctx context.Context, aCPConfig *v1.ACPConfig, opts metav1.UpdateOptions) (*v1.ACPConfig, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ACPConfig, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.ACPConfigList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ACPConfig, err error) - ACPConfigExpansion -} - -// aCPConfigs implements ACPConfigInterface -type aCPConfigs struct { - client rest.Interface -} - -// newACPConfigs returns a ACPConfigs -func newACPConfigs(c *PolicypkgTsmV1Client) *aCPConfigs { - return &aCPConfigs{ - client: c.RESTClient(), - } -} - -// Get takes name of the aCPConfig, and returns the corresponding aCPConfig object, and an error if there is any. -func (c *aCPConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ACPConfig, err error) { - result = &v1.ACPConfig{} - err = c.client.Get(). - Resource("acpconfigs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ACPConfigs that match those selectors. -func (c *aCPConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ACPConfigList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ACPConfigList{} - err = c.client.Get(). - Resource("acpconfigs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested aCPConfigs. -func (c *aCPConfigs) Watch(ctx context.Context, opts metav1.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(). - Resource("acpconfigs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a aCPConfig and creates it. Returns the server's representation of the aCPConfig, and an error, if there is any. -func (c *aCPConfigs) Create(ctx context.Context, aCPConfig *v1.ACPConfig, opts metav1.CreateOptions) (result *v1.ACPConfig, err error) { - result = &v1.ACPConfig{} - err = c.client.Post(). - Resource("acpconfigs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(aCPConfig). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a aCPConfig and updates it. Returns the server's representation of the aCPConfig, and an error, if there is any. -func (c *aCPConfigs) Update(ctx context.Context, aCPConfig *v1.ACPConfig, opts metav1.UpdateOptions) (result *v1.ACPConfig, err error) { - result = &v1.ACPConfig{} - err = c.client.Put(). - Resource("acpconfigs"). - Name(aCPConfig.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(aCPConfig). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the aCPConfig and deletes it. Returns an error if one occurs. -func (c *aCPConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("acpconfigs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *aCPConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("acpconfigs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched aCPConfig. -func (c *aCPConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ACPConfig, err error) { - result = &v1.ACPConfig{} - err = c.client.Patch(pt). - Resource("acpconfigs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/additionalpolicydata.go b/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/additionalpolicydata.go deleted file mode 100644 index d0ed609b6..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/additionalpolicydata.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// AdditionalPolicyDatasGetter has a method to return a AdditionalPolicyDataInterface. -// A group's client should implement this interface. -type AdditionalPolicyDatasGetter interface { - AdditionalPolicyDatas() AdditionalPolicyDataInterface -} - -// AdditionalPolicyDataInterface has methods to work with AdditionalPolicyData resources. -type AdditionalPolicyDataInterface interface { - Create(ctx context.Context, additionalPolicyData *v1.AdditionalPolicyData, opts metav1.CreateOptions) (*v1.AdditionalPolicyData, error) - Update(ctx context.Context, additionalPolicyData *v1.AdditionalPolicyData, opts metav1.UpdateOptions) (*v1.AdditionalPolicyData, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AdditionalPolicyData, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.AdditionalPolicyDataList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AdditionalPolicyData, err error) - AdditionalPolicyDataExpansion -} - -// additionalPolicyDatas implements AdditionalPolicyDataInterface -type additionalPolicyDatas struct { - client rest.Interface -} - -// newAdditionalPolicyDatas returns a AdditionalPolicyDatas -func newAdditionalPolicyDatas(c *PolicypkgTsmV1Client) *additionalPolicyDatas { - return &additionalPolicyDatas{ - client: c.RESTClient(), - } -} - -// Get takes name of the additionalPolicyData, and returns the corresponding additionalPolicyData object, and an error if there is any. -func (c *additionalPolicyDatas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AdditionalPolicyData, err error) { - result = &v1.AdditionalPolicyData{} - err = c.client.Get(). - Resource("additionalpolicydatas"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of AdditionalPolicyDatas that match those selectors. -func (c *additionalPolicyDatas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AdditionalPolicyDataList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.AdditionalPolicyDataList{} - err = c.client.Get(). - Resource("additionalpolicydatas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested additionalPolicyDatas. -func (c *additionalPolicyDatas) Watch(ctx context.Context, opts metav1.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(). - Resource("additionalpolicydatas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a additionalPolicyData and creates it. Returns the server's representation of the additionalPolicyData, and an error, if there is any. -func (c *additionalPolicyDatas) Create(ctx context.Context, additionalPolicyData *v1.AdditionalPolicyData, opts metav1.CreateOptions) (result *v1.AdditionalPolicyData, err error) { - result = &v1.AdditionalPolicyData{} - err = c.client.Post(). - Resource("additionalpolicydatas"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(additionalPolicyData). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a additionalPolicyData and updates it. Returns the server's representation of the additionalPolicyData, and an error, if there is any. -func (c *additionalPolicyDatas) Update(ctx context.Context, additionalPolicyData *v1.AdditionalPolicyData, opts metav1.UpdateOptions) (result *v1.AdditionalPolicyData, err error) { - result = &v1.AdditionalPolicyData{} - err = c.client.Put(). - Resource("additionalpolicydatas"). - Name(additionalPolicyData.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(additionalPolicyData). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the additionalPolicyData and deletes it. Returns an error if one occurs. -func (c *additionalPolicyDatas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("additionalpolicydatas"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *additionalPolicyDatas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("additionalpolicydatas"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched additionalPolicyData. -func (c *additionalPolicyDatas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AdditionalPolicyData, err error) { - result = &v1.AdditionalPolicyData{} - err = c.client.Patch(pt). - Resource("additionalpolicydatas"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/doc.go b/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/doc.go deleted file mode 100644 index 3af5d054f..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -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 v1 diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/doc.go b/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -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/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_accesscontrolpolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_accesscontrolpolicy.go deleted file mode 100644 index 6403663cd..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_accesscontrolpolicy.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - policypkgtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeAccessControlPolicies implements AccessControlPolicyInterface -type FakeAccessControlPolicies struct { - Fake *FakePolicypkgTsmV1 -} - -var accesscontrolpoliciesResource = schema.GroupVersionResource{Group: "policypkg.tsm.tanzu.vmware.com", Version: "v1", Resource: "accesscontrolpolicies"} - -var accesscontrolpoliciesKind = schema.GroupVersionKind{Group: "policypkg.tsm.tanzu.vmware.com", Version: "v1", Kind: "AccessControlPolicy"} - -// Get takes name of the accessControlPolicy, and returns the corresponding accessControlPolicy object, and an error if there is any. -func (c *FakeAccessControlPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *policypkgtsmtanzuvmwarecomv1.AccessControlPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(accesscontrolpoliciesResource, name), &policypkgtsmtanzuvmwarecomv1.AccessControlPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.AccessControlPolicy), err -} - -// List takes label and field selectors, and returns the list of AccessControlPolicies that match those selectors. -func (c *FakeAccessControlPolicies) List(ctx context.Context, opts v1.ListOptions) (result *policypkgtsmtanzuvmwarecomv1.AccessControlPolicyList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(accesscontrolpoliciesResource, accesscontrolpoliciesKind, opts), &policypkgtsmtanzuvmwarecomv1.AccessControlPolicyList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &policypkgtsmtanzuvmwarecomv1.AccessControlPolicyList{ListMeta: obj.(*policypkgtsmtanzuvmwarecomv1.AccessControlPolicyList).ListMeta} - for _, item := range obj.(*policypkgtsmtanzuvmwarecomv1.AccessControlPolicyList).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 accessControlPolicies. -func (c *FakeAccessControlPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(accesscontrolpoliciesResource, opts)) -} - -// Create takes the representation of a accessControlPolicy and creates it. Returns the server's representation of the accessControlPolicy, and an error, if there is any. -func (c *FakeAccessControlPolicies) Create(ctx context.Context, accessControlPolicy *policypkgtsmtanzuvmwarecomv1.AccessControlPolicy, opts v1.CreateOptions) (result *policypkgtsmtanzuvmwarecomv1.AccessControlPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(accesscontrolpoliciesResource, accessControlPolicy), &policypkgtsmtanzuvmwarecomv1.AccessControlPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.AccessControlPolicy), err -} - -// Update takes the representation of a accessControlPolicy and updates it. Returns the server's representation of the accessControlPolicy, and an error, if there is any. -func (c *FakeAccessControlPolicies) Update(ctx context.Context, accessControlPolicy *policypkgtsmtanzuvmwarecomv1.AccessControlPolicy, opts v1.UpdateOptions) (result *policypkgtsmtanzuvmwarecomv1.AccessControlPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(accesscontrolpoliciesResource, accessControlPolicy), &policypkgtsmtanzuvmwarecomv1.AccessControlPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.AccessControlPolicy), err -} - -// Delete takes name of the accessControlPolicy and deletes it. Returns an error if one occurs. -func (c *FakeAccessControlPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(accesscontrolpoliciesResource, name), &policypkgtsmtanzuvmwarecomv1.AccessControlPolicy{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeAccessControlPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(accesscontrolpoliciesResource, listOpts) - - _, err := c.Fake.Invokes(action, &policypkgtsmtanzuvmwarecomv1.AccessControlPolicyList{}) - return err -} - -// Patch applies the patch and returns the patched accessControlPolicy. -func (c *FakeAccessControlPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *policypkgtsmtanzuvmwarecomv1.AccessControlPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(accesscontrolpoliciesResource, name, pt, data, subresources...), &policypkgtsmtanzuvmwarecomv1.AccessControlPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.AccessControlPolicy), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_acpconfig.go b/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_acpconfig.go deleted file mode 100644 index ebc19c66e..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_acpconfig.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - policypkgtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeACPConfigs implements ACPConfigInterface -type FakeACPConfigs struct { - Fake *FakePolicypkgTsmV1 -} - -var acpconfigsResource = schema.GroupVersionResource{Group: "policypkg.tsm.tanzu.vmware.com", Version: "v1", Resource: "acpconfigs"} - -var acpconfigsKind = schema.GroupVersionKind{Group: "policypkg.tsm.tanzu.vmware.com", Version: "v1", Kind: "ACPConfig"} - -// Get takes name of the aCPConfig, and returns the corresponding aCPConfig object, and an error if there is any. -func (c *FakeACPConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *policypkgtsmtanzuvmwarecomv1.ACPConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(acpconfigsResource, name), &policypkgtsmtanzuvmwarecomv1.ACPConfig{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.ACPConfig), err -} - -// List takes label and field selectors, and returns the list of ACPConfigs that match those selectors. -func (c *FakeACPConfigs) List(ctx context.Context, opts v1.ListOptions) (result *policypkgtsmtanzuvmwarecomv1.ACPConfigList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(acpconfigsResource, acpconfigsKind, opts), &policypkgtsmtanzuvmwarecomv1.ACPConfigList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &policypkgtsmtanzuvmwarecomv1.ACPConfigList{ListMeta: obj.(*policypkgtsmtanzuvmwarecomv1.ACPConfigList).ListMeta} - for _, item := range obj.(*policypkgtsmtanzuvmwarecomv1.ACPConfigList).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 aCPConfigs. -func (c *FakeACPConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(acpconfigsResource, opts)) -} - -// Create takes the representation of a aCPConfig and creates it. Returns the server's representation of the aCPConfig, and an error, if there is any. -func (c *FakeACPConfigs) Create(ctx context.Context, aCPConfig *policypkgtsmtanzuvmwarecomv1.ACPConfig, opts v1.CreateOptions) (result *policypkgtsmtanzuvmwarecomv1.ACPConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(acpconfigsResource, aCPConfig), &policypkgtsmtanzuvmwarecomv1.ACPConfig{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.ACPConfig), err -} - -// Update takes the representation of a aCPConfig and updates it. Returns the server's representation of the aCPConfig, and an error, if there is any. -func (c *FakeACPConfigs) Update(ctx context.Context, aCPConfig *policypkgtsmtanzuvmwarecomv1.ACPConfig, opts v1.UpdateOptions) (result *policypkgtsmtanzuvmwarecomv1.ACPConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(acpconfigsResource, aCPConfig), &policypkgtsmtanzuvmwarecomv1.ACPConfig{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.ACPConfig), err -} - -// Delete takes name of the aCPConfig and deletes it. Returns an error if one occurs. -func (c *FakeACPConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(acpconfigsResource, name), &policypkgtsmtanzuvmwarecomv1.ACPConfig{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeACPConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(acpconfigsResource, listOpts) - - _, err := c.Fake.Invokes(action, &policypkgtsmtanzuvmwarecomv1.ACPConfigList{}) - return err -} - -// Patch applies the patch and returns the patched aCPConfig. -func (c *FakeACPConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *policypkgtsmtanzuvmwarecomv1.ACPConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(acpconfigsResource, name, pt, data, subresources...), &policypkgtsmtanzuvmwarecomv1.ACPConfig{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.ACPConfig), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_additionalpolicydata.go b/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_additionalpolicydata.go deleted file mode 100644 index 63aa77343..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_additionalpolicydata.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - policypkgtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeAdditionalPolicyDatas implements AdditionalPolicyDataInterface -type FakeAdditionalPolicyDatas struct { - Fake *FakePolicypkgTsmV1 -} - -var additionalpolicydatasResource = schema.GroupVersionResource{Group: "policypkg.tsm.tanzu.vmware.com", Version: "v1", Resource: "additionalpolicydatas"} - -var additionalpolicydatasKind = schema.GroupVersionKind{Group: "policypkg.tsm.tanzu.vmware.com", Version: "v1", Kind: "AdditionalPolicyData"} - -// Get takes name of the additionalPolicyData, and returns the corresponding additionalPolicyData object, and an error if there is any. -func (c *FakeAdditionalPolicyDatas) Get(ctx context.Context, name string, options v1.GetOptions) (result *policypkgtsmtanzuvmwarecomv1.AdditionalPolicyData, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(additionalpolicydatasResource, name), &policypkgtsmtanzuvmwarecomv1.AdditionalPolicyData{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.AdditionalPolicyData), err -} - -// List takes label and field selectors, and returns the list of AdditionalPolicyDatas that match those selectors. -func (c *FakeAdditionalPolicyDatas) List(ctx context.Context, opts v1.ListOptions) (result *policypkgtsmtanzuvmwarecomv1.AdditionalPolicyDataList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(additionalpolicydatasResource, additionalpolicydatasKind, opts), &policypkgtsmtanzuvmwarecomv1.AdditionalPolicyDataList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &policypkgtsmtanzuvmwarecomv1.AdditionalPolicyDataList{ListMeta: obj.(*policypkgtsmtanzuvmwarecomv1.AdditionalPolicyDataList).ListMeta} - for _, item := range obj.(*policypkgtsmtanzuvmwarecomv1.AdditionalPolicyDataList).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 additionalPolicyDatas. -func (c *FakeAdditionalPolicyDatas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(additionalpolicydatasResource, opts)) -} - -// Create takes the representation of a additionalPolicyData and creates it. Returns the server's representation of the additionalPolicyData, and an error, if there is any. -func (c *FakeAdditionalPolicyDatas) Create(ctx context.Context, additionalPolicyData *policypkgtsmtanzuvmwarecomv1.AdditionalPolicyData, opts v1.CreateOptions) (result *policypkgtsmtanzuvmwarecomv1.AdditionalPolicyData, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(additionalpolicydatasResource, additionalPolicyData), &policypkgtsmtanzuvmwarecomv1.AdditionalPolicyData{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.AdditionalPolicyData), err -} - -// Update takes the representation of a additionalPolicyData and updates it. Returns the server's representation of the additionalPolicyData, and an error, if there is any. -func (c *FakeAdditionalPolicyDatas) Update(ctx context.Context, additionalPolicyData *policypkgtsmtanzuvmwarecomv1.AdditionalPolicyData, opts v1.UpdateOptions) (result *policypkgtsmtanzuvmwarecomv1.AdditionalPolicyData, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(additionalpolicydatasResource, additionalPolicyData), &policypkgtsmtanzuvmwarecomv1.AdditionalPolicyData{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.AdditionalPolicyData), err -} - -// Delete takes name of the additionalPolicyData and deletes it. Returns an error if one occurs. -func (c *FakeAdditionalPolicyDatas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(additionalpolicydatasResource, name), &policypkgtsmtanzuvmwarecomv1.AdditionalPolicyData{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeAdditionalPolicyDatas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(additionalpolicydatasResource, listOpts) - - _, err := c.Fake.Invokes(action, &policypkgtsmtanzuvmwarecomv1.AdditionalPolicyDataList{}) - return err -} - -// Patch applies the patch and returns the patched additionalPolicyData. -func (c *FakeAdditionalPolicyDatas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *policypkgtsmtanzuvmwarecomv1.AdditionalPolicyData, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(additionalpolicydatasResource, name, pt, data, subresources...), &policypkgtsmtanzuvmwarecomv1.AdditionalPolicyData{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.AdditionalPolicyData), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_policypkg.tsm.tanzu.vmware.com_client.go b/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_policypkg.tsm.tanzu.vmware.com_client.go deleted file mode 100644 index 02e8c37dd..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_policypkg.tsm.tanzu.vmware.com_client.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -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 ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1" - - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakePolicypkgTsmV1 struct { - *testing.Fake -} - -func (c *FakePolicypkgTsmV1) ACPConfigs() v1.ACPConfigInterface { - return &FakeACPConfigs{c} -} - -func (c *FakePolicypkgTsmV1) AccessControlPolicies() v1.AccessControlPolicyInterface { - return &FakeAccessControlPolicies{c} -} - -func (c *FakePolicypkgTsmV1) AdditionalPolicyDatas() v1.AdditionalPolicyDataInterface { - return &FakeAdditionalPolicyDatas{c} -} - -func (c *FakePolicypkgTsmV1) RandomPolicyDatas() v1.RandomPolicyDataInterface { - return &FakeRandomPolicyDatas{c} -} - -func (c *FakePolicypkgTsmV1) VMpolicies() v1.VMpolicyInterface { - return &FakeVMpolicies{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakePolicypkgTsmV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_randompolicydata.go b/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_randompolicydata.go deleted file mode 100644 index 10325b883..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_randompolicydata.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - policypkgtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeRandomPolicyDatas implements RandomPolicyDataInterface -type FakeRandomPolicyDatas struct { - Fake *FakePolicypkgTsmV1 -} - -var randompolicydatasResource = schema.GroupVersionResource{Group: "policypkg.tsm.tanzu.vmware.com", Version: "v1", Resource: "randompolicydatas"} - -var randompolicydatasKind = schema.GroupVersionKind{Group: "policypkg.tsm.tanzu.vmware.com", Version: "v1", Kind: "RandomPolicyData"} - -// Get takes name of the randomPolicyData, and returns the corresponding randomPolicyData object, and an error if there is any. -func (c *FakeRandomPolicyDatas) Get(ctx context.Context, name string, options v1.GetOptions) (result *policypkgtsmtanzuvmwarecomv1.RandomPolicyData, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(randompolicydatasResource, name), &policypkgtsmtanzuvmwarecomv1.RandomPolicyData{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.RandomPolicyData), err -} - -// List takes label and field selectors, and returns the list of RandomPolicyDatas that match those selectors. -func (c *FakeRandomPolicyDatas) List(ctx context.Context, opts v1.ListOptions) (result *policypkgtsmtanzuvmwarecomv1.RandomPolicyDataList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(randompolicydatasResource, randompolicydatasKind, opts), &policypkgtsmtanzuvmwarecomv1.RandomPolicyDataList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &policypkgtsmtanzuvmwarecomv1.RandomPolicyDataList{ListMeta: obj.(*policypkgtsmtanzuvmwarecomv1.RandomPolicyDataList).ListMeta} - for _, item := range obj.(*policypkgtsmtanzuvmwarecomv1.RandomPolicyDataList).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 randomPolicyDatas. -func (c *FakeRandomPolicyDatas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(randompolicydatasResource, opts)) -} - -// Create takes the representation of a randomPolicyData and creates it. Returns the server's representation of the randomPolicyData, and an error, if there is any. -func (c *FakeRandomPolicyDatas) Create(ctx context.Context, randomPolicyData *policypkgtsmtanzuvmwarecomv1.RandomPolicyData, opts v1.CreateOptions) (result *policypkgtsmtanzuvmwarecomv1.RandomPolicyData, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(randompolicydatasResource, randomPolicyData), &policypkgtsmtanzuvmwarecomv1.RandomPolicyData{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.RandomPolicyData), err -} - -// Update takes the representation of a randomPolicyData and updates it. Returns the server's representation of the randomPolicyData, and an error, if there is any. -func (c *FakeRandomPolicyDatas) Update(ctx context.Context, randomPolicyData *policypkgtsmtanzuvmwarecomv1.RandomPolicyData, opts v1.UpdateOptions) (result *policypkgtsmtanzuvmwarecomv1.RandomPolicyData, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(randompolicydatasResource, randomPolicyData), &policypkgtsmtanzuvmwarecomv1.RandomPolicyData{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.RandomPolicyData), err -} - -// Delete takes name of the randomPolicyData and deletes it. Returns an error if one occurs. -func (c *FakeRandomPolicyDatas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(randompolicydatasResource, name), &policypkgtsmtanzuvmwarecomv1.RandomPolicyData{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeRandomPolicyDatas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(randompolicydatasResource, listOpts) - - _, err := c.Fake.Invokes(action, &policypkgtsmtanzuvmwarecomv1.RandomPolicyDataList{}) - return err -} - -// Patch applies the patch and returns the patched randomPolicyData. -func (c *FakeRandomPolicyDatas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *policypkgtsmtanzuvmwarecomv1.RandomPolicyData, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(randompolicydatasResource, name, pt, data, subresources...), &policypkgtsmtanzuvmwarecomv1.RandomPolicyData{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.RandomPolicyData), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_vmpolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_vmpolicy.go deleted file mode 100644 index 2234d98f9..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/fake/fake_vmpolicy.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - policypkgtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeVMpolicies implements VMpolicyInterface -type FakeVMpolicies struct { - Fake *FakePolicypkgTsmV1 -} - -var vmpoliciesResource = schema.GroupVersionResource{Group: "policypkg.tsm.tanzu.vmware.com", Version: "v1", Resource: "vmpolicies"} - -var vmpoliciesKind = schema.GroupVersionKind{Group: "policypkg.tsm.tanzu.vmware.com", Version: "v1", Kind: "VMpolicy"} - -// Get takes name of the vMpolicy, and returns the corresponding vMpolicy object, and an error if there is any. -func (c *FakeVMpolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *policypkgtsmtanzuvmwarecomv1.VMpolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(vmpoliciesResource, name), &policypkgtsmtanzuvmwarecomv1.VMpolicy{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.VMpolicy), err -} - -// List takes label and field selectors, and returns the list of VMpolicies that match those selectors. -func (c *FakeVMpolicies) List(ctx context.Context, opts v1.ListOptions) (result *policypkgtsmtanzuvmwarecomv1.VMpolicyList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(vmpoliciesResource, vmpoliciesKind, opts), &policypkgtsmtanzuvmwarecomv1.VMpolicyList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &policypkgtsmtanzuvmwarecomv1.VMpolicyList{ListMeta: obj.(*policypkgtsmtanzuvmwarecomv1.VMpolicyList).ListMeta} - for _, item := range obj.(*policypkgtsmtanzuvmwarecomv1.VMpolicyList).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 vMpolicies. -func (c *FakeVMpolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(vmpoliciesResource, opts)) -} - -// Create takes the representation of a vMpolicy and creates it. Returns the server's representation of the vMpolicy, and an error, if there is any. -func (c *FakeVMpolicies) Create(ctx context.Context, vMpolicy *policypkgtsmtanzuvmwarecomv1.VMpolicy, opts v1.CreateOptions) (result *policypkgtsmtanzuvmwarecomv1.VMpolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(vmpoliciesResource, vMpolicy), &policypkgtsmtanzuvmwarecomv1.VMpolicy{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.VMpolicy), err -} - -// Update takes the representation of a vMpolicy and updates it. Returns the server's representation of the vMpolicy, and an error, if there is any. -func (c *FakeVMpolicies) Update(ctx context.Context, vMpolicy *policypkgtsmtanzuvmwarecomv1.VMpolicy, opts v1.UpdateOptions) (result *policypkgtsmtanzuvmwarecomv1.VMpolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(vmpoliciesResource, vMpolicy), &policypkgtsmtanzuvmwarecomv1.VMpolicy{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.VMpolicy), err -} - -// Delete takes name of the vMpolicy and deletes it. Returns an error if one occurs. -func (c *FakeVMpolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(vmpoliciesResource, name), &policypkgtsmtanzuvmwarecomv1.VMpolicy{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVMpolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(vmpoliciesResource, listOpts) - - _, err := c.Fake.Invokes(action, &policypkgtsmtanzuvmwarecomv1.VMpolicyList{}) - return err -} - -// Patch applies the patch and returns the patched vMpolicy. -func (c *FakeVMpolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *policypkgtsmtanzuvmwarecomv1.VMpolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(vmpoliciesResource, name, pt, data, subresources...), &policypkgtsmtanzuvmwarecomv1.VMpolicy{}) - if obj == nil { - return nil, err - } - return obj.(*policypkgtsmtanzuvmwarecomv1.VMpolicy), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/generated_expansion.go b/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/generated_expansion.go deleted file mode 100644 index 3822667e4..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/generated_expansion.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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 v1 - -type ACPConfigExpansion interface{} - -type AccessControlPolicyExpansion interface{} - -type AdditionalPolicyDataExpansion interface{} - -type RandomPolicyDataExpansion interface{} - -type VMpolicyExpansion interface{} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/policypkg.tsm.tanzu.vmware.com_client.go b/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/policypkg.tsm.tanzu.vmware.com_client.go deleted file mode 100644 index 317e99eef..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/policypkg.tsm.tanzu.vmware.com_client.go +++ /dev/null @@ -1,110 +0,0 @@ -/* -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 v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - rest "k8s.io/client-go/rest" -) - -type PolicypkgTsmV1Interface interface { - RESTClient() rest.Interface - ACPConfigsGetter - AccessControlPoliciesGetter - AdditionalPolicyDatasGetter - RandomPolicyDatasGetter - VMpoliciesGetter -} - -// PolicypkgTsmV1Client is used to interact with features provided by the policypkg.tsm.tanzu.vmware.com group. -type PolicypkgTsmV1Client struct { - restClient rest.Interface -} - -func (c *PolicypkgTsmV1Client) ACPConfigs() ACPConfigInterface { - return newACPConfigs(c) -} - -func (c *PolicypkgTsmV1Client) AccessControlPolicies() AccessControlPolicyInterface { - return newAccessControlPolicies(c) -} - -func (c *PolicypkgTsmV1Client) AdditionalPolicyDatas() AdditionalPolicyDataInterface { - return newAdditionalPolicyDatas(c) -} - -func (c *PolicypkgTsmV1Client) RandomPolicyDatas() RandomPolicyDataInterface { - return newRandomPolicyDatas(c) -} - -func (c *PolicypkgTsmV1Client) VMpolicies() VMpolicyInterface { - return newVMpolicies(c) -} - -// NewForConfig creates a new PolicypkgTsmV1Client for the given config. -func NewForConfig(c *rest.Config) (*PolicypkgTsmV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &PolicypkgTsmV1Client{client}, nil -} - -// NewForConfigOrDie creates a new PolicypkgTsmV1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *PolicypkgTsmV1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new PolicypkgTsmV1Client for the given RESTClient. -func New(c rest.Interface) *PolicypkgTsmV1Client { - return &PolicypkgTsmV1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1.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 *PolicypkgTsmV1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/randompolicydata.go b/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/randompolicydata.go deleted file mode 100644 index 69abb47e9..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/randompolicydata.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// RandomPolicyDatasGetter has a method to return a RandomPolicyDataInterface. -// A group's client should implement this interface. -type RandomPolicyDatasGetter interface { - RandomPolicyDatas() RandomPolicyDataInterface -} - -// RandomPolicyDataInterface has methods to work with RandomPolicyData resources. -type RandomPolicyDataInterface interface { - Create(ctx context.Context, randomPolicyData *v1.RandomPolicyData, opts metav1.CreateOptions) (*v1.RandomPolicyData, error) - Update(ctx context.Context, randomPolicyData *v1.RandomPolicyData, opts metav1.UpdateOptions) (*v1.RandomPolicyData, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.RandomPolicyData, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.RandomPolicyDataList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RandomPolicyData, err error) - RandomPolicyDataExpansion -} - -// randomPolicyDatas implements RandomPolicyDataInterface -type randomPolicyDatas struct { - client rest.Interface -} - -// newRandomPolicyDatas returns a RandomPolicyDatas -func newRandomPolicyDatas(c *PolicypkgTsmV1Client) *randomPolicyDatas { - return &randomPolicyDatas{ - client: c.RESTClient(), - } -} - -// Get takes name of the randomPolicyData, and returns the corresponding randomPolicyData object, and an error if there is any. -func (c *randomPolicyDatas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RandomPolicyData, err error) { - result = &v1.RandomPolicyData{} - err = c.client.Get(). - Resource("randompolicydatas"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RandomPolicyDatas that match those selectors. -func (c *randomPolicyDatas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RandomPolicyDataList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RandomPolicyDataList{} - err = c.client.Get(). - Resource("randompolicydatas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested randomPolicyDatas. -func (c *randomPolicyDatas) Watch(ctx context.Context, opts metav1.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(). - Resource("randompolicydatas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a randomPolicyData and creates it. Returns the server's representation of the randomPolicyData, and an error, if there is any. -func (c *randomPolicyDatas) Create(ctx context.Context, randomPolicyData *v1.RandomPolicyData, opts metav1.CreateOptions) (result *v1.RandomPolicyData, err error) { - result = &v1.RandomPolicyData{} - err = c.client.Post(). - Resource("randompolicydatas"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(randomPolicyData). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a randomPolicyData and updates it. Returns the server's representation of the randomPolicyData, and an error, if there is any. -func (c *randomPolicyDatas) Update(ctx context.Context, randomPolicyData *v1.RandomPolicyData, opts metav1.UpdateOptions) (result *v1.RandomPolicyData, err error) { - result = &v1.RandomPolicyData{} - err = c.client.Put(). - Resource("randompolicydatas"). - Name(randomPolicyData.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(randomPolicyData). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the randomPolicyData and deletes it. Returns an error if one occurs. -func (c *randomPolicyDatas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("randompolicydatas"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *randomPolicyDatas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("randompolicydatas"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched randomPolicyData. -func (c *randomPolicyDatas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RandomPolicyData, err error) { - result = &v1.RandomPolicyData{} - err = c.client.Patch(pt). - Resource("randompolicydatas"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/vmpolicy.go b/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/vmpolicy.go deleted file mode 100644 index c5072f2e3..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/policypkg.tsm.tanzu.vmware.com/v1/vmpolicy.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// VMpoliciesGetter has a method to return a VMpolicyInterface. -// A group's client should implement this interface. -type VMpoliciesGetter interface { - VMpolicies() VMpolicyInterface -} - -// VMpolicyInterface has methods to work with VMpolicy resources. -type VMpolicyInterface interface { - Create(ctx context.Context, vMpolicy *v1.VMpolicy, opts metav1.CreateOptions) (*v1.VMpolicy, error) - Update(ctx context.Context, vMpolicy *v1.VMpolicy, opts metav1.UpdateOptions) (*v1.VMpolicy, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.VMpolicy, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.VMpolicyList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VMpolicy, err error) - VMpolicyExpansion -} - -// vMpolicies implements VMpolicyInterface -type vMpolicies struct { - client rest.Interface -} - -// newVMpolicies returns a VMpolicies -func newVMpolicies(c *PolicypkgTsmV1Client) *vMpolicies { - return &vMpolicies{ - client: c.RESTClient(), - } -} - -// Get takes name of the vMpolicy, and returns the corresponding vMpolicy object, and an error if there is any. -func (c *vMpolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VMpolicy, err error) { - result = &v1.VMpolicy{} - err = c.client.Get(). - Resource("vmpolicies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VMpolicies that match those selectors. -func (c *vMpolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VMpolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.VMpolicyList{} - err = c.client.Get(). - Resource("vmpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested vMpolicies. -func (c *vMpolicies) Watch(ctx context.Context, opts metav1.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(). - Resource("vmpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a vMpolicy and creates it. Returns the server's representation of the vMpolicy, and an error, if there is any. -func (c *vMpolicies) Create(ctx context.Context, vMpolicy *v1.VMpolicy, opts metav1.CreateOptions) (result *v1.VMpolicy, err error) { - result = &v1.VMpolicy{} - err = c.client.Post(). - Resource("vmpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMpolicy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a vMpolicy and updates it. Returns the server's representation of the vMpolicy, and an error, if there is any. -func (c *vMpolicies) Update(ctx context.Context, vMpolicy *v1.VMpolicy, opts metav1.UpdateOptions) (result *v1.VMpolicy, err error) { - result = &v1.VMpolicy{} - err = c.client.Put(). - Resource("vmpolicies"). - Name(vMpolicy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMpolicy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the vMpolicy and deletes it. Returns an error if one occurs. -func (c *vMpolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("vmpolicies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *vMpolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("vmpolicies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched vMpolicy. -func (c *vMpolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VMpolicy, err error) { - result = &v1.VMpolicy{} - err = c.client.Patch(pt). - Resource("vmpolicies"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/doc.go b/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/doc.go deleted file mode 100644 index 3af5d054f..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -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 v1 diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/fake/doc.go b/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -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/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/fake/fake_root.go b/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/fake/fake_root.go deleted file mode 100644 index fa1bbe66c..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/fake/fake_root.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - roottsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeRoots implements RootInterface -type FakeRoots struct { - Fake *FakeRootTsmV1 -} - -var rootsResource = schema.GroupVersionResource{Group: "root.tsm.tanzu.vmware.com", Version: "v1", Resource: "roots"} - -var rootsKind = schema.GroupVersionKind{Group: "root.tsm.tanzu.vmware.com", Version: "v1", Kind: "Root"} - -// Get takes name of the root, and returns the corresponding root object, and an error if there is any. -func (c *FakeRoots) Get(ctx context.Context, name string, options v1.GetOptions) (result *roottsmtanzuvmwarecomv1.Root, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(rootsResource, name), &roottsmtanzuvmwarecomv1.Root{}) - if obj == nil { - return nil, err - } - return obj.(*roottsmtanzuvmwarecomv1.Root), err -} - -// List takes label and field selectors, and returns the list of Roots that match those selectors. -func (c *FakeRoots) List(ctx context.Context, opts v1.ListOptions) (result *roottsmtanzuvmwarecomv1.RootList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(rootsResource, rootsKind, opts), &roottsmtanzuvmwarecomv1.RootList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &roottsmtanzuvmwarecomv1.RootList{ListMeta: obj.(*roottsmtanzuvmwarecomv1.RootList).ListMeta} - for _, item := range obj.(*roottsmtanzuvmwarecomv1.RootList).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 roots. -func (c *FakeRoots) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(rootsResource, opts)) -} - -// Create takes the representation of a root and creates it. Returns the server's representation of the root, and an error, if there is any. -func (c *FakeRoots) Create(ctx context.Context, root *roottsmtanzuvmwarecomv1.Root, opts v1.CreateOptions) (result *roottsmtanzuvmwarecomv1.Root, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(rootsResource, root), &roottsmtanzuvmwarecomv1.Root{}) - if obj == nil { - return nil, err - } - return obj.(*roottsmtanzuvmwarecomv1.Root), err -} - -// Update takes the representation of a root and updates it. Returns the server's representation of the root, and an error, if there is any. -func (c *FakeRoots) Update(ctx context.Context, root *roottsmtanzuvmwarecomv1.Root, opts v1.UpdateOptions) (result *roottsmtanzuvmwarecomv1.Root, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(rootsResource, root), &roottsmtanzuvmwarecomv1.Root{}) - if obj == nil { - return nil, err - } - return obj.(*roottsmtanzuvmwarecomv1.Root), err -} - -// Delete takes name of the root and deletes it. Returns an error if one occurs. -func (c *FakeRoots) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(rootsResource, name), &roottsmtanzuvmwarecomv1.Root{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeRoots) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(rootsResource, listOpts) - - _, err := c.Fake.Invokes(action, &roottsmtanzuvmwarecomv1.RootList{}) - return err -} - -// Patch applies the patch and returns the patched root. -func (c *FakeRoots) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *roottsmtanzuvmwarecomv1.Root, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(rootsResource, name, pt, data, subresources...), &roottsmtanzuvmwarecomv1.Root{}) - if obj == nil { - return nil, err - } - return obj.(*roottsmtanzuvmwarecomv1.Root), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/fake/fake_root.tsm.tanzu.vmware.com_client.go b/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/fake/fake_root.tsm.tanzu.vmware.com_client.go deleted file mode 100644 index 2adb0dddf..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/fake/fake_root.tsm.tanzu.vmware.com_client.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -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 ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1" - - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeRootTsmV1 struct { - *testing.Fake -} - -func (c *FakeRootTsmV1) Roots() v1.RootInterface { - return &FakeRoots{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeRootTsmV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/generated_expansion.go b/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/generated_expansion.go deleted file mode 100644 index 9e47d261d..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/generated_expansion.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -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 v1 - -type RootExpansion interface{} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/root.go b/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/root.go deleted file mode 100644 index 1fa0d10c5..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/root.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// RootsGetter has a method to return a RootInterface. -// A group's client should implement this interface. -type RootsGetter interface { - Roots() RootInterface -} - -// RootInterface has methods to work with Root resources. -type RootInterface interface { - Create(ctx context.Context, root *v1.Root, opts metav1.CreateOptions) (*v1.Root, error) - Update(ctx context.Context, root *v1.Root, opts metav1.UpdateOptions) (*v1.Root, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Root, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.RootList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Root, err error) - RootExpansion -} - -// roots implements RootInterface -type roots struct { - client rest.Interface -} - -// newRoots returns a Roots -func newRoots(c *RootTsmV1Client) *roots { - return &roots{ - client: c.RESTClient(), - } -} - -// Get takes name of the root, and returns the corresponding root object, and an error if there is any. -func (c *roots) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Root, err error) { - result = &v1.Root{} - err = c.client.Get(). - Resource("roots"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Roots that match those selectors. -func (c *roots) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RootList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RootList{} - err = c.client.Get(). - Resource("roots"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested roots. -func (c *roots) Watch(ctx context.Context, opts metav1.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(). - Resource("roots"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a root and creates it. Returns the server's representation of the root, and an error, if there is any. -func (c *roots) Create(ctx context.Context, root *v1.Root, opts metav1.CreateOptions) (result *v1.Root, err error) { - result = &v1.Root{} - err = c.client.Post(). - Resource("roots"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(root). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a root and updates it. Returns the server's representation of the root, and an error, if there is any. -func (c *roots) Update(ctx context.Context, root *v1.Root, opts metav1.UpdateOptions) (result *v1.Root, err error) { - result = &v1.Root{} - err = c.client.Put(). - Resource("roots"). - Name(root.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(root). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the root and deletes it. Returns an error if one occurs. -func (c *roots) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("roots"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *roots) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("roots"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched root. -func (c *roots) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Root, err error) { - result = &v1.Root{} - err = c.client.Patch(pt). - Resource("roots"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/root.tsm.tanzu.vmware.com_client.go b/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/root.tsm.tanzu.vmware.com_client.go deleted file mode 100644 index 6b75583c2..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/root.tsm.tanzu.vmware.com/v1/root.tsm.tanzu.vmware.com_client.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1" - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - rest "k8s.io/client-go/rest" -) - -type RootTsmV1Interface interface { - RESTClient() rest.Interface - RootsGetter -} - -// RootTsmV1Client is used to interact with features provided by the root.tsm.tanzu.vmware.com group. -type RootTsmV1Client struct { - restClient rest.Interface -} - -func (c *RootTsmV1Client) Roots() RootInterface { - return newRoots(c) -} - -// NewForConfig creates a new RootTsmV1Client for the given config. -func NewForConfig(c *rest.Config) (*RootTsmV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &RootTsmV1Client{client}, nil -} - -// NewForConfigOrDie creates a new RootTsmV1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *RootTsmV1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new RootTsmV1Client for the given RESTClient. -func New(c rest.Interface) *RootTsmV1Client { - return &RootTsmV1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1.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 *RootTsmV1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/doc.go b/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/doc.go deleted file mode 100644 index 3af5d054f..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -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 v1 diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/fake/doc.go b/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -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/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/fake/fake_servicegroup.tsm.tanzu.vmware.com_client.go b/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/fake/fake_servicegroup.tsm.tanzu.vmware.com_client.go deleted file mode 100644 index 4fe5eb437..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/fake/fake_servicegroup.tsm.tanzu.vmware.com_client.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -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 ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1" - - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeServicegroupTsmV1 struct { - *testing.Fake -} - -func (c *FakeServicegroupTsmV1) SvcGroups() v1.SvcGroupInterface { - return &FakeSvcGroups{c} -} - -func (c *FakeServicegroupTsmV1) SvcGroupLinkInfos() v1.SvcGroupLinkInfoInterface { - return &FakeSvcGroupLinkInfos{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeServicegroupTsmV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/fake/fake_svcgroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/fake/fake_svcgroup.go deleted file mode 100644 index 235827557..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/fake/fake_svcgroup.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - servicegrouptsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeSvcGroups implements SvcGroupInterface -type FakeSvcGroups struct { - Fake *FakeServicegroupTsmV1 -} - -var svcgroupsResource = schema.GroupVersionResource{Group: "servicegroup.tsm.tanzu.vmware.com", Version: "v1", Resource: "svcgroups"} - -var svcgroupsKind = schema.GroupVersionKind{Group: "servicegroup.tsm.tanzu.vmware.com", Version: "v1", Kind: "SvcGroup"} - -// Get takes name of the svcGroup, and returns the corresponding svcGroup object, and an error if there is any. -func (c *FakeSvcGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *servicegrouptsmtanzuvmwarecomv1.SvcGroup, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(svcgroupsResource, name), &servicegrouptsmtanzuvmwarecomv1.SvcGroup{}) - if obj == nil { - return nil, err - } - return obj.(*servicegrouptsmtanzuvmwarecomv1.SvcGroup), err -} - -// List takes label and field selectors, and returns the list of SvcGroups that match those selectors. -func (c *FakeSvcGroups) List(ctx context.Context, opts v1.ListOptions) (result *servicegrouptsmtanzuvmwarecomv1.SvcGroupList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(svcgroupsResource, svcgroupsKind, opts), &servicegrouptsmtanzuvmwarecomv1.SvcGroupList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &servicegrouptsmtanzuvmwarecomv1.SvcGroupList{ListMeta: obj.(*servicegrouptsmtanzuvmwarecomv1.SvcGroupList).ListMeta} - for _, item := range obj.(*servicegrouptsmtanzuvmwarecomv1.SvcGroupList).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 svcGroups. -func (c *FakeSvcGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(svcgroupsResource, opts)) -} - -// Create takes the representation of a svcGroup and creates it. Returns the server's representation of the svcGroup, and an error, if there is any. -func (c *FakeSvcGroups) Create(ctx context.Context, svcGroup *servicegrouptsmtanzuvmwarecomv1.SvcGroup, opts v1.CreateOptions) (result *servicegrouptsmtanzuvmwarecomv1.SvcGroup, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(svcgroupsResource, svcGroup), &servicegrouptsmtanzuvmwarecomv1.SvcGroup{}) - if obj == nil { - return nil, err - } - return obj.(*servicegrouptsmtanzuvmwarecomv1.SvcGroup), err -} - -// Update takes the representation of a svcGroup and updates it. Returns the server's representation of the svcGroup, and an error, if there is any. -func (c *FakeSvcGroups) Update(ctx context.Context, svcGroup *servicegrouptsmtanzuvmwarecomv1.SvcGroup, opts v1.UpdateOptions) (result *servicegrouptsmtanzuvmwarecomv1.SvcGroup, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(svcgroupsResource, svcGroup), &servicegrouptsmtanzuvmwarecomv1.SvcGroup{}) - if obj == nil { - return nil, err - } - return obj.(*servicegrouptsmtanzuvmwarecomv1.SvcGroup), err -} - -// Delete takes name of the svcGroup and deletes it. Returns an error if one occurs. -func (c *FakeSvcGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(svcgroupsResource, name), &servicegrouptsmtanzuvmwarecomv1.SvcGroup{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeSvcGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(svcgroupsResource, listOpts) - - _, err := c.Fake.Invokes(action, &servicegrouptsmtanzuvmwarecomv1.SvcGroupList{}) - return err -} - -// Patch applies the patch and returns the patched svcGroup. -func (c *FakeSvcGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *servicegrouptsmtanzuvmwarecomv1.SvcGroup, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(svcgroupsResource, name, pt, data, subresources...), &servicegrouptsmtanzuvmwarecomv1.SvcGroup{}) - if obj == nil { - return nil, err - } - return obj.(*servicegrouptsmtanzuvmwarecomv1.SvcGroup), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/fake/fake_svcgrouplinkinfo.go b/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/fake/fake_svcgrouplinkinfo.go deleted file mode 100644 index f3f019287..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/fake/fake_svcgrouplinkinfo.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -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 ( - "context" - - servicegrouptsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1" - - 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" -) - -// FakeSvcGroupLinkInfos implements SvcGroupLinkInfoInterface -type FakeSvcGroupLinkInfos struct { - Fake *FakeServicegroupTsmV1 -} - -var svcgrouplinkinfosResource = schema.GroupVersionResource{Group: "servicegroup.tsm.tanzu.vmware.com", Version: "v1", Resource: "svcgrouplinkinfos"} - -var svcgrouplinkinfosKind = schema.GroupVersionKind{Group: "servicegroup.tsm.tanzu.vmware.com", Version: "v1", Kind: "SvcGroupLinkInfo"} - -// Get takes name of the svcGroupLinkInfo, and returns the corresponding svcGroupLinkInfo object, and an error if there is any. -func (c *FakeSvcGroupLinkInfos) Get(ctx context.Context, name string, options v1.GetOptions) (result *servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(svcgrouplinkinfosResource, name), &servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo{}) - if obj == nil { - return nil, err - } - return obj.(*servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo), err -} - -// List takes label and field selectors, and returns the list of SvcGroupLinkInfos that match those selectors. -func (c *FakeSvcGroupLinkInfos) List(ctx context.Context, opts v1.ListOptions) (result *servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfoList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(svcgrouplinkinfosResource, svcgrouplinkinfosKind, opts), &servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfoList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfoList{ListMeta: obj.(*servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfoList).ListMeta} - for _, item := range obj.(*servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfoList).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 svcGroupLinkInfos. -func (c *FakeSvcGroupLinkInfos) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(svcgrouplinkinfosResource, opts)) -} - -// Create takes the representation of a svcGroupLinkInfo and creates it. Returns the server's representation of the svcGroupLinkInfo, and an error, if there is any. -func (c *FakeSvcGroupLinkInfos) Create(ctx context.Context, svcGroupLinkInfo *servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo, opts v1.CreateOptions) (result *servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(svcgrouplinkinfosResource, svcGroupLinkInfo), &servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo{}) - if obj == nil { - return nil, err - } - return obj.(*servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo), err -} - -// Update takes the representation of a svcGroupLinkInfo and updates it. Returns the server's representation of the svcGroupLinkInfo, and an error, if there is any. -func (c *FakeSvcGroupLinkInfos) Update(ctx context.Context, svcGroupLinkInfo *servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo, opts v1.UpdateOptions) (result *servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(svcgrouplinkinfosResource, svcGroupLinkInfo), &servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo{}) - if obj == nil { - return nil, err - } - return obj.(*servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo), err -} - -// Delete takes name of the svcGroupLinkInfo and deletes it. Returns an error if one occurs. -func (c *FakeSvcGroupLinkInfos) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(svcgrouplinkinfosResource, name), &servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeSvcGroupLinkInfos) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(svcgrouplinkinfosResource, listOpts) - - _, err := c.Fake.Invokes(action, &servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfoList{}) - return err -} - -// Patch applies the patch and returns the patched svcGroupLinkInfo. -func (c *FakeSvcGroupLinkInfos) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(svcgrouplinkinfosResource, name, pt, data, subresources...), &servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo{}) - if obj == nil { - return nil, err - } - return obj.(*servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo), err -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/generated_expansion.go b/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/generated_expansion.go deleted file mode 100644 index 1fdf22790..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/generated_expansion.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -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 v1 - -type SvcGroupExpansion interface{} - -type SvcGroupLinkInfoExpansion interface{} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/servicegroup.tsm.tanzu.vmware.com_client.go b/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/servicegroup.tsm.tanzu.vmware.com_client.go deleted file mode 100644 index 8142bebd5..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/servicegroup.tsm.tanzu.vmware.com_client.go +++ /dev/null @@ -1,95 +0,0 @@ -/* -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 v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1" - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - rest "k8s.io/client-go/rest" -) - -type ServicegroupTsmV1Interface interface { - RESTClient() rest.Interface - SvcGroupsGetter - SvcGroupLinkInfosGetter -} - -// ServicegroupTsmV1Client is used to interact with features provided by the servicegroup.tsm.tanzu.vmware.com group. -type ServicegroupTsmV1Client struct { - restClient rest.Interface -} - -func (c *ServicegroupTsmV1Client) SvcGroups() SvcGroupInterface { - return newSvcGroups(c) -} - -func (c *ServicegroupTsmV1Client) SvcGroupLinkInfos() SvcGroupLinkInfoInterface { - return newSvcGroupLinkInfos(c) -} - -// NewForConfig creates a new ServicegroupTsmV1Client for the given config. -func NewForConfig(c *rest.Config) (*ServicegroupTsmV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &ServicegroupTsmV1Client{client}, nil -} - -// NewForConfigOrDie creates a new ServicegroupTsmV1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ServicegroupTsmV1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new ServicegroupTsmV1Client for the given RESTClient. -func New(c rest.Interface) *ServicegroupTsmV1Client { - return &ServicegroupTsmV1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1.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 *ServicegroupTsmV1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/svcgroup.go b/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/svcgroup.go deleted file mode 100644 index 8040e012d..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/svcgroup.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// SvcGroupsGetter has a method to return a SvcGroupInterface. -// A group's client should implement this interface. -type SvcGroupsGetter interface { - SvcGroups() SvcGroupInterface -} - -// SvcGroupInterface has methods to work with SvcGroup resources. -type SvcGroupInterface interface { - Create(ctx context.Context, svcGroup *v1.SvcGroup, opts metav1.CreateOptions) (*v1.SvcGroup, error) - Update(ctx context.Context, svcGroup *v1.SvcGroup, opts metav1.UpdateOptions) (*v1.SvcGroup, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.SvcGroup, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.SvcGroupList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SvcGroup, err error) - SvcGroupExpansion -} - -// svcGroups implements SvcGroupInterface -type svcGroups struct { - client rest.Interface -} - -// newSvcGroups returns a SvcGroups -func newSvcGroups(c *ServicegroupTsmV1Client) *svcGroups { - return &svcGroups{ - client: c.RESTClient(), - } -} - -// Get takes name of the svcGroup, and returns the corresponding svcGroup object, and an error if there is any. -func (c *svcGroups) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SvcGroup, err error) { - result = &v1.SvcGroup{} - err = c.client.Get(). - Resource("svcgroups"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SvcGroups that match those selectors. -func (c *svcGroups) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SvcGroupList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.SvcGroupList{} - err = c.client.Get(). - Resource("svcgroups"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested svcGroups. -func (c *svcGroups) Watch(ctx context.Context, opts metav1.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(). - Resource("svcgroups"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a svcGroup and creates it. Returns the server's representation of the svcGroup, and an error, if there is any. -func (c *svcGroups) Create(ctx context.Context, svcGroup *v1.SvcGroup, opts metav1.CreateOptions) (result *v1.SvcGroup, err error) { - result = &v1.SvcGroup{} - err = c.client.Post(). - Resource("svcgroups"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(svcGroup). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a svcGroup and updates it. Returns the server's representation of the svcGroup, and an error, if there is any. -func (c *svcGroups) Update(ctx context.Context, svcGroup *v1.SvcGroup, opts metav1.UpdateOptions) (result *v1.SvcGroup, err error) { - result = &v1.SvcGroup{} - err = c.client.Put(). - Resource("svcgroups"). - Name(svcGroup.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(svcGroup). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the svcGroup and deletes it. Returns an error if one occurs. -func (c *svcGroups) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("svcgroups"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *svcGroups) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("svcgroups"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched svcGroup. -func (c *svcGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SvcGroup, err error) { - result = &v1.SvcGroup{} - err = c.client.Patch(pt). - Resource("svcgroups"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/svcgrouplinkinfo.go b/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/svcgrouplinkinfo.go deleted file mode 100644 index a33741c70..000000000 --- a/compiler/example/output/generated/client/clientset/versioned/typed/servicegroup.tsm.tanzu.vmware.com/v1/svcgrouplinkinfo.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 v1 - -import ( - "context" - "time" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1" - scheme "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/scheme" - - metav1 "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" -) - -// SvcGroupLinkInfosGetter has a method to return a SvcGroupLinkInfoInterface. -// A group's client should implement this interface. -type SvcGroupLinkInfosGetter interface { - SvcGroupLinkInfos() SvcGroupLinkInfoInterface -} - -// SvcGroupLinkInfoInterface has methods to work with SvcGroupLinkInfo resources. -type SvcGroupLinkInfoInterface interface { - Create(ctx context.Context, svcGroupLinkInfo *v1.SvcGroupLinkInfo, opts metav1.CreateOptions) (*v1.SvcGroupLinkInfo, error) - Update(ctx context.Context, svcGroupLinkInfo *v1.SvcGroupLinkInfo, opts metav1.UpdateOptions) (*v1.SvcGroupLinkInfo, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.SvcGroupLinkInfo, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.SvcGroupLinkInfoList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SvcGroupLinkInfo, err error) - SvcGroupLinkInfoExpansion -} - -// svcGroupLinkInfos implements SvcGroupLinkInfoInterface -type svcGroupLinkInfos struct { - client rest.Interface -} - -// newSvcGroupLinkInfos returns a SvcGroupLinkInfos -func newSvcGroupLinkInfos(c *ServicegroupTsmV1Client) *svcGroupLinkInfos { - return &svcGroupLinkInfos{ - client: c.RESTClient(), - } -} - -// Get takes name of the svcGroupLinkInfo, and returns the corresponding svcGroupLinkInfo object, and an error if there is any. -func (c *svcGroupLinkInfos) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SvcGroupLinkInfo, err error) { - result = &v1.SvcGroupLinkInfo{} - err = c.client.Get(). - Resource("svcgrouplinkinfos"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SvcGroupLinkInfos that match those selectors. -func (c *svcGroupLinkInfos) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SvcGroupLinkInfoList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.SvcGroupLinkInfoList{} - err = c.client.Get(). - Resource("svcgrouplinkinfos"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested svcGroupLinkInfos. -func (c *svcGroupLinkInfos) Watch(ctx context.Context, opts metav1.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(). - Resource("svcgrouplinkinfos"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a svcGroupLinkInfo and creates it. Returns the server's representation of the svcGroupLinkInfo, and an error, if there is any. -func (c *svcGroupLinkInfos) Create(ctx context.Context, svcGroupLinkInfo *v1.SvcGroupLinkInfo, opts metav1.CreateOptions) (result *v1.SvcGroupLinkInfo, err error) { - result = &v1.SvcGroupLinkInfo{} - err = c.client.Post(). - Resource("svcgrouplinkinfos"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(svcGroupLinkInfo). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a svcGroupLinkInfo and updates it. Returns the server's representation of the svcGroupLinkInfo, and an error, if there is any. -func (c *svcGroupLinkInfos) Update(ctx context.Context, svcGroupLinkInfo *v1.SvcGroupLinkInfo, opts metav1.UpdateOptions) (result *v1.SvcGroupLinkInfo, err error) { - result = &v1.SvcGroupLinkInfo{} - err = c.client.Put(). - Resource("svcgrouplinkinfos"). - Name(svcGroupLinkInfo.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(svcGroupLinkInfo). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the svcGroupLinkInfo and deletes it. Returns an error if one occurs. -func (c *svcGroupLinkInfos) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("svcgrouplinkinfos"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *svcGroupLinkInfos) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("svcgrouplinkinfos"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched svcGroupLinkInfo. -func (c *svcGroupLinkInfos) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SvcGroupLinkInfo, err error) { - result = &v1.SvcGroupLinkInfo{} - err = c.client.Patch(pt). - Resource("svcgrouplinkinfos"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com/interface.go b/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com/interface.go deleted file mode 100644 index 6408ea6d1..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package config - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com/v1" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to each of this group's versions. -type Interface interface { - // V1 provides access to shared informers for resources in V1. - V1() v1.Interface -} - -type group struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// V1 returns a new v1.Interface. -func (g *group) V1() v1.Interface { - return v1.New(g.factory, g.namespace, g.tweakListOptions) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com/v1/config.go b/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com/v1/config.go deleted file mode 100644 index cfcd8b53a..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com/v1/config.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - configtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/config.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// ConfigInformer provides access to a shared informer and lister for -// Configs. -type ConfigInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.ConfigLister -} - -type configInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewConfigInformer constructs a new informer for Config type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredConfigInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredConfigInformer constructs a new informer for Config type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ConfigTsmV1().Configs().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ConfigTsmV1().Configs().Watch(context.TODO(), options) - }, - }, - &configtsmtanzuvmwarecomv1.Config{}, - resyncPeriod, - indexers, - ) -} - -func (f *configInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *configInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&configtsmtanzuvmwarecomv1.Config{}, f.defaultInformer) -} - -func (f *configInformer) Lister() v1.ConfigLister { - return v1.NewConfigLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com/v1/domain.go b/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com/v1/domain.go deleted file mode 100644 index e3f6db6a1..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com/v1/domain.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - configtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/config.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// DomainInformer provides access to a shared informer and lister for -// Domains. -type DomainInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.DomainLister -} - -type domainInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewDomainInformer constructs a new informer for Domain type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewDomainInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredDomainInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredDomainInformer constructs a new informer for Domain type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredDomainInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ConfigTsmV1().Domains().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ConfigTsmV1().Domains().Watch(context.TODO(), options) - }, - }, - &configtsmtanzuvmwarecomv1.Domain{}, - resyncPeriod, - indexers, - ) -} - -func (f *domainInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredDomainInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *domainInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&configtsmtanzuvmwarecomv1.Domain{}, f.defaultInformer) -} - -func (f *domainInformer) Lister() v1.DomainLister { - return v1.NewDomainLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com/v1/footypeabc.go b/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com/v1/footypeabc.go deleted file mode 100644 index 812d88fed..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com/v1/footypeabc.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - configtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/config.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// FooTypeABCInformer provides access to a shared informer and lister for -// FooTypeABCs. -type FooTypeABCInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.FooTypeABCLister -} - -type fooTypeABCInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewFooTypeABCInformer constructs a new informer for FooTypeABC type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFooTypeABCInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredFooTypeABCInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredFooTypeABCInformer constructs a new informer for FooTypeABC type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredFooTypeABCInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ConfigTsmV1().FooTypeABCs().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ConfigTsmV1().FooTypeABCs().Watch(context.TODO(), options) - }, - }, - &configtsmtanzuvmwarecomv1.FooTypeABC{}, - resyncPeriod, - indexers, - ) -} - -func (f *fooTypeABCInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredFooTypeABCInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *fooTypeABCInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&configtsmtanzuvmwarecomv1.FooTypeABC{}, f.defaultInformer) -} - -func (f *fooTypeABCInformer) Lister() v1.FooTypeABCLister { - return v1.NewFooTypeABCLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com/v1/interface.go b/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com/v1/interface.go deleted file mode 100644 index b73ea3782..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com/v1/interface.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // Configs returns a ConfigInformer. - Configs() ConfigInformer - // Domains returns a DomainInformer. - Domains() DomainInformer - // FooTypeABCs returns a FooTypeABCInformer. - FooTypeABCs() FooTypeABCInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// Configs returns a ConfigInformer. -func (v *version) Configs() ConfigInformer { - return &configInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// Domains returns a DomainInformer. -func (v *version) Domains() DomainInformer { - return &domainInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// FooTypeABCs returns a FooTypeABCInformer. -func (v *version) FooTypeABCs() FooTypeABCInformer { - return &fooTypeABCInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} diff --git a/compiler/example/output/generated/client/informers/externalversions/factory.go b/compiler/example/output/generated/client/informers/externalversions/factory.go index bafce3808..ea0af124a 100644 --- a/compiler/example/output/generated/client/informers/externalversions/factory.go +++ b/compiler/example/output/generated/client/informers/externalversions/factory.go @@ -19,18 +19,13 @@ limitations under the License. package externalversions import ( + versioned "nexustempmodule/client/clientset/versioned" + globaltsmtanzuvmwarecom "nexustempmodule/client/informers/externalversions/global.tsm.tanzu.vmware.com" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" reflect "reflect" sync "sync" time "time" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - configtsmtanzuvmwarecom "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com" - gnstsmtanzuvmwarecom "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - policypkgtsmtanzuvmwarecom "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com" - roottsmtanzuvmwarecom "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/root.tsm.tanzu.vmware.com" - servicegrouptsmtanzuvmwarecom "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/servicegroup.tsm.tanzu.vmware.com" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -177,29 +172,9 @@ type SharedInformerFactory interface { ForResource(resource schema.GroupVersionResource) (GenericInformer, error) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - ConfigTsm() configtsmtanzuvmwarecom.Interface - GnsTsm() gnstsmtanzuvmwarecom.Interface - PolicypkgTsm() policypkgtsmtanzuvmwarecom.Interface - RootTsm() roottsmtanzuvmwarecom.Interface - ServicegroupTsm() servicegrouptsmtanzuvmwarecom.Interface -} - -func (f *sharedInformerFactory) ConfigTsm() configtsmtanzuvmwarecom.Interface { - return configtsmtanzuvmwarecom.New(f, f.namespace, f.tweakListOptions) -} - -func (f *sharedInformerFactory) GnsTsm() gnstsmtanzuvmwarecom.Interface { - return gnstsmtanzuvmwarecom.New(f, f.namespace, f.tweakListOptions) -} - -func (f *sharedInformerFactory) PolicypkgTsm() policypkgtsmtanzuvmwarecom.Interface { - return policypkgtsmtanzuvmwarecom.New(f, f.namespace, f.tweakListOptions) -} - -func (f *sharedInformerFactory) RootTsm() roottsmtanzuvmwarecom.Interface { - return roottsmtanzuvmwarecom.New(f, f.namespace, f.tweakListOptions) + GlobalTsm() globaltsmtanzuvmwarecom.Interface } -func (f *sharedInformerFactory) ServicegroupTsm() servicegrouptsmtanzuvmwarecom.Interface { - return servicegrouptsmtanzuvmwarecom.New(f, f.namespace, f.tweakListOptions) +func (f *sharedInformerFactory) GlobalTsm() globaltsmtanzuvmwarecom.Interface { + return globaltsmtanzuvmwarecom.New(f, f.namespace, f.tweakListOptions) } diff --git a/compiler/example/output/generated/client/informers/externalversions/generic.go b/compiler/example/output/generated/client/informers/externalversions/generic.go index 68442b55b..9046975c8 100644 --- a/compiler/example/output/generated/client/informers/externalversions/generic.go +++ b/compiler/example/output/generated/client/informers/externalversions/generic.go @@ -20,12 +20,7 @@ package externalversions import ( "fmt" - - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1" - gnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - policypkgtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - roottsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1" - servicegrouptsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1" + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" @@ -57,51 +52,423 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=config.tsm.tanzu.vmware.com, Version=v1 + // Group=global.tsm.tanzu.vmware.com, Version=v1 + case v1.SchemeGroupVersion.WithResource("acpconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ACPConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("accesscontrolpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AccessControlPolicies().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("accesstokens"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AccessTokens().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("additionalattributeses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AdditionalAttributeses().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("allsparkserviceses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AllSparkServiceses().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("annotations"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Annotations().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("apidiscoveries"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ApiDiscoveries().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("apidiscoveryrts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ApiDiscoveryRTs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("apps"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Apps().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("appfolders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AppFolders().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("appgroups"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AppGroups().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("apptemplates"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AppTemplates().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("apptemplateservicedefinitions"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AppTemplateServiceDefinitions().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("appusers"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AppUsers().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("appversions"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AppVersions().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("applicationinfos"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ApplicationInfos().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("attackdiscoveries"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AttackDiscoveries().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("attackdiscoveryrts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AttackDiscoveryRTs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("authenticationpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AuthenticationPolicies().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("autoscalers"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Autoscalers().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("autoscalercrs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AutoscalerCRs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("autoscalerconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AutoscalerConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("autoscalerfolders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AutoscalerFolders().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("autoscalingpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AutoscalingPolicies().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("awsconnectors"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().AwsConnectors().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("buckets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Buckets().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("certificates"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Certificates().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("certificateauthorityconfigns"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().CertificateAuthorityConfigNs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("certificateauthorityrts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().CertificateAuthorityRTs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("certificateconfigns"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().CertificateConfigNs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("certificaterequests"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().CertificateRequests().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("clusters"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Clusters().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("clusterconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ClusterConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("clusterconfigfolders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ClusterConfigFolders().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("clusterfolders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ClusterFolders().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("clustersettingses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ClusterSettingses().Informer()}, nil case v1.SchemeGroupVersion.WithResource("configs"): - return &genericInformer{resource: resource.GroupResource(), informer: f.ConfigTsm().V1().Configs().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Configs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("configmaps"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ConfigMaps().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("connectionstatuses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ConnectionStatuses().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("dcregions"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().DCRegions().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("dczones"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().DCZones().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("dnsconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().DNSConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("dnsconfigfolders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().DNSConfigFolders().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("dnsprobeconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().DNSProbeConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("dnsprobestatuses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().DNSProbeStatuses().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("dnsprobesconfigfolders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().DNSProbesConfigFolders().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("datafolders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().DataFolders().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("datafolderdomains"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().DataFolderDomains().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("datafolderdomainclusters"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().DataFolderDomainClusters().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("datafolderdomainservices"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().DataFolderDomainServices().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("datafolderdomainserviceversions"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().DataFolderDomainServiceVersions().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("datagroups"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().DataGroups().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("datatemplates"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().DataTemplates().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("databases"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Databases().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("destinationrules"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().DestinationRules().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("directories"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Directories().Informer()}, nil case v1.SchemeGroupVersion.WithResource("domains"): - return &genericInformer{resource: resource.GroupResource(), informer: f.ConfigTsm().V1().Domains().Informer()}, nil - case v1.SchemeGroupVersion.WithResource("footypeabcs"): - return &genericInformer{resource: resource.GroupResource(), informer: f.ConfigTsm().V1().FooTypeABCs().Informer()}, nil - - // Group=gns.tsm.tanzu.vmware.com, Version=v1 - case gnstsmtanzuvmwarecomv1.SchemeGroupVersion.WithResource("additionalgnsdatas"): - return &genericInformer{resource: resource.GroupResource(), informer: f.GnsTsm().V1().AdditionalGnsDatas().Informer()}, nil - case gnstsmtanzuvmwarecomv1.SchemeGroupVersion.WithResource("barchilds"): - return &genericInformer{resource: resource.GroupResource(), informer: f.GnsTsm().V1().BarChilds().Informer()}, nil - case gnstsmtanzuvmwarecomv1.SchemeGroupVersion.WithResource("dnses"): - return &genericInformer{resource: resource.GroupResource(), informer: f.GnsTsm().V1().Dnses().Informer()}, nil - case gnstsmtanzuvmwarecomv1.SchemeGroupVersion.WithResource("foos"): - return &genericInformer{resource: resource.GroupResource(), informer: f.GnsTsm().V1().Foos().Informer()}, nil - case gnstsmtanzuvmwarecomv1.SchemeGroupVersion.WithResource("gnses"): - return &genericInformer{resource: resource.GroupResource(), informer: f.GnsTsm().V1().Gnses().Informer()}, nil - case gnstsmtanzuvmwarecomv1.SchemeGroupVersion.WithResource("ignorechilds"): - return &genericInformer{resource: resource.GroupResource(), informer: f.GnsTsm().V1().IgnoreChilds().Informer()}, nil - case gnstsmtanzuvmwarecomv1.SchemeGroupVersion.WithResource("randomgnsdatas"): - return &genericInformer{resource: resource.GroupResource(), informer: f.GnsTsm().V1().RandomGnsDatas().Informer()}, nil - - // Group=policypkg.tsm.tanzu.vmware.com, Version=v1 - case policypkgtsmtanzuvmwarecomv1.SchemeGroupVersion.WithResource("acpconfigs"): - return &genericInformer{resource: resource.GroupResource(), informer: f.PolicypkgTsm().V1().ACPConfigs().Informer()}, nil - case policypkgtsmtanzuvmwarecomv1.SchemeGroupVersion.WithResource("accesscontrolpolicies"): - return &genericInformer{resource: resource.GroupResource(), informer: f.PolicypkgTsm().V1().AccessControlPolicies().Informer()}, nil - case policypkgtsmtanzuvmwarecomv1.SchemeGroupVersion.WithResource("additionalpolicydatas"): - return &genericInformer{resource: resource.GroupResource(), informer: f.PolicypkgTsm().V1().AdditionalPolicyDatas().Informer()}, nil - case policypkgtsmtanzuvmwarecomv1.SchemeGroupVersion.WithResource("randompolicydatas"): - return &genericInformer{resource: resource.GroupResource(), informer: f.PolicypkgTsm().V1().RandomPolicyDatas().Informer()}, nil - case policypkgtsmtanzuvmwarecomv1.SchemeGroupVersion.WithResource("vmpolicies"): - return &genericInformer{resource: resource.GroupResource(), informer: f.PolicypkgTsm().V1().VMpolicies().Informer()}, nil - - // Group=root.tsm.tanzu.vmware.com, Version=v1 - case roottsmtanzuvmwarecomv1.SchemeGroupVersion.WithResource("roots"): - return &genericInformer{resource: resource.GroupResource(), informer: f.RootTsm().V1().Roots().Informer()}, nil - - // Group=servicegroup.tsm.tanzu.vmware.com, Version=v1 - case servicegrouptsmtanzuvmwarecomv1.SchemeGroupVersion.WithResource("svcgroups"): - return &genericInformer{resource: resource.GroupResource(), informer: f.ServicegroupTsm().V1().SvcGroups().Informer()}, nil - case servicegrouptsmtanzuvmwarecomv1.SchemeGroupVersion.WithResource("svcgrouplinkinfos"): - return &genericInformer{resource: resource.GroupResource(), informer: f.ServicegroupTsm().V1().SvcGroupLinkInfos().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Domains().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("domainconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().DomainConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("endpoints"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Endpoints().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("envoyfilters"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().EnvoyFilters().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externalaccountconfigns"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalAccountConfigNs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externalauditstorages"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalAuditStorages().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externaldnsconfigns"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalDNSConfigNs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externaldnsinventories"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalDNSInventories().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externaldnsinventoryhealthchecks"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalDNSInventoryHealthChecks().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externaldnsinventoryprimarydomains"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalDNSInventoryPrimaryDomains().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externaldnsinventoryrecords"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalDNSInventoryRecords().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externaldnsinventoryzones"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalDNSInventoryZones().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externaldnsruntimes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalDNSRuntimes().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externaldnsruntimeendpoints"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalDNSRuntimeEndpoints().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externaldnsruntimeprimarydomains"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalDNSRuntimePrimaryDomains().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externaldnsruntimesubdomains"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalDNSRuntimeSubdomains().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externallbconfigns"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalLBConfigNs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externalplugincapabilities"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalPluginCapabilities().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externalpluginconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalPluginConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externalpluginconfigfolders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalPluginConfigFolders().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externalplugininstanceconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalPluginInstanceConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externalpluginmonitors"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalPluginMonitors().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externalserviceconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalServiceConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("externalservicesrts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ExternalServicesRTs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("featureflags"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().FeatureFlags().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("federatedsloconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().FederatedSloConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("federatedsloserviceconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().FederatedSloServiceConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gnss"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GNSs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gnsroutingconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GNSRoutingConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gnssvcgroups"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GNSSvcGroups().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gateways"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Gateways().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gatewayconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GatewayConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gatewayconfigadditionallistenerses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GatewayConfigAdditionalListenerses().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gatewayconfiglistenercertificates"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GatewayConfigListenerCertificates().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gatewayconfiglistenerdestinationroutes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GatewayConfigListenerDestinationRoutes().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("geodiscoveries"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GeoDiscoveries().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("geodiscoveryrts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GeoDiscoveryRTs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("globalnamespaces"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GlobalNamespaces().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("globalnses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GlobalNses().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("globalregistrationservices"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GlobalRegistrationServices().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gnsaccesscontrolpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GnsAccessControlPolicies().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gnsaccesscontrolpolicyrts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GnsAccessControlPolicyRTs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gnsbindingrts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GnsBindingRTs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gnsendpointsconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GnsEndpointsConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gnsroutingruleconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GnsRoutingRuleConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gnsschemaviolationdiscoveries"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GnsSchemaViolationDiscoveries().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gnssegmentationpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GnsSegmentationPolicies().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gnssegmentationpolicyrts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GnsSegmentationPolicyRTs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gnsserviceentryconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GnsServiceEntryConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gnssvcgrouprts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().GnsSvcGroupRTs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("haconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().HaConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("haconfigv2s"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().HaConfigV2s().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("healthcheckconfigns"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().HealthCheckConfigNs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("hostconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().HostConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("hostconfigv2s"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().HostConfigV2s().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("inboundauthenticationconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().InboundAuthenticationConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("inventories"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Inventories().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("issuers"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Issuers().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("jobs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Jobs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("jobconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().JobConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("jobconfigfolders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().JobConfigFolders().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("jobfolders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().JobFolders().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("knativeingresses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().KnativeIngresses().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("labelconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().LabelConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("localregistrationservices"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().LocalRegistrationServices().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("localregistrationserviceclusters"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().LocalRegistrationServiceClusters().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("localregistrationserviceresources"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().LocalRegistrationServiceResources().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("logs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Logs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("logfolders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().LogFolders().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("metricmonitors"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().MetricMonitors().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("networkattachmentdefinitions"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().NetworkAttachmentDefinitions().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("networkattachmentdefinitionconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().NetworkAttachmentDefinitionConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("nodes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Nodes().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("nodedefinitions"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().NodeDefinitions().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("nodefolders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().NodeFolders().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("nodefolderclusters"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().NodeFolderClusters().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("nodegroups"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().NodeGroups().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("nodestatuses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().NodeStatuses().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("nodetemplates"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().NodeTemplates().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("outboundauthenticationmodes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().OutboundAuthenticationModes().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("peerauthentications"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().PeerAuthentications().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("piidiscoveries"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().PiiDiscoveries().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("piidiscoveryrts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().PiiDiscoveryRTs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("policyconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().PolicyConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("policytemplates"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().PolicyTemplates().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("progressiveupgrades"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ProgressiveUpgrades().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("progressiveupgradeconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ProgressiveUpgradeConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("progressiveupgradefolders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ProgressiveUpgradeFolders().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("progressiveupgraderuntimes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ProgressiveUpgradeRuntimes().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("projects"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Projects().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("projectconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ProjectConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("projectinventories"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ProjectInventories().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("projectqueries"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ProjectQueries().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("publicserviceconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().PublicServiceConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("publicservicerts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().PublicServiceRTs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("publicservicerouteconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().PublicServiceRouteConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("rpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().RPolicies().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("remotegatewayserviceconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().RemoteGatewayServiceConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("resourcegroups"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ResourceGroups().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("resourcegrouprts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ResourceGroupRTs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("roots"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Roots().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("runtimes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Runtimes().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("slofolders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().SLOFolders().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("slopolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().SLOPolicies().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("schemaviolationdiscoveryrts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().SchemaViolationDiscoveryRTs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("secrethashes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().SecretHashes().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("secretrtconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().SecretRTConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("securitycontextconstraintses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().SecurityContextConstraintses().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("securitycontextconstraintsconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().SecurityContextConstraintsConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("services"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Services().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("serviceconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicecronjobs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceCronJobs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicedaemonsets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceDaemonSets().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicedeployments"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceDeployments().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicedeploymentcontainers"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceDeploymentContainers().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicedirectoryentryconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceDirectoryEntryConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicedirectoryns"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceDirectoryNs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicedirectoryrts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceDirectoryRTs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicedirectoryrtfolders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceDirectoryRTFolders().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicedirectoryrtfolderentries"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceDirectoryRTFolderEntries().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("serviceentries"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceEntries().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("serviceentryconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceEntryConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("serviceinstances"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceInstances().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("serviceinstancecontainers"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceInstanceContainers().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicejobs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceJobs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicelevelobjectives"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceLevelObjectives().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicelevelobjectivefolders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceLevelObjectiveFolders().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicereplicasets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceReplicaSets().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicestatefulsets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceStatefulSets().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicetemplates"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceTemplates().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicetemplateservicedefinitions"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceTemplateServiceDefinitions().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("serviceversions"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceVersions().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("serviceversionconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().ServiceVersionConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("sharedserviceconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().SharedServiceConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("sloconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().SloConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("sloserviceconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().SloServiceConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("svcgroups"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().SvcGroups().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("svcgrouprts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().SvcGroupRTs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("tables"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Tables().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("templates"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Templates().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("templategroups"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().TemplateGroups().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("tenants"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Tenants().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("tenantresources"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().TenantResources().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("tenanttokens"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().TenantTokens().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("users"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().Users().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("userdiscoveries"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().UserDiscoveries().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("userdiscoveryrts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().UserDiscoveryRTs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("userfolders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().UserFolders().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("usergroups"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().UserGroups().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("userpreferences"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().UserPreferences().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("virtualservices"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().VirtualServices().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("workloadentries"): + return &genericInformer{resource: resource.GroupResource(), informer: f.GlobalTsm().V1().WorkloadEntries().Informer()}, nil } diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/interface.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/interface.go new file mode 100644 index 000000000..8ecbd7f49 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/interface.go @@ -0,0 +1,46 @@ +/* +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 informer-gen. DO NOT EDIT. + +package global + +import ( + v1 "nexustempmodule/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go new file mode 100644 index 000000000..d172d6df6 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AccessControlPolicyInformer provides access to a shared informer and lister for +// AccessControlPolicies. +type AccessControlPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AccessControlPolicyLister +} + +type accessControlPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAccessControlPolicyInformer constructs a new informer for AccessControlPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAccessControlPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAccessControlPolicyInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAccessControlPolicyInformer constructs a new informer for AccessControlPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAccessControlPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AccessControlPolicies().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AccessControlPolicies().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AccessControlPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *accessControlPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAccessControlPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *accessControlPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AccessControlPolicy{}, f.defaultInformer) +} + +func (f *accessControlPolicyInformer) Lister() v1.AccessControlPolicyLister { + return v1.NewAccessControlPolicyLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/accesstoken.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/accesstoken.go new file mode 100644 index 000000000..62c3fafc0 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/accesstoken.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AccessTokenInformer provides access to a shared informer and lister for +// AccessTokens. +type AccessTokenInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AccessTokenLister +} + +type accessTokenInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAccessTokenInformer constructs a new informer for AccessToken type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAccessTokenInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAccessTokenInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAccessTokenInformer constructs a new informer for AccessToken type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAccessTokenInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AccessTokens().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AccessTokens().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AccessToken{}, + resyncPeriod, + indexers, + ) +} + +func (f *accessTokenInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAccessTokenInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *accessTokenInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AccessToken{}, f.defaultInformer) +} + +func (f *accessTokenInformer) Lister() v1.AccessTokenLister { + return v1.NewAccessTokenLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/acpconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/acpconfig.go new file mode 100644 index 000000000..3adc035a8 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/acpconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ACPConfigInformer provides access to a shared informer and lister for +// ACPConfigs. +type ACPConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ACPConfigLister +} + +type aCPConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewACPConfigInformer constructs a new informer for ACPConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewACPConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredACPConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredACPConfigInformer constructs a new informer for ACPConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredACPConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ACPConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ACPConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ACPConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *aCPConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredACPConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *aCPConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ACPConfig{}, f.defaultInformer) +} + +func (f *aCPConfigInformer) Lister() v1.ACPConfigLister { + return v1.NewACPConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/additionalattributes.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/additionalattributes.go new file mode 100644 index 000000000..801cc301f --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/additionalattributes.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AdditionalAttributesInformer provides access to a shared informer and lister for +// AdditionalAttributeses. +type AdditionalAttributesInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AdditionalAttributesLister +} + +type additionalAttributesInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAdditionalAttributesInformer constructs a new informer for AdditionalAttributes type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAdditionalAttributesInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAdditionalAttributesInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAdditionalAttributesInformer constructs a new informer for AdditionalAttributes type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAdditionalAttributesInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AdditionalAttributeses().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AdditionalAttributeses().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AdditionalAttributes{}, + resyncPeriod, + indexers, + ) +} + +func (f *additionalAttributesInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAdditionalAttributesInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *additionalAttributesInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AdditionalAttributes{}, f.defaultInformer) +} + +func (f *additionalAttributesInformer) Lister() v1.AdditionalAttributesLister { + return v1.NewAdditionalAttributesLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/allsparkservices.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/allsparkservices.go new file mode 100644 index 000000000..6a4b018e2 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/allsparkservices.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AllSparkServicesInformer provides access to a shared informer and lister for +// AllSparkServiceses. +type AllSparkServicesInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AllSparkServicesLister +} + +type allSparkServicesInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAllSparkServicesInformer constructs a new informer for AllSparkServices type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAllSparkServicesInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAllSparkServicesInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAllSparkServicesInformer constructs a new informer for AllSparkServices type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAllSparkServicesInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AllSparkServiceses().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AllSparkServiceses().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AllSparkServices{}, + resyncPeriod, + indexers, + ) +} + +func (f *allSparkServicesInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAllSparkServicesInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *allSparkServicesInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AllSparkServices{}, f.defaultInformer) +} + +func (f *allSparkServicesInformer) Lister() v1.AllSparkServicesLister { + return v1.NewAllSparkServicesLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/annotation.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/annotation.go new file mode 100644 index 000000000..6dcd76b4b --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/annotation.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AnnotationInformer provides access to a shared informer and lister for +// Annotations. +type AnnotationInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AnnotationLister +} + +type annotationInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAnnotationInformer constructs a new informer for Annotation type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAnnotationInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAnnotationInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAnnotationInformer constructs a new informer for Annotation type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAnnotationInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Annotations().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Annotations().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Annotation{}, + resyncPeriod, + indexers, + ) +} + +func (f *annotationInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAnnotationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *annotationInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Annotation{}, f.defaultInformer) +} + +func (f *annotationInformer) Lister() v1.AnnotationLister { + return v1.NewAnnotationLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/apidiscovery.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/apidiscovery.go new file mode 100644 index 000000000..65b69b3c8 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/apidiscovery.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ApiDiscoveryInformer provides access to a shared informer and lister for +// ApiDiscoveries. +type ApiDiscoveryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ApiDiscoveryLister +} + +type apiDiscoveryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewApiDiscoveryInformer constructs a new informer for ApiDiscovery type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewApiDiscoveryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredApiDiscoveryInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredApiDiscoveryInformer constructs a new informer for ApiDiscovery type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredApiDiscoveryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ApiDiscoveries().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ApiDiscoveries().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ApiDiscovery{}, + resyncPeriod, + indexers, + ) +} + +func (f *apiDiscoveryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredApiDiscoveryInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *apiDiscoveryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ApiDiscovery{}, f.defaultInformer) +} + +func (f *apiDiscoveryInformer) Lister() v1.ApiDiscoveryLister { + return v1.NewApiDiscoveryLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/apidiscoveryrt.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/apidiscoveryrt.go new file mode 100644 index 000000000..c2efb0de5 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/apidiscoveryrt.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ApiDiscoveryRTInformer provides access to a shared informer and lister for +// ApiDiscoveryRTs. +type ApiDiscoveryRTInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ApiDiscoveryRTLister +} + +type apiDiscoveryRTInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewApiDiscoveryRTInformer constructs a new informer for ApiDiscoveryRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewApiDiscoveryRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredApiDiscoveryRTInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredApiDiscoveryRTInformer constructs a new informer for ApiDiscoveryRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredApiDiscoveryRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ApiDiscoveryRTs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ApiDiscoveryRTs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ApiDiscoveryRT{}, + resyncPeriod, + indexers, + ) +} + +func (f *apiDiscoveryRTInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredApiDiscoveryRTInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *apiDiscoveryRTInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ApiDiscoveryRT{}, f.defaultInformer) +} + +func (f *apiDiscoveryRTInformer) Lister() v1.ApiDiscoveryRTLister { + return v1.NewApiDiscoveryRTLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/app.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/app.go new file mode 100644 index 000000000..ac7e83297 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/app.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AppInformer provides access to a shared informer and lister for +// Apps. +type AppInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AppLister +} + +type appInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAppInformer constructs a new informer for App type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAppInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAppInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAppInformer constructs a new informer for App type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAppInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Apps().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Apps().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.App{}, + resyncPeriod, + indexers, + ) +} + +func (f *appInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAppInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *appInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.App{}, f.defaultInformer) +} + +func (f *appInformer) Lister() v1.AppLister { + return v1.NewAppLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/appfolder.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/appfolder.go new file mode 100644 index 000000000..a2cca0fef --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/appfolder.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AppFolderInformer provides access to a shared informer and lister for +// AppFolders. +type AppFolderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AppFolderLister +} + +type appFolderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAppFolderInformer constructs a new informer for AppFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAppFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAppFolderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAppFolderInformer constructs a new informer for AppFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAppFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AppFolders().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AppFolders().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AppFolder{}, + resyncPeriod, + indexers, + ) +} + +func (f *appFolderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAppFolderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *appFolderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AppFolder{}, f.defaultInformer) +} + +func (f *appFolderInformer) Lister() v1.AppFolderLister { + return v1.NewAppFolderLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/appgroup.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/appgroup.go new file mode 100644 index 000000000..074096bcd --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/appgroup.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AppGroupInformer provides access to a shared informer and lister for +// AppGroups. +type AppGroupInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AppGroupLister +} + +type appGroupInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAppGroupInformer constructs a new informer for AppGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAppGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAppGroupInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAppGroupInformer constructs a new informer for AppGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAppGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AppGroups().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AppGroups().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AppGroup{}, + resyncPeriod, + indexers, + ) +} + +func (f *appGroupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAppGroupInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *appGroupInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AppGroup{}, f.defaultInformer) +} + +func (f *appGroupInformer) Lister() v1.AppGroupLister { + return v1.NewAppGroupLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/applicationinfo.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/applicationinfo.go new file mode 100644 index 000000000..f5e9735a2 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/applicationinfo.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ApplicationInfoInformer provides access to a shared informer and lister for +// ApplicationInfos. +type ApplicationInfoInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ApplicationInfoLister +} + +type applicationInfoInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewApplicationInfoInformer constructs a new informer for ApplicationInfo type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewApplicationInfoInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredApplicationInfoInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredApplicationInfoInformer constructs a new informer for ApplicationInfo type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredApplicationInfoInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ApplicationInfos().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ApplicationInfos().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ApplicationInfo{}, + resyncPeriod, + indexers, + ) +} + +func (f *applicationInfoInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredApplicationInfoInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *applicationInfoInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ApplicationInfo{}, f.defaultInformer) +} + +func (f *applicationInfoInformer) Lister() v1.ApplicationInfoLister { + return v1.NewApplicationInfoLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/apptemplate.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/apptemplate.go new file mode 100644 index 000000000..b44107902 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/apptemplate.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AppTemplateInformer provides access to a shared informer and lister for +// AppTemplates. +type AppTemplateInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AppTemplateLister +} + +type appTemplateInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAppTemplateInformer constructs a new informer for AppTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAppTemplateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAppTemplateInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAppTemplateInformer constructs a new informer for AppTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAppTemplateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AppTemplates().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AppTemplates().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AppTemplate{}, + resyncPeriod, + indexers, + ) +} + +func (f *appTemplateInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAppTemplateInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *appTemplateInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AppTemplate{}, f.defaultInformer) +} + +func (f *appTemplateInformer) Lister() v1.AppTemplateLister { + return v1.NewAppTemplateLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/apptemplateservicedefinition.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/apptemplateservicedefinition.go new file mode 100644 index 000000000..86734b753 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/apptemplateservicedefinition.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AppTemplateServiceDefinitionInformer provides access to a shared informer and lister for +// AppTemplateServiceDefinitions. +type AppTemplateServiceDefinitionInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AppTemplateServiceDefinitionLister +} + +type appTemplateServiceDefinitionInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAppTemplateServiceDefinitionInformer constructs a new informer for AppTemplateServiceDefinition type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAppTemplateServiceDefinitionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAppTemplateServiceDefinitionInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAppTemplateServiceDefinitionInformer constructs a new informer for AppTemplateServiceDefinition type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAppTemplateServiceDefinitionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AppTemplateServiceDefinitions().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AppTemplateServiceDefinitions().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition{}, + resyncPeriod, + indexers, + ) +} + +func (f *appTemplateServiceDefinitionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAppTemplateServiceDefinitionInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *appTemplateServiceDefinitionInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition{}, f.defaultInformer) +} + +func (f *appTemplateServiceDefinitionInformer) Lister() v1.AppTemplateServiceDefinitionLister { + return v1.NewAppTemplateServiceDefinitionLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/appuser.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/appuser.go new file mode 100644 index 000000000..bfda065d8 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/appuser.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AppUserInformer provides access to a shared informer and lister for +// AppUsers. +type AppUserInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AppUserLister +} + +type appUserInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAppUserInformer constructs a new informer for AppUser type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAppUserInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAppUserInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAppUserInformer constructs a new informer for AppUser type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAppUserInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AppUsers().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AppUsers().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AppUser{}, + resyncPeriod, + indexers, + ) +} + +func (f *appUserInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAppUserInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *appUserInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AppUser{}, f.defaultInformer) +} + +func (f *appUserInformer) Lister() v1.AppUserLister { + return v1.NewAppUserLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/appversion.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/appversion.go new file mode 100644 index 000000000..5da038a56 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/appversion.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AppVersionInformer provides access to a shared informer and lister for +// AppVersions. +type AppVersionInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AppVersionLister +} + +type appVersionInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAppVersionInformer constructs a new informer for AppVersion type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAppVersionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAppVersionInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAppVersionInformer constructs a new informer for AppVersion type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAppVersionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AppVersions().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AppVersions().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AppVersion{}, + resyncPeriod, + indexers, + ) +} + +func (f *appVersionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAppVersionInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *appVersionInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AppVersion{}, f.defaultInformer) +} + +func (f *appVersionInformer) Lister() v1.AppVersionLister { + return v1.NewAppVersionLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/attackdiscovery.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/attackdiscovery.go new file mode 100644 index 000000000..467ff66ac --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/attackdiscovery.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AttackDiscoveryInformer provides access to a shared informer and lister for +// AttackDiscoveries. +type AttackDiscoveryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AttackDiscoveryLister +} + +type attackDiscoveryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAttackDiscoveryInformer constructs a new informer for AttackDiscovery type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAttackDiscoveryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAttackDiscoveryInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAttackDiscoveryInformer constructs a new informer for AttackDiscovery type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAttackDiscoveryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AttackDiscoveries().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AttackDiscoveries().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AttackDiscovery{}, + resyncPeriod, + indexers, + ) +} + +func (f *attackDiscoveryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAttackDiscoveryInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *attackDiscoveryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AttackDiscovery{}, f.defaultInformer) +} + +func (f *attackDiscoveryInformer) Lister() v1.AttackDiscoveryLister { + return v1.NewAttackDiscoveryLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/attackdiscoveryrt.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/attackdiscoveryrt.go new file mode 100644 index 000000000..ef3258d50 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/attackdiscoveryrt.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AttackDiscoveryRTInformer provides access to a shared informer and lister for +// AttackDiscoveryRTs. +type AttackDiscoveryRTInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AttackDiscoveryRTLister +} + +type attackDiscoveryRTInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAttackDiscoveryRTInformer constructs a new informer for AttackDiscoveryRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAttackDiscoveryRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAttackDiscoveryRTInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAttackDiscoveryRTInformer constructs a new informer for AttackDiscoveryRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAttackDiscoveryRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AttackDiscoveryRTs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AttackDiscoveryRTs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AttackDiscoveryRT{}, + resyncPeriod, + indexers, + ) +} + +func (f *attackDiscoveryRTInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAttackDiscoveryRTInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *attackDiscoveryRTInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AttackDiscoveryRT{}, f.defaultInformer) +} + +func (f *attackDiscoveryRTInformer) Lister() v1.AttackDiscoveryRTLister { + return v1.NewAttackDiscoveryRTLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/authenticationpolicy.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/authenticationpolicy.go new file mode 100644 index 000000000..5107e40ab --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/authenticationpolicy.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AuthenticationPolicyInformer provides access to a shared informer and lister for +// AuthenticationPolicies. +type AuthenticationPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AuthenticationPolicyLister +} + +type authenticationPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAuthenticationPolicyInformer constructs a new informer for AuthenticationPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAuthenticationPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAuthenticationPolicyInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAuthenticationPolicyInformer constructs a new informer for AuthenticationPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAuthenticationPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AuthenticationPolicies().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AuthenticationPolicies().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AuthenticationPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *authenticationPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAuthenticationPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *authenticationPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AuthenticationPolicy{}, f.defaultInformer) +} + +func (f *authenticationPolicyInformer) Lister() v1.AuthenticationPolicyLister { + return v1.NewAuthenticationPolicyLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/autoscaler.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/autoscaler.go new file mode 100644 index 000000000..082e682d1 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/autoscaler.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AutoscalerInformer provides access to a shared informer and lister for +// Autoscalers. +type AutoscalerInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AutoscalerLister +} + +type autoscalerInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAutoscalerInformer constructs a new informer for Autoscaler type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAutoscalerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAutoscalerInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAutoscalerInformer constructs a new informer for Autoscaler type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAutoscalerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Autoscalers().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Autoscalers().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Autoscaler{}, + resyncPeriod, + indexers, + ) +} + +func (f *autoscalerInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAutoscalerInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *autoscalerInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Autoscaler{}, f.defaultInformer) +} + +func (f *autoscalerInformer) Lister() v1.AutoscalerLister { + return v1.NewAutoscalerLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/autoscalerconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/autoscalerconfig.go new file mode 100644 index 000000000..345b009c0 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/autoscalerconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AutoscalerConfigInformer provides access to a shared informer and lister for +// AutoscalerConfigs. +type AutoscalerConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AutoscalerConfigLister +} + +type autoscalerConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAutoscalerConfigInformer constructs a new informer for AutoscalerConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAutoscalerConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAutoscalerConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAutoscalerConfigInformer constructs a new informer for AutoscalerConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAutoscalerConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AutoscalerConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AutoscalerConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AutoscalerConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *autoscalerConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAutoscalerConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *autoscalerConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AutoscalerConfig{}, f.defaultInformer) +} + +func (f *autoscalerConfigInformer) Lister() v1.AutoscalerConfigLister { + return v1.NewAutoscalerConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/autoscalercr.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/autoscalercr.go new file mode 100644 index 000000000..c59c8cbbc --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/autoscalercr.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AutoscalerCRInformer provides access to a shared informer and lister for +// AutoscalerCRs. +type AutoscalerCRInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AutoscalerCRLister +} + +type autoscalerCRInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAutoscalerCRInformer constructs a new informer for AutoscalerCR type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAutoscalerCRInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAutoscalerCRInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAutoscalerCRInformer constructs a new informer for AutoscalerCR type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAutoscalerCRInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AutoscalerCRs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AutoscalerCRs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AutoscalerCR{}, + resyncPeriod, + indexers, + ) +} + +func (f *autoscalerCRInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAutoscalerCRInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *autoscalerCRInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AutoscalerCR{}, f.defaultInformer) +} + +func (f *autoscalerCRInformer) Lister() v1.AutoscalerCRLister { + return v1.NewAutoscalerCRLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/autoscalerfolder.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/autoscalerfolder.go new file mode 100644 index 000000000..e5cee5680 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/autoscalerfolder.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AutoscalerFolderInformer provides access to a shared informer and lister for +// AutoscalerFolders. +type AutoscalerFolderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AutoscalerFolderLister +} + +type autoscalerFolderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAutoscalerFolderInformer constructs a new informer for AutoscalerFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAutoscalerFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAutoscalerFolderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAutoscalerFolderInformer constructs a new informer for AutoscalerFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAutoscalerFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AutoscalerFolders().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AutoscalerFolders().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AutoscalerFolder{}, + resyncPeriod, + indexers, + ) +} + +func (f *autoscalerFolderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAutoscalerFolderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *autoscalerFolderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AutoscalerFolder{}, f.defaultInformer) +} + +func (f *autoscalerFolderInformer) Lister() v1.AutoscalerFolderLister { + return v1.NewAutoscalerFolderLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/autoscalingpolicy.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/autoscalingpolicy.go new file mode 100644 index 000000000..45b42210b --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/autoscalingpolicy.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AutoscalingPolicyInformer provides access to a shared informer and lister for +// AutoscalingPolicies. +type AutoscalingPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AutoscalingPolicyLister +} + +type autoscalingPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAutoscalingPolicyInformer constructs a new informer for AutoscalingPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAutoscalingPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAutoscalingPolicyInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAutoscalingPolicyInformer constructs a new informer for AutoscalingPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAutoscalingPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AutoscalingPolicies().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AutoscalingPolicies().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AutoscalingPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *autoscalingPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAutoscalingPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *autoscalingPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AutoscalingPolicy{}, f.defaultInformer) +} + +func (f *autoscalingPolicyInformer) Lister() v1.AutoscalingPolicyLister { + return v1.NewAutoscalingPolicyLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/awsconnector.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/awsconnector.go new file mode 100644 index 000000000..1468f6acb --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/awsconnector.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AwsConnectorInformer provides access to a shared informer and lister for +// AwsConnectors. +type AwsConnectorInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AwsConnectorLister +} + +type awsConnectorInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAwsConnectorInformer constructs a new informer for AwsConnector type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAwsConnectorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAwsConnectorInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAwsConnectorInformer constructs a new informer for AwsConnector type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAwsConnectorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AwsConnectors().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().AwsConnectors().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.AwsConnector{}, + resyncPeriod, + indexers, + ) +} + +func (f *awsConnectorInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAwsConnectorInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *awsConnectorInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.AwsConnector{}, f.defaultInformer) +} + +func (f *awsConnectorInformer) Lister() v1.AwsConnectorLister { + return v1.NewAwsConnectorLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/bucket.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/bucket.go new file mode 100644 index 000000000..227cfa392 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/bucket.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// BucketInformer provides access to a shared informer and lister for +// Buckets. +type BucketInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.BucketLister +} + +type bucketInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewBucketInformer constructs a new informer for Bucket type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewBucketInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBucketInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredBucketInformer constructs a new informer for Bucket type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredBucketInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Buckets().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Buckets().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Bucket{}, + resyncPeriod, + indexers, + ) +} + +func (f *bucketInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredBucketInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *bucketInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Bucket{}, f.defaultInformer) +} + +func (f *bucketInformer) Lister() v1.BucketLister { + return v1.NewBucketLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/certificate.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/certificate.go new file mode 100644 index 000000000..cbe915786 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/certificate.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// CertificateInformer provides access to a shared informer and lister for +// Certificates. +type CertificateInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.CertificateLister +} + +type certificateInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewCertificateInformer constructs a new informer for Certificate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewCertificateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredCertificateInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredCertificateInformer constructs a new informer for Certificate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredCertificateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Certificates().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Certificates().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Certificate{}, + resyncPeriod, + indexers, + ) +} + +func (f *certificateInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredCertificateInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *certificateInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Certificate{}, f.defaultInformer) +} + +func (f *certificateInformer) Lister() v1.CertificateLister { + return v1.NewCertificateLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/certificateauthorityconfign.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/certificateauthorityconfign.go new file mode 100644 index 000000000..211a82f3f --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/certificateauthorityconfign.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// CertificateAuthorityConfigNInformer provides access to a shared informer and lister for +// CertificateAuthorityConfigNs. +type CertificateAuthorityConfigNInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.CertificateAuthorityConfigNLister +} + +type certificateAuthorityConfigNInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewCertificateAuthorityConfigNInformer constructs a new informer for CertificateAuthorityConfigN type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewCertificateAuthorityConfigNInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredCertificateAuthorityConfigNInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredCertificateAuthorityConfigNInformer constructs a new informer for CertificateAuthorityConfigN type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredCertificateAuthorityConfigNInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().CertificateAuthorityConfigNs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().CertificateAuthorityConfigNs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN{}, + resyncPeriod, + indexers, + ) +} + +func (f *certificateAuthorityConfigNInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredCertificateAuthorityConfigNInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *certificateAuthorityConfigNInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN{}, f.defaultInformer) +} + +func (f *certificateAuthorityConfigNInformer) Lister() v1.CertificateAuthorityConfigNLister { + return v1.NewCertificateAuthorityConfigNLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/certificateauthorityrt.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/certificateauthorityrt.go new file mode 100644 index 000000000..d80811a63 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/certificateauthorityrt.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// CertificateAuthorityRTInformer provides access to a shared informer and lister for +// CertificateAuthorityRTs. +type CertificateAuthorityRTInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.CertificateAuthorityRTLister +} + +type certificateAuthorityRTInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewCertificateAuthorityRTInformer constructs a new informer for CertificateAuthorityRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewCertificateAuthorityRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredCertificateAuthorityRTInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredCertificateAuthorityRTInformer constructs a new informer for CertificateAuthorityRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredCertificateAuthorityRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().CertificateAuthorityRTs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().CertificateAuthorityRTs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.CertificateAuthorityRT{}, + resyncPeriod, + indexers, + ) +} + +func (f *certificateAuthorityRTInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredCertificateAuthorityRTInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *certificateAuthorityRTInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.CertificateAuthorityRT{}, f.defaultInformer) +} + +func (f *certificateAuthorityRTInformer) Lister() v1.CertificateAuthorityRTLister { + return v1.NewCertificateAuthorityRTLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/certificateconfign.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/certificateconfign.go new file mode 100644 index 000000000..17c5d16f6 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/certificateconfign.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// CertificateConfigNInformer provides access to a shared informer and lister for +// CertificateConfigNs. +type CertificateConfigNInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.CertificateConfigNLister +} + +type certificateConfigNInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewCertificateConfigNInformer constructs a new informer for CertificateConfigN type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewCertificateConfigNInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredCertificateConfigNInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredCertificateConfigNInformer constructs a new informer for CertificateConfigN type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredCertificateConfigNInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().CertificateConfigNs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().CertificateConfigNs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.CertificateConfigN{}, + resyncPeriod, + indexers, + ) +} + +func (f *certificateConfigNInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredCertificateConfigNInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *certificateConfigNInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.CertificateConfigN{}, f.defaultInformer) +} + +func (f *certificateConfigNInformer) Lister() v1.CertificateConfigNLister { + return v1.NewCertificateConfigNLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/certificaterequest.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/certificaterequest.go new file mode 100644 index 000000000..5370b236d --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/certificaterequest.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// CertificateRequestInformer provides access to a shared informer and lister for +// CertificateRequests. +type CertificateRequestInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.CertificateRequestLister +} + +type certificateRequestInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewCertificateRequestInformer constructs a new informer for CertificateRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewCertificateRequestInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredCertificateRequestInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredCertificateRequestInformer constructs a new informer for CertificateRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredCertificateRequestInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().CertificateRequests().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().CertificateRequests().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.CertificateRequest{}, + resyncPeriod, + indexers, + ) +} + +func (f *certificateRequestInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredCertificateRequestInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *certificateRequestInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.CertificateRequest{}, f.defaultInformer) +} + +func (f *certificateRequestInformer) Lister() v1.CertificateRequestLister { + return v1.NewCertificateRequestLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/cluster.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/cluster.go new file mode 100644 index 000000000..9b72e800a --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/cluster.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ClusterInformer provides access to a shared informer and lister for +// Clusters. +type ClusterInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ClusterLister +} + +type clusterInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewClusterInformer constructs a new informer for Cluster type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewClusterInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredClusterInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredClusterInformer constructs a new informer for Cluster type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredClusterInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Clusters().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Clusters().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Cluster{}, + resyncPeriod, + indexers, + ) +} + +func (f *clusterInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredClusterInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *clusterInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Cluster{}, f.defaultInformer) +} + +func (f *clusterInformer) Lister() v1.ClusterLister { + return v1.NewClusterLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/clusterconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/clusterconfig.go new file mode 100644 index 000000000..07d6d897e --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/clusterconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ClusterConfigInformer provides access to a shared informer and lister for +// ClusterConfigs. +type ClusterConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ClusterConfigLister +} + +type clusterConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewClusterConfigInformer constructs a new informer for ClusterConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewClusterConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredClusterConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredClusterConfigInformer constructs a new informer for ClusterConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredClusterConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ClusterConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ClusterConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ClusterConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *clusterConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredClusterConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *clusterConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ClusterConfig{}, f.defaultInformer) +} + +func (f *clusterConfigInformer) Lister() v1.ClusterConfigLister { + return v1.NewClusterConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/clusterconfigfolder.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/clusterconfigfolder.go new file mode 100644 index 000000000..b6dbf31ef --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/clusterconfigfolder.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ClusterConfigFolderInformer provides access to a shared informer and lister for +// ClusterConfigFolders. +type ClusterConfigFolderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ClusterConfigFolderLister +} + +type clusterConfigFolderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewClusterConfigFolderInformer constructs a new informer for ClusterConfigFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewClusterConfigFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredClusterConfigFolderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredClusterConfigFolderInformer constructs a new informer for ClusterConfigFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredClusterConfigFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ClusterConfigFolders().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ClusterConfigFolders().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ClusterConfigFolder{}, + resyncPeriod, + indexers, + ) +} + +func (f *clusterConfigFolderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredClusterConfigFolderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *clusterConfigFolderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ClusterConfigFolder{}, f.defaultInformer) +} + +func (f *clusterConfigFolderInformer) Lister() v1.ClusterConfigFolderLister { + return v1.NewClusterConfigFolderLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/clusterfolder.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/clusterfolder.go new file mode 100644 index 000000000..10ac16c7d --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/clusterfolder.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ClusterFolderInformer provides access to a shared informer and lister for +// ClusterFolders. +type ClusterFolderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ClusterFolderLister +} + +type clusterFolderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewClusterFolderInformer constructs a new informer for ClusterFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewClusterFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredClusterFolderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredClusterFolderInformer constructs a new informer for ClusterFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredClusterFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ClusterFolders().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ClusterFolders().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ClusterFolder{}, + resyncPeriod, + indexers, + ) +} + +func (f *clusterFolderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredClusterFolderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *clusterFolderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ClusterFolder{}, f.defaultInformer) +} + +func (f *clusterFolderInformer) Lister() v1.ClusterFolderLister { + return v1.NewClusterFolderLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/clustersettings.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/clustersettings.go new file mode 100644 index 000000000..99fda453c --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/clustersettings.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ClusterSettingsInformer provides access to a shared informer and lister for +// ClusterSettingses. +type ClusterSettingsInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ClusterSettingsLister +} + +type clusterSettingsInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewClusterSettingsInformer constructs a new informer for ClusterSettings type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewClusterSettingsInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredClusterSettingsInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredClusterSettingsInformer constructs a new informer for ClusterSettings type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredClusterSettingsInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ClusterSettingses().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ClusterSettingses().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ClusterSettings{}, + resyncPeriod, + indexers, + ) +} + +func (f *clusterSettingsInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredClusterSettingsInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *clusterSettingsInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ClusterSettings{}, f.defaultInformer) +} + +func (f *clusterSettingsInformer) Lister() v1.ClusterSettingsLister { + return v1.NewClusterSettingsLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/config.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/config.go new file mode 100644 index 000000000..e95c7afca --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/config.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ConfigInformer provides access to a shared informer and lister for +// Configs. +type ConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ConfigLister +} + +type configInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewConfigInformer constructs a new informer for Config type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredConfigInformer constructs a new informer for Config type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Configs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Configs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Config{}, + resyncPeriod, + indexers, + ) +} + +func (f *configInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *configInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Config{}, f.defaultInformer) +} + +func (f *configInformer) Lister() v1.ConfigLister { + return v1.NewConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/configmap.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/configmap.go new file mode 100644 index 000000000..1fa14acaf --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/configmap.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ConfigMapInformer provides access to a shared informer and lister for +// ConfigMaps. +type ConfigMapInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ConfigMapLister +} + +type configMapInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewConfigMapInformer constructs a new informer for ConfigMap type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewConfigMapInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredConfigMapInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredConfigMapInformer constructs a new informer for ConfigMap type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredConfigMapInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ConfigMaps().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ConfigMaps().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ConfigMap{}, + resyncPeriod, + indexers, + ) +} + +func (f *configMapInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredConfigMapInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *configMapInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ConfigMap{}, f.defaultInformer) +} + +func (f *configMapInformer) Lister() v1.ConfigMapLister { + return v1.NewConfigMapLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/connectionstatus.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/connectionstatus.go new file mode 100644 index 000000000..06b608169 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/connectionstatus.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ConnectionStatusInformer provides access to a shared informer and lister for +// ConnectionStatuses. +type ConnectionStatusInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ConnectionStatusLister +} + +type connectionStatusInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewConnectionStatusInformer constructs a new informer for ConnectionStatus type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewConnectionStatusInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredConnectionStatusInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredConnectionStatusInformer constructs a new informer for ConnectionStatus type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredConnectionStatusInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ConnectionStatuses().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ConnectionStatuses().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ConnectionStatus{}, + resyncPeriod, + indexers, + ) +} + +func (f *connectionStatusInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredConnectionStatusInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *connectionStatusInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ConnectionStatus{}, f.defaultInformer) +} + +func (f *connectionStatusInformer) Lister() v1.ConnectionStatusLister { + return v1.NewConnectionStatusLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/database.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/database.go new file mode 100644 index 000000000..7fed379a1 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/database.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DatabaseInformer provides access to a shared informer and lister for +// Databases. +type DatabaseInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DatabaseLister +} + +type databaseInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDatabaseInformer constructs a new informer for Database type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDatabaseInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDatabaseInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDatabaseInformer constructs a new informer for Database type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDatabaseInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Databases().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Databases().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Database{}, + resyncPeriod, + indexers, + ) +} + +func (f *databaseInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDatabaseInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *databaseInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Database{}, f.defaultInformer) +} + +func (f *databaseInformer) Lister() v1.DatabaseLister { + return v1.NewDatabaseLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datafolder.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datafolder.go new file mode 100644 index 000000000..85b4a6921 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datafolder.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DataFolderInformer provides access to a shared informer and lister for +// DataFolders. +type DataFolderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DataFolderLister +} + +type dataFolderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDataFolderInformer constructs a new informer for DataFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDataFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDataFolderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDataFolderInformer constructs a new informer for DataFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDataFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DataFolders().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DataFolders().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.DataFolder{}, + resyncPeriod, + indexers, + ) +} + +func (f *dataFolderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDataFolderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *dataFolderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.DataFolder{}, f.defaultInformer) +} + +func (f *dataFolderInformer) Lister() v1.DataFolderLister { + return v1.NewDataFolderLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datafolderdomain.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datafolderdomain.go new file mode 100644 index 000000000..6711f86d5 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datafolderdomain.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DataFolderDomainInformer provides access to a shared informer and lister for +// DataFolderDomains. +type DataFolderDomainInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DataFolderDomainLister +} + +type dataFolderDomainInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDataFolderDomainInformer constructs a new informer for DataFolderDomain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDataFolderDomainInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDataFolderDomainInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDataFolderDomainInformer constructs a new informer for DataFolderDomain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDataFolderDomainInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DataFolderDomains().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DataFolderDomains().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.DataFolderDomain{}, + resyncPeriod, + indexers, + ) +} + +func (f *dataFolderDomainInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDataFolderDomainInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *dataFolderDomainInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.DataFolderDomain{}, f.defaultInformer) +} + +func (f *dataFolderDomainInformer) Lister() v1.DataFolderDomainLister { + return v1.NewDataFolderDomainLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datafolderdomaincluster.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datafolderdomaincluster.go new file mode 100644 index 000000000..c5c12b5c3 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datafolderdomaincluster.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DataFolderDomainClusterInformer provides access to a shared informer and lister for +// DataFolderDomainClusters. +type DataFolderDomainClusterInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DataFolderDomainClusterLister +} + +type dataFolderDomainClusterInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDataFolderDomainClusterInformer constructs a new informer for DataFolderDomainCluster type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDataFolderDomainClusterInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDataFolderDomainClusterInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDataFolderDomainClusterInformer constructs a new informer for DataFolderDomainCluster type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDataFolderDomainClusterInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DataFolderDomainClusters().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DataFolderDomainClusters().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.DataFolderDomainCluster{}, + resyncPeriod, + indexers, + ) +} + +func (f *dataFolderDomainClusterInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDataFolderDomainClusterInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *dataFolderDomainClusterInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.DataFolderDomainCluster{}, f.defaultInformer) +} + +func (f *dataFolderDomainClusterInformer) Lister() v1.DataFolderDomainClusterLister { + return v1.NewDataFolderDomainClusterLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datafolderdomainservice.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datafolderdomainservice.go new file mode 100644 index 000000000..7f1cd8b7e --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datafolderdomainservice.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DataFolderDomainServiceInformer provides access to a shared informer and lister for +// DataFolderDomainServices. +type DataFolderDomainServiceInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DataFolderDomainServiceLister +} + +type dataFolderDomainServiceInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDataFolderDomainServiceInformer constructs a new informer for DataFolderDomainService type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDataFolderDomainServiceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDataFolderDomainServiceInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDataFolderDomainServiceInformer constructs a new informer for DataFolderDomainService type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDataFolderDomainServiceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DataFolderDomainServices().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DataFolderDomainServices().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.DataFolderDomainService{}, + resyncPeriod, + indexers, + ) +} + +func (f *dataFolderDomainServiceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDataFolderDomainServiceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *dataFolderDomainServiceInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.DataFolderDomainService{}, f.defaultInformer) +} + +func (f *dataFolderDomainServiceInformer) Lister() v1.DataFolderDomainServiceLister { + return v1.NewDataFolderDomainServiceLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datafolderdomainserviceversion.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datafolderdomainserviceversion.go new file mode 100644 index 000000000..7345567a4 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datafolderdomainserviceversion.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DataFolderDomainServiceVersionInformer provides access to a shared informer and lister for +// DataFolderDomainServiceVersions. +type DataFolderDomainServiceVersionInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DataFolderDomainServiceVersionLister +} + +type dataFolderDomainServiceVersionInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDataFolderDomainServiceVersionInformer constructs a new informer for DataFolderDomainServiceVersion type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDataFolderDomainServiceVersionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDataFolderDomainServiceVersionInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDataFolderDomainServiceVersionInformer constructs a new informer for DataFolderDomainServiceVersion type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDataFolderDomainServiceVersionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DataFolderDomainServiceVersions().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DataFolderDomainServiceVersions().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion{}, + resyncPeriod, + indexers, + ) +} + +func (f *dataFolderDomainServiceVersionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDataFolderDomainServiceVersionInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *dataFolderDomainServiceVersionInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion{}, f.defaultInformer) +} + +func (f *dataFolderDomainServiceVersionInformer) Lister() v1.DataFolderDomainServiceVersionLister { + return v1.NewDataFolderDomainServiceVersionLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datagroup.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datagroup.go new file mode 100644 index 000000000..5b058593a --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datagroup.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DataGroupInformer provides access to a shared informer and lister for +// DataGroups. +type DataGroupInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DataGroupLister +} + +type dataGroupInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDataGroupInformer constructs a new informer for DataGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDataGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDataGroupInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDataGroupInformer constructs a new informer for DataGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDataGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DataGroups().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DataGroups().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.DataGroup{}, + resyncPeriod, + indexers, + ) +} + +func (f *dataGroupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDataGroupInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *dataGroupInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.DataGroup{}, f.defaultInformer) +} + +func (f *dataGroupInformer) Lister() v1.DataGroupLister { + return v1.NewDataGroupLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datatemplate.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datatemplate.go new file mode 100644 index 000000000..edc5dc144 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/datatemplate.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DataTemplateInformer provides access to a shared informer and lister for +// DataTemplates. +type DataTemplateInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DataTemplateLister +} + +type dataTemplateInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDataTemplateInformer constructs a new informer for DataTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDataTemplateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDataTemplateInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDataTemplateInformer constructs a new informer for DataTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDataTemplateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DataTemplates().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DataTemplates().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.DataTemplate{}, + resyncPeriod, + indexers, + ) +} + +func (f *dataTemplateInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDataTemplateInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *dataTemplateInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.DataTemplate{}, f.defaultInformer) +} + +func (f *dataTemplateInformer) Lister() v1.DataTemplateLister { + return v1.NewDataTemplateLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dcregion.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dcregion.go new file mode 100644 index 000000000..cbd796103 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dcregion.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DCRegionInformer provides access to a shared informer and lister for +// DCRegions. +type DCRegionInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DCRegionLister +} + +type dCRegionInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDCRegionInformer constructs a new informer for DCRegion type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDCRegionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDCRegionInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDCRegionInformer constructs a new informer for DCRegion type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDCRegionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DCRegions().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DCRegions().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.DCRegion{}, + resyncPeriod, + indexers, + ) +} + +func (f *dCRegionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDCRegionInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *dCRegionInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.DCRegion{}, f.defaultInformer) +} + +func (f *dCRegionInformer) Lister() v1.DCRegionLister { + return v1.NewDCRegionLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dczone.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dczone.go new file mode 100644 index 000000000..9ab8a398b --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dczone.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DCZoneInformer provides access to a shared informer and lister for +// DCZones. +type DCZoneInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DCZoneLister +} + +type dCZoneInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDCZoneInformer constructs a new informer for DCZone type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDCZoneInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDCZoneInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDCZoneInformer constructs a new informer for DCZone type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDCZoneInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DCZones().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DCZones().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.DCZone{}, + resyncPeriod, + indexers, + ) +} + +func (f *dCZoneInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDCZoneInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *dCZoneInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.DCZone{}, f.defaultInformer) +} + +func (f *dCZoneInformer) Lister() v1.DCZoneLister { + return v1.NewDCZoneLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/destinationrule.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/destinationrule.go new file mode 100644 index 000000000..11815a960 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/destinationrule.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DestinationRuleInformer provides access to a shared informer and lister for +// DestinationRules. +type DestinationRuleInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DestinationRuleLister +} + +type destinationRuleInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDestinationRuleInformer constructs a new informer for DestinationRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDestinationRuleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDestinationRuleInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDestinationRuleInformer constructs a new informer for DestinationRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDestinationRuleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DestinationRules().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DestinationRules().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.DestinationRule{}, + resyncPeriod, + indexers, + ) +} + +func (f *destinationRuleInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDestinationRuleInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *destinationRuleInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.DestinationRule{}, f.defaultInformer) +} + +func (f *destinationRuleInformer) Lister() v1.DestinationRuleLister { + return v1.NewDestinationRuleLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/directory.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/directory.go new file mode 100644 index 000000000..05f658a0c --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/directory.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DirectoryInformer provides access to a shared informer and lister for +// Directories. +type DirectoryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DirectoryLister +} + +type directoryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDirectoryInformer constructs a new informer for Directory type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDirectoryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDirectoryInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDirectoryInformer constructs a new informer for Directory type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDirectoryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Directories().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Directories().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Directory{}, + resyncPeriod, + indexers, + ) +} + +func (f *directoryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDirectoryInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *directoryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Directory{}, f.defaultInformer) +} + +func (f *directoryInformer) Lister() v1.DirectoryLister { + return v1.NewDirectoryLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dnsconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dnsconfig.go new file mode 100644 index 000000000..b609dbb3b --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dnsconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DNSConfigInformer provides access to a shared informer and lister for +// DNSConfigs. +type DNSConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DNSConfigLister +} + +type dNSConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDNSConfigInformer constructs a new informer for DNSConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDNSConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDNSConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDNSConfigInformer constructs a new informer for DNSConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDNSConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DNSConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DNSConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.DNSConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *dNSConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDNSConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *dNSConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.DNSConfig{}, f.defaultInformer) +} + +func (f *dNSConfigInformer) Lister() v1.DNSConfigLister { + return v1.NewDNSConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dnsconfigfolder.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dnsconfigfolder.go new file mode 100644 index 000000000..510f8de75 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dnsconfigfolder.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DNSConfigFolderInformer provides access to a shared informer and lister for +// DNSConfigFolders. +type DNSConfigFolderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DNSConfigFolderLister +} + +type dNSConfigFolderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDNSConfigFolderInformer constructs a new informer for DNSConfigFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDNSConfigFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDNSConfigFolderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDNSConfigFolderInformer constructs a new informer for DNSConfigFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDNSConfigFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DNSConfigFolders().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DNSConfigFolders().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.DNSConfigFolder{}, + resyncPeriod, + indexers, + ) +} + +func (f *dNSConfigFolderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDNSConfigFolderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *dNSConfigFolderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.DNSConfigFolder{}, f.defaultInformer) +} + +func (f *dNSConfigFolderInformer) Lister() v1.DNSConfigFolderLister { + return v1.NewDNSConfigFolderLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dnsprobeconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dnsprobeconfig.go new file mode 100644 index 000000000..7e60f2314 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dnsprobeconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DNSProbeConfigInformer provides access to a shared informer and lister for +// DNSProbeConfigs. +type DNSProbeConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DNSProbeConfigLister +} + +type dNSProbeConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDNSProbeConfigInformer constructs a new informer for DNSProbeConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDNSProbeConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDNSProbeConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDNSProbeConfigInformer constructs a new informer for DNSProbeConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDNSProbeConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DNSProbeConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DNSProbeConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.DNSProbeConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *dNSProbeConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDNSProbeConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *dNSProbeConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.DNSProbeConfig{}, f.defaultInformer) +} + +func (f *dNSProbeConfigInformer) Lister() v1.DNSProbeConfigLister { + return v1.NewDNSProbeConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dnsprobesconfigfolder.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dnsprobesconfigfolder.go new file mode 100644 index 000000000..355c44818 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dnsprobesconfigfolder.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DNSProbesConfigFolderInformer provides access to a shared informer and lister for +// DNSProbesConfigFolders. +type DNSProbesConfigFolderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DNSProbesConfigFolderLister +} + +type dNSProbesConfigFolderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDNSProbesConfigFolderInformer constructs a new informer for DNSProbesConfigFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDNSProbesConfigFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDNSProbesConfigFolderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDNSProbesConfigFolderInformer constructs a new informer for DNSProbesConfigFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDNSProbesConfigFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DNSProbesConfigFolders().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DNSProbesConfigFolders().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.DNSProbesConfigFolder{}, + resyncPeriod, + indexers, + ) +} + +func (f *dNSProbesConfigFolderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDNSProbesConfigFolderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *dNSProbesConfigFolderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.DNSProbesConfigFolder{}, f.defaultInformer) +} + +func (f *dNSProbesConfigFolderInformer) Lister() v1.DNSProbesConfigFolderLister { + return v1.NewDNSProbesConfigFolderLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dnsprobestatus.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dnsprobestatus.go new file mode 100644 index 000000000..fa84fa52b --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/dnsprobestatus.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DNSProbeStatusInformer provides access to a shared informer and lister for +// DNSProbeStatuses. +type DNSProbeStatusInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DNSProbeStatusLister +} + +type dNSProbeStatusInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDNSProbeStatusInformer constructs a new informer for DNSProbeStatus type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDNSProbeStatusInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDNSProbeStatusInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDNSProbeStatusInformer constructs a new informer for DNSProbeStatus type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDNSProbeStatusInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DNSProbeStatuses().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DNSProbeStatuses().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.DNSProbeStatus{}, + resyncPeriod, + indexers, + ) +} + +func (f *dNSProbeStatusInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDNSProbeStatusInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *dNSProbeStatusInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.DNSProbeStatus{}, f.defaultInformer) +} + +func (f *dNSProbeStatusInformer) Lister() v1.DNSProbeStatusLister { + return v1.NewDNSProbeStatusLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/domain.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/domain.go new file mode 100644 index 000000000..7dc321c3f --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/domain.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DomainInformer provides access to a shared informer and lister for +// Domains. +type DomainInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DomainLister +} + +type domainInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDomainInformer constructs a new informer for Domain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDomainInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDomainInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDomainInformer constructs a new informer for Domain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDomainInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Domains().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Domains().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Domain{}, + resyncPeriod, + indexers, + ) +} + +func (f *domainInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDomainInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *domainInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Domain{}, f.defaultInformer) +} + +func (f *domainInformer) Lister() v1.DomainLister { + return v1.NewDomainLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/domainconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/domainconfig.go new file mode 100644 index 000000000..b736573b0 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/domainconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DomainConfigInformer provides access to a shared informer and lister for +// DomainConfigs. +type DomainConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DomainConfigLister +} + +type domainConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDomainConfigInformer constructs a new informer for DomainConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDomainConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDomainConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDomainConfigInformer constructs a new informer for DomainConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDomainConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DomainConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().DomainConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.DomainConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *domainConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDomainConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *domainConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.DomainConfig{}, f.defaultInformer) +} + +func (f *domainConfigInformer) Lister() v1.DomainConfigLister { + return v1.NewDomainConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/endpoints.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/endpoints.go new file mode 100644 index 000000000..7ab72f73e --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/endpoints.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// EndpointsInformer provides access to a shared informer and lister for +// Endpoints. +type EndpointsInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.EndpointsLister +} + +type endpointsInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewEndpointsInformer constructs a new informer for Endpoints type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewEndpointsInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredEndpointsInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredEndpointsInformer constructs a new informer for Endpoints type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredEndpointsInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Endpoints().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Endpoints().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Endpoints{}, + resyncPeriod, + indexers, + ) +} + +func (f *endpointsInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredEndpointsInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *endpointsInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Endpoints{}, f.defaultInformer) +} + +func (f *endpointsInformer) Lister() v1.EndpointsLister { + return v1.NewEndpointsLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/envoyfilter.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/envoyfilter.go new file mode 100644 index 000000000..a167e21ee --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/envoyfilter.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// EnvoyFilterInformer provides access to a shared informer and lister for +// EnvoyFilters. +type EnvoyFilterInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.EnvoyFilterLister +} + +type envoyFilterInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewEnvoyFilterInformer constructs a new informer for EnvoyFilter type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewEnvoyFilterInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredEnvoyFilterInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredEnvoyFilterInformer constructs a new informer for EnvoyFilter type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredEnvoyFilterInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().EnvoyFilters().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().EnvoyFilters().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.EnvoyFilter{}, + resyncPeriod, + indexers, + ) +} + +func (f *envoyFilterInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredEnvoyFilterInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *envoyFilterInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.EnvoyFilter{}, f.defaultInformer) +} + +func (f *envoyFilterInformer) Lister() v1.EnvoyFilterLister { + return v1.NewEnvoyFilterLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalaccountconfign.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalaccountconfign.go new file mode 100644 index 000000000..809682b09 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalaccountconfign.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalAccountConfigNInformer provides access to a shared informer and lister for +// ExternalAccountConfigNs. +type ExternalAccountConfigNInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalAccountConfigNLister +} + +type externalAccountConfigNInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalAccountConfigNInformer constructs a new informer for ExternalAccountConfigN type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalAccountConfigNInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalAccountConfigNInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalAccountConfigNInformer constructs a new informer for ExternalAccountConfigN type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalAccountConfigNInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalAccountConfigNs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalAccountConfigNs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalAccountConfigN{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalAccountConfigNInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalAccountConfigNInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalAccountConfigNInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalAccountConfigN{}, f.defaultInformer) +} + +func (f *externalAccountConfigNInformer) Lister() v1.ExternalAccountConfigNLister { + return v1.NewExternalAccountConfigNLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalauditstorage.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalauditstorage.go new file mode 100644 index 000000000..ea1d1ab91 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalauditstorage.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalAuditStorageInformer provides access to a shared informer and lister for +// ExternalAuditStorages. +type ExternalAuditStorageInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalAuditStorageLister +} + +type externalAuditStorageInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalAuditStorageInformer constructs a new informer for ExternalAuditStorage type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalAuditStorageInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalAuditStorageInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalAuditStorageInformer constructs a new informer for ExternalAuditStorage type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalAuditStorageInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalAuditStorages().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalAuditStorages().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalAuditStorage{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalAuditStorageInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalAuditStorageInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalAuditStorageInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalAuditStorage{}, f.defaultInformer) +} + +func (f *externalAuditStorageInformer) Lister() v1.ExternalAuditStorageLister { + return v1.NewExternalAuditStorageLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsconfign.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsconfign.go new file mode 100644 index 000000000..d01060c40 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsconfign.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalDNSConfigNInformer provides access to a shared informer and lister for +// ExternalDNSConfigNs. +type ExternalDNSConfigNInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalDNSConfigNLister +} + +type externalDNSConfigNInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalDNSConfigNInformer constructs a new informer for ExternalDNSConfigN type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalDNSConfigNInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalDNSConfigNInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalDNSConfigNInformer constructs a new informer for ExternalDNSConfigN type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalDNSConfigNInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSConfigNs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSConfigNs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalDNSConfigN{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalDNSConfigNInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalDNSConfigNInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalDNSConfigNInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalDNSConfigN{}, f.defaultInformer) +} + +func (f *externalDNSConfigNInformer) Lister() v1.ExternalDNSConfigNLister { + return v1.NewExternalDNSConfigNLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsinventory.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsinventory.go new file mode 100644 index 000000000..3b943a195 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsinventory.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalDNSInventoryInformer provides access to a shared informer and lister for +// ExternalDNSInventories. +type ExternalDNSInventoryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalDNSInventoryLister +} + +type externalDNSInventoryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalDNSInventoryInformer constructs a new informer for ExternalDNSInventory type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalDNSInventoryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalDNSInventoryInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalDNSInventoryInformer constructs a new informer for ExternalDNSInventory type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalDNSInventoryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSInventories().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSInventories().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalDNSInventory{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalDNSInventoryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalDNSInventoryInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalDNSInventoryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalDNSInventory{}, f.defaultInformer) +} + +func (f *externalDNSInventoryInformer) Lister() v1.ExternalDNSInventoryLister { + return v1.NewExternalDNSInventoryLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryhealthcheck.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryhealthcheck.go new file mode 100644 index 000000000..d37bfeb43 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryhealthcheck.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalDNSInventoryHealthCheckInformer provides access to a shared informer and lister for +// ExternalDNSInventoryHealthChecks. +type ExternalDNSInventoryHealthCheckInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalDNSInventoryHealthCheckLister +} + +type externalDNSInventoryHealthCheckInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalDNSInventoryHealthCheckInformer constructs a new informer for ExternalDNSInventoryHealthCheck type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalDNSInventoryHealthCheckInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalDNSInventoryHealthCheckInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalDNSInventoryHealthCheckInformer constructs a new informer for ExternalDNSInventoryHealthCheck type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalDNSInventoryHealthCheckInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSInventoryHealthChecks().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSInventoryHealthChecks().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalDNSInventoryHealthCheckInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalDNSInventoryHealthCheckInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalDNSInventoryHealthCheckInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck{}, f.defaultInformer) +} + +func (f *externalDNSInventoryHealthCheckInformer) Lister() v1.ExternalDNSInventoryHealthCheckLister { + return v1.NewExternalDNSInventoryHealthCheckLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryprimarydomain.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryprimarydomain.go new file mode 100644 index 000000000..82bcbf0c3 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryprimarydomain.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalDNSInventoryPrimaryDomainInformer provides access to a shared informer and lister for +// ExternalDNSInventoryPrimaryDomains. +type ExternalDNSInventoryPrimaryDomainInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalDNSInventoryPrimaryDomainLister +} + +type externalDNSInventoryPrimaryDomainInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalDNSInventoryPrimaryDomainInformer constructs a new informer for ExternalDNSInventoryPrimaryDomain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalDNSInventoryPrimaryDomainInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalDNSInventoryPrimaryDomainInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalDNSInventoryPrimaryDomainInformer constructs a new informer for ExternalDNSInventoryPrimaryDomain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalDNSInventoryPrimaryDomainInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSInventoryPrimaryDomains().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSInventoryPrimaryDomains().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalDNSInventoryPrimaryDomainInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalDNSInventoryPrimaryDomainInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalDNSInventoryPrimaryDomainInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain{}, f.defaultInformer) +} + +func (f *externalDNSInventoryPrimaryDomainInformer) Lister() v1.ExternalDNSInventoryPrimaryDomainLister { + return v1.NewExternalDNSInventoryPrimaryDomainLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryrecord.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryrecord.go new file mode 100644 index 000000000..65b376b89 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryrecord.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalDNSInventoryRecordInformer provides access to a shared informer and lister for +// ExternalDNSInventoryRecords. +type ExternalDNSInventoryRecordInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalDNSInventoryRecordLister +} + +type externalDNSInventoryRecordInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalDNSInventoryRecordInformer constructs a new informer for ExternalDNSInventoryRecord type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalDNSInventoryRecordInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalDNSInventoryRecordInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalDNSInventoryRecordInformer constructs a new informer for ExternalDNSInventoryRecord type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalDNSInventoryRecordInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSInventoryRecords().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSInventoryRecords().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalDNSInventoryRecordInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalDNSInventoryRecordInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalDNSInventoryRecordInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord{}, f.defaultInformer) +} + +func (f *externalDNSInventoryRecordInformer) Lister() v1.ExternalDNSInventoryRecordLister { + return v1.NewExternalDNSInventoryRecordLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryzone.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryzone.go new file mode 100644 index 000000000..4d02dbdfd --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryzone.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalDNSInventoryZoneInformer provides access to a shared informer and lister for +// ExternalDNSInventoryZones. +type ExternalDNSInventoryZoneInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalDNSInventoryZoneLister +} + +type externalDNSInventoryZoneInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalDNSInventoryZoneInformer constructs a new informer for ExternalDNSInventoryZone type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalDNSInventoryZoneInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalDNSInventoryZoneInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalDNSInventoryZoneInformer constructs a new informer for ExternalDNSInventoryZone type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalDNSInventoryZoneInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSInventoryZones().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSInventoryZones().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalDNSInventoryZoneInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalDNSInventoryZoneInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalDNSInventoryZoneInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone{}, f.defaultInformer) +} + +func (f *externalDNSInventoryZoneInformer) Lister() v1.ExternalDNSInventoryZoneLister { + return v1.NewExternalDNSInventoryZoneLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsruntime.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsruntime.go new file mode 100644 index 000000000..13e4404d9 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsruntime.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalDNSRuntimeInformer provides access to a shared informer and lister for +// ExternalDNSRuntimes. +type ExternalDNSRuntimeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalDNSRuntimeLister +} + +type externalDNSRuntimeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalDNSRuntimeInformer constructs a new informer for ExternalDNSRuntime type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalDNSRuntimeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalDNSRuntimeInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalDNSRuntimeInformer constructs a new informer for ExternalDNSRuntime type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalDNSRuntimeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSRuntimes().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSRuntimes().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalDNSRuntime{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalDNSRuntimeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalDNSRuntimeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalDNSRuntimeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalDNSRuntime{}, f.defaultInformer) +} + +func (f *externalDNSRuntimeInformer) Lister() v1.ExternalDNSRuntimeLister { + return v1.NewExternalDNSRuntimeLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeendpoint.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeendpoint.go new file mode 100644 index 000000000..d4930b1ae --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeendpoint.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalDNSRuntimeEndpointInformer provides access to a shared informer and lister for +// ExternalDNSRuntimeEndpoints. +type ExternalDNSRuntimeEndpointInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalDNSRuntimeEndpointLister +} + +type externalDNSRuntimeEndpointInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalDNSRuntimeEndpointInformer constructs a new informer for ExternalDNSRuntimeEndpoint type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalDNSRuntimeEndpointInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalDNSRuntimeEndpointInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalDNSRuntimeEndpointInformer constructs a new informer for ExternalDNSRuntimeEndpoint type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalDNSRuntimeEndpointInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSRuntimeEndpoints().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSRuntimeEndpoints().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalDNSRuntimeEndpointInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalDNSRuntimeEndpointInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalDNSRuntimeEndpointInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint{}, f.defaultInformer) +} + +func (f *externalDNSRuntimeEndpointInformer) Lister() v1.ExternalDNSRuntimeEndpointLister { + return v1.NewExternalDNSRuntimeEndpointLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeprimarydomain.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeprimarydomain.go new file mode 100644 index 000000000..d7be1fe9a --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeprimarydomain.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalDNSRuntimePrimaryDomainInformer provides access to a shared informer and lister for +// ExternalDNSRuntimePrimaryDomains. +type ExternalDNSRuntimePrimaryDomainInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalDNSRuntimePrimaryDomainLister +} + +type externalDNSRuntimePrimaryDomainInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalDNSRuntimePrimaryDomainInformer constructs a new informer for ExternalDNSRuntimePrimaryDomain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalDNSRuntimePrimaryDomainInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalDNSRuntimePrimaryDomainInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalDNSRuntimePrimaryDomainInformer constructs a new informer for ExternalDNSRuntimePrimaryDomain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalDNSRuntimePrimaryDomainInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSRuntimePrimaryDomains().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSRuntimePrimaryDomains().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalDNSRuntimePrimaryDomainInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalDNSRuntimePrimaryDomainInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalDNSRuntimePrimaryDomainInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain{}, f.defaultInformer) +} + +func (f *externalDNSRuntimePrimaryDomainInformer) Lister() v1.ExternalDNSRuntimePrimaryDomainLister { + return v1.NewExternalDNSRuntimePrimaryDomainLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsruntimesubdomain.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsruntimesubdomain.go new file mode 100644 index 000000000..fc31bcaaa --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externaldnsruntimesubdomain.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalDNSRuntimeSubdomainInformer provides access to a shared informer and lister for +// ExternalDNSRuntimeSubdomains. +type ExternalDNSRuntimeSubdomainInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalDNSRuntimeSubdomainLister +} + +type externalDNSRuntimeSubdomainInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalDNSRuntimeSubdomainInformer constructs a new informer for ExternalDNSRuntimeSubdomain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalDNSRuntimeSubdomainInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalDNSRuntimeSubdomainInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalDNSRuntimeSubdomainInformer constructs a new informer for ExternalDNSRuntimeSubdomain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalDNSRuntimeSubdomainInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSRuntimeSubdomains().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalDNSRuntimeSubdomains().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalDNSRuntimeSubdomainInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalDNSRuntimeSubdomainInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalDNSRuntimeSubdomainInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain{}, f.defaultInformer) +} + +func (f *externalDNSRuntimeSubdomainInformer) Lister() v1.ExternalDNSRuntimeSubdomainLister { + return v1.NewExternalDNSRuntimeSubdomainLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externallbconfign.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externallbconfign.go new file mode 100644 index 000000000..030d9bfd8 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externallbconfign.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalLBConfigNInformer provides access to a shared informer and lister for +// ExternalLBConfigNs. +type ExternalLBConfigNInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalLBConfigNLister +} + +type externalLBConfigNInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalLBConfigNInformer constructs a new informer for ExternalLBConfigN type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalLBConfigNInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalLBConfigNInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalLBConfigNInformer constructs a new informer for ExternalLBConfigN type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalLBConfigNInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalLBConfigNs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalLBConfigNs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalLBConfigN{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalLBConfigNInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalLBConfigNInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalLBConfigNInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalLBConfigN{}, f.defaultInformer) +} + +func (f *externalLBConfigNInformer) Lister() v1.ExternalLBConfigNLister { + return v1.NewExternalLBConfigNLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalplugincapability.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalplugincapability.go new file mode 100644 index 000000000..5f96af616 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalplugincapability.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalPluginCapabilityInformer provides access to a shared informer and lister for +// ExternalPluginCapabilities. +type ExternalPluginCapabilityInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalPluginCapabilityLister +} + +type externalPluginCapabilityInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalPluginCapabilityInformer constructs a new informer for ExternalPluginCapability type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalPluginCapabilityInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalPluginCapabilityInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalPluginCapabilityInformer constructs a new informer for ExternalPluginCapability type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalPluginCapabilityInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalPluginCapabilities().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalPluginCapabilities().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalPluginCapability{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalPluginCapabilityInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalPluginCapabilityInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalPluginCapabilityInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalPluginCapability{}, f.defaultInformer) +} + +func (f *externalPluginCapabilityInformer) Lister() v1.ExternalPluginCapabilityLister { + return v1.NewExternalPluginCapabilityLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalpluginconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalpluginconfig.go new file mode 100644 index 000000000..91b667538 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalpluginconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalPluginConfigInformer provides access to a shared informer and lister for +// ExternalPluginConfigs. +type ExternalPluginConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalPluginConfigLister +} + +type externalPluginConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalPluginConfigInformer constructs a new informer for ExternalPluginConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalPluginConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalPluginConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalPluginConfigInformer constructs a new informer for ExternalPluginConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalPluginConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalPluginConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalPluginConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalPluginConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalPluginConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalPluginConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalPluginConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalPluginConfig{}, f.defaultInformer) +} + +func (f *externalPluginConfigInformer) Lister() v1.ExternalPluginConfigLister { + return v1.NewExternalPluginConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalpluginconfigfolder.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalpluginconfigfolder.go new file mode 100644 index 000000000..329f3d631 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalpluginconfigfolder.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalPluginConfigFolderInformer provides access to a shared informer and lister for +// ExternalPluginConfigFolders. +type ExternalPluginConfigFolderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalPluginConfigFolderLister +} + +type externalPluginConfigFolderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalPluginConfigFolderInformer constructs a new informer for ExternalPluginConfigFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalPluginConfigFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalPluginConfigFolderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalPluginConfigFolderInformer constructs a new informer for ExternalPluginConfigFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalPluginConfigFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalPluginConfigFolders().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalPluginConfigFolders().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalPluginConfigFolderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalPluginConfigFolderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalPluginConfigFolderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder{}, f.defaultInformer) +} + +func (f *externalPluginConfigFolderInformer) Lister() v1.ExternalPluginConfigFolderLister { + return v1.NewExternalPluginConfigFolderLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalplugininstanceconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalplugininstanceconfig.go new file mode 100644 index 000000000..37b581461 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalplugininstanceconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalPluginInstanceConfigInformer provides access to a shared informer and lister for +// ExternalPluginInstanceConfigs. +type ExternalPluginInstanceConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalPluginInstanceConfigLister +} + +type externalPluginInstanceConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalPluginInstanceConfigInformer constructs a new informer for ExternalPluginInstanceConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalPluginInstanceConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalPluginInstanceConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalPluginInstanceConfigInformer constructs a new informer for ExternalPluginInstanceConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalPluginInstanceConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalPluginInstanceConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalPluginInstanceConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalPluginInstanceConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalPluginInstanceConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalPluginInstanceConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig{}, f.defaultInformer) +} + +func (f *externalPluginInstanceConfigInformer) Lister() v1.ExternalPluginInstanceConfigLister { + return v1.NewExternalPluginInstanceConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalpluginmonitor.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalpluginmonitor.go new file mode 100644 index 000000000..7b936c9de --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalpluginmonitor.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalPluginMonitorInformer provides access to a shared informer and lister for +// ExternalPluginMonitors. +type ExternalPluginMonitorInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalPluginMonitorLister +} + +type externalPluginMonitorInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalPluginMonitorInformer constructs a new informer for ExternalPluginMonitor type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalPluginMonitorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalPluginMonitorInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalPluginMonitorInformer constructs a new informer for ExternalPluginMonitor type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalPluginMonitorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalPluginMonitors().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalPluginMonitors().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalPluginMonitor{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalPluginMonitorInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalPluginMonitorInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalPluginMonitorInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalPluginMonitor{}, f.defaultInformer) +} + +func (f *externalPluginMonitorInformer) Lister() v1.ExternalPluginMonitorLister { + return v1.NewExternalPluginMonitorLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalserviceconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalserviceconfig.go new file mode 100644 index 000000000..299af7110 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalserviceconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalServiceConfigInformer provides access to a shared informer and lister for +// ExternalServiceConfigs. +type ExternalServiceConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalServiceConfigLister +} + +type externalServiceConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalServiceConfigInformer constructs a new informer for ExternalServiceConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalServiceConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalServiceConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalServiceConfigInformer constructs a new informer for ExternalServiceConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalServiceConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalServiceConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalServiceConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalServiceConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalServiceConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalServiceConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalServiceConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalServiceConfig{}, f.defaultInformer) +} + +func (f *externalServiceConfigInformer) Lister() v1.ExternalServiceConfigLister { + return v1.NewExternalServiceConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalservicesrt.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalservicesrt.go new file mode 100644 index 000000000..a71b4750f --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/externalservicesrt.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExternalServicesRTInformer provides access to a shared informer and lister for +// ExternalServicesRTs. +type ExternalServicesRTInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ExternalServicesRTLister +} + +type externalServicesRTInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewExternalServicesRTInformer constructs a new informer for ExternalServicesRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExternalServicesRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExternalServicesRTInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredExternalServicesRTInformer constructs a new informer for ExternalServicesRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExternalServicesRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalServicesRTs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ExternalServicesRTs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ExternalServicesRT{}, + resyncPeriod, + indexers, + ) +} + +func (f *externalServicesRTInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExternalServicesRTInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *externalServicesRTInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ExternalServicesRT{}, f.defaultInformer) +} + +func (f *externalServicesRTInformer) Lister() v1.ExternalServicesRTLister { + return v1.NewExternalServicesRTLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/featureflag.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/featureflag.go new file mode 100644 index 000000000..4f2daa00b --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/featureflag.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// FeatureFlagInformer provides access to a shared informer and lister for +// FeatureFlags. +type FeatureFlagInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.FeatureFlagLister +} + +type featureFlagInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewFeatureFlagInformer constructs a new informer for FeatureFlag type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFeatureFlagInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredFeatureFlagInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredFeatureFlagInformer constructs a new informer for FeatureFlag type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredFeatureFlagInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().FeatureFlags().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().FeatureFlags().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.FeatureFlag{}, + resyncPeriod, + indexers, + ) +} + +func (f *featureFlagInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredFeatureFlagInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *featureFlagInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.FeatureFlag{}, f.defaultInformer) +} + +func (f *featureFlagInformer) Lister() v1.FeatureFlagLister { + return v1.NewFeatureFlagLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/federatedsloconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/federatedsloconfig.go new file mode 100644 index 000000000..d8b5c720d --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/federatedsloconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// FederatedSloConfigInformer provides access to a shared informer and lister for +// FederatedSloConfigs. +type FederatedSloConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.FederatedSloConfigLister +} + +type federatedSloConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewFederatedSloConfigInformer constructs a new informer for FederatedSloConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFederatedSloConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredFederatedSloConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredFederatedSloConfigInformer constructs a new informer for FederatedSloConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredFederatedSloConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().FederatedSloConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().FederatedSloConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.FederatedSloConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *federatedSloConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredFederatedSloConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *federatedSloConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.FederatedSloConfig{}, f.defaultInformer) +} + +func (f *federatedSloConfigInformer) Lister() v1.FederatedSloConfigLister { + return v1.NewFederatedSloConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/federatedsloserviceconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/federatedsloserviceconfig.go new file mode 100644 index 000000000..06977af2a --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/federatedsloserviceconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// FederatedSloServiceConfigInformer provides access to a shared informer and lister for +// FederatedSloServiceConfigs. +type FederatedSloServiceConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.FederatedSloServiceConfigLister +} + +type federatedSloServiceConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewFederatedSloServiceConfigInformer constructs a new informer for FederatedSloServiceConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFederatedSloServiceConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredFederatedSloServiceConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredFederatedSloServiceConfigInformer constructs a new informer for FederatedSloServiceConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredFederatedSloServiceConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().FederatedSloServiceConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().FederatedSloServiceConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.FederatedSloServiceConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *federatedSloServiceConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredFederatedSloServiceConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *federatedSloServiceConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.FederatedSloServiceConfig{}, f.defaultInformer) +} + +func (f *federatedSloServiceConfigInformer) Lister() v1.FederatedSloServiceConfigLister { + return v1.NewFederatedSloServiceConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gateway.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gateway.go new file mode 100644 index 000000000..e7a9614f3 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gateway.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GatewayInformer provides access to a shared informer and lister for +// Gateways. +type GatewayInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GatewayLister +} + +type gatewayInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGatewayInformer constructs a new informer for Gateway type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGatewayInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGatewayInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGatewayInformer constructs a new informer for Gateway type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGatewayInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Gateways().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Gateways().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Gateway{}, + resyncPeriod, + indexers, + ) +} + +func (f *gatewayInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGatewayInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gatewayInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Gateway{}, f.defaultInformer) +} + +func (f *gatewayInformer) Lister() v1.GatewayLister { + return v1.NewGatewayLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gatewayconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gatewayconfig.go new file mode 100644 index 000000000..31a02f1aa --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gatewayconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GatewayConfigInformer provides access to a shared informer and lister for +// GatewayConfigs. +type GatewayConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GatewayConfigLister +} + +type gatewayConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGatewayConfigInformer constructs a new informer for GatewayConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGatewayConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGatewayConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGatewayConfigInformer constructs a new informer for GatewayConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGatewayConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GatewayConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GatewayConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GatewayConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *gatewayConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGatewayConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gatewayConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GatewayConfig{}, f.defaultInformer) +} + +func (f *gatewayConfigInformer) Lister() v1.GatewayConfigLister { + return v1.NewGatewayConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gatewayconfigadditionallisteners.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gatewayconfigadditionallisteners.go new file mode 100644 index 000000000..4d6001a86 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gatewayconfigadditionallisteners.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GatewayConfigAdditionalListenersInformer provides access to a shared informer and lister for +// GatewayConfigAdditionalListenerses. +type GatewayConfigAdditionalListenersInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GatewayConfigAdditionalListenersLister +} + +type gatewayConfigAdditionalListenersInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGatewayConfigAdditionalListenersInformer constructs a new informer for GatewayConfigAdditionalListeners type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGatewayConfigAdditionalListenersInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGatewayConfigAdditionalListenersInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGatewayConfigAdditionalListenersInformer constructs a new informer for GatewayConfigAdditionalListeners type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGatewayConfigAdditionalListenersInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GatewayConfigAdditionalListenerses().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GatewayConfigAdditionalListenerses().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners{}, + resyncPeriod, + indexers, + ) +} + +func (f *gatewayConfigAdditionalListenersInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGatewayConfigAdditionalListenersInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gatewayConfigAdditionalListenersInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners{}, f.defaultInformer) +} + +func (f *gatewayConfigAdditionalListenersInformer) Lister() v1.GatewayConfigAdditionalListenersLister { + return v1.NewGatewayConfigAdditionalListenersLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenercertificate.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenercertificate.go new file mode 100644 index 000000000..38481aba5 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenercertificate.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GatewayConfigListenerCertificateInformer provides access to a shared informer and lister for +// GatewayConfigListenerCertificates. +type GatewayConfigListenerCertificateInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GatewayConfigListenerCertificateLister +} + +type gatewayConfigListenerCertificateInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGatewayConfigListenerCertificateInformer constructs a new informer for GatewayConfigListenerCertificate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGatewayConfigListenerCertificateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGatewayConfigListenerCertificateInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGatewayConfigListenerCertificateInformer constructs a new informer for GatewayConfigListenerCertificate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGatewayConfigListenerCertificateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GatewayConfigListenerCertificates().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GatewayConfigListenerCertificates().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate{}, + resyncPeriod, + indexers, + ) +} + +func (f *gatewayConfigListenerCertificateInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGatewayConfigListenerCertificateInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gatewayConfigListenerCertificateInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate{}, f.defaultInformer) +} + +func (f *gatewayConfigListenerCertificateInformer) Lister() v1.GatewayConfigListenerCertificateLister { + return v1.NewGatewayConfigListenerCertificateLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenerdestinationroute.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenerdestinationroute.go new file mode 100644 index 000000000..326876469 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenerdestinationroute.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GatewayConfigListenerDestinationRouteInformer provides access to a shared informer and lister for +// GatewayConfigListenerDestinationRoutes. +type GatewayConfigListenerDestinationRouteInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GatewayConfigListenerDestinationRouteLister +} + +type gatewayConfigListenerDestinationRouteInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGatewayConfigListenerDestinationRouteInformer constructs a new informer for GatewayConfigListenerDestinationRoute type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGatewayConfigListenerDestinationRouteInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGatewayConfigListenerDestinationRouteInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGatewayConfigListenerDestinationRouteInformer constructs a new informer for GatewayConfigListenerDestinationRoute type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGatewayConfigListenerDestinationRouteInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GatewayConfigListenerDestinationRoutes().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GatewayConfigListenerDestinationRoutes().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute{}, + resyncPeriod, + indexers, + ) +} + +func (f *gatewayConfigListenerDestinationRouteInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGatewayConfigListenerDestinationRouteInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gatewayConfigListenerDestinationRouteInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute{}, f.defaultInformer) +} + +func (f *gatewayConfigListenerDestinationRouteInformer) Lister() v1.GatewayConfigListenerDestinationRouteLister { + return v1.NewGatewayConfigListenerDestinationRouteLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/geodiscovery.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/geodiscovery.go new file mode 100644 index 000000000..b23ae722d --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/geodiscovery.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GeoDiscoveryInformer provides access to a shared informer and lister for +// GeoDiscoveries. +type GeoDiscoveryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GeoDiscoveryLister +} + +type geoDiscoveryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGeoDiscoveryInformer constructs a new informer for GeoDiscovery type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGeoDiscoveryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGeoDiscoveryInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGeoDiscoveryInformer constructs a new informer for GeoDiscovery type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGeoDiscoveryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GeoDiscoveries().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GeoDiscoveries().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GeoDiscovery{}, + resyncPeriod, + indexers, + ) +} + +func (f *geoDiscoveryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGeoDiscoveryInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *geoDiscoveryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GeoDiscovery{}, f.defaultInformer) +} + +func (f *geoDiscoveryInformer) Lister() v1.GeoDiscoveryLister { + return v1.NewGeoDiscoveryLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/geodiscoveryrt.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/geodiscoveryrt.go new file mode 100644 index 000000000..59708661a --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/geodiscoveryrt.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GeoDiscoveryRTInformer provides access to a shared informer and lister for +// GeoDiscoveryRTs. +type GeoDiscoveryRTInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GeoDiscoveryRTLister +} + +type geoDiscoveryRTInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGeoDiscoveryRTInformer constructs a new informer for GeoDiscoveryRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGeoDiscoveryRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGeoDiscoveryRTInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGeoDiscoveryRTInformer constructs a new informer for GeoDiscoveryRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGeoDiscoveryRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GeoDiscoveryRTs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GeoDiscoveryRTs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GeoDiscoveryRT{}, + resyncPeriod, + indexers, + ) +} + +func (f *geoDiscoveryRTInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGeoDiscoveryRTInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *geoDiscoveryRTInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GeoDiscoveryRT{}, f.defaultInformer) +} + +func (f *geoDiscoveryRTInformer) Lister() v1.GeoDiscoveryRTLister { + return v1.NewGeoDiscoveryRTLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/globalnamespace.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/globalnamespace.go new file mode 100644 index 000000000..acff0281b --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/globalnamespace.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GlobalNamespaceInformer provides access to a shared informer and lister for +// GlobalNamespaces. +type GlobalNamespaceInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GlobalNamespaceLister +} + +type globalNamespaceInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGlobalNamespaceInformer constructs a new informer for GlobalNamespace type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGlobalNamespaceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGlobalNamespaceInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGlobalNamespaceInformer constructs a new informer for GlobalNamespace type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGlobalNamespaceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GlobalNamespaces().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GlobalNamespaces().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GlobalNamespace{}, + resyncPeriod, + indexers, + ) +} + +func (f *globalNamespaceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGlobalNamespaceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *globalNamespaceInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GlobalNamespace{}, f.defaultInformer) +} + +func (f *globalNamespaceInformer) Lister() v1.GlobalNamespaceLister { + return v1.NewGlobalNamespaceLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/globalns.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/globalns.go new file mode 100644 index 000000000..c60622d0a --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/globalns.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GlobalNsInformer provides access to a shared informer and lister for +// GlobalNses. +type GlobalNsInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GlobalNsLister +} + +type globalNsInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGlobalNsInformer constructs a new informer for GlobalNs type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGlobalNsInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGlobalNsInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGlobalNsInformer constructs a new informer for GlobalNs type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGlobalNsInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GlobalNses().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GlobalNses().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GlobalNs{}, + resyncPeriod, + indexers, + ) +} + +func (f *globalNsInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGlobalNsInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *globalNsInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GlobalNs{}, f.defaultInformer) +} + +func (f *globalNsInformer) Lister() v1.GlobalNsLister { + return v1.NewGlobalNsLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/globalregistrationservice.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/globalregistrationservice.go new file mode 100644 index 000000000..dd7f32e97 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/globalregistrationservice.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GlobalRegistrationServiceInformer provides access to a shared informer and lister for +// GlobalRegistrationServices. +type GlobalRegistrationServiceInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GlobalRegistrationServiceLister +} + +type globalRegistrationServiceInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGlobalRegistrationServiceInformer constructs a new informer for GlobalRegistrationService type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGlobalRegistrationServiceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGlobalRegistrationServiceInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGlobalRegistrationServiceInformer constructs a new informer for GlobalRegistrationService type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGlobalRegistrationServiceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GlobalRegistrationServices().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GlobalRegistrationServices().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GlobalRegistrationService{}, + resyncPeriod, + indexers, + ) +} + +func (f *globalRegistrationServiceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGlobalRegistrationServiceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *globalRegistrationServiceInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GlobalRegistrationService{}, f.defaultInformer) +} + +func (f *globalRegistrationServiceInformer) Lister() v1.GlobalRegistrationServiceLister { + return v1.NewGlobalRegistrationServiceLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gns.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gns.go new file mode 100644 index 000000000..55fe747ca --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gns.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GNSInformer provides access to a shared informer and lister for +// GNSs. +type GNSInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GNSLister +} + +type gNSInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGNSInformer constructs a new informer for GNS type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGNSInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGNSInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGNSInformer constructs a new informer for GNS type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGNSInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GNSs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GNSs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GNS{}, + resyncPeriod, + indexers, + ) +} + +func (f *gNSInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGNSInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gNSInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GNS{}, f.defaultInformer) +} + +func (f *gNSInformer) Lister() v1.GNSLister { + return v1.NewGNSLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicy.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicy.go new file mode 100644 index 000000000..bcf7546a8 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicy.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GnsAccessControlPolicyInformer provides access to a shared informer and lister for +// GnsAccessControlPolicies. +type GnsAccessControlPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GnsAccessControlPolicyLister +} + +type gnsAccessControlPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGnsAccessControlPolicyInformer constructs a new informer for GnsAccessControlPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGnsAccessControlPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGnsAccessControlPolicyInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGnsAccessControlPolicyInformer constructs a new informer for GnsAccessControlPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGnsAccessControlPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsAccessControlPolicies().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsAccessControlPolicies().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *gnsAccessControlPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGnsAccessControlPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gnsAccessControlPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GnsAccessControlPolicy{}, f.defaultInformer) +} + +func (f *gnsAccessControlPolicyInformer) Lister() v1.GnsAccessControlPolicyLister { + return v1.NewGnsAccessControlPolicyLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicyrt.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicyrt.go new file mode 100644 index 000000000..e7a8c45ab --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicyrt.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GnsAccessControlPolicyRTInformer provides access to a shared informer and lister for +// GnsAccessControlPolicyRTs. +type GnsAccessControlPolicyRTInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GnsAccessControlPolicyRTLister +} + +type gnsAccessControlPolicyRTInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGnsAccessControlPolicyRTInformer constructs a new informer for GnsAccessControlPolicyRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGnsAccessControlPolicyRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGnsAccessControlPolicyRTInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGnsAccessControlPolicyRTInformer constructs a new informer for GnsAccessControlPolicyRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGnsAccessControlPolicyRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsAccessControlPolicyRTs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsAccessControlPolicyRTs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT{}, + resyncPeriod, + indexers, + ) +} + +func (f *gnsAccessControlPolicyRTInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGnsAccessControlPolicyRTInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gnsAccessControlPolicyRTInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT{}, f.defaultInformer) +} + +func (f *gnsAccessControlPolicyRTInformer) Lister() v1.GnsAccessControlPolicyRTLister { + return v1.NewGnsAccessControlPolicyRTLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsbindingrt.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsbindingrt.go new file mode 100644 index 000000000..0159d39ab --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsbindingrt.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GnsBindingRTInformer provides access to a shared informer and lister for +// GnsBindingRTs. +type GnsBindingRTInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GnsBindingRTLister +} + +type gnsBindingRTInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGnsBindingRTInformer constructs a new informer for GnsBindingRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGnsBindingRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGnsBindingRTInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGnsBindingRTInformer constructs a new informer for GnsBindingRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGnsBindingRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsBindingRTs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsBindingRTs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GnsBindingRT{}, + resyncPeriod, + indexers, + ) +} + +func (f *gnsBindingRTInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGnsBindingRTInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gnsBindingRTInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GnsBindingRT{}, f.defaultInformer) +} + +func (f *gnsBindingRTInformer) Lister() v1.GnsBindingRTLister { + return v1.NewGnsBindingRTLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsendpointsconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsendpointsconfig.go new file mode 100644 index 000000000..b4b92f931 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsendpointsconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GnsEndpointsConfigInformer provides access to a shared informer and lister for +// GnsEndpointsConfigs. +type GnsEndpointsConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GnsEndpointsConfigLister +} + +type gnsEndpointsConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGnsEndpointsConfigInformer constructs a new informer for GnsEndpointsConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGnsEndpointsConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGnsEndpointsConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGnsEndpointsConfigInformer constructs a new informer for GnsEndpointsConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGnsEndpointsConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsEndpointsConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsEndpointsConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GnsEndpointsConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *gnsEndpointsConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGnsEndpointsConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gnsEndpointsConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GnsEndpointsConfig{}, f.defaultInformer) +} + +func (f *gnsEndpointsConfigInformer) Lister() v1.GnsEndpointsConfigLister { + return v1.NewGnsEndpointsConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsroutingconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsroutingconfig.go new file mode 100644 index 000000000..21a7052fe --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsroutingconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GNSRoutingConfigInformer provides access to a shared informer and lister for +// GNSRoutingConfigs. +type GNSRoutingConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GNSRoutingConfigLister +} + +type gNSRoutingConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGNSRoutingConfigInformer constructs a new informer for GNSRoutingConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGNSRoutingConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGNSRoutingConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGNSRoutingConfigInformer constructs a new informer for GNSRoutingConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGNSRoutingConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GNSRoutingConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GNSRoutingConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GNSRoutingConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *gNSRoutingConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGNSRoutingConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gNSRoutingConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GNSRoutingConfig{}, f.defaultInformer) +} + +func (f *gNSRoutingConfigInformer) Lister() v1.GNSRoutingConfigLister { + return v1.NewGNSRoutingConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsroutingruleconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsroutingruleconfig.go new file mode 100644 index 000000000..d18a8c94f --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsroutingruleconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GnsRoutingRuleConfigInformer provides access to a shared informer and lister for +// GnsRoutingRuleConfigs. +type GnsRoutingRuleConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GnsRoutingRuleConfigLister +} + +type gnsRoutingRuleConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGnsRoutingRuleConfigInformer constructs a new informer for GnsRoutingRuleConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGnsRoutingRuleConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGnsRoutingRuleConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGnsRoutingRuleConfigInformer constructs a new informer for GnsRoutingRuleConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGnsRoutingRuleConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsRoutingRuleConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsRoutingRuleConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *gnsRoutingRuleConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGnsRoutingRuleConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gnsRoutingRuleConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig{}, f.defaultInformer) +} + +func (f *gnsRoutingRuleConfigInformer) Lister() v1.GnsRoutingRuleConfigLister { + return v1.NewGnsRoutingRuleConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsschemaviolationdiscovery.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsschemaviolationdiscovery.go new file mode 100644 index 000000000..ab6ec51a3 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsschemaviolationdiscovery.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GnsSchemaViolationDiscoveryInformer provides access to a shared informer and lister for +// GnsSchemaViolationDiscoveries. +type GnsSchemaViolationDiscoveryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GnsSchemaViolationDiscoveryLister +} + +type gnsSchemaViolationDiscoveryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGnsSchemaViolationDiscoveryInformer constructs a new informer for GnsSchemaViolationDiscovery type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGnsSchemaViolationDiscoveryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGnsSchemaViolationDiscoveryInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGnsSchemaViolationDiscoveryInformer constructs a new informer for GnsSchemaViolationDiscovery type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGnsSchemaViolationDiscoveryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsSchemaViolationDiscoveries().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsSchemaViolationDiscoveries().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery{}, + resyncPeriod, + indexers, + ) +} + +func (f *gnsSchemaViolationDiscoveryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGnsSchemaViolationDiscoveryInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gnsSchemaViolationDiscoveryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery{}, f.defaultInformer) +} + +func (f *gnsSchemaViolationDiscoveryInformer) Lister() v1.GnsSchemaViolationDiscoveryLister { + return v1.NewGnsSchemaViolationDiscoveryLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicy.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicy.go new file mode 100644 index 000000000..d5a76ea28 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicy.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GnsSegmentationPolicyInformer provides access to a shared informer and lister for +// GnsSegmentationPolicies. +type GnsSegmentationPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GnsSegmentationPolicyLister +} + +type gnsSegmentationPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGnsSegmentationPolicyInformer constructs a new informer for GnsSegmentationPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGnsSegmentationPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGnsSegmentationPolicyInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGnsSegmentationPolicyInformer constructs a new informer for GnsSegmentationPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGnsSegmentationPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsSegmentationPolicies().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsSegmentationPolicies().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *gnsSegmentationPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGnsSegmentationPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gnsSegmentationPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GnsSegmentationPolicy{}, f.defaultInformer) +} + +func (f *gnsSegmentationPolicyInformer) Lister() v1.GnsSegmentationPolicyLister { + return v1.NewGnsSegmentationPolicyLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicyrt.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicyrt.go new file mode 100644 index 000000000..e571421e0 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicyrt.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GnsSegmentationPolicyRTInformer provides access to a shared informer and lister for +// GnsSegmentationPolicyRTs. +type GnsSegmentationPolicyRTInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GnsSegmentationPolicyRTLister +} + +type gnsSegmentationPolicyRTInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGnsSegmentationPolicyRTInformer constructs a new informer for GnsSegmentationPolicyRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGnsSegmentationPolicyRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGnsSegmentationPolicyRTInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGnsSegmentationPolicyRTInformer constructs a new informer for GnsSegmentationPolicyRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGnsSegmentationPolicyRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsSegmentationPolicyRTs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsSegmentationPolicyRTs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT{}, + resyncPeriod, + indexers, + ) +} + +func (f *gnsSegmentationPolicyRTInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGnsSegmentationPolicyRTInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gnsSegmentationPolicyRTInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT{}, f.defaultInformer) +} + +func (f *gnsSegmentationPolicyRTInformer) Lister() v1.GnsSegmentationPolicyRTLister { + return v1.NewGnsSegmentationPolicyRTLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsserviceentryconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsserviceentryconfig.go new file mode 100644 index 000000000..0f439703a --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnsserviceentryconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GnsServiceEntryConfigInformer provides access to a shared informer and lister for +// GnsServiceEntryConfigs. +type GnsServiceEntryConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GnsServiceEntryConfigLister +} + +type gnsServiceEntryConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGnsServiceEntryConfigInformer constructs a new informer for GnsServiceEntryConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGnsServiceEntryConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGnsServiceEntryConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGnsServiceEntryConfigInformer constructs a new informer for GnsServiceEntryConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGnsServiceEntryConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsServiceEntryConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsServiceEntryConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GnsServiceEntryConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *gnsServiceEntryConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGnsServiceEntryConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gnsServiceEntryConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GnsServiceEntryConfig{}, f.defaultInformer) +} + +func (f *gnsServiceEntryConfigInformer) Lister() v1.GnsServiceEntryConfigLister { + return v1.NewGnsServiceEntryConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnssvcgroup.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnssvcgroup.go new file mode 100644 index 000000000..02aa81038 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnssvcgroup.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GNSSvcGroupInformer provides access to a shared informer and lister for +// GNSSvcGroups. +type GNSSvcGroupInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GNSSvcGroupLister +} + +type gNSSvcGroupInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGNSSvcGroupInformer constructs a new informer for GNSSvcGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGNSSvcGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGNSSvcGroupInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGNSSvcGroupInformer constructs a new informer for GNSSvcGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGNSSvcGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GNSSvcGroups().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GNSSvcGroups().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GNSSvcGroup{}, + resyncPeriod, + indexers, + ) +} + +func (f *gNSSvcGroupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGNSSvcGroupInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gNSSvcGroupInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GNSSvcGroup{}, f.defaultInformer) +} + +func (f *gNSSvcGroupInformer) Lister() v1.GNSSvcGroupLister { + return v1.NewGNSSvcGroupLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnssvcgrouprt.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnssvcgrouprt.go new file mode 100644 index 000000000..fe3506273 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/gnssvcgrouprt.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GnsSvcGroupRTInformer provides access to a shared informer and lister for +// GnsSvcGroupRTs. +type GnsSvcGroupRTInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GnsSvcGroupRTLister +} + +type gnsSvcGroupRTInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewGnsSvcGroupRTInformer constructs a new informer for GnsSvcGroupRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGnsSvcGroupRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGnsSvcGroupRTInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredGnsSvcGroupRTInformer constructs a new informer for GnsSvcGroupRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGnsSvcGroupRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsSvcGroupRTs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().GnsSvcGroupRTs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.GnsSvcGroupRT{}, + resyncPeriod, + indexers, + ) +} + +func (f *gnsSvcGroupRTInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGnsSvcGroupRTInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gnsSvcGroupRTInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.GnsSvcGroupRT{}, f.defaultInformer) +} + +func (f *gnsSvcGroupRTInformer) Lister() v1.GnsSvcGroupRTLister { + return v1.NewGnsSvcGroupRTLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/haconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/haconfig.go new file mode 100644 index 000000000..3848dc16f --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/haconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// HaConfigInformer provides access to a shared informer and lister for +// HaConfigs. +type HaConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.HaConfigLister +} + +type haConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewHaConfigInformer constructs a new informer for HaConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewHaConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredHaConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredHaConfigInformer constructs a new informer for HaConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredHaConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().HaConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().HaConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.HaConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *haConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredHaConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *haConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.HaConfig{}, f.defaultInformer) +} + +func (f *haConfigInformer) Lister() v1.HaConfigLister { + return v1.NewHaConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/haconfigv2.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/haconfigv2.go new file mode 100644 index 000000000..0e9cb7917 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/haconfigv2.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// HaConfigV2Informer provides access to a shared informer and lister for +// HaConfigV2s. +type HaConfigV2Informer interface { + Informer() cache.SharedIndexInformer + Lister() v1.HaConfigV2Lister +} + +type haConfigV2Informer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewHaConfigV2Informer constructs a new informer for HaConfigV2 type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewHaConfigV2Informer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredHaConfigV2Informer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredHaConfigV2Informer constructs a new informer for HaConfigV2 type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredHaConfigV2Informer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().HaConfigV2s().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().HaConfigV2s().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.HaConfigV2{}, + resyncPeriod, + indexers, + ) +} + +func (f *haConfigV2Informer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredHaConfigV2Informer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *haConfigV2Informer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.HaConfigV2{}, f.defaultInformer) +} + +func (f *haConfigV2Informer) Lister() v1.HaConfigV2Lister { + return v1.NewHaConfigV2Lister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/healthcheckconfign.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/healthcheckconfign.go new file mode 100644 index 000000000..4a4252312 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/healthcheckconfign.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// HealthCheckConfigNInformer provides access to a shared informer and lister for +// HealthCheckConfigNs. +type HealthCheckConfigNInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.HealthCheckConfigNLister +} + +type healthCheckConfigNInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewHealthCheckConfigNInformer constructs a new informer for HealthCheckConfigN type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewHealthCheckConfigNInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredHealthCheckConfigNInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredHealthCheckConfigNInformer constructs a new informer for HealthCheckConfigN type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredHealthCheckConfigNInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().HealthCheckConfigNs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().HealthCheckConfigNs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.HealthCheckConfigN{}, + resyncPeriod, + indexers, + ) +} + +func (f *healthCheckConfigNInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredHealthCheckConfigNInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *healthCheckConfigNInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.HealthCheckConfigN{}, f.defaultInformer) +} + +func (f *healthCheckConfigNInformer) Lister() v1.HealthCheckConfigNLister { + return v1.NewHealthCheckConfigNLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/hostconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/hostconfig.go new file mode 100644 index 000000000..653e9ffcc --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/hostconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// HostConfigInformer provides access to a shared informer and lister for +// HostConfigs. +type HostConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.HostConfigLister +} + +type hostConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewHostConfigInformer constructs a new informer for HostConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewHostConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredHostConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredHostConfigInformer constructs a new informer for HostConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredHostConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().HostConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().HostConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.HostConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *hostConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredHostConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *hostConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.HostConfig{}, f.defaultInformer) +} + +func (f *hostConfigInformer) Lister() v1.HostConfigLister { + return v1.NewHostConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/hostconfigv2.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/hostconfigv2.go new file mode 100644 index 000000000..5f63fb703 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/hostconfigv2.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// HostConfigV2Informer provides access to a shared informer and lister for +// HostConfigV2s. +type HostConfigV2Informer interface { + Informer() cache.SharedIndexInformer + Lister() v1.HostConfigV2Lister +} + +type hostConfigV2Informer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewHostConfigV2Informer constructs a new informer for HostConfigV2 type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewHostConfigV2Informer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredHostConfigV2Informer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredHostConfigV2Informer constructs a new informer for HostConfigV2 type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredHostConfigV2Informer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().HostConfigV2s().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().HostConfigV2s().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.HostConfigV2{}, + resyncPeriod, + indexers, + ) +} + +func (f *hostConfigV2Informer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredHostConfigV2Informer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *hostConfigV2Informer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.HostConfigV2{}, f.defaultInformer) +} + +func (f *hostConfigV2Informer) Lister() v1.HostConfigV2Lister { + return v1.NewHostConfigV2Lister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/inboundauthenticationconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/inboundauthenticationconfig.go new file mode 100644 index 000000000..045d34dab --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/inboundauthenticationconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// InboundAuthenticationConfigInformer provides access to a shared informer and lister for +// InboundAuthenticationConfigs. +type InboundAuthenticationConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.InboundAuthenticationConfigLister +} + +type inboundAuthenticationConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewInboundAuthenticationConfigInformer constructs a new informer for InboundAuthenticationConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewInboundAuthenticationConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredInboundAuthenticationConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredInboundAuthenticationConfigInformer constructs a new informer for InboundAuthenticationConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredInboundAuthenticationConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().InboundAuthenticationConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().InboundAuthenticationConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.InboundAuthenticationConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *inboundAuthenticationConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredInboundAuthenticationConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *inboundAuthenticationConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.InboundAuthenticationConfig{}, f.defaultInformer) +} + +func (f *inboundAuthenticationConfigInformer) Lister() v1.InboundAuthenticationConfigLister { + return v1.NewInboundAuthenticationConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/interface.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/interface.go new file mode 100644 index 000000000..b5203f15b --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/interface.go @@ -0,0 +1,1494 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // ACPConfigs returns a ACPConfigInformer. + ACPConfigs() ACPConfigInformer + // AccessControlPolicies returns a AccessControlPolicyInformer. + AccessControlPolicies() AccessControlPolicyInformer + // AccessTokens returns a AccessTokenInformer. + AccessTokens() AccessTokenInformer + // AdditionalAttributeses returns a AdditionalAttributesInformer. + AdditionalAttributeses() AdditionalAttributesInformer + // AllSparkServiceses returns a AllSparkServicesInformer. + AllSparkServiceses() AllSparkServicesInformer + // Annotations returns a AnnotationInformer. + Annotations() AnnotationInformer + // ApiDiscoveries returns a ApiDiscoveryInformer. + ApiDiscoveries() ApiDiscoveryInformer + // ApiDiscoveryRTs returns a ApiDiscoveryRTInformer. + ApiDiscoveryRTs() ApiDiscoveryRTInformer + // Apps returns a AppInformer. + Apps() AppInformer + // AppFolders returns a AppFolderInformer. + AppFolders() AppFolderInformer + // AppGroups returns a AppGroupInformer. + AppGroups() AppGroupInformer + // AppTemplates returns a AppTemplateInformer. + AppTemplates() AppTemplateInformer + // AppTemplateServiceDefinitions returns a AppTemplateServiceDefinitionInformer. + AppTemplateServiceDefinitions() AppTemplateServiceDefinitionInformer + // AppUsers returns a AppUserInformer. + AppUsers() AppUserInformer + // AppVersions returns a AppVersionInformer. + AppVersions() AppVersionInformer + // ApplicationInfos returns a ApplicationInfoInformer. + ApplicationInfos() ApplicationInfoInformer + // AttackDiscoveries returns a AttackDiscoveryInformer. + AttackDiscoveries() AttackDiscoveryInformer + // AttackDiscoveryRTs returns a AttackDiscoveryRTInformer. + AttackDiscoveryRTs() AttackDiscoveryRTInformer + // AuthenticationPolicies returns a AuthenticationPolicyInformer. + AuthenticationPolicies() AuthenticationPolicyInformer + // Autoscalers returns a AutoscalerInformer. + Autoscalers() AutoscalerInformer + // AutoscalerCRs returns a AutoscalerCRInformer. + AutoscalerCRs() AutoscalerCRInformer + // AutoscalerConfigs returns a AutoscalerConfigInformer. + AutoscalerConfigs() AutoscalerConfigInformer + // AutoscalerFolders returns a AutoscalerFolderInformer. + AutoscalerFolders() AutoscalerFolderInformer + // AutoscalingPolicies returns a AutoscalingPolicyInformer. + AutoscalingPolicies() AutoscalingPolicyInformer + // AwsConnectors returns a AwsConnectorInformer. + AwsConnectors() AwsConnectorInformer + // Buckets returns a BucketInformer. + Buckets() BucketInformer + // Certificates returns a CertificateInformer. + Certificates() CertificateInformer + // CertificateAuthorityConfigNs returns a CertificateAuthorityConfigNInformer. + CertificateAuthorityConfigNs() CertificateAuthorityConfigNInformer + // CertificateAuthorityRTs returns a CertificateAuthorityRTInformer. + CertificateAuthorityRTs() CertificateAuthorityRTInformer + // CertificateConfigNs returns a CertificateConfigNInformer. + CertificateConfigNs() CertificateConfigNInformer + // CertificateRequests returns a CertificateRequestInformer. + CertificateRequests() CertificateRequestInformer + // Clusters returns a ClusterInformer. + Clusters() ClusterInformer + // ClusterConfigs returns a ClusterConfigInformer. + ClusterConfigs() ClusterConfigInformer + // ClusterConfigFolders returns a ClusterConfigFolderInformer. + ClusterConfigFolders() ClusterConfigFolderInformer + // ClusterFolders returns a ClusterFolderInformer. + ClusterFolders() ClusterFolderInformer + // ClusterSettingses returns a ClusterSettingsInformer. + ClusterSettingses() ClusterSettingsInformer + // Configs returns a ConfigInformer. + Configs() ConfigInformer + // ConfigMaps returns a ConfigMapInformer. + ConfigMaps() ConfigMapInformer + // ConnectionStatuses returns a ConnectionStatusInformer. + ConnectionStatuses() ConnectionStatusInformer + // DCRegions returns a DCRegionInformer. + DCRegions() DCRegionInformer + // DCZones returns a DCZoneInformer. + DCZones() DCZoneInformer + // DNSConfigs returns a DNSConfigInformer. + DNSConfigs() DNSConfigInformer + // DNSConfigFolders returns a DNSConfigFolderInformer. + DNSConfigFolders() DNSConfigFolderInformer + // DNSProbeConfigs returns a DNSProbeConfigInformer. + DNSProbeConfigs() DNSProbeConfigInformer + // DNSProbeStatuses returns a DNSProbeStatusInformer. + DNSProbeStatuses() DNSProbeStatusInformer + // DNSProbesConfigFolders returns a DNSProbesConfigFolderInformer. + DNSProbesConfigFolders() DNSProbesConfigFolderInformer + // DataFolders returns a DataFolderInformer. + DataFolders() DataFolderInformer + // DataFolderDomains returns a DataFolderDomainInformer. + DataFolderDomains() DataFolderDomainInformer + // DataFolderDomainClusters returns a DataFolderDomainClusterInformer. + DataFolderDomainClusters() DataFolderDomainClusterInformer + // DataFolderDomainServices returns a DataFolderDomainServiceInformer. + DataFolderDomainServices() DataFolderDomainServiceInformer + // DataFolderDomainServiceVersions returns a DataFolderDomainServiceVersionInformer. + DataFolderDomainServiceVersions() DataFolderDomainServiceVersionInformer + // DataGroups returns a DataGroupInformer. + DataGroups() DataGroupInformer + // DataTemplates returns a DataTemplateInformer. + DataTemplates() DataTemplateInformer + // Databases returns a DatabaseInformer. + Databases() DatabaseInformer + // DestinationRules returns a DestinationRuleInformer. + DestinationRules() DestinationRuleInformer + // Directories returns a DirectoryInformer. + Directories() DirectoryInformer + // Domains returns a DomainInformer. + Domains() DomainInformer + // DomainConfigs returns a DomainConfigInformer. + DomainConfigs() DomainConfigInformer + // Endpoints returns a EndpointsInformer. + Endpoints() EndpointsInformer + // EnvoyFilters returns a EnvoyFilterInformer. + EnvoyFilters() EnvoyFilterInformer + // ExternalAccountConfigNs returns a ExternalAccountConfigNInformer. + ExternalAccountConfigNs() ExternalAccountConfigNInformer + // ExternalAuditStorages returns a ExternalAuditStorageInformer. + ExternalAuditStorages() ExternalAuditStorageInformer + // ExternalDNSConfigNs returns a ExternalDNSConfigNInformer. + ExternalDNSConfigNs() ExternalDNSConfigNInformer + // ExternalDNSInventories returns a ExternalDNSInventoryInformer. + ExternalDNSInventories() ExternalDNSInventoryInformer + // ExternalDNSInventoryHealthChecks returns a ExternalDNSInventoryHealthCheckInformer. + ExternalDNSInventoryHealthChecks() ExternalDNSInventoryHealthCheckInformer + // ExternalDNSInventoryPrimaryDomains returns a ExternalDNSInventoryPrimaryDomainInformer. + ExternalDNSInventoryPrimaryDomains() ExternalDNSInventoryPrimaryDomainInformer + // ExternalDNSInventoryRecords returns a ExternalDNSInventoryRecordInformer. + ExternalDNSInventoryRecords() ExternalDNSInventoryRecordInformer + // ExternalDNSInventoryZones returns a ExternalDNSInventoryZoneInformer. + ExternalDNSInventoryZones() ExternalDNSInventoryZoneInformer + // ExternalDNSRuntimes returns a ExternalDNSRuntimeInformer. + ExternalDNSRuntimes() ExternalDNSRuntimeInformer + // ExternalDNSRuntimeEndpoints returns a ExternalDNSRuntimeEndpointInformer. + ExternalDNSRuntimeEndpoints() ExternalDNSRuntimeEndpointInformer + // ExternalDNSRuntimePrimaryDomains returns a ExternalDNSRuntimePrimaryDomainInformer. + ExternalDNSRuntimePrimaryDomains() ExternalDNSRuntimePrimaryDomainInformer + // ExternalDNSRuntimeSubdomains returns a ExternalDNSRuntimeSubdomainInformer. + ExternalDNSRuntimeSubdomains() ExternalDNSRuntimeSubdomainInformer + // ExternalLBConfigNs returns a ExternalLBConfigNInformer. + ExternalLBConfigNs() ExternalLBConfigNInformer + // ExternalPluginCapabilities returns a ExternalPluginCapabilityInformer. + ExternalPluginCapabilities() ExternalPluginCapabilityInformer + // ExternalPluginConfigs returns a ExternalPluginConfigInformer. + ExternalPluginConfigs() ExternalPluginConfigInformer + // ExternalPluginConfigFolders returns a ExternalPluginConfigFolderInformer. + ExternalPluginConfigFolders() ExternalPluginConfigFolderInformer + // ExternalPluginInstanceConfigs returns a ExternalPluginInstanceConfigInformer. + ExternalPluginInstanceConfigs() ExternalPluginInstanceConfigInformer + // ExternalPluginMonitors returns a ExternalPluginMonitorInformer. + ExternalPluginMonitors() ExternalPluginMonitorInformer + // ExternalServiceConfigs returns a ExternalServiceConfigInformer. + ExternalServiceConfigs() ExternalServiceConfigInformer + // ExternalServicesRTs returns a ExternalServicesRTInformer. + ExternalServicesRTs() ExternalServicesRTInformer + // FeatureFlags returns a FeatureFlagInformer. + FeatureFlags() FeatureFlagInformer + // FederatedSloConfigs returns a FederatedSloConfigInformer. + FederatedSloConfigs() FederatedSloConfigInformer + // FederatedSloServiceConfigs returns a FederatedSloServiceConfigInformer. + FederatedSloServiceConfigs() FederatedSloServiceConfigInformer + // GNSs returns a GNSInformer. + GNSs() GNSInformer + // GNSRoutingConfigs returns a GNSRoutingConfigInformer. + GNSRoutingConfigs() GNSRoutingConfigInformer + // GNSSvcGroups returns a GNSSvcGroupInformer. + GNSSvcGroups() GNSSvcGroupInformer + // Gateways returns a GatewayInformer. + Gateways() GatewayInformer + // GatewayConfigs returns a GatewayConfigInformer. + GatewayConfigs() GatewayConfigInformer + // GatewayConfigAdditionalListenerses returns a GatewayConfigAdditionalListenersInformer. + GatewayConfigAdditionalListenerses() GatewayConfigAdditionalListenersInformer + // GatewayConfigListenerCertificates returns a GatewayConfigListenerCertificateInformer. + GatewayConfigListenerCertificates() GatewayConfigListenerCertificateInformer + // GatewayConfigListenerDestinationRoutes returns a GatewayConfigListenerDestinationRouteInformer. + GatewayConfigListenerDestinationRoutes() GatewayConfigListenerDestinationRouteInformer + // GeoDiscoveries returns a GeoDiscoveryInformer. + GeoDiscoveries() GeoDiscoveryInformer + // GeoDiscoveryRTs returns a GeoDiscoveryRTInformer. + GeoDiscoveryRTs() GeoDiscoveryRTInformer + // GlobalNamespaces returns a GlobalNamespaceInformer. + GlobalNamespaces() GlobalNamespaceInformer + // GlobalNses returns a GlobalNsInformer. + GlobalNses() GlobalNsInformer + // GlobalRegistrationServices returns a GlobalRegistrationServiceInformer. + GlobalRegistrationServices() GlobalRegistrationServiceInformer + // GnsAccessControlPolicies returns a GnsAccessControlPolicyInformer. + GnsAccessControlPolicies() GnsAccessControlPolicyInformer + // GnsAccessControlPolicyRTs returns a GnsAccessControlPolicyRTInformer. + GnsAccessControlPolicyRTs() GnsAccessControlPolicyRTInformer + // GnsBindingRTs returns a GnsBindingRTInformer. + GnsBindingRTs() GnsBindingRTInformer + // GnsEndpointsConfigs returns a GnsEndpointsConfigInformer. + GnsEndpointsConfigs() GnsEndpointsConfigInformer + // GnsRoutingRuleConfigs returns a GnsRoutingRuleConfigInformer. + GnsRoutingRuleConfigs() GnsRoutingRuleConfigInformer + // GnsSchemaViolationDiscoveries returns a GnsSchemaViolationDiscoveryInformer. + GnsSchemaViolationDiscoveries() GnsSchemaViolationDiscoveryInformer + // GnsSegmentationPolicies returns a GnsSegmentationPolicyInformer. + GnsSegmentationPolicies() GnsSegmentationPolicyInformer + // GnsSegmentationPolicyRTs returns a GnsSegmentationPolicyRTInformer. + GnsSegmentationPolicyRTs() GnsSegmentationPolicyRTInformer + // GnsServiceEntryConfigs returns a GnsServiceEntryConfigInformer. + GnsServiceEntryConfigs() GnsServiceEntryConfigInformer + // GnsSvcGroupRTs returns a GnsSvcGroupRTInformer. + GnsSvcGroupRTs() GnsSvcGroupRTInformer + // HaConfigs returns a HaConfigInformer. + HaConfigs() HaConfigInformer + // HaConfigV2s returns a HaConfigV2Informer. + HaConfigV2s() HaConfigV2Informer + // HealthCheckConfigNs returns a HealthCheckConfigNInformer. + HealthCheckConfigNs() HealthCheckConfigNInformer + // HostConfigs returns a HostConfigInformer. + HostConfigs() HostConfigInformer + // HostConfigV2s returns a HostConfigV2Informer. + HostConfigV2s() HostConfigV2Informer + // InboundAuthenticationConfigs returns a InboundAuthenticationConfigInformer. + InboundAuthenticationConfigs() InboundAuthenticationConfigInformer + // Inventories returns a InventoryInformer. + Inventories() InventoryInformer + // Issuers returns a IssuerInformer. + Issuers() IssuerInformer + // Jobs returns a JobInformer. + Jobs() JobInformer + // JobConfigs returns a JobConfigInformer. + JobConfigs() JobConfigInformer + // JobConfigFolders returns a JobConfigFolderInformer. + JobConfigFolders() JobConfigFolderInformer + // JobFolders returns a JobFolderInformer. + JobFolders() JobFolderInformer + // KnativeIngresses returns a KnativeIngressInformer. + KnativeIngresses() KnativeIngressInformer + // LabelConfigs returns a LabelConfigInformer. + LabelConfigs() LabelConfigInformer + // LocalRegistrationServices returns a LocalRegistrationServiceInformer. + LocalRegistrationServices() LocalRegistrationServiceInformer + // LocalRegistrationServiceClusters returns a LocalRegistrationServiceClusterInformer. + LocalRegistrationServiceClusters() LocalRegistrationServiceClusterInformer + // LocalRegistrationServiceResources returns a LocalRegistrationServiceResourceInformer. + LocalRegistrationServiceResources() LocalRegistrationServiceResourceInformer + // Logs returns a LogInformer. + Logs() LogInformer + // LogFolders returns a LogFolderInformer. + LogFolders() LogFolderInformer + // MetricMonitors returns a MetricMonitorInformer. + MetricMonitors() MetricMonitorInformer + // NetworkAttachmentDefinitions returns a NetworkAttachmentDefinitionInformer. + NetworkAttachmentDefinitions() NetworkAttachmentDefinitionInformer + // NetworkAttachmentDefinitionConfigs returns a NetworkAttachmentDefinitionConfigInformer. + NetworkAttachmentDefinitionConfigs() NetworkAttachmentDefinitionConfigInformer + // Nodes returns a NodeInformer. + Nodes() NodeInformer + // NodeDefinitions returns a NodeDefinitionInformer. + NodeDefinitions() NodeDefinitionInformer + // NodeFolders returns a NodeFolderInformer. + NodeFolders() NodeFolderInformer + // NodeFolderClusters returns a NodeFolderClusterInformer. + NodeFolderClusters() NodeFolderClusterInformer + // NodeGroups returns a NodeGroupInformer. + NodeGroups() NodeGroupInformer + // NodeStatuses returns a NodeStatusInformer. + NodeStatuses() NodeStatusInformer + // NodeTemplates returns a NodeTemplateInformer. + NodeTemplates() NodeTemplateInformer + // OutboundAuthenticationModes returns a OutboundAuthenticationModeInformer. + OutboundAuthenticationModes() OutboundAuthenticationModeInformer + // PeerAuthentications returns a PeerAuthenticationInformer. + PeerAuthentications() PeerAuthenticationInformer + // PiiDiscoveries returns a PiiDiscoveryInformer. + PiiDiscoveries() PiiDiscoveryInformer + // PiiDiscoveryRTs returns a PiiDiscoveryRTInformer. + PiiDiscoveryRTs() PiiDiscoveryRTInformer + // PolicyConfigs returns a PolicyConfigInformer. + PolicyConfigs() PolicyConfigInformer + // PolicyTemplates returns a PolicyTemplateInformer. + PolicyTemplates() PolicyTemplateInformer + // ProgressiveUpgrades returns a ProgressiveUpgradeInformer. + ProgressiveUpgrades() ProgressiveUpgradeInformer + // ProgressiveUpgradeConfigs returns a ProgressiveUpgradeConfigInformer. + ProgressiveUpgradeConfigs() ProgressiveUpgradeConfigInformer + // ProgressiveUpgradeFolders returns a ProgressiveUpgradeFolderInformer. + ProgressiveUpgradeFolders() ProgressiveUpgradeFolderInformer + // ProgressiveUpgradeRuntimes returns a ProgressiveUpgradeRuntimeInformer. + ProgressiveUpgradeRuntimes() ProgressiveUpgradeRuntimeInformer + // Projects returns a ProjectInformer. + Projects() ProjectInformer + // ProjectConfigs returns a ProjectConfigInformer. + ProjectConfigs() ProjectConfigInformer + // ProjectInventories returns a ProjectInventoryInformer. + ProjectInventories() ProjectInventoryInformer + // ProjectQueries returns a ProjectQueryInformer. + ProjectQueries() ProjectQueryInformer + // PublicServiceConfigs returns a PublicServiceConfigInformer. + PublicServiceConfigs() PublicServiceConfigInformer + // PublicServiceRTs returns a PublicServiceRTInformer. + PublicServiceRTs() PublicServiceRTInformer + // PublicServiceRouteConfigs returns a PublicServiceRouteConfigInformer. + PublicServiceRouteConfigs() PublicServiceRouteConfigInformer + // RPolicies returns a RPolicyInformer. + RPolicies() RPolicyInformer + // RemoteGatewayServiceConfigs returns a RemoteGatewayServiceConfigInformer. + RemoteGatewayServiceConfigs() RemoteGatewayServiceConfigInformer + // ResourceGroups returns a ResourceGroupInformer. + ResourceGroups() ResourceGroupInformer + // ResourceGroupRTs returns a ResourceGroupRTInformer. + ResourceGroupRTs() ResourceGroupRTInformer + // Roots returns a RootInformer. + Roots() RootInformer + // Runtimes returns a RuntimeInformer. + Runtimes() RuntimeInformer + // SLOFolders returns a SLOFolderInformer. + SLOFolders() SLOFolderInformer + // SLOPolicies returns a SLOPolicyInformer. + SLOPolicies() SLOPolicyInformer + // SchemaViolationDiscoveryRTs returns a SchemaViolationDiscoveryRTInformer. + SchemaViolationDiscoveryRTs() SchemaViolationDiscoveryRTInformer + // SecretHashes returns a SecretHashInformer. + SecretHashes() SecretHashInformer + // SecretRTConfigs returns a SecretRTConfigInformer. + SecretRTConfigs() SecretRTConfigInformer + // SecurityContextConstraintses returns a SecurityContextConstraintsInformer. + SecurityContextConstraintses() SecurityContextConstraintsInformer + // SecurityContextConstraintsConfigs returns a SecurityContextConstraintsConfigInformer. + SecurityContextConstraintsConfigs() SecurityContextConstraintsConfigInformer + // Services returns a ServiceInformer. + Services() ServiceInformer + // ServiceConfigs returns a ServiceConfigInformer. + ServiceConfigs() ServiceConfigInformer + // ServiceCronJobs returns a ServiceCronJobInformer. + ServiceCronJobs() ServiceCronJobInformer + // ServiceDaemonSets returns a ServiceDaemonSetInformer. + ServiceDaemonSets() ServiceDaemonSetInformer + // ServiceDeployments returns a ServiceDeploymentInformer. + ServiceDeployments() ServiceDeploymentInformer + // ServiceDeploymentContainers returns a ServiceDeploymentContainerInformer. + ServiceDeploymentContainers() ServiceDeploymentContainerInformer + // ServiceDirectoryEntryConfigs returns a ServiceDirectoryEntryConfigInformer. + ServiceDirectoryEntryConfigs() ServiceDirectoryEntryConfigInformer + // ServiceDirectoryNs returns a ServiceDirectoryNInformer. + ServiceDirectoryNs() ServiceDirectoryNInformer + // ServiceDirectoryRTs returns a ServiceDirectoryRTInformer. + ServiceDirectoryRTs() ServiceDirectoryRTInformer + // ServiceDirectoryRTFolders returns a ServiceDirectoryRTFolderInformer. + ServiceDirectoryRTFolders() ServiceDirectoryRTFolderInformer + // ServiceDirectoryRTFolderEntries returns a ServiceDirectoryRTFolderEntryInformer. + ServiceDirectoryRTFolderEntries() ServiceDirectoryRTFolderEntryInformer + // ServiceEntries returns a ServiceEntryInformer. + ServiceEntries() ServiceEntryInformer + // ServiceEntryConfigs returns a ServiceEntryConfigInformer. + ServiceEntryConfigs() ServiceEntryConfigInformer + // ServiceInstances returns a ServiceInstanceInformer. + ServiceInstances() ServiceInstanceInformer + // ServiceInstanceContainers returns a ServiceInstanceContainerInformer. + ServiceInstanceContainers() ServiceInstanceContainerInformer + // ServiceJobs returns a ServiceJobInformer. + ServiceJobs() ServiceJobInformer + // ServiceLevelObjectives returns a ServiceLevelObjectiveInformer. + ServiceLevelObjectives() ServiceLevelObjectiveInformer + // ServiceLevelObjectiveFolders returns a ServiceLevelObjectiveFolderInformer. + ServiceLevelObjectiveFolders() ServiceLevelObjectiveFolderInformer + // ServiceReplicaSets returns a ServiceReplicaSetInformer. + ServiceReplicaSets() ServiceReplicaSetInformer + // ServiceStatefulSets returns a ServiceStatefulSetInformer. + ServiceStatefulSets() ServiceStatefulSetInformer + // ServiceTemplates returns a ServiceTemplateInformer. + ServiceTemplates() ServiceTemplateInformer + // ServiceTemplateServiceDefinitions returns a ServiceTemplateServiceDefinitionInformer. + ServiceTemplateServiceDefinitions() ServiceTemplateServiceDefinitionInformer + // ServiceVersions returns a ServiceVersionInformer. + ServiceVersions() ServiceVersionInformer + // ServiceVersionConfigs returns a ServiceVersionConfigInformer. + ServiceVersionConfigs() ServiceVersionConfigInformer + // SharedServiceConfigs returns a SharedServiceConfigInformer. + SharedServiceConfigs() SharedServiceConfigInformer + // SloConfigs returns a SloConfigInformer. + SloConfigs() SloConfigInformer + // SloServiceConfigs returns a SloServiceConfigInformer. + SloServiceConfigs() SloServiceConfigInformer + // SvcGroups returns a SvcGroupInformer. + SvcGroups() SvcGroupInformer + // SvcGroupRTs returns a SvcGroupRTInformer. + SvcGroupRTs() SvcGroupRTInformer + // Tables returns a TableInformer. + Tables() TableInformer + // Templates returns a TemplateInformer. + Templates() TemplateInformer + // TemplateGroups returns a TemplateGroupInformer. + TemplateGroups() TemplateGroupInformer + // Tenants returns a TenantInformer. + Tenants() TenantInformer + // TenantResources returns a TenantResourceInformer. + TenantResources() TenantResourceInformer + // TenantTokens returns a TenantTokenInformer. + TenantTokens() TenantTokenInformer + // Users returns a UserInformer. + Users() UserInformer + // UserDiscoveries returns a UserDiscoveryInformer. + UserDiscoveries() UserDiscoveryInformer + // UserDiscoveryRTs returns a UserDiscoveryRTInformer. + UserDiscoveryRTs() UserDiscoveryRTInformer + // UserFolders returns a UserFolderInformer. + UserFolders() UserFolderInformer + // UserGroups returns a UserGroupInformer. + UserGroups() UserGroupInformer + // UserPreferences returns a UserPreferenceInformer. + UserPreferences() UserPreferenceInformer + // VirtualServices returns a VirtualServiceInformer. + VirtualServices() VirtualServiceInformer + // WorkloadEntries returns a WorkloadEntryInformer. + WorkloadEntries() WorkloadEntryInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// ACPConfigs returns a ACPConfigInformer. +func (v *version) ACPConfigs() ACPConfigInformer { + return &aCPConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AccessControlPolicies returns a AccessControlPolicyInformer. +func (v *version) AccessControlPolicies() AccessControlPolicyInformer { + return &accessControlPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AccessTokens returns a AccessTokenInformer. +func (v *version) AccessTokens() AccessTokenInformer { + return &accessTokenInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AdditionalAttributeses returns a AdditionalAttributesInformer. +func (v *version) AdditionalAttributeses() AdditionalAttributesInformer { + return &additionalAttributesInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AllSparkServiceses returns a AllSparkServicesInformer. +func (v *version) AllSparkServiceses() AllSparkServicesInformer { + return &allSparkServicesInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Annotations returns a AnnotationInformer. +func (v *version) Annotations() AnnotationInformer { + return &annotationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ApiDiscoveries returns a ApiDiscoveryInformer. +func (v *version) ApiDiscoveries() ApiDiscoveryInformer { + return &apiDiscoveryInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ApiDiscoveryRTs returns a ApiDiscoveryRTInformer. +func (v *version) ApiDiscoveryRTs() ApiDiscoveryRTInformer { + return &apiDiscoveryRTInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Apps returns a AppInformer. +func (v *version) Apps() AppInformer { + return &appInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AppFolders returns a AppFolderInformer. +func (v *version) AppFolders() AppFolderInformer { + return &appFolderInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AppGroups returns a AppGroupInformer. +func (v *version) AppGroups() AppGroupInformer { + return &appGroupInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AppTemplates returns a AppTemplateInformer. +func (v *version) AppTemplates() AppTemplateInformer { + return &appTemplateInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AppTemplateServiceDefinitions returns a AppTemplateServiceDefinitionInformer. +func (v *version) AppTemplateServiceDefinitions() AppTemplateServiceDefinitionInformer { + return &appTemplateServiceDefinitionInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AppUsers returns a AppUserInformer. +func (v *version) AppUsers() AppUserInformer { + return &appUserInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AppVersions returns a AppVersionInformer. +func (v *version) AppVersions() AppVersionInformer { + return &appVersionInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ApplicationInfos returns a ApplicationInfoInformer. +func (v *version) ApplicationInfos() ApplicationInfoInformer { + return &applicationInfoInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AttackDiscoveries returns a AttackDiscoveryInformer. +func (v *version) AttackDiscoveries() AttackDiscoveryInformer { + return &attackDiscoveryInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AttackDiscoveryRTs returns a AttackDiscoveryRTInformer. +func (v *version) AttackDiscoveryRTs() AttackDiscoveryRTInformer { + return &attackDiscoveryRTInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AuthenticationPolicies returns a AuthenticationPolicyInformer. +func (v *version) AuthenticationPolicies() AuthenticationPolicyInformer { + return &authenticationPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Autoscalers returns a AutoscalerInformer. +func (v *version) Autoscalers() AutoscalerInformer { + return &autoscalerInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AutoscalerCRs returns a AutoscalerCRInformer. +func (v *version) AutoscalerCRs() AutoscalerCRInformer { + return &autoscalerCRInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AutoscalerConfigs returns a AutoscalerConfigInformer. +func (v *version) AutoscalerConfigs() AutoscalerConfigInformer { + return &autoscalerConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AutoscalerFolders returns a AutoscalerFolderInformer. +func (v *version) AutoscalerFolders() AutoscalerFolderInformer { + return &autoscalerFolderInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AutoscalingPolicies returns a AutoscalingPolicyInformer. +func (v *version) AutoscalingPolicies() AutoscalingPolicyInformer { + return &autoscalingPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// AwsConnectors returns a AwsConnectorInformer. +func (v *version) AwsConnectors() AwsConnectorInformer { + return &awsConnectorInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Buckets returns a BucketInformer. +func (v *version) Buckets() BucketInformer { + return &bucketInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Certificates returns a CertificateInformer. +func (v *version) Certificates() CertificateInformer { + return &certificateInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// CertificateAuthorityConfigNs returns a CertificateAuthorityConfigNInformer. +func (v *version) CertificateAuthorityConfigNs() CertificateAuthorityConfigNInformer { + return &certificateAuthorityConfigNInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// CertificateAuthorityRTs returns a CertificateAuthorityRTInformer. +func (v *version) CertificateAuthorityRTs() CertificateAuthorityRTInformer { + return &certificateAuthorityRTInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// CertificateConfigNs returns a CertificateConfigNInformer. +func (v *version) CertificateConfigNs() CertificateConfigNInformer { + return &certificateConfigNInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// CertificateRequests returns a CertificateRequestInformer. +func (v *version) CertificateRequests() CertificateRequestInformer { + return &certificateRequestInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Clusters returns a ClusterInformer. +func (v *version) Clusters() ClusterInformer { + return &clusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ClusterConfigs returns a ClusterConfigInformer. +func (v *version) ClusterConfigs() ClusterConfigInformer { + return &clusterConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ClusterConfigFolders returns a ClusterConfigFolderInformer. +func (v *version) ClusterConfigFolders() ClusterConfigFolderInformer { + return &clusterConfigFolderInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ClusterFolders returns a ClusterFolderInformer. +func (v *version) ClusterFolders() ClusterFolderInformer { + return &clusterFolderInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ClusterSettingses returns a ClusterSettingsInformer. +func (v *version) ClusterSettingses() ClusterSettingsInformer { + return &clusterSettingsInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Configs returns a ConfigInformer. +func (v *version) Configs() ConfigInformer { + return &configInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ConfigMaps returns a ConfigMapInformer. +func (v *version) ConfigMaps() ConfigMapInformer { + return &configMapInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ConnectionStatuses returns a ConnectionStatusInformer. +func (v *version) ConnectionStatuses() ConnectionStatusInformer { + return &connectionStatusInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// DCRegions returns a DCRegionInformer. +func (v *version) DCRegions() DCRegionInformer { + return &dCRegionInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// DCZones returns a DCZoneInformer. +func (v *version) DCZones() DCZoneInformer { + return &dCZoneInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// DNSConfigs returns a DNSConfigInformer. +func (v *version) DNSConfigs() DNSConfigInformer { + return &dNSConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// DNSConfigFolders returns a DNSConfigFolderInformer. +func (v *version) DNSConfigFolders() DNSConfigFolderInformer { + return &dNSConfigFolderInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// DNSProbeConfigs returns a DNSProbeConfigInformer. +func (v *version) DNSProbeConfigs() DNSProbeConfigInformer { + return &dNSProbeConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// DNSProbeStatuses returns a DNSProbeStatusInformer. +func (v *version) DNSProbeStatuses() DNSProbeStatusInformer { + return &dNSProbeStatusInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// DNSProbesConfigFolders returns a DNSProbesConfigFolderInformer. +func (v *version) DNSProbesConfigFolders() DNSProbesConfigFolderInformer { + return &dNSProbesConfigFolderInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// DataFolders returns a DataFolderInformer. +func (v *version) DataFolders() DataFolderInformer { + return &dataFolderInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// DataFolderDomains returns a DataFolderDomainInformer. +func (v *version) DataFolderDomains() DataFolderDomainInformer { + return &dataFolderDomainInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// DataFolderDomainClusters returns a DataFolderDomainClusterInformer. +func (v *version) DataFolderDomainClusters() DataFolderDomainClusterInformer { + return &dataFolderDomainClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// DataFolderDomainServices returns a DataFolderDomainServiceInformer. +func (v *version) DataFolderDomainServices() DataFolderDomainServiceInformer { + return &dataFolderDomainServiceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// DataFolderDomainServiceVersions returns a DataFolderDomainServiceVersionInformer. +func (v *version) DataFolderDomainServiceVersions() DataFolderDomainServiceVersionInformer { + return &dataFolderDomainServiceVersionInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// DataGroups returns a DataGroupInformer. +func (v *version) DataGroups() DataGroupInformer { + return &dataGroupInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// DataTemplates returns a DataTemplateInformer. +func (v *version) DataTemplates() DataTemplateInformer { + return &dataTemplateInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Databases returns a DatabaseInformer. +func (v *version) Databases() DatabaseInformer { + return &databaseInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// DestinationRules returns a DestinationRuleInformer. +func (v *version) DestinationRules() DestinationRuleInformer { + return &destinationRuleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Directories returns a DirectoryInformer. +func (v *version) Directories() DirectoryInformer { + return &directoryInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Domains returns a DomainInformer. +func (v *version) Domains() DomainInformer { + return &domainInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// DomainConfigs returns a DomainConfigInformer. +func (v *version) DomainConfigs() DomainConfigInformer { + return &domainConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Endpoints returns a EndpointsInformer. +func (v *version) Endpoints() EndpointsInformer { + return &endpointsInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// EnvoyFilters returns a EnvoyFilterInformer. +func (v *version) EnvoyFilters() EnvoyFilterInformer { + return &envoyFilterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalAccountConfigNs returns a ExternalAccountConfigNInformer. +func (v *version) ExternalAccountConfigNs() ExternalAccountConfigNInformer { + return &externalAccountConfigNInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalAuditStorages returns a ExternalAuditStorageInformer. +func (v *version) ExternalAuditStorages() ExternalAuditStorageInformer { + return &externalAuditStorageInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalDNSConfigNs returns a ExternalDNSConfigNInformer. +func (v *version) ExternalDNSConfigNs() ExternalDNSConfigNInformer { + return &externalDNSConfigNInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalDNSInventories returns a ExternalDNSInventoryInformer. +func (v *version) ExternalDNSInventories() ExternalDNSInventoryInformer { + return &externalDNSInventoryInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalDNSInventoryHealthChecks returns a ExternalDNSInventoryHealthCheckInformer. +func (v *version) ExternalDNSInventoryHealthChecks() ExternalDNSInventoryHealthCheckInformer { + return &externalDNSInventoryHealthCheckInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalDNSInventoryPrimaryDomains returns a ExternalDNSInventoryPrimaryDomainInformer. +func (v *version) ExternalDNSInventoryPrimaryDomains() ExternalDNSInventoryPrimaryDomainInformer { + return &externalDNSInventoryPrimaryDomainInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalDNSInventoryRecords returns a ExternalDNSInventoryRecordInformer. +func (v *version) ExternalDNSInventoryRecords() ExternalDNSInventoryRecordInformer { + return &externalDNSInventoryRecordInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalDNSInventoryZones returns a ExternalDNSInventoryZoneInformer. +func (v *version) ExternalDNSInventoryZones() ExternalDNSInventoryZoneInformer { + return &externalDNSInventoryZoneInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalDNSRuntimes returns a ExternalDNSRuntimeInformer. +func (v *version) ExternalDNSRuntimes() ExternalDNSRuntimeInformer { + return &externalDNSRuntimeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalDNSRuntimeEndpoints returns a ExternalDNSRuntimeEndpointInformer. +func (v *version) ExternalDNSRuntimeEndpoints() ExternalDNSRuntimeEndpointInformer { + return &externalDNSRuntimeEndpointInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalDNSRuntimePrimaryDomains returns a ExternalDNSRuntimePrimaryDomainInformer. +func (v *version) ExternalDNSRuntimePrimaryDomains() ExternalDNSRuntimePrimaryDomainInformer { + return &externalDNSRuntimePrimaryDomainInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalDNSRuntimeSubdomains returns a ExternalDNSRuntimeSubdomainInformer. +func (v *version) ExternalDNSRuntimeSubdomains() ExternalDNSRuntimeSubdomainInformer { + return &externalDNSRuntimeSubdomainInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalLBConfigNs returns a ExternalLBConfigNInformer. +func (v *version) ExternalLBConfigNs() ExternalLBConfigNInformer { + return &externalLBConfigNInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalPluginCapabilities returns a ExternalPluginCapabilityInformer. +func (v *version) ExternalPluginCapabilities() ExternalPluginCapabilityInformer { + return &externalPluginCapabilityInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalPluginConfigs returns a ExternalPluginConfigInformer. +func (v *version) ExternalPluginConfigs() ExternalPluginConfigInformer { + return &externalPluginConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalPluginConfigFolders returns a ExternalPluginConfigFolderInformer. +func (v *version) ExternalPluginConfigFolders() ExternalPluginConfigFolderInformer { + return &externalPluginConfigFolderInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalPluginInstanceConfigs returns a ExternalPluginInstanceConfigInformer. +func (v *version) ExternalPluginInstanceConfigs() ExternalPluginInstanceConfigInformer { + return &externalPluginInstanceConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalPluginMonitors returns a ExternalPluginMonitorInformer. +func (v *version) ExternalPluginMonitors() ExternalPluginMonitorInformer { + return &externalPluginMonitorInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalServiceConfigs returns a ExternalServiceConfigInformer. +func (v *version) ExternalServiceConfigs() ExternalServiceConfigInformer { + return &externalServiceConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ExternalServicesRTs returns a ExternalServicesRTInformer. +func (v *version) ExternalServicesRTs() ExternalServicesRTInformer { + return &externalServicesRTInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// FeatureFlags returns a FeatureFlagInformer. +func (v *version) FeatureFlags() FeatureFlagInformer { + return &featureFlagInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// FederatedSloConfigs returns a FederatedSloConfigInformer. +func (v *version) FederatedSloConfigs() FederatedSloConfigInformer { + return &federatedSloConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// FederatedSloServiceConfigs returns a FederatedSloServiceConfigInformer. +func (v *version) FederatedSloServiceConfigs() FederatedSloServiceConfigInformer { + return &federatedSloServiceConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GNSs returns a GNSInformer. +func (v *version) GNSs() GNSInformer { + return &gNSInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GNSRoutingConfigs returns a GNSRoutingConfigInformer. +func (v *version) GNSRoutingConfigs() GNSRoutingConfigInformer { + return &gNSRoutingConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GNSSvcGroups returns a GNSSvcGroupInformer. +func (v *version) GNSSvcGroups() GNSSvcGroupInformer { + return &gNSSvcGroupInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Gateways returns a GatewayInformer. +func (v *version) Gateways() GatewayInformer { + return &gatewayInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GatewayConfigs returns a GatewayConfigInformer. +func (v *version) GatewayConfigs() GatewayConfigInformer { + return &gatewayConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GatewayConfigAdditionalListenerses returns a GatewayConfigAdditionalListenersInformer. +func (v *version) GatewayConfigAdditionalListenerses() GatewayConfigAdditionalListenersInformer { + return &gatewayConfigAdditionalListenersInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GatewayConfigListenerCertificates returns a GatewayConfigListenerCertificateInformer. +func (v *version) GatewayConfigListenerCertificates() GatewayConfigListenerCertificateInformer { + return &gatewayConfigListenerCertificateInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GatewayConfigListenerDestinationRoutes returns a GatewayConfigListenerDestinationRouteInformer. +func (v *version) GatewayConfigListenerDestinationRoutes() GatewayConfigListenerDestinationRouteInformer { + return &gatewayConfigListenerDestinationRouteInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GeoDiscoveries returns a GeoDiscoveryInformer. +func (v *version) GeoDiscoveries() GeoDiscoveryInformer { + return &geoDiscoveryInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GeoDiscoveryRTs returns a GeoDiscoveryRTInformer. +func (v *version) GeoDiscoveryRTs() GeoDiscoveryRTInformer { + return &geoDiscoveryRTInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GlobalNamespaces returns a GlobalNamespaceInformer. +func (v *version) GlobalNamespaces() GlobalNamespaceInformer { + return &globalNamespaceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GlobalNses returns a GlobalNsInformer. +func (v *version) GlobalNses() GlobalNsInformer { + return &globalNsInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GlobalRegistrationServices returns a GlobalRegistrationServiceInformer. +func (v *version) GlobalRegistrationServices() GlobalRegistrationServiceInformer { + return &globalRegistrationServiceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GnsAccessControlPolicies returns a GnsAccessControlPolicyInformer. +func (v *version) GnsAccessControlPolicies() GnsAccessControlPolicyInformer { + return &gnsAccessControlPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GnsAccessControlPolicyRTs returns a GnsAccessControlPolicyRTInformer. +func (v *version) GnsAccessControlPolicyRTs() GnsAccessControlPolicyRTInformer { + return &gnsAccessControlPolicyRTInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GnsBindingRTs returns a GnsBindingRTInformer. +func (v *version) GnsBindingRTs() GnsBindingRTInformer { + return &gnsBindingRTInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GnsEndpointsConfigs returns a GnsEndpointsConfigInformer. +func (v *version) GnsEndpointsConfigs() GnsEndpointsConfigInformer { + return &gnsEndpointsConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GnsRoutingRuleConfigs returns a GnsRoutingRuleConfigInformer. +func (v *version) GnsRoutingRuleConfigs() GnsRoutingRuleConfigInformer { + return &gnsRoutingRuleConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GnsSchemaViolationDiscoveries returns a GnsSchemaViolationDiscoveryInformer. +func (v *version) GnsSchemaViolationDiscoveries() GnsSchemaViolationDiscoveryInformer { + return &gnsSchemaViolationDiscoveryInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GnsSegmentationPolicies returns a GnsSegmentationPolicyInformer. +func (v *version) GnsSegmentationPolicies() GnsSegmentationPolicyInformer { + return &gnsSegmentationPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GnsSegmentationPolicyRTs returns a GnsSegmentationPolicyRTInformer. +func (v *version) GnsSegmentationPolicyRTs() GnsSegmentationPolicyRTInformer { + return &gnsSegmentationPolicyRTInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GnsServiceEntryConfigs returns a GnsServiceEntryConfigInformer. +func (v *version) GnsServiceEntryConfigs() GnsServiceEntryConfigInformer { + return &gnsServiceEntryConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// GnsSvcGroupRTs returns a GnsSvcGroupRTInformer. +func (v *version) GnsSvcGroupRTs() GnsSvcGroupRTInformer { + return &gnsSvcGroupRTInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// HaConfigs returns a HaConfigInformer. +func (v *version) HaConfigs() HaConfigInformer { + return &haConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// HaConfigV2s returns a HaConfigV2Informer. +func (v *version) HaConfigV2s() HaConfigV2Informer { + return &haConfigV2Informer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// HealthCheckConfigNs returns a HealthCheckConfigNInformer. +func (v *version) HealthCheckConfigNs() HealthCheckConfigNInformer { + return &healthCheckConfigNInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// HostConfigs returns a HostConfigInformer. +func (v *version) HostConfigs() HostConfigInformer { + return &hostConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// HostConfigV2s returns a HostConfigV2Informer. +func (v *version) HostConfigV2s() HostConfigV2Informer { + return &hostConfigV2Informer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// InboundAuthenticationConfigs returns a InboundAuthenticationConfigInformer. +func (v *version) InboundAuthenticationConfigs() InboundAuthenticationConfigInformer { + return &inboundAuthenticationConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Inventories returns a InventoryInformer. +func (v *version) Inventories() InventoryInformer { + return &inventoryInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Issuers returns a IssuerInformer. +func (v *version) Issuers() IssuerInformer { + return &issuerInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Jobs returns a JobInformer. +func (v *version) Jobs() JobInformer { + return &jobInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// JobConfigs returns a JobConfigInformer. +func (v *version) JobConfigs() JobConfigInformer { + return &jobConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// JobConfigFolders returns a JobConfigFolderInformer. +func (v *version) JobConfigFolders() JobConfigFolderInformer { + return &jobConfigFolderInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// JobFolders returns a JobFolderInformer. +func (v *version) JobFolders() JobFolderInformer { + return &jobFolderInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// KnativeIngresses returns a KnativeIngressInformer. +func (v *version) KnativeIngresses() KnativeIngressInformer { + return &knativeIngressInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// LabelConfigs returns a LabelConfigInformer. +func (v *version) LabelConfigs() LabelConfigInformer { + return &labelConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// LocalRegistrationServices returns a LocalRegistrationServiceInformer. +func (v *version) LocalRegistrationServices() LocalRegistrationServiceInformer { + return &localRegistrationServiceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// LocalRegistrationServiceClusters returns a LocalRegistrationServiceClusterInformer. +func (v *version) LocalRegistrationServiceClusters() LocalRegistrationServiceClusterInformer { + return &localRegistrationServiceClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// LocalRegistrationServiceResources returns a LocalRegistrationServiceResourceInformer. +func (v *version) LocalRegistrationServiceResources() LocalRegistrationServiceResourceInformer { + return &localRegistrationServiceResourceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Logs returns a LogInformer. +func (v *version) Logs() LogInformer { + return &logInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// LogFolders returns a LogFolderInformer. +func (v *version) LogFolders() LogFolderInformer { + return &logFolderInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// MetricMonitors returns a MetricMonitorInformer. +func (v *version) MetricMonitors() MetricMonitorInformer { + return &metricMonitorInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// NetworkAttachmentDefinitions returns a NetworkAttachmentDefinitionInformer. +func (v *version) NetworkAttachmentDefinitions() NetworkAttachmentDefinitionInformer { + return &networkAttachmentDefinitionInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// NetworkAttachmentDefinitionConfigs returns a NetworkAttachmentDefinitionConfigInformer. +func (v *version) NetworkAttachmentDefinitionConfigs() NetworkAttachmentDefinitionConfigInformer { + return &networkAttachmentDefinitionConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Nodes returns a NodeInformer. +func (v *version) Nodes() NodeInformer { + return &nodeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// NodeDefinitions returns a NodeDefinitionInformer. +func (v *version) NodeDefinitions() NodeDefinitionInformer { + return &nodeDefinitionInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// NodeFolders returns a NodeFolderInformer. +func (v *version) NodeFolders() NodeFolderInformer { + return &nodeFolderInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// NodeFolderClusters returns a NodeFolderClusterInformer. +func (v *version) NodeFolderClusters() NodeFolderClusterInformer { + return &nodeFolderClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// NodeGroups returns a NodeGroupInformer. +func (v *version) NodeGroups() NodeGroupInformer { + return &nodeGroupInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// NodeStatuses returns a NodeStatusInformer. +func (v *version) NodeStatuses() NodeStatusInformer { + return &nodeStatusInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// NodeTemplates returns a NodeTemplateInformer. +func (v *version) NodeTemplates() NodeTemplateInformer { + return &nodeTemplateInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// OutboundAuthenticationModes returns a OutboundAuthenticationModeInformer. +func (v *version) OutboundAuthenticationModes() OutboundAuthenticationModeInformer { + return &outboundAuthenticationModeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// PeerAuthentications returns a PeerAuthenticationInformer. +func (v *version) PeerAuthentications() PeerAuthenticationInformer { + return &peerAuthenticationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// PiiDiscoveries returns a PiiDiscoveryInformer. +func (v *version) PiiDiscoveries() PiiDiscoveryInformer { + return &piiDiscoveryInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// PiiDiscoveryRTs returns a PiiDiscoveryRTInformer. +func (v *version) PiiDiscoveryRTs() PiiDiscoveryRTInformer { + return &piiDiscoveryRTInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// PolicyConfigs returns a PolicyConfigInformer. +func (v *version) PolicyConfigs() PolicyConfigInformer { + return &policyConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// PolicyTemplates returns a PolicyTemplateInformer. +func (v *version) PolicyTemplates() PolicyTemplateInformer { + return &policyTemplateInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ProgressiveUpgrades returns a ProgressiveUpgradeInformer. +func (v *version) ProgressiveUpgrades() ProgressiveUpgradeInformer { + return &progressiveUpgradeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ProgressiveUpgradeConfigs returns a ProgressiveUpgradeConfigInformer. +func (v *version) ProgressiveUpgradeConfigs() ProgressiveUpgradeConfigInformer { + return &progressiveUpgradeConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ProgressiveUpgradeFolders returns a ProgressiveUpgradeFolderInformer. +func (v *version) ProgressiveUpgradeFolders() ProgressiveUpgradeFolderInformer { + return &progressiveUpgradeFolderInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ProgressiveUpgradeRuntimes returns a ProgressiveUpgradeRuntimeInformer. +func (v *version) ProgressiveUpgradeRuntimes() ProgressiveUpgradeRuntimeInformer { + return &progressiveUpgradeRuntimeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Projects returns a ProjectInformer. +func (v *version) Projects() ProjectInformer { + return &projectInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ProjectConfigs returns a ProjectConfigInformer. +func (v *version) ProjectConfigs() ProjectConfigInformer { + return &projectConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ProjectInventories returns a ProjectInventoryInformer. +func (v *version) ProjectInventories() ProjectInventoryInformer { + return &projectInventoryInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ProjectQueries returns a ProjectQueryInformer. +func (v *version) ProjectQueries() ProjectQueryInformer { + return &projectQueryInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// PublicServiceConfigs returns a PublicServiceConfigInformer. +func (v *version) PublicServiceConfigs() PublicServiceConfigInformer { + return &publicServiceConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// PublicServiceRTs returns a PublicServiceRTInformer. +func (v *version) PublicServiceRTs() PublicServiceRTInformer { + return &publicServiceRTInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// PublicServiceRouteConfigs returns a PublicServiceRouteConfigInformer. +func (v *version) PublicServiceRouteConfigs() PublicServiceRouteConfigInformer { + return &publicServiceRouteConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// RPolicies returns a RPolicyInformer. +func (v *version) RPolicies() RPolicyInformer { + return &rPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// RemoteGatewayServiceConfigs returns a RemoteGatewayServiceConfigInformer. +func (v *version) RemoteGatewayServiceConfigs() RemoteGatewayServiceConfigInformer { + return &remoteGatewayServiceConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ResourceGroups returns a ResourceGroupInformer. +func (v *version) ResourceGroups() ResourceGroupInformer { + return &resourceGroupInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ResourceGroupRTs returns a ResourceGroupRTInformer. +func (v *version) ResourceGroupRTs() ResourceGroupRTInformer { + return &resourceGroupRTInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Roots returns a RootInformer. +func (v *version) Roots() RootInformer { + return &rootInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Runtimes returns a RuntimeInformer. +func (v *version) Runtimes() RuntimeInformer { + return &runtimeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// SLOFolders returns a SLOFolderInformer. +func (v *version) SLOFolders() SLOFolderInformer { + return &sLOFolderInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// SLOPolicies returns a SLOPolicyInformer. +func (v *version) SLOPolicies() SLOPolicyInformer { + return &sLOPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// SchemaViolationDiscoveryRTs returns a SchemaViolationDiscoveryRTInformer. +func (v *version) SchemaViolationDiscoveryRTs() SchemaViolationDiscoveryRTInformer { + return &schemaViolationDiscoveryRTInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// SecretHashes returns a SecretHashInformer. +func (v *version) SecretHashes() SecretHashInformer { + return &secretHashInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// SecretRTConfigs returns a SecretRTConfigInformer. +func (v *version) SecretRTConfigs() SecretRTConfigInformer { + return &secretRTConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// SecurityContextConstraintses returns a SecurityContextConstraintsInformer. +func (v *version) SecurityContextConstraintses() SecurityContextConstraintsInformer { + return &securityContextConstraintsInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// SecurityContextConstraintsConfigs returns a SecurityContextConstraintsConfigInformer. +func (v *version) SecurityContextConstraintsConfigs() SecurityContextConstraintsConfigInformer { + return &securityContextConstraintsConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Services returns a ServiceInformer. +func (v *version) Services() ServiceInformer { + return &serviceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceConfigs returns a ServiceConfigInformer. +func (v *version) ServiceConfigs() ServiceConfigInformer { + return &serviceConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceCronJobs returns a ServiceCronJobInformer. +func (v *version) ServiceCronJobs() ServiceCronJobInformer { + return &serviceCronJobInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceDaemonSets returns a ServiceDaemonSetInformer. +func (v *version) ServiceDaemonSets() ServiceDaemonSetInformer { + return &serviceDaemonSetInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceDeployments returns a ServiceDeploymentInformer. +func (v *version) ServiceDeployments() ServiceDeploymentInformer { + return &serviceDeploymentInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceDeploymentContainers returns a ServiceDeploymentContainerInformer. +func (v *version) ServiceDeploymentContainers() ServiceDeploymentContainerInformer { + return &serviceDeploymentContainerInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceDirectoryEntryConfigs returns a ServiceDirectoryEntryConfigInformer. +func (v *version) ServiceDirectoryEntryConfigs() ServiceDirectoryEntryConfigInformer { + return &serviceDirectoryEntryConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceDirectoryNs returns a ServiceDirectoryNInformer. +func (v *version) ServiceDirectoryNs() ServiceDirectoryNInformer { + return &serviceDirectoryNInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceDirectoryRTs returns a ServiceDirectoryRTInformer. +func (v *version) ServiceDirectoryRTs() ServiceDirectoryRTInformer { + return &serviceDirectoryRTInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceDirectoryRTFolders returns a ServiceDirectoryRTFolderInformer. +func (v *version) ServiceDirectoryRTFolders() ServiceDirectoryRTFolderInformer { + return &serviceDirectoryRTFolderInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceDirectoryRTFolderEntries returns a ServiceDirectoryRTFolderEntryInformer. +func (v *version) ServiceDirectoryRTFolderEntries() ServiceDirectoryRTFolderEntryInformer { + return &serviceDirectoryRTFolderEntryInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceEntries returns a ServiceEntryInformer. +func (v *version) ServiceEntries() ServiceEntryInformer { + return &serviceEntryInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceEntryConfigs returns a ServiceEntryConfigInformer. +func (v *version) ServiceEntryConfigs() ServiceEntryConfigInformer { + return &serviceEntryConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceInstances returns a ServiceInstanceInformer. +func (v *version) ServiceInstances() ServiceInstanceInformer { + return &serviceInstanceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceInstanceContainers returns a ServiceInstanceContainerInformer. +func (v *version) ServiceInstanceContainers() ServiceInstanceContainerInformer { + return &serviceInstanceContainerInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceJobs returns a ServiceJobInformer. +func (v *version) ServiceJobs() ServiceJobInformer { + return &serviceJobInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceLevelObjectives returns a ServiceLevelObjectiveInformer. +func (v *version) ServiceLevelObjectives() ServiceLevelObjectiveInformer { + return &serviceLevelObjectiveInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceLevelObjectiveFolders returns a ServiceLevelObjectiveFolderInformer. +func (v *version) ServiceLevelObjectiveFolders() ServiceLevelObjectiveFolderInformer { + return &serviceLevelObjectiveFolderInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceReplicaSets returns a ServiceReplicaSetInformer. +func (v *version) ServiceReplicaSets() ServiceReplicaSetInformer { + return &serviceReplicaSetInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceStatefulSets returns a ServiceStatefulSetInformer. +func (v *version) ServiceStatefulSets() ServiceStatefulSetInformer { + return &serviceStatefulSetInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceTemplates returns a ServiceTemplateInformer. +func (v *version) ServiceTemplates() ServiceTemplateInformer { + return &serviceTemplateInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceTemplateServiceDefinitions returns a ServiceTemplateServiceDefinitionInformer. +func (v *version) ServiceTemplateServiceDefinitions() ServiceTemplateServiceDefinitionInformer { + return &serviceTemplateServiceDefinitionInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceVersions returns a ServiceVersionInformer. +func (v *version) ServiceVersions() ServiceVersionInformer { + return &serviceVersionInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceVersionConfigs returns a ServiceVersionConfigInformer. +func (v *version) ServiceVersionConfigs() ServiceVersionConfigInformer { + return &serviceVersionConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// SharedServiceConfigs returns a SharedServiceConfigInformer. +func (v *version) SharedServiceConfigs() SharedServiceConfigInformer { + return &sharedServiceConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// SloConfigs returns a SloConfigInformer. +func (v *version) SloConfigs() SloConfigInformer { + return &sloConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// SloServiceConfigs returns a SloServiceConfigInformer. +func (v *version) SloServiceConfigs() SloServiceConfigInformer { + return &sloServiceConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// SvcGroups returns a SvcGroupInformer. +func (v *version) SvcGroups() SvcGroupInformer { + return &svcGroupInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// SvcGroupRTs returns a SvcGroupRTInformer. +func (v *version) SvcGroupRTs() SvcGroupRTInformer { + return &svcGroupRTInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Tables returns a TableInformer. +func (v *version) Tables() TableInformer { + return &tableInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Templates returns a TemplateInformer. +func (v *version) Templates() TemplateInformer { + return &templateInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// TemplateGroups returns a TemplateGroupInformer. +func (v *version) TemplateGroups() TemplateGroupInformer { + return &templateGroupInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Tenants returns a TenantInformer. +func (v *version) Tenants() TenantInformer { + return &tenantInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// TenantResources returns a TenantResourceInformer. +func (v *version) TenantResources() TenantResourceInformer { + return &tenantResourceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// TenantTokens returns a TenantTokenInformer. +func (v *version) TenantTokens() TenantTokenInformer { + return &tenantTokenInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Users returns a UserInformer. +func (v *version) Users() UserInformer { + return &userInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// UserDiscoveries returns a UserDiscoveryInformer. +func (v *version) UserDiscoveries() UserDiscoveryInformer { + return &userDiscoveryInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// UserDiscoveryRTs returns a UserDiscoveryRTInformer. +func (v *version) UserDiscoveryRTs() UserDiscoveryRTInformer { + return &userDiscoveryRTInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// UserFolders returns a UserFolderInformer. +func (v *version) UserFolders() UserFolderInformer { + return &userFolderInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// UserGroups returns a UserGroupInformer. +func (v *version) UserGroups() UserGroupInformer { + return &userGroupInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// UserPreferences returns a UserPreferenceInformer. +func (v *version) UserPreferences() UserPreferenceInformer { + return &userPreferenceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// VirtualServices returns a VirtualServiceInformer. +func (v *version) VirtualServices() VirtualServiceInformer { + return &virtualServiceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// WorkloadEntries returns a WorkloadEntryInformer. +func (v *version) WorkloadEntries() WorkloadEntryInformer { + return &workloadEntryInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/inventory.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/inventory.go new file mode 100644 index 000000000..eca9f8dc0 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/inventory.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// InventoryInformer provides access to a shared informer and lister for +// Inventories. +type InventoryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.InventoryLister +} + +type inventoryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewInventoryInformer constructs a new informer for Inventory type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewInventoryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredInventoryInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredInventoryInformer constructs a new informer for Inventory type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredInventoryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Inventories().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Inventories().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Inventory{}, + resyncPeriod, + indexers, + ) +} + +func (f *inventoryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredInventoryInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *inventoryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Inventory{}, f.defaultInformer) +} + +func (f *inventoryInformer) Lister() v1.InventoryLister { + return v1.NewInventoryLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/issuer.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/issuer.go new file mode 100644 index 000000000..9f1fd672e --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/issuer.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// IssuerInformer provides access to a shared informer and lister for +// Issuers. +type IssuerInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.IssuerLister +} + +type issuerInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewIssuerInformer constructs a new informer for Issuer type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewIssuerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredIssuerInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredIssuerInformer constructs a new informer for Issuer type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredIssuerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Issuers().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Issuers().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Issuer{}, + resyncPeriod, + indexers, + ) +} + +func (f *issuerInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredIssuerInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *issuerInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Issuer{}, f.defaultInformer) +} + +func (f *issuerInformer) Lister() v1.IssuerLister { + return v1.NewIssuerLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/job.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/job.go new file mode 100644 index 000000000..5e70cea4d --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/job.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// JobInformer provides access to a shared informer and lister for +// Jobs. +type JobInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.JobLister +} + +type jobInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewJobInformer constructs a new informer for Job type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewJobInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredJobInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredJobInformer constructs a new informer for Job type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredJobInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Jobs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Jobs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Job{}, + resyncPeriod, + indexers, + ) +} + +func (f *jobInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredJobInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *jobInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Job{}, f.defaultInformer) +} + +func (f *jobInformer) Lister() v1.JobLister { + return v1.NewJobLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/jobconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/jobconfig.go new file mode 100644 index 000000000..afc7ee016 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/jobconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// JobConfigInformer provides access to a shared informer and lister for +// JobConfigs. +type JobConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.JobConfigLister +} + +type jobConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewJobConfigInformer constructs a new informer for JobConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewJobConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredJobConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredJobConfigInformer constructs a new informer for JobConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredJobConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().JobConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().JobConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.JobConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *jobConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredJobConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *jobConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.JobConfig{}, f.defaultInformer) +} + +func (f *jobConfigInformer) Lister() v1.JobConfigLister { + return v1.NewJobConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/jobconfigfolder.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/jobconfigfolder.go new file mode 100644 index 000000000..b12339952 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/jobconfigfolder.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// JobConfigFolderInformer provides access to a shared informer and lister for +// JobConfigFolders. +type JobConfigFolderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.JobConfigFolderLister +} + +type jobConfigFolderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewJobConfigFolderInformer constructs a new informer for JobConfigFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewJobConfigFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredJobConfigFolderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredJobConfigFolderInformer constructs a new informer for JobConfigFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredJobConfigFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().JobConfigFolders().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().JobConfigFolders().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.JobConfigFolder{}, + resyncPeriod, + indexers, + ) +} + +func (f *jobConfigFolderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredJobConfigFolderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *jobConfigFolderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.JobConfigFolder{}, f.defaultInformer) +} + +func (f *jobConfigFolderInformer) Lister() v1.JobConfigFolderLister { + return v1.NewJobConfigFolderLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/jobfolder.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/jobfolder.go new file mode 100644 index 000000000..3d687c7a3 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/jobfolder.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// JobFolderInformer provides access to a shared informer and lister for +// JobFolders. +type JobFolderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.JobFolderLister +} + +type jobFolderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewJobFolderInformer constructs a new informer for JobFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewJobFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredJobFolderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredJobFolderInformer constructs a new informer for JobFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredJobFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().JobFolders().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().JobFolders().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.JobFolder{}, + resyncPeriod, + indexers, + ) +} + +func (f *jobFolderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredJobFolderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *jobFolderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.JobFolder{}, f.defaultInformer) +} + +func (f *jobFolderInformer) Lister() v1.JobFolderLister { + return v1.NewJobFolderLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/knativeingress.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/knativeingress.go new file mode 100644 index 000000000..b74c7ac8c --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/knativeingress.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// KnativeIngressInformer provides access to a shared informer and lister for +// KnativeIngresses. +type KnativeIngressInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.KnativeIngressLister +} + +type knativeIngressInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewKnativeIngressInformer constructs a new informer for KnativeIngress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewKnativeIngressInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredKnativeIngressInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredKnativeIngressInformer constructs a new informer for KnativeIngress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredKnativeIngressInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().KnativeIngresses().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().KnativeIngresses().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.KnativeIngress{}, + resyncPeriod, + indexers, + ) +} + +func (f *knativeIngressInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredKnativeIngressInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *knativeIngressInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.KnativeIngress{}, f.defaultInformer) +} + +func (f *knativeIngressInformer) Lister() v1.KnativeIngressLister { + return v1.NewKnativeIngressLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/labelconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/labelconfig.go new file mode 100644 index 000000000..320725b0d --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/labelconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// LabelConfigInformer provides access to a shared informer and lister for +// LabelConfigs. +type LabelConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.LabelConfigLister +} + +type labelConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewLabelConfigInformer constructs a new informer for LabelConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewLabelConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredLabelConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredLabelConfigInformer constructs a new informer for LabelConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredLabelConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().LabelConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().LabelConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.LabelConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *labelConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredLabelConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *labelConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.LabelConfig{}, f.defaultInformer) +} + +func (f *labelConfigInformer) Lister() v1.LabelConfigLister { + return v1.NewLabelConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/localregistrationservice.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/localregistrationservice.go new file mode 100644 index 000000000..5264ec0c6 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/localregistrationservice.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// LocalRegistrationServiceInformer provides access to a shared informer and lister for +// LocalRegistrationServices. +type LocalRegistrationServiceInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.LocalRegistrationServiceLister +} + +type localRegistrationServiceInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewLocalRegistrationServiceInformer constructs a new informer for LocalRegistrationService type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewLocalRegistrationServiceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredLocalRegistrationServiceInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredLocalRegistrationServiceInformer constructs a new informer for LocalRegistrationService type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredLocalRegistrationServiceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().LocalRegistrationServices().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().LocalRegistrationServices().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.LocalRegistrationService{}, + resyncPeriod, + indexers, + ) +} + +func (f *localRegistrationServiceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredLocalRegistrationServiceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *localRegistrationServiceInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.LocalRegistrationService{}, f.defaultInformer) +} + +func (f *localRegistrationServiceInformer) Lister() v1.LocalRegistrationServiceLister { + return v1.NewLocalRegistrationServiceLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/localregistrationservicecluster.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/localregistrationservicecluster.go new file mode 100644 index 000000000..3ae846b0f --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/localregistrationservicecluster.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// LocalRegistrationServiceClusterInformer provides access to a shared informer and lister for +// LocalRegistrationServiceClusters. +type LocalRegistrationServiceClusterInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.LocalRegistrationServiceClusterLister +} + +type localRegistrationServiceClusterInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewLocalRegistrationServiceClusterInformer constructs a new informer for LocalRegistrationServiceCluster type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewLocalRegistrationServiceClusterInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredLocalRegistrationServiceClusterInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredLocalRegistrationServiceClusterInformer constructs a new informer for LocalRegistrationServiceCluster type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredLocalRegistrationServiceClusterInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().LocalRegistrationServiceClusters().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().LocalRegistrationServiceClusters().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster{}, + resyncPeriod, + indexers, + ) +} + +func (f *localRegistrationServiceClusterInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredLocalRegistrationServiceClusterInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *localRegistrationServiceClusterInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster{}, f.defaultInformer) +} + +func (f *localRegistrationServiceClusterInformer) Lister() v1.LocalRegistrationServiceClusterLister { + return v1.NewLocalRegistrationServiceClusterLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/localregistrationserviceresource.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/localregistrationserviceresource.go new file mode 100644 index 000000000..c426c0366 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/localregistrationserviceresource.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// LocalRegistrationServiceResourceInformer provides access to a shared informer and lister for +// LocalRegistrationServiceResources. +type LocalRegistrationServiceResourceInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.LocalRegistrationServiceResourceLister +} + +type localRegistrationServiceResourceInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewLocalRegistrationServiceResourceInformer constructs a new informer for LocalRegistrationServiceResource type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewLocalRegistrationServiceResourceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredLocalRegistrationServiceResourceInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredLocalRegistrationServiceResourceInformer constructs a new informer for LocalRegistrationServiceResource type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredLocalRegistrationServiceResourceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().LocalRegistrationServiceResources().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().LocalRegistrationServiceResources().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource{}, + resyncPeriod, + indexers, + ) +} + +func (f *localRegistrationServiceResourceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredLocalRegistrationServiceResourceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *localRegistrationServiceResourceInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource{}, f.defaultInformer) +} + +func (f *localRegistrationServiceResourceInformer) Lister() v1.LocalRegistrationServiceResourceLister { + return v1.NewLocalRegistrationServiceResourceLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/log.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/log.go new file mode 100644 index 000000000..8b79501b8 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/log.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// LogInformer provides access to a shared informer and lister for +// Logs. +type LogInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.LogLister +} + +type logInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewLogInformer constructs a new informer for Log type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewLogInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredLogInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredLogInformer constructs a new informer for Log type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredLogInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Logs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Logs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Log{}, + resyncPeriod, + indexers, + ) +} + +func (f *logInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredLogInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *logInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Log{}, f.defaultInformer) +} + +func (f *logInformer) Lister() v1.LogLister { + return v1.NewLogLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/logfolder.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/logfolder.go new file mode 100644 index 000000000..e309af658 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/logfolder.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// LogFolderInformer provides access to a shared informer and lister for +// LogFolders. +type LogFolderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.LogFolderLister +} + +type logFolderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewLogFolderInformer constructs a new informer for LogFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewLogFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredLogFolderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredLogFolderInformer constructs a new informer for LogFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredLogFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().LogFolders().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().LogFolders().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.LogFolder{}, + resyncPeriod, + indexers, + ) +} + +func (f *logFolderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredLogFolderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *logFolderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.LogFolder{}, f.defaultInformer) +} + +func (f *logFolderInformer) Lister() v1.LogFolderLister { + return v1.NewLogFolderLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/metricmonitor.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/metricmonitor.go new file mode 100644 index 000000000..c000fd6da --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/metricmonitor.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// MetricMonitorInformer provides access to a shared informer and lister for +// MetricMonitors. +type MetricMonitorInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.MetricMonitorLister +} + +type metricMonitorInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewMetricMonitorInformer constructs a new informer for MetricMonitor type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewMetricMonitorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredMetricMonitorInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredMetricMonitorInformer constructs a new informer for MetricMonitor type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredMetricMonitorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().MetricMonitors().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().MetricMonitors().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.MetricMonitor{}, + resyncPeriod, + indexers, + ) +} + +func (f *metricMonitorInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredMetricMonitorInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *metricMonitorInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.MetricMonitor{}, f.defaultInformer) +} + +func (f *metricMonitorInformer) Lister() v1.MetricMonitorLister { + return v1.NewMetricMonitorLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinition.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinition.go new file mode 100644 index 000000000..5c8fdbbfe --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinition.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// NetworkAttachmentDefinitionInformer provides access to a shared informer and lister for +// NetworkAttachmentDefinitions. +type NetworkAttachmentDefinitionInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.NetworkAttachmentDefinitionLister +} + +type networkAttachmentDefinitionInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewNetworkAttachmentDefinitionInformer constructs a new informer for NetworkAttachmentDefinition type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewNetworkAttachmentDefinitionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredNetworkAttachmentDefinitionInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredNetworkAttachmentDefinitionInformer constructs a new informer for NetworkAttachmentDefinition type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredNetworkAttachmentDefinitionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().NetworkAttachmentDefinitions().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().NetworkAttachmentDefinitions().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition{}, + resyncPeriod, + indexers, + ) +} + +func (f *networkAttachmentDefinitionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredNetworkAttachmentDefinitionInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *networkAttachmentDefinitionInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition{}, f.defaultInformer) +} + +func (f *networkAttachmentDefinitionInformer) Lister() v1.NetworkAttachmentDefinitionLister { + return v1.NewNetworkAttachmentDefinitionLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinitionconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinitionconfig.go new file mode 100644 index 000000000..6976b1ce7 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinitionconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// NetworkAttachmentDefinitionConfigInformer provides access to a shared informer and lister for +// NetworkAttachmentDefinitionConfigs. +type NetworkAttachmentDefinitionConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.NetworkAttachmentDefinitionConfigLister +} + +type networkAttachmentDefinitionConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewNetworkAttachmentDefinitionConfigInformer constructs a new informer for NetworkAttachmentDefinitionConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewNetworkAttachmentDefinitionConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredNetworkAttachmentDefinitionConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredNetworkAttachmentDefinitionConfigInformer constructs a new informer for NetworkAttachmentDefinitionConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredNetworkAttachmentDefinitionConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().NetworkAttachmentDefinitionConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().NetworkAttachmentDefinitionConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *networkAttachmentDefinitionConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredNetworkAttachmentDefinitionConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *networkAttachmentDefinitionConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig{}, f.defaultInformer) +} + +func (f *networkAttachmentDefinitionConfigInformer) Lister() v1.NetworkAttachmentDefinitionConfigLister { + return v1.NewNetworkAttachmentDefinitionConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/node.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/node.go new file mode 100644 index 000000000..2f8265585 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/node.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// NodeInformer provides access to a shared informer and lister for +// Nodes. +type NodeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.NodeLister +} + +type nodeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewNodeInformer constructs a new informer for Node type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewNodeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredNodeInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredNodeInformer constructs a new informer for Node type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredNodeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Nodes().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Nodes().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Node{}, + resyncPeriod, + indexers, + ) +} + +func (f *nodeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredNodeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *nodeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Node{}, f.defaultInformer) +} + +func (f *nodeInformer) Lister() v1.NodeLister { + return v1.NewNodeLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodedefinition.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodedefinition.go new file mode 100644 index 000000000..285e06252 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodedefinition.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// NodeDefinitionInformer provides access to a shared informer and lister for +// NodeDefinitions. +type NodeDefinitionInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.NodeDefinitionLister +} + +type nodeDefinitionInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewNodeDefinitionInformer constructs a new informer for NodeDefinition type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewNodeDefinitionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredNodeDefinitionInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredNodeDefinitionInformer constructs a new informer for NodeDefinition type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredNodeDefinitionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().NodeDefinitions().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().NodeDefinitions().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.NodeDefinition{}, + resyncPeriod, + indexers, + ) +} + +func (f *nodeDefinitionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredNodeDefinitionInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *nodeDefinitionInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.NodeDefinition{}, f.defaultInformer) +} + +func (f *nodeDefinitionInformer) Lister() v1.NodeDefinitionLister { + return v1.NewNodeDefinitionLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodefolder.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodefolder.go new file mode 100644 index 000000000..57ab5b83c --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodefolder.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// NodeFolderInformer provides access to a shared informer and lister for +// NodeFolders. +type NodeFolderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.NodeFolderLister +} + +type nodeFolderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewNodeFolderInformer constructs a new informer for NodeFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewNodeFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredNodeFolderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredNodeFolderInformer constructs a new informer for NodeFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredNodeFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().NodeFolders().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().NodeFolders().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.NodeFolder{}, + resyncPeriod, + indexers, + ) +} + +func (f *nodeFolderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredNodeFolderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *nodeFolderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.NodeFolder{}, f.defaultInformer) +} + +func (f *nodeFolderInformer) Lister() v1.NodeFolderLister { + return v1.NewNodeFolderLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodefoldercluster.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodefoldercluster.go new file mode 100644 index 000000000..0d6e36558 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodefoldercluster.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// NodeFolderClusterInformer provides access to a shared informer and lister for +// NodeFolderClusters. +type NodeFolderClusterInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.NodeFolderClusterLister +} + +type nodeFolderClusterInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewNodeFolderClusterInformer constructs a new informer for NodeFolderCluster type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewNodeFolderClusterInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredNodeFolderClusterInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredNodeFolderClusterInformer constructs a new informer for NodeFolderCluster type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredNodeFolderClusterInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().NodeFolderClusters().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().NodeFolderClusters().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.NodeFolderCluster{}, + resyncPeriod, + indexers, + ) +} + +func (f *nodeFolderClusterInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredNodeFolderClusterInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *nodeFolderClusterInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.NodeFolderCluster{}, f.defaultInformer) +} + +func (f *nodeFolderClusterInformer) Lister() v1.NodeFolderClusterLister { + return v1.NewNodeFolderClusterLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodegroup.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodegroup.go new file mode 100644 index 000000000..09229163e --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodegroup.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// NodeGroupInformer provides access to a shared informer and lister for +// NodeGroups. +type NodeGroupInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.NodeGroupLister +} + +type nodeGroupInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewNodeGroupInformer constructs a new informer for NodeGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewNodeGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredNodeGroupInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredNodeGroupInformer constructs a new informer for NodeGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredNodeGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().NodeGroups().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().NodeGroups().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.NodeGroup{}, + resyncPeriod, + indexers, + ) +} + +func (f *nodeGroupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredNodeGroupInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *nodeGroupInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.NodeGroup{}, f.defaultInformer) +} + +func (f *nodeGroupInformer) Lister() v1.NodeGroupLister { + return v1.NewNodeGroupLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodestatus.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodestatus.go new file mode 100644 index 000000000..77f139e32 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodestatus.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// NodeStatusInformer provides access to a shared informer and lister for +// NodeStatuses. +type NodeStatusInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.NodeStatusLister +} + +type nodeStatusInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewNodeStatusInformer constructs a new informer for NodeStatus type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewNodeStatusInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredNodeStatusInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredNodeStatusInformer constructs a new informer for NodeStatus type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredNodeStatusInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().NodeStatuses().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().NodeStatuses().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.NodeStatus{}, + resyncPeriod, + indexers, + ) +} + +func (f *nodeStatusInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredNodeStatusInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *nodeStatusInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.NodeStatus{}, f.defaultInformer) +} + +func (f *nodeStatusInformer) Lister() v1.NodeStatusLister { + return v1.NewNodeStatusLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodetemplate.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodetemplate.go new file mode 100644 index 000000000..6abf73a01 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/nodetemplate.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// NodeTemplateInformer provides access to a shared informer and lister for +// NodeTemplates. +type NodeTemplateInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.NodeTemplateLister +} + +type nodeTemplateInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewNodeTemplateInformer constructs a new informer for NodeTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewNodeTemplateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredNodeTemplateInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredNodeTemplateInformer constructs a new informer for NodeTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredNodeTemplateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().NodeTemplates().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().NodeTemplates().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.NodeTemplate{}, + resyncPeriod, + indexers, + ) +} + +func (f *nodeTemplateInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredNodeTemplateInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *nodeTemplateInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.NodeTemplate{}, f.defaultInformer) +} + +func (f *nodeTemplateInformer) Lister() v1.NodeTemplateLister { + return v1.NewNodeTemplateLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/outboundauthenticationmode.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/outboundauthenticationmode.go new file mode 100644 index 000000000..f014bb62c --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/outboundauthenticationmode.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// OutboundAuthenticationModeInformer provides access to a shared informer and lister for +// OutboundAuthenticationModes. +type OutboundAuthenticationModeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.OutboundAuthenticationModeLister +} + +type outboundAuthenticationModeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewOutboundAuthenticationModeInformer constructs a new informer for OutboundAuthenticationMode type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewOutboundAuthenticationModeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredOutboundAuthenticationModeInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredOutboundAuthenticationModeInformer constructs a new informer for OutboundAuthenticationMode type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredOutboundAuthenticationModeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().OutboundAuthenticationModes().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().OutboundAuthenticationModes().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.OutboundAuthenticationMode{}, + resyncPeriod, + indexers, + ) +} + +func (f *outboundAuthenticationModeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredOutboundAuthenticationModeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *outboundAuthenticationModeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.OutboundAuthenticationMode{}, f.defaultInformer) +} + +func (f *outboundAuthenticationModeInformer) Lister() v1.OutboundAuthenticationModeLister { + return v1.NewOutboundAuthenticationModeLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/peerauthentication.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/peerauthentication.go new file mode 100644 index 000000000..223841f95 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/peerauthentication.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// PeerAuthenticationInformer provides access to a shared informer and lister for +// PeerAuthentications. +type PeerAuthenticationInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.PeerAuthenticationLister +} + +type peerAuthenticationInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewPeerAuthenticationInformer constructs a new informer for PeerAuthentication type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewPeerAuthenticationInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPeerAuthenticationInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredPeerAuthenticationInformer constructs a new informer for PeerAuthentication type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredPeerAuthenticationInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().PeerAuthentications().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().PeerAuthentications().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.PeerAuthentication{}, + resyncPeriod, + indexers, + ) +} + +func (f *peerAuthenticationInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPeerAuthenticationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *peerAuthenticationInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.PeerAuthentication{}, f.defaultInformer) +} + +func (f *peerAuthenticationInformer) Lister() v1.PeerAuthenticationLister { + return v1.NewPeerAuthenticationLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/piidiscovery.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/piidiscovery.go new file mode 100644 index 000000000..f12cfff27 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/piidiscovery.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// PiiDiscoveryInformer provides access to a shared informer and lister for +// PiiDiscoveries. +type PiiDiscoveryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.PiiDiscoveryLister +} + +type piiDiscoveryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewPiiDiscoveryInformer constructs a new informer for PiiDiscovery type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewPiiDiscoveryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPiiDiscoveryInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredPiiDiscoveryInformer constructs a new informer for PiiDiscovery type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredPiiDiscoveryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().PiiDiscoveries().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().PiiDiscoveries().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.PiiDiscovery{}, + resyncPeriod, + indexers, + ) +} + +func (f *piiDiscoveryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPiiDiscoveryInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *piiDiscoveryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.PiiDiscovery{}, f.defaultInformer) +} + +func (f *piiDiscoveryInformer) Lister() v1.PiiDiscoveryLister { + return v1.NewPiiDiscoveryLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/piidiscoveryrt.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/piidiscoveryrt.go new file mode 100644 index 000000000..2d8a5e96f --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/piidiscoveryrt.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// PiiDiscoveryRTInformer provides access to a shared informer and lister for +// PiiDiscoveryRTs. +type PiiDiscoveryRTInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.PiiDiscoveryRTLister +} + +type piiDiscoveryRTInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewPiiDiscoveryRTInformer constructs a new informer for PiiDiscoveryRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewPiiDiscoveryRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPiiDiscoveryRTInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredPiiDiscoveryRTInformer constructs a new informer for PiiDiscoveryRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredPiiDiscoveryRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().PiiDiscoveryRTs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().PiiDiscoveryRTs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.PiiDiscoveryRT{}, + resyncPeriod, + indexers, + ) +} + +func (f *piiDiscoveryRTInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPiiDiscoveryRTInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *piiDiscoveryRTInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.PiiDiscoveryRT{}, f.defaultInformer) +} + +func (f *piiDiscoveryRTInformer) Lister() v1.PiiDiscoveryRTLister { + return v1.NewPiiDiscoveryRTLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/policyconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/policyconfig.go new file mode 100644 index 000000000..d08003534 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/policyconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// PolicyConfigInformer provides access to a shared informer and lister for +// PolicyConfigs. +type PolicyConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.PolicyConfigLister +} + +type policyConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewPolicyConfigInformer constructs a new informer for PolicyConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewPolicyConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPolicyConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredPolicyConfigInformer constructs a new informer for PolicyConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredPolicyConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().PolicyConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().PolicyConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.PolicyConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *policyConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPolicyConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *policyConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.PolicyConfig{}, f.defaultInformer) +} + +func (f *policyConfigInformer) Lister() v1.PolicyConfigLister { + return v1.NewPolicyConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/policytemplate.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/policytemplate.go new file mode 100644 index 000000000..6869d6b6a --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/policytemplate.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// PolicyTemplateInformer provides access to a shared informer and lister for +// PolicyTemplates. +type PolicyTemplateInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.PolicyTemplateLister +} + +type policyTemplateInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewPolicyTemplateInformer constructs a new informer for PolicyTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewPolicyTemplateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPolicyTemplateInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredPolicyTemplateInformer constructs a new informer for PolicyTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredPolicyTemplateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().PolicyTemplates().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().PolicyTemplates().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.PolicyTemplate{}, + resyncPeriod, + indexers, + ) +} + +func (f *policyTemplateInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPolicyTemplateInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *policyTemplateInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.PolicyTemplate{}, f.defaultInformer) +} + +func (f *policyTemplateInformer) Lister() v1.PolicyTemplateLister { + return v1.NewPolicyTemplateLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/progressiveupgrade.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/progressiveupgrade.go new file mode 100644 index 000000000..d04216e54 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/progressiveupgrade.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ProgressiveUpgradeInformer provides access to a shared informer and lister for +// ProgressiveUpgrades. +type ProgressiveUpgradeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ProgressiveUpgradeLister +} + +type progressiveUpgradeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewProgressiveUpgradeInformer constructs a new informer for ProgressiveUpgrade type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewProgressiveUpgradeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredProgressiveUpgradeInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredProgressiveUpgradeInformer constructs a new informer for ProgressiveUpgrade type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredProgressiveUpgradeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ProgressiveUpgrades().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ProgressiveUpgrades().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ProgressiveUpgrade{}, + resyncPeriod, + indexers, + ) +} + +func (f *progressiveUpgradeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredProgressiveUpgradeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *progressiveUpgradeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ProgressiveUpgrade{}, f.defaultInformer) +} + +func (f *progressiveUpgradeInformer) Lister() v1.ProgressiveUpgradeLister { + return v1.NewProgressiveUpgradeLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/progressiveupgradeconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/progressiveupgradeconfig.go new file mode 100644 index 000000000..8681ef52a --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/progressiveupgradeconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ProgressiveUpgradeConfigInformer provides access to a shared informer and lister for +// ProgressiveUpgradeConfigs. +type ProgressiveUpgradeConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ProgressiveUpgradeConfigLister +} + +type progressiveUpgradeConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewProgressiveUpgradeConfigInformer constructs a new informer for ProgressiveUpgradeConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewProgressiveUpgradeConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredProgressiveUpgradeConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredProgressiveUpgradeConfigInformer constructs a new informer for ProgressiveUpgradeConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredProgressiveUpgradeConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ProgressiveUpgradeConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ProgressiveUpgradeConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *progressiveUpgradeConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredProgressiveUpgradeConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *progressiveUpgradeConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig{}, f.defaultInformer) +} + +func (f *progressiveUpgradeConfigInformer) Lister() v1.ProgressiveUpgradeConfigLister { + return v1.NewProgressiveUpgradeConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/progressiveupgradefolder.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/progressiveupgradefolder.go new file mode 100644 index 000000000..4801d6d6d --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/progressiveupgradefolder.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ProgressiveUpgradeFolderInformer provides access to a shared informer and lister for +// ProgressiveUpgradeFolders. +type ProgressiveUpgradeFolderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ProgressiveUpgradeFolderLister +} + +type progressiveUpgradeFolderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewProgressiveUpgradeFolderInformer constructs a new informer for ProgressiveUpgradeFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewProgressiveUpgradeFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredProgressiveUpgradeFolderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredProgressiveUpgradeFolderInformer constructs a new informer for ProgressiveUpgradeFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredProgressiveUpgradeFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ProgressiveUpgradeFolders().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ProgressiveUpgradeFolders().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder{}, + resyncPeriod, + indexers, + ) +} + +func (f *progressiveUpgradeFolderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredProgressiveUpgradeFolderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *progressiveUpgradeFolderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder{}, f.defaultInformer) +} + +func (f *progressiveUpgradeFolderInformer) Lister() v1.ProgressiveUpgradeFolderLister { + return v1.NewProgressiveUpgradeFolderLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/progressiveupgraderuntime.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/progressiveupgraderuntime.go new file mode 100644 index 000000000..107738d11 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/progressiveupgraderuntime.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ProgressiveUpgradeRuntimeInformer provides access to a shared informer and lister for +// ProgressiveUpgradeRuntimes. +type ProgressiveUpgradeRuntimeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ProgressiveUpgradeRuntimeLister +} + +type progressiveUpgradeRuntimeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewProgressiveUpgradeRuntimeInformer constructs a new informer for ProgressiveUpgradeRuntime type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewProgressiveUpgradeRuntimeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredProgressiveUpgradeRuntimeInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredProgressiveUpgradeRuntimeInformer constructs a new informer for ProgressiveUpgradeRuntime type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredProgressiveUpgradeRuntimeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ProgressiveUpgradeRuntimes().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ProgressiveUpgradeRuntimes().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime{}, + resyncPeriod, + indexers, + ) +} + +func (f *progressiveUpgradeRuntimeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredProgressiveUpgradeRuntimeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *progressiveUpgradeRuntimeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime{}, f.defaultInformer) +} + +func (f *progressiveUpgradeRuntimeInformer) Lister() v1.ProgressiveUpgradeRuntimeLister { + return v1.NewProgressiveUpgradeRuntimeLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/project.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/project.go new file mode 100644 index 000000000..d99ccd717 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/project.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ProjectInformer provides access to a shared informer and lister for +// Projects. +type ProjectInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ProjectLister +} + +type projectInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewProjectInformer constructs a new informer for Project type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewProjectInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredProjectInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredProjectInformer constructs a new informer for Project type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredProjectInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Projects().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Projects().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Project{}, + resyncPeriod, + indexers, + ) +} + +func (f *projectInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredProjectInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *projectInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Project{}, f.defaultInformer) +} + +func (f *projectInformer) Lister() v1.ProjectLister { + return v1.NewProjectLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/projectconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/projectconfig.go new file mode 100644 index 000000000..bdcca0206 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/projectconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ProjectConfigInformer provides access to a shared informer and lister for +// ProjectConfigs. +type ProjectConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ProjectConfigLister +} + +type projectConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewProjectConfigInformer constructs a new informer for ProjectConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewProjectConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredProjectConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredProjectConfigInformer constructs a new informer for ProjectConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredProjectConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ProjectConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ProjectConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ProjectConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *projectConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredProjectConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *projectConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ProjectConfig{}, f.defaultInformer) +} + +func (f *projectConfigInformer) Lister() v1.ProjectConfigLister { + return v1.NewProjectConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/projectinventory.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/projectinventory.go new file mode 100644 index 000000000..86f5fa88e --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/projectinventory.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ProjectInventoryInformer provides access to a shared informer and lister for +// ProjectInventories. +type ProjectInventoryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ProjectInventoryLister +} + +type projectInventoryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewProjectInventoryInformer constructs a new informer for ProjectInventory type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewProjectInventoryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredProjectInventoryInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredProjectInventoryInformer constructs a new informer for ProjectInventory type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredProjectInventoryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ProjectInventories().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ProjectInventories().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ProjectInventory{}, + resyncPeriod, + indexers, + ) +} + +func (f *projectInventoryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredProjectInventoryInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *projectInventoryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ProjectInventory{}, f.defaultInformer) +} + +func (f *projectInventoryInformer) Lister() v1.ProjectInventoryLister { + return v1.NewProjectInventoryLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/projectquery.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/projectquery.go new file mode 100644 index 000000000..480da3997 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/projectquery.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ProjectQueryInformer provides access to a shared informer and lister for +// ProjectQueries. +type ProjectQueryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ProjectQueryLister +} + +type projectQueryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewProjectQueryInformer constructs a new informer for ProjectQuery type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewProjectQueryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredProjectQueryInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredProjectQueryInformer constructs a new informer for ProjectQuery type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredProjectQueryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ProjectQueries().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ProjectQueries().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ProjectQuery{}, + resyncPeriod, + indexers, + ) +} + +func (f *projectQueryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredProjectQueryInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *projectQueryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ProjectQuery{}, f.defaultInformer) +} + +func (f *projectQueryInformer) Lister() v1.ProjectQueryLister { + return v1.NewProjectQueryLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/publicserviceconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/publicserviceconfig.go new file mode 100644 index 000000000..10efbb496 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/publicserviceconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// PublicServiceConfigInformer provides access to a shared informer and lister for +// PublicServiceConfigs. +type PublicServiceConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.PublicServiceConfigLister +} + +type publicServiceConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewPublicServiceConfigInformer constructs a new informer for PublicServiceConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewPublicServiceConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPublicServiceConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredPublicServiceConfigInformer constructs a new informer for PublicServiceConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredPublicServiceConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().PublicServiceConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().PublicServiceConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.PublicServiceConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *publicServiceConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPublicServiceConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *publicServiceConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.PublicServiceConfig{}, f.defaultInformer) +} + +func (f *publicServiceConfigInformer) Lister() v1.PublicServiceConfigLister { + return v1.NewPublicServiceConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/publicservicerouteconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/publicservicerouteconfig.go new file mode 100644 index 000000000..0fb9a3b36 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/publicservicerouteconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// PublicServiceRouteConfigInformer provides access to a shared informer and lister for +// PublicServiceRouteConfigs. +type PublicServiceRouteConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.PublicServiceRouteConfigLister +} + +type publicServiceRouteConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewPublicServiceRouteConfigInformer constructs a new informer for PublicServiceRouteConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewPublicServiceRouteConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPublicServiceRouteConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredPublicServiceRouteConfigInformer constructs a new informer for PublicServiceRouteConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredPublicServiceRouteConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().PublicServiceRouteConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().PublicServiceRouteConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.PublicServiceRouteConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *publicServiceRouteConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPublicServiceRouteConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *publicServiceRouteConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.PublicServiceRouteConfig{}, f.defaultInformer) +} + +func (f *publicServiceRouteConfigInformer) Lister() v1.PublicServiceRouteConfigLister { + return v1.NewPublicServiceRouteConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/publicservicert.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/publicservicert.go new file mode 100644 index 000000000..c440ff527 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/publicservicert.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// PublicServiceRTInformer provides access to a shared informer and lister for +// PublicServiceRTs. +type PublicServiceRTInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.PublicServiceRTLister +} + +type publicServiceRTInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewPublicServiceRTInformer constructs a new informer for PublicServiceRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewPublicServiceRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPublicServiceRTInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredPublicServiceRTInformer constructs a new informer for PublicServiceRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredPublicServiceRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().PublicServiceRTs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().PublicServiceRTs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.PublicServiceRT{}, + resyncPeriod, + indexers, + ) +} + +func (f *publicServiceRTInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPublicServiceRTInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *publicServiceRTInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.PublicServiceRT{}, f.defaultInformer) +} + +func (f *publicServiceRTInformer) Lister() v1.PublicServiceRTLister { + return v1.NewPublicServiceRTLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/remotegatewayserviceconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/remotegatewayserviceconfig.go new file mode 100644 index 000000000..3d05c2a61 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/remotegatewayserviceconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// RemoteGatewayServiceConfigInformer provides access to a shared informer and lister for +// RemoteGatewayServiceConfigs. +type RemoteGatewayServiceConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.RemoteGatewayServiceConfigLister +} + +type remoteGatewayServiceConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewRemoteGatewayServiceConfigInformer constructs a new informer for RemoteGatewayServiceConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewRemoteGatewayServiceConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredRemoteGatewayServiceConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredRemoteGatewayServiceConfigInformer constructs a new informer for RemoteGatewayServiceConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredRemoteGatewayServiceConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().RemoteGatewayServiceConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().RemoteGatewayServiceConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *remoteGatewayServiceConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredRemoteGatewayServiceConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *remoteGatewayServiceConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig{}, f.defaultInformer) +} + +func (f *remoteGatewayServiceConfigInformer) Lister() v1.RemoteGatewayServiceConfigLister { + return v1.NewRemoteGatewayServiceConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/resourcegroup.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/resourcegroup.go new file mode 100644 index 000000000..913119f00 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/resourcegroup.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ResourceGroupInformer provides access to a shared informer and lister for +// ResourceGroups. +type ResourceGroupInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ResourceGroupLister +} + +type resourceGroupInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewResourceGroupInformer constructs a new informer for ResourceGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewResourceGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredResourceGroupInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredResourceGroupInformer constructs a new informer for ResourceGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredResourceGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ResourceGroups().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ResourceGroups().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ResourceGroup{}, + resyncPeriod, + indexers, + ) +} + +func (f *resourceGroupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredResourceGroupInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *resourceGroupInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ResourceGroup{}, f.defaultInformer) +} + +func (f *resourceGroupInformer) Lister() v1.ResourceGroupLister { + return v1.NewResourceGroupLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/resourcegrouprt.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/resourcegrouprt.go new file mode 100644 index 000000000..55e8b05fe --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/resourcegrouprt.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ResourceGroupRTInformer provides access to a shared informer and lister for +// ResourceGroupRTs. +type ResourceGroupRTInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ResourceGroupRTLister +} + +type resourceGroupRTInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewResourceGroupRTInformer constructs a new informer for ResourceGroupRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewResourceGroupRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredResourceGroupRTInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredResourceGroupRTInformer constructs a new informer for ResourceGroupRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredResourceGroupRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ResourceGroupRTs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ResourceGroupRTs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ResourceGroupRT{}, + resyncPeriod, + indexers, + ) +} + +func (f *resourceGroupRTInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredResourceGroupRTInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *resourceGroupRTInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ResourceGroupRT{}, f.defaultInformer) +} + +func (f *resourceGroupRTInformer) Lister() v1.ResourceGroupRTLister { + return v1.NewResourceGroupRTLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/root.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/root.go new file mode 100644 index 000000000..9e4a63d36 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/root.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// RootInformer provides access to a shared informer and lister for +// Roots. +type RootInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.RootLister +} + +type rootInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewRootInformer constructs a new informer for Root type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewRootInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredRootInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredRootInformer constructs a new informer for Root type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredRootInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Roots().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Roots().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Root{}, + resyncPeriod, + indexers, + ) +} + +func (f *rootInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredRootInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *rootInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Root{}, f.defaultInformer) +} + +func (f *rootInformer) Lister() v1.RootLister { + return v1.NewRootLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/rpolicy.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/rpolicy.go new file mode 100644 index 000000000..1ca9195c2 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/rpolicy.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// RPolicyInformer provides access to a shared informer and lister for +// RPolicies. +type RPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.RPolicyLister +} + +type rPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewRPolicyInformer constructs a new informer for RPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewRPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredRPolicyInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredRPolicyInformer constructs a new informer for RPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredRPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().RPolicies().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().RPolicies().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.RPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *rPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredRPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *rPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.RPolicy{}, f.defaultInformer) +} + +func (f *rPolicyInformer) Lister() v1.RPolicyLister { + return v1.NewRPolicyLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/runtime.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/runtime.go new file mode 100644 index 000000000..479682498 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/runtime.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// RuntimeInformer provides access to a shared informer and lister for +// Runtimes. +type RuntimeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.RuntimeLister +} + +type runtimeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewRuntimeInformer constructs a new informer for Runtime type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewRuntimeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredRuntimeInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredRuntimeInformer constructs a new informer for Runtime type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredRuntimeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Runtimes().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Runtimes().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Runtime{}, + resyncPeriod, + indexers, + ) +} + +func (f *runtimeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredRuntimeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *runtimeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Runtime{}, f.defaultInformer) +} + +func (f *runtimeInformer) Lister() v1.RuntimeLister { + return v1.NewRuntimeLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/schemaviolationdiscoveryrt.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/schemaviolationdiscoveryrt.go new file mode 100644 index 000000000..63f1074ca --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/schemaviolationdiscoveryrt.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SchemaViolationDiscoveryRTInformer provides access to a shared informer and lister for +// SchemaViolationDiscoveryRTs. +type SchemaViolationDiscoveryRTInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.SchemaViolationDiscoveryRTLister +} + +type schemaViolationDiscoveryRTInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewSchemaViolationDiscoveryRTInformer constructs a new informer for SchemaViolationDiscoveryRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSchemaViolationDiscoveryRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSchemaViolationDiscoveryRTInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredSchemaViolationDiscoveryRTInformer constructs a new informer for SchemaViolationDiscoveryRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSchemaViolationDiscoveryRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SchemaViolationDiscoveryRTs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SchemaViolationDiscoveryRTs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT{}, + resyncPeriod, + indexers, + ) +} + +func (f *schemaViolationDiscoveryRTInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSchemaViolationDiscoveryRTInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *schemaViolationDiscoveryRTInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT{}, f.defaultInformer) +} + +func (f *schemaViolationDiscoveryRTInformer) Lister() v1.SchemaViolationDiscoveryRTLister { + return v1.NewSchemaViolationDiscoveryRTLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/secrethash.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/secrethash.go new file mode 100644 index 000000000..3065c92de --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/secrethash.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SecretHashInformer provides access to a shared informer and lister for +// SecretHashes. +type SecretHashInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.SecretHashLister +} + +type secretHashInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewSecretHashInformer constructs a new informer for SecretHash type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSecretHashInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSecretHashInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredSecretHashInformer constructs a new informer for SecretHash type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSecretHashInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SecretHashes().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SecretHashes().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.SecretHash{}, + resyncPeriod, + indexers, + ) +} + +func (f *secretHashInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSecretHashInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *secretHashInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.SecretHash{}, f.defaultInformer) +} + +func (f *secretHashInformer) Lister() v1.SecretHashLister { + return v1.NewSecretHashLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/secretrtconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/secretrtconfig.go new file mode 100644 index 000000000..d087f44e8 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/secretrtconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SecretRTConfigInformer provides access to a shared informer and lister for +// SecretRTConfigs. +type SecretRTConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.SecretRTConfigLister +} + +type secretRTConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewSecretRTConfigInformer constructs a new informer for SecretRTConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSecretRTConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSecretRTConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredSecretRTConfigInformer constructs a new informer for SecretRTConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSecretRTConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SecretRTConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SecretRTConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.SecretRTConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *secretRTConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSecretRTConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *secretRTConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.SecretRTConfig{}, f.defaultInformer) +} + +func (f *secretRTConfigInformer) Lister() v1.SecretRTConfigLister { + return v1.NewSecretRTConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/securitycontextconstraints.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/securitycontextconstraints.go new file mode 100644 index 000000000..1362e5713 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/securitycontextconstraints.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SecurityContextConstraintsInformer provides access to a shared informer and lister for +// SecurityContextConstraintses. +type SecurityContextConstraintsInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.SecurityContextConstraintsLister +} + +type securityContextConstraintsInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewSecurityContextConstraintsInformer constructs a new informer for SecurityContextConstraints type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSecurityContextConstraintsInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSecurityContextConstraintsInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredSecurityContextConstraintsInformer constructs a new informer for SecurityContextConstraints type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSecurityContextConstraintsInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SecurityContextConstraintses().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SecurityContextConstraintses().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.SecurityContextConstraints{}, + resyncPeriod, + indexers, + ) +} + +func (f *securityContextConstraintsInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSecurityContextConstraintsInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *securityContextConstraintsInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.SecurityContextConstraints{}, f.defaultInformer) +} + +func (f *securityContextConstraintsInformer) Lister() v1.SecurityContextConstraintsLister { + return v1.NewSecurityContextConstraintsLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/securitycontextconstraintsconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/securitycontextconstraintsconfig.go new file mode 100644 index 000000000..fc40b4534 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/securitycontextconstraintsconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SecurityContextConstraintsConfigInformer provides access to a shared informer and lister for +// SecurityContextConstraintsConfigs. +type SecurityContextConstraintsConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.SecurityContextConstraintsConfigLister +} + +type securityContextConstraintsConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewSecurityContextConstraintsConfigInformer constructs a new informer for SecurityContextConstraintsConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSecurityContextConstraintsConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSecurityContextConstraintsConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredSecurityContextConstraintsConfigInformer constructs a new informer for SecurityContextConstraintsConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSecurityContextConstraintsConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SecurityContextConstraintsConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SecurityContextConstraintsConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *securityContextConstraintsConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSecurityContextConstraintsConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *securityContextConstraintsConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig{}, f.defaultInformer) +} + +func (f *securityContextConstraintsConfigInformer) Lister() v1.SecurityContextConstraintsConfigLister { + return v1.NewSecurityContextConstraintsConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/service.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/service.go new file mode 100644 index 000000000..38b6da227 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/service.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceInformer provides access to a shared informer and lister for +// Services. +type ServiceInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceLister +} + +type serviceInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceInformer constructs a new informer for Service type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceInformer constructs a new informer for Service type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Services().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Services().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Service{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Service{}, f.defaultInformer) +} + +func (f *serviceInformer) Lister() v1.ServiceLister { + return v1.NewServiceLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceconfig.go new file mode 100644 index 000000000..10dc3ffc0 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceConfigInformer provides access to a shared informer and lister for +// ServiceConfigs. +type ServiceConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceConfigLister +} + +type serviceConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceConfigInformer constructs a new informer for ServiceConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceConfigInformer constructs a new informer for ServiceConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceConfig{}, f.defaultInformer) +} + +func (f *serviceConfigInformer) Lister() v1.ServiceConfigLister { + return v1.NewServiceConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicecronjob.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicecronjob.go new file mode 100644 index 000000000..83d2278cb --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicecronjob.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceCronJobInformer provides access to a shared informer and lister for +// ServiceCronJobs. +type ServiceCronJobInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceCronJobLister +} + +type serviceCronJobInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceCronJobInformer constructs a new informer for ServiceCronJob type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceCronJobInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceCronJobInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceCronJobInformer constructs a new informer for ServiceCronJob type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceCronJobInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceCronJobs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceCronJobs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceCronJob{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceCronJobInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceCronJobInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceCronJobInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceCronJob{}, f.defaultInformer) +} + +func (f *serviceCronJobInformer) Lister() v1.ServiceCronJobLister { + return v1.NewServiceCronJobLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedaemonset.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedaemonset.go new file mode 100644 index 000000000..3b74d651b --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedaemonset.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceDaemonSetInformer provides access to a shared informer and lister for +// ServiceDaemonSets. +type ServiceDaemonSetInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceDaemonSetLister +} + +type serviceDaemonSetInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceDaemonSetInformer constructs a new informer for ServiceDaemonSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceDaemonSetInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceDaemonSetInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceDaemonSetInformer constructs a new informer for ServiceDaemonSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceDaemonSetInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceDaemonSets().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceDaemonSets().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceDaemonSet{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceDaemonSetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceDaemonSetInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceDaemonSetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceDaemonSet{}, f.defaultInformer) +} + +func (f *serviceDaemonSetInformer) Lister() v1.ServiceDaemonSetLister { + return v1.NewServiceDaemonSetLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedeployment.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedeployment.go new file mode 100644 index 000000000..d175dee1b --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedeployment.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceDeploymentInformer provides access to a shared informer and lister for +// ServiceDeployments. +type ServiceDeploymentInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceDeploymentLister +} + +type serviceDeploymentInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceDeploymentInformer constructs a new informer for ServiceDeployment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceDeploymentInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceDeploymentInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceDeploymentInformer constructs a new informer for ServiceDeployment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceDeploymentInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceDeployments().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceDeployments().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceDeployment{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceDeploymentInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceDeploymentInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceDeploymentInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceDeployment{}, f.defaultInformer) +} + +func (f *serviceDeploymentInformer) Lister() v1.ServiceDeploymentLister { + return v1.NewServiceDeploymentLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedeploymentcontainer.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedeploymentcontainer.go new file mode 100644 index 000000000..214f36345 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedeploymentcontainer.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceDeploymentContainerInformer provides access to a shared informer and lister for +// ServiceDeploymentContainers. +type ServiceDeploymentContainerInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceDeploymentContainerLister +} + +type serviceDeploymentContainerInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceDeploymentContainerInformer constructs a new informer for ServiceDeploymentContainer type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceDeploymentContainerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceDeploymentContainerInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceDeploymentContainerInformer constructs a new informer for ServiceDeploymentContainer type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceDeploymentContainerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceDeploymentContainers().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceDeploymentContainers().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceDeploymentContainer{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceDeploymentContainerInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceDeploymentContainerInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceDeploymentContainerInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceDeploymentContainer{}, f.defaultInformer) +} + +func (f *serviceDeploymentContainerInformer) Lister() v1.ServiceDeploymentContainerLister { + return v1.NewServiceDeploymentContainerLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedirectoryentryconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedirectoryentryconfig.go new file mode 100644 index 000000000..15cff618b --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedirectoryentryconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceDirectoryEntryConfigInformer provides access to a shared informer and lister for +// ServiceDirectoryEntryConfigs. +type ServiceDirectoryEntryConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceDirectoryEntryConfigLister +} + +type serviceDirectoryEntryConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceDirectoryEntryConfigInformer constructs a new informer for ServiceDirectoryEntryConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceDirectoryEntryConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceDirectoryEntryConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceDirectoryEntryConfigInformer constructs a new informer for ServiceDirectoryEntryConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceDirectoryEntryConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceDirectoryEntryConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceDirectoryEntryConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceDirectoryEntryConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceDirectoryEntryConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceDirectoryEntryConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig{}, f.defaultInformer) +} + +func (f *serviceDirectoryEntryConfigInformer) Lister() v1.ServiceDirectoryEntryConfigLister { + return v1.NewServiceDirectoryEntryConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedirectoryn.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedirectoryn.go new file mode 100644 index 000000000..5c80f785e --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedirectoryn.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceDirectoryNInformer provides access to a shared informer and lister for +// ServiceDirectoryNs. +type ServiceDirectoryNInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceDirectoryNLister +} + +type serviceDirectoryNInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceDirectoryNInformer constructs a new informer for ServiceDirectoryN type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceDirectoryNInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceDirectoryNInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceDirectoryNInformer constructs a new informer for ServiceDirectoryN type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceDirectoryNInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceDirectoryNs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceDirectoryNs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceDirectoryN{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceDirectoryNInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceDirectoryNInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceDirectoryNInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceDirectoryN{}, f.defaultInformer) +} + +func (f *serviceDirectoryNInformer) Lister() v1.ServiceDirectoryNLister { + return v1.NewServiceDirectoryNLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedirectoryrt.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedirectoryrt.go new file mode 100644 index 000000000..6d88218e7 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedirectoryrt.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceDirectoryRTInformer provides access to a shared informer and lister for +// ServiceDirectoryRTs. +type ServiceDirectoryRTInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceDirectoryRTLister +} + +type serviceDirectoryRTInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceDirectoryRTInformer constructs a new informer for ServiceDirectoryRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceDirectoryRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceDirectoryRTInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceDirectoryRTInformer constructs a new informer for ServiceDirectoryRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceDirectoryRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceDirectoryRTs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceDirectoryRTs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceDirectoryRT{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceDirectoryRTInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceDirectoryRTInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceDirectoryRTInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceDirectoryRT{}, f.defaultInformer) +} + +func (f *serviceDirectoryRTInformer) Lister() v1.ServiceDirectoryRTLister { + return v1.NewServiceDirectoryRTLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolder.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolder.go new file mode 100644 index 000000000..2a975ac51 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolder.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceDirectoryRTFolderInformer provides access to a shared informer and lister for +// ServiceDirectoryRTFolders. +type ServiceDirectoryRTFolderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceDirectoryRTFolderLister +} + +type serviceDirectoryRTFolderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceDirectoryRTFolderInformer constructs a new informer for ServiceDirectoryRTFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceDirectoryRTFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceDirectoryRTFolderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceDirectoryRTFolderInformer constructs a new informer for ServiceDirectoryRTFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceDirectoryRTFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceDirectoryRTFolders().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceDirectoryRTFolders().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceDirectoryRTFolderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceDirectoryRTFolderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceDirectoryRTFolderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder{}, f.defaultInformer) +} + +func (f *serviceDirectoryRTFolderInformer) Lister() v1.ServiceDirectoryRTFolderLister { + return v1.NewServiceDirectoryRTFolderLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolderentry.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolderentry.go new file mode 100644 index 000000000..670f723e2 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolderentry.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceDirectoryRTFolderEntryInformer provides access to a shared informer and lister for +// ServiceDirectoryRTFolderEntries. +type ServiceDirectoryRTFolderEntryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceDirectoryRTFolderEntryLister +} + +type serviceDirectoryRTFolderEntryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceDirectoryRTFolderEntryInformer constructs a new informer for ServiceDirectoryRTFolderEntry type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceDirectoryRTFolderEntryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceDirectoryRTFolderEntryInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceDirectoryRTFolderEntryInformer constructs a new informer for ServiceDirectoryRTFolderEntry type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceDirectoryRTFolderEntryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceDirectoryRTFolderEntries().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceDirectoryRTFolderEntries().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceDirectoryRTFolderEntryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceDirectoryRTFolderEntryInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceDirectoryRTFolderEntryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry{}, f.defaultInformer) +} + +func (f *serviceDirectoryRTFolderEntryInformer) Lister() v1.ServiceDirectoryRTFolderEntryLister { + return v1.NewServiceDirectoryRTFolderEntryLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceentry.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceentry.go new file mode 100644 index 000000000..3e1c31340 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceentry.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceEntryInformer provides access to a shared informer and lister for +// ServiceEntries. +type ServiceEntryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceEntryLister +} + +type serviceEntryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceEntryInformer constructs a new informer for ServiceEntry type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceEntryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceEntryInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceEntryInformer constructs a new informer for ServiceEntry type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceEntryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceEntries().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceEntries().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceEntry{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceEntryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceEntryInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceEntryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceEntry{}, f.defaultInformer) +} + +func (f *serviceEntryInformer) Lister() v1.ServiceEntryLister { + return v1.NewServiceEntryLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceentryconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceentryconfig.go new file mode 100644 index 000000000..8122af17f --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceentryconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceEntryConfigInformer provides access to a shared informer and lister for +// ServiceEntryConfigs. +type ServiceEntryConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceEntryConfigLister +} + +type serviceEntryConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceEntryConfigInformer constructs a new informer for ServiceEntryConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceEntryConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceEntryConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceEntryConfigInformer constructs a new informer for ServiceEntryConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceEntryConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceEntryConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceEntryConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceEntryConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceEntryConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceEntryConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceEntryConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceEntryConfig{}, f.defaultInformer) +} + +func (f *serviceEntryConfigInformer) Lister() v1.ServiceEntryConfigLister { + return v1.NewServiceEntryConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceinstance.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceinstance.go new file mode 100644 index 000000000..adf48bb2b --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceinstance.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceInstanceInformer provides access to a shared informer and lister for +// ServiceInstances. +type ServiceInstanceInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceInstanceLister +} + +type serviceInstanceInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceInstanceInformer constructs a new informer for ServiceInstance type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceInstanceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceInstanceInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceInstanceInformer constructs a new informer for ServiceInstance type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceInstanceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceInstances().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceInstances().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceInstance{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceInstanceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceInstanceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceInstanceInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceInstance{}, f.defaultInformer) +} + +func (f *serviceInstanceInformer) Lister() v1.ServiceInstanceLister { + return v1.NewServiceInstanceLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceinstancecontainer.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceinstancecontainer.go new file mode 100644 index 000000000..ea7a6ec0a --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceinstancecontainer.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceInstanceContainerInformer provides access to a shared informer and lister for +// ServiceInstanceContainers. +type ServiceInstanceContainerInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceInstanceContainerLister +} + +type serviceInstanceContainerInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceInstanceContainerInformer constructs a new informer for ServiceInstanceContainer type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceInstanceContainerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceInstanceContainerInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceInstanceContainerInformer constructs a new informer for ServiceInstanceContainer type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceInstanceContainerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceInstanceContainers().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceInstanceContainers().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceInstanceContainer{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceInstanceContainerInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceInstanceContainerInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceInstanceContainerInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceInstanceContainer{}, f.defaultInformer) +} + +func (f *serviceInstanceContainerInformer) Lister() v1.ServiceInstanceContainerLister { + return v1.NewServiceInstanceContainerLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicejob.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicejob.go new file mode 100644 index 000000000..af80bd12b --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicejob.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceJobInformer provides access to a shared informer and lister for +// ServiceJobs. +type ServiceJobInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceJobLister +} + +type serviceJobInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceJobInformer constructs a new informer for ServiceJob type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceJobInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceJobInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceJobInformer constructs a new informer for ServiceJob type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceJobInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceJobs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceJobs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceJob{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceJobInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceJobInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceJobInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceJob{}, f.defaultInformer) +} + +func (f *serviceJobInformer) Lister() v1.ServiceJobLister { + return v1.NewServiceJobLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicelevelobjective.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicelevelobjective.go new file mode 100644 index 000000000..83a26b829 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicelevelobjective.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceLevelObjectiveInformer provides access to a shared informer and lister for +// ServiceLevelObjectives. +type ServiceLevelObjectiveInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceLevelObjectiveLister +} + +type serviceLevelObjectiveInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceLevelObjectiveInformer constructs a new informer for ServiceLevelObjective type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceLevelObjectiveInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceLevelObjectiveInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceLevelObjectiveInformer constructs a new informer for ServiceLevelObjective type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceLevelObjectiveInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceLevelObjectives().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceLevelObjectives().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceLevelObjective{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceLevelObjectiveInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceLevelObjectiveInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceLevelObjectiveInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceLevelObjective{}, f.defaultInformer) +} + +func (f *serviceLevelObjectiveInformer) Lister() v1.ServiceLevelObjectiveLister { + return v1.NewServiceLevelObjectiveLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicelevelobjectivefolder.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicelevelobjectivefolder.go new file mode 100644 index 000000000..028f535fe --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicelevelobjectivefolder.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceLevelObjectiveFolderInformer provides access to a shared informer and lister for +// ServiceLevelObjectiveFolders. +type ServiceLevelObjectiveFolderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceLevelObjectiveFolderLister +} + +type serviceLevelObjectiveFolderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceLevelObjectiveFolderInformer constructs a new informer for ServiceLevelObjectiveFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceLevelObjectiveFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceLevelObjectiveFolderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceLevelObjectiveFolderInformer constructs a new informer for ServiceLevelObjectiveFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceLevelObjectiveFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceLevelObjectiveFolders().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceLevelObjectiveFolders().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceLevelObjectiveFolderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceLevelObjectiveFolderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceLevelObjectiveFolderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder{}, f.defaultInformer) +} + +func (f *serviceLevelObjectiveFolderInformer) Lister() v1.ServiceLevelObjectiveFolderLister { + return v1.NewServiceLevelObjectiveFolderLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicereplicaset.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicereplicaset.go new file mode 100644 index 000000000..8eb2f5f94 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicereplicaset.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceReplicaSetInformer provides access to a shared informer and lister for +// ServiceReplicaSets. +type ServiceReplicaSetInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceReplicaSetLister +} + +type serviceReplicaSetInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceReplicaSetInformer constructs a new informer for ServiceReplicaSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceReplicaSetInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceReplicaSetInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceReplicaSetInformer constructs a new informer for ServiceReplicaSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceReplicaSetInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceReplicaSets().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceReplicaSets().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceReplicaSet{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceReplicaSetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceReplicaSetInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceReplicaSetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceReplicaSet{}, f.defaultInformer) +} + +func (f *serviceReplicaSetInformer) Lister() v1.ServiceReplicaSetLister { + return v1.NewServiceReplicaSetLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicestatefulset.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicestatefulset.go new file mode 100644 index 000000000..d0d777ee1 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicestatefulset.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceStatefulSetInformer provides access to a shared informer and lister for +// ServiceStatefulSets. +type ServiceStatefulSetInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceStatefulSetLister +} + +type serviceStatefulSetInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceStatefulSetInformer constructs a new informer for ServiceStatefulSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceStatefulSetInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceStatefulSetInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceStatefulSetInformer constructs a new informer for ServiceStatefulSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceStatefulSetInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceStatefulSets().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceStatefulSets().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceStatefulSet{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceStatefulSetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceStatefulSetInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceStatefulSetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceStatefulSet{}, f.defaultInformer) +} + +func (f *serviceStatefulSetInformer) Lister() v1.ServiceStatefulSetLister { + return v1.NewServiceStatefulSetLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicetemplate.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicetemplate.go new file mode 100644 index 000000000..043ec9662 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicetemplate.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceTemplateInformer provides access to a shared informer and lister for +// ServiceTemplates. +type ServiceTemplateInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceTemplateLister +} + +type serviceTemplateInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceTemplateInformer constructs a new informer for ServiceTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceTemplateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceTemplateInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceTemplateInformer constructs a new informer for ServiceTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceTemplateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceTemplates().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceTemplates().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceTemplate{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceTemplateInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceTemplateInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceTemplateInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceTemplate{}, f.defaultInformer) +} + +func (f *serviceTemplateInformer) Lister() v1.ServiceTemplateLister { + return v1.NewServiceTemplateLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicetemplateservicedefinition.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicetemplateservicedefinition.go new file mode 100644 index 000000000..38f452e10 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/servicetemplateservicedefinition.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceTemplateServiceDefinitionInformer provides access to a shared informer and lister for +// ServiceTemplateServiceDefinitions. +type ServiceTemplateServiceDefinitionInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceTemplateServiceDefinitionLister +} + +type serviceTemplateServiceDefinitionInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceTemplateServiceDefinitionInformer constructs a new informer for ServiceTemplateServiceDefinition type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceTemplateServiceDefinitionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceTemplateServiceDefinitionInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceTemplateServiceDefinitionInformer constructs a new informer for ServiceTemplateServiceDefinition type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceTemplateServiceDefinitionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceTemplateServiceDefinitions().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceTemplateServiceDefinitions().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceTemplateServiceDefinitionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceTemplateServiceDefinitionInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceTemplateServiceDefinitionInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition{}, f.defaultInformer) +} + +func (f *serviceTemplateServiceDefinitionInformer) Lister() v1.ServiceTemplateServiceDefinitionLister { + return v1.NewServiceTemplateServiceDefinitionLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceversion.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceversion.go new file mode 100644 index 000000000..a498ac00d --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceversion.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceVersionInformer provides access to a shared informer and lister for +// ServiceVersions. +type ServiceVersionInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceVersionLister +} + +type serviceVersionInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceVersionInformer constructs a new informer for ServiceVersion type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceVersionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceVersionInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceVersionInformer constructs a new informer for ServiceVersion type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceVersionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceVersions().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceVersions().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceVersion{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceVersionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceVersionInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceVersionInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceVersion{}, f.defaultInformer) +} + +func (f *serviceVersionInformer) Lister() v1.ServiceVersionLister { + return v1.NewServiceVersionLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceversionconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceversionconfig.go new file mode 100644 index 000000000..6c626f503 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/serviceversionconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceVersionConfigInformer provides access to a shared informer and lister for +// ServiceVersionConfigs. +type ServiceVersionConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceVersionConfigLister +} + +type serviceVersionConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceVersionConfigInformer constructs a new informer for ServiceVersionConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceVersionConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceVersionConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceVersionConfigInformer constructs a new informer for ServiceVersionConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceVersionConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceVersionConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().ServiceVersionConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.ServiceVersionConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceVersionConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceVersionConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceVersionConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.ServiceVersionConfig{}, f.defaultInformer) +} + +func (f *serviceVersionConfigInformer) Lister() v1.ServiceVersionConfigLister { + return v1.NewServiceVersionConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/sharedserviceconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/sharedserviceconfig.go new file mode 100644 index 000000000..082f3d724 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/sharedserviceconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SharedServiceConfigInformer provides access to a shared informer and lister for +// SharedServiceConfigs. +type SharedServiceConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.SharedServiceConfigLister +} + +type sharedServiceConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewSharedServiceConfigInformer constructs a new informer for SharedServiceConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSharedServiceConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSharedServiceConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredSharedServiceConfigInformer constructs a new informer for SharedServiceConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSharedServiceConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SharedServiceConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SharedServiceConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.SharedServiceConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *sharedServiceConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSharedServiceConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *sharedServiceConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.SharedServiceConfig{}, f.defaultInformer) +} + +func (f *sharedServiceConfigInformer) Lister() v1.SharedServiceConfigLister { + return v1.NewSharedServiceConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/sloconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/sloconfig.go new file mode 100644 index 000000000..a5c5f83c0 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/sloconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SloConfigInformer provides access to a shared informer and lister for +// SloConfigs. +type SloConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.SloConfigLister +} + +type sloConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewSloConfigInformer constructs a new informer for SloConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSloConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSloConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredSloConfigInformer constructs a new informer for SloConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSloConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SloConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SloConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.SloConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *sloConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSloConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *sloConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.SloConfig{}, f.defaultInformer) +} + +func (f *sloConfigInformer) Lister() v1.SloConfigLister { + return v1.NewSloConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/slofolder.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/slofolder.go new file mode 100644 index 000000000..f1b52349f --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/slofolder.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SLOFolderInformer provides access to a shared informer and lister for +// SLOFolders. +type SLOFolderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.SLOFolderLister +} + +type sLOFolderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewSLOFolderInformer constructs a new informer for SLOFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSLOFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSLOFolderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredSLOFolderInformer constructs a new informer for SLOFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSLOFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SLOFolders().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SLOFolders().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.SLOFolder{}, + resyncPeriod, + indexers, + ) +} + +func (f *sLOFolderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSLOFolderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *sLOFolderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.SLOFolder{}, f.defaultInformer) +} + +func (f *sLOFolderInformer) Lister() v1.SLOFolderLister { + return v1.NewSLOFolderLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/slopolicy.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/slopolicy.go new file mode 100644 index 000000000..3c3b11c57 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/slopolicy.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SLOPolicyInformer provides access to a shared informer and lister for +// SLOPolicies. +type SLOPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.SLOPolicyLister +} + +type sLOPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewSLOPolicyInformer constructs a new informer for SLOPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSLOPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSLOPolicyInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredSLOPolicyInformer constructs a new informer for SLOPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSLOPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SLOPolicies().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SLOPolicies().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.SLOPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *sLOPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSLOPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *sLOPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.SLOPolicy{}, f.defaultInformer) +} + +func (f *sLOPolicyInformer) Lister() v1.SLOPolicyLister { + return v1.NewSLOPolicyLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/sloserviceconfig.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/sloserviceconfig.go new file mode 100644 index 000000000..de791b9c7 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/sloserviceconfig.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SloServiceConfigInformer provides access to a shared informer and lister for +// SloServiceConfigs. +type SloServiceConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.SloServiceConfigLister +} + +type sloServiceConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewSloServiceConfigInformer constructs a new informer for SloServiceConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSloServiceConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSloServiceConfigInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredSloServiceConfigInformer constructs a new informer for SloServiceConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSloServiceConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SloServiceConfigs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SloServiceConfigs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.SloServiceConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *sloServiceConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSloServiceConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *sloServiceConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.SloServiceConfig{}, f.defaultInformer) +} + +func (f *sloServiceConfigInformer) Lister() v1.SloServiceConfigLister { + return v1.NewSloServiceConfigLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/svcgroup.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/svcgroup.go new file mode 100644 index 000000000..706402ab1 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/svcgroup.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SvcGroupInformer provides access to a shared informer and lister for +// SvcGroups. +type SvcGroupInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.SvcGroupLister +} + +type svcGroupInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewSvcGroupInformer constructs a new informer for SvcGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSvcGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSvcGroupInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredSvcGroupInformer constructs a new informer for SvcGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSvcGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SvcGroups().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SvcGroups().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.SvcGroup{}, + resyncPeriod, + indexers, + ) +} + +func (f *svcGroupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSvcGroupInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *svcGroupInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.SvcGroup{}, f.defaultInformer) +} + +func (f *svcGroupInformer) Lister() v1.SvcGroupLister { + return v1.NewSvcGroupLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/svcgrouprt.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/svcgrouprt.go new file mode 100644 index 000000000..982104fe4 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/svcgrouprt.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SvcGroupRTInformer provides access to a shared informer and lister for +// SvcGroupRTs. +type SvcGroupRTInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.SvcGroupRTLister +} + +type svcGroupRTInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewSvcGroupRTInformer constructs a new informer for SvcGroupRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSvcGroupRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSvcGroupRTInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredSvcGroupRTInformer constructs a new informer for SvcGroupRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSvcGroupRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SvcGroupRTs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().SvcGroupRTs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.SvcGroupRT{}, + resyncPeriod, + indexers, + ) +} + +func (f *svcGroupRTInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSvcGroupRTInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *svcGroupRTInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.SvcGroupRT{}, f.defaultInformer) +} + +func (f *svcGroupRTInformer) Lister() v1.SvcGroupRTLister { + return v1.NewSvcGroupRTLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/table.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/table.go new file mode 100644 index 000000000..3fef74f5b --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/table.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// TableInformer provides access to a shared informer and lister for +// Tables. +type TableInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.TableLister +} + +type tableInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewTableInformer constructs a new informer for Table type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTableInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTableInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredTableInformer constructs a new informer for Table type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTableInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Tables().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Tables().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Table{}, + resyncPeriod, + indexers, + ) +} + +func (f *tableInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTableInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *tableInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Table{}, f.defaultInformer) +} + +func (f *tableInformer) Lister() v1.TableLister { + return v1.NewTableLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/template.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/template.go new file mode 100644 index 000000000..2062f7383 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/template.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// TemplateInformer provides access to a shared informer and lister for +// Templates. +type TemplateInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.TemplateLister +} + +type templateInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewTemplateInformer constructs a new informer for Template type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTemplateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTemplateInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredTemplateInformer constructs a new informer for Template type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTemplateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Templates().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Templates().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Template{}, + resyncPeriod, + indexers, + ) +} + +func (f *templateInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTemplateInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *templateInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Template{}, f.defaultInformer) +} + +func (f *templateInformer) Lister() v1.TemplateLister { + return v1.NewTemplateLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/templategroup.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/templategroup.go new file mode 100644 index 000000000..94c7405e4 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/templategroup.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// TemplateGroupInformer provides access to a shared informer and lister for +// TemplateGroups. +type TemplateGroupInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.TemplateGroupLister +} + +type templateGroupInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewTemplateGroupInformer constructs a new informer for TemplateGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTemplateGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTemplateGroupInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredTemplateGroupInformer constructs a new informer for TemplateGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTemplateGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().TemplateGroups().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().TemplateGroups().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.TemplateGroup{}, + resyncPeriod, + indexers, + ) +} + +func (f *templateGroupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTemplateGroupInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *templateGroupInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.TemplateGroup{}, f.defaultInformer) +} + +func (f *templateGroupInformer) Lister() v1.TemplateGroupLister { + return v1.NewTemplateGroupLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/tenant.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/tenant.go new file mode 100644 index 000000000..90246851f --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/tenant.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// TenantInformer provides access to a shared informer and lister for +// Tenants. +type TenantInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.TenantLister +} + +type tenantInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewTenantInformer constructs a new informer for Tenant type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTenantInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTenantInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredTenantInformer constructs a new informer for Tenant type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTenantInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Tenants().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Tenants().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.Tenant{}, + resyncPeriod, + indexers, + ) +} + +func (f *tenantInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTenantInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *tenantInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.Tenant{}, f.defaultInformer) +} + +func (f *tenantInformer) Lister() v1.TenantLister { + return v1.NewTenantLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/tenantresource.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/tenantresource.go new file mode 100644 index 000000000..25d536faf --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/tenantresource.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// TenantResourceInformer provides access to a shared informer and lister for +// TenantResources. +type TenantResourceInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.TenantResourceLister +} + +type tenantResourceInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewTenantResourceInformer constructs a new informer for TenantResource type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTenantResourceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTenantResourceInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredTenantResourceInformer constructs a new informer for TenantResource type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTenantResourceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().TenantResources().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().TenantResources().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.TenantResource{}, + resyncPeriod, + indexers, + ) +} + +func (f *tenantResourceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTenantResourceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *tenantResourceInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.TenantResource{}, f.defaultInformer) +} + +func (f *tenantResourceInformer) Lister() v1.TenantResourceLister { + return v1.NewTenantResourceLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/tenanttoken.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/tenanttoken.go new file mode 100644 index 000000000..94787db60 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/tenanttoken.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// TenantTokenInformer provides access to a shared informer and lister for +// TenantTokens. +type TenantTokenInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.TenantTokenLister +} + +type tenantTokenInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewTenantTokenInformer constructs a new informer for TenantToken type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTenantTokenInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTenantTokenInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredTenantTokenInformer constructs a new informer for TenantToken type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTenantTokenInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().TenantTokens().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().TenantTokens().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.TenantToken{}, + resyncPeriod, + indexers, + ) +} + +func (f *tenantTokenInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTenantTokenInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *tenantTokenInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.TenantToken{}, f.defaultInformer) +} + +func (f *tenantTokenInformer) Lister() v1.TenantTokenLister { + return v1.NewTenantTokenLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/user.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/user.go new file mode 100644 index 000000000..d297add7d --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/user.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// UserInformer provides access to a shared informer and lister for +// Users. +type UserInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.UserLister +} + +type userInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewUserInformer constructs a new informer for User type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewUserInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredUserInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredUserInformer constructs a new informer for User type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredUserInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Users().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().Users().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.User{}, + resyncPeriod, + indexers, + ) +} + +func (f *userInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredUserInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *userInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.User{}, f.defaultInformer) +} + +func (f *userInformer) Lister() v1.UserLister { + return v1.NewUserLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/userdiscovery.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/userdiscovery.go new file mode 100644 index 000000000..7d392d709 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/userdiscovery.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// UserDiscoveryInformer provides access to a shared informer and lister for +// UserDiscoveries. +type UserDiscoveryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.UserDiscoveryLister +} + +type userDiscoveryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewUserDiscoveryInformer constructs a new informer for UserDiscovery type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewUserDiscoveryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredUserDiscoveryInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredUserDiscoveryInformer constructs a new informer for UserDiscovery type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredUserDiscoveryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().UserDiscoveries().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().UserDiscoveries().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.UserDiscovery{}, + resyncPeriod, + indexers, + ) +} + +func (f *userDiscoveryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredUserDiscoveryInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *userDiscoveryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.UserDiscovery{}, f.defaultInformer) +} + +func (f *userDiscoveryInformer) Lister() v1.UserDiscoveryLister { + return v1.NewUserDiscoveryLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/userdiscoveryrt.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/userdiscoveryrt.go new file mode 100644 index 000000000..1ac8d895b --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/userdiscoveryrt.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// UserDiscoveryRTInformer provides access to a shared informer and lister for +// UserDiscoveryRTs. +type UserDiscoveryRTInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.UserDiscoveryRTLister +} + +type userDiscoveryRTInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewUserDiscoveryRTInformer constructs a new informer for UserDiscoveryRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewUserDiscoveryRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredUserDiscoveryRTInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredUserDiscoveryRTInformer constructs a new informer for UserDiscoveryRT type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredUserDiscoveryRTInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().UserDiscoveryRTs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().UserDiscoveryRTs().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.UserDiscoveryRT{}, + resyncPeriod, + indexers, + ) +} + +func (f *userDiscoveryRTInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredUserDiscoveryRTInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *userDiscoveryRTInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.UserDiscoveryRT{}, f.defaultInformer) +} + +func (f *userDiscoveryRTInformer) Lister() v1.UserDiscoveryRTLister { + return v1.NewUserDiscoveryRTLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/userfolder.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/userfolder.go new file mode 100644 index 000000000..9605ee20d --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/userfolder.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// UserFolderInformer provides access to a shared informer and lister for +// UserFolders. +type UserFolderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.UserFolderLister +} + +type userFolderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewUserFolderInformer constructs a new informer for UserFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewUserFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredUserFolderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredUserFolderInformer constructs a new informer for UserFolder type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredUserFolderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().UserFolders().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().UserFolders().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.UserFolder{}, + resyncPeriod, + indexers, + ) +} + +func (f *userFolderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredUserFolderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *userFolderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.UserFolder{}, f.defaultInformer) +} + +func (f *userFolderInformer) Lister() v1.UserFolderLister { + return v1.NewUserFolderLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/usergroup.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/usergroup.go new file mode 100644 index 000000000..427e314ee --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/usergroup.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// UserGroupInformer provides access to a shared informer and lister for +// UserGroups. +type UserGroupInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.UserGroupLister +} + +type userGroupInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewUserGroupInformer constructs a new informer for UserGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewUserGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredUserGroupInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredUserGroupInformer constructs a new informer for UserGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredUserGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().UserGroups().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().UserGroups().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.UserGroup{}, + resyncPeriod, + indexers, + ) +} + +func (f *userGroupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredUserGroupInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *userGroupInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.UserGroup{}, f.defaultInformer) +} + +func (f *userGroupInformer) Lister() v1.UserGroupLister { + return v1.NewUserGroupLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/userpreference.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/userpreference.go new file mode 100644 index 000000000..4e87dca40 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/userpreference.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// UserPreferenceInformer provides access to a shared informer and lister for +// UserPreferences. +type UserPreferenceInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.UserPreferenceLister +} + +type userPreferenceInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewUserPreferenceInformer constructs a new informer for UserPreference type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewUserPreferenceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredUserPreferenceInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredUserPreferenceInformer constructs a new informer for UserPreference type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredUserPreferenceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().UserPreferences().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().UserPreferences().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.UserPreference{}, + resyncPeriod, + indexers, + ) +} + +func (f *userPreferenceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredUserPreferenceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *userPreferenceInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.UserPreference{}, f.defaultInformer) +} + +func (f *userPreferenceInformer) Lister() v1.UserPreferenceLister { + return v1.NewUserPreferenceLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/virtualservice.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/virtualservice.go new file mode 100644 index 000000000..19f1b0dce --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/virtualservice.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// VirtualServiceInformer provides access to a shared informer and lister for +// VirtualServices. +type VirtualServiceInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.VirtualServiceLister +} + +type virtualServiceInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewVirtualServiceInformer constructs a new informer for VirtualService type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewVirtualServiceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredVirtualServiceInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredVirtualServiceInformer constructs a new informer for VirtualService type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredVirtualServiceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().VirtualServices().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().VirtualServices().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.VirtualService{}, + resyncPeriod, + indexers, + ) +} + +func (f *virtualServiceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredVirtualServiceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *virtualServiceInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.VirtualService{}, f.defaultInformer) +} + +func (f *virtualServiceInformer) Lister() v1.VirtualServiceLister { + return v1.NewVirtualServiceLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/workloadentry.go b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/workloadentry.go new file mode 100644 index 000000000..5cf862492 --- /dev/null +++ b/compiler/example/output/generated/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1/workloadentry.go @@ -0,0 +1,89 @@ +/* +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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + globaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + versioned "nexustempmodule/client/clientset/versioned" + internalinterfaces "nexustempmodule/client/informers/externalversions/internalinterfaces" + v1 "nexustempmodule/client/listers/global.tsm.tanzu.vmware.com/v1" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// WorkloadEntryInformer provides access to a shared informer and lister for +// WorkloadEntries. +type WorkloadEntryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.WorkloadEntryLister +} + +type workloadEntryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewWorkloadEntryInformer constructs a new informer for WorkloadEntry type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewWorkloadEntryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredWorkloadEntryInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredWorkloadEntryInformer constructs a new informer for WorkloadEntry type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredWorkloadEntryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().WorkloadEntries().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GlobalTsmV1().WorkloadEntries().Watch(context.TODO(), options) + }, + }, + &globaltsmtanzuvmwarecomv1.WorkloadEntry{}, + resyncPeriod, + indexers, + ) +} + +func (f *workloadEntryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredWorkloadEntryInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *workloadEntryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&globaltsmtanzuvmwarecomv1.WorkloadEntry{}, f.defaultInformer) +} + +func (f *workloadEntryInformer) Lister() v1.WorkloadEntryLister { + return v1.NewWorkloadEntryLister(f.Informer().GetIndexer()) +} diff --git a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/interface.go b/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/interface.go deleted file mode 100644 index 059692bf5..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package gns - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to each of this group's versions. -type Interface interface { - // V1 provides access to shared informers for resources in V1. - V1() v1.Interface -} - -type group struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// V1 returns a new v1.Interface. -func (g *group) V1() v1.Interface { - return v1.New(g.factory, g.namespace, g.tweakListOptions) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/additionalgnsdata.go b/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/additionalgnsdata.go deleted file mode 100644 index e0b1f2c3d..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/additionalgnsdata.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - gnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// AdditionalGnsDataInformer provides access to a shared informer and lister for -// AdditionalGnsDatas. -type AdditionalGnsDataInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.AdditionalGnsDataLister -} - -type additionalGnsDataInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewAdditionalGnsDataInformer constructs a new informer for AdditionalGnsData type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewAdditionalGnsDataInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredAdditionalGnsDataInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredAdditionalGnsDataInformer constructs a new informer for AdditionalGnsData type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredAdditionalGnsDataInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GnsTsmV1().AdditionalGnsDatas().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GnsTsmV1().AdditionalGnsDatas().Watch(context.TODO(), options) - }, - }, - &gnstsmtanzuvmwarecomv1.AdditionalGnsData{}, - resyncPeriod, - indexers, - ) -} - -func (f *additionalGnsDataInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredAdditionalGnsDataInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *additionalGnsDataInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&gnstsmtanzuvmwarecomv1.AdditionalGnsData{}, f.defaultInformer) -} - -func (f *additionalGnsDataInformer) Lister() v1.AdditionalGnsDataLister { - return v1.NewAdditionalGnsDataLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/barchild.go b/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/barchild.go deleted file mode 100644 index 2f118cbc4..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/barchild.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - gnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// BarChildInformer provides access to a shared informer and lister for -// BarChilds. -type BarChildInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.BarChildLister -} - -type barChildInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewBarChildInformer constructs a new informer for BarChild type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewBarChildInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredBarChildInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredBarChildInformer constructs a new informer for BarChild type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredBarChildInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GnsTsmV1().BarChilds().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GnsTsmV1().BarChilds().Watch(context.TODO(), options) - }, - }, - &gnstsmtanzuvmwarecomv1.BarChild{}, - resyncPeriod, - indexers, - ) -} - -func (f *barChildInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredBarChildInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *barChildInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&gnstsmtanzuvmwarecomv1.BarChild{}, f.defaultInformer) -} - -func (f *barChildInformer) Lister() v1.BarChildLister { - return v1.NewBarChildLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/dns.go b/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/dns.go deleted file mode 100644 index c80a97e71..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/dns.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - gnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// DnsInformer provides access to a shared informer and lister for -// Dnses. -type DnsInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.DnsLister -} - -type dnsInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewDnsInformer constructs a new informer for Dns type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewDnsInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredDnsInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredDnsInformer constructs a new informer for Dns type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredDnsInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GnsTsmV1().Dnses().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GnsTsmV1().Dnses().Watch(context.TODO(), options) - }, - }, - &gnstsmtanzuvmwarecomv1.Dns{}, - resyncPeriod, - indexers, - ) -} - -func (f *dnsInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredDnsInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *dnsInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&gnstsmtanzuvmwarecomv1.Dns{}, f.defaultInformer) -} - -func (f *dnsInformer) Lister() v1.DnsLister { - return v1.NewDnsLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/foo.go b/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/foo.go deleted file mode 100644 index a23a014a1..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/foo.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - gnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// FooInformer provides access to a shared informer and lister for -// Foos. -type FooInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.FooLister -} - -type fooInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewFooInformer constructs a new informer for Foo type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFooInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredFooInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredFooInformer constructs a new informer for Foo type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredFooInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GnsTsmV1().Foos().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GnsTsmV1().Foos().Watch(context.TODO(), options) - }, - }, - &gnstsmtanzuvmwarecomv1.Foo{}, - resyncPeriod, - indexers, - ) -} - -func (f *fooInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredFooInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *fooInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&gnstsmtanzuvmwarecomv1.Foo{}, f.defaultInformer) -} - -func (f *fooInformer) Lister() v1.FooLister { - return v1.NewFooLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/gns.go b/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/gns.go deleted file mode 100644 index c99631b1c..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/gns.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - gnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// GnsInformer provides access to a shared informer and lister for -// Gnses. -type GnsInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.GnsLister -} - -type gnsInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewGnsInformer constructs a new informer for Gns type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewGnsInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredGnsInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredGnsInformer constructs a new informer for Gns type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredGnsInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GnsTsmV1().Gnses().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GnsTsmV1().Gnses().Watch(context.TODO(), options) - }, - }, - &gnstsmtanzuvmwarecomv1.Gns{}, - resyncPeriod, - indexers, - ) -} - -func (f *gnsInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredGnsInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *gnsInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&gnstsmtanzuvmwarecomv1.Gns{}, f.defaultInformer) -} - -func (f *gnsInformer) Lister() v1.GnsLister { - return v1.NewGnsLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/ignorechild.go b/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/ignorechild.go deleted file mode 100644 index 4dac73670..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/ignorechild.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - gnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// IgnoreChildInformer provides access to a shared informer and lister for -// IgnoreChilds. -type IgnoreChildInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.IgnoreChildLister -} - -type ignoreChildInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewIgnoreChildInformer constructs a new informer for IgnoreChild type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewIgnoreChildInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredIgnoreChildInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredIgnoreChildInformer constructs a new informer for IgnoreChild type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredIgnoreChildInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GnsTsmV1().IgnoreChilds().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GnsTsmV1().IgnoreChilds().Watch(context.TODO(), options) - }, - }, - &gnstsmtanzuvmwarecomv1.IgnoreChild{}, - resyncPeriod, - indexers, - ) -} - -func (f *ignoreChildInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredIgnoreChildInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *ignoreChildInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&gnstsmtanzuvmwarecomv1.IgnoreChild{}, f.defaultInformer) -} - -func (f *ignoreChildInformer) Lister() v1.IgnoreChildLister { - return v1.NewIgnoreChildLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/interface.go b/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/interface.go deleted file mode 100644 index 9436e8167..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/interface.go +++ /dev/null @@ -1,87 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // AdditionalGnsDatas returns a AdditionalGnsDataInformer. - AdditionalGnsDatas() AdditionalGnsDataInformer - // BarChilds returns a BarChildInformer. - BarChilds() BarChildInformer - // Dnses returns a DnsInformer. - Dnses() DnsInformer - // Foos returns a FooInformer. - Foos() FooInformer - // Gnses returns a GnsInformer. - Gnses() GnsInformer - // IgnoreChilds returns a IgnoreChildInformer. - IgnoreChilds() IgnoreChildInformer - // RandomGnsDatas returns a RandomGnsDataInformer. - RandomGnsDatas() RandomGnsDataInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// AdditionalGnsDatas returns a AdditionalGnsDataInformer. -func (v *version) AdditionalGnsDatas() AdditionalGnsDataInformer { - return &additionalGnsDataInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// BarChilds returns a BarChildInformer. -func (v *version) BarChilds() BarChildInformer { - return &barChildInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// Dnses returns a DnsInformer. -func (v *version) Dnses() DnsInformer { - return &dnsInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// Foos returns a FooInformer. -func (v *version) Foos() FooInformer { - return &fooInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// Gnses returns a GnsInformer. -func (v *version) Gnses() GnsInformer { - return &gnsInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// IgnoreChilds returns a IgnoreChildInformer. -func (v *version) IgnoreChilds() IgnoreChildInformer { - return &ignoreChildInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// RandomGnsDatas returns a RandomGnsDataInformer. -func (v *version) RandomGnsDatas() RandomGnsDataInformer { - return &randomGnsDataInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} diff --git a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/randomgnsdata.go b/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/randomgnsdata.go deleted file mode 100644 index f762ca365..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1/randomgnsdata.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - gnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// RandomGnsDataInformer provides access to a shared informer and lister for -// RandomGnsDatas. -type RandomGnsDataInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.RandomGnsDataLister -} - -type randomGnsDataInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewRandomGnsDataInformer constructs a new informer for RandomGnsData type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewRandomGnsDataInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredRandomGnsDataInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredRandomGnsDataInformer constructs a new informer for RandomGnsData type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredRandomGnsDataInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GnsTsmV1().RandomGnsDatas().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GnsTsmV1().RandomGnsDatas().Watch(context.TODO(), options) - }, - }, - &gnstsmtanzuvmwarecomv1.RandomGnsData{}, - resyncPeriod, - indexers, - ) -} - -func (f *randomGnsDataInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredRandomGnsDataInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *randomGnsDataInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&gnstsmtanzuvmwarecomv1.RandomGnsData{}, f.defaultInformer) -} - -func (f *randomGnsDataInformer) Lister() v1.RandomGnsDataLister { - return v1.NewRandomGnsDataLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/compiler/example/output/generated/client/informers/externalversions/internalinterfaces/factory_interfaces.go index ae0a5c599..545059a30 100644 --- a/compiler/example/output/generated/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/compiler/example/output/generated/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -19,10 +19,9 @@ limitations under the License. package internalinterfaces import ( + versioned "nexustempmodule/client/clientset/versioned" time "time" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" diff --git a/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/interface.go b/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/interface.go deleted file mode 100644 index c983554a3..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package policypkg - -import ( - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1" -) - -// Interface provides access to each of this group's versions. -type Interface interface { - // V1 provides access to shared informers for resources in V1. - V1() v1.Interface -} - -type group struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// V1 returns a new v1.Interface. -func (g *group) V1() v1.Interface { - return v1.New(g.factory, g.namespace, g.tweakListOptions) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go b/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go deleted file mode 100644 index 717576d5d..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - policypkgtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// AccessControlPolicyInformer provides access to a shared informer and lister for -// AccessControlPolicies. -type AccessControlPolicyInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.AccessControlPolicyLister -} - -type accessControlPolicyInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewAccessControlPolicyInformer constructs a new informer for AccessControlPolicy type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewAccessControlPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredAccessControlPolicyInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredAccessControlPolicyInformer constructs a new informer for AccessControlPolicy type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredAccessControlPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.PolicypkgTsmV1().AccessControlPolicies().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.PolicypkgTsmV1().AccessControlPolicies().Watch(context.TODO(), options) - }, - }, - &policypkgtsmtanzuvmwarecomv1.AccessControlPolicy{}, - resyncPeriod, - indexers, - ) -} - -func (f *accessControlPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredAccessControlPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *accessControlPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&policypkgtsmtanzuvmwarecomv1.AccessControlPolicy{}, f.defaultInformer) -} - -func (f *accessControlPolicyInformer) Lister() v1.AccessControlPolicyLister { - return v1.NewAccessControlPolicyLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/acpconfig.go b/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/acpconfig.go deleted file mode 100644 index 9509d6975..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/acpconfig.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - policypkgtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// ACPConfigInformer provides access to a shared informer and lister for -// ACPConfigs. -type ACPConfigInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.ACPConfigLister -} - -type aCPConfigInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewACPConfigInformer constructs a new informer for ACPConfig type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewACPConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredACPConfigInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredACPConfigInformer constructs a new informer for ACPConfig type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredACPConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.PolicypkgTsmV1().ACPConfigs().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.PolicypkgTsmV1().ACPConfigs().Watch(context.TODO(), options) - }, - }, - &policypkgtsmtanzuvmwarecomv1.ACPConfig{}, - resyncPeriod, - indexers, - ) -} - -func (f *aCPConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredACPConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *aCPConfigInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&policypkgtsmtanzuvmwarecomv1.ACPConfig{}, f.defaultInformer) -} - -func (f *aCPConfigInformer) Lister() v1.ACPConfigLister { - return v1.NewACPConfigLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/additionalpolicydata.go b/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/additionalpolicydata.go deleted file mode 100644 index 768552cb2..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/additionalpolicydata.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - policypkgtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// AdditionalPolicyDataInformer provides access to a shared informer and lister for -// AdditionalPolicyDatas. -type AdditionalPolicyDataInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.AdditionalPolicyDataLister -} - -type additionalPolicyDataInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewAdditionalPolicyDataInformer constructs a new informer for AdditionalPolicyData type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewAdditionalPolicyDataInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredAdditionalPolicyDataInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredAdditionalPolicyDataInformer constructs a new informer for AdditionalPolicyData type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredAdditionalPolicyDataInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.PolicypkgTsmV1().AdditionalPolicyDatas().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.PolicypkgTsmV1().AdditionalPolicyDatas().Watch(context.TODO(), options) - }, - }, - &policypkgtsmtanzuvmwarecomv1.AdditionalPolicyData{}, - resyncPeriod, - indexers, - ) -} - -func (f *additionalPolicyDataInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredAdditionalPolicyDataInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *additionalPolicyDataInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&policypkgtsmtanzuvmwarecomv1.AdditionalPolicyData{}, f.defaultInformer) -} - -func (f *additionalPolicyDataInformer) Lister() v1.AdditionalPolicyDataLister { - return v1.NewAdditionalPolicyDataLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/interface.go b/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/interface.go deleted file mode 100644 index 38594e982..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/interface.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // ACPConfigs returns a ACPConfigInformer. - ACPConfigs() ACPConfigInformer - // AccessControlPolicies returns a AccessControlPolicyInformer. - AccessControlPolicies() AccessControlPolicyInformer - // AdditionalPolicyDatas returns a AdditionalPolicyDataInformer. - AdditionalPolicyDatas() AdditionalPolicyDataInformer - // RandomPolicyDatas returns a RandomPolicyDataInformer. - RandomPolicyDatas() RandomPolicyDataInformer - // VMpolicies returns a VMpolicyInformer. - VMpolicies() VMpolicyInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// ACPConfigs returns a ACPConfigInformer. -func (v *version) ACPConfigs() ACPConfigInformer { - return &aCPConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// AccessControlPolicies returns a AccessControlPolicyInformer. -func (v *version) AccessControlPolicies() AccessControlPolicyInformer { - return &accessControlPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// AdditionalPolicyDatas returns a AdditionalPolicyDataInformer. -func (v *version) AdditionalPolicyDatas() AdditionalPolicyDataInformer { - return &additionalPolicyDataInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// RandomPolicyDatas returns a RandomPolicyDataInformer. -func (v *version) RandomPolicyDatas() RandomPolicyDataInformer { - return &randomPolicyDataInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// VMpolicies returns a VMpolicyInformer. -func (v *version) VMpolicies() VMpolicyInformer { - return &vMpolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} diff --git a/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/randompolicydata.go b/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/randompolicydata.go deleted file mode 100644 index ab9c9729e..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/randompolicydata.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - policypkgtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// RandomPolicyDataInformer provides access to a shared informer and lister for -// RandomPolicyDatas. -type RandomPolicyDataInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.RandomPolicyDataLister -} - -type randomPolicyDataInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewRandomPolicyDataInformer constructs a new informer for RandomPolicyData type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewRandomPolicyDataInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredRandomPolicyDataInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredRandomPolicyDataInformer constructs a new informer for RandomPolicyData type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredRandomPolicyDataInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.PolicypkgTsmV1().RandomPolicyDatas().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.PolicypkgTsmV1().RandomPolicyDatas().Watch(context.TODO(), options) - }, - }, - &policypkgtsmtanzuvmwarecomv1.RandomPolicyData{}, - resyncPeriod, - indexers, - ) -} - -func (f *randomPolicyDataInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredRandomPolicyDataInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *randomPolicyDataInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&policypkgtsmtanzuvmwarecomv1.RandomPolicyData{}, f.defaultInformer) -} - -func (f *randomPolicyDataInformer) Lister() v1.RandomPolicyDataLister { - return v1.NewRandomPolicyDataLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/vmpolicy.go b/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/vmpolicy.go deleted file mode 100644 index 40c8d3955..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1/vmpolicy.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - policypkgtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// VMpolicyInformer provides access to a shared informer and lister for -// VMpolicies. -type VMpolicyInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.VMpolicyLister -} - -type vMpolicyInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewVMpolicyInformer constructs a new informer for VMpolicy type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewVMpolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredVMpolicyInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredVMpolicyInformer constructs a new informer for VMpolicy type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredVMpolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.PolicypkgTsmV1().VMpolicies().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.PolicypkgTsmV1().VMpolicies().Watch(context.TODO(), options) - }, - }, - &policypkgtsmtanzuvmwarecomv1.VMpolicy{}, - resyncPeriod, - indexers, - ) -} - -func (f *vMpolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredVMpolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *vMpolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&policypkgtsmtanzuvmwarecomv1.VMpolicy{}, f.defaultInformer) -} - -func (f *vMpolicyInformer) Lister() v1.VMpolicyLister { - return v1.NewVMpolicyLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/root.tsm.tanzu.vmware.com/interface.go b/compiler/example/output/generated/client/informers/externalversions/root.tsm.tanzu.vmware.com/interface.go deleted file mode 100644 index 68a15c378..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/root.tsm.tanzu.vmware.com/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package root - -import ( - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/root.tsm.tanzu.vmware.com/v1" -) - -// Interface provides access to each of this group's versions. -type Interface interface { - // V1 provides access to shared informers for resources in V1. - V1() v1.Interface -} - -type group struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// V1 returns a new v1.Interface. -func (g *group) V1() v1.Interface { - return v1.New(g.factory, g.namespace, g.tweakListOptions) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/root.tsm.tanzu.vmware.com/v1/interface.go b/compiler/example/output/generated/client/informers/externalversions/root.tsm.tanzu.vmware.com/v1/interface.go deleted file mode 100644 index 74f50949a..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/root.tsm.tanzu.vmware.com/v1/interface.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // Roots returns a RootInformer. - Roots() RootInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// Roots returns a RootInformer. -func (v *version) Roots() RootInformer { - return &rootInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} diff --git a/compiler/example/output/generated/client/informers/externalversions/root.tsm.tanzu.vmware.com/v1/root.go b/compiler/example/output/generated/client/informers/externalversions/root.tsm.tanzu.vmware.com/v1/root.go deleted file mode 100644 index c9ddd5664..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/root.tsm.tanzu.vmware.com/v1/root.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - roottsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/root.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// RootInformer provides access to a shared informer and lister for -// Roots. -type RootInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.RootLister -} - -type rootInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewRootInformer constructs a new informer for Root type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewRootInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredRootInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredRootInformer constructs a new informer for Root type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredRootInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.RootTsmV1().Roots().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.RootTsmV1().Roots().Watch(context.TODO(), options) - }, - }, - &roottsmtanzuvmwarecomv1.Root{}, - resyncPeriod, - indexers, - ) -} - -func (f *rootInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredRootInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *rootInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&roottsmtanzuvmwarecomv1.Root{}, f.defaultInformer) -} - -func (f *rootInformer) Lister() v1.RootLister { - return v1.NewRootLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/servicegroup.tsm.tanzu.vmware.com/interface.go b/compiler/example/output/generated/client/informers/externalversions/servicegroup.tsm.tanzu.vmware.com/interface.go deleted file mode 100644 index ea99b1beb..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/servicegroup.tsm.tanzu.vmware.com/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package servicegroup - -import ( - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/servicegroup.tsm.tanzu.vmware.com/v1" -) - -// Interface provides access to each of this group's versions. -type Interface interface { - // V1 provides access to shared informers for resources in V1. - V1() v1.Interface -} - -type group struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// V1 returns a new v1.Interface. -func (g *group) V1() v1.Interface { - return v1.New(g.factory, g.namespace, g.tweakListOptions) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/servicegroup.tsm.tanzu.vmware.com/v1/interface.go b/compiler/example/output/generated/client/informers/externalversions/servicegroup.tsm.tanzu.vmware.com/v1/interface.go deleted file mode 100644 index dc185d322..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/servicegroup.tsm.tanzu.vmware.com/v1/interface.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // SvcGroups returns a SvcGroupInformer. - SvcGroups() SvcGroupInformer - // SvcGroupLinkInfos returns a SvcGroupLinkInfoInformer. - SvcGroupLinkInfos() SvcGroupLinkInfoInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// SvcGroups returns a SvcGroupInformer. -func (v *version) SvcGroups() SvcGroupInformer { - return &svcGroupInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// SvcGroupLinkInfos returns a SvcGroupLinkInfoInformer. -func (v *version) SvcGroupLinkInfos() SvcGroupLinkInfoInformer { - return &svcGroupLinkInfoInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} diff --git a/compiler/example/output/generated/client/informers/externalversions/servicegroup.tsm.tanzu.vmware.com/v1/svcgroup.go b/compiler/example/output/generated/client/informers/externalversions/servicegroup.tsm.tanzu.vmware.com/v1/svcgroup.go deleted file mode 100644 index 1eb653fad..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/servicegroup.tsm.tanzu.vmware.com/v1/svcgroup.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - servicegrouptsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/servicegroup.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// SvcGroupInformer provides access to a shared informer and lister for -// SvcGroups. -type SvcGroupInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.SvcGroupLister -} - -type svcGroupInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewSvcGroupInformer constructs a new informer for SvcGroup type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewSvcGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredSvcGroupInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredSvcGroupInformer constructs a new informer for SvcGroup type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredSvcGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ServicegroupTsmV1().SvcGroups().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ServicegroupTsmV1().SvcGroups().Watch(context.TODO(), options) - }, - }, - &servicegrouptsmtanzuvmwarecomv1.SvcGroup{}, - resyncPeriod, - indexers, - ) -} - -func (f *svcGroupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredSvcGroupInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *svcGroupInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&servicegrouptsmtanzuvmwarecomv1.SvcGroup{}, f.defaultInformer) -} - -func (f *svcGroupInformer) Lister() v1.SvcGroupLister { - return v1.NewSvcGroupLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/informers/externalversions/servicegroup.tsm.tanzu.vmware.com/v1/svcgrouplinkinfo.go b/compiler/example/output/generated/client/informers/externalversions/servicegroup.tsm.tanzu.vmware.com/v1/svcgrouplinkinfo.go deleted file mode 100644 index 181f19caa..000000000 --- a/compiler/example/output/generated/client/informers/externalversions/servicegroup.tsm.tanzu.vmware.com/v1/svcgrouplinkinfo.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - servicegrouptsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1" - versioned "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - internalinterfaces "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/internalinterfaces" - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/listers/servicegroup.tsm.tanzu.vmware.com/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// SvcGroupLinkInfoInformer provides access to a shared informer and lister for -// SvcGroupLinkInfos. -type SvcGroupLinkInfoInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.SvcGroupLinkInfoLister -} - -type svcGroupLinkInfoInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewSvcGroupLinkInfoInformer constructs a new informer for SvcGroupLinkInfo type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewSvcGroupLinkInfoInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredSvcGroupLinkInfoInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredSvcGroupLinkInfoInformer constructs a new informer for SvcGroupLinkInfo type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredSvcGroupLinkInfoInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ServicegroupTsmV1().SvcGroupLinkInfos().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ServicegroupTsmV1().SvcGroupLinkInfos().Watch(context.TODO(), options) - }, - }, - &servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo{}, - resyncPeriod, - indexers, - ) -} - -func (f *svcGroupLinkInfoInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredSvcGroupLinkInfoInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *svcGroupLinkInfoInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&servicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo{}, f.defaultInformer) -} - -func (f *svcGroupLinkInfoInformer) Lister() v1.SvcGroupLinkInfoLister { - return v1.NewSvcGroupLinkInfoLister(f.Informer().GetIndexer()) -} diff --git a/compiler/example/output/generated/client/listers/config.tsm.tanzu.vmware.com/v1/config.go b/compiler/example/output/generated/client/listers/config.tsm.tanzu.vmware.com/v1/config.go deleted file mode 100644 index c0f68ea00..000000000 --- a/compiler/example/output/generated/client/listers/config.tsm.tanzu.vmware.com/v1/config.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// ConfigLister helps list Configs. -// All objects returned here must be treated as read-only. -type ConfigLister interface { - // List lists all Configs in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Config, err error) - // Get retrieves the Config from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.Config, error) - ConfigListerExpansion -} - -// configLister implements the ConfigLister interface. -type configLister struct { - indexer cache.Indexer -} - -// NewConfigLister returns a new ConfigLister. -func NewConfigLister(indexer cache.Indexer) ConfigLister { - return &configLister{indexer: indexer} -} - -// List lists all Configs in the indexer. -func (s *configLister) List(selector labels.Selector) (ret []*v1.Config, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Config)) - }) - return ret, err -} - -// Get retrieves the Config from the index for a given name. -func (s *configLister) Get(name string) (*v1.Config, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("config"), name) - } - return obj.(*v1.Config), nil -} diff --git a/compiler/example/output/generated/client/listers/config.tsm.tanzu.vmware.com/v1/domain.go b/compiler/example/output/generated/client/listers/config.tsm.tanzu.vmware.com/v1/domain.go deleted file mode 100644 index 015a97521..000000000 --- a/compiler/example/output/generated/client/listers/config.tsm.tanzu.vmware.com/v1/domain.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// DomainLister helps list Domains. -// All objects returned here must be treated as read-only. -type DomainLister interface { - // List lists all Domains in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Domain, err error) - // Get retrieves the Domain from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.Domain, error) - DomainListerExpansion -} - -// domainLister implements the DomainLister interface. -type domainLister struct { - indexer cache.Indexer -} - -// NewDomainLister returns a new DomainLister. -func NewDomainLister(indexer cache.Indexer) DomainLister { - return &domainLister{indexer: indexer} -} - -// List lists all Domains in the indexer. -func (s *domainLister) List(selector labels.Selector) (ret []*v1.Domain, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Domain)) - }) - return ret, err -} - -// Get retrieves the Domain from the index for a given name. -func (s *domainLister) Get(name string) (*v1.Domain, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("domain"), name) - } - return obj.(*v1.Domain), nil -} diff --git a/compiler/example/output/generated/client/listers/config.tsm.tanzu.vmware.com/v1/expansion_generated.go b/compiler/example/output/generated/client/listers/config.tsm.tanzu.vmware.com/v1/expansion_generated.go deleted file mode 100644 index f20a1e17e..000000000 --- a/compiler/example/output/generated/client/listers/config.tsm.tanzu.vmware.com/v1/expansion_generated.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -// ConfigListerExpansion allows custom methods to be added to -// ConfigLister. -type ConfigListerExpansion interface{} - -// DomainListerExpansion allows custom methods to be added to -// DomainLister. -type DomainListerExpansion interface{} - -// FooTypeABCListerExpansion allows custom methods to be added to -// FooTypeABCLister. -type FooTypeABCListerExpansion interface{} diff --git a/compiler/example/output/generated/client/listers/config.tsm.tanzu.vmware.com/v1/footypeabc.go b/compiler/example/output/generated/client/listers/config.tsm.tanzu.vmware.com/v1/footypeabc.go deleted file mode 100644 index 79c43016d..000000000 --- a/compiler/example/output/generated/client/listers/config.tsm.tanzu.vmware.com/v1/footypeabc.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// FooTypeABCLister helps list FooTypeABCs. -// All objects returned here must be treated as read-only. -type FooTypeABCLister interface { - // List lists all FooTypeABCs in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.FooTypeABC, err error) - // Get retrieves the FooTypeABC from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.FooTypeABC, error) - FooTypeABCListerExpansion -} - -// fooTypeABCLister implements the FooTypeABCLister interface. -type fooTypeABCLister struct { - indexer cache.Indexer -} - -// NewFooTypeABCLister returns a new FooTypeABCLister. -func NewFooTypeABCLister(indexer cache.Indexer) FooTypeABCLister { - return &fooTypeABCLister{indexer: indexer} -} - -// List lists all FooTypeABCs in the indexer. -func (s *fooTypeABCLister) List(selector labels.Selector) (ret []*v1.FooTypeABC, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.FooTypeABC)) - }) - return ret, err -} - -// Get retrieves the FooTypeABC from the index for a given name. -func (s *fooTypeABCLister) Get(name string) (*v1.FooTypeABC, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("footypeabc"), name) - } - return obj.(*v1.FooTypeABC), nil -} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go new file mode 100644 index 000000000..542e8de89 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AccessControlPolicyLister helps list AccessControlPolicies. +// All objects returned here must be treated as read-only. +type AccessControlPolicyLister interface { + // List lists all AccessControlPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AccessControlPolicy, err error) + // Get retrieves the AccessControlPolicy from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AccessControlPolicy, error) + AccessControlPolicyListerExpansion +} + +// accessControlPolicyLister implements the AccessControlPolicyLister interface. +type accessControlPolicyLister struct { + indexer cache.Indexer +} + +// NewAccessControlPolicyLister returns a new AccessControlPolicyLister. +func NewAccessControlPolicyLister(indexer cache.Indexer) AccessControlPolicyLister { + return &accessControlPolicyLister{indexer: indexer} +} + +// List lists all AccessControlPolicies in the indexer. +func (s *accessControlPolicyLister) List(selector labels.Selector) (ret []*v1.AccessControlPolicy, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AccessControlPolicy)) + }) + return ret, err +} + +// Get retrieves the AccessControlPolicy from the index for a given name. +func (s *accessControlPolicyLister) Get(name string) (*v1.AccessControlPolicy, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("accesscontrolpolicy"), name) + } + return obj.(*v1.AccessControlPolicy), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/accesstoken.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/accesstoken.go new file mode 100644 index 000000000..55aa9e6eb --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/accesstoken.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AccessTokenLister helps list AccessTokens. +// All objects returned here must be treated as read-only. +type AccessTokenLister interface { + // List lists all AccessTokens in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AccessToken, err error) + // Get retrieves the AccessToken from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AccessToken, error) + AccessTokenListerExpansion +} + +// accessTokenLister implements the AccessTokenLister interface. +type accessTokenLister struct { + indexer cache.Indexer +} + +// NewAccessTokenLister returns a new AccessTokenLister. +func NewAccessTokenLister(indexer cache.Indexer) AccessTokenLister { + return &accessTokenLister{indexer: indexer} +} + +// List lists all AccessTokens in the indexer. +func (s *accessTokenLister) List(selector labels.Selector) (ret []*v1.AccessToken, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AccessToken)) + }) + return ret, err +} + +// Get retrieves the AccessToken from the index for a given name. +func (s *accessTokenLister) Get(name string) (*v1.AccessToken, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("accesstoken"), name) + } + return obj.(*v1.AccessToken), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/acpconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/acpconfig.go new file mode 100644 index 000000000..eca1c4bc7 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/acpconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ACPConfigLister helps list ACPConfigs. +// All objects returned here must be treated as read-only. +type ACPConfigLister interface { + // List lists all ACPConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ACPConfig, err error) + // Get retrieves the ACPConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ACPConfig, error) + ACPConfigListerExpansion +} + +// aCPConfigLister implements the ACPConfigLister interface. +type aCPConfigLister struct { + indexer cache.Indexer +} + +// NewACPConfigLister returns a new ACPConfigLister. +func NewACPConfigLister(indexer cache.Indexer) ACPConfigLister { + return &aCPConfigLister{indexer: indexer} +} + +// List lists all ACPConfigs in the indexer. +func (s *aCPConfigLister) List(selector labels.Selector) (ret []*v1.ACPConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ACPConfig)) + }) + return ret, err +} + +// Get retrieves the ACPConfig from the index for a given name. +func (s *aCPConfigLister) Get(name string) (*v1.ACPConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("acpconfig"), name) + } + return obj.(*v1.ACPConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/additionalattributes.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/additionalattributes.go new file mode 100644 index 000000000..7f7e1e89a --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/additionalattributes.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AdditionalAttributesLister helps list AdditionalAttributeses. +// All objects returned here must be treated as read-only. +type AdditionalAttributesLister interface { + // List lists all AdditionalAttributeses in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AdditionalAttributes, err error) + // Get retrieves the AdditionalAttributes from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AdditionalAttributes, error) + AdditionalAttributesListerExpansion +} + +// additionalAttributesLister implements the AdditionalAttributesLister interface. +type additionalAttributesLister struct { + indexer cache.Indexer +} + +// NewAdditionalAttributesLister returns a new AdditionalAttributesLister. +func NewAdditionalAttributesLister(indexer cache.Indexer) AdditionalAttributesLister { + return &additionalAttributesLister{indexer: indexer} +} + +// List lists all AdditionalAttributeses in the indexer. +func (s *additionalAttributesLister) List(selector labels.Selector) (ret []*v1.AdditionalAttributes, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AdditionalAttributes)) + }) + return ret, err +} + +// Get retrieves the AdditionalAttributes from the index for a given name. +func (s *additionalAttributesLister) Get(name string) (*v1.AdditionalAttributes, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("additionalattributes"), name) + } + return obj.(*v1.AdditionalAttributes), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/allsparkservices.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/allsparkservices.go new file mode 100644 index 000000000..163e84bcd --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/allsparkservices.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AllSparkServicesLister helps list AllSparkServiceses. +// All objects returned here must be treated as read-only. +type AllSparkServicesLister interface { + // List lists all AllSparkServiceses in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AllSparkServices, err error) + // Get retrieves the AllSparkServices from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AllSparkServices, error) + AllSparkServicesListerExpansion +} + +// allSparkServicesLister implements the AllSparkServicesLister interface. +type allSparkServicesLister struct { + indexer cache.Indexer +} + +// NewAllSparkServicesLister returns a new AllSparkServicesLister. +func NewAllSparkServicesLister(indexer cache.Indexer) AllSparkServicesLister { + return &allSparkServicesLister{indexer: indexer} +} + +// List lists all AllSparkServiceses in the indexer. +func (s *allSparkServicesLister) List(selector labels.Selector) (ret []*v1.AllSparkServices, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AllSparkServices)) + }) + return ret, err +} + +// Get retrieves the AllSparkServices from the index for a given name. +func (s *allSparkServicesLister) Get(name string) (*v1.AllSparkServices, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("allsparkservices"), name) + } + return obj.(*v1.AllSparkServices), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/annotation.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/annotation.go new file mode 100644 index 000000000..f69229af2 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/annotation.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AnnotationLister helps list Annotations. +// All objects returned here must be treated as read-only. +type AnnotationLister interface { + // List lists all Annotations in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Annotation, err error) + // Get retrieves the Annotation from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Annotation, error) + AnnotationListerExpansion +} + +// annotationLister implements the AnnotationLister interface. +type annotationLister struct { + indexer cache.Indexer +} + +// NewAnnotationLister returns a new AnnotationLister. +func NewAnnotationLister(indexer cache.Indexer) AnnotationLister { + return &annotationLister{indexer: indexer} +} + +// List lists all Annotations in the indexer. +func (s *annotationLister) List(selector labels.Selector) (ret []*v1.Annotation, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Annotation)) + }) + return ret, err +} + +// Get retrieves the Annotation from the index for a given name. +func (s *annotationLister) Get(name string) (*v1.Annotation, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("annotation"), name) + } + return obj.(*v1.Annotation), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/apidiscovery.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/apidiscovery.go new file mode 100644 index 000000000..67bf36fe5 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/apidiscovery.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ApiDiscoveryLister helps list ApiDiscoveries. +// All objects returned here must be treated as read-only. +type ApiDiscoveryLister interface { + // List lists all ApiDiscoveries in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ApiDiscovery, err error) + // Get retrieves the ApiDiscovery from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ApiDiscovery, error) + ApiDiscoveryListerExpansion +} + +// apiDiscoveryLister implements the ApiDiscoveryLister interface. +type apiDiscoveryLister struct { + indexer cache.Indexer +} + +// NewApiDiscoveryLister returns a new ApiDiscoveryLister. +func NewApiDiscoveryLister(indexer cache.Indexer) ApiDiscoveryLister { + return &apiDiscoveryLister{indexer: indexer} +} + +// List lists all ApiDiscoveries in the indexer. +func (s *apiDiscoveryLister) List(selector labels.Selector) (ret []*v1.ApiDiscovery, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ApiDiscovery)) + }) + return ret, err +} + +// Get retrieves the ApiDiscovery from the index for a given name. +func (s *apiDiscoveryLister) Get(name string) (*v1.ApiDiscovery, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("apidiscovery"), name) + } + return obj.(*v1.ApiDiscovery), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/apidiscoveryrt.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/apidiscoveryrt.go new file mode 100644 index 000000000..02363f641 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/apidiscoveryrt.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ApiDiscoveryRTLister helps list ApiDiscoveryRTs. +// All objects returned here must be treated as read-only. +type ApiDiscoveryRTLister interface { + // List lists all ApiDiscoveryRTs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ApiDiscoveryRT, err error) + // Get retrieves the ApiDiscoveryRT from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ApiDiscoveryRT, error) + ApiDiscoveryRTListerExpansion +} + +// apiDiscoveryRTLister implements the ApiDiscoveryRTLister interface. +type apiDiscoveryRTLister struct { + indexer cache.Indexer +} + +// NewApiDiscoveryRTLister returns a new ApiDiscoveryRTLister. +func NewApiDiscoveryRTLister(indexer cache.Indexer) ApiDiscoveryRTLister { + return &apiDiscoveryRTLister{indexer: indexer} +} + +// List lists all ApiDiscoveryRTs in the indexer. +func (s *apiDiscoveryRTLister) List(selector labels.Selector) (ret []*v1.ApiDiscoveryRT, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ApiDiscoveryRT)) + }) + return ret, err +} + +// Get retrieves the ApiDiscoveryRT from the index for a given name. +func (s *apiDiscoveryRTLister) Get(name string) (*v1.ApiDiscoveryRT, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("apidiscoveryrt"), name) + } + return obj.(*v1.ApiDiscoveryRT), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/app.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/app.go new file mode 100644 index 000000000..e3b34be7d --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/app.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AppLister helps list Apps. +// All objects returned here must be treated as read-only. +type AppLister interface { + // List lists all Apps in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.App, err error) + // Get retrieves the App from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.App, error) + AppListerExpansion +} + +// appLister implements the AppLister interface. +type appLister struct { + indexer cache.Indexer +} + +// NewAppLister returns a new AppLister. +func NewAppLister(indexer cache.Indexer) AppLister { + return &appLister{indexer: indexer} +} + +// List lists all Apps in the indexer. +func (s *appLister) List(selector labels.Selector) (ret []*v1.App, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.App)) + }) + return ret, err +} + +// Get retrieves the App from the index for a given name. +func (s *appLister) Get(name string) (*v1.App, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("app"), name) + } + return obj.(*v1.App), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/appfolder.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/appfolder.go new file mode 100644 index 000000000..55a921da7 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/appfolder.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AppFolderLister helps list AppFolders. +// All objects returned here must be treated as read-only. +type AppFolderLister interface { + // List lists all AppFolders in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AppFolder, err error) + // Get retrieves the AppFolder from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AppFolder, error) + AppFolderListerExpansion +} + +// appFolderLister implements the AppFolderLister interface. +type appFolderLister struct { + indexer cache.Indexer +} + +// NewAppFolderLister returns a new AppFolderLister. +func NewAppFolderLister(indexer cache.Indexer) AppFolderLister { + return &appFolderLister{indexer: indexer} +} + +// List lists all AppFolders in the indexer. +func (s *appFolderLister) List(selector labels.Selector) (ret []*v1.AppFolder, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AppFolder)) + }) + return ret, err +} + +// Get retrieves the AppFolder from the index for a given name. +func (s *appFolderLister) Get(name string) (*v1.AppFolder, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("appfolder"), name) + } + return obj.(*v1.AppFolder), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/appgroup.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/appgroup.go new file mode 100644 index 000000000..0c4794f3d --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/appgroup.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AppGroupLister helps list AppGroups. +// All objects returned here must be treated as read-only. +type AppGroupLister interface { + // List lists all AppGroups in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AppGroup, err error) + // Get retrieves the AppGroup from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AppGroup, error) + AppGroupListerExpansion +} + +// appGroupLister implements the AppGroupLister interface. +type appGroupLister struct { + indexer cache.Indexer +} + +// NewAppGroupLister returns a new AppGroupLister. +func NewAppGroupLister(indexer cache.Indexer) AppGroupLister { + return &appGroupLister{indexer: indexer} +} + +// List lists all AppGroups in the indexer. +func (s *appGroupLister) List(selector labels.Selector) (ret []*v1.AppGroup, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AppGroup)) + }) + return ret, err +} + +// Get retrieves the AppGroup from the index for a given name. +func (s *appGroupLister) Get(name string) (*v1.AppGroup, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("appgroup"), name) + } + return obj.(*v1.AppGroup), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/applicationinfo.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/applicationinfo.go new file mode 100644 index 000000000..997975287 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/applicationinfo.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ApplicationInfoLister helps list ApplicationInfos. +// All objects returned here must be treated as read-only. +type ApplicationInfoLister interface { + // List lists all ApplicationInfos in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ApplicationInfo, err error) + // Get retrieves the ApplicationInfo from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ApplicationInfo, error) + ApplicationInfoListerExpansion +} + +// applicationInfoLister implements the ApplicationInfoLister interface. +type applicationInfoLister struct { + indexer cache.Indexer +} + +// NewApplicationInfoLister returns a new ApplicationInfoLister. +func NewApplicationInfoLister(indexer cache.Indexer) ApplicationInfoLister { + return &applicationInfoLister{indexer: indexer} +} + +// List lists all ApplicationInfos in the indexer. +func (s *applicationInfoLister) List(selector labels.Selector) (ret []*v1.ApplicationInfo, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ApplicationInfo)) + }) + return ret, err +} + +// Get retrieves the ApplicationInfo from the index for a given name. +func (s *applicationInfoLister) Get(name string) (*v1.ApplicationInfo, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("applicationinfo"), name) + } + return obj.(*v1.ApplicationInfo), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/apptemplate.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/apptemplate.go new file mode 100644 index 000000000..0f5af341d --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/apptemplate.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AppTemplateLister helps list AppTemplates. +// All objects returned here must be treated as read-only. +type AppTemplateLister interface { + // List lists all AppTemplates in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AppTemplate, err error) + // Get retrieves the AppTemplate from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AppTemplate, error) + AppTemplateListerExpansion +} + +// appTemplateLister implements the AppTemplateLister interface. +type appTemplateLister struct { + indexer cache.Indexer +} + +// NewAppTemplateLister returns a new AppTemplateLister. +func NewAppTemplateLister(indexer cache.Indexer) AppTemplateLister { + return &appTemplateLister{indexer: indexer} +} + +// List lists all AppTemplates in the indexer. +func (s *appTemplateLister) List(selector labels.Selector) (ret []*v1.AppTemplate, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AppTemplate)) + }) + return ret, err +} + +// Get retrieves the AppTemplate from the index for a given name. +func (s *appTemplateLister) Get(name string) (*v1.AppTemplate, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("apptemplate"), name) + } + return obj.(*v1.AppTemplate), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/apptemplateservicedefinition.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/apptemplateservicedefinition.go new file mode 100644 index 000000000..c618505ac --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/apptemplateservicedefinition.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AppTemplateServiceDefinitionLister helps list AppTemplateServiceDefinitions. +// All objects returned here must be treated as read-only. +type AppTemplateServiceDefinitionLister interface { + // List lists all AppTemplateServiceDefinitions in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AppTemplateServiceDefinition, err error) + // Get retrieves the AppTemplateServiceDefinition from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AppTemplateServiceDefinition, error) + AppTemplateServiceDefinitionListerExpansion +} + +// appTemplateServiceDefinitionLister implements the AppTemplateServiceDefinitionLister interface. +type appTemplateServiceDefinitionLister struct { + indexer cache.Indexer +} + +// NewAppTemplateServiceDefinitionLister returns a new AppTemplateServiceDefinitionLister. +func NewAppTemplateServiceDefinitionLister(indexer cache.Indexer) AppTemplateServiceDefinitionLister { + return &appTemplateServiceDefinitionLister{indexer: indexer} +} + +// List lists all AppTemplateServiceDefinitions in the indexer. +func (s *appTemplateServiceDefinitionLister) List(selector labels.Selector) (ret []*v1.AppTemplateServiceDefinition, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AppTemplateServiceDefinition)) + }) + return ret, err +} + +// Get retrieves the AppTemplateServiceDefinition from the index for a given name. +func (s *appTemplateServiceDefinitionLister) Get(name string) (*v1.AppTemplateServiceDefinition, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("apptemplateservicedefinition"), name) + } + return obj.(*v1.AppTemplateServiceDefinition), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/appuser.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/appuser.go new file mode 100644 index 000000000..5aebd6c8d --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/appuser.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AppUserLister helps list AppUsers. +// All objects returned here must be treated as read-only. +type AppUserLister interface { + // List lists all AppUsers in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AppUser, err error) + // Get retrieves the AppUser from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AppUser, error) + AppUserListerExpansion +} + +// appUserLister implements the AppUserLister interface. +type appUserLister struct { + indexer cache.Indexer +} + +// NewAppUserLister returns a new AppUserLister. +func NewAppUserLister(indexer cache.Indexer) AppUserLister { + return &appUserLister{indexer: indexer} +} + +// List lists all AppUsers in the indexer. +func (s *appUserLister) List(selector labels.Selector) (ret []*v1.AppUser, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AppUser)) + }) + return ret, err +} + +// Get retrieves the AppUser from the index for a given name. +func (s *appUserLister) Get(name string) (*v1.AppUser, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("appuser"), name) + } + return obj.(*v1.AppUser), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/appversion.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/appversion.go new file mode 100644 index 000000000..29fbbb733 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/appversion.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AppVersionLister helps list AppVersions. +// All objects returned here must be treated as read-only. +type AppVersionLister interface { + // List lists all AppVersions in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AppVersion, err error) + // Get retrieves the AppVersion from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AppVersion, error) + AppVersionListerExpansion +} + +// appVersionLister implements the AppVersionLister interface. +type appVersionLister struct { + indexer cache.Indexer +} + +// NewAppVersionLister returns a new AppVersionLister. +func NewAppVersionLister(indexer cache.Indexer) AppVersionLister { + return &appVersionLister{indexer: indexer} +} + +// List lists all AppVersions in the indexer. +func (s *appVersionLister) List(selector labels.Selector) (ret []*v1.AppVersion, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AppVersion)) + }) + return ret, err +} + +// Get retrieves the AppVersion from the index for a given name. +func (s *appVersionLister) Get(name string) (*v1.AppVersion, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("appversion"), name) + } + return obj.(*v1.AppVersion), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/attackdiscovery.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/attackdiscovery.go new file mode 100644 index 000000000..11358476a --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/attackdiscovery.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AttackDiscoveryLister helps list AttackDiscoveries. +// All objects returned here must be treated as read-only. +type AttackDiscoveryLister interface { + // List lists all AttackDiscoveries in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AttackDiscovery, err error) + // Get retrieves the AttackDiscovery from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AttackDiscovery, error) + AttackDiscoveryListerExpansion +} + +// attackDiscoveryLister implements the AttackDiscoveryLister interface. +type attackDiscoveryLister struct { + indexer cache.Indexer +} + +// NewAttackDiscoveryLister returns a new AttackDiscoveryLister. +func NewAttackDiscoveryLister(indexer cache.Indexer) AttackDiscoveryLister { + return &attackDiscoveryLister{indexer: indexer} +} + +// List lists all AttackDiscoveries in the indexer. +func (s *attackDiscoveryLister) List(selector labels.Selector) (ret []*v1.AttackDiscovery, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AttackDiscovery)) + }) + return ret, err +} + +// Get retrieves the AttackDiscovery from the index for a given name. +func (s *attackDiscoveryLister) Get(name string) (*v1.AttackDiscovery, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("attackdiscovery"), name) + } + return obj.(*v1.AttackDiscovery), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/attackdiscoveryrt.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/attackdiscoveryrt.go new file mode 100644 index 000000000..fb53290b1 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/attackdiscoveryrt.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AttackDiscoveryRTLister helps list AttackDiscoveryRTs. +// All objects returned here must be treated as read-only. +type AttackDiscoveryRTLister interface { + // List lists all AttackDiscoveryRTs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AttackDiscoveryRT, err error) + // Get retrieves the AttackDiscoveryRT from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AttackDiscoveryRT, error) + AttackDiscoveryRTListerExpansion +} + +// attackDiscoveryRTLister implements the AttackDiscoveryRTLister interface. +type attackDiscoveryRTLister struct { + indexer cache.Indexer +} + +// NewAttackDiscoveryRTLister returns a new AttackDiscoveryRTLister. +func NewAttackDiscoveryRTLister(indexer cache.Indexer) AttackDiscoveryRTLister { + return &attackDiscoveryRTLister{indexer: indexer} +} + +// List lists all AttackDiscoveryRTs in the indexer. +func (s *attackDiscoveryRTLister) List(selector labels.Selector) (ret []*v1.AttackDiscoveryRT, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AttackDiscoveryRT)) + }) + return ret, err +} + +// Get retrieves the AttackDiscoveryRT from the index for a given name. +func (s *attackDiscoveryRTLister) Get(name string) (*v1.AttackDiscoveryRT, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("attackdiscoveryrt"), name) + } + return obj.(*v1.AttackDiscoveryRT), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/authenticationpolicy.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/authenticationpolicy.go new file mode 100644 index 000000000..63232454b --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/authenticationpolicy.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AuthenticationPolicyLister helps list AuthenticationPolicies. +// All objects returned here must be treated as read-only. +type AuthenticationPolicyLister interface { + // List lists all AuthenticationPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AuthenticationPolicy, err error) + // Get retrieves the AuthenticationPolicy from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AuthenticationPolicy, error) + AuthenticationPolicyListerExpansion +} + +// authenticationPolicyLister implements the AuthenticationPolicyLister interface. +type authenticationPolicyLister struct { + indexer cache.Indexer +} + +// NewAuthenticationPolicyLister returns a new AuthenticationPolicyLister. +func NewAuthenticationPolicyLister(indexer cache.Indexer) AuthenticationPolicyLister { + return &authenticationPolicyLister{indexer: indexer} +} + +// List lists all AuthenticationPolicies in the indexer. +func (s *authenticationPolicyLister) List(selector labels.Selector) (ret []*v1.AuthenticationPolicy, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AuthenticationPolicy)) + }) + return ret, err +} + +// Get retrieves the AuthenticationPolicy from the index for a given name. +func (s *authenticationPolicyLister) Get(name string) (*v1.AuthenticationPolicy, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("authenticationpolicy"), name) + } + return obj.(*v1.AuthenticationPolicy), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/autoscaler.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/autoscaler.go new file mode 100644 index 000000000..d1958f0b7 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/autoscaler.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AutoscalerLister helps list Autoscalers. +// All objects returned here must be treated as read-only. +type AutoscalerLister interface { + // List lists all Autoscalers in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Autoscaler, err error) + // Get retrieves the Autoscaler from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Autoscaler, error) + AutoscalerListerExpansion +} + +// autoscalerLister implements the AutoscalerLister interface. +type autoscalerLister struct { + indexer cache.Indexer +} + +// NewAutoscalerLister returns a new AutoscalerLister. +func NewAutoscalerLister(indexer cache.Indexer) AutoscalerLister { + return &autoscalerLister{indexer: indexer} +} + +// List lists all Autoscalers in the indexer. +func (s *autoscalerLister) List(selector labels.Selector) (ret []*v1.Autoscaler, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Autoscaler)) + }) + return ret, err +} + +// Get retrieves the Autoscaler from the index for a given name. +func (s *autoscalerLister) Get(name string) (*v1.Autoscaler, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("autoscaler"), name) + } + return obj.(*v1.Autoscaler), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/autoscalerconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/autoscalerconfig.go new file mode 100644 index 000000000..0bb4b9524 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/autoscalerconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AutoscalerConfigLister helps list AutoscalerConfigs. +// All objects returned here must be treated as read-only. +type AutoscalerConfigLister interface { + // List lists all AutoscalerConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AutoscalerConfig, err error) + // Get retrieves the AutoscalerConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AutoscalerConfig, error) + AutoscalerConfigListerExpansion +} + +// autoscalerConfigLister implements the AutoscalerConfigLister interface. +type autoscalerConfigLister struct { + indexer cache.Indexer +} + +// NewAutoscalerConfigLister returns a new AutoscalerConfigLister. +func NewAutoscalerConfigLister(indexer cache.Indexer) AutoscalerConfigLister { + return &autoscalerConfigLister{indexer: indexer} +} + +// List lists all AutoscalerConfigs in the indexer. +func (s *autoscalerConfigLister) List(selector labels.Selector) (ret []*v1.AutoscalerConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AutoscalerConfig)) + }) + return ret, err +} + +// Get retrieves the AutoscalerConfig from the index for a given name. +func (s *autoscalerConfigLister) Get(name string) (*v1.AutoscalerConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("autoscalerconfig"), name) + } + return obj.(*v1.AutoscalerConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/autoscalercr.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/autoscalercr.go new file mode 100644 index 000000000..f2c5e2252 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/autoscalercr.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AutoscalerCRLister helps list AutoscalerCRs. +// All objects returned here must be treated as read-only. +type AutoscalerCRLister interface { + // List lists all AutoscalerCRs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AutoscalerCR, err error) + // Get retrieves the AutoscalerCR from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AutoscalerCR, error) + AutoscalerCRListerExpansion +} + +// autoscalerCRLister implements the AutoscalerCRLister interface. +type autoscalerCRLister struct { + indexer cache.Indexer +} + +// NewAutoscalerCRLister returns a new AutoscalerCRLister. +func NewAutoscalerCRLister(indexer cache.Indexer) AutoscalerCRLister { + return &autoscalerCRLister{indexer: indexer} +} + +// List lists all AutoscalerCRs in the indexer. +func (s *autoscalerCRLister) List(selector labels.Selector) (ret []*v1.AutoscalerCR, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AutoscalerCR)) + }) + return ret, err +} + +// Get retrieves the AutoscalerCR from the index for a given name. +func (s *autoscalerCRLister) Get(name string) (*v1.AutoscalerCR, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("autoscalercr"), name) + } + return obj.(*v1.AutoscalerCR), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/autoscalerfolder.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/autoscalerfolder.go new file mode 100644 index 000000000..ff0d7136c --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/autoscalerfolder.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AutoscalerFolderLister helps list AutoscalerFolders. +// All objects returned here must be treated as read-only. +type AutoscalerFolderLister interface { + // List lists all AutoscalerFolders in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AutoscalerFolder, err error) + // Get retrieves the AutoscalerFolder from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AutoscalerFolder, error) + AutoscalerFolderListerExpansion +} + +// autoscalerFolderLister implements the AutoscalerFolderLister interface. +type autoscalerFolderLister struct { + indexer cache.Indexer +} + +// NewAutoscalerFolderLister returns a new AutoscalerFolderLister. +func NewAutoscalerFolderLister(indexer cache.Indexer) AutoscalerFolderLister { + return &autoscalerFolderLister{indexer: indexer} +} + +// List lists all AutoscalerFolders in the indexer. +func (s *autoscalerFolderLister) List(selector labels.Selector) (ret []*v1.AutoscalerFolder, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AutoscalerFolder)) + }) + return ret, err +} + +// Get retrieves the AutoscalerFolder from the index for a given name. +func (s *autoscalerFolderLister) Get(name string) (*v1.AutoscalerFolder, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("autoscalerfolder"), name) + } + return obj.(*v1.AutoscalerFolder), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/autoscalingpolicy.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/autoscalingpolicy.go new file mode 100644 index 000000000..817746192 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/autoscalingpolicy.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AutoscalingPolicyLister helps list AutoscalingPolicies. +// All objects returned here must be treated as read-only. +type AutoscalingPolicyLister interface { + // List lists all AutoscalingPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AutoscalingPolicy, err error) + // Get retrieves the AutoscalingPolicy from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AutoscalingPolicy, error) + AutoscalingPolicyListerExpansion +} + +// autoscalingPolicyLister implements the AutoscalingPolicyLister interface. +type autoscalingPolicyLister struct { + indexer cache.Indexer +} + +// NewAutoscalingPolicyLister returns a new AutoscalingPolicyLister. +func NewAutoscalingPolicyLister(indexer cache.Indexer) AutoscalingPolicyLister { + return &autoscalingPolicyLister{indexer: indexer} +} + +// List lists all AutoscalingPolicies in the indexer. +func (s *autoscalingPolicyLister) List(selector labels.Selector) (ret []*v1.AutoscalingPolicy, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AutoscalingPolicy)) + }) + return ret, err +} + +// Get retrieves the AutoscalingPolicy from the index for a given name. +func (s *autoscalingPolicyLister) Get(name string) (*v1.AutoscalingPolicy, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("autoscalingpolicy"), name) + } + return obj.(*v1.AutoscalingPolicy), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/awsconnector.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/awsconnector.go new file mode 100644 index 000000000..ffcd99c60 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/awsconnector.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AwsConnectorLister helps list AwsConnectors. +// All objects returned here must be treated as read-only. +type AwsConnectorLister interface { + // List lists all AwsConnectors in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.AwsConnector, err error) + // Get retrieves the AwsConnector from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.AwsConnector, error) + AwsConnectorListerExpansion +} + +// awsConnectorLister implements the AwsConnectorLister interface. +type awsConnectorLister struct { + indexer cache.Indexer +} + +// NewAwsConnectorLister returns a new AwsConnectorLister. +func NewAwsConnectorLister(indexer cache.Indexer) AwsConnectorLister { + return &awsConnectorLister{indexer: indexer} +} + +// List lists all AwsConnectors in the indexer. +func (s *awsConnectorLister) List(selector labels.Selector) (ret []*v1.AwsConnector, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.AwsConnector)) + }) + return ret, err +} + +// Get retrieves the AwsConnector from the index for a given name. +func (s *awsConnectorLister) Get(name string) (*v1.AwsConnector, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("awsconnector"), name) + } + return obj.(*v1.AwsConnector), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/bucket.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/bucket.go new file mode 100644 index 000000000..4bba0baeb --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/bucket.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// BucketLister helps list Buckets. +// All objects returned here must be treated as read-only. +type BucketLister interface { + // List lists all Buckets in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Bucket, err error) + // Get retrieves the Bucket from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Bucket, error) + BucketListerExpansion +} + +// bucketLister implements the BucketLister interface. +type bucketLister struct { + indexer cache.Indexer +} + +// NewBucketLister returns a new BucketLister. +func NewBucketLister(indexer cache.Indexer) BucketLister { + return &bucketLister{indexer: indexer} +} + +// List lists all Buckets in the indexer. +func (s *bucketLister) List(selector labels.Selector) (ret []*v1.Bucket, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Bucket)) + }) + return ret, err +} + +// Get retrieves the Bucket from the index for a given name. +func (s *bucketLister) Get(name string) (*v1.Bucket, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("bucket"), name) + } + return obj.(*v1.Bucket), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/certificate.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/certificate.go new file mode 100644 index 000000000..ecda12c6e --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/certificate.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// CertificateLister helps list Certificates. +// All objects returned here must be treated as read-only. +type CertificateLister interface { + // List lists all Certificates in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Certificate, err error) + // Get retrieves the Certificate from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Certificate, error) + CertificateListerExpansion +} + +// certificateLister implements the CertificateLister interface. +type certificateLister struct { + indexer cache.Indexer +} + +// NewCertificateLister returns a new CertificateLister. +func NewCertificateLister(indexer cache.Indexer) CertificateLister { + return &certificateLister{indexer: indexer} +} + +// List lists all Certificates in the indexer. +func (s *certificateLister) List(selector labels.Selector) (ret []*v1.Certificate, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Certificate)) + }) + return ret, err +} + +// Get retrieves the Certificate from the index for a given name. +func (s *certificateLister) Get(name string) (*v1.Certificate, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("certificate"), name) + } + return obj.(*v1.Certificate), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/certificateauthorityconfign.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/certificateauthorityconfign.go new file mode 100644 index 000000000..d1e440392 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/certificateauthorityconfign.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// CertificateAuthorityConfigNLister helps list CertificateAuthorityConfigNs. +// All objects returned here must be treated as read-only. +type CertificateAuthorityConfigNLister interface { + // List lists all CertificateAuthorityConfigNs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.CertificateAuthorityConfigN, err error) + // Get retrieves the CertificateAuthorityConfigN from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.CertificateAuthorityConfigN, error) + CertificateAuthorityConfigNListerExpansion +} + +// certificateAuthorityConfigNLister implements the CertificateAuthorityConfigNLister interface. +type certificateAuthorityConfigNLister struct { + indexer cache.Indexer +} + +// NewCertificateAuthorityConfigNLister returns a new CertificateAuthorityConfigNLister. +func NewCertificateAuthorityConfigNLister(indexer cache.Indexer) CertificateAuthorityConfigNLister { + return &certificateAuthorityConfigNLister{indexer: indexer} +} + +// List lists all CertificateAuthorityConfigNs in the indexer. +func (s *certificateAuthorityConfigNLister) List(selector labels.Selector) (ret []*v1.CertificateAuthorityConfigN, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.CertificateAuthorityConfigN)) + }) + return ret, err +} + +// Get retrieves the CertificateAuthorityConfigN from the index for a given name. +func (s *certificateAuthorityConfigNLister) Get(name string) (*v1.CertificateAuthorityConfigN, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("certificateauthorityconfign"), name) + } + return obj.(*v1.CertificateAuthorityConfigN), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/certificateauthorityrt.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/certificateauthorityrt.go new file mode 100644 index 000000000..50e9f263c --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/certificateauthorityrt.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// CertificateAuthorityRTLister helps list CertificateAuthorityRTs. +// All objects returned here must be treated as read-only. +type CertificateAuthorityRTLister interface { + // List lists all CertificateAuthorityRTs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.CertificateAuthorityRT, err error) + // Get retrieves the CertificateAuthorityRT from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.CertificateAuthorityRT, error) + CertificateAuthorityRTListerExpansion +} + +// certificateAuthorityRTLister implements the CertificateAuthorityRTLister interface. +type certificateAuthorityRTLister struct { + indexer cache.Indexer +} + +// NewCertificateAuthorityRTLister returns a new CertificateAuthorityRTLister. +func NewCertificateAuthorityRTLister(indexer cache.Indexer) CertificateAuthorityRTLister { + return &certificateAuthorityRTLister{indexer: indexer} +} + +// List lists all CertificateAuthorityRTs in the indexer. +func (s *certificateAuthorityRTLister) List(selector labels.Selector) (ret []*v1.CertificateAuthorityRT, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.CertificateAuthorityRT)) + }) + return ret, err +} + +// Get retrieves the CertificateAuthorityRT from the index for a given name. +func (s *certificateAuthorityRTLister) Get(name string) (*v1.CertificateAuthorityRT, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("certificateauthorityrt"), name) + } + return obj.(*v1.CertificateAuthorityRT), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/certificateconfign.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/certificateconfign.go new file mode 100644 index 000000000..c3f83063c --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/certificateconfign.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// CertificateConfigNLister helps list CertificateConfigNs. +// All objects returned here must be treated as read-only. +type CertificateConfigNLister interface { + // List lists all CertificateConfigNs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.CertificateConfigN, err error) + // Get retrieves the CertificateConfigN from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.CertificateConfigN, error) + CertificateConfigNListerExpansion +} + +// certificateConfigNLister implements the CertificateConfigNLister interface. +type certificateConfigNLister struct { + indexer cache.Indexer +} + +// NewCertificateConfigNLister returns a new CertificateConfigNLister. +func NewCertificateConfigNLister(indexer cache.Indexer) CertificateConfigNLister { + return &certificateConfigNLister{indexer: indexer} +} + +// List lists all CertificateConfigNs in the indexer. +func (s *certificateConfigNLister) List(selector labels.Selector) (ret []*v1.CertificateConfigN, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.CertificateConfigN)) + }) + return ret, err +} + +// Get retrieves the CertificateConfigN from the index for a given name. +func (s *certificateConfigNLister) Get(name string) (*v1.CertificateConfigN, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("certificateconfign"), name) + } + return obj.(*v1.CertificateConfigN), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/certificaterequest.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/certificaterequest.go new file mode 100644 index 000000000..89e71cfaa --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/certificaterequest.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// CertificateRequestLister helps list CertificateRequests. +// All objects returned here must be treated as read-only. +type CertificateRequestLister interface { + // List lists all CertificateRequests in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.CertificateRequest, err error) + // Get retrieves the CertificateRequest from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.CertificateRequest, error) + CertificateRequestListerExpansion +} + +// certificateRequestLister implements the CertificateRequestLister interface. +type certificateRequestLister struct { + indexer cache.Indexer +} + +// NewCertificateRequestLister returns a new CertificateRequestLister. +func NewCertificateRequestLister(indexer cache.Indexer) CertificateRequestLister { + return &certificateRequestLister{indexer: indexer} +} + +// List lists all CertificateRequests in the indexer. +func (s *certificateRequestLister) List(selector labels.Selector) (ret []*v1.CertificateRequest, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.CertificateRequest)) + }) + return ret, err +} + +// Get retrieves the CertificateRequest from the index for a given name. +func (s *certificateRequestLister) Get(name string) (*v1.CertificateRequest, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("certificaterequest"), name) + } + return obj.(*v1.CertificateRequest), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/cluster.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/cluster.go new file mode 100644 index 000000000..029af4d9f --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/cluster.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ClusterLister helps list Clusters. +// All objects returned here must be treated as read-only. +type ClusterLister interface { + // List lists all Clusters in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Cluster, err error) + // Get retrieves the Cluster from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Cluster, error) + ClusterListerExpansion +} + +// clusterLister implements the ClusterLister interface. +type clusterLister struct { + indexer cache.Indexer +} + +// NewClusterLister returns a new ClusterLister. +func NewClusterLister(indexer cache.Indexer) ClusterLister { + return &clusterLister{indexer: indexer} +} + +// List lists all Clusters in the indexer. +func (s *clusterLister) List(selector labels.Selector) (ret []*v1.Cluster, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Cluster)) + }) + return ret, err +} + +// Get retrieves the Cluster from the index for a given name. +func (s *clusterLister) Get(name string) (*v1.Cluster, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("cluster"), name) + } + return obj.(*v1.Cluster), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/clusterconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/clusterconfig.go new file mode 100644 index 000000000..d32bee2a3 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/clusterconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ClusterConfigLister helps list ClusterConfigs. +// All objects returned here must be treated as read-only. +type ClusterConfigLister interface { + // List lists all ClusterConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ClusterConfig, err error) + // Get retrieves the ClusterConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ClusterConfig, error) + ClusterConfigListerExpansion +} + +// clusterConfigLister implements the ClusterConfigLister interface. +type clusterConfigLister struct { + indexer cache.Indexer +} + +// NewClusterConfigLister returns a new ClusterConfigLister. +func NewClusterConfigLister(indexer cache.Indexer) ClusterConfigLister { + return &clusterConfigLister{indexer: indexer} +} + +// List lists all ClusterConfigs in the indexer. +func (s *clusterConfigLister) List(selector labels.Selector) (ret []*v1.ClusterConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ClusterConfig)) + }) + return ret, err +} + +// Get retrieves the ClusterConfig from the index for a given name. +func (s *clusterConfigLister) Get(name string) (*v1.ClusterConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("clusterconfig"), name) + } + return obj.(*v1.ClusterConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/clusterconfigfolder.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/clusterconfigfolder.go new file mode 100644 index 000000000..ac255e527 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/clusterconfigfolder.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ClusterConfigFolderLister helps list ClusterConfigFolders. +// All objects returned here must be treated as read-only. +type ClusterConfigFolderLister interface { + // List lists all ClusterConfigFolders in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ClusterConfigFolder, err error) + // Get retrieves the ClusterConfigFolder from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ClusterConfigFolder, error) + ClusterConfigFolderListerExpansion +} + +// clusterConfigFolderLister implements the ClusterConfigFolderLister interface. +type clusterConfigFolderLister struct { + indexer cache.Indexer +} + +// NewClusterConfigFolderLister returns a new ClusterConfigFolderLister. +func NewClusterConfigFolderLister(indexer cache.Indexer) ClusterConfigFolderLister { + return &clusterConfigFolderLister{indexer: indexer} +} + +// List lists all ClusterConfigFolders in the indexer. +func (s *clusterConfigFolderLister) List(selector labels.Selector) (ret []*v1.ClusterConfigFolder, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ClusterConfigFolder)) + }) + return ret, err +} + +// Get retrieves the ClusterConfigFolder from the index for a given name. +func (s *clusterConfigFolderLister) Get(name string) (*v1.ClusterConfigFolder, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("clusterconfigfolder"), name) + } + return obj.(*v1.ClusterConfigFolder), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/clusterfolder.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/clusterfolder.go new file mode 100644 index 000000000..9d606f532 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/clusterfolder.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ClusterFolderLister helps list ClusterFolders. +// All objects returned here must be treated as read-only. +type ClusterFolderLister interface { + // List lists all ClusterFolders in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ClusterFolder, err error) + // Get retrieves the ClusterFolder from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ClusterFolder, error) + ClusterFolderListerExpansion +} + +// clusterFolderLister implements the ClusterFolderLister interface. +type clusterFolderLister struct { + indexer cache.Indexer +} + +// NewClusterFolderLister returns a new ClusterFolderLister. +func NewClusterFolderLister(indexer cache.Indexer) ClusterFolderLister { + return &clusterFolderLister{indexer: indexer} +} + +// List lists all ClusterFolders in the indexer. +func (s *clusterFolderLister) List(selector labels.Selector) (ret []*v1.ClusterFolder, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ClusterFolder)) + }) + return ret, err +} + +// Get retrieves the ClusterFolder from the index for a given name. +func (s *clusterFolderLister) Get(name string) (*v1.ClusterFolder, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("clusterfolder"), name) + } + return obj.(*v1.ClusterFolder), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/clustersettings.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/clustersettings.go new file mode 100644 index 000000000..29d70e4f9 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/clustersettings.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ClusterSettingsLister helps list ClusterSettingses. +// All objects returned here must be treated as read-only. +type ClusterSettingsLister interface { + // List lists all ClusterSettingses in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ClusterSettings, err error) + // Get retrieves the ClusterSettings from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ClusterSettings, error) + ClusterSettingsListerExpansion +} + +// clusterSettingsLister implements the ClusterSettingsLister interface. +type clusterSettingsLister struct { + indexer cache.Indexer +} + +// NewClusterSettingsLister returns a new ClusterSettingsLister. +func NewClusterSettingsLister(indexer cache.Indexer) ClusterSettingsLister { + return &clusterSettingsLister{indexer: indexer} +} + +// List lists all ClusterSettingses in the indexer. +func (s *clusterSettingsLister) List(selector labels.Selector) (ret []*v1.ClusterSettings, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ClusterSettings)) + }) + return ret, err +} + +// Get retrieves the ClusterSettings from the index for a given name. +func (s *clusterSettingsLister) Get(name string) (*v1.ClusterSettings, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("clustersettings"), name) + } + return obj.(*v1.ClusterSettings), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/config.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/config.go new file mode 100644 index 000000000..b23fe8499 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/config.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ConfigLister helps list Configs. +// All objects returned here must be treated as read-only. +type ConfigLister interface { + // List lists all Configs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Config, err error) + // Get retrieves the Config from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Config, error) + ConfigListerExpansion +} + +// configLister implements the ConfigLister interface. +type configLister struct { + indexer cache.Indexer +} + +// NewConfigLister returns a new ConfigLister. +func NewConfigLister(indexer cache.Indexer) ConfigLister { + return &configLister{indexer: indexer} +} + +// List lists all Configs in the indexer. +func (s *configLister) List(selector labels.Selector) (ret []*v1.Config, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Config)) + }) + return ret, err +} + +// Get retrieves the Config from the index for a given name. +func (s *configLister) Get(name string) (*v1.Config, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("config"), name) + } + return obj.(*v1.Config), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/configmap.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/configmap.go new file mode 100644 index 000000000..b841a9447 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/configmap.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ConfigMapLister helps list ConfigMaps. +// All objects returned here must be treated as read-only. +type ConfigMapLister interface { + // List lists all ConfigMaps in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ConfigMap, err error) + // Get retrieves the ConfigMap from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ConfigMap, error) + ConfigMapListerExpansion +} + +// configMapLister implements the ConfigMapLister interface. +type configMapLister struct { + indexer cache.Indexer +} + +// NewConfigMapLister returns a new ConfigMapLister. +func NewConfigMapLister(indexer cache.Indexer) ConfigMapLister { + return &configMapLister{indexer: indexer} +} + +// List lists all ConfigMaps in the indexer. +func (s *configMapLister) List(selector labels.Selector) (ret []*v1.ConfigMap, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ConfigMap)) + }) + return ret, err +} + +// Get retrieves the ConfigMap from the index for a given name. +func (s *configMapLister) Get(name string) (*v1.ConfigMap, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("configmap"), name) + } + return obj.(*v1.ConfigMap), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/connectionstatus.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/connectionstatus.go new file mode 100644 index 000000000..b76fe2c58 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/connectionstatus.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ConnectionStatusLister helps list ConnectionStatuses. +// All objects returned here must be treated as read-only. +type ConnectionStatusLister interface { + // List lists all ConnectionStatuses in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ConnectionStatus, err error) + // Get retrieves the ConnectionStatus from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ConnectionStatus, error) + ConnectionStatusListerExpansion +} + +// connectionStatusLister implements the ConnectionStatusLister interface. +type connectionStatusLister struct { + indexer cache.Indexer +} + +// NewConnectionStatusLister returns a new ConnectionStatusLister. +func NewConnectionStatusLister(indexer cache.Indexer) ConnectionStatusLister { + return &connectionStatusLister{indexer: indexer} +} + +// List lists all ConnectionStatuses in the indexer. +func (s *connectionStatusLister) List(selector labels.Selector) (ret []*v1.ConnectionStatus, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ConnectionStatus)) + }) + return ret, err +} + +// Get retrieves the ConnectionStatus from the index for a given name. +func (s *connectionStatusLister) Get(name string) (*v1.ConnectionStatus, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("connectionstatus"), name) + } + return obj.(*v1.ConnectionStatus), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/database.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/database.go new file mode 100644 index 000000000..494dfe876 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/database.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DatabaseLister helps list Databases. +// All objects returned here must be treated as read-only. +type DatabaseLister interface { + // List lists all Databases in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Database, err error) + // Get retrieves the Database from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Database, error) + DatabaseListerExpansion +} + +// databaseLister implements the DatabaseLister interface. +type databaseLister struct { + indexer cache.Indexer +} + +// NewDatabaseLister returns a new DatabaseLister. +func NewDatabaseLister(indexer cache.Indexer) DatabaseLister { + return &databaseLister{indexer: indexer} +} + +// List lists all Databases in the indexer. +func (s *databaseLister) List(selector labels.Selector) (ret []*v1.Database, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Database)) + }) + return ret, err +} + +// Get retrieves the Database from the index for a given name. +func (s *databaseLister) Get(name string) (*v1.Database, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("database"), name) + } + return obj.(*v1.Database), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datafolder.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datafolder.go new file mode 100644 index 000000000..3ca2a5c5b --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datafolder.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DataFolderLister helps list DataFolders. +// All objects returned here must be treated as read-only. +type DataFolderLister interface { + // List lists all DataFolders in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DataFolder, err error) + // Get retrieves the DataFolder from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DataFolder, error) + DataFolderListerExpansion +} + +// dataFolderLister implements the DataFolderLister interface. +type dataFolderLister struct { + indexer cache.Indexer +} + +// NewDataFolderLister returns a new DataFolderLister. +func NewDataFolderLister(indexer cache.Indexer) DataFolderLister { + return &dataFolderLister{indexer: indexer} +} + +// List lists all DataFolders in the indexer. +func (s *dataFolderLister) List(selector labels.Selector) (ret []*v1.DataFolder, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DataFolder)) + }) + return ret, err +} + +// Get retrieves the DataFolder from the index for a given name. +func (s *dataFolderLister) Get(name string) (*v1.DataFolder, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("datafolder"), name) + } + return obj.(*v1.DataFolder), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datafolderdomain.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datafolderdomain.go new file mode 100644 index 000000000..9523dcbb2 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datafolderdomain.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DataFolderDomainLister helps list DataFolderDomains. +// All objects returned here must be treated as read-only. +type DataFolderDomainLister interface { + // List lists all DataFolderDomains in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DataFolderDomain, err error) + // Get retrieves the DataFolderDomain from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DataFolderDomain, error) + DataFolderDomainListerExpansion +} + +// dataFolderDomainLister implements the DataFolderDomainLister interface. +type dataFolderDomainLister struct { + indexer cache.Indexer +} + +// NewDataFolderDomainLister returns a new DataFolderDomainLister. +func NewDataFolderDomainLister(indexer cache.Indexer) DataFolderDomainLister { + return &dataFolderDomainLister{indexer: indexer} +} + +// List lists all DataFolderDomains in the indexer. +func (s *dataFolderDomainLister) List(selector labels.Selector) (ret []*v1.DataFolderDomain, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DataFolderDomain)) + }) + return ret, err +} + +// Get retrieves the DataFolderDomain from the index for a given name. +func (s *dataFolderDomainLister) Get(name string) (*v1.DataFolderDomain, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("datafolderdomain"), name) + } + return obj.(*v1.DataFolderDomain), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datafolderdomaincluster.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datafolderdomaincluster.go new file mode 100644 index 000000000..1d0723050 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datafolderdomaincluster.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DataFolderDomainClusterLister helps list DataFolderDomainClusters. +// All objects returned here must be treated as read-only. +type DataFolderDomainClusterLister interface { + // List lists all DataFolderDomainClusters in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DataFolderDomainCluster, err error) + // Get retrieves the DataFolderDomainCluster from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DataFolderDomainCluster, error) + DataFolderDomainClusterListerExpansion +} + +// dataFolderDomainClusterLister implements the DataFolderDomainClusterLister interface. +type dataFolderDomainClusterLister struct { + indexer cache.Indexer +} + +// NewDataFolderDomainClusterLister returns a new DataFolderDomainClusterLister. +func NewDataFolderDomainClusterLister(indexer cache.Indexer) DataFolderDomainClusterLister { + return &dataFolderDomainClusterLister{indexer: indexer} +} + +// List lists all DataFolderDomainClusters in the indexer. +func (s *dataFolderDomainClusterLister) List(selector labels.Selector) (ret []*v1.DataFolderDomainCluster, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DataFolderDomainCluster)) + }) + return ret, err +} + +// Get retrieves the DataFolderDomainCluster from the index for a given name. +func (s *dataFolderDomainClusterLister) Get(name string) (*v1.DataFolderDomainCluster, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("datafolderdomaincluster"), name) + } + return obj.(*v1.DataFolderDomainCluster), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datafolderdomainservice.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datafolderdomainservice.go new file mode 100644 index 000000000..fc7e17880 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datafolderdomainservice.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DataFolderDomainServiceLister helps list DataFolderDomainServices. +// All objects returned here must be treated as read-only. +type DataFolderDomainServiceLister interface { + // List lists all DataFolderDomainServices in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DataFolderDomainService, err error) + // Get retrieves the DataFolderDomainService from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DataFolderDomainService, error) + DataFolderDomainServiceListerExpansion +} + +// dataFolderDomainServiceLister implements the DataFolderDomainServiceLister interface. +type dataFolderDomainServiceLister struct { + indexer cache.Indexer +} + +// NewDataFolderDomainServiceLister returns a new DataFolderDomainServiceLister. +func NewDataFolderDomainServiceLister(indexer cache.Indexer) DataFolderDomainServiceLister { + return &dataFolderDomainServiceLister{indexer: indexer} +} + +// List lists all DataFolderDomainServices in the indexer. +func (s *dataFolderDomainServiceLister) List(selector labels.Selector) (ret []*v1.DataFolderDomainService, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DataFolderDomainService)) + }) + return ret, err +} + +// Get retrieves the DataFolderDomainService from the index for a given name. +func (s *dataFolderDomainServiceLister) Get(name string) (*v1.DataFolderDomainService, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("datafolderdomainservice"), name) + } + return obj.(*v1.DataFolderDomainService), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datafolderdomainserviceversion.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datafolderdomainserviceversion.go new file mode 100644 index 000000000..840405b7d --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datafolderdomainserviceversion.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DataFolderDomainServiceVersionLister helps list DataFolderDomainServiceVersions. +// All objects returned here must be treated as read-only. +type DataFolderDomainServiceVersionLister interface { + // List lists all DataFolderDomainServiceVersions in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DataFolderDomainServiceVersion, err error) + // Get retrieves the DataFolderDomainServiceVersion from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DataFolderDomainServiceVersion, error) + DataFolderDomainServiceVersionListerExpansion +} + +// dataFolderDomainServiceVersionLister implements the DataFolderDomainServiceVersionLister interface. +type dataFolderDomainServiceVersionLister struct { + indexer cache.Indexer +} + +// NewDataFolderDomainServiceVersionLister returns a new DataFolderDomainServiceVersionLister. +func NewDataFolderDomainServiceVersionLister(indexer cache.Indexer) DataFolderDomainServiceVersionLister { + return &dataFolderDomainServiceVersionLister{indexer: indexer} +} + +// List lists all DataFolderDomainServiceVersions in the indexer. +func (s *dataFolderDomainServiceVersionLister) List(selector labels.Selector) (ret []*v1.DataFolderDomainServiceVersion, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DataFolderDomainServiceVersion)) + }) + return ret, err +} + +// Get retrieves the DataFolderDomainServiceVersion from the index for a given name. +func (s *dataFolderDomainServiceVersionLister) Get(name string) (*v1.DataFolderDomainServiceVersion, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("datafolderdomainserviceversion"), name) + } + return obj.(*v1.DataFolderDomainServiceVersion), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datagroup.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datagroup.go new file mode 100644 index 000000000..1bc1d8366 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datagroup.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DataGroupLister helps list DataGroups. +// All objects returned here must be treated as read-only. +type DataGroupLister interface { + // List lists all DataGroups in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DataGroup, err error) + // Get retrieves the DataGroup from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DataGroup, error) + DataGroupListerExpansion +} + +// dataGroupLister implements the DataGroupLister interface. +type dataGroupLister struct { + indexer cache.Indexer +} + +// NewDataGroupLister returns a new DataGroupLister. +func NewDataGroupLister(indexer cache.Indexer) DataGroupLister { + return &dataGroupLister{indexer: indexer} +} + +// List lists all DataGroups in the indexer. +func (s *dataGroupLister) List(selector labels.Selector) (ret []*v1.DataGroup, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DataGroup)) + }) + return ret, err +} + +// Get retrieves the DataGroup from the index for a given name. +func (s *dataGroupLister) Get(name string) (*v1.DataGroup, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("datagroup"), name) + } + return obj.(*v1.DataGroup), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datatemplate.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datatemplate.go new file mode 100644 index 000000000..1a59e8eea --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/datatemplate.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DataTemplateLister helps list DataTemplates. +// All objects returned here must be treated as read-only. +type DataTemplateLister interface { + // List lists all DataTemplates in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DataTemplate, err error) + // Get retrieves the DataTemplate from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DataTemplate, error) + DataTemplateListerExpansion +} + +// dataTemplateLister implements the DataTemplateLister interface. +type dataTemplateLister struct { + indexer cache.Indexer +} + +// NewDataTemplateLister returns a new DataTemplateLister. +func NewDataTemplateLister(indexer cache.Indexer) DataTemplateLister { + return &dataTemplateLister{indexer: indexer} +} + +// List lists all DataTemplates in the indexer. +func (s *dataTemplateLister) List(selector labels.Selector) (ret []*v1.DataTemplate, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DataTemplate)) + }) + return ret, err +} + +// Get retrieves the DataTemplate from the index for a given name. +func (s *dataTemplateLister) Get(name string) (*v1.DataTemplate, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("datatemplate"), name) + } + return obj.(*v1.DataTemplate), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dcregion.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dcregion.go new file mode 100644 index 000000000..7c1e7f896 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dcregion.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DCRegionLister helps list DCRegions. +// All objects returned here must be treated as read-only. +type DCRegionLister interface { + // List lists all DCRegions in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DCRegion, err error) + // Get retrieves the DCRegion from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DCRegion, error) + DCRegionListerExpansion +} + +// dCRegionLister implements the DCRegionLister interface. +type dCRegionLister struct { + indexer cache.Indexer +} + +// NewDCRegionLister returns a new DCRegionLister. +func NewDCRegionLister(indexer cache.Indexer) DCRegionLister { + return &dCRegionLister{indexer: indexer} +} + +// List lists all DCRegions in the indexer. +func (s *dCRegionLister) List(selector labels.Selector) (ret []*v1.DCRegion, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DCRegion)) + }) + return ret, err +} + +// Get retrieves the DCRegion from the index for a given name. +func (s *dCRegionLister) Get(name string) (*v1.DCRegion, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("dcregion"), name) + } + return obj.(*v1.DCRegion), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dczone.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dczone.go new file mode 100644 index 000000000..fc1bdfd92 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dczone.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DCZoneLister helps list DCZones. +// All objects returned here must be treated as read-only. +type DCZoneLister interface { + // List lists all DCZones in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DCZone, err error) + // Get retrieves the DCZone from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DCZone, error) + DCZoneListerExpansion +} + +// dCZoneLister implements the DCZoneLister interface. +type dCZoneLister struct { + indexer cache.Indexer +} + +// NewDCZoneLister returns a new DCZoneLister. +func NewDCZoneLister(indexer cache.Indexer) DCZoneLister { + return &dCZoneLister{indexer: indexer} +} + +// List lists all DCZones in the indexer. +func (s *dCZoneLister) List(selector labels.Selector) (ret []*v1.DCZone, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DCZone)) + }) + return ret, err +} + +// Get retrieves the DCZone from the index for a given name. +func (s *dCZoneLister) Get(name string) (*v1.DCZone, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("dczone"), name) + } + return obj.(*v1.DCZone), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/destinationrule.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/destinationrule.go new file mode 100644 index 000000000..39d4ae1f2 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/destinationrule.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DestinationRuleLister helps list DestinationRules. +// All objects returned here must be treated as read-only. +type DestinationRuleLister interface { + // List lists all DestinationRules in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DestinationRule, err error) + // Get retrieves the DestinationRule from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DestinationRule, error) + DestinationRuleListerExpansion +} + +// destinationRuleLister implements the DestinationRuleLister interface. +type destinationRuleLister struct { + indexer cache.Indexer +} + +// NewDestinationRuleLister returns a new DestinationRuleLister. +func NewDestinationRuleLister(indexer cache.Indexer) DestinationRuleLister { + return &destinationRuleLister{indexer: indexer} +} + +// List lists all DestinationRules in the indexer. +func (s *destinationRuleLister) List(selector labels.Selector) (ret []*v1.DestinationRule, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DestinationRule)) + }) + return ret, err +} + +// Get retrieves the DestinationRule from the index for a given name. +func (s *destinationRuleLister) Get(name string) (*v1.DestinationRule, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("destinationrule"), name) + } + return obj.(*v1.DestinationRule), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/directory.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/directory.go new file mode 100644 index 000000000..943391c14 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/directory.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DirectoryLister helps list Directories. +// All objects returned here must be treated as read-only. +type DirectoryLister interface { + // List lists all Directories in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Directory, err error) + // Get retrieves the Directory from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Directory, error) + DirectoryListerExpansion +} + +// directoryLister implements the DirectoryLister interface. +type directoryLister struct { + indexer cache.Indexer +} + +// NewDirectoryLister returns a new DirectoryLister. +func NewDirectoryLister(indexer cache.Indexer) DirectoryLister { + return &directoryLister{indexer: indexer} +} + +// List lists all Directories in the indexer. +func (s *directoryLister) List(selector labels.Selector) (ret []*v1.Directory, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Directory)) + }) + return ret, err +} + +// Get retrieves the Directory from the index for a given name. +func (s *directoryLister) Get(name string) (*v1.Directory, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("directory"), name) + } + return obj.(*v1.Directory), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dnsconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dnsconfig.go new file mode 100644 index 000000000..89b487570 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dnsconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DNSConfigLister helps list DNSConfigs. +// All objects returned here must be treated as read-only. +type DNSConfigLister interface { + // List lists all DNSConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DNSConfig, err error) + // Get retrieves the DNSConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DNSConfig, error) + DNSConfigListerExpansion +} + +// dNSConfigLister implements the DNSConfigLister interface. +type dNSConfigLister struct { + indexer cache.Indexer +} + +// NewDNSConfigLister returns a new DNSConfigLister. +func NewDNSConfigLister(indexer cache.Indexer) DNSConfigLister { + return &dNSConfigLister{indexer: indexer} +} + +// List lists all DNSConfigs in the indexer. +func (s *dNSConfigLister) List(selector labels.Selector) (ret []*v1.DNSConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DNSConfig)) + }) + return ret, err +} + +// Get retrieves the DNSConfig from the index for a given name. +func (s *dNSConfigLister) Get(name string) (*v1.DNSConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("dnsconfig"), name) + } + return obj.(*v1.DNSConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dnsconfigfolder.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dnsconfigfolder.go new file mode 100644 index 000000000..76a2425aa --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dnsconfigfolder.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DNSConfigFolderLister helps list DNSConfigFolders. +// All objects returned here must be treated as read-only. +type DNSConfigFolderLister interface { + // List lists all DNSConfigFolders in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DNSConfigFolder, err error) + // Get retrieves the DNSConfigFolder from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DNSConfigFolder, error) + DNSConfigFolderListerExpansion +} + +// dNSConfigFolderLister implements the DNSConfigFolderLister interface. +type dNSConfigFolderLister struct { + indexer cache.Indexer +} + +// NewDNSConfigFolderLister returns a new DNSConfigFolderLister. +func NewDNSConfigFolderLister(indexer cache.Indexer) DNSConfigFolderLister { + return &dNSConfigFolderLister{indexer: indexer} +} + +// List lists all DNSConfigFolders in the indexer. +func (s *dNSConfigFolderLister) List(selector labels.Selector) (ret []*v1.DNSConfigFolder, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DNSConfigFolder)) + }) + return ret, err +} + +// Get retrieves the DNSConfigFolder from the index for a given name. +func (s *dNSConfigFolderLister) Get(name string) (*v1.DNSConfigFolder, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("dnsconfigfolder"), name) + } + return obj.(*v1.DNSConfigFolder), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dnsprobeconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dnsprobeconfig.go new file mode 100644 index 000000000..c5d12cd31 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dnsprobeconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DNSProbeConfigLister helps list DNSProbeConfigs. +// All objects returned here must be treated as read-only. +type DNSProbeConfigLister interface { + // List lists all DNSProbeConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DNSProbeConfig, err error) + // Get retrieves the DNSProbeConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DNSProbeConfig, error) + DNSProbeConfigListerExpansion +} + +// dNSProbeConfigLister implements the DNSProbeConfigLister interface. +type dNSProbeConfigLister struct { + indexer cache.Indexer +} + +// NewDNSProbeConfigLister returns a new DNSProbeConfigLister. +func NewDNSProbeConfigLister(indexer cache.Indexer) DNSProbeConfigLister { + return &dNSProbeConfigLister{indexer: indexer} +} + +// List lists all DNSProbeConfigs in the indexer. +func (s *dNSProbeConfigLister) List(selector labels.Selector) (ret []*v1.DNSProbeConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DNSProbeConfig)) + }) + return ret, err +} + +// Get retrieves the DNSProbeConfig from the index for a given name. +func (s *dNSProbeConfigLister) Get(name string) (*v1.DNSProbeConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("dnsprobeconfig"), name) + } + return obj.(*v1.DNSProbeConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dnsprobesconfigfolder.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dnsprobesconfigfolder.go new file mode 100644 index 000000000..b5f194a54 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dnsprobesconfigfolder.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DNSProbesConfigFolderLister helps list DNSProbesConfigFolders. +// All objects returned here must be treated as read-only. +type DNSProbesConfigFolderLister interface { + // List lists all DNSProbesConfigFolders in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DNSProbesConfigFolder, err error) + // Get retrieves the DNSProbesConfigFolder from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DNSProbesConfigFolder, error) + DNSProbesConfigFolderListerExpansion +} + +// dNSProbesConfigFolderLister implements the DNSProbesConfigFolderLister interface. +type dNSProbesConfigFolderLister struct { + indexer cache.Indexer +} + +// NewDNSProbesConfigFolderLister returns a new DNSProbesConfigFolderLister. +func NewDNSProbesConfigFolderLister(indexer cache.Indexer) DNSProbesConfigFolderLister { + return &dNSProbesConfigFolderLister{indexer: indexer} +} + +// List lists all DNSProbesConfigFolders in the indexer. +func (s *dNSProbesConfigFolderLister) List(selector labels.Selector) (ret []*v1.DNSProbesConfigFolder, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DNSProbesConfigFolder)) + }) + return ret, err +} + +// Get retrieves the DNSProbesConfigFolder from the index for a given name. +func (s *dNSProbesConfigFolderLister) Get(name string) (*v1.DNSProbesConfigFolder, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("dnsprobesconfigfolder"), name) + } + return obj.(*v1.DNSProbesConfigFolder), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dnsprobestatus.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dnsprobestatus.go new file mode 100644 index 000000000..a58380b08 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/dnsprobestatus.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DNSProbeStatusLister helps list DNSProbeStatuses. +// All objects returned here must be treated as read-only. +type DNSProbeStatusLister interface { + // List lists all DNSProbeStatuses in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DNSProbeStatus, err error) + // Get retrieves the DNSProbeStatus from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DNSProbeStatus, error) + DNSProbeStatusListerExpansion +} + +// dNSProbeStatusLister implements the DNSProbeStatusLister interface. +type dNSProbeStatusLister struct { + indexer cache.Indexer +} + +// NewDNSProbeStatusLister returns a new DNSProbeStatusLister. +func NewDNSProbeStatusLister(indexer cache.Indexer) DNSProbeStatusLister { + return &dNSProbeStatusLister{indexer: indexer} +} + +// List lists all DNSProbeStatuses in the indexer. +func (s *dNSProbeStatusLister) List(selector labels.Selector) (ret []*v1.DNSProbeStatus, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DNSProbeStatus)) + }) + return ret, err +} + +// Get retrieves the DNSProbeStatus from the index for a given name. +func (s *dNSProbeStatusLister) Get(name string) (*v1.DNSProbeStatus, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("dnsprobestatus"), name) + } + return obj.(*v1.DNSProbeStatus), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/domain.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/domain.go new file mode 100644 index 000000000..76829d656 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/domain.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DomainLister helps list Domains. +// All objects returned here must be treated as read-only. +type DomainLister interface { + // List lists all Domains in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Domain, err error) + // Get retrieves the Domain from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Domain, error) + DomainListerExpansion +} + +// domainLister implements the DomainLister interface. +type domainLister struct { + indexer cache.Indexer +} + +// NewDomainLister returns a new DomainLister. +func NewDomainLister(indexer cache.Indexer) DomainLister { + return &domainLister{indexer: indexer} +} + +// List lists all Domains in the indexer. +func (s *domainLister) List(selector labels.Selector) (ret []*v1.Domain, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Domain)) + }) + return ret, err +} + +// Get retrieves the Domain from the index for a given name. +func (s *domainLister) Get(name string) (*v1.Domain, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("domain"), name) + } + return obj.(*v1.Domain), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/domainconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/domainconfig.go new file mode 100644 index 000000000..fd72e34fb --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/domainconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DomainConfigLister helps list DomainConfigs. +// All objects returned here must be treated as read-only. +type DomainConfigLister interface { + // List lists all DomainConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DomainConfig, err error) + // Get retrieves the DomainConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DomainConfig, error) + DomainConfigListerExpansion +} + +// domainConfigLister implements the DomainConfigLister interface. +type domainConfigLister struct { + indexer cache.Indexer +} + +// NewDomainConfigLister returns a new DomainConfigLister. +func NewDomainConfigLister(indexer cache.Indexer) DomainConfigLister { + return &domainConfigLister{indexer: indexer} +} + +// List lists all DomainConfigs in the indexer. +func (s *domainConfigLister) List(selector labels.Selector) (ret []*v1.DomainConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DomainConfig)) + }) + return ret, err +} + +// Get retrieves the DomainConfig from the index for a given name. +func (s *domainConfigLister) Get(name string) (*v1.DomainConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("domainconfig"), name) + } + return obj.(*v1.DomainConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/endpoints.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/endpoints.go new file mode 100644 index 000000000..fef02b7a8 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/endpoints.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// EndpointsLister helps list Endpoints. +// All objects returned here must be treated as read-only. +type EndpointsLister interface { + // List lists all Endpoints in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Endpoints, err error) + // Get retrieves the Endpoints from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Endpoints, error) + EndpointsListerExpansion +} + +// endpointsLister implements the EndpointsLister interface. +type endpointsLister struct { + indexer cache.Indexer +} + +// NewEndpointsLister returns a new EndpointsLister. +func NewEndpointsLister(indexer cache.Indexer) EndpointsLister { + return &endpointsLister{indexer: indexer} +} + +// List lists all Endpoints in the indexer. +func (s *endpointsLister) List(selector labels.Selector) (ret []*v1.Endpoints, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Endpoints)) + }) + return ret, err +} + +// Get retrieves the Endpoints from the index for a given name. +func (s *endpointsLister) Get(name string) (*v1.Endpoints, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("endpoints"), name) + } + return obj.(*v1.Endpoints), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/envoyfilter.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/envoyfilter.go new file mode 100644 index 000000000..33c5ba475 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/envoyfilter.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// EnvoyFilterLister helps list EnvoyFilters. +// All objects returned here must be treated as read-only. +type EnvoyFilterLister interface { + // List lists all EnvoyFilters in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.EnvoyFilter, err error) + // Get retrieves the EnvoyFilter from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.EnvoyFilter, error) + EnvoyFilterListerExpansion +} + +// envoyFilterLister implements the EnvoyFilterLister interface. +type envoyFilterLister struct { + indexer cache.Indexer +} + +// NewEnvoyFilterLister returns a new EnvoyFilterLister. +func NewEnvoyFilterLister(indexer cache.Indexer) EnvoyFilterLister { + return &envoyFilterLister{indexer: indexer} +} + +// List lists all EnvoyFilters in the indexer. +func (s *envoyFilterLister) List(selector labels.Selector) (ret []*v1.EnvoyFilter, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.EnvoyFilter)) + }) + return ret, err +} + +// Get retrieves the EnvoyFilter from the index for a given name. +func (s *envoyFilterLister) Get(name string) (*v1.EnvoyFilter, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("envoyfilter"), name) + } + return obj.(*v1.EnvoyFilter), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/expansion_generated.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/expansion_generated.go new file mode 100644 index 000000000..524915ac8 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/expansion_generated.go @@ -0,0 +1,851 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +// ACPConfigListerExpansion allows custom methods to be added to +// ACPConfigLister. +type ACPConfigListerExpansion interface{} + +// AccessControlPolicyListerExpansion allows custom methods to be added to +// AccessControlPolicyLister. +type AccessControlPolicyListerExpansion interface{} + +// AccessTokenListerExpansion allows custom methods to be added to +// AccessTokenLister. +type AccessTokenListerExpansion interface{} + +// AdditionalAttributesListerExpansion allows custom methods to be added to +// AdditionalAttributesLister. +type AdditionalAttributesListerExpansion interface{} + +// AllSparkServicesListerExpansion allows custom methods to be added to +// AllSparkServicesLister. +type AllSparkServicesListerExpansion interface{} + +// AnnotationListerExpansion allows custom methods to be added to +// AnnotationLister. +type AnnotationListerExpansion interface{} + +// ApiDiscoveryListerExpansion allows custom methods to be added to +// ApiDiscoveryLister. +type ApiDiscoveryListerExpansion interface{} + +// ApiDiscoveryRTListerExpansion allows custom methods to be added to +// ApiDiscoveryRTLister. +type ApiDiscoveryRTListerExpansion interface{} + +// AppListerExpansion allows custom methods to be added to +// AppLister. +type AppListerExpansion interface{} + +// AppFolderListerExpansion allows custom methods to be added to +// AppFolderLister. +type AppFolderListerExpansion interface{} + +// AppGroupListerExpansion allows custom methods to be added to +// AppGroupLister. +type AppGroupListerExpansion interface{} + +// AppTemplateListerExpansion allows custom methods to be added to +// AppTemplateLister. +type AppTemplateListerExpansion interface{} + +// AppTemplateServiceDefinitionListerExpansion allows custom methods to be added to +// AppTemplateServiceDefinitionLister. +type AppTemplateServiceDefinitionListerExpansion interface{} + +// AppUserListerExpansion allows custom methods to be added to +// AppUserLister. +type AppUserListerExpansion interface{} + +// AppVersionListerExpansion allows custom methods to be added to +// AppVersionLister. +type AppVersionListerExpansion interface{} + +// ApplicationInfoListerExpansion allows custom methods to be added to +// ApplicationInfoLister. +type ApplicationInfoListerExpansion interface{} + +// AttackDiscoveryListerExpansion allows custom methods to be added to +// AttackDiscoveryLister. +type AttackDiscoveryListerExpansion interface{} + +// AttackDiscoveryRTListerExpansion allows custom methods to be added to +// AttackDiscoveryRTLister. +type AttackDiscoveryRTListerExpansion interface{} + +// AuthenticationPolicyListerExpansion allows custom methods to be added to +// AuthenticationPolicyLister. +type AuthenticationPolicyListerExpansion interface{} + +// AutoscalerListerExpansion allows custom methods to be added to +// AutoscalerLister. +type AutoscalerListerExpansion interface{} + +// AutoscalerCRListerExpansion allows custom methods to be added to +// AutoscalerCRLister. +type AutoscalerCRListerExpansion interface{} + +// AutoscalerConfigListerExpansion allows custom methods to be added to +// AutoscalerConfigLister. +type AutoscalerConfigListerExpansion interface{} + +// AutoscalerFolderListerExpansion allows custom methods to be added to +// AutoscalerFolderLister. +type AutoscalerFolderListerExpansion interface{} + +// AutoscalingPolicyListerExpansion allows custom methods to be added to +// AutoscalingPolicyLister. +type AutoscalingPolicyListerExpansion interface{} + +// AwsConnectorListerExpansion allows custom methods to be added to +// AwsConnectorLister. +type AwsConnectorListerExpansion interface{} + +// BucketListerExpansion allows custom methods to be added to +// BucketLister. +type BucketListerExpansion interface{} + +// CertificateListerExpansion allows custom methods to be added to +// CertificateLister. +type CertificateListerExpansion interface{} + +// CertificateAuthorityConfigNListerExpansion allows custom methods to be added to +// CertificateAuthorityConfigNLister. +type CertificateAuthorityConfigNListerExpansion interface{} + +// CertificateAuthorityRTListerExpansion allows custom methods to be added to +// CertificateAuthorityRTLister. +type CertificateAuthorityRTListerExpansion interface{} + +// CertificateConfigNListerExpansion allows custom methods to be added to +// CertificateConfigNLister. +type CertificateConfigNListerExpansion interface{} + +// CertificateRequestListerExpansion allows custom methods to be added to +// CertificateRequestLister. +type CertificateRequestListerExpansion interface{} + +// ClusterListerExpansion allows custom methods to be added to +// ClusterLister. +type ClusterListerExpansion interface{} + +// ClusterConfigListerExpansion allows custom methods to be added to +// ClusterConfigLister. +type ClusterConfigListerExpansion interface{} + +// ClusterConfigFolderListerExpansion allows custom methods to be added to +// ClusterConfigFolderLister. +type ClusterConfigFolderListerExpansion interface{} + +// ClusterFolderListerExpansion allows custom methods to be added to +// ClusterFolderLister. +type ClusterFolderListerExpansion interface{} + +// ClusterSettingsListerExpansion allows custom methods to be added to +// ClusterSettingsLister. +type ClusterSettingsListerExpansion interface{} + +// ConfigListerExpansion allows custom methods to be added to +// ConfigLister. +type ConfigListerExpansion interface{} + +// ConfigMapListerExpansion allows custom methods to be added to +// ConfigMapLister. +type ConfigMapListerExpansion interface{} + +// ConnectionStatusListerExpansion allows custom methods to be added to +// ConnectionStatusLister. +type ConnectionStatusListerExpansion interface{} + +// DCRegionListerExpansion allows custom methods to be added to +// DCRegionLister. +type DCRegionListerExpansion interface{} + +// DCZoneListerExpansion allows custom methods to be added to +// DCZoneLister. +type DCZoneListerExpansion interface{} + +// DNSConfigListerExpansion allows custom methods to be added to +// DNSConfigLister. +type DNSConfigListerExpansion interface{} + +// DNSConfigFolderListerExpansion allows custom methods to be added to +// DNSConfigFolderLister. +type DNSConfigFolderListerExpansion interface{} + +// DNSProbeConfigListerExpansion allows custom methods to be added to +// DNSProbeConfigLister. +type DNSProbeConfigListerExpansion interface{} + +// DNSProbeStatusListerExpansion allows custom methods to be added to +// DNSProbeStatusLister. +type DNSProbeStatusListerExpansion interface{} + +// DNSProbesConfigFolderListerExpansion allows custom methods to be added to +// DNSProbesConfigFolderLister. +type DNSProbesConfigFolderListerExpansion interface{} + +// DataFolderListerExpansion allows custom methods to be added to +// DataFolderLister. +type DataFolderListerExpansion interface{} + +// DataFolderDomainListerExpansion allows custom methods to be added to +// DataFolderDomainLister. +type DataFolderDomainListerExpansion interface{} + +// DataFolderDomainClusterListerExpansion allows custom methods to be added to +// DataFolderDomainClusterLister. +type DataFolderDomainClusterListerExpansion interface{} + +// DataFolderDomainServiceListerExpansion allows custom methods to be added to +// DataFolderDomainServiceLister. +type DataFolderDomainServiceListerExpansion interface{} + +// DataFolderDomainServiceVersionListerExpansion allows custom methods to be added to +// DataFolderDomainServiceVersionLister. +type DataFolderDomainServiceVersionListerExpansion interface{} + +// DataGroupListerExpansion allows custom methods to be added to +// DataGroupLister. +type DataGroupListerExpansion interface{} + +// DataTemplateListerExpansion allows custom methods to be added to +// DataTemplateLister. +type DataTemplateListerExpansion interface{} + +// DatabaseListerExpansion allows custom methods to be added to +// DatabaseLister. +type DatabaseListerExpansion interface{} + +// DestinationRuleListerExpansion allows custom methods to be added to +// DestinationRuleLister. +type DestinationRuleListerExpansion interface{} + +// DirectoryListerExpansion allows custom methods to be added to +// DirectoryLister. +type DirectoryListerExpansion interface{} + +// DomainListerExpansion allows custom methods to be added to +// DomainLister. +type DomainListerExpansion interface{} + +// DomainConfigListerExpansion allows custom methods to be added to +// DomainConfigLister. +type DomainConfigListerExpansion interface{} + +// EndpointsListerExpansion allows custom methods to be added to +// EndpointsLister. +type EndpointsListerExpansion interface{} + +// EnvoyFilterListerExpansion allows custom methods to be added to +// EnvoyFilterLister. +type EnvoyFilterListerExpansion interface{} + +// ExternalAccountConfigNListerExpansion allows custom methods to be added to +// ExternalAccountConfigNLister. +type ExternalAccountConfigNListerExpansion interface{} + +// ExternalAuditStorageListerExpansion allows custom methods to be added to +// ExternalAuditStorageLister. +type ExternalAuditStorageListerExpansion interface{} + +// ExternalDNSConfigNListerExpansion allows custom methods to be added to +// ExternalDNSConfigNLister. +type ExternalDNSConfigNListerExpansion interface{} + +// ExternalDNSInventoryListerExpansion allows custom methods to be added to +// ExternalDNSInventoryLister. +type ExternalDNSInventoryListerExpansion interface{} + +// ExternalDNSInventoryHealthCheckListerExpansion allows custom methods to be added to +// ExternalDNSInventoryHealthCheckLister. +type ExternalDNSInventoryHealthCheckListerExpansion interface{} + +// ExternalDNSInventoryPrimaryDomainListerExpansion allows custom methods to be added to +// ExternalDNSInventoryPrimaryDomainLister. +type ExternalDNSInventoryPrimaryDomainListerExpansion interface{} + +// ExternalDNSInventoryRecordListerExpansion allows custom methods to be added to +// ExternalDNSInventoryRecordLister. +type ExternalDNSInventoryRecordListerExpansion interface{} + +// ExternalDNSInventoryZoneListerExpansion allows custom methods to be added to +// ExternalDNSInventoryZoneLister. +type ExternalDNSInventoryZoneListerExpansion interface{} + +// ExternalDNSRuntimeListerExpansion allows custom methods to be added to +// ExternalDNSRuntimeLister. +type ExternalDNSRuntimeListerExpansion interface{} + +// ExternalDNSRuntimeEndpointListerExpansion allows custom methods to be added to +// ExternalDNSRuntimeEndpointLister. +type ExternalDNSRuntimeEndpointListerExpansion interface{} + +// ExternalDNSRuntimePrimaryDomainListerExpansion allows custom methods to be added to +// ExternalDNSRuntimePrimaryDomainLister. +type ExternalDNSRuntimePrimaryDomainListerExpansion interface{} + +// ExternalDNSRuntimeSubdomainListerExpansion allows custom methods to be added to +// ExternalDNSRuntimeSubdomainLister. +type ExternalDNSRuntimeSubdomainListerExpansion interface{} + +// ExternalLBConfigNListerExpansion allows custom methods to be added to +// ExternalLBConfigNLister. +type ExternalLBConfigNListerExpansion interface{} + +// ExternalPluginCapabilityListerExpansion allows custom methods to be added to +// ExternalPluginCapabilityLister. +type ExternalPluginCapabilityListerExpansion interface{} + +// ExternalPluginConfigListerExpansion allows custom methods to be added to +// ExternalPluginConfigLister. +type ExternalPluginConfigListerExpansion interface{} + +// ExternalPluginConfigFolderListerExpansion allows custom methods to be added to +// ExternalPluginConfigFolderLister. +type ExternalPluginConfigFolderListerExpansion interface{} + +// ExternalPluginInstanceConfigListerExpansion allows custom methods to be added to +// ExternalPluginInstanceConfigLister. +type ExternalPluginInstanceConfigListerExpansion interface{} + +// ExternalPluginMonitorListerExpansion allows custom methods to be added to +// ExternalPluginMonitorLister. +type ExternalPluginMonitorListerExpansion interface{} + +// ExternalServiceConfigListerExpansion allows custom methods to be added to +// ExternalServiceConfigLister. +type ExternalServiceConfigListerExpansion interface{} + +// ExternalServicesRTListerExpansion allows custom methods to be added to +// ExternalServicesRTLister. +type ExternalServicesRTListerExpansion interface{} + +// FeatureFlagListerExpansion allows custom methods to be added to +// FeatureFlagLister. +type FeatureFlagListerExpansion interface{} + +// FederatedSloConfigListerExpansion allows custom methods to be added to +// FederatedSloConfigLister. +type FederatedSloConfigListerExpansion interface{} + +// FederatedSloServiceConfigListerExpansion allows custom methods to be added to +// FederatedSloServiceConfigLister. +type FederatedSloServiceConfigListerExpansion interface{} + +// GNSListerExpansion allows custom methods to be added to +// GNSLister. +type GNSListerExpansion interface{} + +// GNSRoutingConfigListerExpansion allows custom methods to be added to +// GNSRoutingConfigLister. +type GNSRoutingConfigListerExpansion interface{} + +// GNSSvcGroupListerExpansion allows custom methods to be added to +// GNSSvcGroupLister. +type GNSSvcGroupListerExpansion interface{} + +// GatewayListerExpansion allows custom methods to be added to +// GatewayLister. +type GatewayListerExpansion interface{} + +// GatewayConfigListerExpansion allows custom methods to be added to +// GatewayConfigLister. +type GatewayConfigListerExpansion interface{} + +// GatewayConfigAdditionalListenersListerExpansion allows custom methods to be added to +// GatewayConfigAdditionalListenersLister. +type GatewayConfigAdditionalListenersListerExpansion interface{} + +// GatewayConfigListenerCertificateListerExpansion allows custom methods to be added to +// GatewayConfigListenerCertificateLister. +type GatewayConfigListenerCertificateListerExpansion interface{} + +// GatewayConfigListenerDestinationRouteListerExpansion allows custom methods to be added to +// GatewayConfigListenerDestinationRouteLister. +type GatewayConfigListenerDestinationRouteListerExpansion interface{} + +// GeoDiscoveryListerExpansion allows custom methods to be added to +// GeoDiscoveryLister. +type GeoDiscoveryListerExpansion interface{} + +// GeoDiscoveryRTListerExpansion allows custom methods to be added to +// GeoDiscoveryRTLister. +type GeoDiscoveryRTListerExpansion interface{} + +// GlobalNamespaceListerExpansion allows custom methods to be added to +// GlobalNamespaceLister. +type GlobalNamespaceListerExpansion interface{} + +// GlobalNsListerExpansion allows custom methods to be added to +// GlobalNsLister. +type GlobalNsListerExpansion interface{} + +// GlobalRegistrationServiceListerExpansion allows custom methods to be added to +// GlobalRegistrationServiceLister. +type GlobalRegistrationServiceListerExpansion interface{} + +// GnsAccessControlPolicyListerExpansion allows custom methods to be added to +// GnsAccessControlPolicyLister. +type GnsAccessControlPolicyListerExpansion interface{} + +// GnsAccessControlPolicyRTListerExpansion allows custom methods to be added to +// GnsAccessControlPolicyRTLister. +type GnsAccessControlPolicyRTListerExpansion interface{} + +// GnsBindingRTListerExpansion allows custom methods to be added to +// GnsBindingRTLister. +type GnsBindingRTListerExpansion interface{} + +// GnsEndpointsConfigListerExpansion allows custom methods to be added to +// GnsEndpointsConfigLister. +type GnsEndpointsConfigListerExpansion interface{} + +// GnsRoutingRuleConfigListerExpansion allows custom methods to be added to +// GnsRoutingRuleConfigLister. +type GnsRoutingRuleConfigListerExpansion interface{} + +// GnsSchemaViolationDiscoveryListerExpansion allows custom methods to be added to +// GnsSchemaViolationDiscoveryLister. +type GnsSchemaViolationDiscoveryListerExpansion interface{} + +// GnsSegmentationPolicyListerExpansion allows custom methods to be added to +// GnsSegmentationPolicyLister. +type GnsSegmentationPolicyListerExpansion interface{} + +// GnsSegmentationPolicyRTListerExpansion allows custom methods to be added to +// GnsSegmentationPolicyRTLister. +type GnsSegmentationPolicyRTListerExpansion interface{} + +// GnsServiceEntryConfigListerExpansion allows custom methods to be added to +// GnsServiceEntryConfigLister. +type GnsServiceEntryConfigListerExpansion interface{} + +// GnsSvcGroupRTListerExpansion allows custom methods to be added to +// GnsSvcGroupRTLister. +type GnsSvcGroupRTListerExpansion interface{} + +// HaConfigListerExpansion allows custom methods to be added to +// HaConfigLister. +type HaConfigListerExpansion interface{} + +// HaConfigV2ListerExpansion allows custom methods to be added to +// HaConfigV2Lister. +type HaConfigV2ListerExpansion interface{} + +// HealthCheckConfigNListerExpansion allows custom methods to be added to +// HealthCheckConfigNLister. +type HealthCheckConfigNListerExpansion interface{} + +// HostConfigListerExpansion allows custom methods to be added to +// HostConfigLister. +type HostConfigListerExpansion interface{} + +// HostConfigV2ListerExpansion allows custom methods to be added to +// HostConfigV2Lister. +type HostConfigV2ListerExpansion interface{} + +// InboundAuthenticationConfigListerExpansion allows custom methods to be added to +// InboundAuthenticationConfigLister. +type InboundAuthenticationConfigListerExpansion interface{} + +// InventoryListerExpansion allows custom methods to be added to +// InventoryLister. +type InventoryListerExpansion interface{} + +// IssuerListerExpansion allows custom methods to be added to +// IssuerLister. +type IssuerListerExpansion interface{} + +// JobListerExpansion allows custom methods to be added to +// JobLister. +type JobListerExpansion interface{} + +// JobConfigListerExpansion allows custom methods to be added to +// JobConfigLister. +type JobConfigListerExpansion interface{} + +// JobConfigFolderListerExpansion allows custom methods to be added to +// JobConfigFolderLister. +type JobConfigFolderListerExpansion interface{} + +// JobFolderListerExpansion allows custom methods to be added to +// JobFolderLister. +type JobFolderListerExpansion interface{} + +// KnativeIngressListerExpansion allows custom methods to be added to +// KnativeIngressLister. +type KnativeIngressListerExpansion interface{} + +// LabelConfigListerExpansion allows custom methods to be added to +// LabelConfigLister. +type LabelConfigListerExpansion interface{} + +// LocalRegistrationServiceListerExpansion allows custom methods to be added to +// LocalRegistrationServiceLister. +type LocalRegistrationServiceListerExpansion interface{} + +// LocalRegistrationServiceClusterListerExpansion allows custom methods to be added to +// LocalRegistrationServiceClusterLister. +type LocalRegistrationServiceClusterListerExpansion interface{} + +// LocalRegistrationServiceResourceListerExpansion allows custom methods to be added to +// LocalRegistrationServiceResourceLister. +type LocalRegistrationServiceResourceListerExpansion interface{} + +// LogListerExpansion allows custom methods to be added to +// LogLister. +type LogListerExpansion interface{} + +// LogFolderListerExpansion allows custom methods to be added to +// LogFolderLister. +type LogFolderListerExpansion interface{} + +// MetricMonitorListerExpansion allows custom methods to be added to +// MetricMonitorLister. +type MetricMonitorListerExpansion interface{} + +// NetworkAttachmentDefinitionListerExpansion allows custom methods to be added to +// NetworkAttachmentDefinitionLister. +type NetworkAttachmentDefinitionListerExpansion interface{} + +// NetworkAttachmentDefinitionConfigListerExpansion allows custom methods to be added to +// NetworkAttachmentDefinitionConfigLister. +type NetworkAttachmentDefinitionConfigListerExpansion interface{} + +// NodeListerExpansion allows custom methods to be added to +// NodeLister. +type NodeListerExpansion interface{} + +// NodeDefinitionListerExpansion allows custom methods to be added to +// NodeDefinitionLister. +type NodeDefinitionListerExpansion interface{} + +// NodeFolderListerExpansion allows custom methods to be added to +// NodeFolderLister. +type NodeFolderListerExpansion interface{} + +// NodeFolderClusterListerExpansion allows custom methods to be added to +// NodeFolderClusterLister. +type NodeFolderClusterListerExpansion interface{} + +// NodeGroupListerExpansion allows custom methods to be added to +// NodeGroupLister. +type NodeGroupListerExpansion interface{} + +// NodeStatusListerExpansion allows custom methods to be added to +// NodeStatusLister. +type NodeStatusListerExpansion interface{} + +// NodeTemplateListerExpansion allows custom methods to be added to +// NodeTemplateLister. +type NodeTemplateListerExpansion interface{} + +// OutboundAuthenticationModeListerExpansion allows custom methods to be added to +// OutboundAuthenticationModeLister. +type OutboundAuthenticationModeListerExpansion interface{} + +// PeerAuthenticationListerExpansion allows custom methods to be added to +// PeerAuthenticationLister. +type PeerAuthenticationListerExpansion interface{} + +// PiiDiscoveryListerExpansion allows custom methods to be added to +// PiiDiscoveryLister. +type PiiDiscoveryListerExpansion interface{} + +// PiiDiscoveryRTListerExpansion allows custom methods to be added to +// PiiDiscoveryRTLister. +type PiiDiscoveryRTListerExpansion interface{} + +// PolicyConfigListerExpansion allows custom methods to be added to +// PolicyConfigLister. +type PolicyConfigListerExpansion interface{} + +// PolicyTemplateListerExpansion allows custom methods to be added to +// PolicyTemplateLister. +type PolicyTemplateListerExpansion interface{} + +// ProgressiveUpgradeListerExpansion allows custom methods to be added to +// ProgressiveUpgradeLister. +type ProgressiveUpgradeListerExpansion interface{} + +// ProgressiveUpgradeConfigListerExpansion allows custom methods to be added to +// ProgressiveUpgradeConfigLister. +type ProgressiveUpgradeConfigListerExpansion interface{} + +// ProgressiveUpgradeFolderListerExpansion allows custom methods to be added to +// ProgressiveUpgradeFolderLister. +type ProgressiveUpgradeFolderListerExpansion interface{} + +// ProgressiveUpgradeRuntimeListerExpansion allows custom methods to be added to +// ProgressiveUpgradeRuntimeLister. +type ProgressiveUpgradeRuntimeListerExpansion interface{} + +// ProjectListerExpansion allows custom methods to be added to +// ProjectLister. +type ProjectListerExpansion interface{} + +// ProjectConfigListerExpansion allows custom methods to be added to +// ProjectConfigLister. +type ProjectConfigListerExpansion interface{} + +// ProjectInventoryListerExpansion allows custom methods to be added to +// ProjectInventoryLister. +type ProjectInventoryListerExpansion interface{} + +// ProjectQueryListerExpansion allows custom methods to be added to +// ProjectQueryLister. +type ProjectQueryListerExpansion interface{} + +// PublicServiceConfigListerExpansion allows custom methods to be added to +// PublicServiceConfigLister. +type PublicServiceConfigListerExpansion interface{} + +// PublicServiceRTListerExpansion allows custom methods to be added to +// PublicServiceRTLister. +type PublicServiceRTListerExpansion interface{} + +// PublicServiceRouteConfigListerExpansion allows custom methods to be added to +// PublicServiceRouteConfigLister. +type PublicServiceRouteConfigListerExpansion interface{} + +// RPolicyListerExpansion allows custom methods to be added to +// RPolicyLister. +type RPolicyListerExpansion interface{} + +// RemoteGatewayServiceConfigListerExpansion allows custom methods to be added to +// RemoteGatewayServiceConfigLister. +type RemoteGatewayServiceConfigListerExpansion interface{} + +// ResourceGroupListerExpansion allows custom methods to be added to +// ResourceGroupLister. +type ResourceGroupListerExpansion interface{} + +// ResourceGroupRTListerExpansion allows custom methods to be added to +// ResourceGroupRTLister. +type ResourceGroupRTListerExpansion interface{} + +// RootListerExpansion allows custom methods to be added to +// RootLister. +type RootListerExpansion interface{} + +// RuntimeListerExpansion allows custom methods to be added to +// RuntimeLister. +type RuntimeListerExpansion interface{} + +// SLOFolderListerExpansion allows custom methods to be added to +// SLOFolderLister. +type SLOFolderListerExpansion interface{} + +// SLOPolicyListerExpansion allows custom methods to be added to +// SLOPolicyLister. +type SLOPolicyListerExpansion interface{} + +// SchemaViolationDiscoveryRTListerExpansion allows custom methods to be added to +// SchemaViolationDiscoveryRTLister. +type SchemaViolationDiscoveryRTListerExpansion interface{} + +// SecretHashListerExpansion allows custom methods to be added to +// SecretHashLister. +type SecretHashListerExpansion interface{} + +// SecretRTConfigListerExpansion allows custom methods to be added to +// SecretRTConfigLister. +type SecretRTConfigListerExpansion interface{} + +// SecurityContextConstraintsListerExpansion allows custom methods to be added to +// SecurityContextConstraintsLister. +type SecurityContextConstraintsListerExpansion interface{} + +// SecurityContextConstraintsConfigListerExpansion allows custom methods to be added to +// SecurityContextConstraintsConfigLister. +type SecurityContextConstraintsConfigListerExpansion interface{} + +// ServiceListerExpansion allows custom methods to be added to +// ServiceLister. +type ServiceListerExpansion interface{} + +// ServiceConfigListerExpansion allows custom methods to be added to +// ServiceConfigLister. +type ServiceConfigListerExpansion interface{} + +// ServiceCronJobListerExpansion allows custom methods to be added to +// ServiceCronJobLister. +type ServiceCronJobListerExpansion interface{} + +// ServiceDaemonSetListerExpansion allows custom methods to be added to +// ServiceDaemonSetLister. +type ServiceDaemonSetListerExpansion interface{} + +// ServiceDeploymentListerExpansion allows custom methods to be added to +// ServiceDeploymentLister. +type ServiceDeploymentListerExpansion interface{} + +// ServiceDeploymentContainerListerExpansion allows custom methods to be added to +// ServiceDeploymentContainerLister. +type ServiceDeploymentContainerListerExpansion interface{} + +// ServiceDirectoryEntryConfigListerExpansion allows custom methods to be added to +// ServiceDirectoryEntryConfigLister. +type ServiceDirectoryEntryConfigListerExpansion interface{} + +// ServiceDirectoryNListerExpansion allows custom methods to be added to +// ServiceDirectoryNLister. +type ServiceDirectoryNListerExpansion interface{} + +// ServiceDirectoryRTListerExpansion allows custom methods to be added to +// ServiceDirectoryRTLister. +type ServiceDirectoryRTListerExpansion interface{} + +// ServiceDirectoryRTFolderListerExpansion allows custom methods to be added to +// ServiceDirectoryRTFolderLister. +type ServiceDirectoryRTFolderListerExpansion interface{} + +// ServiceDirectoryRTFolderEntryListerExpansion allows custom methods to be added to +// ServiceDirectoryRTFolderEntryLister. +type ServiceDirectoryRTFolderEntryListerExpansion interface{} + +// ServiceEntryListerExpansion allows custom methods to be added to +// ServiceEntryLister. +type ServiceEntryListerExpansion interface{} + +// ServiceEntryConfigListerExpansion allows custom methods to be added to +// ServiceEntryConfigLister. +type ServiceEntryConfigListerExpansion interface{} + +// ServiceInstanceListerExpansion allows custom methods to be added to +// ServiceInstanceLister. +type ServiceInstanceListerExpansion interface{} + +// ServiceInstanceContainerListerExpansion allows custom methods to be added to +// ServiceInstanceContainerLister. +type ServiceInstanceContainerListerExpansion interface{} + +// ServiceJobListerExpansion allows custom methods to be added to +// ServiceJobLister. +type ServiceJobListerExpansion interface{} + +// ServiceLevelObjectiveListerExpansion allows custom methods to be added to +// ServiceLevelObjectiveLister. +type ServiceLevelObjectiveListerExpansion interface{} + +// ServiceLevelObjectiveFolderListerExpansion allows custom methods to be added to +// ServiceLevelObjectiveFolderLister. +type ServiceLevelObjectiveFolderListerExpansion interface{} + +// ServiceReplicaSetListerExpansion allows custom methods to be added to +// ServiceReplicaSetLister. +type ServiceReplicaSetListerExpansion interface{} + +// ServiceStatefulSetListerExpansion allows custom methods to be added to +// ServiceStatefulSetLister. +type ServiceStatefulSetListerExpansion interface{} + +// ServiceTemplateListerExpansion allows custom methods to be added to +// ServiceTemplateLister. +type ServiceTemplateListerExpansion interface{} + +// ServiceTemplateServiceDefinitionListerExpansion allows custom methods to be added to +// ServiceTemplateServiceDefinitionLister. +type ServiceTemplateServiceDefinitionListerExpansion interface{} + +// ServiceVersionListerExpansion allows custom methods to be added to +// ServiceVersionLister. +type ServiceVersionListerExpansion interface{} + +// ServiceVersionConfigListerExpansion allows custom methods to be added to +// ServiceVersionConfigLister. +type ServiceVersionConfigListerExpansion interface{} + +// SharedServiceConfigListerExpansion allows custom methods to be added to +// SharedServiceConfigLister. +type SharedServiceConfigListerExpansion interface{} + +// SloConfigListerExpansion allows custom methods to be added to +// SloConfigLister. +type SloConfigListerExpansion interface{} + +// SloServiceConfigListerExpansion allows custom methods to be added to +// SloServiceConfigLister. +type SloServiceConfigListerExpansion interface{} + +// SvcGroupListerExpansion allows custom methods to be added to +// SvcGroupLister. +type SvcGroupListerExpansion interface{} + +// SvcGroupRTListerExpansion allows custom methods to be added to +// SvcGroupRTLister. +type SvcGroupRTListerExpansion interface{} + +// TableListerExpansion allows custom methods to be added to +// TableLister. +type TableListerExpansion interface{} + +// TemplateListerExpansion allows custom methods to be added to +// TemplateLister. +type TemplateListerExpansion interface{} + +// TemplateGroupListerExpansion allows custom methods to be added to +// TemplateGroupLister. +type TemplateGroupListerExpansion interface{} + +// TenantListerExpansion allows custom methods to be added to +// TenantLister. +type TenantListerExpansion interface{} + +// TenantResourceListerExpansion allows custom methods to be added to +// TenantResourceLister. +type TenantResourceListerExpansion interface{} + +// TenantTokenListerExpansion allows custom methods to be added to +// TenantTokenLister. +type TenantTokenListerExpansion interface{} + +// UserListerExpansion allows custom methods to be added to +// UserLister. +type UserListerExpansion interface{} + +// UserDiscoveryListerExpansion allows custom methods to be added to +// UserDiscoveryLister. +type UserDiscoveryListerExpansion interface{} + +// UserDiscoveryRTListerExpansion allows custom methods to be added to +// UserDiscoveryRTLister. +type UserDiscoveryRTListerExpansion interface{} + +// UserFolderListerExpansion allows custom methods to be added to +// UserFolderLister. +type UserFolderListerExpansion interface{} + +// UserGroupListerExpansion allows custom methods to be added to +// UserGroupLister. +type UserGroupListerExpansion interface{} + +// UserPreferenceListerExpansion allows custom methods to be added to +// UserPreferenceLister. +type UserPreferenceListerExpansion interface{} + +// VirtualServiceListerExpansion allows custom methods to be added to +// VirtualServiceLister. +type VirtualServiceListerExpansion interface{} + +// WorkloadEntryListerExpansion allows custom methods to be added to +// WorkloadEntryLister. +type WorkloadEntryListerExpansion interface{} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalaccountconfign.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalaccountconfign.go new file mode 100644 index 000000000..95e6519ee --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalaccountconfign.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalAccountConfigNLister helps list ExternalAccountConfigNs. +// All objects returned here must be treated as read-only. +type ExternalAccountConfigNLister interface { + // List lists all ExternalAccountConfigNs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalAccountConfigN, err error) + // Get retrieves the ExternalAccountConfigN from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalAccountConfigN, error) + ExternalAccountConfigNListerExpansion +} + +// externalAccountConfigNLister implements the ExternalAccountConfigNLister interface. +type externalAccountConfigNLister struct { + indexer cache.Indexer +} + +// NewExternalAccountConfigNLister returns a new ExternalAccountConfigNLister. +func NewExternalAccountConfigNLister(indexer cache.Indexer) ExternalAccountConfigNLister { + return &externalAccountConfigNLister{indexer: indexer} +} + +// List lists all ExternalAccountConfigNs in the indexer. +func (s *externalAccountConfigNLister) List(selector labels.Selector) (ret []*v1.ExternalAccountConfigN, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalAccountConfigN)) + }) + return ret, err +} + +// Get retrieves the ExternalAccountConfigN from the index for a given name. +func (s *externalAccountConfigNLister) Get(name string) (*v1.ExternalAccountConfigN, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externalaccountconfign"), name) + } + return obj.(*v1.ExternalAccountConfigN), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalauditstorage.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalauditstorage.go new file mode 100644 index 000000000..53d3bdf92 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalauditstorage.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalAuditStorageLister helps list ExternalAuditStorages. +// All objects returned here must be treated as read-only. +type ExternalAuditStorageLister interface { + // List lists all ExternalAuditStorages in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalAuditStorage, err error) + // Get retrieves the ExternalAuditStorage from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalAuditStorage, error) + ExternalAuditStorageListerExpansion +} + +// externalAuditStorageLister implements the ExternalAuditStorageLister interface. +type externalAuditStorageLister struct { + indexer cache.Indexer +} + +// NewExternalAuditStorageLister returns a new ExternalAuditStorageLister. +func NewExternalAuditStorageLister(indexer cache.Indexer) ExternalAuditStorageLister { + return &externalAuditStorageLister{indexer: indexer} +} + +// List lists all ExternalAuditStorages in the indexer. +func (s *externalAuditStorageLister) List(selector labels.Selector) (ret []*v1.ExternalAuditStorage, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalAuditStorage)) + }) + return ret, err +} + +// Get retrieves the ExternalAuditStorage from the index for a given name. +func (s *externalAuditStorageLister) Get(name string) (*v1.ExternalAuditStorage, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externalauditstorage"), name) + } + return obj.(*v1.ExternalAuditStorage), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsconfign.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsconfign.go new file mode 100644 index 000000000..48a0d93a5 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsconfign.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalDNSConfigNLister helps list ExternalDNSConfigNs. +// All objects returned here must be treated as read-only. +type ExternalDNSConfigNLister interface { + // List lists all ExternalDNSConfigNs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalDNSConfigN, err error) + // Get retrieves the ExternalDNSConfigN from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalDNSConfigN, error) + ExternalDNSConfigNListerExpansion +} + +// externalDNSConfigNLister implements the ExternalDNSConfigNLister interface. +type externalDNSConfigNLister struct { + indexer cache.Indexer +} + +// NewExternalDNSConfigNLister returns a new ExternalDNSConfigNLister. +func NewExternalDNSConfigNLister(indexer cache.Indexer) ExternalDNSConfigNLister { + return &externalDNSConfigNLister{indexer: indexer} +} + +// List lists all ExternalDNSConfigNs in the indexer. +func (s *externalDNSConfigNLister) List(selector labels.Selector) (ret []*v1.ExternalDNSConfigN, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalDNSConfigN)) + }) + return ret, err +} + +// Get retrieves the ExternalDNSConfigN from the index for a given name. +func (s *externalDNSConfigNLister) Get(name string) (*v1.ExternalDNSConfigN, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externaldnsconfign"), name) + } + return obj.(*v1.ExternalDNSConfigN), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsinventory.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsinventory.go new file mode 100644 index 000000000..457ff5ec9 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsinventory.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalDNSInventoryLister helps list ExternalDNSInventories. +// All objects returned here must be treated as read-only. +type ExternalDNSInventoryLister interface { + // List lists all ExternalDNSInventories in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalDNSInventory, err error) + // Get retrieves the ExternalDNSInventory from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalDNSInventory, error) + ExternalDNSInventoryListerExpansion +} + +// externalDNSInventoryLister implements the ExternalDNSInventoryLister interface. +type externalDNSInventoryLister struct { + indexer cache.Indexer +} + +// NewExternalDNSInventoryLister returns a new ExternalDNSInventoryLister. +func NewExternalDNSInventoryLister(indexer cache.Indexer) ExternalDNSInventoryLister { + return &externalDNSInventoryLister{indexer: indexer} +} + +// List lists all ExternalDNSInventories in the indexer. +func (s *externalDNSInventoryLister) List(selector labels.Selector) (ret []*v1.ExternalDNSInventory, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalDNSInventory)) + }) + return ret, err +} + +// Get retrieves the ExternalDNSInventory from the index for a given name. +func (s *externalDNSInventoryLister) Get(name string) (*v1.ExternalDNSInventory, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externaldnsinventory"), name) + } + return obj.(*v1.ExternalDNSInventory), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryhealthcheck.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryhealthcheck.go new file mode 100644 index 000000000..56d3f5435 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryhealthcheck.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalDNSInventoryHealthCheckLister helps list ExternalDNSInventoryHealthChecks. +// All objects returned here must be treated as read-only. +type ExternalDNSInventoryHealthCheckLister interface { + // List lists all ExternalDNSInventoryHealthChecks in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalDNSInventoryHealthCheck, err error) + // Get retrieves the ExternalDNSInventoryHealthCheck from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalDNSInventoryHealthCheck, error) + ExternalDNSInventoryHealthCheckListerExpansion +} + +// externalDNSInventoryHealthCheckLister implements the ExternalDNSInventoryHealthCheckLister interface. +type externalDNSInventoryHealthCheckLister struct { + indexer cache.Indexer +} + +// NewExternalDNSInventoryHealthCheckLister returns a new ExternalDNSInventoryHealthCheckLister. +func NewExternalDNSInventoryHealthCheckLister(indexer cache.Indexer) ExternalDNSInventoryHealthCheckLister { + return &externalDNSInventoryHealthCheckLister{indexer: indexer} +} + +// List lists all ExternalDNSInventoryHealthChecks in the indexer. +func (s *externalDNSInventoryHealthCheckLister) List(selector labels.Selector) (ret []*v1.ExternalDNSInventoryHealthCheck, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalDNSInventoryHealthCheck)) + }) + return ret, err +} + +// Get retrieves the ExternalDNSInventoryHealthCheck from the index for a given name. +func (s *externalDNSInventoryHealthCheckLister) Get(name string) (*v1.ExternalDNSInventoryHealthCheck, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externaldnsinventoryhealthcheck"), name) + } + return obj.(*v1.ExternalDNSInventoryHealthCheck), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryprimarydomain.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryprimarydomain.go new file mode 100644 index 000000000..ed1b76b0a --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryprimarydomain.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalDNSInventoryPrimaryDomainLister helps list ExternalDNSInventoryPrimaryDomains. +// All objects returned here must be treated as read-only. +type ExternalDNSInventoryPrimaryDomainLister interface { + // List lists all ExternalDNSInventoryPrimaryDomains in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalDNSInventoryPrimaryDomain, err error) + // Get retrieves the ExternalDNSInventoryPrimaryDomain from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalDNSInventoryPrimaryDomain, error) + ExternalDNSInventoryPrimaryDomainListerExpansion +} + +// externalDNSInventoryPrimaryDomainLister implements the ExternalDNSInventoryPrimaryDomainLister interface. +type externalDNSInventoryPrimaryDomainLister struct { + indexer cache.Indexer +} + +// NewExternalDNSInventoryPrimaryDomainLister returns a new ExternalDNSInventoryPrimaryDomainLister. +func NewExternalDNSInventoryPrimaryDomainLister(indexer cache.Indexer) ExternalDNSInventoryPrimaryDomainLister { + return &externalDNSInventoryPrimaryDomainLister{indexer: indexer} +} + +// List lists all ExternalDNSInventoryPrimaryDomains in the indexer. +func (s *externalDNSInventoryPrimaryDomainLister) List(selector labels.Selector) (ret []*v1.ExternalDNSInventoryPrimaryDomain, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalDNSInventoryPrimaryDomain)) + }) + return ret, err +} + +// Get retrieves the ExternalDNSInventoryPrimaryDomain from the index for a given name. +func (s *externalDNSInventoryPrimaryDomainLister) Get(name string) (*v1.ExternalDNSInventoryPrimaryDomain, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externaldnsinventoryprimarydomain"), name) + } + return obj.(*v1.ExternalDNSInventoryPrimaryDomain), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryrecord.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryrecord.go new file mode 100644 index 000000000..f5a2285c6 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryrecord.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalDNSInventoryRecordLister helps list ExternalDNSInventoryRecords. +// All objects returned here must be treated as read-only. +type ExternalDNSInventoryRecordLister interface { + // List lists all ExternalDNSInventoryRecords in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalDNSInventoryRecord, err error) + // Get retrieves the ExternalDNSInventoryRecord from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalDNSInventoryRecord, error) + ExternalDNSInventoryRecordListerExpansion +} + +// externalDNSInventoryRecordLister implements the ExternalDNSInventoryRecordLister interface. +type externalDNSInventoryRecordLister struct { + indexer cache.Indexer +} + +// NewExternalDNSInventoryRecordLister returns a new ExternalDNSInventoryRecordLister. +func NewExternalDNSInventoryRecordLister(indexer cache.Indexer) ExternalDNSInventoryRecordLister { + return &externalDNSInventoryRecordLister{indexer: indexer} +} + +// List lists all ExternalDNSInventoryRecords in the indexer. +func (s *externalDNSInventoryRecordLister) List(selector labels.Selector) (ret []*v1.ExternalDNSInventoryRecord, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalDNSInventoryRecord)) + }) + return ret, err +} + +// Get retrieves the ExternalDNSInventoryRecord from the index for a given name. +func (s *externalDNSInventoryRecordLister) Get(name string) (*v1.ExternalDNSInventoryRecord, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externaldnsinventoryrecord"), name) + } + return obj.(*v1.ExternalDNSInventoryRecord), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryzone.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryzone.go new file mode 100644 index 000000000..b4babc282 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsinventoryzone.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalDNSInventoryZoneLister helps list ExternalDNSInventoryZones. +// All objects returned here must be treated as read-only. +type ExternalDNSInventoryZoneLister interface { + // List lists all ExternalDNSInventoryZones in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalDNSInventoryZone, err error) + // Get retrieves the ExternalDNSInventoryZone from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalDNSInventoryZone, error) + ExternalDNSInventoryZoneListerExpansion +} + +// externalDNSInventoryZoneLister implements the ExternalDNSInventoryZoneLister interface. +type externalDNSInventoryZoneLister struct { + indexer cache.Indexer +} + +// NewExternalDNSInventoryZoneLister returns a new ExternalDNSInventoryZoneLister. +func NewExternalDNSInventoryZoneLister(indexer cache.Indexer) ExternalDNSInventoryZoneLister { + return &externalDNSInventoryZoneLister{indexer: indexer} +} + +// List lists all ExternalDNSInventoryZones in the indexer. +func (s *externalDNSInventoryZoneLister) List(selector labels.Selector) (ret []*v1.ExternalDNSInventoryZone, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalDNSInventoryZone)) + }) + return ret, err +} + +// Get retrieves the ExternalDNSInventoryZone from the index for a given name. +func (s *externalDNSInventoryZoneLister) Get(name string) (*v1.ExternalDNSInventoryZone, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externaldnsinventoryzone"), name) + } + return obj.(*v1.ExternalDNSInventoryZone), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsruntime.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsruntime.go new file mode 100644 index 000000000..5b5ec87c5 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsruntime.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalDNSRuntimeLister helps list ExternalDNSRuntimes. +// All objects returned here must be treated as read-only. +type ExternalDNSRuntimeLister interface { + // List lists all ExternalDNSRuntimes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalDNSRuntime, err error) + // Get retrieves the ExternalDNSRuntime from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalDNSRuntime, error) + ExternalDNSRuntimeListerExpansion +} + +// externalDNSRuntimeLister implements the ExternalDNSRuntimeLister interface. +type externalDNSRuntimeLister struct { + indexer cache.Indexer +} + +// NewExternalDNSRuntimeLister returns a new ExternalDNSRuntimeLister. +func NewExternalDNSRuntimeLister(indexer cache.Indexer) ExternalDNSRuntimeLister { + return &externalDNSRuntimeLister{indexer: indexer} +} + +// List lists all ExternalDNSRuntimes in the indexer. +func (s *externalDNSRuntimeLister) List(selector labels.Selector) (ret []*v1.ExternalDNSRuntime, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalDNSRuntime)) + }) + return ret, err +} + +// Get retrieves the ExternalDNSRuntime from the index for a given name. +func (s *externalDNSRuntimeLister) Get(name string) (*v1.ExternalDNSRuntime, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externaldnsruntime"), name) + } + return obj.(*v1.ExternalDNSRuntime), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeendpoint.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeendpoint.go new file mode 100644 index 000000000..248b0e3f5 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeendpoint.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalDNSRuntimeEndpointLister helps list ExternalDNSRuntimeEndpoints. +// All objects returned here must be treated as read-only. +type ExternalDNSRuntimeEndpointLister interface { + // List lists all ExternalDNSRuntimeEndpoints in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalDNSRuntimeEndpoint, err error) + // Get retrieves the ExternalDNSRuntimeEndpoint from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalDNSRuntimeEndpoint, error) + ExternalDNSRuntimeEndpointListerExpansion +} + +// externalDNSRuntimeEndpointLister implements the ExternalDNSRuntimeEndpointLister interface. +type externalDNSRuntimeEndpointLister struct { + indexer cache.Indexer +} + +// NewExternalDNSRuntimeEndpointLister returns a new ExternalDNSRuntimeEndpointLister. +func NewExternalDNSRuntimeEndpointLister(indexer cache.Indexer) ExternalDNSRuntimeEndpointLister { + return &externalDNSRuntimeEndpointLister{indexer: indexer} +} + +// List lists all ExternalDNSRuntimeEndpoints in the indexer. +func (s *externalDNSRuntimeEndpointLister) List(selector labels.Selector) (ret []*v1.ExternalDNSRuntimeEndpoint, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalDNSRuntimeEndpoint)) + }) + return ret, err +} + +// Get retrieves the ExternalDNSRuntimeEndpoint from the index for a given name. +func (s *externalDNSRuntimeEndpointLister) Get(name string) (*v1.ExternalDNSRuntimeEndpoint, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externaldnsruntimeendpoint"), name) + } + return obj.(*v1.ExternalDNSRuntimeEndpoint), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeprimarydomain.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeprimarydomain.go new file mode 100644 index 000000000..e0d51e02c --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsruntimeprimarydomain.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalDNSRuntimePrimaryDomainLister helps list ExternalDNSRuntimePrimaryDomains. +// All objects returned here must be treated as read-only. +type ExternalDNSRuntimePrimaryDomainLister interface { + // List lists all ExternalDNSRuntimePrimaryDomains in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalDNSRuntimePrimaryDomain, err error) + // Get retrieves the ExternalDNSRuntimePrimaryDomain from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalDNSRuntimePrimaryDomain, error) + ExternalDNSRuntimePrimaryDomainListerExpansion +} + +// externalDNSRuntimePrimaryDomainLister implements the ExternalDNSRuntimePrimaryDomainLister interface. +type externalDNSRuntimePrimaryDomainLister struct { + indexer cache.Indexer +} + +// NewExternalDNSRuntimePrimaryDomainLister returns a new ExternalDNSRuntimePrimaryDomainLister. +func NewExternalDNSRuntimePrimaryDomainLister(indexer cache.Indexer) ExternalDNSRuntimePrimaryDomainLister { + return &externalDNSRuntimePrimaryDomainLister{indexer: indexer} +} + +// List lists all ExternalDNSRuntimePrimaryDomains in the indexer. +func (s *externalDNSRuntimePrimaryDomainLister) List(selector labels.Selector) (ret []*v1.ExternalDNSRuntimePrimaryDomain, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalDNSRuntimePrimaryDomain)) + }) + return ret, err +} + +// Get retrieves the ExternalDNSRuntimePrimaryDomain from the index for a given name. +func (s *externalDNSRuntimePrimaryDomainLister) Get(name string) (*v1.ExternalDNSRuntimePrimaryDomain, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externaldnsruntimeprimarydomain"), name) + } + return obj.(*v1.ExternalDNSRuntimePrimaryDomain), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsruntimesubdomain.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsruntimesubdomain.go new file mode 100644 index 000000000..b131fa68e --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externaldnsruntimesubdomain.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalDNSRuntimeSubdomainLister helps list ExternalDNSRuntimeSubdomains. +// All objects returned here must be treated as read-only. +type ExternalDNSRuntimeSubdomainLister interface { + // List lists all ExternalDNSRuntimeSubdomains in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalDNSRuntimeSubdomain, err error) + // Get retrieves the ExternalDNSRuntimeSubdomain from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalDNSRuntimeSubdomain, error) + ExternalDNSRuntimeSubdomainListerExpansion +} + +// externalDNSRuntimeSubdomainLister implements the ExternalDNSRuntimeSubdomainLister interface. +type externalDNSRuntimeSubdomainLister struct { + indexer cache.Indexer +} + +// NewExternalDNSRuntimeSubdomainLister returns a new ExternalDNSRuntimeSubdomainLister. +func NewExternalDNSRuntimeSubdomainLister(indexer cache.Indexer) ExternalDNSRuntimeSubdomainLister { + return &externalDNSRuntimeSubdomainLister{indexer: indexer} +} + +// List lists all ExternalDNSRuntimeSubdomains in the indexer. +func (s *externalDNSRuntimeSubdomainLister) List(selector labels.Selector) (ret []*v1.ExternalDNSRuntimeSubdomain, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalDNSRuntimeSubdomain)) + }) + return ret, err +} + +// Get retrieves the ExternalDNSRuntimeSubdomain from the index for a given name. +func (s *externalDNSRuntimeSubdomainLister) Get(name string) (*v1.ExternalDNSRuntimeSubdomain, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externaldnsruntimesubdomain"), name) + } + return obj.(*v1.ExternalDNSRuntimeSubdomain), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externallbconfign.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externallbconfign.go new file mode 100644 index 000000000..0835d7d1c --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externallbconfign.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalLBConfigNLister helps list ExternalLBConfigNs. +// All objects returned here must be treated as read-only. +type ExternalLBConfigNLister interface { + // List lists all ExternalLBConfigNs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalLBConfigN, err error) + // Get retrieves the ExternalLBConfigN from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalLBConfigN, error) + ExternalLBConfigNListerExpansion +} + +// externalLBConfigNLister implements the ExternalLBConfigNLister interface. +type externalLBConfigNLister struct { + indexer cache.Indexer +} + +// NewExternalLBConfigNLister returns a new ExternalLBConfigNLister. +func NewExternalLBConfigNLister(indexer cache.Indexer) ExternalLBConfigNLister { + return &externalLBConfigNLister{indexer: indexer} +} + +// List lists all ExternalLBConfigNs in the indexer. +func (s *externalLBConfigNLister) List(selector labels.Selector) (ret []*v1.ExternalLBConfigN, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalLBConfigN)) + }) + return ret, err +} + +// Get retrieves the ExternalLBConfigN from the index for a given name. +func (s *externalLBConfigNLister) Get(name string) (*v1.ExternalLBConfigN, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externallbconfign"), name) + } + return obj.(*v1.ExternalLBConfigN), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalplugincapability.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalplugincapability.go new file mode 100644 index 000000000..fdde9710b --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalplugincapability.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalPluginCapabilityLister helps list ExternalPluginCapabilities. +// All objects returned here must be treated as read-only. +type ExternalPluginCapabilityLister interface { + // List lists all ExternalPluginCapabilities in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalPluginCapability, err error) + // Get retrieves the ExternalPluginCapability from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalPluginCapability, error) + ExternalPluginCapabilityListerExpansion +} + +// externalPluginCapabilityLister implements the ExternalPluginCapabilityLister interface. +type externalPluginCapabilityLister struct { + indexer cache.Indexer +} + +// NewExternalPluginCapabilityLister returns a new ExternalPluginCapabilityLister. +func NewExternalPluginCapabilityLister(indexer cache.Indexer) ExternalPluginCapabilityLister { + return &externalPluginCapabilityLister{indexer: indexer} +} + +// List lists all ExternalPluginCapabilities in the indexer. +func (s *externalPluginCapabilityLister) List(selector labels.Selector) (ret []*v1.ExternalPluginCapability, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalPluginCapability)) + }) + return ret, err +} + +// Get retrieves the ExternalPluginCapability from the index for a given name. +func (s *externalPluginCapabilityLister) Get(name string) (*v1.ExternalPluginCapability, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externalplugincapability"), name) + } + return obj.(*v1.ExternalPluginCapability), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalpluginconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalpluginconfig.go new file mode 100644 index 000000000..88c1daf7b --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalpluginconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalPluginConfigLister helps list ExternalPluginConfigs. +// All objects returned here must be treated as read-only. +type ExternalPluginConfigLister interface { + // List lists all ExternalPluginConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalPluginConfig, err error) + // Get retrieves the ExternalPluginConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalPluginConfig, error) + ExternalPluginConfigListerExpansion +} + +// externalPluginConfigLister implements the ExternalPluginConfigLister interface. +type externalPluginConfigLister struct { + indexer cache.Indexer +} + +// NewExternalPluginConfigLister returns a new ExternalPluginConfigLister. +func NewExternalPluginConfigLister(indexer cache.Indexer) ExternalPluginConfigLister { + return &externalPluginConfigLister{indexer: indexer} +} + +// List lists all ExternalPluginConfigs in the indexer. +func (s *externalPluginConfigLister) List(selector labels.Selector) (ret []*v1.ExternalPluginConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalPluginConfig)) + }) + return ret, err +} + +// Get retrieves the ExternalPluginConfig from the index for a given name. +func (s *externalPluginConfigLister) Get(name string) (*v1.ExternalPluginConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externalpluginconfig"), name) + } + return obj.(*v1.ExternalPluginConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalpluginconfigfolder.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalpluginconfigfolder.go new file mode 100644 index 000000000..2abef02c1 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalpluginconfigfolder.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalPluginConfigFolderLister helps list ExternalPluginConfigFolders. +// All objects returned here must be treated as read-only. +type ExternalPluginConfigFolderLister interface { + // List lists all ExternalPluginConfigFolders in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalPluginConfigFolder, err error) + // Get retrieves the ExternalPluginConfigFolder from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalPluginConfigFolder, error) + ExternalPluginConfigFolderListerExpansion +} + +// externalPluginConfigFolderLister implements the ExternalPluginConfigFolderLister interface. +type externalPluginConfigFolderLister struct { + indexer cache.Indexer +} + +// NewExternalPluginConfigFolderLister returns a new ExternalPluginConfigFolderLister. +func NewExternalPluginConfigFolderLister(indexer cache.Indexer) ExternalPluginConfigFolderLister { + return &externalPluginConfigFolderLister{indexer: indexer} +} + +// List lists all ExternalPluginConfigFolders in the indexer. +func (s *externalPluginConfigFolderLister) List(selector labels.Selector) (ret []*v1.ExternalPluginConfigFolder, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalPluginConfigFolder)) + }) + return ret, err +} + +// Get retrieves the ExternalPluginConfigFolder from the index for a given name. +func (s *externalPluginConfigFolderLister) Get(name string) (*v1.ExternalPluginConfigFolder, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externalpluginconfigfolder"), name) + } + return obj.(*v1.ExternalPluginConfigFolder), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalplugininstanceconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalplugininstanceconfig.go new file mode 100644 index 000000000..28f948fe2 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalplugininstanceconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalPluginInstanceConfigLister helps list ExternalPluginInstanceConfigs. +// All objects returned here must be treated as read-only. +type ExternalPluginInstanceConfigLister interface { + // List lists all ExternalPluginInstanceConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalPluginInstanceConfig, err error) + // Get retrieves the ExternalPluginInstanceConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalPluginInstanceConfig, error) + ExternalPluginInstanceConfigListerExpansion +} + +// externalPluginInstanceConfigLister implements the ExternalPluginInstanceConfigLister interface. +type externalPluginInstanceConfigLister struct { + indexer cache.Indexer +} + +// NewExternalPluginInstanceConfigLister returns a new ExternalPluginInstanceConfigLister. +func NewExternalPluginInstanceConfigLister(indexer cache.Indexer) ExternalPluginInstanceConfigLister { + return &externalPluginInstanceConfigLister{indexer: indexer} +} + +// List lists all ExternalPluginInstanceConfigs in the indexer. +func (s *externalPluginInstanceConfigLister) List(selector labels.Selector) (ret []*v1.ExternalPluginInstanceConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalPluginInstanceConfig)) + }) + return ret, err +} + +// Get retrieves the ExternalPluginInstanceConfig from the index for a given name. +func (s *externalPluginInstanceConfigLister) Get(name string) (*v1.ExternalPluginInstanceConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externalplugininstanceconfig"), name) + } + return obj.(*v1.ExternalPluginInstanceConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalpluginmonitor.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalpluginmonitor.go new file mode 100644 index 000000000..b5a99fe87 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalpluginmonitor.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalPluginMonitorLister helps list ExternalPluginMonitors. +// All objects returned here must be treated as read-only. +type ExternalPluginMonitorLister interface { + // List lists all ExternalPluginMonitors in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalPluginMonitor, err error) + // Get retrieves the ExternalPluginMonitor from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalPluginMonitor, error) + ExternalPluginMonitorListerExpansion +} + +// externalPluginMonitorLister implements the ExternalPluginMonitorLister interface. +type externalPluginMonitorLister struct { + indexer cache.Indexer +} + +// NewExternalPluginMonitorLister returns a new ExternalPluginMonitorLister. +func NewExternalPluginMonitorLister(indexer cache.Indexer) ExternalPluginMonitorLister { + return &externalPluginMonitorLister{indexer: indexer} +} + +// List lists all ExternalPluginMonitors in the indexer. +func (s *externalPluginMonitorLister) List(selector labels.Selector) (ret []*v1.ExternalPluginMonitor, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalPluginMonitor)) + }) + return ret, err +} + +// Get retrieves the ExternalPluginMonitor from the index for a given name. +func (s *externalPluginMonitorLister) Get(name string) (*v1.ExternalPluginMonitor, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externalpluginmonitor"), name) + } + return obj.(*v1.ExternalPluginMonitor), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalserviceconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalserviceconfig.go new file mode 100644 index 000000000..0a81cb613 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalserviceconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalServiceConfigLister helps list ExternalServiceConfigs. +// All objects returned here must be treated as read-only. +type ExternalServiceConfigLister interface { + // List lists all ExternalServiceConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalServiceConfig, err error) + // Get retrieves the ExternalServiceConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalServiceConfig, error) + ExternalServiceConfigListerExpansion +} + +// externalServiceConfigLister implements the ExternalServiceConfigLister interface. +type externalServiceConfigLister struct { + indexer cache.Indexer +} + +// NewExternalServiceConfigLister returns a new ExternalServiceConfigLister. +func NewExternalServiceConfigLister(indexer cache.Indexer) ExternalServiceConfigLister { + return &externalServiceConfigLister{indexer: indexer} +} + +// List lists all ExternalServiceConfigs in the indexer. +func (s *externalServiceConfigLister) List(selector labels.Selector) (ret []*v1.ExternalServiceConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalServiceConfig)) + }) + return ret, err +} + +// Get retrieves the ExternalServiceConfig from the index for a given name. +func (s *externalServiceConfigLister) Get(name string) (*v1.ExternalServiceConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externalserviceconfig"), name) + } + return obj.(*v1.ExternalServiceConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalservicesrt.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalservicesrt.go new file mode 100644 index 000000000..eb3d1c4ae --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/externalservicesrt.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ExternalServicesRTLister helps list ExternalServicesRTs. +// All objects returned here must be treated as read-only. +type ExternalServicesRTLister interface { + // List lists all ExternalServicesRTs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExternalServicesRT, err error) + // Get retrieves the ExternalServicesRT from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExternalServicesRT, error) + ExternalServicesRTListerExpansion +} + +// externalServicesRTLister implements the ExternalServicesRTLister interface. +type externalServicesRTLister struct { + indexer cache.Indexer +} + +// NewExternalServicesRTLister returns a new ExternalServicesRTLister. +func NewExternalServicesRTLister(indexer cache.Indexer) ExternalServicesRTLister { + return &externalServicesRTLister{indexer: indexer} +} + +// List lists all ExternalServicesRTs in the indexer. +func (s *externalServicesRTLister) List(selector labels.Selector) (ret []*v1.ExternalServicesRT, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExternalServicesRT)) + }) + return ret, err +} + +// Get retrieves the ExternalServicesRT from the index for a given name. +func (s *externalServicesRTLister) Get(name string) (*v1.ExternalServicesRT, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("externalservicesrt"), name) + } + return obj.(*v1.ExternalServicesRT), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/featureflag.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/featureflag.go new file mode 100644 index 000000000..4728f8219 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/featureflag.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// FeatureFlagLister helps list FeatureFlags. +// All objects returned here must be treated as read-only. +type FeatureFlagLister interface { + // List lists all FeatureFlags in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.FeatureFlag, err error) + // Get retrieves the FeatureFlag from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.FeatureFlag, error) + FeatureFlagListerExpansion +} + +// featureFlagLister implements the FeatureFlagLister interface. +type featureFlagLister struct { + indexer cache.Indexer +} + +// NewFeatureFlagLister returns a new FeatureFlagLister. +func NewFeatureFlagLister(indexer cache.Indexer) FeatureFlagLister { + return &featureFlagLister{indexer: indexer} +} + +// List lists all FeatureFlags in the indexer. +func (s *featureFlagLister) List(selector labels.Selector) (ret []*v1.FeatureFlag, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.FeatureFlag)) + }) + return ret, err +} + +// Get retrieves the FeatureFlag from the index for a given name. +func (s *featureFlagLister) Get(name string) (*v1.FeatureFlag, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("featureflag"), name) + } + return obj.(*v1.FeatureFlag), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/federatedsloconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/federatedsloconfig.go new file mode 100644 index 000000000..96e5a4bc1 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/federatedsloconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// FederatedSloConfigLister helps list FederatedSloConfigs. +// All objects returned here must be treated as read-only. +type FederatedSloConfigLister interface { + // List lists all FederatedSloConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.FederatedSloConfig, err error) + // Get retrieves the FederatedSloConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.FederatedSloConfig, error) + FederatedSloConfigListerExpansion +} + +// federatedSloConfigLister implements the FederatedSloConfigLister interface. +type federatedSloConfigLister struct { + indexer cache.Indexer +} + +// NewFederatedSloConfigLister returns a new FederatedSloConfigLister. +func NewFederatedSloConfigLister(indexer cache.Indexer) FederatedSloConfigLister { + return &federatedSloConfigLister{indexer: indexer} +} + +// List lists all FederatedSloConfigs in the indexer. +func (s *federatedSloConfigLister) List(selector labels.Selector) (ret []*v1.FederatedSloConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.FederatedSloConfig)) + }) + return ret, err +} + +// Get retrieves the FederatedSloConfig from the index for a given name. +func (s *federatedSloConfigLister) Get(name string) (*v1.FederatedSloConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("federatedsloconfig"), name) + } + return obj.(*v1.FederatedSloConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/federatedsloserviceconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/federatedsloserviceconfig.go new file mode 100644 index 000000000..8f2457003 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/federatedsloserviceconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// FederatedSloServiceConfigLister helps list FederatedSloServiceConfigs. +// All objects returned here must be treated as read-only. +type FederatedSloServiceConfigLister interface { + // List lists all FederatedSloServiceConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.FederatedSloServiceConfig, err error) + // Get retrieves the FederatedSloServiceConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.FederatedSloServiceConfig, error) + FederatedSloServiceConfigListerExpansion +} + +// federatedSloServiceConfigLister implements the FederatedSloServiceConfigLister interface. +type federatedSloServiceConfigLister struct { + indexer cache.Indexer +} + +// NewFederatedSloServiceConfigLister returns a new FederatedSloServiceConfigLister. +func NewFederatedSloServiceConfigLister(indexer cache.Indexer) FederatedSloServiceConfigLister { + return &federatedSloServiceConfigLister{indexer: indexer} +} + +// List lists all FederatedSloServiceConfigs in the indexer. +func (s *federatedSloServiceConfigLister) List(selector labels.Selector) (ret []*v1.FederatedSloServiceConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.FederatedSloServiceConfig)) + }) + return ret, err +} + +// Get retrieves the FederatedSloServiceConfig from the index for a given name. +func (s *federatedSloServiceConfigLister) Get(name string) (*v1.FederatedSloServiceConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("federatedsloserviceconfig"), name) + } + return obj.(*v1.FederatedSloServiceConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gateway.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gateway.go new file mode 100644 index 000000000..cfa7bed64 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gateway.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GatewayLister helps list Gateways. +// All objects returned here must be treated as read-only. +type GatewayLister interface { + // List lists all Gateways in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Gateway, err error) + // Get retrieves the Gateway from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Gateway, error) + GatewayListerExpansion +} + +// gatewayLister implements the GatewayLister interface. +type gatewayLister struct { + indexer cache.Indexer +} + +// NewGatewayLister returns a new GatewayLister. +func NewGatewayLister(indexer cache.Indexer) GatewayLister { + return &gatewayLister{indexer: indexer} +} + +// List lists all Gateways in the indexer. +func (s *gatewayLister) List(selector labels.Selector) (ret []*v1.Gateway, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Gateway)) + }) + return ret, err +} + +// Get retrieves the Gateway from the index for a given name. +func (s *gatewayLister) Get(name string) (*v1.Gateway, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gateway"), name) + } + return obj.(*v1.Gateway), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gatewayconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gatewayconfig.go new file mode 100644 index 000000000..e63a5a3e2 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gatewayconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GatewayConfigLister helps list GatewayConfigs. +// All objects returned here must be treated as read-only. +type GatewayConfigLister interface { + // List lists all GatewayConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GatewayConfig, err error) + // Get retrieves the GatewayConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GatewayConfig, error) + GatewayConfigListerExpansion +} + +// gatewayConfigLister implements the GatewayConfigLister interface. +type gatewayConfigLister struct { + indexer cache.Indexer +} + +// NewGatewayConfigLister returns a new GatewayConfigLister. +func NewGatewayConfigLister(indexer cache.Indexer) GatewayConfigLister { + return &gatewayConfigLister{indexer: indexer} +} + +// List lists all GatewayConfigs in the indexer. +func (s *gatewayConfigLister) List(selector labels.Selector) (ret []*v1.GatewayConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GatewayConfig)) + }) + return ret, err +} + +// Get retrieves the GatewayConfig from the index for a given name. +func (s *gatewayConfigLister) Get(name string) (*v1.GatewayConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gatewayconfig"), name) + } + return obj.(*v1.GatewayConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gatewayconfigadditionallisteners.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gatewayconfigadditionallisteners.go new file mode 100644 index 000000000..59259d8e2 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gatewayconfigadditionallisteners.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GatewayConfigAdditionalListenersLister helps list GatewayConfigAdditionalListenerses. +// All objects returned here must be treated as read-only. +type GatewayConfigAdditionalListenersLister interface { + // List lists all GatewayConfigAdditionalListenerses in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GatewayConfigAdditionalListeners, err error) + // Get retrieves the GatewayConfigAdditionalListeners from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GatewayConfigAdditionalListeners, error) + GatewayConfigAdditionalListenersListerExpansion +} + +// gatewayConfigAdditionalListenersLister implements the GatewayConfigAdditionalListenersLister interface. +type gatewayConfigAdditionalListenersLister struct { + indexer cache.Indexer +} + +// NewGatewayConfigAdditionalListenersLister returns a new GatewayConfigAdditionalListenersLister. +func NewGatewayConfigAdditionalListenersLister(indexer cache.Indexer) GatewayConfigAdditionalListenersLister { + return &gatewayConfigAdditionalListenersLister{indexer: indexer} +} + +// List lists all GatewayConfigAdditionalListenerses in the indexer. +func (s *gatewayConfigAdditionalListenersLister) List(selector labels.Selector) (ret []*v1.GatewayConfigAdditionalListeners, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GatewayConfigAdditionalListeners)) + }) + return ret, err +} + +// Get retrieves the GatewayConfigAdditionalListeners from the index for a given name. +func (s *gatewayConfigAdditionalListenersLister) Get(name string) (*v1.GatewayConfigAdditionalListeners, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gatewayconfigadditionallisteners"), name) + } + return obj.(*v1.GatewayConfigAdditionalListeners), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenercertificate.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenercertificate.go new file mode 100644 index 000000000..812c70c4e --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenercertificate.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GatewayConfigListenerCertificateLister helps list GatewayConfigListenerCertificates. +// All objects returned here must be treated as read-only. +type GatewayConfigListenerCertificateLister interface { + // List lists all GatewayConfigListenerCertificates in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GatewayConfigListenerCertificate, err error) + // Get retrieves the GatewayConfigListenerCertificate from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GatewayConfigListenerCertificate, error) + GatewayConfigListenerCertificateListerExpansion +} + +// gatewayConfigListenerCertificateLister implements the GatewayConfigListenerCertificateLister interface. +type gatewayConfigListenerCertificateLister struct { + indexer cache.Indexer +} + +// NewGatewayConfigListenerCertificateLister returns a new GatewayConfigListenerCertificateLister. +func NewGatewayConfigListenerCertificateLister(indexer cache.Indexer) GatewayConfigListenerCertificateLister { + return &gatewayConfigListenerCertificateLister{indexer: indexer} +} + +// List lists all GatewayConfigListenerCertificates in the indexer. +func (s *gatewayConfigListenerCertificateLister) List(selector labels.Selector) (ret []*v1.GatewayConfigListenerCertificate, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GatewayConfigListenerCertificate)) + }) + return ret, err +} + +// Get retrieves the GatewayConfigListenerCertificate from the index for a given name. +func (s *gatewayConfigListenerCertificateLister) Get(name string) (*v1.GatewayConfigListenerCertificate, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gatewayconfiglistenercertificate"), name) + } + return obj.(*v1.GatewayConfigListenerCertificate), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenerdestinationroute.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenerdestinationroute.go new file mode 100644 index 000000000..e62bc49ee --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gatewayconfiglistenerdestinationroute.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GatewayConfigListenerDestinationRouteLister helps list GatewayConfigListenerDestinationRoutes. +// All objects returned here must be treated as read-only. +type GatewayConfigListenerDestinationRouteLister interface { + // List lists all GatewayConfigListenerDestinationRoutes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GatewayConfigListenerDestinationRoute, err error) + // Get retrieves the GatewayConfigListenerDestinationRoute from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GatewayConfigListenerDestinationRoute, error) + GatewayConfigListenerDestinationRouteListerExpansion +} + +// gatewayConfigListenerDestinationRouteLister implements the GatewayConfigListenerDestinationRouteLister interface. +type gatewayConfigListenerDestinationRouteLister struct { + indexer cache.Indexer +} + +// NewGatewayConfigListenerDestinationRouteLister returns a new GatewayConfigListenerDestinationRouteLister. +func NewGatewayConfigListenerDestinationRouteLister(indexer cache.Indexer) GatewayConfigListenerDestinationRouteLister { + return &gatewayConfigListenerDestinationRouteLister{indexer: indexer} +} + +// List lists all GatewayConfigListenerDestinationRoutes in the indexer. +func (s *gatewayConfigListenerDestinationRouteLister) List(selector labels.Selector) (ret []*v1.GatewayConfigListenerDestinationRoute, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GatewayConfigListenerDestinationRoute)) + }) + return ret, err +} + +// Get retrieves the GatewayConfigListenerDestinationRoute from the index for a given name. +func (s *gatewayConfigListenerDestinationRouteLister) Get(name string) (*v1.GatewayConfigListenerDestinationRoute, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gatewayconfiglistenerdestinationroute"), name) + } + return obj.(*v1.GatewayConfigListenerDestinationRoute), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/geodiscovery.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/geodiscovery.go new file mode 100644 index 000000000..6183671c5 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/geodiscovery.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GeoDiscoveryLister helps list GeoDiscoveries. +// All objects returned here must be treated as read-only. +type GeoDiscoveryLister interface { + // List lists all GeoDiscoveries in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GeoDiscovery, err error) + // Get retrieves the GeoDiscovery from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GeoDiscovery, error) + GeoDiscoveryListerExpansion +} + +// geoDiscoveryLister implements the GeoDiscoveryLister interface. +type geoDiscoveryLister struct { + indexer cache.Indexer +} + +// NewGeoDiscoveryLister returns a new GeoDiscoveryLister. +func NewGeoDiscoveryLister(indexer cache.Indexer) GeoDiscoveryLister { + return &geoDiscoveryLister{indexer: indexer} +} + +// List lists all GeoDiscoveries in the indexer. +func (s *geoDiscoveryLister) List(selector labels.Selector) (ret []*v1.GeoDiscovery, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GeoDiscovery)) + }) + return ret, err +} + +// Get retrieves the GeoDiscovery from the index for a given name. +func (s *geoDiscoveryLister) Get(name string) (*v1.GeoDiscovery, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("geodiscovery"), name) + } + return obj.(*v1.GeoDiscovery), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/geodiscoveryrt.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/geodiscoveryrt.go new file mode 100644 index 000000000..923def085 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/geodiscoveryrt.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GeoDiscoveryRTLister helps list GeoDiscoveryRTs. +// All objects returned here must be treated as read-only. +type GeoDiscoveryRTLister interface { + // List lists all GeoDiscoveryRTs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GeoDiscoveryRT, err error) + // Get retrieves the GeoDiscoveryRT from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GeoDiscoveryRT, error) + GeoDiscoveryRTListerExpansion +} + +// geoDiscoveryRTLister implements the GeoDiscoveryRTLister interface. +type geoDiscoveryRTLister struct { + indexer cache.Indexer +} + +// NewGeoDiscoveryRTLister returns a new GeoDiscoveryRTLister. +func NewGeoDiscoveryRTLister(indexer cache.Indexer) GeoDiscoveryRTLister { + return &geoDiscoveryRTLister{indexer: indexer} +} + +// List lists all GeoDiscoveryRTs in the indexer. +func (s *geoDiscoveryRTLister) List(selector labels.Selector) (ret []*v1.GeoDiscoveryRT, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GeoDiscoveryRT)) + }) + return ret, err +} + +// Get retrieves the GeoDiscoveryRT from the index for a given name. +func (s *geoDiscoveryRTLister) Get(name string) (*v1.GeoDiscoveryRT, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("geodiscoveryrt"), name) + } + return obj.(*v1.GeoDiscoveryRT), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/globalnamespace.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/globalnamespace.go new file mode 100644 index 000000000..4d0ca36f0 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/globalnamespace.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GlobalNamespaceLister helps list GlobalNamespaces. +// All objects returned here must be treated as read-only. +type GlobalNamespaceLister interface { + // List lists all GlobalNamespaces in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GlobalNamespace, err error) + // Get retrieves the GlobalNamespace from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GlobalNamespace, error) + GlobalNamespaceListerExpansion +} + +// globalNamespaceLister implements the GlobalNamespaceLister interface. +type globalNamespaceLister struct { + indexer cache.Indexer +} + +// NewGlobalNamespaceLister returns a new GlobalNamespaceLister. +func NewGlobalNamespaceLister(indexer cache.Indexer) GlobalNamespaceLister { + return &globalNamespaceLister{indexer: indexer} +} + +// List lists all GlobalNamespaces in the indexer. +func (s *globalNamespaceLister) List(selector labels.Selector) (ret []*v1.GlobalNamespace, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GlobalNamespace)) + }) + return ret, err +} + +// Get retrieves the GlobalNamespace from the index for a given name. +func (s *globalNamespaceLister) Get(name string) (*v1.GlobalNamespace, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("globalnamespace"), name) + } + return obj.(*v1.GlobalNamespace), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/globalns.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/globalns.go new file mode 100644 index 000000000..7ffdda1d7 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/globalns.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GlobalNsLister helps list GlobalNses. +// All objects returned here must be treated as read-only. +type GlobalNsLister interface { + // List lists all GlobalNses in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GlobalNs, err error) + // Get retrieves the GlobalNs from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GlobalNs, error) + GlobalNsListerExpansion +} + +// globalNsLister implements the GlobalNsLister interface. +type globalNsLister struct { + indexer cache.Indexer +} + +// NewGlobalNsLister returns a new GlobalNsLister. +func NewGlobalNsLister(indexer cache.Indexer) GlobalNsLister { + return &globalNsLister{indexer: indexer} +} + +// List lists all GlobalNses in the indexer. +func (s *globalNsLister) List(selector labels.Selector) (ret []*v1.GlobalNs, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GlobalNs)) + }) + return ret, err +} + +// Get retrieves the GlobalNs from the index for a given name. +func (s *globalNsLister) Get(name string) (*v1.GlobalNs, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("globalns"), name) + } + return obj.(*v1.GlobalNs), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/globalregistrationservice.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/globalregistrationservice.go new file mode 100644 index 000000000..1dcbc2176 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/globalregistrationservice.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GlobalRegistrationServiceLister helps list GlobalRegistrationServices. +// All objects returned here must be treated as read-only. +type GlobalRegistrationServiceLister interface { + // List lists all GlobalRegistrationServices in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GlobalRegistrationService, err error) + // Get retrieves the GlobalRegistrationService from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GlobalRegistrationService, error) + GlobalRegistrationServiceListerExpansion +} + +// globalRegistrationServiceLister implements the GlobalRegistrationServiceLister interface. +type globalRegistrationServiceLister struct { + indexer cache.Indexer +} + +// NewGlobalRegistrationServiceLister returns a new GlobalRegistrationServiceLister. +func NewGlobalRegistrationServiceLister(indexer cache.Indexer) GlobalRegistrationServiceLister { + return &globalRegistrationServiceLister{indexer: indexer} +} + +// List lists all GlobalRegistrationServices in the indexer. +func (s *globalRegistrationServiceLister) List(selector labels.Selector) (ret []*v1.GlobalRegistrationService, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GlobalRegistrationService)) + }) + return ret, err +} + +// Get retrieves the GlobalRegistrationService from the index for a given name. +func (s *globalRegistrationServiceLister) Get(name string) (*v1.GlobalRegistrationService, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("globalregistrationservice"), name) + } + return obj.(*v1.GlobalRegistrationService), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gns.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gns.go new file mode 100644 index 000000000..68b39521d --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gns.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GNSLister helps list GNSs. +// All objects returned here must be treated as read-only. +type GNSLister interface { + // List lists all GNSs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GNS, err error) + // Get retrieves the GNS from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GNS, error) + GNSListerExpansion +} + +// gNSLister implements the GNSLister interface. +type gNSLister struct { + indexer cache.Indexer +} + +// NewGNSLister returns a new GNSLister. +func NewGNSLister(indexer cache.Indexer) GNSLister { + return &gNSLister{indexer: indexer} +} + +// List lists all GNSs in the indexer. +func (s *gNSLister) List(selector labels.Selector) (ret []*v1.GNS, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GNS)) + }) + return ret, err +} + +// Get retrieves the GNS from the index for a given name. +func (s *gNSLister) Get(name string) (*v1.GNS, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gns"), name) + } + return obj.(*v1.GNS), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicy.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicy.go new file mode 100644 index 000000000..6e7da041c --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicy.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GnsAccessControlPolicyLister helps list GnsAccessControlPolicies. +// All objects returned here must be treated as read-only. +type GnsAccessControlPolicyLister interface { + // List lists all GnsAccessControlPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GnsAccessControlPolicy, err error) + // Get retrieves the GnsAccessControlPolicy from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GnsAccessControlPolicy, error) + GnsAccessControlPolicyListerExpansion +} + +// gnsAccessControlPolicyLister implements the GnsAccessControlPolicyLister interface. +type gnsAccessControlPolicyLister struct { + indexer cache.Indexer +} + +// NewGnsAccessControlPolicyLister returns a new GnsAccessControlPolicyLister. +func NewGnsAccessControlPolicyLister(indexer cache.Indexer) GnsAccessControlPolicyLister { + return &gnsAccessControlPolicyLister{indexer: indexer} +} + +// List lists all GnsAccessControlPolicies in the indexer. +func (s *gnsAccessControlPolicyLister) List(selector labels.Selector) (ret []*v1.GnsAccessControlPolicy, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GnsAccessControlPolicy)) + }) + return ret, err +} + +// Get retrieves the GnsAccessControlPolicy from the index for a given name. +func (s *gnsAccessControlPolicyLister) Get(name string) (*v1.GnsAccessControlPolicy, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gnsaccesscontrolpolicy"), name) + } + return obj.(*v1.GnsAccessControlPolicy), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicyrt.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicyrt.go new file mode 100644 index 000000000..12d4210eb --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsaccesscontrolpolicyrt.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GnsAccessControlPolicyRTLister helps list GnsAccessControlPolicyRTs. +// All objects returned here must be treated as read-only. +type GnsAccessControlPolicyRTLister interface { + // List lists all GnsAccessControlPolicyRTs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GnsAccessControlPolicyRT, err error) + // Get retrieves the GnsAccessControlPolicyRT from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GnsAccessControlPolicyRT, error) + GnsAccessControlPolicyRTListerExpansion +} + +// gnsAccessControlPolicyRTLister implements the GnsAccessControlPolicyRTLister interface. +type gnsAccessControlPolicyRTLister struct { + indexer cache.Indexer +} + +// NewGnsAccessControlPolicyRTLister returns a new GnsAccessControlPolicyRTLister. +func NewGnsAccessControlPolicyRTLister(indexer cache.Indexer) GnsAccessControlPolicyRTLister { + return &gnsAccessControlPolicyRTLister{indexer: indexer} +} + +// List lists all GnsAccessControlPolicyRTs in the indexer. +func (s *gnsAccessControlPolicyRTLister) List(selector labels.Selector) (ret []*v1.GnsAccessControlPolicyRT, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GnsAccessControlPolicyRT)) + }) + return ret, err +} + +// Get retrieves the GnsAccessControlPolicyRT from the index for a given name. +func (s *gnsAccessControlPolicyRTLister) Get(name string) (*v1.GnsAccessControlPolicyRT, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gnsaccesscontrolpolicyrt"), name) + } + return obj.(*v1.GnsAccessControlPolicyRT), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsbindingrt.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsbindingrt.go new file mode 100644 index 000000000..2ca8b0141 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsbindingrt.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GnsBindingRTLister helps list GnsBindingRTs. +// All objects returned here must be treated as read-only. +type GnsBindingRTLister interface { + // List lists all GnsBindingRTs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GnsBindingRT, err error) + // Get retrieves the GnsBindingRT from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GnsBindingRT, error) + GnsBindingRTListerExpansion +} + +// gnsBindingRTLister implements the GnsBindingRTLister interface. +type gnsBindingRTLister struct { + indexer cache.Indexer +} + +// NewGnsBindingRTLister returns a new GnsBindingRTLister. +func NewGnsBindingRTLister(indexer cache.Indexer) GnsBindingRTLister { + return &gnsBindingRTLister{indexer: indexer} +} + +// List lists all GnsBindingRTs in the indexer. +func (s *gnsBindingRTLister) List(selector labels.Selector) (ret []*v1.GnsBindingRT, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GnsBindingRT)) + }) + return ret, err +} + +// Get retrieves the GnsBindingRT from the index for a given name. +func (s *gnsBindingRTLister) Get(name string) (*v1.GnsBindingRT, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gnsbindingrt"), name) + } + return obj.(*v1.GnsBindingRT), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsendpointsconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsendpointsconfig.go new file mode 100644 index 000000000..ab7b70910 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsendpointsconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GnsEndpointsConfigLister helps list GnsEndpointsConfigs. +// All objects returned here must be treated as read-only. +type GnsEndpointsConfigLister interface { + // List lists all GnsEndpointsConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GnsEndpointsConfig, err error) + // Get retrieves the GnsEndpointsConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GnsEndpointsConfig, error) + GnsEndpointsConfigListerExpansion +} + +// gnsEndpointsConfigLister implements the GnsEndpointsConfigLister interface. +type gnsEndpointsConfigLister struct { + indexer cache.Indexer +} + +// NewGnsEndpointsConfigLister returns a new GnsEndpointsConfigLister. +func NewGnsEndpointsConfigLister(indexer cache.Indexer) GnsEndpointsConfigLister { + return &gnsEndpointsConfigLister{indexer: indexer} +} + +// List lists all GnsEndpointsConfigs in the indexer. +func (s *gnsEndpointsConfigLister) List(selector labels.Selector) (ret []*v1.GnsEndpointsConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GnsEndpointsConfig)) + }) + return ret, err +} + +// Get retrieves the GnsEndpointsConfig from the index for a given name. +func (s *gnsEndpointsConfigLister) Get(name string) (*v1.GnsEndpointsConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gnsendpointsconfig"), name) + } + return obj.(*v1.GnsEndpointsConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsroutingconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsroutingconfig.go new file mode 100644 index 000000000..07a69835c --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsroutingconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GNSRoutingConfigLister helps list GNSRoutingConfigs. +// All objects returned here must be treated as read-only. +type GNSRoutingConfigLister interface { + // List lists all GNSRoutingConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GNSRoutingConfig, err error) + // Get retrieves the GNSRoutingConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GNSRoutingConfig, error) + GNSRoutingConfigListerExpansion +} + +// gNSRoutingConfigLister implements the GNSRoutingConfigLister interface. +type gNSRoutingConfigLister struct { + indexer cache.Indexer +} + +// NewGNSRoutingConfigLister returns a new GNSRoutingConfigLister. +func NewGNSRoutingConfigLister(indexer cache.Indexer) GNSRoutingConfigLister { + return &gNSRoutingConfigLister{indexer: indexer} +} + +// List lists all GNSRoutingConfigs in the indexer. +func (s *gNSRoutingConfigLister) List(selector labels.Selector) (ret []*v1.GNSRoutingConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GNSRoutingConfig)) + }) + return ret, err +} + +// Get retrieves the GNSRoutingConfig from the index for a given name. +func (s *gNSRoutingConfigLister) Get(name string) (*v1.GNSRoutingConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gnsroutingconfig"), name) + } + return obj.(*v1.GNSRoutingConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsroutingruleconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsroutingruleconfig.go new file mode 100644 index 000000000..43cc2a81f --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsroutingruleconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GnsRoutingRuleConfigLister helps list GnsRoutingRuleConfigs. +// All objects returned here must be treated as read-only. +type GnsRoutingRuleConfigLister interface { + // List lists all GnsRoutingRuleConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GnsRoutingRuleConfig, err error) + // Get retrieves the GnsRoutingRuleConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GnsRoutingRuleConfig, error) + GnsRoutingRuleConfigListerExpansion +} + +// gnsRoutingRuleConfigLister implements the GnsRoutingRuleConfigLister interface. +type gnsRoutingRuleConfigLister struct { + indexer cache.Indexer +} + +// NewGnsRoutingRuleConfigLister returns a new GnsRoutingRuleConfigLister. +func NewGnsRoutingRuleConfigLister(indexer cache.Indexer) GnsRoutingRuleConfigLister { + return &gnsRoutingRuleConfigLister{indexer: indexer} +} + +// List lists all GnsRoutingRuleConfigs in the indexer. +func (s *gnsRoutingRuleConfigLister) List(selector labels.Selector) (ret []*v1.GnsRoutingRuleConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GnsRoutingRuleConfig)) + }) + return ret, err +} + +// Get retrieves the GnsRoutingRuleConfig from the index for a given name. +func (s *gnsRoutingRuleConfigLister) Get(name string) (*v1.GnsRoutingRuleConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gnsroutingruleconfig"), name) + } + return obj.(*v1.GnsRoutingRuleConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsschemaviolationdiscovery.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsschemaviolationdiscovery.go new file mode 100644 index 000000000..0c393c7b9 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsschemaviolationdiscovery.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GnsSchemaViolationDiscoveryLister helps list GnsSchemaViolationDiscoveries. +// All objects returned here must be treated as read-only. +type GnsSchemaViolationDiscoveryLister interface { + // List lists all GnsSchemaViolationDiscoveries in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GnsSchemaViolationDiscovery, err error) + // Get retrieves the GnsSchemaViolationDiscovery from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GnsSchemaViolationDiscovery, error) + GnsSchemaViolationDiscoveryListerExpansion +} + +// gnsSchemaViolationDiscoveryLister implements the GnsSchemaViolationDiscoveryLister interface. +type gnsSchemaViolationDiscoveryLister struct { + indexer cache.Indexer +} + +// NewGnsSchemaViolationDiscoveryLister returns a new GnsSchemaViolationDiscoveryLister. +func NewGnsSchemaViolationDiscoveryLister(indexer cache.Indexer) GnsSchemaViolationDiscoveryLister { + return &gnsSchemaViolationDiscoveryLister{indexer: indexer} +} + +// List lists all GnsSchemaViolationDiscoveries in the indexer. +func (s *gnsSchemaViolationDiscoveryLister) List(selector labels.Selector) (ret []*v1.GnsSchemaViolationDiscovery, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GnsSchemaViolationDiscovery)) + }) + return ret, err +} + +// Get retrieves the GnsSchemaViolationDiscovery from the index for a given name. +func (s *gnsSchemaViolationDiscoveryLister) Get(name string) (*v1.GnsSchemaViolationDiscovery, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gnsschemaviolationdiscovery"), name) + } + return obj.(*v1.GnsSchemaViolationDiscovery), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicy.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicy.go new file mode 100644 index 000000000..63908cfe5 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicy.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GnsSegmentationPolicyLister helps list GnsSegmentationPolicies. +// All objects returned here must be treated as read-only. +type GnsSegmentationPolicyLister interface { + // List lists all GnsSegmentationPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GnsSegmentationPolicy, err error) + // Get retrieves the GnsSegmentationPolicy from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GnsSegmentationPolicy, error) + GnsSegmentationPolicyListerExpansion +} + +// gnsSegmentationPolicyLister implements the GnsSegmentationPolicyLister interface. +type gnsSegmentationPolicyLister struct { + indexer cache.Indexer +} + +// NewGnsSegmentationPolicyLister returns a new GnsSegmentationPolicyLister. +func NewGnsSegmentationPolicyLister(indexer cache.Indexer) GnsSegmentationPolicyLister { + return &gnsSegmentationPolicyLister{indexer: indexer} +} + +// List lists all GnsSegmentationPolicies in the indexer. +func (s *gnsSegmentationPolicyLister) List(selector labels.Selector) (ret []*v1.GnsSegmentationPolicy, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GnsSegmentationPolicy)) + }) + return ret, err +} + +// Get retrieves the GnsSegmentationPolicy from the index for a given name. +func (s *gnsSegmentationPolicyLister) Get(name string) (*v1.GnsSegmentationPolicy, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gnssegmentationpolicy"), name) + } + return obj.(*v1.GnsSegmentationPolicy), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicyrt.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicyrt.go new file mode 100644 index 000000000..533f1c2f6 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnssegmentationpolicyrt.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GnsSegmentationPolicyRTLister helps list GnsSegmentationPolicyRTs. +// All objects returned here must be treated as read-only. +type GnsSegmentationPolicyRTLister interface { + // List lists all GnsSegmentationPolicyRTs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GnsSegmentationPolicyRT, err error) + // Get retrieves the GnsSegmentationPolicyRT from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GnsSegmentationPolicyRT, error) + GnsSegmentationPolicyRTListerExpansion +} + +// gnsSegmentationPolicyRTLister implements the GnsSegmentationPolicyRTLister interface. +type gnsSegmentationPolicyRTLister struct { + indexer cache.Indexer +} + +// NewGnsSegmentationPolicyRTLister returns a new GnsSegmentationPolicyRTLister. +func NewGnsSegmentationPolicyRTLister(indexer cache.Indexer) GnsSegmentationPolicyRTLister { + return &gnsSegmentationPolicyRTLister{indexer: indexer} +} + +// List lists all GnsSegmentationPolicyRTs in the indexer. +func (s *gnsSegmentationPolicyRTLister) List(selector labels.Selector) (ret []*v1.GnsSegmentationPolicyRT, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GnsSegmentationPolicyRT)) + }) + return ret, err +} + +// Get retrieves the GnsSegmentationPolicyRT from the index for a given name. +func (s *gnsSegmentationPolicyRTLister) Get(name string) (*v1.GnsSegmentationPolicyRT, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gnssegmentationpolicyrt"), name) + } + return obj.(*v1.GnsSegmentationPolicyRT), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsserviceentryconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsserviceentryconfig.go new file mode 100644 index 000000000..47d7de74e --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnsserviceentryconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GnsServiceEntryConfigLister helps list GnsServiceEntryConfigs. +// All objects returned here must be treated as read-only. +type GnsServiceEntryConfigLister interface { + // List lists all GnsServiceEntryConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GnsServiceEntryConfig, err error) + // Get retrieves the GnsServiceEntryConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GnsServiceEntryConfig, error) + GnsServiceEntryConfigListerExpansion +} + +// gnsServiceEntryConfigLister implements the GnsServiceEntryConfigLister interface. +type gnsServiceEntryConfigLister struct { + indexer cache.Indexer +} + +// NewGnsServiceEntryConfigLister returns a new GnsServiceEntryConfigLister. +func NewGnsServiceEntryConfigLister(indexer cache.Indexer) GnsServiceEntryConfigLister { + return &gnsServiceEntryConfigLister{indexer: indexer} +} + +// List lists all GnsServiceEntryConfigs in the indexer. +func (s *gnsServiceEntryConfigLister) List(selector labels.Selector) (ret []*v1.GnsServiceEntryConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GnsServiceEntryConfig)) + }) + return ret, err +} + +// Get retrieves the GnsServiceEntryConfig from the index for a given name. +func (s *gnsServiceEntryConfigLister) Get(name string) (*v1.GnsServiceEntryConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gnsserviceentryconfig"), name) + } + return obj.(*v1.GnsServiceEntryConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnssvcgroup.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnssvcgroup.go new file mode 100644 index 000000000..ae6952805 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnssvcgroup.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GNSSvcGroupLister helps list GNSSvcGroups. +// All objects returned here must be treated as read-only. +type GNSSvcGroupLister interface { + // List lists all GNSSvcGroups in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GNSSvcGroup, err error) + // Get retrieves the GNSSvcGroup from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GNSSvcGroup, error) + GNSSvcGroupListerExpansion +} + +// gNSSvcGroupLister implements the GNSSvcGroupLister interface. +type gNSSvcGroupLister struct { + indexer cache.Indexer +} + +// NewGNSSvcGroupLister returns a new GNSSvcGroupLister. +func NewGNSSvcGroupLister(indexer cache.Indexer) GNSSvcGroupLister { + return &gNSSvcGroupLister{indexer: indexer} +} + +// List lists all GNSSvcGroups in the indexer. +func (s *gNSSvcGroupLister) List(selector labels.Selector) (ret []*v1.GNSSvcGroup, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GNSSvcGroup)) + }) + return ret, err +} + +// Get retrieves the GNSSvcGroup from the index for a given name. +func (s *gNSSvcGroupLister) Get(name string) (*v1.GNSSvcGroup, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gnssvcgroup"), name) + } + return obj.(*v1.GNSSvcGroup), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnssvcgrouprt.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnssvcgrouprt.go new file mode 100644 index 000000000..01df90e0d --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/gnssvcgrouprt.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GnsSvcGroupRTLister helps list GnsSvcGroupRTs. +// All objects returned here must be treated as read-only. +type GnsSvcGroupRTLister interface { + // List lists all GnsSvcGroupRTs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GnsSvcGroupRT, err error) + // Get retrieves the GnsSvcGroupRT from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GnsSvcGroupRT, error) + GnsSvcGroupRTListerExpansion +} + +// gnsSvcGroupRTLister implements the GnsSvcGroupRTLister interface. +type gnsSvcGroupRTLister struct { + indexer cache.Indexer +} + +// NewGnsSvcGroupRTLister returns a new GnsSvcGroupRTLister. +func NewGnsSvcGroupRTLister(indexer cache.Indexer) GnsSvcGroupRTLister { + return &gnsSvcGroupRTLister{indexer: indexer} +} + +// List lists all GnsSvcGroupRTs in the indexer. +func (s *gnsSvcGroupRTLister) List(selector labels.Selector) (ret []*v1.GnsSvcGroupRT, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GnsSvcGroupRT)) + }) + return ret, err +} + +// Get retrieves the GnsSvcGroupRT from the index for a given name. +func (s *gnsSvcGroupRTLister) Get(name string) (*v1.GnsSvcGroupRT, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gnssvcgrouprt"), name) + } + return obj.(*v1.GnsSvcGroupRT), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/haconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/haconfig.go new file mode 100644 index 000000000..ea87b799b --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/haconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// HaConfigLister helps list HaConfigs. +// All objects returned here must be treated as read-only. +type HaConfigLister interface { + // List lists all HaConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.HaConfig, err error) + // Get retrieves the HaConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.HaConfig, error) + HaConfigListerExpansion +} + +// haConfigLister implements the HaConfigLister interface. +type haConfigLister struct { + indexer cache.Indexer +} + +// NewHaConfigLister returns a new HaConfigLister. +func NewHaConfigLister(indexer cache.Indexer) HaConfigLister { + return &haConfigLister{indexer: indexer} +} + +// List lists all HaConfigs in the indexer. +func (s *haConfigLister) List(selector labels.Selector) (ret []*v1.HaConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.HaConfig)) + }) + return ret, err +} + +// Get retrieves the HaConfig from the index for a given name. +func (s *haConfigLister) Get(name string) (*v1.HaConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("haconfig"), name) + } + return obj.(*v1.HaConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/haconfigv2.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/haconfigv2.go new file mode 100644 index 000000000..17084e10c --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/haconfigv2.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// HaConfigV2Lister helps list HaConfigV2s. +// All objects returned here must be treated as read-only. +type HaConfigV2Lister interface { + // List lists all HaConfigV2s in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.HaConfigV2, err error) + // Get retrieves the HaConfigV2 from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.HaConfigV2, error) + HaConfigV2ListerExpansion +} + +// haConfigV2Lister implements the HaConfigV2Lister interface. +type haConfigV2Lister struct { + indexer cache.Indexer +} + +// NewHaConfigV2Lister returns a new HaConfigV2Lister. +func NewHaConfigV2Lister(indexer cache.Indexer) HaConfigV2Lister { + return &haConfigV2Lister{indexer: indexer} +} + +// List lists all HaConfigV2s in the indexer. +func (s *haConfigV2Lister) List(selector labels.Selector) (ret []*v1.HaConfigV2, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.HaConfigV2)) + }) + return ret, err +} + +// Get retrieves the HaConfigV2 from the index for a given name. +func (s *haConfigV2Lister) Get(name string) (*v1.HaConfigV2, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("haconfigv2"), name) + } + return obj.(*v1.HaConfigV2), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/healthcheckconfign.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/healthcheckconfign.go new file mode 100644 index 000000000..035a618ba --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/healthcheckconfign.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// HealthCheckConfigNLister helps list HealthCheckConfigNs. +// All objects returned here must be treated as read-only. +type HealthCheckConfigNLister interface { + // List lists all HealthCheckConfigNs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.HealthCheckConfigN, err error) + // Get retrieves the HealthCheckConfigN from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.HealthCheckConfigN, error) + HealthCheckConfigNListerExpansion +} + +// healthCheckConfigNLister implements the HealthCheckConfigNLister interface. +type healthCheckConfigNLister struct { + indexer cache.Indexer +} + +// NewHealthCheckConfigNLister returns a new HealthCheckConfigNLister. +func NewHealthCheckConfigNLister(indexer cache.Indexer) HealthCheckConfigNLister { + return &healthCheckConfigNLister{indexer: indexer} +} + +// List lists all HealthCheckConfigNs in the indexer. +func (s *healthCheckConfigNLister) List(selector labels.Selector) (ret []*v1.HealthCheckConfigN, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.HealthCheckConfigN)) + }) + return ret, err +} + +// Get retrieves the HealthCheckConfigN from the index for a given name. +func (s *healthCheckConfigNLister) Get(name string) (*v1.HealthCheckConfigN, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("healthcheckconfign"), name) + } + return obj.(*v1.HealthCheckConfigN), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/hostconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/hostconfig.go new file mode 100644 index 000000000..4b82edccc --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/hostconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// HostConfigLister helps list HostConfigs. +// All objects returned here must be treated as read-only. +type HostConfigLister interface { + // List lists all HostConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.HostConfig, err error) + // Get retrieves the HostConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.HostConfig, error) + HostConfigListerExpansion +} + +// hostConfigLister implements the HostConfigLister interface. +type hostConfigLister struct { + indexer cache.Indexer +} + +// NewHostConfigLister returns a new HostConfigLister. +func NewHostConfigLister(indexer cache.Indexer) HostConfigLister { + return &hostConfigLister{indexer: indexer} +} + +// List lists all HostConfigs in the indexer. +func (s *hostConfigLister) List(selector labels.Selector) (ret []*v1.HostConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.HostConfig)) + }) + return ret, err +} + +// Get retrieves the HostConfig from the index for a given name. +func (s *hostConfigLister) Get(name string) (*v1.HostConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("hostconfig"), name) + } + return obj.(*v1.HostConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/hostconfigv2.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/hostconfigv2.go new file mode 100644 index 000000000..546bcc951 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/hostconfigv2.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// HostConfigV2Lister helps list HostConfigV2s. +// All objects returned here must be treated as read-only. +type HostConfigV2Lister interface { + // List lists all HostConfigV2s in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.HostConfigV2, err error) + // Get retrieves the HostConfigV2 from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.HostConfigV2, error) + HostConfigV2ListerExpansion +} + +// hostConfigV2Lister implements the HostConfigV2Lister interface. +type hostConfigV2Lister struct { + indexer cache.Indexer +} + +// NewHostConfigV2Lister returns a new HostConfigV2Lister. +func NewHostConfigV2Lister(indexer cache.Indexer) HostConfigV2Lister { + return &hostConfigV2Lister{indexer: indexer} +} + +// List lists all HostConfigV2s in the indexer. +func (s *hostConfigV2Lister) List(selector labels.Selector) (ret []*v1.HostConfigV2, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.HostConfigV2)) + }) + return ret, err +} + +// Get retrieves the HostConfigV2 from the index for a given name. +func (s *hostConfigV2Lister) Get(name string) (*v1.HostConfigV2, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("hostconfigv2"), name) + } + return obj.(*v1.HostConfigV2), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/inboundauthenticationconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/inboundauthenticationconfig.go new file mode 100644 index 000000000..e63135dc7 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/inboundauthenticationconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// InboundAuthenticationConfigLister helps list InboundAuthenticationConfigs. +// All objects returned here must be treated as read-only. +type InboundAuthenticationConfigLister interface { + // List lists all InboundAuthenticationConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.InboundAuthenticationConfig, err error) + // Get retrieves the InboundAuthenticationConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.InboundAuthenticationConfig, error) + InboundAuthenticationConfigListerExpansion +} + +// inboundAuthenticationConfigLister implements the InboundAuthenticationConfigLister interface. +type inboundAuthenticationConfigLister struct { + indexer cache.Indexer +} + +// NewInboundAuthenticationConfigLister returns a new InboundAuthenticationConfigLister. +func NewInboundAuthenticationConfigLister(indexer cache.Indexer) InboundAuthenticationConfigLister { + return &inboundAuthenticationConfigLister{indexer: indexer} +} + +// List lists all InboundAuthenticationConfigs in the indexer. +func (s *inboundAuthenticationConfigLister) List(selector labels.Selector) (ret []*v1.InboundAuthenticationConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.InboundAuthenticationConfig)) + }) + return ret, err +} + +// Get retrieves the InboundAuthenticationConfig from the index for a given name. +func (s *inboundAuthenticationConfigLister) Get(name string) (*v1.InboundAuthenticationConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("inboundauthenticationconfig"), name) + } + return obj.(*v1.InboundAuthenticationConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/inventory.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/inventory.go new file mode 100644 index 000000000..8b1debf31 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/inventory.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// InventoryLister helps list Inventories. +// All objects returned here must be treated as read-only. +type InventoryLister interface { + // List lists all Inventories in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Inventory, err error) + // Get retrieves the Inventory from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Inventory, error) + InventoryListerExpansion +} + +// inventoryLister implements the InventoryLister interface. +type inventoryLister struct { + indexer cache.Indexer +} + +// NewInventoryLister returns a new InventoryLister. +func NewInventoryLister(indexer cache.Indexer) InventoryLister { + return &inventoryLister{indexer: indexer} +} + +// List lists all Inventories in the indexer. +func (s *inventoryLister) List(selector labels.Selector) (ret []*v1.Inventory, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Inventory)) + }) + return ret, err +} + +// Get retrieves the Inventory from the index for a given name. +func (s *inventoryLister) Get(name string) (*v1.Inventory, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("inventory"), name) + } + return obj.(*v1.Inventory), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/issuer.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/issuer.go new file mode 100644 index 000000000..c32342605 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/issuer.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// IssuerLister helps list Issuers. +// All objects returned here must be treated as read-only. +type IssuerLister interface { + // List lists all Issuers in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Issuer, err error) + // Get retrieves the Issuer from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Issuer, error) + IssuerListerExpansion +} + +// issuerLister implements the IssuerLister interface. +type issuerLister struct { + indexer cache.Indexer +} + +// NewIssuerLister returns a new IssuerLister. +func NewIssuerLister(indexer cache.Indexer) IssuerLister { + return &issuerLister{indexer: indexer} +} + +// List lists all Issuers in the indexer. +func (s *issuerLister) List(selector labels.Selector) (ret []*v1.Issuer, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Issuer)) + }) + return ret, err +} + +// Get retrieves the Issuer from the index for a given name. +func (s *issuerLister) Get(name string) (*v1.Issuer, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("issuer"), name) + } + return obj.(*v1.Issuer), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/job.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/job.go new file mode 100644 index 000000000..1bc15aef5 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/job.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// JobLister helps list Jobs. +// All objects returned here must be treated as read-only. +type JobLister interface { + // List lists all Jobs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Job, err error) + // Get retrieves the Job from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Job, error) + JobListerExpansion +} + +// jobLister implements the JobLister interface. +type jobLister struct { + indexer cache.Indexer +} + +// NewJobLister returns a new JobLister. +func NewJobLister(indexer cache.Indexer) JobLister { + return &jobLister{indexer: indexer} +} + +// List lists all Jobs in the indexer. +func (s *jobLister) List(selector labels.Selector) (ret []*v1.Job, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Job)) + }) + return ret, err +} + +// Get retrieves the Job from the index for a given name. +func (s *jobLister) Get(name string) (*v1.Job, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("job"), name) + } + return obj.(*v1.Job), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/jobconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/jobconfig.go new file mode 100644 index 000000000..3adfc5d53 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/jobconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// JobConfigLister helps list JobConfigs. +// All objects returned here must be treated as read-only. +type JobConfigLister interface { + // List lists all JobConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.JobConfig, err error) + // Get retrieves the JobConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.JobConfig, error) + JobConfigListerExpansion +} + +// jobConfigLister implements the JobConfigLister interface. +type jobConfigLister struct { + indexer cache.Indexer +} + +// NewJobConfigLister returns a new JobConfigLister. +func NewJobConfigLister(indexer cache.Indexer) JobConfigLister { + return &jobConfigLister{indexer: indexer} +} + +// List lists all JobConfigs in the indexer. +func (s *jobConfigLister) List(selector labels.Selector) (ret []*v1.JobConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.JobConfig)) + }) + return ret, err +} + +// Get retrieves the JobConfig from the index for a given name. +func (s *jobConfigLister) Get(name string) (*v1.JobConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("jobconfig"), name) + } + return obj.(*v1.JobConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/jobconfigfolder.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/jobconfigfolder.go new file mode 100644 index 000000000..765d872d5 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/jobconfigfolder.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// JobConfigFolderLister helps list JobConfigFolders. +// All objects returned here must be treated as read-only. +type JobConfigFolderLister interface { + // List lists all JobConfigFolders in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.JobConfigFolder, err error) + // Get retrieves the JobConfigFolder from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.JobConfigFolder, error) + JobConfigFolderListerExpansion +} + +// jobConfigFolderLister implements the JobConfigFolderLister interface. +type jobConfigFolderLister struct { + indexer cache.Indexer +} + +// NewJobConfigFolderLister returns a new JobConfigFolderLister. +func NewJobConfigFolderLister(indexer cache.Indexer) JobConfigFolderLister { + return &jobConfigFolderLister{indexer: indexer} +} + +// List lists all JobConfigFolders in the indexer. +func (s *jobConfigFolderLister) List(selector labels.Selector) (ret []*v1.JobConfigFolder, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.JobConfigFolder)) + }) + return ret, err +} + +// Get retrieves the JobConfigFolder from the index for a given name. +func (s *jobConfigFolderLister) Get(name string) (*v1.JobConfigFolder, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("jobconfigfolder"), name) + } + return obj.(*v1.JobConfigFolder), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/jobfolder.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/jobfolder.go new file mode 100644 index 000000000..8c8016b6a --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/jobfolder.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// JobFolderLister helps list JobFolders. +// All objects returned here must be treated as read-only. +type JobFolderLister interface { + // List lists all JobFolders in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.JobFolder, err error) + // Get retrieves the JobFolder from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.JobFolder, error) + JobFolderListerExpansion +} + +// jobFolderLister implements the JobFolderLister interface. +type jobFolderLister struct { + indexer cache.Indexer +} + +// NewJobFolderLister returns a new JobFolderLister. +func NewJobFolderLister(indexer cache.Indexer) JobFolderLister { + return &jobFolderLister{indexer: indexer} +} + +// List lists all JobFolders in the indexer. +func (s *jobFolderLister) List(selector labels.Selector) (ret []*v1.JobFolder, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.JobFolder)) + }) + return ret, err +} + +// Get retrieves the JobFolder from the index for a given name. +func (s *jobFolderLister) Get(name string) (*v1.JobFolder, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("jobfolder"), name) + } + return obj.(*v1.JobFolder), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/knativeingress.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/knativeingress.go new file mode 100644 index 000000000..a0ad87dde --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/knativeingress.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// KnativeIngressLister helps list KnativeIngresses. +// All objects returned here must be treated as read-only. +type KnativeIngressLister interface { + // List lists all KnativeIngresses in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.KnativeIngress, err error) + // Get retrieves the KnativeIngress from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.KnativeIngress, error) + KnativeIngressListerExpansion +} + +// knativeIngressLister implements the KnativeIngressLister interface. +type knativeIngressLister struct { + indexer cache.Indexer +} + +// NewKnativeIngressLister returns a new KnativeIngressLister. +func NewKnativeIngressLister(indexer cache.Indexer) KnativeIngressLister { + return &knativeIngressLister{indexer: indexer} +} + +// List lists all KnativeIngresses in the indexer. +func (s *knativeIngressLister) List(selector labels.Selector) (ret []*v1.KnativeIngress, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.KnativeIngress)) + }) + return ret, err +} + +// Get retrieves the KnativeIngress from the index for a given name. +func (s *knativeIngressLister) Get(name string) (*v1.KnativeIngress, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("knativeingress"), name) + } + return obj.(*v1.KnativeIngress), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/labelconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/labelconfig.go new file mode 100644 index 000000000..147bdf85f --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/labelconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// LabelConfigLister helps list LabelConfigs. +// All objects returned here must be treated as read-only. +type LabelConfigLister interface { + // List lists all LabelConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.LabelConfig, err error) + // Get retrieves the LabelConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.LabelConfig, error) + LabelConfigListerExpansion +} + +// labelConfigLister implements the LabelConfigLister interface. +type labelConfigLister struct { + indexer cache.Indexer +} + +// NewLabelConfigLister returns a new LabelConfigLister. +func NewLabelConfigLister(indexer cache.Indexer) LabelConfigLister { + return &labelConfigLister{indexer: indexer} +} + +// List lists all LabelConfigs in the indexer. +func (s *labelConfigLister) List(selector labels.Selector) (ret []*v1.LabelConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.LabelConfig)) + }) + return ret, err +} + +// Get retrieves the LabelConfig from the index for a given name. +func (s *labelConfigLister) Get(name string) (*v1.LabelConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("labelconfig"), name) + } + return obj.(*v1.LabelConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/localregistrationservice.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/localregistrationservice.go new file mode 100644 index 000000000..61ed9c6ee --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/localregistrationservice.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// LocalRegistrationServiceLister helps list LocalRegistrationServices. +// All objects returned here must be treated as read-only. +type LocalRegistrationServiceLister interface { + // List lists all LocalRegistrationServices in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.LocalRegistrationService, err error) + // Get retrieves the LocalRegistrationService from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.LocalRegistrationService, error) + LocalRegistrationServiceListerExpansion +} + +// localRegistrationServiceLister implements the LocalRegistrationServiceLister interface. +type localRegistrationServiceLister struct { + indexer cache.Indexer +} + +// NewLocalRegistrationServiceLister returns a new LocalRegistrationServiceLister. +func NewLocalRegistrationServiceLister(indexer cache.Indexer) LocalRegistrationServiceLister { + return &localRegistrationServiceLister{indexer: indexer} +} + +// List lists all LocalRegistrationServices in the indexer. +func (s *localRegistrationServiceLister) List(selector labels.Selector) (ret []*v1.LocalRegistrationService, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.LocalRegistrationService)) + }) + return ret, err +} + +// Get retrieves the LocalRegistrationService from the index for a given name. +func (s *localRegistrationServiceLister) Get(name string) (*v1.LocalRegistrationService, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("localregistrationservice"), name) + } + return obj.(*v1.LocalRegistrationService), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/localregistrationservicecluster.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/localregistrationservicecluster.go new file mode 100644 index 000000000..aa4a77b35 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/localregistrationservicecluster.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// LocalRegistrationServiceClusterLister helps list LocalRegistrationServiceClusters. +// All objects returned here must be treated as read-only. +type LocalRegistrationServiceClusterLister interface { + // List lists all LocalRegistrationServiceClusters in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.LocalRegistrationServiceCluster, err error) + // Get retrieves the LocalRegistrationServiceCluster from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.LocalRegistrationServiceCluster, error) + LocalRegistrationServiceClusterListerExpansion +} + +// localRegistrationServiceClusterLister implements the LocalRegistrationServiceClusterLister interface. +type localRegistrationServiceClusterLister struct { + indexer cache.Indexer +} + +// NewLocalRegistrationServiceClusterLister returns a new LocalRegistrationServiceClusterLister. +func NewLocalRegistrationServiceClusterLister(indexer cache.Indexer) LocalRegistrationServiceClusterLister { + return &localRegistrationServiceClusterLister{indexer: indexer} +} + +// List lists all LocalRegistrationServiceClusters in the indexer. +func (s *localRegistrationServiceClusterLister) List(selector labels.Selector) (ret []*v1.LocalRegistrationServiceCluster, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.LocalRegistrationServiceCluster)) + }) + return ret, err +} + +// Get retrieves the LocalRegistrationServiceCluster from the index for a given name. +func (s *localRegistrationServiceClusterLister) Get(name string) (*v1.LocalRegistrationServiceCluster, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("localregistrationservicecluster"), name) + } + return obj.(*v1.LocalRegistrationServiceCluster), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/localregistrationserviceresource.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/localregistrationserviceresource.go new file mode 100644 index 000000000..123c76415 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/localregistrationserviceresource.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// LocalRegistrationServiceResourceLister helps list LocalRegistrationServiceResources. +// All objects returned here must be treated as read-only. +type LocalRegistrationServiceResourceLister interface { + // List lists all LocalRegistrationServiceResources in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.LocalRegistrationServiceResource, err error) + // Get retrieves the LocalRegistrationServiceResource from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.LocalRegistrationServiceResource, error) + LocalRegistrationServiceResourceListerExpansion +} + +// localRegistrationServiceResourceLister implements the LocalRegistrationServiceResourceLister interface. +type localRegistrationServiceResourceLister struct { + indexer cache.Indexer +} + +// NewLocalRegistrationServiceResourceLister returns a new LocalRegistrationServiceResourceLister. +func NewLocalRegistrationServiceResourceLister(indexer cache.Indexer) LocalRegistrationServiceResourceLister { + return &localRegistrationServiceResourceLister{indexer: indexer} +} + +// List lists all LocalRegistrationServiceResources in the indexer. +func (s *localRegistrationServiceResourceLister) List(selector labels.Selector) (ret []*v1.LocalRegistrationServiceResource, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.LocalRegistrationServiceResource)) + }) + return ret, err +} + +// Get retrieves the LocalRegistrationServiceResource from the index for a given name. +func (s *localRegistrationServiceResourceLister) Get(name string) (*v1.LocalRegistrationServiceResource, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("localregistrationserviceresource"), name) + } + return obj.(*v1.LocalRegistrationServiceResource), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/log.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/log.go new file mode 100644 index 000000000..ad5c2c374 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/log.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// LogLister helps list Logs. +// All objects returned here must be treated as read-only. +type LogLister interface { + // List lists all Logs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Log, err error) + // Get retrieves the Log from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Log, error) + LogListerExpansion +} + +// logLister implements the LogLister interface. +type logLister struct { + indexer cache.Indexer +} + +// NewLogLister returns a new LogLister. +func NewLogLister(indexer cache.Indexer) LogLister { + return &logLister{indexer: indexer} +} + +// List lists all Logs in the indexer. +func (s *logLister) List(selector labels.Selector) (ret []*v1.Log, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Log)) + }) + return ret, err +} + +// Get retrieves the Log from the index for a given name. +func (s *logLister) Get(name string) (*v1.Log, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("log"), name) + } + return obj.(*v1.Log), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/logfolder.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/logfolder.go new file mode 100644 index 000000000..4412bbaf7 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/logfolder.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// LogFolderLister helps list LogFolders. +// All objects returned here must be treated as read-only. +type LogFolderLister interface { + // List lists all LogFolders in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.LogFolder, err error) + // Get retrieves the LogFolder from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.LogFolder, error) + LogFolderListerExpansion +} + +// logFolderLister implements the LogFolderLister interface. +type logFolderLister struct { + indexer cache.Indexer +} + +// NewLogFolderLister returns a new LogFolderLister. +func NewLogFolderLister(indexer cache.Indexer) LogFolderLister { + return &logFolderLister{indexer: indexer} +} + +// List lists all LogFolders in the indexer. +func (s *logFolderLister) List(selector labels.Selector) (ret []*v1.LogFolder, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.LogFolder)) + }) + return ret, err +} + +// Get retrieves the LogFolder from the index for a given name. +func (s *logFolderLister) Get(name string) (*v1.LogFolder, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("logfolder"), name) + } + return obj.(*v1.LogFolder), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/metricmonitor.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/metricmonitor.go new file mode 100644 index 000000000..70a0e2159 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/metricmonitor.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// MetricMonitorLister helps list MetricMonitors. +// All objects returned here must be treated as read-only. +type MetricMonitorLister interface { + // List lists all MetricMonitors in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.MetricMonitor, err error) + // Get retrieves the MetricMonitor from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.MetricMonitor, error) + MetricMonitorListerExpansion +} + +// metricMonitorLister implements the MetricMonitorLister interface. +type metricMonitorLister struct { + indexer cache.Indexer +} + +// NewMetricMonitorLister returns a new MetricMonitorLister. +func NewMetricMonitorLister(indexer cache.Indexer) MetricMonitorLister { + return &metricMonitorLister{indexer: indexer} +} + +// List lists all MetricMonitors in the indexer. +func (s *metricMonitorLister) List(selector labels.Selector) (ret []*v1.MetricMonitor, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.MetricMonitor)) + }) + return ret, err +} + +// Get retrieves the MetricMonitor from the index for a given name. +func (s *metricMonitorLister) Get(name string) (*v1.MetricMonitor, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("metricmonitor"), name) + } + return obj.(*v1.MetricMonitor), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinition.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinition.go new file mode 100644 index 000000000..d82cf44f2 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinition.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// NetworkAttachmentDefinitionLister helps list NetworkAttachmentDefinitions. +// All objects returned here must be treated as read-only. +type NetworkAttachmentDefinitionLister interface { + // List lists all NetworkAttachmentDefinitions in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.NetworkAttachmentDefinition, err error) + // Get retrieves the NetworkAttachmentDefinition from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.NetworkAttachmentDefinition, error) + NetworkAttachmentDefinitionListerExpansion +} + +// networkAttachmentDefinitionLister implements the NetworkAttachmentDefinitionLister interface. +type networkAttachmentDefinitionLister struct { + indexer cache.Indexer +} + +// NewNetworkAttachmentDefinitionLister returns a new NetworkAttachmentDefinitionLister. +func NewNetworkAttachmentDefinitionLister(indexer cache.Indexer) NetworkAttachmentDefinitionLister { + return &networkAttachmentDefinitionLister{indexer: indexer} +} + +// List lists all NetworkAttachmentDefinitions in the indexer. +func (s *networkAttachmentDefinitionLister) List(selector labels.Selector) (ret []*v1.NetworkAttachmentDefinition, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.NetworkAttachmentDefinition)) + }) + return ret, err +} + +// Get retrieves the NetworkAttachmentDefinition from the index for a given name. +func (s *networkAttachmentDefinitionLister) Get(name string) (*v1.NetworkAttachmentDefinition, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("networkattachmentdefinition"), name) + } + return obj.(*v1.NetworkAttachmentDefinition), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinitionconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinitionconfig.go new file mode 100644 index 000000000..83803193f --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/networkattachmentdefinitionconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// NetworkAttachmentDefinitionConfigLister helps list NetworkAttachmentDefinitionConfigs. +// All objects returned here must be treated as read-only. +type NetworkAttachmentDefinitionConfigLister interface { + // List lists all NetworkAttachmentDefinitionConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.NetworkAttachmentDefinitionConfig, err error) + // Get retrieves the NetworkAttachmentDefinitionConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.NetworkAttachmentDefinitionConfig, error) + NetworkAttachmentDefinitionConfigListerExpansion +} + +// networkAttachmentDefinitionConfigLister implements the NetworkAttachmentDefinitionConfigLister interface. +type networkAttachmentDefinitionConfigLister struct { + indexer cache.Indexer +} + +// NewNetworkAttachmentDefinitionConfigLister returns a new NetworkAttachmentDefinitionConfigLister. +func NewNetworkAttachmentDefinitionConfigLister(indexer cache.Indexer) NetworkAttachmentDefinitionConfigLister { + return &networkAttachmentDefinitionConfigLister{indexer: indexer} +} + +// List lists all NetworkAttachmentDefinitionConfigs in the indexer. +func (s *networkAttachmentDefinitionConfigLister) List(selector labels.Selector) (ret []*v1.NetworkAttachmentDefinitionConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.NetworkAttachmentDefinitionConfig)) + }) + return ret, err +} + +// Get retrieves the NetworkAttachmentDefinitionConfig from the index for a given name. +func (s *networkAttachmentDefinitionConfigLister) Get(name string) (*v1.NetworkAttachmentDefinitionConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("networkattachmentdefinitionconfig"), name) + } + return obj.(*v1.NetworkAttachmentDefinitionConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/node.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/node.go new file mode 100644 index 000000000..b872fce65 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/node.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// NodeLister helps list Nodes. +// All objects returned here must be treated as read-only. +type NodeLister interface { + // List lists all Nodes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Node, err error) + // Get retrieves the Node from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Node, error) + NodeListerExpansion +} + +// nodeLister implements the NodeLister interface. +type nodeLister struct { + indexer cache.Indexer +} + +// NewNodeLister returns a new NodeLister. +func NewNodeLister(indexer cache.Indexer) NodeLister { + return &nodeLister{indexer: indexer} +} + +// List lists all Nodes in the indexer. +func (s *nodeLister) List(selector labels.Selector) (ret []*v1.Node, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Node)) + }) + return ret, err +} + +// Get retrieves the Node from the index for a given name. +func (s *nodeLister) Get(name string) (*v1.Node, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("node"), name) + } + return obj.(*v1.Node), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodedefinition.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodedefinition.go new file mode 100644 index 000000000..53df67bba --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodedefinition.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// NodeDefinitionLister helps list NodeDefinitions. +// All objects returned here must be treated as read-only. +type NodeDefinitionLister interface { + // List lists all NodeDefinitions in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.NodeDefinition, err error) + // Get retrieves the NodeDefinition from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.NodeDefinition, error) + NodeDefinitionListerExpansion +} + +// nodeDefinitionLister implements the NodeDefinitionLister interface. +type nodeDefinitionLister struct { + indexer cache.Indexer +} + +// NewNodeDefinitionLister returns a new NodeDefinitionLister. +func NewNodeDefinitionLister(indexer cache.Indexer) NodeDefinitionLister { + return &nodeDefinitionLister{indexer: indexer} +} + +// List lists all NodeDefinitions in the indexer. +func (s *nodeDefinitionLister) List(selector labels.Selector) (ret []*v1.NodeDefinition, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.NodeDefinition)) + }) + return ret, err +} + +// Get retrieves the NodeDefinition from the index for a given name. +func (s *nodeDefinitionLister) Get(name string) (*v1.NodeDefinition, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("nodedefinition"), name) + } + return obj.(*v1.NodeDefinition), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodefolder.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodefolder.go new file mode 100644 index 000000000..5a7e447aa --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodefolder.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// NodeFolderLister helps list NodeFolders. +// All objects returned here must be treated as read-only. +type NodeFolderLister interface { + // List lists all NodeFolders in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.NodeFolder, err error) + // Get retrieves the NodeFolder from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.NodeFolder, error) + NodeFolderListerExpansion +} + +// nodeFolderLister implements the NodeFolderLister interface. +type nodeFolderLister struct { + indexer cache.Indexer +} + +// NewNodeFolderLister returns a new NodeFolderLister. +func NewNodeFolderLister(indexer cache.Indexer) NodeFolderLister { + return &nodeFolderLister{indexer: indexer} +} + +// List lists all NodeFolders in the indexer. +func (s *nodeFolderLister) List(selector labels.Selector) (ret []*v1.NodeFolder, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.NodeFolder)) + }) + return ret, err +} + +// Get retrieves the NodeFolder from the index for a given name. +func (s *nodeFolderLister) Get(name string) (*v1.NodeFolder, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("nodefolder"), name) + } + return obj.(*v1.NodeFolder), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodefoldercluster.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodefoldercluster.go new file mode 100644 index 000000000..d664bf963 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodefoldercluster.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// NodeFolderClusterLister helps list NodeFolderClusters. +// All objects returned here must be treated as read-only. +type NodeFolderClusterLister interface { + // List lists all NodeFolderClusters in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.NodeFolderCluster, err error) + // Get retrieves the NodeFolderCluster from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.NodeFolderCluster, error) + NodeFolderClusterListerExpansion +} + +// nodeFolderClusterLister implements the NodeFolderClusterLister interface. +type nodeFolderClusterLister struct { + indexer cache.Indexer +} + +// NewNodeFolderClusterLister returns a new NodeFolderClusterLister. +func NewNodeFolderClusterLister(indexer cache.Indexer) NodeFolderClusterLister { + return &nodeFolderClusterLister{indexer: indexer} +} + +// List lists all NodeFolderClusters in the indexer. +func (s *nodeFolderClusterLister) List(selector labels.Selector) (ret []*v1.NodeFolderCluster, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.NodeFolderCluster)) + }) + return ret, err +} + +// Get retrieves the NodeFolderCluster from the index for a given name. +func (s *nodeFolderClusterLister) Get(name string) (*v1.NodeFolderCluster, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("nodefoldercluster"), name) + } + return obj.(*v1.NodeFolderCluster), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodegroup.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodegroup.go new file mode 100644 index 000000000..fc7f5bad4 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodegroup.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// NodeGroupLister helps list NodeGroups. +// All objects returned here must be treated as read-only. +type NodeGroupLister interface { + // List lists all NodeGroups in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.NodeGroup, err error) + // Get retrieves the NodeGroup from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.NodeGroup, error) + NodeGroupListerExpansion +} + +// nodeGroupLister implements the NodeGroupLister interface. +type nodeGroupLister struct { + indexer cache.Indexer +} + +// NewNodeGroupLister returns a new NodeGroupLister. +func NewNodeGroupLister(indexer cache.Indexer) NodeGroupLister { + return &nodeGroupLister{indexer: indexer} +} + +// List lists all NodeGroups in the indexer. +func (s *nodeGroupLister) List(selector labels.Selector) (ret []*v1.NodeGroup, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.NodeGroup)) + }) + return ret, err +} + +// Get retrieves the NodeGroup from the index for a given name. +func (s *nodeGroupLister) Get(name string) (*v1.NodeGroup, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("nodegroup"), name) + } + return obj.(*v1.NodeGroup), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodestatus.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodestatus.go new file mode 100644 index 000000000..d03ecc21d --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodestatus.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// NodeStatusLister helps list NodeStatuses. +// All objects returned here must be treated as read-only. +type NodeStatusLister interface { + // List lists all NodeStatuses in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.NodeStatus, err error) + // Get retrieves the NodeStatus from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.NodeStatus, error) + NodeStatusListerExpansion +} + +// nodeStatusLister implements the NodeStatusLister interface. +type nodeStatusLister struct { + indexer cache.Indexer +} + +// NewNodeStatusLister returns a new NodeStatusLister. +func NewNodeStatusLister(indexer cache.Indexer) NodeStatusLister { + return &nodeStatusLister{indexer: indexer} +} + +// List lists all NodeStatuses in the indexer. +func (s *nodeStatusLister) List(selector labels.Selector) (ret []*v1.NodeStatus, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.NodeStatus)) + }) + return ret, err +} + +// Get retrieves the NodeStatus from the index for a given name. +func (s *nodeStatusLister) Get(name string) (*v1.NodeStatus, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("nodestatus"), name) + } + return obj.(*v1.NodeStatus), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodetemplate.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodetemplate.go new file mode 100644 index 000000000..08a8e39b7 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/nodetemplate.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// NodeTemplateLister helps list NodeTemplates. +// All objects returned here must be treated as read-only. +type NodeTemplateLister interface { + // List lists all NodeTemplates in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.NodeTemplate, err error) + // Get retrieves the NodeTemplate from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.NodeTemplate, error) + NodeTemplateListerExpansion +} + +// nodeTemplateLister implements the NodeTemplateLister interface. +type nodeTemplateLister struct { + indexer cache.Indexer +} + +// NewNodeTemplateLister returns a new NodeTemplateLister. +func NewNodeTemplateLister(indexer cache.Indexer) NodeTemplateLister { + return &nodeTemplateLister{indexer: indexer} +} + +// List lists all NodeTemplates in the indexer. +func (s *nodeTemplateLister) List(selector labels.Selector) (ret []*v1.NodeTemplate, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.NodeTemplate)) + }) + return ret, err +} + +// Get retrieves the NodeTemplate from the index for a given name. +func (s *nodeTemplateLister) Get(name string) (*v1.NodeTemplate, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("nodetemplate"), name) + } + return obj.(*v1.NodeTemplate), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/outboundauthenticationmode.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/outboundauthenticationmode.go new file mode 100644 index 000000000..746915b9b --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/outboundauthenticationmode.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// OutboundAuthenticationModeLister helps list OutboundAuthenticationModes. +// All objects returned here must be treated as read-only. +type OutboundAuthenticationModeLister interface { + // List lists all OutboundAuthenticationModes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.OutboundAuthenticationMode, err error) + // Get retrieves the OutboundAuthenticationMode from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.OutboundAuthenticationMode, error) + OutboundAuthenticationModeListerExpansion +} + +// outboundAuthenticationModeLister implements the OutboundAuthenticationModeLister interface. +type outboundAuthenticationModeLister struct { + indexer cache.Indexer +} + +// NewOutboundAuthenticationModeLister returns a new OutboundAuthenticationModeLister. +func NewOutboundAuthenticationModeLister(indexer cache.Indexer) OutboundAuthenticationModeLister { + return &outboundAuthenticationModeLister{indexer: indexer} +} + +// List lists all OutboundAuthenticationModes in the indexer. +func (s *outboundAuthenticationModeLister) List(selector labels.Selector) (ret []*v1.OutboundAuthenticationMode, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.OutboundAuthenticationMode)) + }) + return ret, err +} + +// Get retrieves the OutboundAuthenticationMode from the index for a given name. +func (s *outboundAuthenticationModeLister) Get(name string) (*v1.OutboundAuthenticationMode, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("outboundauthenticationmode"), name) + } + return obj.(*v1.OutboundAuthenticationMode), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/peerauthentication.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/peerauthentication.go new file mode 100644 index 000000000..0a77ea570 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/peerauthentication.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// PeerAuthenticationLister helps list PeerAuthentications. +// All objects returned here must be treated as read-only. +type PeerAuthenticationLister interface { + // List lists all PeerAuthentications in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.PeerAuthentication, err error) + // Get retrieves the PeerAuthentication from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.PeerAuthentication, error) + PeerAuthenticationListerExpansion +} + +// peerAuthenticationLister implements the PeerAuthenticationLister interface. +type peerAuthenticationLister struct { + indexer cache.Indexer +} + +// NewPeerAuthenticationLister returns a new PeerAuthenticationLister. +func NewPeerAuthenticationLister(indexer cache.Indexer) PeerAuthenticationLister { + return &peerAuthenticationLister{indexer: indexer} +} + +// List lists all PeerAuthentications in the indexer. +func (s *peerAuthenticationLister) List(selector labels.Selector) (ret []*v1.PeerAuthentication, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.PeerAuthentication)) + }) + return ret, err +} + +// Get retrieves the PeerAuthentication from the index for a given name. +func (s *peerAuthenticationLister) Get(name string) (*v1.PeerAuthentication, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("peerauthentication"), name) + } + return obj.(*v1.PeerAuthentication), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/piidiscovery.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/piidiscovery.go new file mode 100644 index 000000000..8ff6ae0f2 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/piidiscovery.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// PiiDiscoveryLister helps list PiiDiscoveries. +// All objects returned here must be treated as read-only. +type PiiDiscoveryLister interface { + // List lists all PiiDiscoveries in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.PiiDiscovery, err error) + // Get retrieves the PiiDiscovery from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.PiiDiscovery, error) + PiiDiscoveryListerExpansion +} + +// piiDiscoveryLister implements the PiiDiscoveryLister interface. +type piiDiscoveryLister struct { + indexer cache.Indexer +} + +// NewPiiDiscoveryLister returns a new PiiDiscoveryLister. +func NewPiiDiscoveryLister(indexer cache.Indexer) PiiDiscoveryLister { + return &piiDiscoveryLister{indexer: indexer} +} + +// List lists all PiiDiscoveries in the indexer. +func (s *piiDiscoveryLister) List(selector labels.Selector) (ret []*v1.PiiDiscovery, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.PiiDiscovery)) + }) + return ret, err +} + +// Get retrieves the PiiDiscovery from the index for a given name. +func (s *piiDiscoveryLister) Get(name string) (*v1.PiiDiscovery, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("piidiscovery"), name) + } + return obj.(*v1.PiiDiscovery), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/piidiscoveryrt.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/piidiscoveryrt.go new file mode 100644 index 000000000..5e6c1aa71 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/piidiscoveryrt.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// PiiDiscoveryRTLister helps list PiiDiscoveryRTs. +// All objects returned here must be treated as read-only. +type PiiDiscoveryRTLister interface { + // List lists all PiiDiscoveryRTs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.PiiDiscoveryRT, err error) + // Get retrieves the PiiDiscoveryRT from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.PiiDiscoveryRT, error) + PiiDiscoveryRTListerExpansion +} + +// piiDiscoveryRTLister implements the PiiDiscoveryRTLister interface. +type piiDiscoveryRTLister struct { + indexer cache.Indexer +} + +// NewPiiDiscoveryRTLister returns a new PiiDiscoveryRTLister. +func NewPiiDiscoveryRTLister(indexer cache.Indexer) PiiDiscoveryRTLister { + return &piiDiscoveryRTLister{indexer: indexer} +} + +// List lists all PiiDiscoveryRTs in the indexer. +func (s *piiDiscoveryRTLister) List(selector labels.Selector) (ret []*v1.PiiDiscoveryRT, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.PiiDiscoveryRT)) + }) + return ret, err +} + +// Get retrieves the PiiDiscoveryRT from the index for a given name. +func (s *piiDiscoveryRTLister) Get(name string) (*v1.PiiDiscoveryRT, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("piidiscoveryrt"), name) + } + return obj.(*v1.PiiDiscoveryRT), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/policyconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/policyconfig.go new file mode 100644 index 000000000..3de5597f4 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/policyconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// PolicyConfigLister helps list PolicyConfigs. +// All objects returned here must be treated as read-only. +type PolicyConfigLister interface { + // List lists all PolicyConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.PolicyConfig, err error) + // Get retrieves the PolicyConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.PolicyConfig, error) + PolicyConfigListerExpansion +} + +// policyConfigLister implements the PolicyConfigLister interface. +type policyConfigLister struct { + indexer cache.Indexer +} + +// NewPolicyConfigLister returns a new PolicyConfigLister. +func NewPolicyConfigLister(indexer cache.Indexer) PolicyConfigLister { + return &policyConfigLister{indexer: indexer} +} + +// List lists all PolicyConfigs in the indexer. +func (s *policyConfigLister) List(selector labels.Selector) (ret []*v1.PolicyConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.PolicyConfig)) + }) + return ret, err +} + +// Get retrieves the PolicyConfig from the index for a given name. +func (s *policyConfigLister) Get(name string) (*v1.PolicyConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("policyconfig"), name) + } + return obj.(*v1.PolicyConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/policytemplate.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/policytemplate.go new file mode 100644 index 000000000..cca966104 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/policytemplate.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// PolicyTemplateLister helps list PolicyTemplates. +// All objects returned here must be treated as read-only. +type PolicyTemplateLister interface { + // List lists all PolicyTemplates in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.PolicyTemplate, err error) + // Get retrieves the PolicyTemplate from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.PolicyTemplate, error) + PolicyTemplateListerExpansion +} + +// policyTemplateLister implements the PolicyTemplateLister interface. +type policyTemplateLister struct { + indexer cache.Indexer +} + +// NewPolicyTemplateLister returns a new PolicyTemplateLister. +func NewPolicyTemplateLister(indexer cache.Indexer) PolicyTemplateLister { + return &policyTemplateLister{indexer: indexer} +} + +// List lists all PolicyTemplates in the indexer. +func (s *policyTemplateLister) List(selector labels.Selector) (ret []*v1.PolicyTemplate, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.PolicyTemplate)) + }) + return ret, err +} + +// Get retrieves the PolicyTemplate from the index for a given name. +func (s *policyTemplateLister) Get(name string) (*v1.PolicyTemplate, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("policytemplate"), name) + } + return obj.(*v1.PolicyTemplate), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/progressiveupgrade.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/progressiveupgrade.go new file mode 100644 index 000000000..f846bb2ac --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/progressiveupgrade.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ProgressiveUpgradeLister helps list ProgressiveUpgrades. +// All objects returned here must be treated as read-only. +type ProgressiveUpgradeLister interface { + // List lists all ProgressiveUpgrades in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ProgressiveUpgrade, err error) + // Get retrieves the ProgressiveUpgrade from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ProgressiveUpgrade, error) + ProgressiveUpgradeListerExpansion +} + +// progressiveUpgradeLister implements the ProgressiveUpgradeLister interface. +type progressiveUpgradeLister struct { + indexer cache.Indexer +} + +// NewProgressiveUpgradeLister returns a new ProgressiveUpgradeLister. +func NewProgressiveUpgradeLister(indexer cache.Indexer) ProgressiveUpgradeLister { + return &progressiveUpgradeLister{indexer: indexer} +} + +// List lists all ProgressiveUpgrades in the indexer. +func (s *progressiveUpgradeLister) List(selector labels.Selector) (ret []*v1.ProgressiveUpgrade, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ProgressiveUpgrade)) + }) + return ret, err +} + +// Get retrieves the ProgressiveUpgrade from the index for a given name. +func (s *progressiveUpgradeLister) Get(name string) (*v1.ProgressiveUpgrade, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("progressiveupgrade"), name) + } + return obj.(*v1.ProgressiveUpgrade), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/progressiveupgradeconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/progressiveupgradeconfig.go new file mode 100644 index 000000000..136268c66 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/progressiveupgradeconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ProgressiveUpgradeConfigLister helps list ProgressiveUpgradeConfigs. +// All objects returned here must be treated as read-only. +type ProgressiveUpgradeConfigLister interface { + // List lists all ProgressiveUpgradeConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ProgressiveUpgradeConfig, err error) + // Get retrieves the ProgressiveUpgradeConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ProgressiveUpgradeConfig, error) + ProgressiveUpgradeConfigListerExpansion +} + +// progressiveUpgradeConfigLister implements the ProgressiveUpgradeConfigLister interface. +type progressiveUpgradeConfigLister struct { + indexer cache.Indexer +} + +// NewProgressiveUpgradeConfigLister returns a new ProgressiveUpgradeConfigLister. +func NewProgressiveUpgradeConfigLister(indexer cache.Indexer) ProgressiveUpgradeConfigLister { + return &progressiveUpgradeConfigLister{indexer: indexer} +} + +// List lists all ProgressiveUpgradeConfigs in the indexer. +func (s *progressiveUpgradeConfigLister) List(selector labels.Selector) (ret []*v1.ProgressiveUpgradeConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ProgressiveUpgradeConfig)) + }) + return ret, err +} + +// Get retrieves the ProgressiveUpgradeConfig from the index for a given name. +func (s *progressiveUpgradeConfigLister) Get(name string) (*v1.ProgressiveUpgradeConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("progressiveupgradeconfig"), name) + } + return obj.(*v1.ProgressiveUpgradeConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/progressiveupgradefolder.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/progressiveupgradefolder.go new file mode 100644 index 000000000..75f14f23d --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/progressiveupgradefolder.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ProgressiveUpgradeFolderLister helps list ProgressiveUpgradeFolders. +// All objects returned here must be treated as read-only. +type ProgressiveUpgradeFolderLister interface { + // List lists all ProgressiveUpgradeFolders in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ProgressiveUpgradeFolder, err error) + // Get retrieves the ProgressiveUpgradeFolder from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ProgressiveUpgradeFolder, error) + ProgressiveUpgradeFolderListerExpansion +} + +// progressiveUpgradeFolderLister implements the ProgressiveUpgradeFolderLister interface. +type progressiveUpgradeFolderLister struct { + indexer cache.Indexer +} + +// NewProgressiveUpgradeFolderLister returns a new ProgressiveUpgradeFolderLister. +func NewProgressiveUpgradeFolderLister(indexer cache.Indexer) ProgressiveUpgradeFolderLister { + return &progressiveUpgradeFolderLister{indexer: indexer} +} + +// List lists all ProgressiveUpgradeFolders in the indexer. +func (s *progressiveUpgradeFolderLister) List(selector labels.Selector) (ret []*v1.ProgressiveUpgradeFolder, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ProgressiveUpgradeFolder)) + }) + return ret, err +} + +// Get retrieves the ProgressiveUpgradeFolder from the index for a given name. +func (s *progressiveUpgradeFolderLister) Get(name string) (*v1.ProgressiveUpgradeFolder, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("progressiveupgradefolder"), name) + } + return obj.(*v1.ProgressiveUpgradeFolder), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/progressiveupgraderuntime.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/progressiveupgraderuntime.go new file mode 100644 index 000000000..8c531462c --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/progressiveupgraderuntime.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ProgressiveUpgradeRuntimeLister helps list ProgressiveUpgradeRuntimes. +// All objects returned here must be treated as read-only. +type ProgressiveUpgradeRuntimeLister interface { + // List lists all ProgressiveUpgradeRuntimes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ProgressiveUpgradeRuntime, err error) + // Get retrieves the ProgressiveUpgradeRuntime from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ProgressiveUpgradeRuntime, error) + ProgressiveUpgradeRuntimeListerExpansion +} + +// progressiveUpgradeRuntimeLister implements the ProgressiveUpgradeRuntimeLister interface. +type progressiveUpgradeRuntimeLister struct { + indexer cache.Indexer +} + +// NewProgressiveUpgradeRuntimeLister returns a new ProgressiveUpgradeRuntimeLister. +func NewProgressiveUpgradeRuntimeLister(indexer cache.Indexer) ProgressiveUpgradeRuntimeLister { + return &progressiveUpgradeRuntimeLister{indexer: indexer} +} + +// List lists all ProgressiveUpgradeRuntimes in the indexer. +func (s *progressiveUpgradeRuntimeLister) List(selector labels.Selector) (ret []*v1.ProgressiveUpgradeRuntime, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ProgressiveUpgradeRuntime)) + }) + return ret, err +} + +// Get retrieves the ProgressiveUpgradeRuntime from the index for a given name. +func (s *progressiveUpgradeRuntimeLister) Get(name string) (*v1.ProgressiveUpgradeRuntime, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("progressiveupgraderuntime"), name) + } + return obj.(*v1.ProgressiveUpgradeRuntime), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/project.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/project.go new file mode 100644 index 000000000..c905682fb --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/project.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ProjectLister helps list Projects. +// All objects returned here must be treated as read-only. +type ProjectLister interface { + // List lists all Projects in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Project, err error) + // Get retrieves the Project from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Project, error) + ProjectListerExpansion +} + +// projectLister implements the ProjectLister interface. +type projectLister struct { + indexer cache.Indexer +} + +// NewProjectLister returns a new ProjectLister. +func NewProjectLister(indexer cache.Indexer) ProjectLister { + return &projectLister{indexer: indexer} +} + +// List lists all Projects in the indexer. +func (s *projectLister) List(selector labels.Selector) (ret []*v1.Project, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Project)) + }) + return ret, err +} + +// Get retrieves the Project from the index for a given name. +func (s *projectLister) Get(name string) (*v1.Project, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("project"), name) + } + return obj.(*v1.Project), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/projectconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/projectconfig.go new file mode 100644 index 000000000..58f719883 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/projectconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ProjectConfigLister helps list ProjectConfigs. +// All objects returned here must be treated as read-only. +type ProjectConfigLister interface { + // List lists all ProjectConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ProjectConfig, err error) + // Get retrieves the ProjectConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ProjectConfig, error) + ProjectConfigListerExpansion +} + +// projectConfigLister implements the ProjectConfigLister interface. +type projectConfigLister struct { + indexer cache.Indexer +} + +// NewProjectConfigLister returns a new ProjectConfigLister. +func NewProjectConfigLister(indexer cache.Indexer) ProjectConfigLister { + return &projectConfigLister{indexer: indexer} +} + +// List lists all ProjectConfigs in the indexer. +func (s *projectConfigLister) List(selector labels.Selector) (ret []*v1.ProjectConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ProjectConfig)) + }) + return ret, err +} + +// Get retrieves the ProjectConfig from the index for a given name. +func (s *projectConfigLister) Get(name string) (*v1.ProjectConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("projectconfig"), name) + } + return obj.(*v1.ProjectConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/projectinventory.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/projectinventory.go new file mode 100644 index 000000000..ef72da94d --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/projectinventory.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ProjectInventoryLister helps list ProjectInventories. +// All objects returned here must be treated as read-only. +type ProjectInventoryLister interface { + // List lists all ProjectInventories in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ProjectInventory, err error) + // Get retrieves the ProjectInventory from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ProjectInventory, error) + ProjectInventoryListerExpansion +} + +// projectInventoryLister implements the ProjectInventoryLister interface. +type projectInventoryLister struct { + indexer cache.Indexer +} + +// NewProjectInventoryLister returns a new ProjectInventoryLister. +func NewProjectInventoryLister(indexer cache.Indexer) ProjectInventoryLister { + return &projectInventoryLister{indexer: indexer} +} + +// List lists all ProjectInventories in the indexer. +func (s *projectInventoryLister) List(selector labels.Selector) (ret []*v1.ProjectInventory, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ProjectInventory)) + }) + return ret, err +} + +// Get retrieves the ProjectInventory from the index for a given name. +func (s *projectInventoryLister) Get(name string) (*v1.ProjectInventory, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("projectinventory"), name) + } + return obj.(*v1.ProjectInventory), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/projectquery.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/projectquery.go new file mode 100644 index 000000000..e514d3ed9 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/projectquery.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ProjectQueryLister helps list ProjectQueries. +// All objects returned here must be treated as read-only. +type ProjectQueryLister interface { + // List lists all ProjectQueries in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ProjectQuery, err error) + // Get retrieves the ProjectQuery from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ProjectQuery, error) + ProjectQueryListerExpansion +} + +// projectQueryLister implements the ProjectQueryLister interface. +type projectQueryLister struct { + indexer cache.Indexer +} + +// NewProjectQueryLister returns a new ProjectQueryLister. +func NewProjectQueryLister(indexer cache.Indexer) ProjectQueryLister { + return &projectQueryLister{indexer: indexer} +} + +// List lists all ProjectQueries in the indexer. +func (s *projectQueryLister) List(selector labels.Selector) (ret []*v1.ProjectQuery, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ProjectQuery)) + }) + return ret, err +} + +// Get retrieves the ProjectQuery from the index for a given name. +func (s *projectQueryLister) Get(name string) (*v1.ProjectQuery, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("projectquery"), name) + } + return obj.(*v1.ProjectQuery), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/publicserviceconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/publicserviceconfig.go new file mode 100644 index 000000000..56a597617 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/publicserviceconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// PublicServiceConfigLister helps list PublicServiceConfigs. +// All objects returned here must be treated as read-only. +type PublicServiceConfigLister interface { + // List lists all PublicServiceConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.PublicServiceConfig, err error) + // Get retrieves the PublicServiceConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.PublicServiceConfig, error) + PublicServiceConfigListerExpansion +} + +// publicServiceConfigLister implements the PublicServiceConfigLister interface. +type publicServiceConfigLister struct { + indexer cache.Indexer +} + +// NewPublicServiceConfigLister returns a new PublicServiceConfigLister. +func NewPublicServiceConfigLister(indexer cache.Indexer) PublicServiceConfigLister { + return &publicServiceConfigLister{indexer: indexer} +} + +// List lists all PublicServiceConfigs in the indexer. +func (s *publicServiceConfigLister) List(selector labels.Selector) (ret []*v1.PublicServiceConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.PublicServiceConfig)) + }) + return ret, err +} + +// Get retrieves the PublicServiceConfig from the index for a given name. +func (s *publicServiceConfigLister) Get(name string) (*v1.PublicServiceConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("publicserviceconfig"), name) + } + return obj.(*v1.PublicServiceConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/publicservicerouteconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/publicservicerouteconfig.go new file mode 100644 index 000000000..d2c7d1b32 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/publicservicerouteconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// PublicServiceRouteConfigLister helps list PublicServiceRouteConfigs. +// All objects returned here must be treated as read-only. +type PublicServiceRouteConfigLister interface { + // List lists all PublicServiceRouteConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.PublicServiceRouteConfig, err error) + // Get retrieves the PublicServiceRouteConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.PublicServiceRouteConfig, error) + PublicServiceRouteConfigListerExpansion +} + +// publicServiceRouteConfigLister implements the PublicServiceRouteConfigLister interface. +type publicServiceRouteConfigLister struct { + indexer cache.Indexer +} + +// NewPublicServiceRouteConfigLister returns a new PublicServiceRouteConfigLister. +func NewPublicServiceRouteConfigLister(indexer cache.Indexer) PublicServiceRouteConfigLister { + return &publicServiceRouteConfigLister{indexer: indexer} +} + +// List lists all PublicServiceRouteConfigs in the indexer. +func (s *publicServiceRouteConfigLister) List(selector labels.Selector) (ret []*v1.PublicServiceRouteConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.PublicServiceRouteConfig)) + }) + return ret, err +} + +// Get retrieves the PublicServiceRouteConfig from the index for a given name. +func (s *publicServiceRouteConfigLister) Get(name string) (*v1.PublicServiceRouteConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("publicservicerouteconfig"), name) + } + return obj.(*v1.PublicServiceRouteConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/publicservicert.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/publicservicert.go new file mode 100644 index 000000000..b3b9cf537 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/publicservicert.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// PublicServiceRTLister helps list PublicServiceRTs. +// All objects returned here must be treated as read-only. +type PublicServiceRTLister interface { + // List lists all PublicServiceRTs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.PublicServiceRT, err error) + // Get retrieves the PublicServiceRT from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.PublicServiceRT, error) + PublicServiceRTListerExpansion +} + +// publicServiceRTLister implements the PublicServiceRTLister interface. +type publicServiceRTLister struct { + indexer cache.Indexer +} + +// NewPublicServiceRTLister returns a new PublicServiceRTLister. +func NewPublicServiceRTLister(indexer cache.Indexer) PublicServiceRTLister { + return &publicServiceRTLister{indexer: indexer} +} + +// List lists all PublicServiceRTs in the indexer. +func (s *publicServiceRTLister) List(selector labels.Selector) (ret []*v1.PublicServiceRT, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.PublicServiceRT)) + }) + return ret, err +} + +// Get retrieves the PublicServiceRT from the index for a given name. +func (s *publicServiceRTLister) Get(name string) (*v1.PublicServiceRT, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("publicservicert"), name) + } + return obj.(*v1.PublicServiceRT), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/remotegatewayserviceconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/remotegatewayserviceconfig.go new file mode 100644 index 000000000..cd15a3dea --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/remotegatewayserviceconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// RemoteGatewayServiceConfigLister helps list RemoteGatewayServiceConfigs. +// All objects returned here must be treated as read-only. +type RemoteGatewayServiceConfigLister interface { + // List lists all RemoteGatewayServiceConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.RemoteGatewayServiceConfig, err error) + // Get retrieves the RemoteGatewayServiceConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.RemoteGatewayServiceConfig, error) + RemoteGatewayServiceConfigListerExpansion +} + +// remoteGatewayServiceConfigLister implements the RemoteGatewayServiceConfigLister interface. +type remoteGatewayServiceConfigLister struct { + indexer cache.Indexer +} + +// NewRemoteGatewayServiceConfigLister returns a new RemoteGatewayServiceConfigLister. +func NewRemoteGatewayServiceConfigLister(indexer cache.Indexer) RemoteGatewayServiceConfigLister { + return &remoteGatewayServiceConfigLister{indexer: indexer} +} + +// List lists all RemoteGatewayServiceConfigs in the indexer. +func (s *remoteGatewayServiceConfigLister) List(selector labels.Selector) (ret []*v1.RemoteGatewayServiceConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.RemoteGatewayServiceConfig)) + }) + return ret, err +} + +// Get retrieves the RemoteGatewayServiceConfig from the index for a given name. +func (s *remoteGatewayServiceConfigLister) Get(name string) (*v1.RemoteGatewayServiceConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("remotegatewayserviceconfig"), name) + } + return obj.(*v1.RemoteGatewayServiceConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/resourcegroup.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/resourcegroup.go new file mode 100644 index 000000000..154f8fa39 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/resourcegroup.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ResourceGroupLister helps list ResourceGroups. +// All objects returned here must be treated as read-only. +type ResourceGroupLister interface { + // List lists all ResourceGroups in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ResourceGroup, err error) + // Get retrieves the ResourceGroup from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ResourceGroup, error) + ResourceGroupListerExpansion +} + +// resourceGroupLister implements the ResourceGroupLister interface. +type resourceGroupLister struct { + indexer cache.Indexer +} + +// NewResourceGroupLister returns a new ResourceGroupLister. +func NewResourceGroupLister(indexer cache.Indexer) ResourceGroupLister { + return &resourceGroupLister{indexer: indexer} +} + +// List lists all ResourceGroups in the indexer. +func (s *resourceGroupLister) List(selector labels.Selector) (ret []*v1.ResourceGroup, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ResourceGroup)) + }) + return ret, err +} + +// Get retrieves the ResourceGroup from the index for a given name. +func (s *resourceGroupLister) Get(name string) (*v1.ResourceGroup, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("resourcegroup"), name) + } + return obj.(*v1.ResourceGroup), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/resourcegrouprt.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/resourcegrouprt.go new file mode 100644 index 000000000..bd58fa528 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/resourcegrouprt.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ResourceGroupRTLister helps list ResourceGroupRTs. +// All objects returned here must be treated as read-only. +type ResourceGroupRTLister interface { + // List lists all ResourceGroupRTs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ResourceGroupRT, err error) + // Get retrieves the ResourceGroupRT from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ResourceGroupRT, error) + ResourceGroupRTListerExpansion +} + +// resourceGroupRTLister implements the ResourceGroupRTLister interface. +type resourceGroupRTLister struct { + indexer cache.Indexer +} + +// NewResourceGroupRTLister returns a new ResourceGroupRTLister. +func NewResourceGroupRTLister(indexer cache.Indexer) ResourceGroupRTLister { + return &resourceGroupRTLister{indexer: indexer} +} + +// List lists all ResourceGroupRTs in the indexer. +func (s *resourceGroupRTLister) List(selector labels.Selector) (ret []*v1.ResourceGroupRT, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ResourceGroupRT)) + }) + return ret, err +} + +// Get retrieves the ResourceGroupRT from the index for a given name. +func (s *resourceGroupRTLister) Get(name string) (*v1.ResourceGroupRT, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("resourcegrouprt"), name) + } + return obj.(*v1.ResourceGroupRT), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/root.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/root.go new file mode 100644 index 000000000..4d1526f20 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/root.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// RootLister helps list Roots. +// All objects returned here must be treated as read-only. +type RootLister interface { + // List lists all Roots in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Root, err error) + // Get retrieves the Root from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Root, error) + RootListerExpansion +} + +// rootLister implements the RootLister interface. +type rootLister struct { + indexer cache.Indexer +} + +// NewRootLister returns a new RootLister. +func NewRootLister(indexer cache.Indexer) RootLister { + return &rootLister{indexer: indexer} +} + +// List lists all Roots in the indexer. +func (s *rootLister) List(selector labels.Selector) (ret []*v1.Root, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Root)) + }) + return ret, err +} + +// Get retrieves the Root from the index for a given name. +func (s *rootLister) Get(name string) (*v1.Root, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("root"), name) + } + return obj.(*v1.Root), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/rpolicy.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/rpolicy.go new file mode 100644 index 000000000..67bcc0ef6 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/rpolicy.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// RPolicyLister helps list RPolicies. +// All objects returned here must be treated as read-only. +type RPolicyLister interface { + // List lists all RPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.RPolicy, err error) + // Get retrieves the RPolicy from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.RPolicy, error) + RPolicyListerExpansion +} + +// rPolicyLister implements the RPolicyLister interface. +type rPolicyLister struct { + indexer cache.Indexer +} + +// NewRPolicyLister returns a new RPolicyLister. +func NewRPolicyLister(indexer cache.Indexer) RPolicyLister { + return &rPolicyLister{indexer: indexer} +} + +// List lists all RPolicies in the indexer. +func (s *rPolicyLister) List(selector labels.Selector) (ret []*v1.RPolicy, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.RPolicy)) + }) + return ret, err +} + +// Get retrieves the RPolicy from the index for a given name. +func (s *rPolicyLister) Get(name string) (*v1.RPolicy, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("rpolicy"), name) + } + return obj.(*v1.RPolicy), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/runtime.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/runtime.go new file mode 100644 index 000000000..e4f7911ec --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/runtime.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// RuntimeLister helps list Runtimes. +// All objects returned here must be treated as read-only. +type RuntimeLister interface { + // List lists all Runtimes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Runtime, err error) + // Get retrieves the Runtime from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Runtime, error) + RuntimeListerExpansion +} + +// runtimeLister implements the RuntimeLister interface. +type runtimeLister struct { + indexer cache.Indexer +} + +// NewRuntimeLister returns a new RuntimeLister. +func NewRuntimeLister(indexer cache.Indexer) RuntimeLister { + return &runtimeLister{indexer: indexer} +} + +// List lists all Runtimes in the indexer. +func (s *runtimeLister) List(selector labels.Selector) (ret []*v1.Runtime, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Runtime)) + }) + return ret, err +} + +// Get retrieves the Runtime from the index for a given name. +func (s *runtimeLister) Get(name string) (*v1.Runtime, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("runtime"), name) + } + return obj.(*v1.Runtime), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/schemaviolationdiscoveryrt.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/schemaviolationdiscoveryrt.go new file mode 100644 index 000000000..772457879 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/schemaviolationdiscoveryrt.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// SchemaViolationDiscoveryRTLister helps list SchemaViolationDiscoveryRTs. +// All objects returned here must be treated as read-only. +type SchemaViolationDiscoveryRTLister interface { + // List lists all SchemaViolationDiscoveryRTs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.SchemaViolationDiscoveryRT, err error) + // Get retrieves the SchemaViolationDiscoveryRT from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.SchemaViolationDiscoveryRT, error) + SchemaViolationDiscoveryRTListerExpansion +} + +// schemaViolationDiscoveryRTLister implements the SchemaViolationDiscoveryRTLister interface. +type schemaViolationDiscoveryRTLister struct { + indexer cache.Indexer +} + +// NewSchemaViolationDiscoveryRTLister returns a new SchemaViolationDiscoveryRTLister. +func NewSchemaViolationDiscoveryRTLister(indexer cache.Indexer) SchemaViolationDiscoveryRTLister { + return &schemaViolationDiscoveryRTLister{indexer: indexer} +} + +// List lists all SchemaViolationDiscoveryRTs in the indexer. +func (s *schemaViolationDiscoveryRTLister) List(selector labels.Selector) (ret []*v1.SchemaViolationDiscoveryRT, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.SchemaViolationDiscoveryRT)) + }) + return ret, err +} + +// Get retrieves the SchemaViolationDiscoveryRT from the index for a given name. +func (s *schemaViolationDiscoveryRTLister) Get(name string) (*v1.SchemaViolationDiscoveryRT, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("schemaviolationdiscoveryrt"), name) + } + return obj.(*v1.SchemaViolationDiscoveryRT), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/secrethash.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/secrethash.go new file mode 100644 index 000000000..025e1d259 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/secrethash.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// SecretHashLister helps list SecretHashes. +// All objects returned here must be treated as read-only. +type SecretHashLister interface { + // List lists all SecretHashes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.SecretHash, err error) + // Get retrieves the SecretHash from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.SecretHash, error) + SecretHashListerExpansion +} + +// secretHashLister implements the SecretHashLister interface. +type secretHashLister struct { + indexer cache.Indexer +} + +// NewSecretHashLister returns a new SecretHashLister. +func NewSecretHashLister(indexer cache.Indexer) SecretHashLister { + return &secretHashLister{indexer: indexer} +} + +// List lists all SecretHashes in the indexer. +func (s *secretHashLister) List(selector labels.Selector) (ret []*v1.SecretHash, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.SecretHash)) + }) + return ret, err +} + +// Get retrieves the SecretHash from the index for a given name. +func (s *secretHashLister) Get(name string) (*v1.SecretHash, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("secrethash"), name) + } + return obj.(*v1.SecretHash), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/secretrtconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/secretrtconfig.go new file mode 100644 index 000000000..8d1da0d65 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/secretrtconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// SecretRTConfigLister helps list SecretRTConfigs. +// All objects returned here must be treated as read-only. +type SecretRTConfigLister interface { + // List lists all SecretRTConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.SecretRTConfig, err error) + // Get retrieves the SecretRTConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.SecretRTConfig, error) + SecretRTConfigListerExpansion +} + +// secretRTConfigLister implements the SecretRTConfigLister interface. +type secretRTConfigLister struct { + indexer cache.Indexer +} + +// NewSecretRTConfigLister returns a new SecretRTConfigLister. +func NewSecretRTConfigLister(indexer cache.Indexer) SecretRTConfigLister { + return &secretRTConfigLister{indexer: indexer} +} + +// List lists all SecretRTConfigs in the indexer. +func (s *secretRTConfigLister) List(selector labels.Selector) (ret []*v1.SecretRTConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.SecretRTConfig)) + }) + return ret, err +} + +// Get retrieves the SecretRTConfig from the index for a given name. +func (s *secretRTConfigLister) Get(name string) (*v1.SecretRTConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("secretrtconfig"), name) + } + return obj.(*v1.SecretRTConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/securitycontextconstraints.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/securitycontextconstraints.go new file mode 100644 index 000000000..e458b1458 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/securitycontextconstraints.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// SecurityContextConstraintsLister helps list SecurityContextConstraintses. +// All objects returned here must be treated as read-only. +type SecurityContextConstraintsLister interface { + // List lists all SecurityContextConstraintses in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.SecurityContextConstraints, err error) + // Get retrieves the SecurityContextConstraints from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.SecurityContextConstraints, error) + SecurityContextConstraintsListerExpansion +} + +// securityContextConstraintsLister implements the SecurityContextConstraintsLister interface. +type securityContextConstraintsLister struct { + indexer cache.Indexer +} + +// NewSecurityContextConstraintsLister returns a new SecurityContextConstraintsLister. +func NewSecurityContextConstraintsLister(indexer cache.Indexer) SecurityContextConstraintsLister { + return &securityContextConstraintsLister{indexer: indexer} +} + +// List lists all SecurityContextConstraintses in the indexer. +func (s *securityContextConstraintsLister) List(selector labels.Selector) (ret []*v1.SecurityContextConstraints, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.SecurityContextConstraints)) + }) + return ret, err +} + +// Get retrieves the SecurityContextConstraints from the index for a given name. +func (s *securityContextConstraintsLister) Get(name string) (*v1.SecurityContextConstraints, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("securitycontextconstraints"), name) + } + return obj.(*v1.SecurityContextConstraints), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/securitycontextconstraintsconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/securitycontextconstraintsconfig.go new file mode 100644 index 000000000..82b0eaf44 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/securitycontextconstraintsconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// SecurityContextConstraintsConfigLister helps list SecurityContextConstraintsConfigs. +// All objects returned here must be treated as read-only. +type SecurityContextConstraintsConfigLister interface { + // List lists all SecurityContextConstraintsConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.SecurityContextConstraintsConfig, err error) + // Get retrieves the SecurityContextConstraintsConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.SecurityContextConstraintsConfig, error) + SecurityContextConstraintsConfigListerExpansion +} + +// securityContextConstraintsConfigLister implements the SecurityContextConstraintsConfigLister interface. +type securityContextConstraintsConfigLister struct { + indexer cache.Indexer +} + +// NewSecurityContextConstraintsConfigLister returns a new SecurityContextConstraintsConfigLister. +func NewSecurityContextConstraintsConfigLister(indexer cache.Indexer) SecurityContextConstraintsConfigLister { + return &securityContextConstraintsConfigLister{indexer: indexer} +} + +// List lists all SecurityContextConstraintsConfigs in the indexer. +func (s *securityContextConstraintsConfigLister) List(selector labels.Selector) (ret []*v1.SecurityContextConstraintsConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.SecurityContextConstraintsConfig)) + }) + return ret, err +} + +// Get retrieves the SecurityContextConstraintsConfig from the index for a given name. +func (s *securityContextConstraintsConfigLister) Get(name string) (*v1.SecurityContextConstraintsConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("securitycontextconstraintsconfig"), name) + } + return obj.(*v1.SecurityContextConstraintsConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/service.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/service.go new file mode 100644 index 000000000..e24b4d81f --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/service.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceLister helps list Services. +// All objects returned here must be treated as read-only. +type ServiceLister interface { + // List lists all Services in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Service, err error) + // Get retrieves the Service from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Service, error) + ServiceListerExpansion +} + +// serviceLister implements the ServiceLister interface. +type serviceLister struct { + indexer cache.Indexer +} + +// NewServiceLister returns a new ServiceLister. +func NewServiceLister(indexer cache.Indexer) ServiceLister { + return &serviceLister{indexer: indexer} +} + +// List lists all Services in the indexer. +func (s *serviceLister) List(selector labels.Selector) (ret []*v1.Service, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Service)) + }) + return ret, err +} + +// Get retrieves the Service from the index for a given name. +func (s *serviceLister) Get(name string) (*v1.Service, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("service"), name) + } + return obj.(*v1.Service), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceconfig.go new file mode 100644 index 000000000..88f455480 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceConfigLister helps list ServiceConfigs. +// All objects returned here must be treated as read-only. +type ServiceConfigLister interface { + // List lists all ServiceConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceConfig, err error) + // Get retrieves the ServiceConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceConfig, error) + ServiceConfigListerExpansion +} + +// serviceConfigLister implements the ServiceConfigLister interface. +type serviceConfigLister struct { + indexer cache.Indexer +} + +// NewServiceConfigLister returns a new ServiceConfigLister. +func NewServiceConfigLister(indexer cache.Indexer) ServiceConfigLister { + return &serviceConfigLister{indexer: indexer} +} + +// List lists all ServiceConfigs in the indexer. +func (s *serviceConfigLister) List(selector labels.Selector) (ret []*v1.ServiceConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceConfig)) + }) + return ret, err +} + +// Get retrieves the ServiceConfig from the index for a given name. +func (s *serviceConfigLister) Get(name string) (*v1.ServiceConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("serviceconfig"), name) + } + return obj.(*v1.ServiceConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicecronjob.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicecronjob.go new file mode 100644 index 000000000..4d91a0566 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicecronjob.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceCronJobLister helps list ServiceCronJobs. +// All objects returned here must be treated as read-only. +type ServiceCronJobLister interface { + // List lists all ServiceCronJobs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceCronJob, err error) + // Get retrieves the ServiceCronJob from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceCronJob, error) + ServiceCronJobListerExpansion +} + +// serviceCronJobLister implements the ServiceCronJobLister interface. +type serviceCronJobLister struct { + indexer cache.Indexer +} + +// NewServiceCronJobLister returns a new ServiceCronJobLister. +func NewServiceCronJobLister(indexer cache.Indexer) ServiceCronJobLister { + return &serviceCronJobLister{indexer: indexer} +} + +// List lists all ServiceCronJobs in the indexer. +func (s *serviceCronJobLister) List(selector labels.Selector) (ret []*v1.ServiceCronJob, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceCronJob)) + }) + return ret, err +} + +// Get retrieves the ServiceCronJob from the index for a given name. +func (s *serviceCronJobLister) Get(name string) (*v1.ServiceCronJob, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicecronjob"), name) + } + return obj.(*v1.ServiceCronJob), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedaemonset.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedaemonset.go new file mode 100644 index 000000000..21d435034 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedaemonset.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceDaemonSetLister helps list ServiceDaemonSets. +// All objects returned here must be treated as read-only. +type ServiceDaemonSetLister interface { + // List lists all ServiceDaemonSets in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceDaemonSet, err error) + // Get retrieves the ServiceDaemonSet from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceDaemonSet, error) + ServiceDaemonSetListerExpansion +} + +// serviceDaemonSetLister implements the ServiceDaemonSetLister interface. +type serviceDaemonSetLister struct { + indexer cache.Indexer +} + +// NewServiceDaemonSetLister returns a new ServiceDaemonSetLister. +func NewServiceDaemonSetLister(indexer cache.Indexer) ServiceDaemonSetLister { + return &serviceDaemonSetLister{indexer: indexer} +} + +// List lists all ServiceDaemonSets in the indexer. +func (s *serviceDaemonSetLister) List(selector labels.Selector) (ret []*v1.ServiceDaemonSet, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceDaemonSet)) + }) + return ret, err +} + +// Get retrieves the ServiceDaemonSet from the index for a given name. +func (s *serviceDaemonSetLister) Get(name string) (*v1.ServiceDaemonSet, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicedaemonset"), name) + } + return obj.(*v1.ServiceDaemonSet), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedeployment.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedeployment.go new file mode 100644 index 000000000..b8b414738 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedeployment.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceDeploymentLister helps list ServiceDeployments. +// All objects returned here must be treated as read-only. +type ServiceDeploymentLister interface { + // List lists all ServiceDeployments in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceDeployment, err error) + // Get retrieves the ServiceDeployment from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceDeployment, error) + ServiceDeploymentListerExpansion +} + +// serviceDeploymentLister implements the ServiceDeploymentLister interface. +type serviceDeploymentLister struct { + indexer cache.Indexer +} + +// NewServiceDeploymentLister returns a new ServiceDeploymentLister. +func NewServiceDeploymentLister(indexer cache.Indexer) ServiceDeploymentLister { + return &serviceDeploymentLister{indexer: indexer} +} + +// List lists all ServiceDeployments in the indexer. +func (s *serviceDeploymentLister) List(selector labels.Selector) (ret []*v1.ServiceDeployment, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceDeployment)) + }) + return ret, err +} + +// Get retrieves the ServiceDeployment from the index for a given name. +func (s *serviceDeploymentLister) Get(name string) (*v1.ServiceDeployment, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicedeployment"), name) + } + return obj.(*v1.ServiceDeployment), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedeploymentcontainer.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedeploymentcontainer.go new file mode 100644 index 000000000..ccbb7c3ac --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedeploymentcontainer.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceDeploymentContainerLister helps list ServiceDeploymentContainers. +// All objects returned here must be treated as read-only. +type ServiceDeploymentContainerLister interface { + // List lists all ServiceDeploymentContainers in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceDeploymentContainer, err error) + // Get retrieves the ServiceDeploymentContainer from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceDeploymentContainer, error) + ServiceDeploymentContainerListerExpansion +} + +// serviceDeploymentContainerLister implements the ServiceDeploymentContainerLister interface. +type serviceDeploymentContainerLister struct { + indexer cache.Indexer +} + +// NewServiceDeploymentContainerLister returns a new ServiceDeploymentContainerLister. +func NewServiceDeploymentContainerLister(indexer cache.Indexer) ServiceDeploymentContainerLister { + return &serviceDeploymentContainerLister{indexer: indexer} +} + +// List lists all ServiceDeploymentContainers in the indexer. +func (s *serviceDeploymentContainerLister) List(selector labels.Selector) (ret []*v1.ServiceDeploymentContainer, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceDeploymentContainer)) + }) + return ret, err +} + +// Get retrieves the ServiceDeploymentContainer from the index for a given name. +func (s *serviceDeploymentContainerLister) Get(name string) (*v1.ServiceDeploymentContainer, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicedeploymentcontainer"), name) + } + return obj.(*v1.ServiceDeploymentContainer), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedirectoryentryconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedirectoryentryconfig.go new file mode 100644 index 000000000..fb8a5a09e --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedirectoryentryconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceDirectoryEntryConfigLister helps list ServiceDirectoryEntryConfigs. +// All objects returned here must be treated as read-only. +type ServiceDirectoryEntryConfigLister interface { + // List lists all ServiceDirectoryEntryConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceDirectoryEntryConfig, err error) + // Get retrieves the ServiceDirectoryEntryConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceDirectoryEntryConfig, error) + ServiceDirectoryEntryConfigListerExpansion +} + +// serviceDirectoryEntryConfigLister implements the ServiceDirectoryEntryConfigLister interface. +type serviceDirectoryEntryConfigLister struct { + indexer cache.Indexer +} + +// NewServiceDirectoryEntryConfigLister returns a new ServiceDirectoryEntryConfigLister. +func NewServiceDirectoryEntryConfigLister(indexer cache.Indexer) ServiceDirectoryEntryConfigLister { + return &serviceDirectoryEntryConfigLister{indexer: indexer} +} + +// List lists all ServiceDirectoryEntryConfigs in the indexer. +func (s *serviceDirectoryEntryConfigLister) List(selector labels.Selector) (ret []*v1.ServiceDirectoryEntryConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceDirectoryEntryConfig)) + }) + return ret, err +} + +// Get retrieves the ServiceDirectoryEntryConfig from the index for a given name. +func (s *serviceDirectoryEntryConfigLister) Get(name string) (*v1.ServiceDirectoryEntryConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicedirectoryentryconfig"), name) + } + return obj.(*v1.ServiceDirectoryEntryConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedirectoryn.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedirectoryn.go new file mode 100644 index 000000000..1d7a170bd --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedirectoryn.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceDirectoryNLister helps list ServiceDirectoryNs. +// All objects returned here must be treated as read-only. +type ServiceDirectoryNLister interface { + // List lists all ServiceDirectoryNs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceDirectoryN, err error) + // Get retrieves the ServiceDirectoryN from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceDirectoryN, error) + ServiceDirectoryNListerExpansion +} + +// serviceDirectoryNLister implements the ServiceDirectoryNLister interface. +type serviceDirectoryNLister struct { + indexer cache.Indexer +} + +// NewServiceDirectoryNLister returns a new ServiceDirectoryNLister. +func NewServiceDirectoryNLister(indexer cache.Indexer) ServiceDirectoryNLister { + return &serviceDirectoryNLister{indexer: indexer} +} + +// List lists all ServiceDirectoryNs in the indexer. +func (s *serviceDirectoryNLister) List(selector labels.Selector) (ret []*v1.ServiceDirectoryN, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceDirectoryN)) + }) + return ret, err +} + +// Get retrieves the ServiceDirectoryN from the index for a given name. +func (s *serviceDirectoryNLister) Get(name string) (*v1.ServiceDirectoryN, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicedirectoryn"), name) + } + return obj.(*v1.ServiceDirectoryN), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedirectoryrt.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedirectoryrt.go new file mode 100644 index 000000000..99010a001 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedirectoryrt.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceDirectoryRTLister helps list ServiceDirectoryRTs. +// All objects returned here must be treated as read-only. +type ServiceDirectoryRTLister interface { + // List lists all ServiceDirectoryRTs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceDirectoryRT, err error) + // Get retrieves the ServiceDirectoryRT from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceDirectoryRT, error) + ServiceDirectoryRTListerExpansion +} + +// serviceDirectoryRTLister implements the ServiceDirectoryRTLister interface. +type serviceDirectoryRTLister struct { + indexer cache.Indexer +} + +// NewServiceDirectoryRTLister returns a new ServiceDirectoryRTLister. +func NewServiceDirectoryRTLister(indexer cache.Indexer) ServiceDirectoryRTLister { + return &serviceDirectoryRTLister{indexer: indexer} +} + +// List lists all ServiceDirectoryRTs in the indexer. +func (s *serviceDirectoryRTLister) List(selector labels.Selector) (ret []*v1.ServiceDirectoryRT, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceDirectoryRT)) + }) + return ret, err +} + +// Get retrieves the ServiceDirectoryRT from the index for a given name. +func (s *serviceDirectoryRTLister) Get(name string) (*v1.ServiceDirectoryRT, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicedirectoryrt"), name) + } + return obj.(*v1.ServiceDirectoryRT), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolder.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolder.go new file mode 100644 index 000000000..f84c12214 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolder.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceDirectoryRTFolderLister helps list ServiceDirectoryRTFolders. +// All objects returned here must be treated as read-only. +type ServiceDirectoryRTFolderLister interface { + // List lists all ServiceDirectoryRTFolders in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceDirectoryRTFolder, err error) + // Get retrieves the ServiceDirectoryRTFolder from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceDirectoryRTFolder, error) + ServiceDirectoryRTFolderListerExpansion +} + +// serviceDirectoryRTFolderLister implements the ServiceDirectoryRTFolderLister interface. +type serviceDirectoryRTFolderLister struct { + indexer cache.Indexer +} + +// NewServiceDirectoryRTFolderLister returns a new ServiceDirectoryRTFolderLister. +func NewServiceDirectoryRTFolderLister(indexer cache.Indexer) ServiceDirectoryRTFolderLister { + return &serviceDirectoryRTFolderLister{indexer: indexer} +} + +// List lists all ServiceDirectoryRTFolders in the indexer. +func (s *serviceDirectoryRTFolderLister) List(selector labels.Selector) (ret []*v1.ServiceDirectoryRTFolder, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceDirectoryRTFolder)) + }) + return ret, err +} + +// Get retrieves the ServiceDirectoryRTFolder from the index for a given name. +func (s *serviceDirectoryRTFolderLister) Get(name string) (*v1.ServiceDirectoryRTFolder, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicedirectoryrtfolder"), name) + } + return obj.(*v1.ServiceDirectoryRTFolder), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolderentry.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolderentry.go new file mode 100644 index 000000000..305f8d668 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicedirectoryrtfolderentry.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceDirectoryRTFolderEntryLister helps list ServiceDirectoryRTFolderEntries. +// All objects returned here must be treated as read-only. +type ServiceDirectoryRTFolderEntryLister interface { + // List lists all ServiceDirectoryRTFolderEntries in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceDirectoryRTFolderEntry, err error) + // Get retrieves the ServiceDirectoryRTFolderEntry from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceDirectoryRTFolderEntry, error) + ServiceDirectoryRTFolderEntryListerExpansion +} + +// serviceDirectoryRTFolderEntryLister implements the ServiceDirectoryRTFolderEntryLister interface. +type serviceDirectoryRTFolderEntryLister struct { + indexer cache.Indexer +} + +// NewServiceDirectoryRTFolderEntryLister returns a new ServiceDirectoryRTFolderEntryLister. +func NewServiceDirectoryRTFolderEntryLister(indexer cache.Indexer) ServiceDirectoryRTFolderEntryLister { + return &serviceDirectoryRTFolderEntryLister{indexer: indexer} +} + +// List lists all ServiceDirectoryRTFolderEntries in the indexer. +func (s *serviceDirectoryRTFolderEntryLister) List(selector labels.Selector) (ret []*v1.ServiceDirectoryRTFolderEntry, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceDirectoryRTFolderEntry)) + }) + return ret, err +} + +// Get retrieves the ServiceDirectoryRTFolderEntry from the index for a given name. +func (s *serviceDirectoryRTFolderEntryLister) Get(name string) (*v1.ServiceDirectoryRTFolderEntry, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicedirectoryrtfolderentry"), name) + } + return obj.(*v1.ServiceDirectoryRTFolderEntry), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceentry.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceentry.go new file mode 100644 index 000000000..9be0938ed --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceentry.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceEntryLister helps list ServiceEntries. +// All objects returned here must be treated as read-only. +type ServiceEntryLister interface { + // List lists all ServiceEntries in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceEntry, err error) + // Get retrieves the ServiceEntry from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceEntry, error) + ServiceEntryListerExpansion +} + +// serviceEntryLister implements the ServiceEntryLister interface. +type serviceEntryLister struct { + indexer cache.Indexer +} + +// NewServiceEntryLister returns a new ServiceEntryLister. +func NewServiceEntryLister(indexer cache.Indexer) ServiceEntryLister { + return &serviceEntryLister{indexer: indexer} +} + +// List lists all ServiceEntries in the indexer. +func (s *serviceEntryLister) List(selector labels.Selector) (ret []*v1.ServiceEntry, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceEntry)) + }) + return ret, err +} + +// Get retrieves the ServiceEntry from the index for a given name. +func (s *serviceEntryLister) Get(name string) (*v1.ServiceEntry, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("serviceentry"), name) + } + return obj.(*v1.ServiceEntry), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceentryconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceentryconfig.go new file mode 100644 index 000000000..50a1f3bad --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceentryconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceEntryConfigLister helps list ServiceEntryConfigs. +// All objects returned here must be treated as read-only. +type ServiceEntryConfigLister interface { + // List lists all ServiceEntryConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceEntryConfig, err error) + // Get retrieves the ServiceEntryConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceEntryConfig, error) + ServiceEntryConfigListerExpansion +} + +// serviceEntryConfigLister implements the ServiceEntryConfigLister interface. +type serviceEntryConfigLister struct { + indexer cache.Indexer +} + +// NewServiceEntryConfigLister returns a new ServiceEntryConfigLister. +func NewServiceEntryConfigLister(indexer cache.Indexer) ServiceEntryConfigLister { + return &serviceEntryConfigLister{indexer: indexer} +} + +// List lists all ServiceEntryConfigs in the indexer. +func (s *serviceEntryConfigLister) List(selector labels.Selector) (ret []*v1.ServiceEntryConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceEntryConfig)) + }) + return ret, err +} + +// Get retrieves the ServiceEntryConfig from the index for a given name. +func (s *serviceEntryConfigLister) Get(name string) (*v1.ServiceEntryConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("serviceentryconfig"), name) + } + return obj.(*v1.ServiceEntryConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceinstance.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceinstance.go new file mode 100644 index 000000000..007ff3fa3 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceinstance.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceInstanceLister helps list ServiceInstances. +// All objects returned here must be treated as read-only. +type ServiceInstanceLister interface { + // List lists all ServiceInstances in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceInstance, err error) + // Get retrieves the ServiceInstance from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceInstance, error) + ServiceInstanceListerExpansion +} + +// serviceInstanceLister implements the ServiceInstanceLister interface. +type serviceInstanceLister struct { + indexer cache.Indexer +} + +// NewServiceInstanceLister returns a new ServiceInstanceLister. +func NewServiceInstanceLister(indexer cache.Indexer) ServiceInstanceLister { + return &serviceInstanceLister{indexer: indexer} +} + +// List lists all ServiceInstances in the indexer. +func (s *serviceInstanceLister) List(selector labels.Selector) (ret []*v1.ServiceInstance, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceInstance)) + }) + return ret, err +} + +// Get retrieves the ServiceInstance from the index for a given name. +func (s *serviceInstanceLister) Get(name string) (*v1.ServiceInstance, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("serviceinstance"), name) + } + return obj.(*v1.ServiceInstance), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceinstancecontainer.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceinstancecontainer.go new file mode 100644 index 000000000..8fadf914b --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceinstancecontainer.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceInstanceContainerLister helps list ServiceInstanceContainers. +// All objects returned here must be treated as read-only. +type ServiceInstanceContainerLister interface { + // List lists all ServiceInstanceContainers in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceInstanceContainer, err error) + // Get retrieves the ServiceInstanceContainer from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceInstanceContainer, error) + ServiceInstanceContainerListerExpansion +} + +// serviceInstanceContainerLister implements the ServiceInstanceContainerLister interface. +type serviceInstanceContainerLister struct { + indexer cache.Indexer +} + +// NewServiceInstanceContainerLister returns a new ServiceInstanceContainerLister. +func NewServiceInstanceContainerLister(indexer cache.Indexer) ServiceInstanceContainerLister { + return &serviceInstanceContainerLister{indexer: indexer} +} + +// List lists all ServiceInstanceContainers in the indexer. +func (s *serviceInstanceContainerLister) List(selector labels.Selector) (ret []*v1.ServiceInstanceContainer, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceInstanceContainer)) + }) + return ret, err +} + +// Get retrieves the ServiceInstanceContainer from the index for a given name. +func (s *serviceInstanceContainerLister) Get(name string) (*v1.ServiceInstanceContainer, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("serviceinstancecontainer"), name) + } + return obj.(*v1.ServiceInstanceContainer), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicejob.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicejob.go new file mode 100644 index 000000000..94392576a --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicejob.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceJobLister helps list ServiceJobs. +// All objects returned here must be treated as read-only. +type ServiceJobLister interface { + // List lists all ServiceJobs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceJob, err error) + // Get retrieves the ServiceJob from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceJob, error) + ServiceJobListerExpansion +} + +// serviceJobLister implements the ServiceJobLister interface. +type serviceJobLister struct { + indexer cache.Indexer +} + +// NewServiceJobLister returns a new ServiceJobLister. +func NewServiceJobLister(indexer cache.Indexer) ServiceJobLister { + return &serviceJobLister{indexer: indexer} +} + +// List lists all ServiceJobs in the indexer. +func (s *serviceJobLister) List(selector labels.Selector) (ret []*v1.ServiceJob, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceJob)) + }) + return ret, err +} + +// Get retrieves the ServiceJob from the index for a given name. +func (s *serviceJobLister) Get(name string) (*v1.ServiceJob, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicejob"), name) + } + return obj.(*v1.ServiceJob), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicelevelobjective.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicelevelobjective.go new file mode 100644 index 000000000..21cb5e186 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicelevelobjective.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceLevelObjectiveLister helps list ServiceLevelObjectives. +// All objects returned here must be treated as read-only. +type ServiceLevelObjectiveLister interface { + // List lists all ServiceLevelObjectives in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceLevelObjective, err error) + // Get retrieves the ServiceLevelObjective from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceLevelObjective, error) + ServiceLevelObjectiveListerExpansion +} + +// serviceLevelObjectiveLister implements the ServiceLevelObjectiveLister interface. +type serviceLevelObjectiveLister struct { + indexer cache.Indexer +} + +// NewServiceLevelObjectiveLister returns a new ServiceLevelObjectiveLister. +func NewServiceLevelObjectiveLister(indexer cache.Indexer) ServiceLevelObjectiveLister { + return &serviceLevelObjectiveLister{indexer: indexer} +} + +// List lists all ServiceLevelObjectives in the indexer. +func (s *serviceLevelObjectiveLister) List(selector labels.Selector) (ret []*v1.ServiceLevelObjective, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceLevelObjective)) + }) + return ret, err +} + +// Get retrieves the ServiceLevelObjective from the index for a given name. +func (s *serviceLevelObjectiveLister) Get(name string) (*v1.ServiceLevelObjective, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicelevelobjective"), name) + } + return obj.(*v1.ServiceLevelObjective), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicelevelobjectivefolder.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicelevelobjectivefolder.go new file mode 100644 index 000000000..8b5833e36 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicelevelobjectivefolder.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceLevelObjectiveFolderLister helps list ServiceLevelObjectiveFolders. +// All objects returned here must be treated as read-only. +type ServiceLevelObjectiveFolderLister interface { + // List lists all ServiceLevelObjectiveFolders in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceLevelObjectiveFolder, err error) + // Get retrieves the ServiceLevelObjectiveFolder from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceLevelObjectiveFolder, error) + ServiceLevelObjectiveFolderListerExpansion +} + +// serviceLevelObjectiveFolderLister implements the ServiceLevelObjectiveFolderLister interface. +type serviceLevelObjectiveFolderLister struct { + indexer cache.Indexer +} + +// NewServiceLevelObjectiveFolderLister returns a new ServiceLevelObjectiveFolderLister. +func NewServiceLevelObjectiveFolderLister(indexer cache.Indexer) ServiceLevelObjectiveFolderLister { + return &serviceLevelObjectiveFolderLister{indexer: indexer} +} + +// List lists all ServiceLevelObjectiveFolders in the indexer. +func (s *serviceLevelObjectiveFolderLister) List(selector labels.Selector) (ret []*v1.ServiceLevelObjectiveFolder, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceLevelObjectiveFolder)) + }) + return ret, err +} + +// Get retrieves the ServiceLevelObjectiveFolder from the index for a given name. +func (s *serviceLevelObjectiveFolderLister) Get(name string) (*v1.ServiceLevelObjectiveFolder, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicelevelobjectivefolder"), name) + } + return obj.(*v1.ServiceLevelObjectiveFolder), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicereplicaset.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicereplicaset.go new file mode 100644 index 000000000..885198b9f --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicereplicaset.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceReplicaSetLister helps list ServiceReplicaSets. +// All objects returned here must be treated as read-only. +type ServiceReplicaSetLister interface { + // List lists all ServiceReplicaSets in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceReplicaSet, err error) + // Get retrieves the ServiceReplicaSet from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceReplicaSet, error) + ServiceReplicaSetListerExpansion +} + +// serviceReplicaSetLister implements the ServiceReplicaSetLister interface. +type serviceReplicaSetLister struct { + indexer cache.Indexer +} + +// NewServiceReplicaSetLister returns a new ServiceReplicaSetLister. +func NewServiceReplicaSetLister(indexer cache.Indexer) ServiceReplicaSetLister { + return &serviceReplicaSetLister{indexer: indexer} +} + +// List lists all ServiceReplicaSets in the indexer. +func (s *serviceReplicaSetLister) List(selector labels.Selector) (ret []*v1.ServiceReplicaSet, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceReplicaSet)) + }) + return ret, err +} + +// Get retrieves the ServiceReplicaSet from the index for a given name. +func (s *serviceReplicaSetLister) Get(name string) (*v1.ServiceReplicaSet, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicereplicaset"), name) + } + return obj.(*v1.ServiceReplicaSet), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicestatefulset.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicestatefulset.go new file mode 100644 index 000000000..1c09145a1 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicestatefulset.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceStatefulSetLister helps list ServiceStatefulSets. +// All objects returned here must be treated as read-only. +type ServiceStatefulSetLister interface { + // List lists all ServiceStatefulSets in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceStatefulSet, err error) + // Get retrieves the ServiceStatefulSet from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceStatefulSet, error) + ServiceStatefulSetListerExpansion +} + +// serviceStatefulSetLister implements the ServiceStatefulSetLister interface. +type serviceStatefulSetLister struct { + indexer cache.Indexer +} + +// NewServiceStatefulSetLister returns a new ServiceStatefulSetLister. +func NewServiceStatefulSetLister(indexer cache.Indexer) ServiceStatefulSetLister { + return &serviceStatefulSetLister{indexer: indexer} +} + +// List lists all ServiceStatefulSets in the indexer. +func (s *serviceStatefulSetLister) List(selector labels.Selector) (ret []*v1.ServiceStatefulSet, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceStatefulSet)) + }) + return ret, err +} + +// Get retrieves the ServiceStatefulSet from the index for a given name. +func (s *serviceStatefulSetLister) Get(name string) (*v1.ServiceStatefulSet, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicestatefulset"), name) + } + return obj.(*v1.ServiceStatefulSet), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicetemplate.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicetemplate.go new file mode 100644 index 000000000..78c23a664 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicetemplate.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceTemplateLister helps list ServiceTemplates. +// All objects returned here must be treated as read-only. +type ServiceTemplateLister interface { + // List lists all ServiceTemplates in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceTemplate, err error) + // Get retrieves the ServiceTemplate from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceTemplate, error) + ServiceTemplateListerExpansion +} + +// serviceTemplateLister implements the ServiceTemplateLister interface. +type serviceTemplateLister struct { + indexer cache.Indexer +} + +// NewServiceTemplateLister returns a new ServiceTemplateLister. +func NewServiceTemplateLister(indexer cache.Indexer) ServiceTemplateLister { + return &serviceTemplateLister{indexer: indexer} +} + +// List lists all ServiceTemplates in the indexer. +func (s *serviceTemplateLister) List(selector labels.Selector) (ret []*v1.ServiceTemplate, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceTemplate)) + }) + return ret, err +} + +// Get retrieves the ServiceTemplate from the index for a given name. +func (s *serviceTemplateLister) Get(name string) (*v1.ServiceTemplate, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicetemplate"), name) + } + return obj.(*v1.ServiceTemplate), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicetemplateservicedefinition.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicetemplateservicedefinition.go new file mode 100644 index 000000000..8feac316e --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/servicetemplateservicedefinition.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceTemplateServiceDefinitionLister helps list ServiceTemplateServiceDefinitions. +// All objects returned here must be treated as read-only. +type ServiceTemplateServiceDefinitionLister interface { + // List lists all ServiceTemplateServiceDefinitions in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceTemplateServiceDefinition, err error) + // Get retrieves the ServiceTemplateServiceDefinition from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceTemplateServiceDefinition, error) + ServiceTemplateServiceDefinitionListerExpansion +} + +// serviceTemplateServiceDefinitionLister implements the ServiceTemplateServiceDefinitionLister interface. +type serviceTemplateServiceDefinitionLister struct { + indexer cache.Indexer +} + +// NewServiceTemplateServiceDefinitionLister returns a new ServiceTemplateServiceDefinitionLister. +func NewServiceTemplateServiceDefinitionLister(indexer cache.Indexer) ServiceTemplateServiceDefinitionLister { + return &serviceTemplateServiceDefinitionLister{indexer: indexer} +} + +// List lists all ServiceTemplateServiceDefinitions in the indexer. +func (s *serviceTemplateServiceDefinitionLister) List(selector labels.Selector) (ret []*v1.ServiceTemplateServiceDefinition, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceTemplateServiceDefinition)) + }) + return ret, err +} + +// Get retrieves the ServiceTemplateServiceDefinition from the index for a given name. +func (s *serviceTemplateServiceDefinitionLister) Get(name string) (*v1.ServiceTemplateServiceDefinition, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicetemplateservicedefinition"), name) + } + return obj.(*v1.ServiceTemplateServiceDefinition), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceversion.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceversion.go new file mode 100644 index 000000000..084d14226 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceversion.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceVersionLister helps list ServiceVersions. +// All objects returned here must be treated as read-only. +type ServiceVersionLister interface { + // List lists all ServiceVersions in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceVersion, err error) + // Get retrieves the ServiceVersion from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceVersion, error) + ServiceVersionListerExpansion +} + +// serviceVersionLister implements the ServiceVersionLister interface. +type serviceVersionLister struct { + indexer cache.Indexer +} + +// NewServiceVersionLister returns a new ServiceVersionLister. +func NewServiceVersionLister(indexer cache.Indexer) ServiceVersionLister { + return &serviceVersionLister{indexer: indexer} +} + +// List lists all ServiceVersions in the indexer. +func (s *serviceVersionLister) List(selector labels.Selector) (ret []*v1.ServiceVersion, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceVersion)) + }) + return ret, err +} + +// Get retrieves the ServiceVersion from the index for a given name. +func (s *serviceVersionLister) Get(name string) (*v1.ServiceVersion, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("serviceversion"), name) + } + return obj.(*v1.ServiceVersion), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceversionconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceversionconfig.go new file mode 100644 index 000000000..bba772b0b --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/serviceversionconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceVersionConfigLister helps list ServiceVersionConfigs. +// All objects returned here must be treated as read-only. +type ServiceVersionConfigLister interface { + // List lists all ServiceVersionConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceVersionConfig, err error) + // Get retrieves the ServiceVersionConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceVersionConfig, error) + ServiceVersionConfigListerExpansion +} + +// serviceVersionConfigLister implements the ServiceVersionConfigLister interface. +type serviceVersionConfigLister struct { + indexer cache.Indexer +} + +// NewServiceVersionConfigLister returns a new ServiceVersionConfigLister. +func NewServiceVersionConfigLister(indexer cache.Indexer) ServiceVersionConfigLister { + return &serviceVersionConfigLister{indexer: indexer} +} + +// List lists all ServiceVersionConfigs in the indexer. +func (s *serviceVersionConfigLister) List(selector labels.Selector) (ret []*v1.ServiceVersionConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceVersionConfig)) + }) + return ret, err +} + +// Get retrieves the ServiceVersionConfig from the index for a given name. +func (s *serviceVersionConfigLister) Get(name string) (*v1.ServiceVersionConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("serviceversionconfig"), name) + } + return obj.(*v1.ServiceVersionConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/sharedserviceconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/sharedserviceconfig.go new file mode 100644 index 000000000..239def523 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/sharedserviceconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// SharedServiceConfigLister helps list SharedServiceConfigs. +// All objects returned here must be treated as read-only. +type SharedServiceConfigLister interface { + // List lists all SharedServiceConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.SharedServiceConfig, err error) + // Get retrieves the SharedServiceConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.SharedServiceConfig, error) + SharedServiceConfigListerExpansion +} + +// sharedServiceConfigLister implements the SharedServiceConfigLister interface. +type sharedServiceConfigLister struct { + indexer cache.Indexer +} + +// NewSharedServiceConfigLister returns a new SharedServiceConfigLister. +func NewSharedServiceConfigLister(indexer cache.Indexer) SharedServiceConfigLister { + return &sharedServiceConfigLister{indexer: indexer} +} + +// List lists all SharedServiceConfigs in the indexer. +func (s *sharedServiceConfigLister) List(selector labels.Selector) (ret []*v1.SharedServiceConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.SharedServiceConfig)) + }) + return ret, err +} + +// Get retrieves the SharedServiceConfig from the index for a given name. +func (s *sharedServiceConfigLister) Get(name string) (*v1.SharedServiceConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("sharedserviceconfig"), name) + } + return obj.(*v1.SharedServiceConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/sloconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/sloconfig.go new file mode 100644 index 000000000..6b08ce8b3 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/sloconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// SloConfigLister helps list SloConfigs. +// All objects returned here must be treated as read-only. +type SloConfigLister interface { + // List lists all SloConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.SloConfig, err error) + // Get retrieves the SloConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.SloConfig, error) + SloConfigListerExpansion +} + +// sloConfigLister implements the SloConfigLister interface. +type sloConfigLister struct { + indexer cache.Indexer +} + +// NewSloConfigLister returns a new SloConfigLister. +func NewSloConfigLister(indexer cache.Indexer) SloConfigLister { + return &sloConfigLister{indexer: indexer} +} + +// List lists all SloConfigs in the indexer. +func (s *sloConfigLister) List(selector labels.Selector) (ret []*v1.SloConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.SloConfig)) + }) + return ret, err +} + +// Get retrieves the SloConfig from the index for a given name. +func (s *sloConfigLister) Get(name string) (*v1.SloConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("sloconfig"), name) + } + return obj.(*v1.SloConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/slofolder.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/slofolder.go new file mode 100644 index 000000000..ac8929446 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/slofolder.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// SLOFolderLister helps list SLOFolders. +// All objects returned here must be treated as read-only. +type SLOFolderLister interface { + // List lists all SLOFolders in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.SLOFolder, err error) + // Get retrieves the SLOFolder from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.SLOFolder, error) + SLOFolderListerExpansion +} + +// sLOFolderLister implements the SLOFolderLister interface. +type sLOFolderLister struct { + indexer cache.Indexer +} + +// NewSLOFolderLister returns a new SLOFolderLister. +func NewSLOFolderLister(indexer cache.Indexer) SLOFolderLister { + return &sLOFolderLister{indexer: indexer} +} + +// List lists all SLOFolders in the indexer. +func (s *sLOFolderLister) List(selector labels.Selector) (ret []*v1.SLOFolder, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.SLOFolder)) + }) + return ret, err +} + +// Get retrieves the SLOFolder from the index for a given name. +func (s *sLOFolderLister) Get(name string) (*v1.SLOFolder, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("slofolder"), name) + } + return obj.(*v1.SLOFolder), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/slopolicy.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/slopolicy.go new file mode 100644 index 000000000..61ff95d92 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/slopolicy.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// SLOPolicyLister helps list SLOPolicies. +// All objects returned here must be treated as read-only. +type SLOPolicyLister interface { + // List lists all SLOPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.SLOPolicy, err error) + // Get retrieves the SLOPolicy from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.SLOPolicy, error) + SLOPolicyListerExpansion +} + +// sLOPolicyLister implements the SLOPolicyLister interface. +type sLOPolicyLister struct { + indexer cache.Indexer +} + +// NewSLOPolicyLister returns a new SLOPolicyLister. +func NewSLOPolicyLister(indexer cache.Indexer) SLOPolicyLister { + return &sLOPolicyLister{indexer: indexer} +} + +// List lists all SLOPolicies in the indexer. +func (s *sLOPolicyLister) List(selector labels.Selector) (ret []*v1.SLOPolicy, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.SLOPolicy)) + }) + return ret, err +} + +// Get retrieves the SLOPolicy from the index for a given name. +func (s *sLOPolicyLister) Get(name string) (*v1.SLOPolicy, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("slopolicy"), name) + } + return obj.(*v1.SLOPolicy), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/sloserviceconfig.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/sloserviceconfig.go new file mode 100644 index 000000000..1775d1718 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/sloserviceconfig.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// SloServiceConfigLister helps list SloServiceConfigs. +// All objects returned here must be treated as read-only. +type SloServiceConfigLister interface { + // List lists all SloServiceConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.SloServiceConfig, err error) + // Get retrieves the SloServiceConfig from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.SloServiceConfig, error) + SloServiceConfigListerExpansion +} + +// sloServiceConfigLister implements the SloServiceConfigLister interface. +type sloServiceConfigLister struct { + indexer cache.Indexer +} + +// NewSloServiceConfigLister returns a new SloServiceConfigLister. +func NewSloServiceConfigLister(indexer cache.Indexer) SloServiceConfigLister { + return &sloServiceConfigLister{indexer: indexer} +} + +// List lists all SloServiceConfigs in the indexer. +func (s *sloServiceConfigLister) List(selector labels.Selector) (ret []*v1.SloServiceConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.SloServiceConfig)) + }) + return ret, err +} + +// Get retrieves the SloServiceConfig from the index for a given name. +func (s *sloServiceConfigLister) Get(name string) (*v1.SloServiceConfig, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("sloserviceconfig"), name) + } + return obj.(*v1.SloServiceConfig), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/svcgroup.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/svcgroup.go new file mode 100644 index 000000000..e7f58901e --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/svcgroup.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// SvcGroupLister helps list SvcGroups. +// All objects returned here must be treated as read-only. +type SvcGroupLister interface { + // List lists all SvcGroups in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.SvcGroup, err error) + // Get retrieves the SvcGroup from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.SvcGroup, error) + SvcGroupListerExpansion +} + +// svcGroupLister implements the SvcGroupLister interface. +type svcGroupLister struct { + indexer cache.Indexer +} + +// NewSvcGroupLister returns a new SvcGroupLister. +func NewSvcGroupLister(indexer cache.Indexer) SvcGroupLister { + return &svcGroupLister{indexer: indexer} +} + +// List lists all SvcGroups in the indexer. +func (s *svcGroupLister) List(selector labels.Selector) (ret []*v1.SvcGroup, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.SvcGroup)) + }) + return ret, err +} + +// Get retrieves the SvcGroup from the index for a given name. +func (s *svcGroupLister) Get(name string) (*v1.SvcGroup, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("svcgroup"), name) + } + return obj.(*v1.SvcGroup), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/svcgrouprt.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/svcgrouprt.go new file mode 100644 index 000000000..45f3c7124 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/svcgrouprt.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// SvcGroupRTLister helps list SvcGroupRTs. +// All objects returned here must be treated as read-only. +type SvcGroupRTLister interface { + // List lists all SvcGroupRTs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.SvcGroupRT, err error) + // Get retrieves the SvcGroupRT from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.SvcGroupRT, error) + SvcGroupRTListerExpansion +} + +// svcGroupRTLister implements the SvcGroupRTLister interface. +type svcGroupRTLister struct { + indexer cache.Indexer +} + +// NewSvcGroupRTLister returns a new SvcGroupRTLister. +func NewSvcGroupRTLister(indexer cache.Indexer) SvcGroupRTLister { + return &svcGroupRTLister{indexer: indexer} +} + +// List lists all SvcGroupRTs in the indexer. +func (s *svcGroupRTLister) List(selector labels.Selector) (ret []*v1.SvcGroupRT, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.SvcGroupRT)) + }) + return ret, err +} + +// Get retrieves the SvcGroupRT from the index for a given name. +func (s *svcGroupRTLister) Get(name string) (*v1.SvcGroupRT, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("svcgrouprt"), name) + } + return obj.(*v1.SvcGroupRT), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/table.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/table.go new file mode 100644 index 000000000..b3abbc079 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/table.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// TableLister helps list Tables. +// All objects returned here must be treated as read-only. +type TableLister interface { + // List lists all Tables in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Table, err error) + // Get retrieves the Table from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Table, error) + TableListerExpansion +} + +// tableLister implements the TableLister interface. +type tableLister struct { + indexer cache.Indexer +} + +// NewTableLister returns a new TableLister. +func NewTableLister(indexer cache.Indexer) TableLister { + return &tableLister{indexer: indexer} +} + +// List lists all Tables in the indexer. +func (s *tableLister) List(selector labels.Selector) (ret []*v1.Table, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Table)) + }) + return ret, err +} + +// Get retrieves the Table from the index for a given name. +func (s *tableLister) Get(name string) (*v1.Table, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("table"), name) + } + return obj.(*v1.Table), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/template.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/template.go new file mode 100644 index 000000000..5c8e3ad9e --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/template.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// TemplateLister helps list Templates. +// All objects returned here must be treated as read-only. +type TemplateLister interface { + // List lists all Templates in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Template, err error) + // Get retrieves the Template from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Template, error) + TemplateListerExpansion +} + +// templateLister implements the TemplateLister interface. +type templateLister struct { + indexer cache.Indexer +} + +// NewTemplateLister returns a new TemplateLister. +func NewTemplateLister(indexer cache.Indexer) TemplateLister { + return &templateLister{indexer: indexer} +} + +// List lists all Templates in the indexer. +func (s *templateLister) List(selector labels.Selector) (ret []*v1.Template, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Template)) + }) + return ret, err +} + +// Get retrieves the Template from the index for a given name. +func (s *templateLister) Get(name string) (*v1.Template, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("template"), name) + } + return obj.(*v1.Template), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/templategroup.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/templategroup.go new file mode 100644 index 000000000..a3d5b175d --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/templategroup.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// TemplateGroupLister helps list TemplateGroups. +// All objects returned here must be treated as read-only. +type TemplateGroupLister interface { + // List lists all TemplateGroups in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.TemplateGroup, err error) + // Get retrieves the TemplateGroup from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.TemplateGroup, error) + TemplateGroupListerExpansion +} + +// templateGroupLister implements the TemplateGroupLister interface. +type templateGroupLister struct { + indexer cache.Indexer +} + +// NewTemplateGroupLister returns a new TemplateGroupLister. +func NewTemplateGroupLister(indexer cache.Indexer) TemplateGroupLister { + return &templateGroupLister{indexer: indexer} +} + +// List lists all TemplateGroups in the indexer. +func (s *templateGroupLister) List(selector labels.Selector) (ret []*v1.TemplateGroup, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.TemplateGroup)) + }) + return ret, err +} + +// Get retrieves the TemplateGroup from the index for a given name. +func (s *templateGroupLister) Get(name string) (*v1.TemplateGroup, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("templategroup"), name) + } + return obj.(*v1.TemplateGroup), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/tenant.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/tenant.go new file mode 100644 index 000000000..b2bb4df10 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/tenant.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// TenantLister helps list Tenants. +// All objects returned here must be treated as read-only. +type TenantLister interface { + // List lists all Tenants in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Tenant, err error) + // Get retrieves the Tenant from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Tenant, error) + TenantListerExpansion +} + +// tenantLister implements the TenantLister interface. +type tenantLister struct { + indexer cache.Indexer +} + +// NewTenantLister returns a new TenantLister. +func NewTenantLister(indexer cache.Indexer) TenantLister { + return &tenantLister{indexer: indexer} +} + +// List lists all Tenants in the indexer. +func (s *tenantLister) List(selector labels.Selector) (ret []*v1.Tenant, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Tenant)) + }) + return ret, err +} + +// Get retrieves the Tenant from the index for a given name. +func (s *tenantLister) Get(name string) (*v1.Tenant, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("tenant"), name) + } + return obj.(*v1.Tenant), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/tenantresource.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/tenantresource.go new file mode 100644 index 000000000..b2d3f32f6 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/tenantresource.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// TenantResourceLister helps list TenantResources. +// All objects returned here must be treated as read-only. +type TenantResourceLister interface { + // List lists all TenantResources in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.TenantResource, err error) + // Get retrieves the TenantResource from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.TenantResource, error) + TenantResourceListerExpansion +} + +// tenantResourceLister implements the TenantResourceLister interface. +type tenantResourceLister struct { + indexer cache.Indexer +} + +// NewTenantResourceLister returns a new TenantResourceLister. +func NewTenantResourceLister(indexer cache.Indexer) TenantResourceLister { + return &tenantResourceLister{indexer: indexer} +} + +// List lists all TenantResources in the indexer. +func (s *tenantResourceLister) List(selector labels.Selector) (ret []*v1.TenantResource, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.TenantResource)) + }) + return ret, err +} + +// Get retrieves the TenantResource from the index for a given name. +func (s *tenantResourceLister) Get(name string) (*v1.TenantResource, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("tenantresource"), name) + } + return obj.(*v1.TenantResource), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/tenanttoken.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/tenanttoken.go new file mode 100644 index 000000000..f8d4e7249 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/tenanttoken.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// TenantTokenLister helps list TenantTokens. +// All objects returned here must be treated as read-only. +type TenantTokenLister interface { + // List lists all TenantTokens in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.TenantToken, err error) + // Get retrieves the TenantToken from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.TenantToken, error) + TenantTokenListerExpansion +} + +// tenantTokenLister implements the TenantTokenLister interface. +type tenantTokenLister struct { + indexer cache.Indexer +} + +// NewTenantTokenLister returns a new TenantTokenLister. +func NewTenantTokenLister(indexer cache.Indexer) TenantTokenLister { + return &tenantTokenLister{indexer: indexer} +} + +// List lists all TenantTokens in the indexer. +func (s *tenantTokenLister) List(selector labels.Selector) (ret []*v1.TenantToken, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.TenantToken)) + }) + return ret, err +} + +// Get retrieves the TenantToken from the index for a given name. +func (s *tenantTokenLister) Get(name string) (*v1.TenantToken, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("tenanttoken"), name) + } + return obj.(*v1.TenantToken), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/user.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/user.go new file mode 100644 index 000000000..38d704216 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/user.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// UserLister helps list Users. +// All objects returned here must be treated as read-only. +type UserLister interface { + // List lists all Users in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.User, err error) + // Get retrieves the User from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.User, error) + UserListerExpansion +} + +// userLister implements the UserLister interface. +type userLister struct { + indexer cache.Indexer +} + +// NewUserLister returns a new UserLister. +func NewUserLister(indexer cache.Indexer) UserLister { + return &userLister{indexer: indexer} +} + +// List lists all Users in the indexer. +func (s *userLister) List(selector labels.Selector) (ret []*v1.User, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.User)) + }) + return ret, err +} + +// Get retrieves the User from the index for a given name. +func (s *userLister) Get(name string) (*v1.User, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("user"), name) + } + return obj.(*v1.User), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/userdiscovery.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/userdiscovery.go new file mode 100644 index 000000000..aef7ecab2 --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/userdiscovery.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// UserDiscoveryLister helps list UserDiscoveries. +// All objects returned here must be treated as read-only. +type UserDiscoveryLister interface { + // List lists all UserDiscoveries in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.UserDiscovery, err error) + // Get retrieves the UserDiscovery from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.UserDiscovery, error) + UserDiscoveryListerExpansion +} + +// userDiscoveryLister implements the UserDiscoveryLister interface. +type userDiscoveryLister struct { + indexer cache.Indexer +} + +// NewUserDiscoveryLister returns a new UserDiscoveryLister. +func NewUserDiscoveryLister(indexer cache.Indexer) UserDiscoveryLister { + return &userDiscoveryLister{indexer: indexer} +} + +// List lists all UserDiscoveries in the indexer. +func (s *userDiscoveryLister) List(selector labels.Selector) (ret []*v1.UserDiscovery, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.UserDiscovery)) + }) + return ret, err +} + +// Get retrieves the UserDiscovery from the index for a given name. +func (s *userDiscoveryLister) Get(name string) (*v1.UserDiscovery, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("userdiscovery"), name) + } + return obj.(*v1.UserDiscovery), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/userdiscoveryrt.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/userdiscoveryrt.go new file mode 100644 index 000000000..901c6d67e --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/userdiscoveryrt.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// UserDiscoveryRTLister helps list UserDiscoveryRTs. +// All objects returned here must be treated as read-only. +type UserDiscoveryRTLister interface { + // List lists all UserDiscoveryRTs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.UserDiscoveryRT, err error) + // Get retrieves the UserDiscoveryRT from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.UserDiscoveryRT, error) + UserDiscoveryRTListerExpansion +} + +// userDiscoveryRTLister implements the UserDiscoveryRTLister interface. +type userDiscoveryRTLister struct { + indexer cache.Indexer +} + +// NewUserDiscoveryRTLister returns a new UserDiscoveryRTLister. +func NewUserDiscoveryRTLister(indexer cache.Indexer) UserDiscoveryRTLister { + return &userDiscoveryRTLister{indexer: indexer} +} + +// List lists all UserDiscoveryRTs in the indexer. +func (s *userDiscoveryRTLister) List(selector labels.Selector) (ret []*v1.UserDiscoveryRT, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.UserDiscoveryRT)) + }) + return ret, err +} + +// Get retrieves the UserDiscoveryRT from the index for a given name. +func (s *userDiscoveryRTLister) Get(name string) (*v1.UserDiscoveryRT, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("userdiscoveryrt"), name) + } + return obj.(*v1.UserDiscoveryRT), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/userfolder.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/userfolder.go new file mode 100644 index 000000000..12480d64b --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/userfolder.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// UserFolderLister helps list UserFolders. +// All objects returned here must be treated as read-only. +type UserFolderLister interface { + // List lists all UserFolders in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.UserFolder, err error) + // Get retrieves the UserFolder from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.UserFolder, error) + UserFolderListerExpansion +} + +// userFolderLister implements the UserFolderLister interface. +type userFolderLister struct { + indexer cache.Indexer +} + +// NewUserFolderLister returns a new UserFolderLister. +func NewUserFolderLister(indexer cache.Indexer) UserFolderLister { + return &userFolderLister{indexer: indexer} +} + +// List lists all UserFolders in the indexer. +func (s *userFolderLister) List(selector labels.Selector) (ret []*v1.UserFolder, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.UserFolder)) + }) + return ret, err +} + +// Get retrieves the UserFolder from the index for a given name. +func (s *userFolderLister) Get(name string) (*v1.UserFolder, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("userfolder"), name) + } + return obj.(*v1.UserFolder), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/usergroup.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/usergroup.go new file mode 100644 index 000000000..52d8382ea --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/usergroup.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// UserGroupLister helps list UserGroups. +// All objects returned here must be treated as read-only. +type UserGroupLister interface { + // List lists all UserGroups in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.UserGroup, err error) + // Get retrieves the UserGroup from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.UserGroup, error) + UserGroupListerExpansion +} + +// userGroupLister implements the UserGroupLister interface. +type userGroupLister struct { + indexer cache.Indexer +} + +// NewUserGroupLister returns a new UserGroupLister. +func NewUserGroupLister(indexer cache.Indexer) UserGroupLister { + return &userGroupLister{indexer: indexer} +} + +// List lists all UserGroups in the indexer. +func (s *userGroupLister) List(selector labels.Selector) (ret []*v1.UserGroup, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.UserGroup)) + }) + return ret, err +} + +// Get retrieves the UserGroup from the index for a given name. +func (s *userGroupLister) Get(name string) (*v1.UserGroup, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("usergroup"), name) + } + return obj.(*v1.UserGroup), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/userpreference.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/userpreference.go new file mode 100644 index 000000000..f523a48aa --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/userpreference.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// UserPreferenceLister helps list UserPreferences. +// All objects returned here must be treated as read-only. +type UserPreferenceLister interface { + // List lists all UserPreferences in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.UserPreference, err error) + // Get retrieves the UserPreference from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.UserPreference, error) + UserPreferenceListerExpansion +} + +// userPreferenceLister implements the UserPreferenceLister interface. +type userPreferenceLister struct { + indexer cache.Indexer +} + +// NewUserPreferenceLister returns a new UserPreferenceLister. +func NewUserPreferenceLister(indexer cache.Indexer) UserPreferenceLister { + return &userPreferenceLister{indexer: indexer} +} + +// List lists all UserPreferences in the indexer. +func (s *userPreferenceLister) List(selector labels.Selector) (ret []*v1.UserPreference, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.UserPreference)) + }) + return ret, err +} + +// Get retrieves the UserPreference from the index for a given name. +func (s *userPreferenceLister) Get(name string) (*v1.UserPreference, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("userpreference"), name) + } + return obj.(*v1.UserPreference), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/virtualservice.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/virtualservice.go new file mode 100644 index 000000000..73e0e5bad --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/virtualservice.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// VirtualServiceLister helps list VirtualServices. +// All objects returned here must be treated as read-only. +type VirtualServiceLister interface { + // List lists all VirtualServices in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.VirtualService, err error) + // Get retrieves the VirtualService from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.VirtualService, error) + VirtualServiceListerExpansion +} + +// virtualServiceLister implements the VirtualServiceLister interface. +type virtualServiceLister struct { + indexer cache.Indexer +} + +// NewVirtualServiceLister returns a new VirtualServiceLister. +func NewVirtualServiceLister(indexer cache.Indexer) VirtualServiceLister { + return &virtualServiceLister{indexer: indexer} +} + +// List lists all VirtualServices in the indexer. +func (s *virtualServiceLister) List(selector labels.Selector) (ret []*v1.VirtualService, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.VirtualService)) + }) + return ret, err +} + +// Get retrieves the VirtualService from the index for a given name. +func (s *virtualServiceLister) Get(name string) (*v1.VirtualService, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("virtualservice"), name) + } + return obj.(*v1.VirtualService), nil +} diff --git a/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/workloadentry.go b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/workloadentry.go new file mode 100644 index 000000000..53ce6b71f --- /dev/null +++ b/compiler/example/output/generated/client/listers/global.tsm.tanzu.vmware.com/v1/workloadentry.go @@ -0,0 +1,69 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// WorkloadEntryLister helps list WorkloadEntries. +// All objects returned here must be treated as read-only. +type WorkloadEntryLister interface { + // List lists all WorkloadEntries in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.WorkloadEntry, err error) + // Get retrieves the WorkloadEntry from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.WorkloadEntry, error) + WorkloadEntryListerExpansion +} + +// workloadEntryLister implements the WorkloadEntryLister interface. +type workloadEntryLister struct { + indexer cache.Indexer +} + +// NewWorkloadEntryLister returns a new WorkloadEntryLister. +func NewWorkloadEntryLister(indexer cache.Indexer) WorkloadEntryLister { + return &workloadEntryLister{indexer: indexer} +} + +// List lists all WorkloadEntries in the indexer. +func (s *workloadEntryLister) List(selector labels.Selector) (ret []*v1.WorkloadEntry, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.WorkloadEntry)) + }) + return ret, err +} + +// Get retrieves the WorkloadEntry from the index for a given name. +func (s *workloadEntryLister) Get(name string) (*v1.WorkloadEntry, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("workloadentry"), name) + } + return obj.(*v1.WorkloadEntry), nil +} diff --git a/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/additionalgnsdata.go b/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/additionalgnsdata.go deleted file mode 100644 index 6011a8d56..000000000 --- a/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/additionalgnsdata.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// AdditionalGnsDataLister helps list AdditionalGnsDatas. -// All objects returned here must be treated as read-only. -type AdditionalGnsDataLister interface { - // List lists all AdditionalGnsDatas in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.AdditionalGnsData, err error) - // Get retrieves the AdditionalGnsData from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.AdditionalGnsData, error) - AdditionalGnsDataListerExpansion -} - -// additionalGnsDataLister implements the AdditionalGnsDataLister interface. -type additionalGnsDataLister struct { - indexer cache.Indexer -} - -// NewAdditionalGnsDataLister returns a new AdditionalGnsDataLister. -func NewAdditionalGnsDataLister(indexer cache.Indexer) AdditionalGnsDataLister { - return &additionalGnsDataLister{indexer: indexer} -} - -// List lists all AdditionalGnsDatas in the indexer. -func (s *additionalGnsDataLister) List(selector labels.Selector) (ret []*v1.AdditionalGnsData, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.AdditionalGnsData)) - }) - return ret, err -} - -// Get retrieves the AdditionalGnsData from the index for a given name. -func (s *additionalGnsDataLister) Get(name string) (*v1.AdditionalGnsData, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("additionalgnsdata"), name) - } - return obj.(*v1.AdditionalGnsData), nil -} diff --git a/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/barchild.go b/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/barchild.go deleted file mode 100644 index 7a6bfbd1d..000000000 --- a/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/barchild.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// BarChildLister helps list BarChilds. -// All objects returned here must be treated as read-only. -type BarChildLister interface { - // List lists all BarChilds in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.BarChild, err error) - // Get retrieves the BarChild from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.BarChild, error) - BarChildListerExpansion -} - -// barChildLister implements the BarChildLister interface. -type barChildLister struct { - indexer cache.Indexer -} - -// NewBarChildLister returns a new BarChildLister. -func NewBarChildLister(indexer cache.Indexer) BarChildLister { - return &barChildLister{indexer: indexer} -} - -// List lists all BarChilds in the indexer. -func (s *barChildLister) List(selector labels.Selector) (ret []*v1.BarChild, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.BarChild)) - }) - return ret, err -} - -// Get retrieves the BarChild from the index for a given name. -func (s *barChildLister) Get(name string) (*v1.BarChild, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("barchild"), name) - } - return obj.(*v1.BarChild), nil -} diff --git a/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/dns.go b/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/dns.go deleted file mode 100644 index 1695cdcec..000000000 --- a/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/dns.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// DnsLister helps list Dnses. -// All objects returned here must be treated as read-only. -type DnsLister interface { - // List lists all Dnses in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Dns, err error) - // Get retrieves the Dns from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.Dns, error) - DnsListerExpansion -} - -// dnsLister implements the DnsLister interface. -type dnsLister struct { - indexer cache.Indexer -} - -// NewDnsLister returns a new DnsLister. -func NewDnsLister(indexer cache.Indexer) DnsLister { - return &dnsLister{indexer: indexer} -} - -// List lists all Dnses in the indexer. -func (s *dnsLister) List(selector labels.Selector) (ret []*v1.Dns, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Dns)) - }) - return ret, err -} - -// Get retrieves the Dns from the index for a given name. -func (s *dnsLister) Get(name string) (*v1.Dns, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("dns"), name) - } - return obj.(*v1.Dns), nil -} diff --git a/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/expansion_generated.go b/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/expansion_generated.go deleted file mode 100644 index 335b9c4f3..000000000 --- a/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/expansion_generated.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -// AdditionalGnsDataListerExpansion allows custom methods to be added to -// AdditionalGnsDataLister. -type AdditionalGnsDataListerExpansion interface{} - -// BarChildListerExpansion allows custom methods to be added to -// BarChildLister. -type BarChildListerExpansion interface{} - -// DnsListerExpansion allows custom methods to be added to -// DnsLister. -type DnsListerExpansion interface{} - -// FooListerExpansion allows custom methods to be added to -// FooLister. -type FooListerExpansion interface{} - -// GnsListerExpansion allows custom methods to be added to -// GnsLister. -type GnsListerExpansion interface{} - -// IgnoreChildListerExpansion allows custom methods to be added to -// IgnoreChildLister. -type IgnoreChildListerExpansion interface{} - -// RandomGnsDataListerExpansion allows custom methods to be added to -// RandomGnsDataLister. -type RandomGnsDataListerExpansion interface{} diff --git a/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/foo.go b/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/foo.go deleted file mode 100644 index 451abde69..000000000 --- a/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/foo.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// FooLister helps list Foos. -// All objects returned here must be treated as read-only. -type FooLister interface { - // List lists all Foos in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Foo, err error) - // Get retrieves the Foo from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.Foo, error) - FooListerExpansion -} - -// fooLister implements the FooLister interface. -type fooLister struct { - indexer cache.Indexer -} - -// NewFooLister returns a new FooLister. -func NewFooLister(indexer cache.Indexer) FooLister { - return &fooLister{indexer: indexer} -} - -// List lists all Foos in the indexer. -func (s *fooLister) List(selector labels.Selector) (ret []*v1.Foo, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Foo)) - }) - return ret, err -} - -// Get retrieves the Foo from the index for a given name. -func (s *fooLister) Get(name string) (*v1.Foo, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("foo"), name) - } - return obj.(*v1.Foo), nil -} diff --git a/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/gns.go b/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/gns.go deleted file mode 100644 index 0b3df3258..000000000 --- a/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/gns.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// GnsLister helps list Gnses. -// All objects returned here must be treated as read-only. -type GnsLister interface { - // List lists all Gnses in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Gns, err error) - // Get retrieves the Gns from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.Gns, error) - GnsListerExpansion -} - -// gnsLister implements the GnsLister interface. -type gnsLister struct { - indexer cache.Indexer -} - -// NewGnsLister returns a new GnsLister. -func NewGnsLister(indexer cache.Indexer) GnsLister { - return &gnsLister{indexer: indexer} -} - -// List lists all Gnses in the indexer. -func (s *gnsLister) List(selector labels.Selector) (ret []*v1.Gns, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Gns)) - }) - return ret, err -} - -// Get retrieves the Gns from the index for a given name. -func (s *gnsLister) Get(name string) (*v1.Gns, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("gns"), name) - } - return obj.(*v1.Gns), nil -} diff --git a/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/ignorechild.go b/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/ignorechild.go deleted file mode 100644 index 16ed422fa..000000000 --- a/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/ignorechild.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// IgnoreChildLister helps list IgnoreChilds. -// All objects returned here must be treated as read-only. -type IgnoreChildLister interface { - // List lists all IgnoreChilds in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.IgnoreChild, err error) - // Get retrieves the IgnoreChild from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.IgnoreChild, error) - IgnoreChildListerExpansion -} - -// ignoreChildLister implements the IgnoreChildLister interface. -type ignoreChildLister struct { - indexer cache.Indexer -} - -// NewIgnoreChildLister returns a new IgnoreChildLister. -func NewIgnoreChildLister(indexer cache.Indexer) IgnoreChildLister { - return &ignoreChildLister{indexer: indexer} -} - -// List lists all IgnoreChilds in the indexer. -func (s *ignoreChildLister) List(selector labels.Selector) (ret []*v1.IgnoreChild, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.IgnoreChild)) - }) - return ret, err -} - -// Get retrieves the IgnoreChild from the index for a given name. -func (s *ignoreChildLister) Get(name string) (*v1.IgnoreChild, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("ignorechild"), name) - } - return obj.(*v1.IgnoreChild), nil -} diff --git a/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/randomgnsdata.go b/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/randomgnsdata.go deleted file mode 100644 index 1982e788a..000000000 --- a/compiler/example/output/generated/client/listers/gns.tsm.tanzu.vmware.com/v1/randomgnsdata.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// RandomGnsDataLister helps list RandomGnsDatas. -// All objects returned here must be treated as read-only. -type RandomGnsDataLister interface { - // List lists all RandomGnsDatas in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.RandomGnsData, err error) - // Get retrieves the RandomGnsData from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.RandomGnsData, error) - RandomGnsDataListerExpansion -} - -// randomGnsDataLister implements the RandomGnsDataLister interface. -type randomGnsDataLister struct { - indexer cache.Indexer -} - -// NewRandomGnsDataLister returns a new RandomGnsDataLister. -func NewRandomGnsDataLister(indexer cache.Indexer) RandomGnsDataLister { - return &randomGnsDataLister{indexer: indexer} -} - -// List lists all RandomGnsDatas in the indexer. -func (s *randomGnsDataLister) List(selector labels.Selector) (ret []*v1.RandomGnsData, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RandomGnsData)) - }) - return ret, err -} - -// Get retrieves the RandomGnsData from the index for a given name. -func (s *randomGnsDataLister) Get(name string) (*v1.RandomGnsData, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("randomgnsdata"), name) - } - return obj.(*v1.RandomGnsData), nil -} diff --git a/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go b/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go deleted file mode 100644 index 08eab8e92..000000000 --- a/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/accesscontrolpolicy.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// AccessControlPolicyLister helps list AccessControlPolicies. -// All objects returned here must be treated as read-only. -type AccessControlPolicyLister interface { - // List lists all AccessControlPolicies in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.AccessControlPolicy, err error) - // Get retrieves the AccessControlPolicy from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.AccessControlPolicy, error) - AccessControlPolicyListerExpansion -} - -// accessControlPolicyLister implements the AccessControlPolicyLister interface. -type accessControlPolicyLister struct { - indexer cache.Indexer -} - -// NewAccessControlPolicyLister returns a new AccessControlPolicyLister. -func NewAccessControlPolicyLister(indexer cache.Indexer) AccessControlPolicyLister { - return &accessControlPolicyLister{indexer: indexer} -} - -// List lists all AccessControlPolicies in the indexer. -func (s *accessControlPolicyLister) List(selector labels.Selector) (ret []*v1.AccessControlPolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.AccessControlPolicy)) - }) - return ret, err -} - -// Get retrieves the AccessControlPolicy from the index for a given name. -func (s *accessControlPolicyLister) Get(name string) (*v1.AccessControlPolicy, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("accesscontrolpolicy"), name) - } - return obj.(*v1.AccessControlPolicy), nil -} diff --git a/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/acpconfig.go b/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/acpconfig.go deleted file mode 100644 index a7264e9e8..000000000 --- a/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/acpconfig.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// ACPConfigLister helps list ACPConfigs. -// All objects returned here must be treated as read-only. -type ACPConfigLister interface { - // List lists all ACPConfigs in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.ACPConfig, err error) - // Get retrieves the ACPConfig from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.ACPConfig, error) - ACPConfigListerExpansion -} - -// aCPConfigLister implements the ACPConfigLister interface. -type aCPConfigLister struct { - indexer cache.Indexer -} - -// NewACPConfigLister returns a new ACPConfigLister. -func NewACPConfigLister(indexer cache.Indexer) ACPConfigLister { - return &aCPConfigLister{indexer: indexer} -} - -// List lists all ACPConfigs in the indexer. -func (s *aCPConfigLister) List(selector labels.Selector) (ret []*v1.ACPConfig, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ACPConfig)) - }) - return ret, err -} - -// Get retrieves the ACPConfig from the index for a given name. -func (s *aCPConfigLister) Get(name string) (*v1.ACPConfig, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("acpconfig"), name) - } - return obj.(*v1.ACPConfig), nil -} diff --git a/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/additionalpolicydata.go b/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/additionalpolicydata.go deleted file mode 100644 index d18bc1151..000000000 --- a/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/additionalpolicydata.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// AdditionalPolicyDataLister helps list AdditionalPolicyDatas. -// All objects returned here must be treated as read-only. -type AdditionalPolicyDataLister interface { - // List lists all AdditionalPolicyDatas in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.AdditionalPolicyData, err error) - // Get retrieves the AdditionalPolicyData from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.AdditionalPolicyData, error) - AdditionalPolicyDataListerExpansion -} - -// additionalPolicyDataLister implements the AdditionalPolicyDataLister interface. -type additionalPolicyDataLister struct { - indexer cache.Indexer -} - -// NewAdditionalPolicyDataLister returns a new AdditionalPolicyDataLister. -func NewAdditionalPolicyDataLister(indexer cache.Indexer) AdditionalPolicyDataLister { - return &additionalPolicyDataLister{indexer: indexer} -} - -// List lists all AdditionalPolicyDatas in the indexer. -func (s *additionalPolicyDataLister) List(selector labels.Selector) (ret []*v1.AdditionalPolicyData, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.AdditionalPolicyData)) - }) - return ret, err -} - -// Get retrieves the AdditionalPolicyData from the index for a given name. -func (s *additionalPolicyDataLister) Get(name string) (*v1.AdditionalPolicyData, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("additionalpolicydata"), name) - } - return obj.(*v1.AdditionalPolicyData), nil -} diff --git a/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/expansion_generated.go b/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/expansion_generated.go deleted file mode 100644 index 8f68c2a5f..000000000 --- a/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/expansion_generated.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -// ACPConfigListerExpansion allows custom methods to be added to -// ACPConfigLister. -type ACPConfigListerExpansion interface{} - -// AccessControlPolicyListerExpansion allows custom methods to be added to -// AccessControlPolicyLister. -type AccessControlPolicyListerExpansion interface{} - -// AdditionalPolicyDataListerExpansion allows custom methods to be added to -// AdditionalPolicyDataLister. -type AdditionalPolicyDataListerExpansion interface{} - -// RandomPolicyDataListerExpansion allows custom methods to be added to -// RandomPolicyDataLister. -type RandomPolicyDataListerExpansion interface{} - -// VMpolicyListerExpansion allows custom methods to be added to -// VMpolicyLister. -type VMpolicyListerExpansion interface{} diff --git a/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/randompolicydata.go b/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/randompolicydata.go deleted file mode 100644 index cba5f7989..000000000 --- a/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/randompolicydata.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// RandomPolicyDataLister helps list RandomPolicyDatas. -// All objects returned here must be treated as read-only. -type RandomPolicyDataLister interface { - // List lists all RandomPolicyDatas in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.RandomPolicyData, err error) - // Get retrieves the RandomPolicyData from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.RandomPolicyData, error) - RandomPolicyDataListerExpansion -} - -// randomPolicyDataLister implements the RandomPolicyDataLister interface. -type randomPolicyDataLister struct { - indexer cache.Indexer -} - -// NewRandomPolicyDataLister returns a new RandomPolicyDataLister. -func NewRandomPolicyDataLister(indexer cache.Indexer) RandomPolicyDataLister { - return &randomPolicyDataLister{indexer: indexer} -} - -// List lists all RandomPolicyDatas in the indexer. -func (s *randomPolicyDataLister) List(selector labels.Selector) (ret []*v1.RandomPolicyData, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RandomPolicyData)) - }) - return ret, err -} - -// Get retrieves the RandomPolicyData from the index for a given name. -func (s *randomPolicyDataLister) Get(name string) (*v1.RandomPolicyData, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("randompolicydata"), name) - } - return obj.(*v1.RandomPolicyData), nil -} diff --git a/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/vmpolicy.go b/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/vmpolicy.go deleted file mode 100644 index 9a7bf268a..000000000 --- a/compiler/example/output/generated/client/listers/policypkg.tsm.tanzu.vmware.com/v1/vmpolicy.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// VMpolicyLister helps list VMpolicies. -// All objects returned here must be treated as read-only. -type VMpolicyLister interface { - // List lists all VMpolicies in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.VMpolicy, err error) - // Get retrieves the VMpolicy from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.VMpolicy, error) - VMpolicyListerExpansion -} - -// vMpolicyLister implements the VMpolicyLister interface. -type vMpolicyLister struct { - indexer cache.Indexer -} - -// NewVMpolicyLister returns a new VMpolicyLister. -func NewVMpolicyLister(indexer cache.Indexer) VMpolicyLister { - return &vMpolicyLister{indexer: indexer} -} - -// List lists all VMpolicies in the indexer. -func (s *vMpolicyLister) List(selector labels.Selector) (ret []*v1.VMpolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.VMpolicy)) - }) - return ret, err -} - -// Get retrieves the VMpolicy from the index for a given name. -func (s *vMpolicyLister) Get(name string) (*v1.VMpolicy, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("vmpolicy"), name) - } - return obj.(*v1.VMpolicy), nil -} diff --git a/compiler/example/output/generated/client/listers/root.tsm.tanzu.vmware.com/v1/expansion_generated.go b/compiler/example/output/generated/client/listers/root.tsm.tanzu.vmware.com/v1/expansion_generated.go deleted file mode 100644 index db7009a12..000000000 --- a/compiler/example/output/generated/client/listers/root.tsm.tanzu.vmware.com/v1/expansion_generated.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -// RootListerExpansion allows custom methods to be added to -// RootLister. -type RootListerExpansion interface{} diff --git a/compiler/example/output/generated/client/listers/root.tsm.tanzu.vmware.com/v1/root.go b/compiler/example/output/generated/client/listers/root.tsm.tanzu.vmware.com/v1/root.go deleted file mode 100644 index edbf2255a..000000000 --- a/compiler/example/output/generated/client/listers/root.tsm.tanzu.vmware.com/v1/root.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// RootLister helps list Roots. -// All objects returned here must be treated as read-only. -type RootLister interface { - // List lists all Roots in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Root, err error) - // Get retrieves the Root from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.Root, error) - RootListerExpansion -} - -// rootLister implements the RootLister interface. -type rootLister struct { - indexer cache.Indexer -} - -// NewRootLister returns a new RootLister. -func NewRootLister(indexer cache.Indexer) RootLister { - return &rootLister{indexer: indexer} -} - -// List lists all Roots in the indexer. -func (s *rootLister) List(selector labels.Selector) (ret []*v1.Root, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Root)) - }) - return ret, err -} - -// Get retrieves the Root from the index for a given name. -func (s *rootLister) Get(name string) (*v1.Root, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("root"), name) - } - return obj.(*v1.Root), nil -} diff --git a/compiler/example/output/generated/client/listers/servicegroup.tsm.tanzu.vmware.com/v1/expansion_generated.go b/compiler/example/output/generated/client/listers/servicegroup.tsm.tanzu.vmware.com/v1/expansion_generated.go deleted file mode 100644 index 787f8b601..000000000 --- a/compiler/example/output/generated/client/listers/servicegroup.tsm.tanzu.vmware.com/v1/expansion_generated.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -// SvcGroupListerExpansion allows custom methods to be added to -// SvcGroupLister. -type SvcGroupListerExpansion interface{} - -// SvcGroupLinkInfoListerExpansion allows custom methods to be added to -// SvcGroupLinkInfoLister. -type SvcGroupLinkInfoListerExpansion interface{} diff --git a/compiler/example/output/generated/client/listers/servicegroup.tsm.tanzu.vmware.com/v1/svcgroup.go b/compiler/example/output/generated/client/listers/servicegroup.tsm.tanzu.vmware.com/v1/svcgroup.go deleted file mode 100644 index 156df89ec..000000000 --- a/compiler/example/output/generated/client/listers/servicegroup.tsm.tanzu.vmware.com/v1/svcgroup.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// SvcGroupLister helps list SvcGroups. -// All objects returned here must be treated as read-only. -type SvcGroupLister interface { - // List lists all SvcGroups in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.SvcGroup, err error) - // Get retrieves the SvcGroup from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.SvcGroup, error) - SvcGroupListerExpansion -} - -// svcGroupLister implements the SvcGroupLister interface. -type svcGroupLister struct { - indexer cache.Indexer -} - -// NewSvcGroupLister returns a new SvcGroupLister. -func NewSvcGroupLister(indexer cache.Indexer) SvcGroupLister { - return &svcGroupLister{indexer: indexer} -} - -// List lists all SvcGroups in the indexer. -func (s *svcGroupLister) List(selector labels.Selector) (ret []*v1.SvcGroup, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.SvcGroup)) - }) - return ret, err -} - -// Get retrieves the SvcGroup from the index for a given name. -func (s *svcGroupLister) Get(name string) (*v1.SvcGroup, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("svcgroup"), name) - } - return obj.(*v1.SvcGroup), nil -} diff --git a/compiler/example/output/generated/client/listers/servicegroup.tsm.tanzu.vmware.com/v1/svcgrouplinkinfo.go b/compiler/example/output/generated/client/listers/servicegroup.tsm.tanzu.vmware.com/v1/svcgrouplinkinfo.go deleted file mode 100644 index e0397e156..000000000 --- a/compiler/example/output/generated/client/listers/servicegroup.tsm.tanzu.vmware.com/v1/svcgrouplinkinfo.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// SvcGroupLinkInfoLister helps list SvcGroupLinkInfos. -// All objects returned here must be treated as read-only. -type SvcGroupLinkInfoLister interface { - // List lists all SvcGroupLinkInfos in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.SvcGroupLinkInfo, err error) - // Get retrieves the SvcGroupLinkInfo from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.SvcGroupLinkInfo, error) - SvcGroupLinkInfoListerExpansion -} - -// svcGroupLinkInfoLister implements the SvcGroupLinkInfoLister interface. -type svcGroupLinkInfoLister struct { - indexer cache.Indexer -} - -// NewSvcGroupLinkInfoLister returns a new SvcGroupLinkInfoLister. -func NewSvcGroupLinkInfoLister(indexer cache.Indexer) SvcGroupLinkInfoLister { - return &svcGroupLinkInfoLister{indexer: indexer} -} - -// List lists all SvcGroupLinkInfos in the indexer. -func (s *svcGroupLinkInfoLister) List(selector labels.Selector) (ret []*v1.SvcGroupLinkInfo, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.SvcGroupLinkInfo)) - }) - return ret, err -} - -// Get retrieves the SvcGroupLinkInfo from the index for a given name. -func (s *svcGroupLinkInfoLister) Get(name string) (*v1.SvcGroupLinkInfo, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("svcgrouplinkinfo"), name) - } - return obj.(*v1.SvcGroupLinkInfo), nil -} diff --git a/compiler/example/output/generated/crds/accesscontrolpolicy.yaml b/compiler/example/output/generated/crds/accesscontrolpolicy.yaml new file mode 100644 index 000000000..269cf4b79 --- /dev/null +++ b/compiler/example/output/generated/crds/accesscontrolpolicy.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: accesscontrolpolicies.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AccessControlPolicy + listKind: AccessControlPolicyList + plural: accesscontrolpolicies + shortNames: + - accesscontrolpolicy + singular: accesscontrolpolicy + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/accesstoken.yaml b/compiler/example/output/generated/crds/accesstoken.yaml new file mode 100644 index 000000000..3f752ac0b --- /dev/null +++ b/compiler/example/output/generated/crds/accesstoken.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: accesstokens.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AccessToken + listKind: AccessTokenList + plural: accesstokens + shortNames: + - accesstoken + singular: accesstoken + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/acpconfig.yaml b/compiler/example/output/generated/crds/acpconfig.yaml new file mode 100644 index 000000000..b83a648f7 --- /dev/null +++ b/compiler/example/output/generated/crds/acpconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: acpconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ACPConfig + listKind: ACPConfigList + plural: acpconfigs + shortNames: + - acpconfig + singular: acpconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/additionalattributes.yaml b/compiler/example/output/generated/crds/additionalattributes.yaml new file mode 100644 index 000000000..6afa130b5 --- /dev/null +++ b/compiler/example/output/generated/crds/additionalattributes.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: additionalattributeses.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AdditionalAttributes + listKind: AdditionalAttributesList + plural: additionalattributeses + shortNames: + - additionalattributes + singular: additionalattributes + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/allsparkservices.yaml b/compiler/example/output/generated/crds/allsparkservices.yaml new file mode 100644 index 000000000..3e4329359 --- /dev/null +++ b/compiler/example/output/generated/crds/allsparkservices.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":true,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: allsparkserviceses.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AllSparkServices + listKind: AllSparkServicesList + plural: allsparkserviceses + shortNames: + - allsparkservices + singular: allsparkservices + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/annotation.yaml b/compiler/example/output/generated/crds/annotation.yaml new file mode 100644 index 000000000..988730a76 --- /dev/null +++ b/compiler/example/output/generated/crds/annotation.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: annotations.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Annotation + listKind: AnnotationList + plural: annotations + shortNames: + - annotation + singular: annotation + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/apidiscovery.yaml b/compiler/example/output/generated/crds/apidiscovery.yaml new file mode 100644 index 000000000..d6f3d6cdf --- /dev/null +++ b/compiler/example/output/generated/crds/apidiscovery.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: apidiscoveries.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ApiDiscovery + listKind: ApiDiscoveryList + plural: apidiscoveries + shortNames: + - apidiscovery + singular: apidiscovery + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/apidiscoveryrt.yaml b/compiler/example/output/generated/crds/apidiscoveryrt.yaml new file mode 100644 index 000000000..417067ddc --- /dev/null +++ b/compiler/example/output/generated/crds/apidiscoveryrt.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: apidiscoveryrts.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ApiDiscoveryRT + listKind: ApiDiscoveryRTList + plural: apidiscoveryrts + shortNames: + - apidiscoveryrt + singular: apidiscoveryrt + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/app.yaml b/compiler/example/output/generated/crds/app.yaml new file mode 100644 index 000000000..0afa84047 --- /dev/null +++ b/compiler/example/output/generated/crds/app.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: apps.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: App + listKind: AppList + plural: apps + shortNames: + - app + singular: app + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/appfolder.yaml b/compiler/example/output/generated/crds/appfolder.yaml new file mode 100644 index 000000000..c7759df92 --- /dev/null +++ b/compiler/example/output/generated/crds/appfolder.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: appfolders.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AppFolder + listKind: AppFolderList + plural: appfolders + shortNames: + - appfolder + singular: appfolder + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/appgroup.yaml b/compiler/example/output/generated/crds/appgroup.yaml new file mode 100644 index 000000000..63889ef1a --- /dev/null +++ b/compiler/example/output/generated/crds/appgroup.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: appgroups.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AppGroup + listKind: AppGroupList + plural: appgroups + shortNames: + - appgroup + singular: appgroup + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/applicationinfo.yaml b/compiler/example/output/generated/crds/applicationinfo.yaml new file mode 100644 index 000000000..053b52744 --- /dev/null +++ b/compiler/example/output/generated/crds/applicationinfo.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: applicationinfos.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ApplicationInfo + listKind: ApplicationInfoList + plural: applicationinfos + shortNames: + - applicationinfo + singular: applicationinfo + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/apptemplate.yaml b/compiler/example/output/generated/crds/apptemplate.yaml new file mode 100644 index 000000000..d8901de71 --- /dev/null +++ b/compiler/example/output/generated/crds/apptemplate.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: apptemplates.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AppTemplate + listKind: AppTemplateList + plural: apptemplates + shortNames: + - apptemplate + singular: apptemplate + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/apptemplateservicedefinition.yaml b/compiler/example/output/generated/crds/apptemplateservicedefinition.yaml new file mode 100644 index 000000000..be9a01ee7 --- /dev/null +++ b/compiler/example/output/generated/crds/apptemplateservicedefinition.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: apptemplateservicedefinitions.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AppTemplateServiceDefinition + listKind: AppTemplateServiceDefinitionList + plural: apptemplateservicedefinitions + shortNames: + - apptemplateservicedefinition + singular: apptemplateservicedefinition + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/appuser.yaml b/compiler/example/output/generated/crds/appuser.yaml new file mode 100644 index 000000000..7c56cf903 --- /dev/null +++ b/compiler/example/output/generated/crds/appuser.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: appusers.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AppUser + listKind: AppUserList + plural: appusers + shortNames: + - appuser + singular: appuser + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/appversion.yaml b/compiler/example/output/generated/crds/appversion.yaml new file mode 100644 index 000000000..d257f3bde --- /dev/null +++ b/compiler/example/output/generated/crds/appversion.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: appversions.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AppVersion + listKind: AppVersionList + plural: appversions + shortNames: + - appversion + singular: appversion + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/attackdiscovery.yaml b/compiler/example/output/generated/crds/attackdiscovery.yaml new file mode 100644 index 000000000..dfaa56987 --- /dev/null +++ b/compiler/example/output/generated/crds/attackdiscovery.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: attackdiscoveries.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AttackDiscovery + listKind: AttackDiscoveryList + plural: attackdiscoveries + shortNames: + - attackdiscovery + singular: attackdiscovery + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/attackdiscoveryrt.yaml b/compiler/example/output/generated/crds/attackdiscoveryrt.yaml new file mode 100644 index 000000000..e40c53f66 --- /dev/null +++ b/compiler/example/output/generated/crds/attackdiscoveryrt.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: attackdiscoveryrts.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AttackDiscoveryRT + listKind: AttackDiscoveryRTList + plural: attackdiscoveryrts + shortNames: + - attackdiscoveryrt + singular: attackdiscoveryrt + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/authenticationpolicy.yaml b/compiler/example/output/generated/crds/authenticationpolicy.yaml new file mode 100644 index 000000000..910ab47f2 --- /dev/null +++ b/compiler/example/output/generated/crds/authenticationpolicy.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: authenticationpolicies.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AuthenticationPolicy + listKind: AuthenticationPolicyList + plural: authenticationpolicies + shortNames: + - authenticationpolicy + singular: authenticationpolicy + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/autoscaler.yaml b/compiler/example/output/generated/crds/autoscaler.yaml new file mode 100644 index 000000000..a477002e9 --- /dev/null +++ b/compiler/example/output/generated/crds/autoscaler.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: autoscalers.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Autoscaler + listKind: AutoscalerList + plural: autoscalers + shortNames: + - autoscaler + singular: autoscaler + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/autoscalerconfig.yaml b/compiler/example/output/generated/crds/autoscalerconfig.yaml new file mode 100644 index 000000000..3e913f5d8 --- /dev/null +++ b/compiler/example/output/generated/crds/autoscalerconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: autoscalerconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AutoscalerConfig + listKind: AutoscalerConfigList + plural: autoscalerconfigs + shortNames: + - autoscalerconfig + singular: autoscalerconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/autoscalercr.yaml b/compiler/example/output/generated/crds/autoscalercr.yaml new file mode 100644 index 000000000..595510065 --- /dev/null +++ b/compiler/example/output/generated/crds/autoscalercr.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: autoscalercrs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AutoscalerCR + listKind: AutoscalerCRList + plural: autoscalercrs + shortNames: + - autoscalercr + singular: autoscalercr + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/autoscalerfolder.yaml b/compiler/example/output/generated/crds/autoscalerfolder.yaml new file mode 100644 index 000000000..adc9d49ea --- /dev/null +++ b/compiler/example/output/generated/crds/autoscalerfolder.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: autoscalerfolders.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AutoscalerFolder + listKind: AutoscalerFolderList + plural: autoscalerfolders + shortNames: + - autoscalerfolder + singular: autoscalerfolder + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/autoscalingpolicy.yaml b/compiler/example/output/generated/crds/autoscalingpolicy.yaml new file mode 100644 index 000000000..a761e866e --- /dev/null +++ b/compiler/example/output/generated/crds/autoscalingpolicy.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: autoscalingpolicies.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AutoscalingPolicy + listKind: AutoscalingPolicyList + plural: autoscalingpolicies + shortNames: + - autoscalingpolicy + singular: autoscalingpolicy + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/awsconnector.yaml b/compiler/example/output/generated/crds/awsconnector.yaml new file mode 100644 index 000000000..929284f01 --- /dev/null +++ b/compiler/example/output/generated/crds/awsconnector.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":true,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: awsconnectors.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: AwsConnector + listKind: AwsConnectorList + plural: awsconnectors + shortNames: + - awsconnector + singular: awsconnector + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/bucket.yaml b/compiler/example/output/generated/crds/bucket.yaml new file mode 100644 index 000000000..e82bb3844 --- /dev/null +++ b/compiler/example/output/generated/crds/bucket.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: buckets.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Bucket + listKind: BucketList + plural: buckets + shortNames: + - bucket + singular: bucket + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/certificate.yaml b/compiler/example/output/generated/crds/certificate.yaml new file mode 100644 index 000000000..6f532b5d5 --- /dev/null +++ b/compiler/example/output/generated/crds/certificate.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: certificates.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Certificate + listKind: CertificateList + plural: certificates + shortNames: + - certificate + singular: certificate + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/certificateauthorityconfign.yaml b/compiler/example/output/generated/crds/certificateauthorityconfign.yaml new file mode 100644 index 000000000..52fbbc716 --- /dev/null +++ b/compiler/example/output/generated/crds/certificateauthorityconfign.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: certificateauthorityconfigns.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: CertificateAuthorityConfigN + listKind: CertificateAuthorityConfigNList + plural: certificateauthorityconfigns + shortNames: + - certificateauthorityconfign + singular: certificateauthorityconfign + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/certificateauthorityrt.yaml b/compiler/example/output/generated/crds/certificateauthorityrt.yaml new file mode 100644 index 000000000..bdca97fc4 --- /dev/null +++ b/compiler/example/output/generated/crds/certificateauthorityrt.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: certificateauthorityrts.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: CertificateAuthorityRT + listKind: CertificateAuthorityRTList + plural: certificateauthorityrts + shortNames: + - certificateauthorityrt + singular: certificateauthorityrt + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/certificateconfign.yaml b/compiler/example/output/generated/crds/certificateconfign.yaml new file mode 100644 index 000000000..c64b48cd9 --- /dev/null +++ b/compiler/example/output/generated/crds/certificateconfign.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: certificateconfigns.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: CertificateConfigN + listKind: CertificateConfigNList + plural: certificateconfigns + shortNames: + - certificateconfign + singular: certificateconfign + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/certificaterequest.yaml b/compiler/example/output/generated/crds/certificaterequest.yaml new file mode 100644 index 000000000..769f7996f --- /dev/null +++ b/compiler/example/output/generated/crds/certificaterequest.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: certificaterequests.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: CertificateRequest + listKind: CertificateRequestList + plural: certificaterequests + shortNames: + - certificaterequest + singular: certificaterequest + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/cluster.yaml b/compiler/example/output/generated/crds/cluster.yaml new file mode 100644 index 000000000..80fc31dd1 --- /dev/null +++ b/compiler/example/output/generated/crds/cluster.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: clusters.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Cluster + listKind: ClusterList + plural: clusters + shortNames: + - cluster + singular: cluster + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/clusterconfig.yaml b/compiler/example/output/generated/crds/clusterconfig.yaml new file mode 100644 index 000000000..36a6dff4e --- /dev/null +++ b/compiler/example/output/generated/crds/clusterconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: clusterconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ClusterConfig + listKind: ClusterConfigList + plural: clusterconfigs + shortNames: + - clusterconfig + singular: clusterconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/clusterconfigfolder.yaml b/compiler/example/output/generated/crds/clusterconfigfolder.yaml new file mode 100644 index 000000000..de0faf86e --- /dev/null +++ b/compiler/example/output/generated/crds/clusterconfigfolder.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: clusterconfigfolders.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ClusterConfigFolder + listKind: ClusterConfigFolderList + plural: clusterconfigfolders + shortNames: + - clusterconfigfolder + singular: clusterconfigfolder + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/clusterfolder.yaml b/compiler/example/output/generated/crds/clusterfolder.yaml new file mode 100644 index 000000000..5b36d15de --- /dev/null +++ b/compiler/example/output/generated/crds/clusterfolder.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: clusterfolders.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ClusterFolder + listKind: ClusterFolderList + plural: clusterfolders + shortNames: + - clusterfolder + singular: clusterfolder + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/clustersettings.yaml b/compiler/example/output/generated/crds/clustersettings.yaml new file mode 100644 index 000000000..b49a98bad --- /dev/null +++ b/compiler/example/output/generated/crds/clustersettings.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: clustersettingses.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ClusterSettings + listKind: ClusterSettingsList + plural: clustersettingses + shortNames: + - clustersettings + singular: clustersettings + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/config.yaml b/compiler/example/output/generated/crds/config.yaml new file mode 100644 index 000000000..063575ad7 --- /dev/null +++ b/compiler/example/output/generated/crds/config.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":true,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: configs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Config + listKind: ConfigList + plural: configs + shortNames: + - config + singular: config + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/config_config.yaml b/compiler/example/output/generated/crds/config_config.yaml deleted file mode 100644 index 18a97a562..000000000 --- a/compiler/example/output/generated/crds/config_config.yaml +++ /dev/null @@ -1,248 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"name":"config.Config","hierarchy":["roots.root.tsm.tanzu.vmware.com"],"children":{"dnses.gns.tsm.tanzu.vmware.com":{"fieldName":"DNS","fieldNameGvk":"dNSGvk","isNamed":false},"domains.config.tsm.tanzu.vmware.com":{"fieldName":"Domain","fieldNameGvk":"domainGvk","isNamed":false},"footypeabcs.config.tsm.tanzu.vmware.com":{"fieldName":"FooExample","fieldNameGvk":"fooExampleGvk","isNamed":true},"gnses.gns.tsm.tanzu.vmware.com":{"fieldName":"GNS","fieldNameGvk":"gNSGvk","isNamed":false},"svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com":{"fieldName":"SvcGrpInfo","fieldNameGvk":"svcGrpInfoGvk","isNamed":false},"vmpolicies.policypkg.tsm.tanzu.vmware.com":{"fieldName":"VMPPolicies","fieldNameGvk":"vMPPoliciesGvk","isNamed":false}},"links":{"ACPPolicies":{"fieldName":"ACPPolicies","fieldNameGvk":"aCPPoliciesGvk","isNamed":true}},"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} - creationTimestamp: null - name: configs.config.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: config.tsm.tanzu.vmware.com - names: - kind: Config - listKind: ConfigList - plural: configs - shortNames: - - config - singular: config - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - aBCHost: - items: - type: string - type: array - aCPPoliciesGvk: - additionalProperties: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - group - - kind - - name - type: object - type: object - clusterNamespaces: - items: - properties: - cluster: - properties: - name: - type: string - type: - type: string - required: - - name - - type - type: object - namespace: - properties: - name: - type: string - type: - type: string - required: - - name - - type - type: object - required: - - cluster - - namespace - type: object - type: array - dNSGvk: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - group - - kind - - name - type: object - domainGvk: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - group - - kind - - name - type: object - fooExampleGvk: - additionalProperties: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - group - - kind - - name - type: object - type: object - gNSGvk: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - group - - kind - - name - type: object - instance: - format: float - type: number - myStr0: - type: string - myStr1: - items: - type: string - type: array - myStr2: - additionalProperties: - type: string - type: object - optionCu: - type: string - svcGrpInfoGvk: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - group - - kind - - name - type: object - testValMarkers: - properties: - myInt: - exclusiveMaximum: true - format: int32 - maximum: 8 - minimum: 2 - type: integer - mySlice: - items: - type: string - maxItems: 3 - minItems: 2 - type: array - uniqueItems: true - myStr: - maxLength: 8 - minLength: 2 - pattern: ab - type: string - required: - - myStr - - myInt - - mySlice - type: object - vMPPoliciesGvk: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - group - - kind - - name - type: object - xYZPort: - format: int32 - type: integer - required: - - myStr0 - - myStr1 - - myStr2 - - xYZPort - - aBCHost - - clusterNamespaces - - testValMarkers - - instance - - optionCu - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/config_domain.yaml b/compiler/example/output/generated/crds/config_domain.yaml deleted file mode 100644 index 3c90932cc..000000000 --- a/compiler/example/output/generated/crds/config_domain.yaml +++ /dev/null @@ -1,121 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"name":"config.Domain","hierarchy":["roots.root.tsm.tanzu.vmware.com","configs.config.tsm.tanzu.vmware.com"],"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} - creationTimestamp: null - name: domains.config.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: config.tsm.tanzu.vmware.com - names: - kind: Domain - listKind: DomainList - plural: domains - shortNames: - - domain - singular: domain - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - mapOfArrsPoints: - additionalProperties: - items: - type: string - type: array - type: object - pointInt: - format: int32 - type: integer - pointMap: - additionalProperties: - type: string - type: object - pointPort: - format: int32 - type: integer - pointSlice: - items: - type: string - type: array - pointString: - type: string - pointStruct: - properties: - myID: - format: int32 - type: integer - name: - type: string - required: - - name - - myID - type: object - sliceOfArrPoints: - items: - items: - type: string - type: array - type: array - sliceOfPoints: - items: - type: string - type: array - required: - - pointPort - - pointString - - pointInt - - pointMap - - pointSlice - - sliceOfPoints - - sliceOfArrPoints - - mapOfArrsPoints - - pointStruct - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/config_footypeabc.yaml b/compiler/example/output/generated/crds/config_footypeabc.yaml deleted file mode 100644 index c1ced007b..000000000 --- a/compiler/example/output/generated/crds/config_footypeabc.yaml +++ /dev/null @@ -1,95 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"name":"config.FooTypeABC","hierarchy":["roots.root.tsm.tanzu.vmware.com","configs.config.tsm.tanzu.vmware.com"],"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} - creationTimestamp: null - name: footypeabcs.config.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: config.tsm.tanzu.vmware.com - names: - kind: FooTypeABC - listKind: FooTypeABCList - plural: footypeabcs - shortNames: - - footypeabc - singular: footypeabc - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - FooC: - format: byte - type: integer - FooD: - format: float - type: number - fooA: - additionalProperties: - type: string - type: object - fooB: - items: - type: string - type: array - fooE: - format: byte - type: integer - fooF: - format: float - type: number - required: - - fooA - - fooB - - FooC - - FooD - - fooE - - fooF - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/configmap.yaml b/compiler/example/output/generated/crds/configmap.yaml new file mode 100644 index 000000000..5e343a36e --- /dev/null +++ b/compiler/example/output/generated/crds/configmap.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: configmaps.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ConfigMap + listKind: ConfigMapList + plural: configmaps + shortNames: + - configmap + singular: configmap + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/connectionstatus.yaml b/compiler/example/output/generated/crds/connectionstatus.yaml new file mode 100644 index 000000000..dd23316db --- /dev/null +++ b/compiler/example/output/generated/crds/connectionstatus.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: connectionstatuses.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ConnectionStatus + listKind: ConnectionStatusList + plural: connectionstatuses + shortNames: + - connectionstatus + singular: connectionstatus + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/database.yaml b/compiler/example/output/generated/crds/database.yaml new file mode 100644 index 000000000..02a85283f --- /dev/null +++ b/compiler/example/output/generated/crds/database.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":true,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: databases.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Database + listKind: DatabaseList + plural: databases + shortNames: + - database + singular: database + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/datafolder.yaml b/compiler/example/output/generated/crds/datafolder.yaml new file mode 100644 index 000000000..a1efb2ebd --- /dev/null +++ b/compiler/example/output/generated/crds/datafolder.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":true,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: datafolders.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: DataFolder + listKind: DataFolderList + plural: datafolders + shortNames: + - datafolder + singular: datafolder + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/datafolderdomain.yaml b/compiler/example/output/generated/crds/datafolderdomain.yaml new file mode 100644 index 000000000..9533cc48b --- /dev/null +++ b/compiler/example/output/generated/crds/datafolderdomain.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: datafolderdomains.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: DataFolderDomain + listKind: DataFolderDomainList + plural: datafolderdomains + shortNames: + - datafolderdomain + singular: datafolderdomain + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/datafolderdomaincluster.yaml b/compiler/example/output/generated/crds/datafolderdomaincluster.yaml new file mode 100644 index 000000000..800b97812 --- /dev/null +++ b/compiler/example/output/generated/crds/datafolderdomaincluster.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: datafolderdomainclusters.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: DataFolderDomainCluster + listKind: DataFolderDomainClusterList + plural: datafolderdomainclusters + shortNames: + - datafolderdomaincluster + singular: datafolderdomaincluster + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/datafolderdomainservice.yaml b/compiler/example/output/generated/crds/datafolderdomainservice.yaml new file mode 100644 index 000000000..d8d004e89 --- /dev/null +++ b/compiler/example/output/generated/crds/datafolderdomainservice.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: datafolderdomainservices.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: DataFolderDomainService + listKind: DataFolderDomainServiceList + plural: datafolderdomainservices + shortNames: + - datafolderdomainservice + singular: datafolderdomainservice + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/datafolderdomainserviceversion.yaml b/compiler/example/output/generated/crds/datafolderdomainserviceversion.yaml new file mode 100644 index 000000000..84ca3a377 --- /dev/null +++ b/compiler/example/output/generated/crds/datafolderdomainserviceversion.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: datafolderdomainserviceversions.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: DataFolderDomainServiceVersion + listKind: DataFolderDomainServiceVersionList + plural: datafolderdomainserviceversions + shortNames: + - datafolderdomainserviceversion + singular: datafolderdomainserviceversion + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/datagroup.yaml b/compiler/example/output/generated/crds/datagroup.yaml new file mode 100644 index 000000000..11a91893f --- /dev/null +++ b/compiler/example/output/generated/crds/datagroup.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: datagroups.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: DataGroup + listKind: DataGroupList + plural: datagroups + shortNames: + - datagroup + singular: datagroup + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/datatemplate.yaml b/compiler/example/output/generated/crds/datatemplate.yaml new file mode 100644 index 000000000..3d6291d87 --- /dev/null +++ b/compiler/example/output/generated/crds/datatemplate.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: datatemplates.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: DataTemplate + listKind: DataTemplateList + plural: datatemplates + shortNames: + - datatemplate + singular: datatemplate + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/dcregion.yaml b/compiler/example/output/generated/crds/dcregion.yaml new file mode 100644 index 000000000..44a9d8154 --- /dev/null +++ b/compiler/example/output/generated/crds/dcregion.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: dcregions.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: DCRegion + listKind: DCRegionList + plural: dcregions + shortNames: + - dcregion + singular: dcregion + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/dczone.yaml b/compiler/example/output/generated/crds/dczone.yaml new file mode 100644 index 000000000..ab52829ab --- /dev/null +++ b/compiler/example/output/generated/crds/dczone.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: dczones.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: DCZone + listKind: DCZoneList + plural: dczones + shortNames: + - dczone + singular: dczone + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/destinationrule.yaml b/compiler/example/output/generated/crds/destinationrule.yaml new file mode 100644 index 000000000..907b34c1a --- /dev/null +++ b/compiler/example/output/generated/crds/destinationrule.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: destinationrules.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: DestinationRule + listKind: DestinationRuleList + plural: destinationrules + shortNames: + - destinationrule + singular: destinationrule + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/directory.yaml b/compiler/example/output/generated/crds/directory.yaml new file mode 100644 index 000000000..cbc2e295c --- /dev/null +++ b/compiler/example/output/generated/crds/directory.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: directories.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Directory + listKind: DirectoryList + plural: directories + shortNames: + - directory + singular: directory + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/dnsconfig.yaml b/compiler/example/output/generated/crds/dnsconfig.yaml new file mode 100644 index 000000000..8f641e69c --- /dev/null +++ b/compiler/example/output/generated/crds/dnsconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: dnsconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: DNSConfig + listKind: DNSConfigList + plural: dnsconfigs + shortNames: + - dnsconfig + singular: dnsconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/dnsconfigfolder.yaml b/compiler/example/output/generated/crds/dnsconfigfolder.yaml new file mode 100644 index 000000000..d01dbc70a --- /dev/null +++ b/compiler/example/output/generated/crds/dnsconfigfolder.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: dnsconfigfolders.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: DNSConfigFolder + listKind: DNSConfigFolderList + plural: dnsconfigfolders + shortNames: + - dnsconfigfolder + singular: dnsconfigfolder + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/dnsprobeconfig.yaml b/compiler/example/output/generated/crds/dnsprobeconfig.yaml new file mode 100644 index 000000000..33ba4a46d --- /dev/null +++ b/compiler/example/output/generated/crds/dnsprobeconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: dnsprobeconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: DNSProbeConfig + listKind: DNSProbeConfigList + plural: dnsprobeconfigs + shortNames: + - dnsprobeconfig + singular: dnsprobeconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/dnsprobesconfigfolder.yaml b/compiler/example/output/generated/crds/dnsprobesconfigfolder.yaml new file mode 100644 index 000000000..12e79b509 --- /dev/null +++ b/compiler/example/output/generated/crds/dnsprobesconfigfolder.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":true,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: dnsprobesconfigfolders.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: DNSProbesConfigFolder + listKind: DNSProbesConfigFolderList + plural: dnsprobesconfigfolders + shortNames: + - dnsprobesconfigfolder + singular: dnsprobesconfigfolder + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/dnsprobestatus.yaml b/compiler/example/output/generated/crds/dnsprobestatus.yaml new file mode 100644 index 000000000..6f8a3c78d --- /dev/null +++ b/compiler/example/output/generated/crds/dnsprobestatus.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: dnsprobestatuses.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: DNSProbeStatus + listKind: DNSProbeStatusList + plural: dnsprobestatuses + shortNames: + - dnsprobestatus + singular: dnsprobestatus + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/domain.yaml b/compiler/example/output/generated/crds/domain.yaml new file mode 100644 index 000000000..08cade9b3 --- /dev/null +++ b/compiler/example/output/generated/crds/domain.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: domains.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Domain + listKind: DomainList + plural: domains + shortNames: + - domain + singular: domain + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/domainconfig.yaml b/compiler/example/output/generated/crds/domainconfig.yaml new file mode 100644 index 000000000..640679e22 --- /dev/null +++ b/compiler/example/output/generated/crds/domainconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: domainconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: DomainConfig + listKind: DomainConfigList + plural: domainconfigs + shortNames: + - domainconfig + singular: domainconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/endpoints.yaml b/compiler/example/output/generated/crds/endpoints.yaml new file mode 100644 index 000000000..ad09d4dea --- /dev/null +++ b/compiler/example/output/generated/crds/endpoints.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: endpointses.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Endpoints + listKind: EndpointsList + plural: endpointses + shortNames: + - endpoints + singular: endpoints + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/envoyfilter.yaml b/compiler/example/output/generated/crds/envoyfilter.yaml new file mode 100644 index 000000000..3fbd4bff3 --- /dev/null +++ b/compiler/example/output/generated/crds/envoyfilter.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: envoyfilters.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: EnvoyFilter + listKind: EnvoyFilterList + plural: envoyfilters + shortNames: + - envoyfilter + singular: envoyfilter + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externalaccountconfign.yaml b/compiler/example/output/generated/crds/externalaccountconfign.yaml new file mode 100644 index 000000000..9a85a80ea --- /dev/null +++ b/compiler/example/output/generated/crds/externalaccountconfign.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externalaccountconfigns.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalAccountConfigN + listKind: ExternalAccountConfigNList + plural: externalaccountconfigns + shortNames: + - externalaccountconfign + singular: externalaccountconfign + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externalauditstorage.yaml b/compiler/example/output/generated/crds/externalauditstorage.yaml new file mode 100644 index 000000000..d00bddaf3 --- /dev/null +++ b/compiler/example/output/generated/crds/externalauditstorage.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externalauditstorages.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalAuditStorage + listKind: ExternalAuditStorageList + plural: externalauditstorages + shortNames: + - externalauditstorage + singular: externalauditstorage + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externaldnsconfign.yaml b/compiler/example/output/generated/crds/externaldnsconfign.yaml new file mode 100644 index 000000000..38568c5ed --- /dev/null +++ b/compiler/example/output/generated/crds/externaldnsconfign.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externaldnsconfigns.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalDNSConfigN + listKind: ExternalDNSConfigNList + plural: externaldnsconfigns + shortNames: + - externaldnsconfign + singular: externaldnsconfign + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externaldnsinventory.yaml b/compiler/example/output/generated/crds/externaldnsinventory.yaml new file mode 100644 index 000000000..a4db956a5 --- /dev/null +++ b/compiler/example/output/generated/crds/externaldnsinventory.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externaldnsinventories.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalDNSInventory + listKind: ExternalDNSInventoryList + plural: externaldnsinventories + shortNames: + - externaldnsinventory + singular: externaldnsinventory + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externaldnsinventoryhealthcheck.yaml b/compiler/example/output/generated/crds/externaldnsinventoryhealthcheck.yaml new file mode 100644 index 000000000..622ffbb86 --- /dev/null +++ b/compiler/example/output/generated/crds/externaldnsinventoryhealthcheck.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externaldnsinventoryhealthchecks.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalDNSInventoryHealthCheck + listKind: ExternalDNSInventoryHealthCheckList + plural: externaldnsinventoryhealthchecks + shortNames: + - externaldnsinventoryhealthcheck + singular: externaldnsinventoryhealthcheck + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externaldnsinventoryprimarydomain.yaml b/compiler/example/output/generated/crds/externaldnsinventoryprimarydomain.yaml new file mode 100644 index 000000000..e8ce117cf --- /dev/null +++ b/compiler/example/output/generated/crds/externaldnsinventoryprimarydomain.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externaldnsinventoryprimarydomains.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalDNSInventoryPrimaryDomain + listKind: ExternalDNSInventoryPrimaryDomainList + plural: externaldnsinventoryprimarydomains + shortNames: + - externaldnsinventoryprimarydomain + singular: externaldnsinventoryprimarydomain + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externaldnsinventoryrecord.yaml b/compiler/example/output/generated/crds/externaldnsinventoryrecord.yaml new file mode 100644 index 000000000..f9389f497 --- /dev/null +++ b/compiler/example/output/generated/crds/externaldnsinventoryrecord.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externaldnsinventoryrecords.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalDNSInventoryRecord + listKind: ExternalDNSInventoryRecordList + plural: externaldnsinventoryrecords + shortNames: + - externaldnsinventoryrecord + singular: externaldnsinventoryrecord + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externaldnsinventoryzone.yaml b/compiler/example/output/generated/crds/externaldnsinventoryzone.yaml new file mode 100644 index 000000000..66762e31b --- /dev/null +++ b/compiler/example/output/generated/crds/externaldnsinventoryzone.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externaldnsinventoryzones.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalDNSInventoryZone + listKind: ExternalDNSInventoryZoneList + plural: externaldnsinventoryzones + shortNames: + - externaldnsinventoryzone + singular: externaldnsinventoryzone + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externaldnsruntime.yaml b/compiler/example/output/generated/crds/externaldnsruntime.yaml new file mode 100644 index 000000000..bf556fbbb --- /dev/null +++ b/compiler/example/output/generated/crds/externaldnsruntime.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":true,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externaldnsruntimes.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalDNSRuntime + listKind: ExternalDNSRuntimeList + plural: externaldnsruntimes + shortNames: + - externaldnsruntime + singular: externaldnsruntime + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externaldnsruntimeendpoint.yaml b/compiler/example/output/generated/crds/externaldnsruntimeendpoint.yaml new file mode 100644 index 000000000..5c04cf22d --- /dev/null +++ b/compiler/example/output/generated/crds/externaldnsruntimeendpoint.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externaldnsruntimeendpoints.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalDNSRuntimeEndpoint + listKind: ExternalDNSRuntimeEndpointList + plural: externaldnsruntimeendpoints + shortNames: + - externaldnsruntimeendpoint + singular: externaldnsruntimeendpoint + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externaldnsruntimeprimarydomain.yaml b/compiler/example/output/generated/crds/externaldnsruntimeprimarydomain.yaml new file mode 100644 index 000000000..1afe14540 --- /dev/null +++ b/compiler/example/output/generated/crds/externaldnsruntimeprimarydomain.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externaldnsruntimeprimarydomains.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalDNSRuntimePrimaryDomain + listKind: ExternalDNSRuntimePrimaryDomainList + plural: externaldnsruntimeprimarydomains + shortNames: + - externaldnsruntimeprimarydomain + singular: externaldnsruntimeprimarydomain + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externaldnsruntimesubdomain.yaml b/compiler/example/output/generated/crds/externaldnsruntimesubdomain.yaml new file mode 100644 index 000000000..470aa21a1 --- /dev/null +++ b/compiler/example/output/generated/crds/externaldnsruntimesubdomain.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externaldnsruntimesubdomains.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalDNSRuntimeSubdomain + listKind: ExternalDNSRuntimeSubdomainList + plural: externaldnsruntimesubdomains + shortNames: + - externaldnsruntimesubdomain + singular: externaldnsruntimesubdomain + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externallbconfign.yaml b/compiler/example/output/generated/crds/externallbconfign.yaml new file mode 100644 index 000000000..1800ce250 --- /dev/null +++ b/compiler/example/output/generated/crds/externallbconfign.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externallbconfigns.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalLBConfigN + listKind: ExternalLBConfigNList + plural: externallbconfigns + shortNames: + - externallbconfign + singular: externallbconfign + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externalplugincapability.yaml b/compiler/example/output/generated/crds/externalplugincapability.yaml new file mode 100644 index 000000000..22c8407e7 --- /dev/null +++ b/compiler/example/output/generated/crds/externalplugincapability.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externalplugincapabilities.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalPluginCapability + listKind: ExternalPluginCapabilityList + plural: externalplugincapabilities + shortNames: + - externalplugincapability + singular: externalplugincapability + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externalpluginconfig.yaml b/compiler/example/output/generated/crds/externalpluginconfig.yaml new file mode 100644 index 000000000..00cbd8336 --- /dev/null +++ b/compiler/example/output/generated/crds/externalpluginconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externalpluginconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalPluginConfig + listKind: ExternalPluginConfigList + plural: externalpluginconfigs + shortNames: + - externalpluginconfig + singular: externalpluginconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externalpluginconfigfolder.yaml b/compiler/example/output/generated/crds/externalpluginconfigfolder.yaml new file mode 100644 index 000000000..391e6aa07 --- /dev/null +++ b/compiler/example/output/generated/crds/externalpluginconfigfolder.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externalpluginconfigfolders.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalPluginConfigFolder + listKind: ExternalPluginConfigFolderList + plural: externalpluginconfigfolders + shortNames: + - externalpluginconfigfolder + singular: externalpluginconfigfolder + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externalplugininstanceconfig.yaml b/compiler/example/output/generated/crds/externalplugininstanceconfig.yaml new file mode 100644 index 000000000..e54920d4e --- /dev/null +++ b/compiler/example/output/generated/crds/externalplugininstanceconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externalplugininstanceconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalPluginInstanceConfig + listKind: ExternalPluginInstanceConfigList + plural: externalplugininstanceconfigs + shortNames: + - externalplugininstanceconfig + singular: externalplugininstanceconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externalpluginmonitor.yaml b/compiler/example/output/generated/crds/externalpluginmonitor.yaml new file mode 100644 index 000000000..ad209cdbb --- /dev/null +++ b/compiler/example/output/generated/crds/externalpluginmonitor.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externalpluginmonitors.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalPluginMonitor + listKind: ExternalPluginMonitorList + plural: externalpluginmonitors + shortNames: + - externalpluginmonitor + singular: externalpluginmonitor + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externalserviceconfig.yaml b/compiler/example/output/generated/crds/externalserviceconfig.yaml new file mode 100644 index 000000000..8a2a35a69 --- /dev/null +++ b/compiler/example/output/generated/crds/externalserviceconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externalserviceconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalServiceConfig + listKind: ExternalServiceConfigList + plural: externalserviceconfigs + shortNames: + - externalserviceconfig + singular: externalserviceconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/externalservicesrt.yaml b/compiler/example/output/generated/crds/externalservicesrt.yaml new file mode 100644 index 000000000..eb696899e --- /dev/null +++ b/compiler/example/output/generated/crds/externalservicesrt.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: externalservicesrts.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ExternalServicesRT + listKind: ExternalServicesRTList + plural: externalservicesrts + shortNames: + - externalservicesrt + singular: externalservicesrt + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/featureflag.yaml b/compiler/example/output/generated/crds/featureflag.yaml new file mode 100644 index 000000000..c5b3866e8 --- /dev/null +++ b/compiler/example/output/generated/crds/featureflag.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: featureflags.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: FeatureFlag + listKind: FeatureFlagList + plural: featureflags + shortNames: + - featureflag + singular: featureflag + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/federatedsloconfig.yaml b/compiler/example/output/generated/crds/federatedsloconfig.yaml new file mode 100644 index 000000000..db0cf8051 --- /dev/null +++ b/compiler/example/output/generated/crds/federatedsloconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: federatedsloconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: FederatedSloConfig + listKind: FederatedSloConfigList + plural: federatedsloconfigs + shortNames: + - federatedsloconfig + singular: federatedsloconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/federatedsloserviceconfig.yaml b/compiler/example/output/generated/crds/federatedsloserviceconfig.yaml new file mode 100644 index 000000000..6400c721b --- /dev/null +++ b/compiler/example/output/generated/crds/federatedsloserviceconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: federatedsloserviceconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: FederatedSloServiceConfig + listKind: FederatedSloServiceConfigList + plural: federatedsloserviceconfigs + shortNames: + - federatedsloserviceconfig + singular: federatedsloserviceconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gateway.yaml b/compiler/example/output/generated/crds/gateway.yaml new file mode 100644 index 000000000..508b0c7ad --- /dev/null +++ b/compiler/example/output/generated/crds/gateway.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gateways.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Gateway + listKind: GatewayList + plural: gateways + shortNames: + - gateway + singular: gateway + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gatewayconfig.yaml b/compiler/example/output/generated/crds/gatewayconfig.yaml new file mode 100644 index 000000000..120c5fcb7 --- /dev/null +++ b/compiler/example/output/generated/crds/gatewayconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gatewayconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GatewayConfig + listKind: GatewayConfigList + plural: gatewayconfigs + shortNames: + - gatewayconfig + singular: gatewayconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gatewayconfigadditionallisteners.yaml b/compiler/example/output/generated/crds/gatewayconfigadditionallisteners.yaml new file mode 100644 index 000000000..6c132f6cb --- /dev/null +++ b/compiler/example/output/generated/crds/gatewayconfigadditionallisteners.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gatewayconfigadditionallistenerses.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GatewayConfigAdditionalListeners + listKind: GatewayConfigAdditionalListenersList + plural: gatewayconfigadditionallistenerses + shortNames: + - gatewayconfigadditionallisteners + singular: gatewayconfigadditionallisteners + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gatewayconfiglistenercertificate.yaml b/compiler/example/output/generated/crds/gatewayconfiglistenercertificate.yaml new file mode 100644 index 000000000..9cd14b91f --- /dev/null +++ b/compiler/example/output/generated/crds/gatewayconfiglistenercertificate.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gatewayconfiglistenercertificates.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GatewayConfigListenerCertificate + listKind: GatewayConfigListenerCertificateList + plural: gatewayconfiglistenercertificates + shortNames: + - gatewayconfiglistenercertificate + singular: gatewayconfiglistenercertificate + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gatewayconfiglistenerdestinationroute.yaml b/compiler/example/output/generated/crds/gatewayconfiglistenerdestinationroute.yaml new file mode 100644 index 000000000..9a7b14e46 --- /dev/null +++ b/compiler/example/output/generated/crds/gatewayconfiglistenerdestinationroute.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gatewayconfiglistenerdestinationroutes.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GatewayConfigListenerDestinationRoute + listKind: GatewayConfigListenerDestinationRouteList + plural: gatewayconfiglistenerdestinationroutes + shortNames: + - gatewayconfiglistenerdestinationroute + singular: gatewayconfiglistenerdestinationroute + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/geodiscovery.yaml b/compiler/example/output/generated/crds/geodiscovery.yaml new file mode 100644 index 000000000..f6f529fe3 --- /dev/null +++ b/compiler/example/output/generated/crds/geodiscovery.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: geodiscoveries.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GeoDiscovery + listKind: GeoDiscoveryList + plural: geodiscoveries + shortNames: + - geodiscovery + singular: geodiscovery + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/geodiscoveryrt.yaml b/compiler/example/output/generated/crds/geodiscoveryrt.yaml new file mode 100644 index 000000000..26fa8bbad --- /dev/null +++ b/compiler/example/output/generated/crds/geodiscoveryrt.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: geodiscoveryrts.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GeoDiscoveryRT + listKind: GeoDiscoveryRTList + plural: geodiscoveryrts + shortNames: + - geodiscoveryrt + singular: geodiscoveryrt + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/globalnamespace.yaml b/compiler/example/output/generated/crds/globalnamespace.yaml new file mode 100644 index 000000000..b018676eb --- /dev/null +++ b/compiler/example/output/generated/crds/globalnamespace.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: globalnamespaces.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GlobalNamespace + listKind: GlobalNamespaceList + plural: globalnamespaces + shortNames: + - globalnamespace + singular: globalnamespace + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/globalns.yaml b/compiler/example/output/generated/crds/globalns.yaml new file mode 100644 index 000000000..ea6cf3523 --- /dev/null +++ b/compiler/example/output/generated/crds/globalns.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: globalnses.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GlobalNs + listKind: GlobalNsList + plural: globalnses + shortNames: + - globalns + singular: globalns + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/globalregistrationservice.yaml b/compiler/example/output/generated/crds/globalregistrationservice.yaml new file mode 100644 index 000000000..845bbecda --- /dev/null +++ b/compiler/example/output/generated/crds/globalregistrationservice.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: globalregistrationservices.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GlobalRegistrationService + listKind: GlobalRegistrationServiceList + plural: globalregistrationservices + shortNames: + - globalregistrationservice + singular: globalregistrationservice + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gns.yaml b/compiler/example/output/generated/crds/gns.yaml new file mode 100644 index 000000000..dc64bc973 --- /dev/null +++ b/compiler/example/output/generated/crds/gns.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gnses.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GNS + listKind: GNSList + plural: gnses + shortNames: + - gns + singular: gns + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gns_additionalgnsdata.yaml b/compiler/example/output/generated/crds/gns_additionalgnsdata.yaml deleted file mode 100644 index 0adac4102..000000000 --- a/compiler/example/output/generated/crds/gns_additionalgnsdata.yaml +++ /dev/null @@ -1,98 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} - creationTimestamp: null - name: additionalgnsdatas.gns.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: gns.tsm.tanzu.vmware.com - names: - kind: AdditionalGnsData - listKind: AdditionalGnsDataList - plural: additionalgnsdatas - shortNames: - - additionalgnsdata - singular: additionalgnsdata - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - description: - properties: - discriptionA: - type: string - discriptionB: - type: string - discriptionC: - type: string - discriptionD: - type: string - required: - - discriptionA - - discriptionB - - discriptionC - - discriptionD - type: object - required: - - description - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - status: - properties: - statusX: - format: int32 - type: integer - statusY: - format: int32 - type: integer - required: - - statusX - - statusY - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/gns_barchild.yaml b/compiler/example/output/generated/crds/gns_barchild.yaml deleted file mode 100644 index 3de510e70..000000000 --- a/compiler/example/output/generated/crds/gns_barchild.yaml +++ /dev/null @@ -1,72 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"name":"gns.BarChild","hierarchy":["roots.root.tsm.tanzu.vmware.com","configs.config.tsm.tanzu.vmware.com","gnses.gns.tsm.tanzu.vmware.com"],"is_singleton":true,"nexus-rest-api-gen":{"uris":null}} - creationTimestamp: null - name: barchilds.gns.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: gns.tsm.tanzu.vmware.com - names: - kind: BarChild - listKind: BarChildList - plural: barchilds - shortNames: - - barchild - singular: barchild - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - name: - type: string - required: - - name - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/gns_dns.yaml b/compiler/example/output/generated/crds/gns_dns.yaml deleted file mode 100644 index ce0f95340..000000000 --- a/compiler/example/output/generated/crds/gns_dns.yaml +++ /dev/null @@ -1,65 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"name":"gns.Dns","hierarchy":["roots.root.tsm.tanzu.vmware.com","configs.config.tsm.tanzu.vmware.com"],"is_singleton":true,"nexus-rest-api-gen":{"uris":[{"uri":"/v1alpha2/dns","query_params":["config.Config","gns.Dns"],"methods":{"DELETE":{"200":{"description":"OK"},"404":{"description":"Not Found"},"501":{"description":"Not Implemented"}},"GET":{"200":{"description":"OK"},"404":{"description":"Not Found"},"501":{"description":"Not Implemented"}},"PUT":{"200":{"description":"OK"},"201":{"description":"Created"},"501":{"description":"Not Implemented"}}}},{"uri":"/v1alpha2/dnses","query_params":["config.Config"],"methods":{"LIST":{"200":{"description":"OK"},"404":{"description":"Not Found"},"501":{"description":"Not Implemented"}}}}]}} - creationTimestamp: null - name: dnses.gns.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: gns.tsm.tanzu.vmware.com - names: - kind: Dns - listKind: DnsList - plural: dnses - shortNames: - - dns - singular: dns - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/gns_foo.yaml b/compiler/example/output/generated/crds/gns_foo.yaml deleted file mode 100644 index 500c8774f..000000000 --- a/compiler/example/output/generated/crds/gns_foo.yaml +++ /dev/null @@ -1,72 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"name":"gns.Foo","hierarchy":["roots.root.tsm.tanzu.vmware.com","configs.config.tsm.tanzu.vmware.com","gnses.gns.tsm.tanzu.vmware.com"],"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} - creationTimestamp: null - name: foos.gns.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: gns.tsm.tanzu.vmware.com - names: - kind: Foo - listKind: FooList - plural: foos - shortNames: - - foo - singular: foo - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - password: - type: string - required: - - password - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/gns_gns.yaml b/compiler/example/output/generated/crds/gns_gns.yaml deleted file mode 100644 index 39b12f77b..000000000 --- a/compiler/example/output/generated/crds/gns_gns.yaml +++ /dev/null @@ -1,318 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"name":"gns.Gns","hierarchy":["roots.root.tsm.tanzu.vmware.com","configs.config.tsm.tanzu.vmware.com"],"children":{"accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com":{"fieldName":"GnsAccessControlPolicy","fieldNameGvk":"gnsAccessControlPolicyGvk","isNamed":false},"barchilds.gns.tsm.tanzu.vmware.com":{"fieldName":"FooChild","fieldNameGvk":"fooChildGvk","isNamed":false},"foos.gns.tsm.tanzu.vmware.com":{"fieldName":"Foo","fieldNameGvk":"fooGvk","isNamed":false},"ignorechilds.gns.tsm.tanzu.vmware.com":{"fieldName":"IgnoreChild","fieldNameGvk":"ignoreChildGvk","isNamed":false},"svcgroups.servicegroup.tsm.tanzu.vmware.com":{"fieldName":"GnsServiceGroups","fieldNameGvk":"gnsServiceGroupsGvk","isNamed":true}},"links":{"Dns":{"fieldName":"Dns","fieldNameGvk":"dnsGvk","isNamed":false}},"is_singleton":false,"nexus-rest-api-gen":{"uris":[{"uri":"/v1alpha2/global-namespace/{gns.Gns}","query_params":["config.Config"],"methods":{"DELETE":{"200":{"description":"OK"},"404":{"description":"Not Found"},"501":{"description":"Not Implemented"}},"GET":{"200":{"description":"OK"},"404":{"description":"Not Found"},"501":{"description":"Not Implemented"}},"PUT":{"200":{"description":"OK"},"201":{"description":"Created"},"501":{"description":"Not Implemented"}}}},{"uri":"/v1alpha2/global-namespaces","query_params":["config.Config"],"methods":{"LIST":{"200":{"description":"OK"},"404":{"description":"Not Found"},"501":{"description":"Not Implemented"}}}},{"uri":"/test-foo","query_params":["config.Config"],"methods":{"DELETE":{"200":{"description":"ok"},"404":{"description":"Not Found"},"501":{"description":"Not Implemented"}}}},{"uri":"/test-bar","query_params":["config.Config"],"methods":{"PATCH":{"400":{"description":"Bad Request"}}}}]},"description":"this is my awesome node"} - creationTimestamp: null - name: gnses.gns.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: gns.tsm.tanzu.vmware.com - names: - kind: Gns - listKind: GnsList - plural: gnses - shortNames: - - gns - singular: gns - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - description: - properties: - color: - type: string - hostPort: - properties: - host: - type: string - port: - format: int32 - type: integer - required: - - host - - port - type: object - instance: - format: float - type: number - projectId: - type: string - testAns: - items: - properties: - name: - type: string - required: - - name - type: object - type: array - version: - type: string - required: - - color - - version - - projectId - - testAns - - instance - - hostPort - type: object - differentSpec: - type: object - x-kubernetes-preserve-unknown-fields: true - dnsGvk: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - group - - kind - - name - type: object - domain: - maxLength: 8 - minLength: 2 - pattern: abc - type: string - fooChildGvk: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - group - - kind - - name - type: object - fooGvk: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - group - - kind - - name - type: object - gnsAccessControlPolicyGvk: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - group - - kind - - name - type: object - gnsServiceGroupsGvk: - additionalProperties: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - group - - kind - - name - type: object - type: object - ignoreChildGvk: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - group - - kind - - name - type: object - mapPointer: - additionalProperties: - type: string - type: object - meta: - type: string - otherDescription: - properties: - color: - type: string - hostPort: - properties: - host: - type: string - port: - format: int32 - type: integer - required: - - host - - port - type: object - instance: - format: float - type: number - projectId: - type: string - testAns: - items: - properties: - name: - type: string - required: - - name - type: object - type: array - version: - type: string - required: - - color - - version - - projectId - - testAns - - instance - - hostPort - type: object - port: - format: int32 - type: integer - serviceSegmentRef: - properties: - field1: - type: string - field2: - type: string - required: - - field1 - - field2 - type: object - serviceSegmentRefMap: - additionalProperties: - properties: - field1: - type: string - field2: - type: string - required: - - field1 - - field2 - type: object - type: object - serviceSegmentRefPointer: - properties: - field1: - type: string - field2: - type: string - required: - - field1 - - field2 - type: object - serviceSegmentRefs: - items: - properties: - field1: - type: string - field2: - type: string - required: - - field1 - - field2 - type: object - type: array - slicePointer: - items: - type: string - type: array - useSharedGateway: - type: boolean - workloadSpec: - type: object - x-kubernetes-preserve-unknown-fields: true - required: - - domain - - useSharedGateway - - description - - meta - - port - - otherDescription - - mapPointer - - slicePointer - - workloadSpec - - differentSpec - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - state: - properties: - temperature: - format: int32 - type: integer - working: - type: boolean - required: - - working - - temperature - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/gns_ignorechild.yaml b/compiler/example/output/generated/crds/gns_ignorechild.yaml deleted file mode 100644 index 78288a055..000000000 --- a/compiler/example/output/generated/crds/gns_ignorechild.yaml +++ /dev/null @@ -1,72 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"name":"gns.IgnoreChild","hierarchy":["roots.root.tsm.tanzu.vmware.com","configs.config.tsm.tanzu.vmware.com","gnses.gns.tsm.tanzu.vmware.com"],"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} - creationTimestamp: null - name: ignorechilds.gns.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: gns.tsm.tanzu.vmware.com - names: - kind: IgnoreChild - listKind: IgnoreChildList - plural: ignorechilds - shortNames: - - ignorechild - singular: ignorechild - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - name: - type: string - required: - - name - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/gns_randomgnsdata.yaml b/compiler/example/output/generated/crds/gns_randomgnsdata.yaml deleted file mode 100644 index 2bc3804d3..000000000 --- a/compiler/example/output/generated/crds/gns_randomgnsdata.yaml +++ /dev/null @@ -1,98 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} - creationTimestamp: null - name: randomgnsdatas.gns.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: gns.tsm.tanzu.vmware.com - names: - kind: RandomGnsData - listKind: RandomGnsDataList - plural: randomgnsdatas - shortNames: - - randomgnsdata - singular: randomgnsdata - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - description: - properties: - discriptionA: - type: string - discriptionB: - type: string - discriptionC: - type: string - discriptionD: - type: string - required: - - discriptionA - - discriptionB - - discriptionC - - discriptionD - type: object - required: - - description - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - status: - properties: - statusX: - format: int32 - type: integer - statusY: - format: int32 - type: integer - required: - - statusX - - statusY - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/gnsaccesscontrolpolicy.yaml b/compiler/example/output/generated/crds/gnsaccesscontrolpolicy.yaml new file mode 100644 index 000000000..9d0544f61 --- /dev/null +++ b/compiler/example/output/generated/crds/gnsaccesscontrolpolicy.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gnsaccesscontrolpolicies.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GnsAccessControlPolicy + listKind: GnsAccessControlPolicyList + plural: gnsaccesscontrolpolicies + shortNames: + - gnsaccesscontrolpolicy + singular: gnsaccesscontrolpolicy + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gnsaccesscontrolpolicyrt.yaml b/compiler/example/output/generated/crds/gnsaccesscontrolpolicyrt.yaml new file mode 100644 index 000000000..823bde7f5 --- /dev/null +++ b/compiler/example/output/generated/crds/gnsaccesscontrolpolicyrt.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gnsaccesscontrolpolicyrts.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GnsAccessControlPolicyRT + listKind: GnsAccessControlPolicyRTList + plural: gnsaccesscontrolpolicyrts + shortNames: + - gnsaccesscontrolpolicyrt + singular: gnsaccesscontrolpolicyrt + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gnsbindingrt.yaml b/compiler/example/output/generated/crds/gnsbindingrt.yaml new file mode 100644 index 000000000..1b66647f6 --- /dev/null +++ b/compiler/example/output/generated/crds/gnsbindingrt.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gnsbindingrts.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GnsBindingRT + listKind: GnsBindingRTList + plural: gnsbindingrts + shortNames: + - gnsbindingrt + singular: gnsbindingrt + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gnsendpointsconfig.yaml b/compiler/example/output/generated/crds/gnsendpointsconfig.yaml new file mode 100644 index 000000000..354a7c362 --- /dev/null +++ b/compiler/example/output/generated/crds/gnsendpointsconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gnsendpointsconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GnsEndpointsConfig + listKind: GnsEndpointsConfigList + plural: gnsendpointsconfigs + shortNames: + - gnsendpointsconfig + singular: gnsendpointsconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gnsroutingconfig.yaml b/compiler/example/output/generated/crds/gnsroutingconfig.yaml new file mode 100644 index 000000000..2fa1c0107 --- /dev/null +++ b/compiler/example/output/generated/crds/gnsroutingconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gnsroutingconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GNSRoutingConfig + listKind: GNSRoutingConfigList + plural: gnsroutingconfigs + shortNames: + - gnsroutingconfig + singular: gnsroutingconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gnsroutingruleconfig.yaml b/compiler/example/output/generated/crds/gnsroutingruleconfig.yaml new file mode 100644 index 000000000..3fe9d07aa --- /dev/null +++ b/compiler/example/output/generated/crds/gnsroutingruleconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gnsroutingruleconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GnsRoutingRuleConfig + listKind: GnsRoutingRuleConfigList + plural: gnsroutingruleconfigs + shortNames: + - gnsroutingruleconfig + singular: gnsroutingruleconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gnsschemaviolationdiscovery.yaml b/compiler/example/output/generated/crds/gnsschemaviolationdiscovery.yaml new file mode 100644 index 000000000..1daa62b67 --- /dev/null +++ b/compiler/example/output/generated/crds/gnsschemaviolationdiscovery.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gnsschemaviolationdiscoveries.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GnsSchemaViolationDiscovery + listKind: GnsSchemaViolationDiscoveryList + plural: gnsschemaviolationdiscoveries + shortNames: + - gnsschemaviolationdiscovery + singular: gnsschemaviolationdiscovery + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gnssegmentationpolicy.yaml b/compiler/example/output/generated/crds/gnssegmentationpolicy.yaml new file mode 100644 index 000000000..48c1cfe4d --- /dev/null +++ b/compiler/example/output/generated/crds/gnssegmentationpolicy.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gnssegmentationpolicies.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GnsSegmentationPolicy + listKind: GnsSegmentationPolicyList + plural: gnssegmentationpolicies + shortNames: + - gnssegmentationpolicy + singular: gnssegmentationpolicy + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gnssegmentationpolicyrt.yaml b/compiler/example/output/generated/crds/gnssegmentationpolicyrt.yaml new file mode 100644 index 000000000..3ee1fdde0 --- /dev/null +++ b/compiler/example/output/generated/crds/gnssegmentationpolicyrt.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gnssegmentationpolicyrts.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GnsSegmentationPolicyRT + listKind: GnsSegmentationPolicyRTList + plural: gnssegmentationpolicyrts + shortNames: + - gnssegmentationpolicyrt + singular: gnssegmentationpolicyrt + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gnsserviceentryconfig.yaml b/compiler/example/output/generated/crds/gnsserviceentryconfig.yaml new file mode 100644 index 000000000..aa22e40d6 --- /dev/null +++ b/compiler/example/output/generated/crds/gnsserviceentryconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gnsserviceentryconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GnsServiceEntryConfig + listKind: GnsServiceEntryConfigList + plural: gnsserviceentryconfigs + shortNames: + - gnsserviceentryconfig + singular: gnsserviceentryconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gnssvcgroup.yaml b/compiler/example/output/generated/crds/gnssvcgroup.yaml new file mode 100644 index 000000000..fa24acefa --- /dev/null +++ b/compiler/example/output/generated/crds/gnssvcgroup.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gnssvcgroups.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GNSSvcGroup + listKind: GNSSvcGroupList + plural: gnssvcgroups + shortNames: + - gnssvcgroup + singular: gnssvcgroup + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/gnssvcgrouprt.yaml b/compiler/example/output/generated/crds/gnssvcgrouprt.yaml new file mode 100644 index 000000000..8a22fffbe --- /dev/null +++ b/compiler/example/output/generated/crds/gnssvcgrouprt.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: gnssvcgrouprts.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: GnsSvcGroupRT + listKind: GnsSvcGroupRTList + plural: gnssvcgrouprts + shortNames: + - gnssvcgrouprt + singular: gnssvcgrouprt + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/haconfig.yaml b/compiler/example/output/generated/crds/haconfig.yaml new file mode 100644 index 000000000..8eb58ed26 --- /dev/null +++ b/compiler/example/output/generated/crds/haconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: haconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: HaConfig + listKind: HaConfigList + plural: haconfigs + shortNames: + - haconfig + singular: haconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/haconfigv2.yaml b/compiler/example/output/generated/crds/haconfigv2.yaml new file mode 100644 index 000000000..23d464033 --- /dev/null +++ b/compiler/example/output/generated/crds/haconfigv2.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: haconfigv2s.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: HaConfigV2 + listKind: HaConfigV2List + plural: haconfigv2s + shortNames: + - haconfigv2 + singular: haconfigv2 + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/healthcheckconfign.yaml b/compiler/example/output/generated/crds/healthcheckconfign.yaml new file mode 100644 index 000000000..10d50921a --- /dev/null +++ b/compiler/example/output/generated/crds/healthcheckconfign.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: healthcheckconfigns.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: HealthCheckConfigN + listKind: HealthCheckConfigNList + plural: healthcheckconfigns + shortNames: + - healthcheckconfign + singular: healthcheckconfign + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/hostconfig.yaml b/compiler/example/output/generated/crds/hostconfig.yaml new file mode 100644 index 000000000..087a40302 --- /dev/null +++ b/compiler/example/output/generated/crds/hostconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: hostconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: HostConfig + listKind: HostConfigList + plural: hostconfigs + shortNames: + - hostconfig + singular: hostconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/hostconfigv2.yaml b/compiler/example/output/generated/crds/hostconfigv2.yaml new file mode 100644 index 000000000..4a957453a --- /dev/null +++ b/compiler/example/output/generated/crds/hostconfigv2.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: hostconfigv2s.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: HostConfigV2 + listKind: HostConfigV2List + plural: hostconfigv2s + shortNames: + - hostconfigv2 + singular: hostconfigv2 + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/inboundauthenticationconfig.yaml b/compiler/example/output/generated/crds/inboundauthenticationconfig.yaml new file mode 100644 index 000000000..7696fbceb --- /dev/null +++ b/compiler/example/output/generated/crds/inboundauthenticationconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: inboundauthenticationconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: InboundAuthenticationConfig + listKind: InboundAuthenticationConfigList + plural: inboundauthenticationconfigs + shortNames: + - inboundauthenticationconfig + singular: inboundauthenticationconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/inventory.yaml b/compiler/example/output/generated/crds/inventory.yaml new file mode 100644 index 000000000..2d6335528 --- /dev/null +++ b/compiler/example/output/generated/crds/inventory.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":true,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: inventories.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Inventory + listKind: InventoryList + plural: inventories + shortNames: + - inventory + singular: inventory + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/issuer.yaml b/compiler/example/output/generated/crds/issuer.yaml new file mode 100644 index 000000000..55bcea9ca --- /dev/null +++ b/compiler/example/output/generated/crds/issuer.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: issuers.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Issuer + listKind: IssuerList + plural: issuers + shortNames: + - issuer + singular: issuer + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/job.yaml b/compiler/example/output/generated/crds/job.yaml new file mode 100644 index 000000000..664e9f51a --- /dev/null +++ b/compiler/example/output/generated/crds/job.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: jobs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Job + listKind: JobList + plural: jobs + shortNames: + - job + singular: job + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/jobconfig.yaml b/compiler/example/output/generated/crds/jobconfig.yaml new file mode 100644 index 000000000..2190824a8 --- /dev/null +++ b/compiler/example/output/generated/crds/jobconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: jobconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: JobConfig + listKind: JobConfigList + plural: jobconfigs + shortNames: + - jobconfig + singular: jobconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/jobconfigfolder.yaml b/compiler/example/output/generated/crds/jobconfigfolder.yaml new file mode 100644 index 000000000..5f64a8da9 --- /dev/null +++ b/compiler/example/output/generated/crds/jobconfigfolder.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":true,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: jobconfigfolders.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: JobConfigFolder + listKind: JobConfigFolderList + plural: jobconfigfolders + shortNames: + - jobconfigfolder + singular: jobconfigfolder + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/jobfolder.yaml b/compiler/example/output/generated/crds/jobfolder.yaml new file mode 100644 index 000000000..af4a0c30b --- /dev/null +++ b/compiler/example/output/generated/crds/jobfolder.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: jobfolders.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: JobFolder + listKind: JobFolderList + plural: jobfolders + shortNames: + - jobfolder + singular: jobfolder + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/knativeingress.yaml b/compiler/example/output/generated/crds/knativeingress.yaml new file mode 100644 index 000000000..fdd5212e6 --- /dev/null +++ b/compiler/example/output/generated/crds/knativeingress.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: knativeingresses.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: KnativeIngress + listKind: KnativeIngressList + plural: knativeingresses + shortNames: + - knativeingress + singular: knativeingress + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/labelconfig.yaml b/compiler/example/output/generated/crds/labelconfig.yaml new file mode 100644 index 000000000..25c497002 --- /dev/null +++ b/compiler/example/output/generated/crds/labelconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: labelconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: LabelConfig + listKind: LabelConfigList + plural: labelconfigs + shortNames: + - labelconfig + singular: labelconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/localregistrationservice.yaml b/compiler/example/output/generated/crds/localregistrationservice.yaml new file mode 100644 index 000000000..a337dd0ef --- /dev/null +++ b/compiler/example/output/generated/crds/localregistrationservice.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: localregistrationservices.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: LocalRegistrationService + listKind: LocalRegistrationServiceList + plural: localregistrationservices + shortNames: + - localregistrationservice + singular: localregistrationservice + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/localregistrationservicecluster.yaml b/compiler/example/output/generated/crds/localregistrationservicecluster.yaml new file mode 100644 index 000000000..46f125c1f --- /dev/null +++ b/compiler/example/output/generated/crds/localregistrationservicecluster.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: localregistrationserviceclusters.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: LocalRegistrationServiceCluster + listKind: LocalRegistrationServiceClusterList + plural: localregistrationserviceclusters + shortNames: + - localregistrationservicecluster + singular: localregistrationservicecluster + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/localregistrationserviceresource.yaml b/compiler/example/output/generated/crds/localregistrationserviceresource.yaml new file mode 100644 index 000000000..993c68274 --- /dev/null +++ b/compiler/example/output/generated/crds/localregistrationserviceresource.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: localregistrationserviceresources.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: LocalRegistrationServiceResource + listKind: LocalRegistrationServiceResourceList + plural: localregistrationserviceresources + shortNames: + - localregistrationserviceresource + singular: localregistrationserviceresource + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/log.yaml b/compiler/example/output/generated/crds/log.yaml new file mode 100644 index 000000000..613c9307f --- /dev/null +++ b/compiler/example/output/generated/crds/log.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: logs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Log + listKind: LogList + plural: logs + shortNames: + - log + singular: log + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/logfolder.yaml b/compiler/example/output/generated/crds/logfolder.yaml new file mode 100644 index 000000000..6e0143eca --- /dev/null +++ b/compiler/example/output/generated/crds/logfolder.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: logfolders.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: LogFolder + listKind: LogFolderList + plural: logfolders + shortNames: + - logfolder + singular: logfolder + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/metricmonitor.yaml b/compiler/example/output/generated/crds/metricmonitor.yaml new file mode 100644 index 000000000..901d9ddf2 --- /dev/null +++ b/compiler/example/output/generated/crds/metricmonitor.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: metricmonitors.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: MetricMonitor + listKind: MetricMonitorList + plural: metricmonitors + shortNames: + - metricmonitor + singular: metricmonitor + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/networkattachmentdefinition.yaml b/compiler/example/output/generated/crds/networkattachmentdefinition.yaml new file mode 100644 index 000000000..224468872 --- /dev/null +++ b/compiler/example/output/generated/crds/networkattachmentdefinition.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: networkattachmentdefinitions.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: NetworkAttachmentDefinition + listKind: NetworkAttachmentDefinitionList + plural: networkattachmentdefinitions + shortNames: + - networkattachmentdefinition + singular: networkattachmentdefinition + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/networkattachmentdefinitionconfig.yaml b/compiler/example/output/generated/crds/networkattachmentdefinitionconfig.yaml new file mode 100644 index 000000000..81aaf378c --- /dev/null +++ b/compiler/example/output/generated/crds/networkattachmentdefinitionconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: networkattachmentdefinitionconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: NetworkAttachmentDefinitionConfig + listKind: NetworkAttachmentDefinitionConfigList + plural: networkattachmentdefinitionconfigs + shortNames: + - networkattachmentdefinitionconfig + singular: networkattachmentdefinitionconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/node.yaml b/compiler/example/output/generated/crds/node.yaml new file mode 100644 index 000000000..f555b630a --- /dev/null +++ b/compiler/example/output/generated/crds/node.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: nodes.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Node + listKind: NodeList + plural: nodes + shortNames: + - node + singular: node + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/nodedefinition.yaml b/compiler/example/output/generated/crds/nodedefinition.yaml new file mode 100644 index 000000000..1c047f8f3 --- /dev/null +++ b/compiler/example/output/generated/crds/nodedefinition.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: nodedefinitions.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: NodeDefinition + listKind: NodeDefinitionList + plural: nodedefinitions + shortNames: + - nodedefinition + singular: nodedefinition + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/nodefolder.yaml b/compiler/example/output/generated/crds/nodefolder.yaml new file mode 100644 index 000000000..8f3b4ac2a --- /dev/null +++ b/compiler/example/output/generated/crds/nodefolder.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":true,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: nodefolders.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: NodeFolder + listKind: NodeFolderList + plural: nodefolders + shortNames: + - nodefolder + singular: nodefolder + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/nodefoldercluster.yaml b/compiler/example/output/generated/crds/nodefoldercluster.yaml new file mode 100644 index 000000000..44e6498e2 --- /dev/null +++ b/compiler/example/output/generated/crds/nodefoldercluster.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: nodefolderclusters.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: NodeFolderCluster + listKind: NodeFolderClusterList + plural: nodefolderclusters + shortNames: + - nodefoldercluster + singular: nodefoldercluster + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/nodegroup.yaml b/compiler/example/output/generated/crds/nodegroup.yaml new file mode 100644 index 000000000..97c144a22 --- /dev/null +++ b/compiler/example/output/generated/crds/nodegroup.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: nodegroups.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: NodeGroup + listKind: NodeGroupList + plural: nodegroups + shortNames: + - nodegroup + singular: nodegroup + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/nodestatus.yaml b/compiler/example/output/generated/crds/nodestatus.yaml new file mode 100644 index 000000000..6cb9dd535 --- /dev/null +++ b/compiler/example/output/generated/crds/nodestatus.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: nodestatuses.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: NodeStatus + listKind: NodeStatusList + plural: nodestatuses + shortNames: + - nodestatus + singular: nodestatus + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/nodetemplate.yaml b/compiler/example/output/generated/crds/nodetemplate.yaml new file mode 100644 index 000000000..78dc2a44b --- /dev/null +++ b/compiler/example/output/generated/crds/nodetemplate.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: nodetemplates.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: NodeTemplate + listKind: NodeTemplateList + plural: nodetemplates + shortNames: + - nodetemplate + singular: nodetemplate + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/outboundauthenticationmode.yaml b/compiler/example/output/generated/crds/outboundauthenticationmode.yaml new file mode 100644 index 000000000..4e8230e5a --- /dev/null +++ b/compiler/example/output/generated/crds/outboundauthenticationmode.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: outboundauthenticationmodes.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: OutboundAuthenticationMode + listKind: OutboundAuthenticationModeList + plural: outboundauthenticationmodes + shortNames: + - outboundauthenticationmode + singular: outboundauthenticationmode + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/peerauthentication.yaml b/compiler/example/output/generated/crds/peerauthentication.yaml new file mode 100644 index 000000000..8427d07e2 --- /dev/null +++ b/compiler/example/output/generated/crds/peerauthentication.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: peerauthentications.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: PeerAuthentication + listKind: PeerAuthenticationList + plural: peerauthentications + shortNames: + - peerauthentication + singular: peerauthentication + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/piidiscovery.yaml b/compiler/example/output/generated/crds/piidiscovery.yaml new file mode 100644 index 000000000..e191cb29a --- /dev/null +++ b/compiler/example/output/generated/crds/piidiscovery.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: piidiscoveries.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: PiiDiscovery + listKind: PiiDiscoveryList + plural: piidiscoveries + shortNames: + - piidiscovery + singular: piidiscovery + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/piidiscoveryrt.yaml b/compiler/example/output/generated/crds/piidiscoveryrt.yaml new file mode 100644 index 000000000..3cfbd253c --- /dev/null +++ b/compiler/example/output/generated/crds/piidiscoveryrt.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: piidiscoveryrts.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: PiiDiscoveryRT + listKind: PiiDiscoveryRTList + plural: piidiscoveryrts + shortNames: + - piidiscoveryrt + singular: piidiscoveryrt + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/policyconfig.yaml b/compiler/example/output/generated/crds/policyconfig.yaml new file mode 100644 index 000000000..0284af96c --- /dev/null +++ b/compiler/example/output/generated/crds/policyconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: policyconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: PolicyConfig + listKind: PolicyConfigList + plural: policyconfigs + shortNames: + - policyconfig + singular: policyconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/policypkg_accesscontrolpolicy.yaml b/compiler/example/output/generated/crds/policypkg_accesscontrolpolicy.yaml deleted file mode 100644 index ceed56a93..000000000 --- a/compiler/example/output/generated/crds/policypkg_accesscontrolpolicy.yaml +++ /dev/null @@ -1,83 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"name":"policypkg.AccessControlPolicy","hierarchy":["roots.root.tsm.tanzu.vmware.com","configs.config.tsm.tanzu.vmware.com","gnses.gns.tsm.tanzu.vmware.com"],"children":{"acpconfigs.policypkg.tsm.tanzu.vmware.com":{"fieldName":"PolicyConfigs","fieldNameGvk":"policyConfigsGvk","isNamed":true}},"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} - creationTimestamp: null - name: accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: policypkg.tsm.tanzu.vmware.com - names: - kind: AccessControlPolicy - listKind: AccessControlPolicyList - plural: accesscontrolpolicies - shortNames: - - accesscontrolpolicy - singular: accesscontrolpolicy - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - policyConfigsGvk: - additionalProperties: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - group - - kind - - name - type: object - type: object - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/policypkg_acpconfig.yaml b/compiler/example/output/generated/crds/policypkg_acpconfig.yaml deleted file mode 100644 index d94b88d89..000000000 --- a/compiler/example/output/generated/crds/policypkg_acpconfig.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"name":"policypkg.ACPConfig","hierarchy":["roots.root.tsm.tanzu.vmware.com","configs.config.tsm.tanzu.vmware.com","gnses.gns.tsm.tanzu.vmware.com","accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com"],"links":{"DestSvcGroups":{"fieldName":"DestSvcGroups","fieldNameGvk":"destSvcGroupsGvk","isNamed":true},"SourceSvcGroups":{"fieldName":"SourceSvcGroups","fieldNameGvk":"sourceSvcGroupsGvk","isNamed":true}},"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} - creationTimestamp: null - name: acpconfigs.policypkg.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: policypkg.tsm.tanzu.vmware.com - names: - kind: ACPConfig - listKind: ACPConfigList - plural: acpconfigs - shortNames: - - acpconfig - singular: acpconfig - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - conditions: - items: - type: string - type: array - description: - type: string - destSvcGroupsGvk: - additionalProperties: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - group - - kind - - name - type: object - type: object - displayName: - type: string - gns: - type: string - projectId: - type: string - sourceSvcGroupsGvk: - additionalProperties: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - group - - kind - - name - type: object - type: object - tags: - items: - type: string - type: array - required: - - displayName - - gns - - description - - tags - - projectId - - conditions - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - status: - properties: - statusABC: - format: int32 - type: integer - statusXYZ: - format: int32 - type: integer - required: - - statusABC - - statusXYZ - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/policypkg_additionalpolicydata.yaml b/compiler/example/output/generated/crds/policypkg_additionalpolicydata.yaml deleted file mode 100644 index cca3f012c..000000000 --- a/compiler/example/output/generated/crds/policypkg_additionalpolicydata.yaml +++ /dev/null @@ -1,98 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} - creationTimestamp: null - name: additionalpolicydatas.policypkg.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: policypkg.tsm.tanzu.vmware.com - names: - kind: AdditionalPolicyData - listKind: AdditionalPolicyDataList - plural: additionalpolicydatas - shortNames: - - additionalpolicydata - singular: additionalpolicydata - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - description: - properties: - discriptionA: - type: string - discriptionB: - type: string - discriptionC: - type: string - discriptionD: - type: string - required: - - discriptionA - - discriptionB - - discriptionC - - discriptionD - type: object - required: - - description - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - status: - properties: - statusX: - format: int32 - type: integer - statusY: - format: int32 - type: integer - required: - - statusX - - statusY - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/policypkg_randompolicydata.yaml b/compiler/example/output/generated/crds/policypkg_randompolicydata.yaml deleted file mode 100644 index f75c49524..000000000 --- a/compiler/example/output/generated/crds/policypkg_randompolicydata.yaml +++ /dev/null @@ -1,98 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} - creationTimestamp: null - name: randompolicydatas.policypkg.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: policypkg.tsm.tanzu.vmware.com - names: - kind: RandomPolicyData - listKind: RandomPolicyDataList - plural: randompolicydatas - shortNames: - - randompolicydata - singular: randompolicydata - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - description: - properties: - discriptionA: - type: string - discriptionB: - type: string - discriptionC: - type: string - discriptionD: - type: string - required: - - discriptionA - - discriptionB - - discriptionC - - discriptionD - type: object - required: - - description - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - status: - properties: - statusX: - format: int32 - type: integer - statusY: - format: int32 - type: integer - required: - - statusX - - statusY - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/policypkg_vmpolicy.yaml b/compiler/example/output/generated/crds/policypkg_vmpolicy.yaml deleted file mode 100644 index a45c35531..000000000 --- a/compiler/example/output/generated/crds/policypkg_vmpolicy.yaml +++ /dev/null @@ -1,65 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"name":"policypkg.VMpolicy","hierarchy":["roots.root.tsm.tanzu.vmware.com","configs.config.tsm.tanzu.vmware.com"],"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} - creationTimestamp: null - name: vmpolicies.policypkg.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: policypkg.tsm.tanzu.vmware.com - names: - kind: VMpolicy - listKind: VMpolicyList - plural: vmpolicies - shortNames: - - vmpolicy - singular: vmpolicy - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/policytemplate.yaml b/compiler/example/output/generated/crds/policytemplate.yaml new file mode 100644 index 000000000..2265ce8ae --- /dev/null +++ b/compiler/example/output/generated/crds/policytemplate.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: policytemplates.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: PolicyTemplate + listKind: PolicyTemplateList + plural: policytemplates + shortNames: + - policytemplate + singular: policytemplate + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/progressiveupgrade.yaml b/compiler/example/output/generated/crds/progressiveupgrade.yaml new file mode 100644 index 000000000..eae33908d --- /dev/null +++ b/compiler/example/output/generated/crds/progressiveupgrade.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: progressiveupgrades.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ProgressiveUpgrade + listKind: ProgressiveUpgradeList + plural: progressiveupgrades + shortNames: + - progressiveupgrade + singular: progressiveupgrade + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/progressiveupgradeconfig.yaml b/compiler/example/output/generated/crds/progressiveupgradeconfig.yaml new file mode 100644 index 000000000..1dfee37b4 --- /dev/null +++ b/compiler/example/output/generated/crds/progressiveupgradeconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: progressiveupgradeconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ProgressiveUpgradeConfig + listKind: ProgressiveUpgradeConfigList + plural: progressiveupgradeconfigs + shortNames: + - progressiveupgradeconfig + singular: progressiveupgradeconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/progressiveupgradefolder.yaml b/compiler/example/output/generated/crds/progressiveupgradefolder.yaml new file mode 100644 index 000000000..0f179928d --- /dev/null +++ b/compiler/example/output/generated/crds/progressiveupgradefolder.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":true,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: progressiveupgradefolders.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ProgressiveUpgradeFolder + listKind: ProgressiveUpgradeFolderList + plural: progressiveupgradefolders + shortNames: + - progressiveupgradefolder + singular: progressiveupgradefolder + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/progressiveupgraderuntime.yaml b/compiler/example/output/generated/crds/progressiveupgraderuntime.yaml new file mode 100644 index 000000000..217c794e1 --- /dev/null +++ b/compiler/example/output/generated/crds/progressiveupgraderuntime.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: progressiveupgraderuntimes.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ProgressiveUpgradeRuntime + listKind: ProgressiveUpgradeRuntimeList + plural: progressiveupgraderuntimes + shortNames: + - progressiveupgraderuntime + singular: progressiveupgraderuntime + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/project.yaml b/compiler/example/output/generated/crds/project.yaml new file mode 100644 index 000000000..504fa6d34 --- /dev/null +++ b/compiler/example/output/generated/crds/project.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: projects.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Project + listKind: ProjectList + plural: projects + shortNames: + - project + singular: project + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/projectconfig.yaml b/compiler/example/output/generated/crds/projectconfig.yaml new file mode 100644 index 000000000..ab5d568a7 --- /dev/null +++ b/compiler/example/output/generated/crds/projectconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: projectconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ProjectConfig + listKind: ProjectConfigList + plural: projectconfigs + shortNames: + - projectconfig + singular: projectconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/projectinventory.yaml b/compiler/example/output/generated/crds/projectinventory.yaml new file mode 100644 index 000000000..5b70674b6 --- /dev/null +++ b/compiler/example/output/generated/crds/projectinventory.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: projectinventories.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ProjectInventory + listKind: ProjectInventoryList + plural: projectinventories + shortNames: + - projectinventory + singular: projectinventory + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/projectquery.yaml b/compiler/example/output/generated/crds/projectquery.yaml new file mode 100644 index 000000000..d21c3f10e --- /dev/null +++ b/compiler/example/output/generated/crds/projectquery.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: projectqueries.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ProjectQuery + listKind: ProjectQueryList + plural: projectqueries + shortNames: + - projectquery + singular: projectquery + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/publicserviceconfig.yaml b/compiler/example/output/generated/crds/publicserviceconfig.yaml new file mode 100644 index 000000000..5f9ffa965 --- /dev/null +++ b/compiler/example/output/generated/crds/publicserviceconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: publicserviceconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: PublicServiceConfig + listKind: PublicServiceConfigList + plural: publicserviceconfigs + shortNames: + - publicserviceconfig + singular: publicserviceconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/publicservicerouteconfig.yaml b/compiler/example/output/generated/crds/publicservicerouteconfig.yaml new file mode 100644 index 000000000..b1a40ceec --- /dev/null +++ b/compiler/example/output/generated/crds/publicservicerouteconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: publicservicerouteconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: PublicServiceRouteConfig + listKind: PublicServiceRouteConfigList + plural: publicservicerouteconfigs + shortNames: + - publicservicerouteconfig + singular: publicservicerouteconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/publicservicert.yaml b/compiler/example/output/generated/crds/publicservicert.yaml new file mode 100644 index 000000000..743785995 --- /dev/null +++ b/compiler/example/output/generated/crds/publicservicert.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: publicservicerts.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: PublicServiceRT + listKind: PublicServiceRTList + plural: publicservicerts + shortNames: + - publicservicert + singular: publicservicert + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/remotegatewayserviceconfig.yaml b/compiler/example/output/generated/crds/remotegatewayserviceconfig.yaml new file mode 100644 index 000000000..45c1c0afc --- /dev/null +++ b/compiler/example/output/generated/crds/remotegatewayserviceconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: remotegatewayserviceconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: RemoteGatewayServiceConfig + listKind: RemoteGatewayServiceConfigList + plural: remotegatewayserviceconfigs + shortNames: + - remotegatewayserviceconfig + singular: remotegatewayserviceconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/resourcegroup.yaml b/compiler/example/output/generated/crds/resourcegroup.yaml new file mode 100644 index 000000000..73e856e49 --- /dev/null +++ b/compiler/example/output/generated/crds/resourcegroup.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: resourcegroups.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ResourceGroup + listKind: ResourceGroupList + plural: resourcegroups + shortNames: + - resourcegroup + singular: resourcegroup + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/resourcegrouprt.yaml b/compiler/example/output/generated/crds/resourcegrouprt.yaml new file mode 100644 index 000000000..2eddbea2e --- /dev/null +++ b/compiler/example/output/generated/crds/resourcegrouprt.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: resourcegrouprts.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ResourceGroupRT + listKind: ResourceGroupRTList + plural: resourcegrouprts + shortNames: + - resourcegrouprt + singular: resourcegrouprt + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/root.yaml b/compiler/example/output/generated/crds/root.yaml new file mode 100644 index 000000000..9dcd35513 --- /dev/null +++ b/compiler/example/output/generated/crds/root.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":true,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: roots.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Root + listKind: RootList + plural: roots + shortNames: + - root + singular: root + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/root_root.yaml b/compiler/example/output/generated/crds/root_root.yaml deleted file mode 100644 index c8af8cb99..000000000 --- a/compiler/example/output/generated/crds/root_root.yaml +++ /dev/null @@ -1,81 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"name":"root.Root","children":{"configs.config.tsm.tanzu.vmware.com":{"fieldName":"Config","fieldNameGvk":"configGvk","isNamed":false}},"is_singleton":true,"nexus-rest-api-gen":{"uris":null}} - creationTimestamp: null - name: roots.root.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: root.tsm.tanzu.vmware.com - names: - kind: Root - listKind: RootList - plural: roots - shortNames: - - root - singular: root - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - configGvk: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - group - - kind - - name - type: object - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/rpolicy.yaml b/compiler/example/output/generated/crds/rpolicy.yaml new file mode 100644 index 000000000..eecac9f13 --- /dev/null +++ b/compiler/example/output/generated/crds/rpolicy.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: rpolicies.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: RPolicy + listKind: RPolicyList + plural: rpolicies + shortNames: + - rpolicy + singular: rpolicy + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/runtime.yaml b/compiler/example/output/generated/crds/runtime.yaml new file mode 100644 index 000000000..d7ac94d86 --- /dev/null +++ b/compiler/example/output/generated/crds/runtime.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":true,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: runtimes.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Runtime + listKind: RuntimeList + plural: runtimes + shortNames: + - runtime + singular: runtime + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/schemaviolationdiscoveryrt.yaml b/compiler/example/output/generated/crds/schemaviolationdiscoveryrt.yaml new file mode 100644 index 000000000..ab87a48d2 --- /dev/null +++ b/compiler/example/output/generated/crds/schemaviolationdiscoveryrt.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: schemaviolationdiscoveryrts.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: SchemaViolationDiscoveryRT + listKind: SchemaViolationDiscoveryRTList + plural: schemaviolationdiscoveryrts + shortNames: + - schemaviolationdiscoveryrt + singular: schemaviolationdiscoveryrt + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/secrethash.yaml b/compiler/example/output/generated/crds/secrethash.yaml new file mode 100644 index 000000000..c737d2f2d --- /dev/null +++ b/compiler/example/output/generated/crds/secrethash.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: secrethashes.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: SecretHash + listKind: SecretHashList + plural: secrethashes + shortNames: + - secrethash + singular: secrethash + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/secretrtconfig.yaml b/compiler/example/output/generated/crds/secretrtconfig.yaml new file mode 100644 index 000000000..b78ac6aed --- /dev/null +++ b/compiler/example/output/generated/crds/secretrtconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: secretrtconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: SecretRTConfig + listKind: SecretRTConfigList + plural: secretrtconfigs + shortNames: + - secretrtconfig + singular: secretrtconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/securitycontextconstraints.yaml b/compiler/example/output/generated/crds/securitycontextconstraints.yaml new file mode 100644 index 000000000..3108c4984 --- /dev/null +++ b/compiler/example/output/generated/crds/securitycontextconstraints.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: securitycontextconstraintses.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: SecurityContextConstraints + listKind: SecurityContextConstraintsList + plural: securitycontextconstraintses + shortNames: + - securitycontextconstraints + singular: securitycontextconstraints + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/securitycontextconstraintsconfig.yaml b/compiler/example/output/generated/crds/securitycontextconstraintsconfig.yaml new file mode 100644 index 000000000..0d27002a0 --- /dev/null +++ b/compiler/example/output/generated/crds/securitycontextconstraintsconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: securitycontextconstraintsconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: SecurityContextConstraintsConfig + listKind: SecurityContextConstraintsConfigList + plural: securitycontextconstraintsconfigs + shortNames: + - securitycontextconstraintsconfig + singular: securitycontextconstraintsconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/service.yaml b/compiler/example/output/generated/crds/service.yaml new file mode 100644 index 000000000..9a0cf5f6b --- /dev/null +++ b/compiler/example/output/generated/crds/service.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: services.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Service + listKind: ServiceList + plural: services + shortNames: + - service + singular: service + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/serviceconfig.yaml b/compiler/example/output/generated/crds/serviceconfig.yaml new file mode 100644 index 000000000..4ab4bf337 --- /dev/null +++ b/compiler/example/output/generated/crds/serviceconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: serviceconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceConfig + listKind: ServiceConfigList + plural: serviceconfigs + shortNames: + - serviceconfig + singular: serviceconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/servicecronjob.yaml b/compiler/example/output/generated/crds/servicecronjob.yaml new file mode 100644 index 000000000..9a331510a --- /dev/null +++ b/compiler/example/output/generated/crds/servicecronjob.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: servicecronjobs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceCronJob + listKind: ServiceCronJobList + plural: servicecronjobs + shortNames: + - servicecronjob + singular: servicecronjob + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/servicedaemonset.yaml b/compiler/example/output/generated/crds/servicedaemonset.yaml new file mode 100644 index 000000000..c22fb26aa --- /dev/null +++ b/compiler/example/output/generated/crds/servicedaemonset.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: servicedaemonsets.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceDaemonSet + listKind: ServiceDaemonSetList + plural: servicedaemonsets + shortNames: + - servicedaemonset + singular: servicedaemonset + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/servicedeployment.yaml b/compiler/example/output/generated/crds/servicedeployment.yaml new file mode 100644 index 000000000..64387f253 --- /dev/null +++ b/compiler/example/output/generated/crds/servicedeployment.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: servicedeployments.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceDeployment + listKind: ServiceDeploymentList + plural: servicedeployments + shortNames: + - servicedeployment + singular: servicedeployment + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/servicedeploymentcontainer.yaml b/compiler/example/output/generated/crds/servicedeploymentcontainer.yaml new file mode 100644 index 000000000..ee6c6e014 --- /dev/null +++ b/compiler/example/output/generated/crds/servicedeploymentcontainer.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: servicedeploymentcontainers.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceDeploymentContainer + listKind: ServiceDeploymentContainerList + plural: servicedeploymentcontainers + shortNames: + - servicedeploymentcontainer + singular: servicedeploymentcontainer + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/servicedirectoryentryconfig.yaml b/compiler/example/output/generated/crds/servicedirectoryentryconfig.yaml new file mode 100644 index 000000000..f3de1429d --- /dev/null +++ b/compiler/example/output/generated/crds/servicedirectoryentryconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: servicedirectoryentryconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceDirectoryEntryConfig + listKind: ServiceDirectoryEntryConfigList + plural: servicedirectoryentryconfigs + shortNames: + - servicedirectoryentryconfig + singular: servicedirectoryentryconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/servicedirectoryn.yaml b/compiler/example/output/generated/crds/servicedirectoryn.yaml new file mode 100644 index 000000000..007630a88 --- /dev/null +++ b/compiler/example/output/generated/crds/servicedirectoryn.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: servicedirectoryns.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceDirectoryN + listKind: ServiceDirectoryNList + plural: servicedirectoryns + shortNames: + - servicedirectoryn + singular: servicedirectoryn + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/servicedirectoryrt.yaml b/compiler/example/output/generated/crds/servicedirectoryrt.yaml new file mode 100644 index 000000000..3f79c0017 --- /dev/null +++ b/compiler/example/output/generated/crds/servicedirectoryrt.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":true,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: servicedirectoryrts.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceDirectoryRT + listKind: ServiceDirectoryRTList + plural: servicedirectoryrts + shortNames: + - servicedirectoryrt + singular: servicedirectoryrt + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/servicedirectoryrtfolder.yaml b/compiler/example/output/generated/crds/servicedirectoryrtfolder.yaml new file mode 100644 index 000000000..19e0fabee --- /dev/null +++ b/compiler/example/output/generated/crds/servicedirectoryrtfolder.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: servicedirectoryrtfolders.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceDirectoryRTFolder + listKind: ServiceDirectoryRTFolderList + plural: servicedirectoryrtfolders + shortNames: + - servicedirectoryrtfolder + singular: servicedirectoryrtfolder + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/servicedirectoryrtfolderentry.yaml b/compiler/example/output/generated/crds/servicedirectoryrtfolderentry.yaml new file mode 100644 index 000000000..d97f79486 --- /dev/null +++ b/compiler/example/output/generated/crds/servicedirectoryrtfolderentry.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: servicedirectoryrtfolderentries.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceDirectoryRTFolderEntry + listKind: ServiceDirectoryRTFolderEntryList + plural: servicedirectoryrtfolderentries + shortNames: + - servicedirectoryrtfolderentry + singular: servicedirectoryrtfolderentry + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/serviceentry.yaml b/compiler/example/output/generated/crds/serviceentry.yaml new file mode 100644 index 000000000..7291e3ec7 --- /dev/null +++ b/compiler/example/output/generated/crds/serviceentry.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: serviceentries.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceEntry + listKind: ServiceEntryList + plural: serviceentries + shortNames: + - serviceentry + singular: serviceentry + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/serviceentryconfig.yaml b/compiler/example/output/generated/crds/serviceentryconfig.yaml new file mode 100644 index 000000000..c44b8d109 --- /dev/null +++ b/compiler/example/output/generated/crds/serviceentryconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: serviceentryconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceEntryConfig + listKind: ServiceEntryConfigList + plural: serviceentryconfigs + shortNames: + - serviceentryconfig + singular: serviceentryconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/servicegroup_svcgroup.yaml b/compiler/example/output/generated/crds/servicegroup_svcgroup.yaml deleted file mode 100644 index 7fbf5e67c..000000000 --- a/compiler/example/output/generated/crds/servicegroup_svcgroup.yaml +++ /dev/null @@ -1,78 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"name":"servicegroup.SvcGroup","hierarchy":["roots.root.tsm.tanzu.vmware.com","configs.config.tsm.tanzu.vmware.com","gnses.gns.tsm.tanzu.vmware.com"],"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} - creationTimestamp: null - name: svcgroups.servicegroup.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: servicegroup.tsm.tanzu.vmware.com - names: - kind: SvcGroup - listKind: SvcGroupList - plural: svcgroups - shortNames: - - svcgroup - singular: svcgroup - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - color: - type: string - description: - type: string - displayName: - type: string - required: - - displayName - - description - - color - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/servicegroup_svcgrouplinkinfo.yaml b/compiler/example/output/generated/crds/servicegroup_svcgrouplinkinfo.yaml deleted file mode 100644 index e80c06968..000000000 --- a/compiler/example/output/generated/crds/servicegroup_svcgrouplinkinfo.yaml +++ /dev/null @@ -1,81 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - nexus: | - {"name":"servicegroup.SvcGroupLinkInfo","hierarchy":["roots.root.tsm.tanzu.vmware.com","configs.config.tsm.tanzu.vmware.com"],"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} - creationTimestamp: null - name: svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com -spec: - conversion: - strategy: None - group: servicegroup.tsm.tanzu.vmware.com - names: - kind: SvcGroupLinkInfo - listKind: SvcGroupLinkInfoList - plural: svcgrouplinkinfos - shortNames: - - svcgrouplinkinfo - singular: svcgrouplinkinfo - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - clusterName: - type: string - domainName: - type: string - serviceName: - type: string - serviceType: - type: string - required: - - clusterName - - domainName - - serviceName - - serviceType - type: object - status: - properties: - nexus: - properties: - remoteGeneration: - format: int64 - type: integer - sourceGeneration: - format: int64 - type: integer - required: - - sourceGeneration - - remoteGeneration - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: - - v1 diff --git a/compiler/example/output/generated/crds/serviceinstance.yaml b/compiler/example/output/generated/crds/serviceinstance.yaml new file mode 100644 index 000000000..cc7dd9681 --- /dev/null +++ b/compiler/example/output/generated/crds/serviceinstance.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: serviceinstances.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceInstance + listKind: ServiceInstanceList + plural: serviceinstances + shortNames: + - serviceinstance + singular: serviceinstance + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/serviceinstancecontainer.yaml b/compiler/example/output/generated/crds/serviceinstancecontainer.yaml new file mode 100644 index 000000000..327f4eb09 --- /dev/null +++ b/compiler/example/output/generated/crds/serviceinstancecontainer.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: serviceinstancecontainers.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceInstanceContainer + listKind: ServiceInstanceContainerList + plural: serviceinstancecontainers + shortNames: + - serviceinstancecontainer + singular: serviceinstancecontainer + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/servicejob.yaml b/compiler/example/output/generated/crds/servicejob.yaml new file mode 100644 index 000000000..d75d87ed8 --- /dev/null +++ b/compiler/example/output/generated/crds/servicejob.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: servicejobs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceJob + listKind: ServiceJobList + plural: servicejobs + shortNames: + - servicejob + singular: servicejob + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/servicelevelobjective.yaml b/compiler/example/output/generated/crds/servicelevelobjective.yaml new file mode 100644 index 000000000..569a1548a --- /dev/null +++ b/compiler/example/output/generated/crds/servicelevelobjective.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: servicelevelobjectives.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceLevelObjective + listKind: ServiceLevelObjectiveList + plural: servicelevelobjectives + shortNames: + - servicelevelobjective + singular: servicelevelobjective + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/servicelevelobjectivefolder.yaml b/compiler/example/output/generated/crds/servicelevelobjectivefolder.yaml new file mode 100644 index 000000000..788506266 --- /dev/null +++ b/compiler/example/output/generated/crds/servicelevelobjectivefolder.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: servicelevelobjectivefolders.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceLevelObjectiveFolder + listKind: ServiceLevelObjectiveFolderList + plural: servicelevelobjectivefolders + shortNames: + - servicelevelobjectivefolder + singular: servicelevelobjectivefolder + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/servicereplicaset.yaml b/compiler/example/output/generated/crds/servicereplicaset.yaml new file mode 100644 index 000000000..be6809496 --- /dev/null +++ b/compiler/example/output/generated/crds/servicereplicaset.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: servicereplicasets.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceReplicaSet + listKind: ServiceReplicaSetList + plural: servicereplicasets + shortNames: + - servicereplicaset + singular: servicereplicaset + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/servicestatefulset.yaml b/compiler/example/output/generated/crds/servicestatefulset.yaml new file mode 100644 index 000000000..c623624b4 --- /dev/null +++ b/compiler/example/output/generated/crds/servicestatefulset.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: servicestatefulsets.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceStatefulSet + listKind: ServiceStatefulSetList + plural: servicestatefulsets + shortNames: + - servicestatefulset + singular: servicestatefulset + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/servicetemplate.yaml b/compiler/example/output/generated/crds/servicetemplate.yaml new file mode 100644 index 000000000..66b78621a --- /dev/null +++ b/compiler/example/output/generated/crds/servicetemplate.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: servicetemplates.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceTemplate + listKind: ServiceTemplateList + plural: servicetemplates + shortNames: + - servicetemplate + singular: servicetemplate + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/servicetemplateservicedefinition.yaml b/compiler/example/output/generated/crds/servicetemplateservicedefinition.yaml new file mode 100644 index 000000000..00bc810c1 --- /dev/null +++ b/compiler/example/output/generated/crds/servicetemplateservicedefinition.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: servicetemplateservicedefinitions.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceTemplateServiceDefinition + listKind: ServiceTemplateServiceDefinitionList + plural: servicetemplateservicedefinitions + shortNames: + - servicetemplateservicedefinition + singular: servicetemplateservicedefinition + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/serviceversion.yaml b/compiler/example/output/generated/crds/serviceversion.yaml new file mode 100644 index 000000000..6713f305b --- /dev/null +++ b/compiler/example/output/generated/crds/serviceversion.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: serviceversions.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceVersion + listKind: ServiceVersionList + plural: serviceversions + shortNames: + - serviceversion + singular: serviceversion + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/serviceversionconfig.yaml b/compiler/example/output/generated/crds/serviceversionconfig.yaml new file mode 100644 index 000000000..7d0434809 --- /dev/null +++ b/compiler/example/output/generated/crds/serviceversionconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: serviceversionconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: ServiceVersionConfig + listKind: ServiceVersionConfigList + plural: serviceversionconfigs + shortNames: + - serviceversionconfig + singular: serviceversionconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/sharedserviceconfig.yaml b/compiler/example/output/generated/crds/sharedserviceconfig.yaml new file mode 100644 index 000000000..fa5bf2157 --- /dev/null +++ b/compiler/example/output/generated/crds/sharedserviceconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: sharedserviceconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: SharedServiceConfig + listKind: SharedServiceConfigList + plural: sharedserviceconfigs + shortNames: + - sharedserviceconfig + singular: sharedserviceconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/sloconfig.yaml b/compiler/example/output/generated/crds/sloconfig.yaml new file mode 100644 index 000000000..bf7988744 --- /dev/null +++ b/compiler/example/output/generated/crds/sloconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: sloconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: SloConfig + listKind: SloConfigList + plural: sloconfigs + shortNames: + - sloconfig + singular: sloconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/slofolder.yaml b/compiler/example/output/generated/crds/slofolder.yaml new file mode 100644 index 000000000..f4df0d432 --- /dev/null +++ b/compiler/example/output/generated/crds/slofolder.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: slofolders.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: SLOFolder + listKind: SLOFolderList + plural: slofolders + shortNames: + - slofolder + singular: slofolder + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/slopolicy.yaml b/compiler/example/output/generated/crds/slopolicy.yaml new file mode 100644 index 000000000..cf1cfabb3 --- /dev/null +++ b/compiler/example/output/generated/crds/slopolicy.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: slopolicies.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: SLOPolicy + listKind: SLOPolicyList + plural: slopolicies + shortNames: + - slopolicy + singular: slopolicy + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/sloserviceconfig.yaml b/compiler/example/output/generated/crds/sloserviceconfig.yaml new file mode 100644 index 000000000..8aaf8fa47 --- /dev/null +++ b/compiler/example/output/generated/crds/sloserviceconfig.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: sloserviceconfigs.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: SloServiceConfig + listKind: SloServiceConfigList + plural: sloserviceconfigs + shortNames: + - sloserviceconfig + singular: sloserviceconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/svcgroup.yaml b/compiler/example/output/generated/crds/svcgroup.yaml new file mode 100644 index 000000000..191663833 --- /dev/null +++ b/compiler/example/output/generated/crds/svcgroup.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: svcgroups.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: SvcGroup + listKind: SvcGroupList + plural: svcgroups + shortNames: + - svcgroup + singular: svcgroup + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/svcgrouprt.yaml b/compiler/example/output/generated/crds/svcgrouprt.yaml new file mode 100644 index 000000000..7e41803a9 --- /dev/null +++ b/compiler/example/output/generated/crds/svcgrouprt.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: svcgrouprts.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: SvcGroupRT + listKind: SvcGroupRTList + plural: svcgrouprts + shortNames: + - svcgrouprt + singular: svcgrouprt + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/table.yaml b/compiler/example/output/generated/crds/table.yaml new file mode 100644 index 000000000..ec5340329 --- /dev/null +++ b/compiler/example/output/generated/crds/table.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: tables.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Table + listKind: TableList + plural: tables + shortNames: + - table + singular: table + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/template.yaml b/compiler/example/output/generated/crds/template.yaml new file mode 100644 index 000000000..6ce0d8b02 --- /dev/null +++ b/compiler/example/output/generated/crds/template.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: templates.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Template + listKind: TemplateList + plural: templates + shortNames: + - template + singular: template + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/templategroup.yaml b/compiler/example/output/generated/crds/templategroup.yaml new file mode 100644 index 000000000..c49ec34fb --- /dev/null +++ b/compiler/example/output/generated/crds/templategroup.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: templategroups.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: TemplateGroup + listKind: TemplateGroupList + plural: templategroups + shortNames: + - templategroup + singular: templategroup + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/tenant.yaml b/compiler/example/output/generated/crds/tenant.yaml new file mode 100644 index 000000000..fc33b0961 --- /dev/null +++ b/compiler/example/output/generated/crds/tenant.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: tenants.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: Tenant + listKind: TenantList + plural: tenants + shortNames: + - tenant + singular: tenant + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/tenantresource.yaml b/compiler/example/output/generated/crds/tenantresource.yaml new file mode 100644 index 000000000..e021eca2f --- /dev/null +++ b/compiler/example/output/generated/crds/tenantresource.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: tenantresources.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: TenantResource + listKind: TenantResourceList + plural: tenantresources + shortNames: + - tenantresource + singular: tenantresource + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/tenanttoken.yaml b/compiler/example/output/generated/crds/tenanttoken.yaml new file mode 100644 index 000000000..742ff5c6a --- /dev/null +++ b/compiler/example/output/generated/crds/tenanttoken.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: tenanttokens.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: TenantToken + listKind: TenantTokenList + plural: tenanttokens + shortNames: + - tenanttoken + singular: tenanttoken + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/user.yaml b/compiler/example/output/generated/crds/user.yaml new file mode 100644 index 000000000..3af07e80d --- /dev/null +++ b/compiler/example/output/generated/crds/user.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: users.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: User + listKind: UserList + plural: users + shortNames: + - user + singular: user + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/userdiscovery.yaml b/compiler/example/output/generated/crds/userdiscovery.yaml new file mode 100644 index 000000000..28b8d103a --- /dev/null +++ b/compiler/example/output/generated/crds/userdiscovery.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: userdiscoveries.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: UserDiscovery + listKind: UserDiscoveryList + plural: userdiscoveries + shortNames: + - userdiscovery + singular: userdiscovery + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/userdiscoveryrt.yaml b/compiler/example/output/generated/crds/userdiscoveryrt.yaml new file mode 100644 index 000000000..0a7e8eab3 --- /dev/null +++ b/compiler/example/output/generated/crds/userdiscoveryrt.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: userdiscoveryrts.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: UserDiscoveryRT + listKind: UserDiscoveryRTList + plural: userdiscoveryrts + shortNames: + - userdiscoveryrt + singular: userdiscoveryrt + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/userfolder.yaml b/compiler/example/output/generated/crds/userfolder.yaml new file mode 100644 index 000000000..82f37c65e --- /dev/null +++ b/compiler/example/output/generated/crds/userfolder.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":true,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: userfolders.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: UserFolder + listKind: UserFolderList + plural: userfolders + shortNames: + - userfolder + singular: userfolder + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/usergroup.yaml b/compiler/example/output/generated/crds/usergroup.yaml new file mode 100644 index 000000000..7af70386a --- /dev/null +++ b/compiler/example/output/generated/crds/usergroup.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: usergroups.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: UserGroup + listKind: UserGroupList + plural: usergroups + shortNames: + - usergroup + singular: usergroup + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/userpreference.yaml b/compiler/example/output/generated/crds/userpreference.yaml new file mode 100644 index 000000000..13d506631 --- /dev/null +++ b/compiler/example/output/generated/crds/userpreference.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: userpreferences.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: UserPreference + listKind: UserPreferenceList + plural: userpreferences + shortNames: + - userpreference + singular: userpreference + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/virtualservice.yaml b/compiler/example/output/generated/crds/virtualservice.yaml new file mode 100644 index 000000000..e7203390f --- /dev/null +++ b/compiler/example/output/generated/crds/virtualservice.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: virtualservices.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: VirtualService + listKind: VirtualServiceList + plural: virtualservices + shortNames: + - virtualservice + singular: virtualservice + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/crds/workloadentry.yaml b/compiler/example/output/generated/crds/workloadentry.yaml new file mode 100644 index 000000000..176cd9317 --- /dev/null +++ b/compiler/example/output/generated/crds/workloadentry.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + nexus: | + {"is_singleton":false,"nexus-rest-api-gen":{"uris":null}} + creationTimestamp: null + name: workloadentries.tsm.tanzu.vmware.com +spec: + conversion: + strategy: None + group: tsm.tanzu.vmware.com + names: + kind: WorkloadEntry + listKind: WorkloadEntryList + plural: workloadentries + shortNames: + - workloadentry + singular: workloadentry + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + metadata: + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: + - v1 diff --git a/compiler/example/output/generated/go.mod b/compiler/example/output/generated/go.mod deleted file mode 100644 index b3e3e1ca9..000000000 --- a/compiler/example/output/generated/go.mod +++ /dev/null @@ -1,80 +0,0 @@ -module github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated - -go 1.18 - -replace github.com/vmware-tanzu/graph-framework-for-microservices/gqlgen => ../../../../gqlgen - -replace github.com/vmware-tanzu/graph-framework-for-microservices/kube-openapi => ../../../../kube-openapi - -replace github.com/vmware-tanzu/graph-framework-for-microservices/nexus => ../../../../nexus - -require ( - github.com/elliotchance/orderedmap v1.4.0 - github.com/golang/protobuf v1.5.2 - github.com/rs/cors v1.8.2 - github.com/sirupsen/logrus v1.8.1 - github.com/vektah/gqlparser/v2 v2.5.0 - github.com/vmware-tanzu/cartographer v0.3.0 - github.com/vmware-tanzu/graph-framework-for-microservices/gqlgen v0.0.0-00010101000000-000000000000 - github.com/vmware-tanzu/graph-framework-for-microservices/nexus v0.2.36-0.20221019134229-f47a3f43cc69 - google.golang.org/grpc v1.43.0 - k8s.io/apimachinery v0.23.5 - k8s.io/client-go v0.23.5 -) - -require ( - github.com/agnivade/levenshtein v1.1.1 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.1.1 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/evanphx/json-patch v4.12.0+incompatible // indirect - github.com/fsnotify/fsnotify v1.5.1 // indirect - github.com/go-logr/logr v1.2.3 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/google/go-cmp v0.5.6 // indirect - github.com/google/gofuzz v1.2.0 // indirect - github.com/googleapis/gnostic v0.5.5 // indirect - github.com/gorilla/websocket v1.5.0 // indirect - github.com/hashicorp/golang-lru v0.5.4 // indirect - github.com/imdario/mergo v0.3.12 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/mitchellh/mapstructure v1.4.1 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.11.1 // indirect - github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.28.0 // indirect - github.com/prometheus/procfs v0.6.0 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/urfave/cli/v2 v2.8.1 // indirect - github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect - golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect - golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect - golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect - golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect - golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect - golang.org/x/tools v0.1.10 // indirect - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2 // indirect - google.golang.org/protobuf v1.28.0 // indirect - gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.23.5 // indirect - k8s.io/apiextensions-apiserver v0.23.5 // indirect - k8s.io/klog/v2 v2.30.0 // indirect - k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect - k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect - sigs.k8s.io/controller-runtime v0.11.1 // indirect - sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect -) diff --git a/compiler/example/output/generated/go.sum b/compiler/example/output/generated/go.sum deleted file mode 100644 index 135606d52..000000000 --- a/compiler/example/output/generated/go.sum +++ /dev/null @@ -1,1002 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= -github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= -github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210826220005-b48c857c3a0e/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= -github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= -github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= -github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU= -github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= -github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/elliotchance/orderedmap v1.4.0 h1:wZtfeEONCbx6in1CZyE6bELEt/vFayMvsxqI5SgsR+A= -github.com/elliotchance/orderedmap v1.4.0/go.mod h1:wsDwEaX5jEoyhbs7x93zk2H/qv0zwuhg4inXhDkYqys= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= -github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= -github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= -github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= -github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= -github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/zapr v1.2.0 h1:n4JnPI1T3Qq1SFEi/F8rwLrZERp2bso19PJZDB9dayk= -github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/cel-go v0.9.0/go.mod h1:U7ayypeSkw23szu4GaQTPJGx66c20mx8JklMSxrmI1w= -github.com/google/cel-spec v0.6.0/go.mod h1:Nwjgxy5CbjlPrtCWjeDjUyKMl8w41YBYGjsyDdqk0xA= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw= -github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kevinmbeaulieu/eq-go v1.0.0/go.mod h1:G3S8ajA56gKBZm4UB9AOyoOS37JO3roToPzKNM8dtdM= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/logrusorgru/aurora/v3 v3.0.0/go.mod h1:vsR12bk5grlLvLXAYrBsb5Oc/N+LxAlxggSjiwMnCUc= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/matryer/moq v0.2.7/go.mod h1:kITsx543GOENm48TUAQyJ9+SAvFSr7iGQXPoth/VUBk= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.11.1 h1:+4eQaD7vAZ6DsfsxB15hbE0odUjGI5ARs9yskGu1v4s= -github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.28.0 h1:vGVfV9KrDTvWt5boZO0I19g2E3CsWfpPPKZM9dt3mEw= -github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= -github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/urfave/cli/v2 v2.8.1 h1:CGuYNZF9IKZY/rfBe3lJpccSoIY1ytfvmgQT90cNOl4= -github.com/urfave/cli/v2 v2.8.1/go.mod h1:Z41J9TPoffeoqP0Iza0YbAhGvymRdZAd2uPmZ5JxRdY= -github.com/vektah/gqlparser/v2 v2.5.0 h1:GwEwy7AJsqPWrey0bHnn+3JLaHLZVT66wY/+O+Tf9SU= -github.com/vektah/gqlparser/v2 v2.5.0/go.mod h1:mPgqFBu/woKTVYWyNk8cO3kh4S/f4aRFZrvOnp3hmCs= -github.com/vmware-tanzu/cartographer v0.3.0 h1:x3sYmEiWj/Yy8WWPm6rGVJ80eF1ntytdIpvbmd3oyaU= -github.com/vmware-tanzu/cartographer v0.3.0/go.mod h1:8Lo2d/vvnFNFl0diClxm8ycxeGbFylRvOaYxiEb++NI= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= -go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= -go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= -go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= -go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= -go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= -go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= -go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= -go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= -go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= -go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= -go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY= -golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff/go.mod h1:YD9qOF0M9xpSpdWTBbzEl5e/RnCefISl8E5Noe10jFM= -golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20= -golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= -gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201102152239-715cce707fb0/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2 h1:NHN4wOCScVzKhPenJ2dt+BTs3X/XkBVI/Rh4iDt55T8= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= -google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.23.5 h1:zno3LUiMubxD/V1Zw3ijyKO3wxrhbUF1Ck+VjBvfaoA= -k8s.io/api v0.23.5/go.mod h1:Na4XuKng8PXJ2JsploYYrivXrINeTaycCGcYgF91Xm8= -k8s.io/apiextensions-apiserver v0.23.5 h1:5SKzdXyvIJKu+zbfPc3kCbWpbxi+O+zdmAJBm26UJqI= -k8s.io/apiextensions-apiserver v0.23.5/go.mod h1:ntcPWNXS8ZPKN+zTXuzYMeg731CP0heCTl6gYBxLcuQ= -k8s.io/apimachinery v0.23.5 h1:Va7dwhp8wgkUPWsEXk6XglXWU4IKYLKNlv8VkX7SDM0= -k8s.io/apimachinery v0.23.5/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= -k8s.io/apiserver v0.23.5/go.mod h1:7wvMtGJ42VRxzgVI7jkbKvMbuCbVbgsWFT7RyXiRNTw= -k8s.io/client-go v0.23.5 h1:zUXHmEuqx0RY4+CsnkOn5l0GU+skkRXKGJrhmE2SLd8= -k8s.io/client-go v0.23.5/go.mod h1:flkeinTO1CirYgzMPRWxUCnV0G4Fbu2vLhYCObnt/r4= -k8s.io/code-generator v0.23.5/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= -k8s.io/component-base v0.23.5 h1:8qgP5R6jG1BBSXmRYW+dsmitIrpk8F/fPEvgDenMCCE= -k8s.io/component-base v0.23.5/go.mod h1:c5Nq44KZyt1aLl0IpHX82fhsn84Sb0jjzwjpcA42bY0= -k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.30.0 h1:bUO6drIvCIsvZ/XFgfxoGFQU/a4Qkh0iAlvUR7vlHJw= -k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 h1:E3J9oCLlaobFUqsjG9DfKbP2BmgwBL2p7pn0A3dG9W4= -k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= -k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20211116205334-6203023598ed h1:ck1fRPWPJWsMd8ZRFsWc6mh/zHp5fZ/shhbrgPUxDAE= -k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= -sigs.k8s.io/controller-runtime v0.11.1 h1:7YIHT2QnHJArj/dk9aUkYhfqfK5cIxPOX5gPECfdZLU= -sigs.k8s.io/controller-runtime v0.11.1/go.mod h1:KKwLiTooNGu+JmLZGn9Sl3Gjmfj66eMbCQznLP5zcqA= -sigs.k8s.io/controller-tools v0.8.0 h1:uUkfTGEwrguqYYfcI2RRGUnC8mYdCFDqfwPKUcNJh1o= -sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 h1:fD1pz4yfdADVNfFmcP2aBEtudwUQ1AlLnRBALr33v3s= -sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y= -sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/compiler/example/output/generated/helper/helper.go b/compiler/example/output/generated/helper/helper.go index dcfae43ac..a1c65a1fa 100644 --- a/compiler/example/output/generated/helper/helper.go +++ b/compiler/example/output/generated/helper/helper.go @@ -8,7 +8,7 @@ import ( "github.com/elliotchance/orderedmap" - datamodel "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" + datamodel "nexustempmodule/client/clientset/versioned" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -19,117 +19,1669 @@ const IS_NAME_HASHED_LABEL = "nexus/is_name_hashed" func GetCRDParentsMap() map[string][]string { return map[string][]string{ - "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com": {"roots.root.tsm.tanzu.vmware.com", "configs.config.tsm.tanzu.vmware.com", "gnses.gns.tsm.tanzu.vmware.com"}, - "acpconfigs.policypkg.tsm.tanzu.vmware.com": {"roots.root.tsm.tanzu.vmware.com", "configs.config.tsm.tanzu.vmware.com", "gnses.gns.tsm.tanzu.vmware.com", "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com"}, - "barchilds.gns.tsm.tanzu.vmware.com": {"roots.root.tsm.tanzu.vmware.com", "configs.config.tsm.tanzu.vmware.com", "gnses.gns.tsm.tanzu.vmware.com"}, - "configs.config.tsm.tanzu.vmware.com": {"roots.root.tsm.tanzu.vmware.com"}, - "dnses.gns.tsm.tanzu.vmware.com": {"roots.root.tsm.tanzu.vmware.com", "configs.config.tsm.tanzu.vmware.com"}, - "domains.config.tsm.tanzu.vmware.com": {"roots.root.tsm.tanzu.vmware.com", "configs.config.tsm.tanzu.vmware.com"}, - "foos.gns.tsm.tanzu.vmware.com": {"roots.root.tsm.tanzu.vmware.com", "configs.config.tsm.tanzu.vmware.com", "gnses.gns.tsm.tanzu.vmware.com"}, - "footypeabcs.config.tsm.tanzu.vmware.com": {"roots.root.tsm.tanzu.vmware.com", "configs.config.tsm.tanzu.vmware.com"}, - "gnses.gns.tsm.tanzu.vmware.com": {"roots.root.tsm.tanzu.vmware.com", "configs.config.tsm.tanzu.vmware.com"}, - "ignorechilds.gns.tsm.tanzu.vmware.com": {"roots.root.tsm.tanzu.vmware.com", "configs.config.tsm.tanzu.vmware.com", "gnses.gns.tsm.tanzu.vmware.com"}, - "roots.root.tsm.tanzu.vmware.com": {}, - "svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com": {"roots.root.tsm.tanzu.vmware.com", "configs.config.tsm.tanzu.vmware.com"}, - "svcgroups.servicegroup.tsm.tanzu.vmware.com": {"roots.root.tsm.tanzu.vmware.com", "configs.config.tsm.tanzu.vmware.com", "gnses.gns.tsm.tanzu.vmware.com"}, - "vmpolicies.policypkg.tsm.tanzu.vmware.com": {"roots.root.tsm.tanzu.vmware.com", "configs.config.tsm.tanzu.vmware.com"}, + "accesscontrolpolicies.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com"}, + "accesstokens.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "userfolders.global.tsm.tanzu.vmware.com"}, + "acpconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "accesscontrolpolicies.global.tsm.tanzu.vmware.com"}, + "additionalattributeses.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com", "services.global.tsm.tanzu.vmware.com"}, + "allsparkserviceses.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com"}, + "annotations.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "allsparkserviceses.global.tsm.tanzu.vmware.com", "globalregistrationservices.global.tsm.tanzu.vmware.com", "tenants.global.tsm.tanzu.vmware.com"}, + "apidiscoveries.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "globalnamespaces.global.tsm.tanzu.vmware.com", "gnss.global.tsm.tanzu.vmware.com"}, + "apidiscoveryrts.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "appfolders.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com"}, + "appgroups.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "resourcegroups.global.tsm.tanzu.vmware.com"}, + "applicationinfos.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com"}, + "apps.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "appfolders.global.tsm.tanzu.vmware.com"}, + "apptemplates.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "templates.global.tsm.tanzu.vmware.com", "templategroups.global.tsm.tanzu.vmware.com"}, + "apptemplateservicedefinitions.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "templates.global.tsm.tanzu.vmware.com", "templategroups.global.tsm.tanzu.vmware.com", "apptemplates.global.tsm.tanzu.vmware.com"}, + "appusers.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "userfolders.global.tsm.tanzu.vmware.com"}, + "appversions.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "appfolders.global.tsm.tanzu.vmware.com", "apps.global.tsm.tanzu.vmware.com"}, + "attackdiscoveries.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "globalnamespaces.global.tsm.tanzu.vmware.com", "gnss.global.tsm.tanzu.vmware.com"}, + "attackdiscoveryrts.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "authenticationpolicies.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "autoscalerconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "autoscalercrs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "autoscalerfolders.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com"}, + "autoscalers.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "autoscalerfolders.global.tsm.tanzu.vmware.com"}, + "autoscalingpolicies.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "globalnamespaces.global.tsm.tanzu.vmware.com", "gnss.global.tsm.tanzu.vmware.com"}, + "awsconnectors.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "allsparkserviceses.global.tsm.tanzu.vmware.com"}, + "buckets.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "datafolders.global.tsm.tanzu.vmware.com", "datafolderdomains.global.tsm.tanzu.vmware.com", "databases.global.tsm.tanzu.vmware.com"}, + "certificateauthorityconfigns.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "projects.global.tsm.tanzu.vmware.com", "projectconfigs.global.tsm.tanzu.vmware.com"}, + "certificateauthorityrts.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "certificateconfigns.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com"}, + "certificaterequests.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "certificates.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "clusterconfigfolders.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com"}, + "clusterconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com"}, + "clusterfolders.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com"}, + "clusters.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com"}, + "clustersettingses.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "clusterconfigfolders.global.tsm.tanzu.vmware.com"}, + "configmaps.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "configs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com"}, + "connectionstatuses.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com"}, + "databases.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "datafolders.global.tsm.tanzu.vmware.com", "datafolderdomains.global.tsm.tanzu.vmware.com"}, + "datafolderdomainclusters.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "datafolders.global.tsm.tanzu.vmware.com", "datafolderdomains.global.tsm.tanzu.vmware.com"}, + "datafolderdomains.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "datafolders.global.tsm.tanzu.vmware.com"}, + "datafolderdomainservices.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "datafolders.global.tsm.tanzu.vmware.com", "datafolderdomains.global.tsm.tanzu.vmware.com"}, + "datafolderdomainserviceversions.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "datafolders.global.tsm.tanzu.vmware.com", "datafolderdomains.global.tsm.tanzu.vmware.com", "datafolderdomainservices.global.tsm.tanzu.vmware.com"}, + "datafolders.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com"}, + "datagroups.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "resourcegroups.global.tsm.tanzu.vmware.com"}, + "datatemplates.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "templates.global.tsm.tanzu.vmware.com", "templategroups.global.tsm.tanzu.vmware.com"}, + "dcregions.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com"}, + "dczones.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "dcregions.global.tsm.tanzu.vmware.com"}, + "destinationrules.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "directories.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "datafolders.global.tsm.tanzu.vmware.com", "datafolderdomains.global.tsm.tanzu.vmware.com", "databases.global.tsm.tanzu.vmware.com"}, + "dnsconfigfolders.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com"}, + "dnsconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "dnsconfigfolders.global.tsm.tanzu.vmware.com"}, + "dnsprobeconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "dnsprobesconfigfolders.global.tsm.tanzu.vmware.com"}, + "dnsprobesconfigfolders.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com"}, + "dnsprobestatuses.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com"}, + "domainconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com"}, + "domains.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com"}, + "endpoints.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "envoyfilters.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "externalaccountconfigns.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com"}, + "externalauditstorages.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com"}, + "externaldnsconfigns.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com"}, + "externaldnsinventories.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com"}, + "externaldnsinventoryhealthchecks.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "externaldnsinventories.global.tsm.tanzu.vmware.com"}, + "externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "externaldnsinventories.global.tsm.tanzu.vmware.com"}, + "externaldnsinventoryrecords.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "externaldnsinventories.global.tsm.tanzu.vmware.com", "externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com"}, + "externaldnsinventoryzones.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "externaldnsinventories.global.tsm.tanzu.vmware.com"}, + "externaldnsruntimeendpoints.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "externaldnsruntimes.global.tsm.tanzu.vmware.com", "externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com", "externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com"}, + "externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "externaldnsruntimes.global.tsm.tanzu.vmware.com"}, + "externaldnsruntimes.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com"}, + "externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "externaldnsruntimes.global.tsm.tanzu.vmware.com", "externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com"}, + "externallbconfigns.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com"}, + "externalplugincapabilities.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "externalpluginconfigfolders.global.tsm.tanzu.vmware.com", "externalpluginconfigs.global.tsm.tanzu.vmware.com", "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com"}, + "externalpluginconfigfolders.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com"}, + "externalpluginconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "externalpluginconfigfolders.global.tsm.tanzu.vmware.com"}, + "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "externalpluginconfigfolders.global.tsm.tanzu.vmware.com", "externalpluginconfigs.global.tsm.tanzu.vmware.com"}, + "externalpluginmonitors.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "externalpluginconfigfolders.global.tsm.tanzu.vmware.com", "externalpluginconfigs.global.tsm.tanzu.vmware.com", "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com"}, + "externalserviceconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "globalnamespaces.global.tsm.tanzu.vmware.com", "gnss.global.tsm.tanzu.vmware.com"}, + "externalservicesrts.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "featureflags.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com"}, + "federatedsloconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "slofolders.global.tsm.tanzu.vmware.com"}, + "federatedsloserviceconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "slofolders.global.tsm.tanzu.vmware.com", "federatedsloconfigs.global.tsm.tanzu.vmware.com"}, + "gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com", "gatewayconfigs.global.tsm.tanzu.vmware.com"}, + "gatewayconfiglistenercertificates.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com", "gatewayconfigs.global.tsm.tanzu.vmware.com", "gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com"}, + "gatewayconfiglistenerdestinationroutes.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com", "gatewayconfigs.global.tsm.tanzu.vmware.com", "gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com"}, + "gatewayconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "gateways.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "geodiscoveries.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "globalnamespaces.global.tsm.tanzu.vmware.com", "gnss.global.tsm.tanzu.vmware.com"}, + "geodiscoveryrts.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "globalnamespaces.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com"}, + "globalnses.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "allsparkserviceses.global.tsm.tanzu.vmware.com", "awsconnectors.global.tsm.tanzu.vmware.com"}, + "globalregistrationservices.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "allsparkserviceses.global.tsm.tanzu.vmware.com"}, + "gnsaccesscontrolpolicies.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "globalnamespaces.global.tsm.tanzu.vmware.com", "gnss.global.tsm.tanzu.vmware.com"}, + "gnsaccesscontrolpolicyrts.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "gnsbindingrts.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com"}, + "gnsendpointsconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "gnsroutingconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "globalnamespaces.global.tsm.tanzu.vmware.com", "gnss.global.tsm.tanzu.vmware.com"}, + "gnsroutingruleconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "gnsbindingrts.global.tsm.tanzu.vmware.com"}, + "gnss.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "globalnamespaces.global.tsm.tanzu.vmware.com"}, + "gnsschemaviolationdiscoveries.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "globalnamespaces.global.tsm.tanzu.vmware.com", "gnss.global.tsm.tanzu.vmware.com"}, + "gnssegmentationpolicies.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "globalnamespaces.global.tsm.tanzu.vmware.com", "gnss.global.tsm.tanzu.vmware.com"}, + "gnssegmentationpolicyrts.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "gnsserviceentryconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "gnsbindingrts.global.tsm.tanzu.vmware.com"}, + "gnssvcgrouprts.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "gnsbindingrts.global.tsm.tanzu.vmware.com"}, + "gnssvcgroups.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "globalnamespaces.global.tsm.tanzu.vmware.com", "gnss.global.tsm.tanzu.vmware.com"}, + "haconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "hostconfigs.global.tsm.tanzu.vmware.com"}, + "haconfigv2s.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com", "hostconfigv2s.global.tsm.tanzu.vmware.com"}, + "healthcheckconfigns.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "templates.global.tsm.tanzu.vmware.com"}, + "hostconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com"}, + "hostconfigv2s.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "inboundauthenticationconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "inventories.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com"}, + "issuers.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "jobconfigfolders.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com"}, + "jobconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "jobconfigfolders.global.tsm.tanzu.vmware.com"}, + "jobfolders.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com"}, + "jobs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "jobfolders.global.tsm.tanzu.vmware.com"}, + "knativeingresses.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "labelconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "localregistrationserviceclusters.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "allsparkserviceses.global.tsm.tanzu.vmware.com", "localregistrationservices.global.tsm.tanzu.vmware.com"}, + "localregistrationserviceresources.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "allsparkserviceses.global.tsm.tanzu.vmware.com", "localregistrationservices.global.tsm.tanzu.vmware.com", "localregistrationserviceclusters.global.tsm.tanzu.vmware.com"}, + "localregistrationservices.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "allsparkserviceses.global.tsm.tanzu.vmware.com"}, + "logfolders.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com"}, + "logs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "logfolders.global.tsm.tanzu.vmware.com"}, + "metricmonitors.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com", "serviceconfigs.global.tsm.tanzu.vmware.com", "serviceversionconfigs.global.tsm.tanzu.vmware.com"}, + "networkattachmentdefinitionconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "networkattachmentdefinitions.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "nodedefinitions.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "templates.global.tsm.tanzu.vmware.com", "templategroups.global.tsm.tanzu.vmware.com", "nodetemplates.global.tsm.tanzu.vmware.com"}, + "nodefolderclusters.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "nodefolders.global.tsm.tanzu.vmware.com"}, + "nodefolders.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com"}, + "nodegroups.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "resourcegroups.global.tsm.tanzu.vmware.com"}, + "nodes.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com"}, + "nodestatuses.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "nodes.global.tsm.tanzu.vmware.com"}, + "nodetemplates.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "templates.global.tsm.tanzu.vmware.com", "templategroups.global.tsm.tanzu.vmware.com"}, + "outboundauthenticationmodes.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com", "hostconfigv2s.global.tsm.tanzu.vmware.com"}, + "peerauthentications.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "piidiscoveries.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "globalnamespaces.global.tsm.tanzu.vmware.com", "gnss.global.tsm.tanzu.vmware.com"}, + "piidiscoveryrts.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "policyconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "policytemplates.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "templates.global.tsm.tanzu.vmware.com", "templategroups.global.tsm.tanzu.vmware.com"}, + "progressiveupgradeconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "progressiveupgrades.global.tsm.tanzu.vmware.com"}, + "progressiveupgradefolders.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com"}, + "progressiveupgraderuntimes.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "progressiveupgradefolders.global.tsm.tanzu.vmware.com"}, + "progressiveupgrades.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com"}, + "projectconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "projects.global.tsm.tanzu.vmware.com"}, + "projectinventories.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "projects.global.tsm.tanzu.vmware.com"}, + "projectqueries.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "projects.global.tsm.tanzu.vmware.com"}, + "projects.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com"}, + "publicserviceconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "globalnamespaces.global.tsm.tanzu.vmware.com", "gnss.global.tsm.tanzu.vmware.com"}, + "publicservicerouteconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "globalnamespaces.global.tsm.tanzu.vmware.com", "gnss.global.tsm.tanzu.vmware.com", "publicserviceconfigs.global.tsm.tanzu.vmware.com"}, + "publicservicerts.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "remotegatewayserviceconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com"}, + "resourcegrouprts.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com"}, + "resourcegroups.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com"}, + "roots.global.tsm.tanzu.vmware.com": {}, + "rpolicies.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "allsparkserviceses.global.tsm.tanzu.vmware.com", "awsconnectors.global.tsm.tanzu.vmware.com", "globalnses.global.tsm.tanzu.vmware.com"}, + "runtimes.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com"}, + "schemaviolationdiscoveryrts.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "secrethashes.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "secretrtconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "securitycontextconstraintsconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com"}, + "securitycontextconstraintses.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com"}, + "serviceconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "servicecronjobs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "servicedaemonsets.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "servicedeploymentcontainers.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com", "servicedeployments.global.tsm.tanzu.vmware.com"}, + "servicedeployments.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "servicedirectoryentryconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "servicedirectoryns.global.tsm.tanzu.vmware.com"}, + "servicedirectoryns.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com"}, + "servicedirectoryrtfolderentries.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "servicedirectoryrts.global.tsm.tanzu.vmware.com", "servicedirectoryrtfolders.global.tsm.tanzu.vmware.com"}, + "servicedirectoryrtfolders.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "servicedirectoryrts.global.tsm.tanzu.vmware.com"}, + "servicedirectoryrts.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com"}, + "serviceentries.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "serviceentryconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "serviceinstancecontainers.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com", "serviceinstances.global.tsm.tanzu.vmware.com"}, + "serviceinstances.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "servicejobs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "servicelevelobjectivefolders.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com"}, + "servicelevelobjectives.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "servicelevelobjectivefolders.global.tsm.tanzu.vmware.com"}, + "servicereplicasets.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "services.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "servicestatefulsets.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "servicetemplates.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "templates.global.tsm.tanzu.vmware.com", "templategroups.global.tsm.tanzu.vmware.com"}, + "servicetemplateservicedefinitions.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "templates.global.tsm.tanzu.vmware.com", "templategroups.global.tsm.tanzu.vmware.com", "servicetemplates.global.tsm.tanzu.vmware.com"}, + "serviceversionconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com", "serviceconfigs.global.tsm.tanzu.vmware.com"}, + "serviceversions.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com", "services.global.tsm.tanzu.vmware.com"}, + "sharedserviceconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "globalnamespaces.global.tsm.tanzu.vmware.com", "gnss.global.tsm.tanzu.vmware.com"}, + "sloconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "slofolders.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com"}, + "slopolicies.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "globalnamespaces.global.tsm.tanzu.vmware.com", "gnss.global.tsm.tanzu.vmware.com"}, + "sloserviceconfigs.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com", "sloconfigs.global.tsm.tanzu.vmware.com"}, + "svcgrouprts.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "resourcegrouprts.global.tsm.tanzu.vmware.com"}, + "svcgroups.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "resourcegroups.global.tsm.tanzu.vmware.com"}, + "tables.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "datafolders.global.tsm.tanzu.vmware.com", "datafolderdomains.global.tsm.tanzu.vmware.com", "databases.global.tsm.tanzu.vmware.com"}, + "templategroups.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "templates.global.tsm.tanzu.vmware.com"}, + "templates.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com"}, + "tenantresources.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "allsparkserviceses.global.tsm.tanzu.vmware.com", "globalregistrationservices.global.tsm.tanzu.vmware.com", "tenants.global.tsm.tanzu.vmware.com"}, + "tenants.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "allsparkserviceses.global.tsm.tanzu.vmware.com", "globalregistrationservices.global.tsm.tanzu.vmware.com"}, + "tenanttokens.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "allsparkserviceses.global.tsm.tanzu.vmware.com", "globalregistrationservices.global.tsm.tanzu.vmware.com"}, + "userdiscoveries.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "globalnamespaces.global.tsm.tanzu.vmware.com", "gnss.global.tsm.tanzu.vmware.com"}, + "userdiscoveryrts.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "clusterfolders.global.tsm.tanzu.vmware.com", "clusterconfigs.global.tsm.tanzu.vmware.com", "domainconfigs.global.tsm.tanzu.vmware.com"}, + "userfolders.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com"}, + "usergroups.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "configs.global.tsm.tanzu.vmware.com", "resourcegroups.global.tsm.tanzu.vmware.com"}, + "userpreferences.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "userfolders.global.tsm.tanzu.vmware.com", "users.global.tsm.tanzu.vmware.com"}, + "users.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "runtimes.global.tsm.tanzu.vmware.com", "userfolders.global.tsm.tanzu.vmware.com"}, + "virtualservices.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, + "workloadentries.global.tsm.tanzu.vmware.com": {"roots.global.tsm.tanzu.vmware.com", "inventories.global.tsm.tanzu.vmware.com", "clusters.global.tsm.tanzu.vmware.com", "domains.global.tsm.tanzu.vmware.com"}, } } func GetObjectByCRDName(dmClient *datamodel.Clientset, crdName string, name string) interface{} { - if crdName == "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com" { - obj, err := dmClient.PolicypkgTsmV1().AccessControlPolicies().Get(context.TODO(), name, metav1.GetOptions{}) + if crdName == "accesscontrolpolicies.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AccessControlPolicies().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return nil } return obj } - if crdName == "acpconfigs.policypkg.tsm.tanzu.vmware.com" { - obj, err := dmClient.PolicypkgTsmV1().ACPConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if crdName == "accesstokens.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AccessTokens().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return nil } return obj } - if crdName == "barchilds.gns.tsm.tanzu.vmware.com" { - obj, err := dmClient.GnsTsmV1().BarChilds().Get(context.TODO(), name, metav1.GetOptions{}) + if crdName == "acpconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ACPConfigs().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return nil } return obj } - if crdName == "configs.config.tsm.tanzu.vmware.com" { - obj, err := dmClient.ConfigTsmV1().Configs().Get(context.TODO(), name, metav1.GetOptions{}) + if crdName == "additionalattributeses.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AdditionalAttributeses().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return nil } return obj } - if crdName == "dnses.gns.tsm.tanzu.vmware.com" { - obj, err := dmClient.GnsTsmV1().Dnses().Get(context.TODO(), name, metav1.GetOptions{}) + if crdName == "allsparkserviceses.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AllSparkServiceses().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return nil } return obj } - if crdName == "domains.config.tsm.tanzu.vmware.com" { - obj, err := dmClient.ConfigTsmV1().Domains().Get(context.TODO(), name, metav1.GetOptions{}) + if crdName == "annotations.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Annotations().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return nil } return obj } - if crdName == "foos.gns.tsm.tanzu.vmware.com" { - obj, err := dmClient.GnsTsmV1().Foos().Get(context.TODO(), name, metav1.GetOptions{}) + if crdName == "apidiscoveries.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ApiDiscoveries().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return nil } return obj } - if crdName == "footypeabcs.config.tsm.tanzu.vmware.com" { - obj, err := dmClient.ConfigTsmV1().FooTypeABCs().Get(context.TODO(), name, metav1.GetOptions{}) + if crdName == "apidiscoveryrts.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ApiDiscoveryRTs().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return nil } return obj } - if crdName == "gnses.gns.tsm.tanzu.vmware.com" { - obj, err := dmClient.GnsTsmV1().Gnses().Get(context.TODO(), name, metav1.GetOptions{}) + if crdName == "appfolders.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AppFolders().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return nil } return obj } - if crdName == "ignorechilds.gns.tsm.tanzu.vmware.com" { - obj, err := dmClient.GnsTsmV1().IgnoreChilds().Get(context.TODO(), name, metav1.GetOptions{}) + if crdName == "appgroups.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AppGroups().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return nil } return obj } - if crdName == "roots.root.tsm.tanzu.vmware.com" { - obj, err := dmClient.RootTsmV1().Roots().Get(context.TODO(), name, metav1.GetOptions{}) + if crdName == "applicationinfos.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ApplicationInfos().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return nil } return obj } - if crdName == "svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com" { - obj, err := dmClient.ServicegroupTsmV1().SvcGroupLinkInfos().Get(context.TODO(), name, metav1.GetOptions{}) + if crdName == "apps.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Apps().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return nil } return obj } - if crdName == "svcgroups.servicegroup.tsm.tanzu.vmware.com" { - obj, err := dmClient.ServicegroupTsmV1().SvcGroups().Get(context.TODO(), name, metav1.GetOptions{}) + if crdName == "apptemplates.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AppTemplates().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return nil } return obj } - if crdName == "vmpolicies.policypkg.tsm.tanzu.vmware.com" { - obj, err := dmClient.PolicypkgTsmV1().VMpolicies().Get(context.TODO(), name, metav1.GetOptions{}) + if crdName == "apptemplateservicedefinitions.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AppTemplateServiceDefinitions().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "appusers.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AppUsers().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "appversions.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AppVersions().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "attackdiscoveries.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AttackDiscoveries().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "attackdiscoveryrts.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AttackDiscoveryRTs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "authenticationpolicies.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AuthenticationPolicies().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "autoscalerconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AutoscalerConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "autoscalercrs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AutoscalerCRs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "autoscalerfolders.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AutoscalerFolders().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "autoscalers.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Autoscalers().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "autoscalingpolicies.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AutoscalingPolicies().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "awsconnectors.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().AwsConnectors().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "buckets.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Buckets().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "certificateauthorityconfigns.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().CertificateAuthorityConfigNs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "certificateauthorityrts.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().CertificateAuthorityRTs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "certificateconfigns.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().CertificateConfigNs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "certificaterequests.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().CertificateRequests().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "certificates.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Certificates().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "clusterconfigfolders.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ClusterConfigFolders().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "clusterconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ClusterConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "clusterfolders.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ClusterFolders().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "clusters.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Clusters().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "clustersettingses.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ClusterSettingses().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "configmaps.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ConfigMaps().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "configs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Configs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "connectionstatuses.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ConnectionStatuses().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "databases.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Databases().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "datafolderdomainclusters.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().DataFolderDomainClusters().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "datafolderdomains.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().DataFolderDomains().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "datafolderdomainservices.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().DataFolderDomainServices().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "datafolderdomainserviceversions.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().DataFolderDomainServiceVersions().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "datafolders.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().DataFolders().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "datagroups.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().DataGroups().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "datatemplates.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().DataTemplates().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "dcregions.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().DCRegions().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "dczones.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().DCZones().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "destinationrules.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().DestinationRules().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "directories.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Directories().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "dnsconfigfolders.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().DNSConfigFolders().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "dnsconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().DNSConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "dnsprobeconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().DNSProbeConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "dnsprobesconfigfolders.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().DNSProbesConfigFolders().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "dnsprobestatuses.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().DNSProbeStatuses().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "domainconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().DomainConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "domains.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Domains().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "endpoints.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Endpoints().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "envoyfilters.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().EnvoyFilters().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externalaccountconfigns.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalAccountConfigNs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externalauditstorages.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalAuditStorages().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externaldnsconfigns.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalDNSConfigNs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externaldnsinventories.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalDNSInventories().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externaldnsinventoryhealthchecks.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalDNSInventoryHealthChecks().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalDNSInventoryPrimaryDomains().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externaldnsinventoryrecords.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalDNSInventoryRecords().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externaldnsinventoryzones.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalDNSInventoryZones().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externaldnsruntimeendpoints.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalDNSRuntimeEndpoints().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalDNSRuntimePrimaryDomains().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externaldnsruntimes.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalDNSRuntimes().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalDNSRuntimeSubdomains().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externallbconfigns.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalLBConfigNs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externalplugincapabilities.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalPluginCapabilities().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externalpluginconfigfolders.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalPluginConfigFolders().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externalpluginconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalPluginConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalPluginInstanceConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externalpluginmonitors.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalPluginMonitors().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externalserviceconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalServiceConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "externalservicesrts.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ExternalServicesRTs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "featureflags.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().FeatureFlags().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "federatedsloconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().FederatedSloConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "federatedsloserviceconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().FederatedSloServiceConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GatewayConfigAdditionalListenerses().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gatewayconfiglistenercertificates.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GatewayConfigListenerCertificates().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gatewayconfiglistenerdestinationroutes.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GatewayConfigListenerDestinationRoutes().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gatewayconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GatewayConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gateways.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Gateways().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "geodiscoveries.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GeoDiscoveries().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "geodiscoveryrts.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GeoDiscoveryRTs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "globalnamespaces.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GlobalNamespaces().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "globalnses.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GlobalNses().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "globalregistrationservices.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GlobalRegistrationServices().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gnsaccesscontrolpolicies.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GnsAccessControlPolicies().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gnsaccesscontrolpolicyrts.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GnsAccessControlPolicyRTs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gnsbindingrts.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GnsBindingRTs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gnsendpointsconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GnsEndpointsConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gnsroutingconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GNSRoutingConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gnsroutingruleconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GnsRoutingRuleConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gnss.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GNSs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gnsschemaviolationdiscoveries.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GnsSchemaViolationDiscoveries().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gnssegmentationpolicies.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GnsSegmentationPolicies().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gnssegmentationpolicyrts.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GnsSegmentationPolicyRTs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gnsserviceentryconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GnsServiceEntryConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gnssvcgrouprts.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GnsSvcGroupRTs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "gnssvcgroups.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().GNSSvcGroups().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "haconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().HaConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "haconfigv2s.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().HaConfigV2s().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "healthcheckconfigns.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().HealthCheckConfigNs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "hostconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().HostConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "hostconfigv2s.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().HostConfigV2s().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "inboundauthenticationconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().InboundAuthenticationConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "inventories.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Inventories().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "issuers.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Issuers().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "jobconfigfolders.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().JobConfigFolders().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "jobconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().JobConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "jobfolders.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().JobFolders().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "jobs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Jobs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "knativeingresses.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().KnativeIngresses().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "labelconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().LabelConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "localregistrationserviceclusters.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().LocalRegistrationServiceClusters().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "localregistrationserviceresources.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().LocalRegistrationServiceResources().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "localregistrationservices.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().LocalRegistrationServices().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "logfolders.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().LogFolders().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "logs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Logs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "metricmonitors.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().MetricMonitors().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "networkattachmentdefinitionconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().NetworkAttachmentDefinitionConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "networkattachmentdefinitions.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().NetworkAttachmentDefinitions().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "nodedefinitions.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().NodeDefinitions().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "nodefolderclusters.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().NodeFolderClusters().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "nodefolders.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().NodeFolders().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "nodegroups.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().NodeGroups().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "nodes.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Nodes().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "nodestatuses.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().NodeStatuses().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "nodetemplates.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().NodeTemplates().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "outboundauthenticationmodes.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().OutboundAuthenticationModes().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "peerauthentications.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().PeerAuthentications().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "piidiscoveries.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().PiiDiscoveries().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "piidiscoveryrts.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().PiiDiscoveryRTs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "policyconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().PolicyConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "policytemplates.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().PolicyTemplates().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "progressiveupgradeconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ProgressiveUpgradeConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "progressiveupgradefolders.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ProgressiveUpgradeFolders().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "progressiveupgraderuntimes.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ProgressiveUpgradeRuntimes().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "progressiveupgrades.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ProgressiveUpgrades().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "projectconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ProjectConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "projectinventories.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ProjectInventories().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "projectqueries.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ProjectQueries().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "projects.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Projects().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "publicserviceconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().PublicServiceConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "publicservicerouteconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().PublicServiceRouteConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "publicservicerts.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().PublicServiceRTs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "remotegatewayserviceconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().RemoteGatewayServiceConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "resourcegrouprts.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ResourceGroupRTs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "resourcegroups.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ResourceGroups().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "roots.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Roots().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "rpolicies.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().RPolicies().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "runtimes.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Runtimes().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "schemaviolationdiscoveryrts.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().SchemaViolationDiscoveryRTs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "secrethashes.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().SecretHashes().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "secretrtconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().SecretRTConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "securitycontextconstraintsconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().SecurityContextConstraintsConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "securitycontextconstraintses.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().SecurityContextConstraintses().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "serviceconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "servicecronjobs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceCronJobs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "servicedaemonsets.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceDaemonSets().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "servicedeploymentcontainers.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceDeploymentContainers().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "servicedeployments.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceDeployments().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "servicedirectoryentryconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceDirectoryEntryConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "servicedirectoryns.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceDirectoryNs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "servicedirectoryrtfolderentries.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceDirectoryRTFolderEntries().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "servicedirectoryrtfolders.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceDirectoryRTFolders().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "servicedirectoryrts.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceDirectoryRTs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "serviceentries.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceEntries().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "serviceentryconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceEntryConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "serviceinstancecontainers.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceInstanceContainers().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "serviceinstances.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceInstances().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "servicejobs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceJobs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "servicelevelobjectivefolders.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceLevelObjectiveFolders().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "servicelevelobjectives.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceLevelObjectives().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "servicereplicasets.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceReplicaSets().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "services.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Services().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "servicestatefulsets.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceStatefulSets().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "servicetemplates.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceTemplates().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "servicetemplateservicedefinitions.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceTemplateServiceDefinitions().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "serviceversionconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceVersionConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "serviceversions.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().ServiceVersions().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "sharedserviceconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().SharedServiceConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "sloconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().SloConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "slofolders.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().SLOFolders().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "slopolicies.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().SLOPolicies().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "sloserviceconfigs.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().SloServiceConfigs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "svcgrouprts.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().SvcGroupRTs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "svcgroups.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().SvcGroups().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "tables.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Tables().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "templategroups.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().TemplateGroups().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "templates.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Templates().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "tenantresources.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().TenantResources().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "tenants.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Tenants().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "tenanttokens.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().TenantTokens().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "userdiscoveries.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().UserDiscoveries().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "userdiscoveryrts.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().UserDiscoveryRTs().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "userfolders.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().UserFolders().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "usergroups.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().UserGroups().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "userpreferences.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().UserPreferences().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "users.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().Users().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "virtualservices.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().VirtualServices().Get(context.TODO(), name, metav1.GetOptions{}) + if err != nil { + return nil + } + return obj + } + if crdName == "workloadentries.global.tsm.tanzu.vmware.com" { + obj, err := dmClient.GlobalTsmV1().WorkloadEntries().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return nil } diff --git a/compiler/example/output/generated/nexus-client/client.go b/compiler/example/output/generated/nexus-client/client.go index 949c140b5..7a01836ac 100644 --- a/compiler/example/output/generated/nexus-client/client.go +++ b/compiler/example/output/generated/nexus-client/client.go @@ -22,31 +22,19 @@ import ( "k8s.io/client-go/rest" cache "k8s.io/client-go/tools/cache" - baseClientset "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned" - fakeBaseClienset "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/clientset/versioned/fake" - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/common" - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/helper" - - baseconfigtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/config.tsm.tanzu.vmware.com/v1" - basegnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/gns.tsm.tanzu.vmware.com/v1" - basepolicypkgtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/policypkg.tsm.tanzu.vmware.com/v1" - baseroottsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/root.tsm.tanzu.vmware.com/v1" - baseservicegrouptsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/apis/servicegroup.tsm.tanzu.vmware.com/v1" - - informerconfigtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/config.tsm.tanzu.vmware.com/v1" - informergnstsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/gns.tsm.tanzu.vmware.com/v1" - informerpolicypkgtsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/policypkg.tsm.tanzu.vmware.com/v1" - informerroottsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/root.tsm.tanzu.vmware.com/v1" - informerservicegrouptsmtanzuvmwarecomv1 "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/client/informers/externalversions/servicegroup.tsm.tanzu.vmware.com/v1" + baseClientset "nexustempmodule/client/clientset/versioned" + fakeBaseClienset "nexustempmodule/client/clientset/versioned/fake" + "nexustempmodule/common" + "nexustempmodule/helper" + + baseglobaltsmtanzuvmwarecomv1 "nexustempmodule/apis/global.tsm.tanzu.vmware.com/v1" + + informerglobaltsmtanzuvmwarecomv1 "nexustempmodule/client/informers/externalversions/global.tsm.tanzu.vmware.com/v1" ) type Clientset struct { - baseClient baseClientset.Interface - rootTsmV1 *RootTsmV1 - configTsmV1 *ConfigTsmV1 - gnsTsmV1 *GnsTsmV1 - servicegroupTsmV1 *ServicegroupTsmV1 - policypkgTsmV1 *PolicypkgTsmV1 + baseClient baseClientset.Interface + globalTsmV1 *GlobalTsmV1 } type subscription struct { @@ -70,285 +58,84950 @@ func subscribe(key string, informer cache.SharedIndexInformer) { func (c *Clientset) SubscribeAll() { var key string - key = "roots.root.tsm.tanzu.vmware.com" + key = "accesstokens.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAccessTokenInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "acpconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewACPConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "additionalattributeses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAdditionalAttributesInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "allsparkserviceses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAllSparkServicesInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "annotations.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAnnotationInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "apidiscoveryrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewApiDiscoveryRTInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "apidiscoveries.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewApiDiscoveryInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "appfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAppFolderInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "appgroups.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAppGroupInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "apptemplateservicedefinitions.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAppTemplateServiceDefinitionInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "apptemplates.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAppTemplateInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "appusers.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAppUserInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "appversions.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAppVersionInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "apps.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAppInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "applicationinfos.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewApplicationInfoInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "attackdiscoveryrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAttackDiscoveryRTInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "attackdiscoveries.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAttackDiscoveryInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "authenticationpolicies.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAuthenticationPolicyInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "autoscalerfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAutoscalerFolderInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "autoscalerconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAutoscalerConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "autoscalers.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAutoscalerInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "autoscalercrs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAutoscalerCRInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "autoscalingpolicies.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAutoscalingPolicyInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "awsconnectors.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAwsConnectorInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "buckets.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewBucketInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "certificateauthorityrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewCertificateAuthorityRTInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "certificateauthorityconfigns.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewCertificateAuthorityConfigNInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "certificateconfigns.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewCertificateConfigNInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "certificaterequests.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewCertificateRequestInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "certificates.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewCertificateInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "clusterconfigfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewClusterConfigFolderInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "clusterconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewClusterConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "clusterfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewClusterFolderInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "clustersettingses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewClusterSettingsInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "clusters.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewClusterInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "configmaps.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewConfigMapInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "configs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "connectionstatuses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewConnectionStatusInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "datafolderdomainclusters.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDataFolderDomainClusterInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "datafolderdomainserviceversions.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDataFolderDomainServiceVersionInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "datafolderdomainservices.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDataFolderDomainServiceInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "datafolderdomains.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDataFolderDomainInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "datafolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDataFolderInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "datagroups.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDataGroupInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "datatemplates.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDataTemplateInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "databases.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDatabaseInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "dcregions.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDCRegionInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "dczones.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDCZoneInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "destinationrules.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDestinationRuleInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "directories.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDirectoryInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "dnsconfigfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDNSConfigFolderInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "dnsconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDNSConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "dnsprobeconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDNSProbeConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "dnsprobestatuses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDNSProbeStatusInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "dnsprobesconfigfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDNSProbesConfigFolderInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "domainconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDomainConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "domains.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDomainInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "endpoints.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewEndpointsInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "envoyfilters.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewEnvoyFilterInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externalaccountconfigns.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalAccountConfigNInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externalauditstorages.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalAuditStorageInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externaldnsconfigns.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSConfigNInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externaldnsinventoryhealthchecks.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSInventoryHealthCheckInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSInventoryPrimaryDomainInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externaldnsinventoryrecords.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSInventoryRecordInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externaldnsinventoryzones.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSInventoryZoneInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externaldnsinventories.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSInventoryInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externaldnsruntimeendpoints.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSRuntimeEndpointInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSRuntimePrimaryDomainInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externaldnsruntimes.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSRuntimeInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSRuntimeSubdomainInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externallbconfigns.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalLBConfigNInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externalplugincapabilities.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalPluginCapabilityInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externalpluginconfigfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalPluginConfigFolderInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externalpluginconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalPluginConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalPluginInstanceConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externalpluginmonitors.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalPluginMonitorInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externalservicesrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalServicesRTInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "featureflags.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewFeatureFlagInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gatewayconfiglistenercertificates.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGatewayConfigListenerCertificateInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGatewayConfigAdditionalListenersInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gatewayconfiglistenerdestinationroutes.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGatewayConfigListenerDestinationRouteInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gatewayconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGatewayConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gateways.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGatewayInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "geodiscoveryrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGeoDiscoveryRTInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "geodiscoveries.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGeoDiscoveryInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "globalnses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGlobalNsInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "globalregistrationservices.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGlobalRegistrationServiceInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "globalnamespaces.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGlobalNamespaceInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gnsaccesscontrolpolicyrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsAccessControlPolicyRTInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gnsaccesscontrolpolicies.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsAccessControlPolicyInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gnsbindingrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsBindingRTInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gnsendpointsconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsEndpointsConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "externalserviceconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalServiceConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "publicservicerouteconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewPublicServiceRouteConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "publicserviceconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewPublicServiceConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gnsroutingconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGNSRoutingConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gnsroutingruleconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsRoutingRuleConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gnssegmentationpolicyrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsSegmentationPolicyRTInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gnssegmentationpolicies.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsSegmentationPolicyInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gnsserviceentryconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsServiceEntryConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gnssvcgrouprts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsSvcGroupRTInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gnssvcgroups.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGNSSvcGroupInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "sharedserviceconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSharedServiceConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gnss.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGNSInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "haconfigv2s.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewHaConfigV2Informer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "haconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewHaConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "healthcheckconfigns.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewHealthCheckConfigNInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "hostconfigv2s.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewHostConfigV2Informer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "hostconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewHostConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "inboundauthenticationconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewInboundAuthenticationConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "inventories.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewInventoryInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "issuers.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewIssuerInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "jobconfigfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewJobConfigFolderInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "jobconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewJobConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "jobfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewJobFolderInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "jobs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewJobInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "knativeingresses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewKnativeIngressInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "labelconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewLabelConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "localregistrationserviceclusters.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewLocalRegistrationServiceClusterInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "localregistrationserviceresources.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewLocalRegistrationServiceResourceInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "localregistrationservices.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewLocalRegistrationServiceInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "logfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewLogFolderInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "logs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewLogInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "networkattachmentdefinitionconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewNetworkAttachmentDefinitionConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "networkattachmentdefinitions.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewNetworkAttachmentDefinitionInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "nodedefinitions.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewNodeDefinitionInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "nodefolderclusters.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informerroottsmtanzuvmwarecomv1.NewRootInformer(c.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewNodeFolderClusterInformer(c.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } - key = "configs.config.tsm.tanzu.vmware.com" + key = "nodefolders.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informerconfigtsmtanzuvmwarecomv1.NewConfigInformer(c.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewNodeFolderInformer(c.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } - key = "footypeabcs.config.tsm.tanzu.vmware.com" + key = "nodegroups.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informerconfigtsmtanzuvmwarecomv1.NewFooTypeABCInformer(c.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewNodeGroupInformer(c.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } - key = "domains.config.tsm.tanzu.vmware.com" + key = "nodestatuses.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informerconfigtsmtanzuvmwarecomv1.NewDomainInformer(c.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewNodeStatusInformer(c.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } - key = "randomgnsdatas.gns.tsm.tanzu.vmware.com" + key = "nodetemplates.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informergnstsmtanzuvmwarecomv1.NewRandomGnsDataInformer(c.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewNodeTemplateInformer(c.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } - key = "foos.gns.tsm.tanzu.vmware.com" + key = "nodes.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informergnstsmtanzuvmwarecomv1.NewFooInformer(c.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewNodeInformer(c.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } - key = "gnses.gns.tsm.tanzu.vmware.com" + key = "outboundauthenticationmodes.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informergnstsmtanzuvmwarecomv1.NewGnsInformer(c.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewOutboundAuthenticationModeInformer(c.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } - key = "barchilds.gns.tsm.tanzu.vmware.com" + key = "peerauthentications.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informergnstsmtanzuvmwarecomv1.NewBarChildInformer(c.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewPeerAuthenticationInformer(c.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } - key = "ignorechilds.gns.tsm.tanzu.vmware.com" + key = "piidiscoveryrts.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informergnstsmtanzuvmwarecomv1.NewIgnoreChildInformer(c.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewPiiDiscoveryRTInformer(c.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } - key = "dnses.gns.tsm.tanzu.vmware.com" + key = "piidiscoveries.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informergnstsmtanzuvmwarecomv1.NewDnsInformer(c.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewPiiDiscoveryInformer(c.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } - key = "additionalgnsdatas.gns.tsm.tanzu.vmware.com" + key = "policyconfigs.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informergnstsmtanzuvmwarecomv1.NewAdditionalGnsDataInformer(c.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewPolicyConfigInformer(c.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } - key = "svcgroups.servicegroup.tsm.tanzu.vmware.com" + key = "policytemplates.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informerservicegrouptsmtanzuvmwarecomv1.NewSvcGroupInformer(c.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewPolicyTemplateInformer(c.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } - key = "svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com" + key = "accesscontrolpolicies.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informerservicegrouptsmtanzuvmwarecomv1.NewSvcGroupLinkInfoInformer(c.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewAccessControlPolicyInformer(c.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } - key = "additionalpolicydatas.policypkg.tsm.tanzu.vmware.com" - if _, ok := subscriptionMap.Load(key); !ok { - informer := informerpolicypkgtsmtanzuvmwarecomv1.NewAdditionalPolicyDataInformer(c.baseClient, 0, cache.Indexers{}) - subscribe(key, informer) + key = "progressiveupgrades.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewProgressiveUpgradeInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "progressiveupgradeconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewProgressiveUpgradeConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "progressiveupgradefolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewProgressiveUpgradeFolderInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "progressiveupgraderuntimes.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewProgressiveUpgradeRuntimeInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "projectconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewProjectConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "projectinventories.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewProjectInventoryInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "projectqueries.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewProjectQueryInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "projects.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewProjectInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "publicservicerts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewPublicServiceRTInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "remotegatewayserviceconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewRemoteGatewayServiceConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "resourcegrouprts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewResourceGroupRTInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "resourcegroups.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewResourceGroupInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "roots.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewRootInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "rpolicies.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewRPolicyInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "runtimes.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewRuntimeInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "schemaviolationdiscoveryrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSchemaViolationDiscoveryRTInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "gnsschemaviolationdiscoveries.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsSchemaViolationDiscoveryInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "secretrtconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSecretRTConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "secrethashes.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSecretHashInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "securitycontextconstraintsconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSecurityContextConstraintsConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "securitycontextconstraintses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSecurityContextConstraintsInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "serviceconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "servicecronjobs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceCronJobInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "servicedaemonsets.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceDaemonSetInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "servicedeploymentcontainers.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceDeploymentContainerInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "servicedeployments.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceDeploymentInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "servicedirectoryentryconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceDirectoryEntryConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "servicedirectoryrtfolderentries.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceDirectoryRTFolderEntryInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "servicedirectoryrtfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceDirectoryRTFolderInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "servicedirectoryrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceDirectoryRTInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "servicedirectoryns.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceDirectoryNInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "serviceentryconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceEntryConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "serviceentries.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceEntryInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "svcgrouprts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSvcGroupRTInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "serviceinstancecontainers.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceInstanceContainerInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "serviceinstances.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceInstanceInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "servicejobs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceJobInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "servicelevelobjectivefolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceLevelObjectiveFolderInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "servicelevelobjectives.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceLevelObjectiveInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "servicereplicasets.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceReplicaSetInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "servicestatefulsets.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceStatefulSetInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "servicetemplateservicedefinitions.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceTemplateServiceDefinitionInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "servicetemplates.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceTemplateInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "serviceversionconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceVersionConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "metricmonitors.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewMetricMonitorInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "serviceversions.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceVersionInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "services.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "sloconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSloConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "sloserviceconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSloServiceConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "slofolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSLOFolderInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "federatedsloconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewFederatedSloConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "federatedsloserviceconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewFederatedSloServiceConfigInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "slopolicies.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSLOPolicyInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "svcgroups.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSvcGroupInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "tables.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewTableInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "templategroups.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewTemplateGroupInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "templates.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewTemplateInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "tenantresources.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewTenantResourceInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "tenanttokens.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewTenantTokenInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "tenants.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewTenantInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "userdiscoveryrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewUserDiscoveryRTInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "userdiscoveries.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewUserDiscoveryInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "userfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewUserFolderInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "usergroups.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewUserGroupInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "userpreferences.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewUserPreferenceInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "users.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewUserInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "virtualservices.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewVirtualServiceInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + + key = "workloadentries.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewWorkloadEntryInformer(c.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } + +} + +func (c *Clientset) UnsubscribeAll() { + subscriptionMap.Range(func(key, s interface{}) bool { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + return true + }) +} + +// NewForConfig returns Client which can be which can be used to connect to database +func NewForConfig(config *rest.Config) (*Clientset, error) { + baseClient, err := baseClientset.NewForConfig(config) + if err != nil { + return nil, err + } + client := &Clientset{} + client.baseClient = baseClient + client.globalTsmV1 = newGlobalTsmV1(client) + + return client, nil +} + +// NewFakeClient creates simple client which can be used for unit tests +func NewFakeClient() *Clientset { + client := &Clientset{} + client.baseClient = fakeBaseClienset.NewSimpleClientset() + client.globalTsmV1 = newGlobalTsmV1(client) + + return client +} + +type PatchOp struct { + Op string `json:"op"` + Path string `json:"path"` + Value interface{} `json:"value,omitempty"` +} + +type Patch []PatchOp + +func (p Patch) Marshal() ([]byte, error) { + return json.Marshal(p) +} + +func (c *Clientset) Global() *GlobalTsmV1 { + return c.globalTsmV1 +} + +type GlobalTsmV1 struct { + client *Clientset +} + +func newGlobalTsmV1(client *Clientset) *GlobalTsmV1 { + return &GlobalTsmV1{ + client: client, + } +} + +// GetAccessTokenByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAccessTokenByName(ctx context.Context, hashedName string) (*GlobalAccessToken, error) { + key := "accesstokens.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AccessToken) + return &GlobalAccessToken{ + client: group.client, + AccessToken: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AccessTokens().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAccessToken{ + client: group.client, + AccessToken: result, + }, nil + } +} + +// DeleteAccessTokenByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAccessTokenByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AccessTokens().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + AccessTokens().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/accessTokenGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["userfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("userfolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + UserFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAccessTokenByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAccessTokenByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AccessToken) (*GlobalAccessToken, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + AccessTokens().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["userfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("userfolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"accessTokenGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"AccessToken\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + UserFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAccessToken{ + client: group.client, + AccessToken: result, + }, nil +} + +// UpdateAccessTokenByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAccessTokenByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AccessToken) (*GlobalAccessToken, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AccessTokens().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueTtl := + objToUpdate.Spec.Ttl + patchOpTtl := PatchOp{ + Op: "replace", + Path: "/spec/ttl", + Value: patchValueTtl, + } + patch = append(patch, patchOpTtl) + + patchValueCreated := + objToUpdate.Spec.Created + patchOpCreated := PatchOp{ + Op: "replace", + Path: "/spec/created", + Value: patchValueCreated, + } + patch = append(patch, patchOpCreated) + + patchValueUserId := + objToUpdate.Spec.UserId + patchOpUserId := PatchOp{ + Op: "replace", + Path: "/spec/userId", + Value: patchValueUserId, + } + patch = append(patch, patchOpUserId) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AccessTokens().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAccessToken{ + client: group.client, + AccessToken: result, + }, nil +} + +// ListAccessTokens returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAccessTokens(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAccessToken, err error) { + key := "accesstokens.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAccessToken, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AccessToken) + result[k] = &GlobalAccessToken{ + client: group.client, + AccessToken: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AccessTokens().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAccessToken, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAccessToken{ + client: group.client, + AccessToken: &item, + } + } + } + return +} + +type GlobalAccessToken struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AccessToken +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAccessToken) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAccessTokenByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AccessToken = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAccessToken) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAccessTokenByName(ctx, obj.AccessToken) + if err != nil { + return err + } + obj.AccessToken = result.AccessToken + return nil +} + +func (obj *GlobalAccessToken) GetParent(ctx context.Context) (result *GlobalUserFolder, err error) { + hashedName := helper.GetHashedName("userfolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["userfolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetUserFolderByName(ctx, hashedName) +} + +type accesstokenGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *accesstokenGlobalTsmV1Chainer) Subscribe() { + key := "accesstokens.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAccessTokenInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *accesstokenGlobalTsmV1Chainer) Unsubscribe() { + key := "accesstokens.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *accesstokenGlobalTsmV1Chainer) IsSubscribed() bool { + key := "accesstokens.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetACPConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetACPConfigByName(ctx context.Context, hashedName string) (*GlobalACPConfig, error) { + key := "acpconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ACPConfig) + return &GlobalACPConfig{ + client: group.client, + ACPConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ACPConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalACPConfig{ + client: group.client, + ACPConfig: result, + }, nil + } +} + +// DeleteACPConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteACPConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ACPConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ACPConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/policyConfigsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["accesscontrolpolicies.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("accesscontrolpolicies.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + AccessControlPolicies().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateACPConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateACPConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ACPConfig) (*GlobalACPConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.DestSvcGroupsGvk = nil + objToCreate.Spec.SourceSvcGroupsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ACPConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["accesscontrolpolicies.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("accesscontrolpolicies.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"policyConfigsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ACPConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + AccessControlPolicies().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalACPConfig{ + client: group.client, + ACPConfig: result, + }, nil +} + +// UpdateACPConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateACPConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ACPConfig) (*GlobalACPConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ACPConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueDisplayName := + objToUpdate.Spec.DisplayName + patchOpDisplayName := PatchOp{ + Op: "replace", + Path: "/spec/displayName", + Value: patchValueDisplayName, + } + patch = append(patch, patchOpDisplayName) + + patchValueGns := + objToUpdate.Spec.Gns + patchOpGns := PatchOp{ + Op: "replace", + Path: "/spec/gns", + Value: patchValueGns, + } + patch = append(patch, patchOpGns) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + if objToUpdate.Spec.Tags != nil { + patchValueTags := + objToUpdate.Spec.Tags + patchOpTags := PatchOp{ + Op: "replace", + Path: "/spec/tags", + Value: patchValueTags, + } + patch = append(patch, patchOpTags) + } + + patchValueProjectId := + objToUpdate.Spec.ProjectId + patchOpProjectId := PatchOp{ + Op: "replace", + Path: "/spec/projectId", + Value: patchValueProjectId, + } + patch = append(patch, patchOpProjectId) + + patchValueDestGroups := + objToUpdate.Spec.DestGroups + patchOpDestGroups := PatchOp{ + Op: "replace", + Path: "/spec/destGroups", + Value: patchValueDestGroups, + } + patch = append(patch, patchOpDestGroups) + + patchValueSourceGroups := + objToUpdate.Spec.SourceGroups + patchOpSourceGroups := PatchOp{ + Op: "replace", + Path: "/spec/sourceGroups", + Value: patchValueSourceGroups, + } + patch = append(patch, patchOpSourceGroups) + + if objToUpdate.Spec.Conditions != nil { + patchValueConditions := + objToUpdate.Spec.Conditions + patchOpConditions := PatchOp{ + Op: "replace", + Path: "/spec/conditions", + Value: patchValueConditions, + } + patch = append(patch, patchOpConditions) + } + + patchValueActions := + objToUpdate.Spec.Actions + patchOpActions := PatchOp{ + Op: "replace", + Path: "/spec/actions", + Value: patchValueActions, + } + patch = append(patch, patchOpActions) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ACPConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalACPConfig{ + client: group.client, + ACPConfig: result, + }, nil +} + +// ListACPConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListACPConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalACPConfig, err error) { + key := "acpconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalACPConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ACPConfig) + result[k] = &GlobalACPConfig{ + client: group.client, + ACPConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ACPConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalACPConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalACPConfig{ + client: group.client, + ACPConfig: &item, + } + } + } + return +} + +type GlobalACPConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ACPConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalACPConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteACPConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ACPConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalACPConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateACPConfigByName(ctx, obj.ACPConfig) + if err != nil { + return err + } + obj.ACPConfig = result.ACPConfig + return nil +} + +func (obj *GlobalACPConfig) GetParent(ctx context.Context) (result *GlobalAccessControlPolicy, err error) { + hashedName := helper.GetHashedName("accesscontrolpolicies.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["accesscontrolpolicies.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetAccessControlPolicyByName(ctx, hashedName) +} + +// GetAllDestSvcGroups returns all links of given type +func (obj *GlobalACPConfig) GetAllDestSvcGroups(ctx context.Context) ( + result []*GlobalSvcGroup, err error) { + result = make([]*GlobalSvcGroup, 0, len(obj.Spec.DestSvcGroupsGvk)) + for _, v := range obj.Spec.DestSvcGroupsGvk { + l, err := obj.client.Global().GetSvcGroupByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetDestSvcGroups returns link which has given displayName +func (obj *GlobalACPConfig) GetDestSvcGroups(ctx context.Context, + displayName string) (result *GlobalSvcGroup, err error) { + l, ok := obj.Spec.DestSvcGroupsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ACPConfig", "DestSvcGroups", displayName) + } + result, err = obj.client.Global().GetSvcGroupByName(ctx, l.Name) + return +} + +// LinkDestSvcGroups links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalACPConfig) LinkDestSvcGroups(ctx context.Context, + linkToAdd *GlobalSvcGroup) error { + + payload := "{\"spec\": {\"destSvcGroupsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"SvcGroup\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ACPConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ACPConfig = result + return nil +} + +// UnlinkDestSvcGroups unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalACPConfig) UnlinkDestSvcGroups(ctx context.Context, + linkToRemove *GlobalSvcGroup) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/destSvcGroupsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ACPConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ACPConfig = result + return nil + +} + +// GetAllSourceSvcGroups returns all links of given type +func (obj *GlobalACPConfig) GetAllSourceSvcGroups(ctx context.Context) ( + result []*GlobalSvcGroup, err error) { + result = make([]*GlobalSvcGroup, 0, len(obj.Spec.SourceSvcGroupsGvk)) + for _, v := range obj.Spec.SourceSvcGroupsGvk { + l, err := obj.client.Global().GetSvcGroupByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetSourceSvcGroups returns link which has given displayName +func (obj *GlobalACPConfig) GetSourceSvcGroups(ctx context.Context, + displayName string) (result *GlobalSvcGroup, err error) { + l, ok := obj.Spec.SourceSvcGroupsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ACPConfig", "SourceSvcGroups", displayName) + } + result, err = obj.client.Global().GetSvcGroupByName(ctx, l.Name) + return +} + +// LinkSourceSvcGroups links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalACPConfig) LinkSourceSvcGroups(ctx context.Context, + linkToAdd *GlobalSvcGroup) error { + + payload := "{\"spec\": {\"sourceSvcGroupsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"SvcGroup\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ACPConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ACPConfig = result + return nil +} + +// UnlinkSourceSvcGroups unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalACPConfig) UnlinkSourceSvcGroups(ctx context.Context, + linkToRemove *GlobalSvcGroup) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/sourceSvcGroupsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ACPConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ACPConfig = result + return nil + +} + +type acpconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *acpconfigGlobalTsmV1Chainer) Subscribe() { + key := "acpconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewACPConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *acpconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "acpconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *acpconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "acpconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetAdditionalAttributesByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAdditionalAttributesByName(ctx context.Context, hashedName string) (*GlobalAdditionalAttributes, error) { + key := "additionalattributeses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AdditionalAttributes) + return &GlobalAdditionalAttributes{ + client: group.client, + AdditionalAttributes: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AdditionalAttributeses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAdditionalAttributes{ + client: group.client, + AdditionalAttributes: result, + }, nil + } +} + +// DeleteAdditionalAttributesByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAdditionalAttributesByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AdditionalAttributeses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + AdditionalAttributeses().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/additionalAttributesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["services.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("services.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Services().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAdditionalAttributesByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAdditionalAttributesByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AdditionalAttributes) (*GlobalAdditionalAttributes, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + AdditionalAttributeses().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["services.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("services.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"additionalAttributesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"AdditionalAttributes\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Services().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAdditionalAttributes{ + client: group.client, + AdditionalAttributes: result, + }, nil +} + +// UpdateAdditionalAttributesByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAdditionalAttributesByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AdditionalAttributes) (*GlobalAdditionalAttributes, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AdditionalAttributeses().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueValue := + objToUpdate.Spec.Value + patchOpValue := PatchOp{ + Op: "replace", + Path: "/spec/value", + Value: patchValueValue, + } + patch = append(patch, patchOpValue) + + patchValueContext := + objToUpdate.Spec.Context + patchOpContext := PatchOp{ + Op: "replace", + Path: "/spec/context", + Value: patchValueContext, + } + patch = append(patch, patchOpContext) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AdditionalAttributeses().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAdditionalAttributes{ + client: group.client, + AdditionalAttributes: result, + }, nil +} + +// ListAdditionalAttributeses returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAdditionalAttributeses(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAdditionalAttributes, err error) { + key := "additionalattributeses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAdditionalAttributes, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AdditionalAttributes) + result[k] = &GlobalAdditionalAttributes{ + client: group.client, + AdditionalAttributes: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AdditionalAttributeses().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAdditionalAttributes, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAdditionalAttributes{ + client: group.client, + AdditionalAttributes: &item, + } + } + } + return +} + +type GlobalAdditionalAttributes struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AdditionalAttributes +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAdditionalAttributes) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAdditionalAttributesByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AdditionalAttributes = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAdditionalAttributes) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAdditionalAttributesByName(ctx, obj.AdditionalAttributes) + if err != nil { + return err + } + obj.AdditionalAttributes = result.AdditionalAttributes + return nil +} + +func (obj *GlobalAdditionalAttributes) GetParent(ctx context.Context) (result *GlobalService, err error) { + hashedName := helper.GetHashedName("services.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["services.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetServiceByName(ctx, hashedName) +} + +type additionalattributesGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *additionalattributesGlobalTsmV1Chainer) Subscribe() { + key := "additionalattributeses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAdditionalAttributesInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *additionalattributesGlobalTsmV1Chainer) Unsubscribe() { + key := "additionalattributeses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *additionalattributesGlobalTsmV1Chainer) IsSubscribed() bool { + key := "additionalattributeses.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetAllSparkServicesByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAllSparkServicesByName(ctx context.Context, hashedName string) (*GlobalAllSparkServices, error) { + key := "allsparkserviceses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AllSparkServices) + return &GlobalAllSparkServices{ + client: group.client, + AllSparkServices: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AllSparkServiceses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAllSparkServices{ + client: group.client, + AllSparkServices: result, + }, nil + } +} + +// DeleteAllSparkServicesByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAllSparkServicesByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AllSparkServiceses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + if result.Spec.GlobalRegistrationServiceGvk != nil { + err := group.client. + Global(). + DeleteGlobalRegistrationServiceByName(ctx, result.Spec.GlobalRegistrationServiceGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.LocalRegistrationServiceGvk != nil { + err := group.client. + Global(). + DeleteLocalRegistrationServiceByName(ctx, result.Spec.LocalRegistrationServiceGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.AwsConnectorGvk != nil { + err := group.client. + Global(). + DeleteAwsConnectorByName(ctx, result.Spec.AwsConnectorGvk.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + AllSparkServiceses().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/allsparkServicesGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAllSparkServicesByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAllSparkServicesByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AllSparkServices) (*GlobalAllSparkServices, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] == "" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.Labels[common.DISPLAY_NAME_LABEL]) + } + + objToCreate.Spec.GlobalRegistrationServiceGvk = nil + objToCreate.Spec.LocalRegistrationServiceGvk = nil + objToCreate.Spec.AwsConnectorGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + AllSparkServiceses().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/allsparkServicesGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "AllSparkServices", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAllSparkServices{ + client: group.client, + AllSparkServices: result, + }, nil +} + +// UpdateAllSparkServicesByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAllSparkServicesByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AllSparkServices) (*GlobalAllSparkServices, error) { + if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) + } + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AllSparkServiceses().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AllSparkServiceses().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAllSparkServices{ + client: group.client, + AllSparkServices: result, + }, nil +} + +// ListAllSparkServiceses returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAllSparkServiceses(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAllSparkServices, err error) { + key := "allsparkserviceses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAllSparkServices, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AllSparkServices) + result[k] = &GlobalAllSparkServices{ + client: group.client, + AllSparkServices: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AllSparkServiceses().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAllSparkServices, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAllSparkServices{ + client: group.client, + AllSparkServices: &item, + } + } + } + return +} + +type GlobalAllSparkServices struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AllSparkServices +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAllSparkServices) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAllSparkServicesByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AllSparkServices = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAllSparkServices) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAllSparkServicesByName(ctx, obj.AllSparkServices) + if err != nil { + return err + } + obj.AllSparkServices = result.AllSparkServices + return nil +} + +func (obj *GlobalAllSparkServices) GetParent(ctx context.Context) (result *GlobalRuntime, err error) { + hashedName := helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["runtimes.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetRuntimeByName(ctx, hashedName) +} + +// GetGlobalRegistrationService returns child of given type +func (obj *GlobalAllSparkServices) GetGlobalRegistrationService(ctx context.Context) ( + result *GlobalGlobalRegistrationService, err error) { + if obj.Spec.GlobalRegistrationServiceGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.AllSparkServices", "GlobalRegistrationService") + } + return obj.client.Global().GetGlobalRegistrationServiceByName(ctx, obj.Spec.GlobalRegistrationServiceGvk.Name) +} + +// AddGlobalRegistrationService calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalAllSparkServices) AddGlobalRegistrationService(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GlobalRegistrationService) (result *GlobalGlobalRegistrationService, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["allsparkserviceses.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["allsparkserviceses.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGlobalRegistrationServiceByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetAllSparkServicesByName(ctx, obj.GetName()) + if getErr == nil { + obj.AllSparkServices = updatedObj.AllSparkServices + } + return +} + +// DeleteGlobalRegistrationService calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalAllSparkServices) DeleteGlobalRegistrationService(ctx context.Context) (err error) { + if obj.Spec.GlobalRegistrationServiceGvk != nil { + err = obj.client. + Global().DeleteGlobalRegistrationServiceByName(ctx, obj.Spec.GlobalRegistrationServiceGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetAllSparkServicesByName(ctx, obj.GetName()) + if err == nil { + obj.AllSparkServices = updatedObj.AllSparkServices + } + return +} + +// GetLocalRegistrationService returns child of given type +func (obj *GlobalAllSparkServices) GetLocalRegistrationService(ctx context.Context) ( + result *GlobalLocalRegistrationService, err error) { + if obj.Spec.LocalRegistrationServiceGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.AllSparkServices", "LocalRegistrationService") + } + return obj.client.Global().GetLocalRegistrationServiceByName(ctx, obj.Spec.LocalRegistrationServiceGvk.Name) +} + +// AddLocalRegistrationService calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalAllSparkServices) AddLocalRegistrationService(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.LocalRegistrationService) (result *GlobalLocalRegistrationService, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["allsparkserviceses.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["allsparkserviceses.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateLocalRegistrationServiceByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetAllSparkServicesByName(ctx, obj.GetName()) + if getErr == nil { + obj.AllSparkServices = updatedObj.AllSparkServices + } + return +} + +// DeleteLocalRegistrationService calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalAllSparkServices) DeleteLocalRegistrationService(ctx context.Context) (err error) { + if obj.Spec.LocalRegistrationServiceGvk != nil { + err = obj.client. + Global().DeleteLocalRegistrationServiceByName(ctx, obj.Spec.LocalRegistrationServiceGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetAllSparkServicesByName(ctx, obj.GetName()) + if err == nil { + obj.AllSparkServices = updatedObj.AllSparkServices + } + return +} + +// GetAwsConnector returns child of given type +func (obj *GlobalAllSparkServices) GetAwsConnector(ctx context.Context) ( + result *GlobalAwsConnector, err error) { + if obj.Spec.AwsConnectorGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.AllSparkServices", "AwsConnector") + } + return obj.client.Global().GetAwsConnectorByName(ctx, obj.Spec.AwsConnectorGvk.Name) +} + +// AddAwsConnector calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalAllSparkServices) AddAwsConnector(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AwsConnector) (result *GlobalAwsConnector, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["allsparkserviceses.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["allsparkserviceses.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAwsConnectorByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetAllSparkServicesByName(ctx, obj.GetName()) + if getErr == nil { + obj.AllSparkServices = updatedObj.AllSparkServices + } + return +} + +// DeleteAwsConnector calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalAllSparkServices) DeleteAwsConnector(ctx context.Context) (err error) { + if obj.Spec.AwsConnectorGvk != nil { + err = obj.client. + Global().DeleteAwsConnectorByName(ctx, obj.Spec.AwsConnectorGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetAllSparkServicesByName(ctx, obj.GetName()) + if err == nil { + obj.AllSparkServices = updatedObj.AllSparkServices + } + return +} + +type allsparkservicesGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *allsparkservicesGlobalTsmV1Chainer) Subscribe() { + key := "allsparkserviceses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAllSparkServicesInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *allsparkservicesGlobalTsmV1Chainer) Unsubscribe() { + key := "allsparkserviceses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *allsparkservicesGlobalTsmV1Chainer) IsSubscribed() bool { + key := "allsparkserviceses.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *allsparkservicesGlobalTsmV1Chainer) GlobalRegistrationService(name string) *globalregistrationserviceGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["globalregistrationservices.global.tsm.tanzu.vmware.com"] = name + return &globalregistrationserviceGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGlobalRegistrationService calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *allsparkservicesGlobalTsmV1Chainer) GetGlobalRegistrationService(ctx context.Context, displayName string) (result *GlobalGlobalRegistrationService, err error) { + hashedName := helper.GetHashedName("globalregistrationservices.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGlobalRegistrationServiceByName(ctx, hashedName) +} + +// AddGlobalRegistrationService calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *allsparkservicesGlobalTsmV1Chainer) AddGlobalRegistrationService(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GlobalRegistrationService) (result *GlobalGlobalRegistrationService, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("globalregistrationservices.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGlobalRegistrationServiceByName(ctx, objToCreate) +} + +// DeleteGlobalRegistrationService calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *allsparkservicesGlobalTsmV1Chainer) DeleteGlobalRegistrationService(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("globalregistrationservices.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGlobalRegistrationServiceByName(ctx, hashedName) +} + +func (c *allsparkservicesGlobalTsmV1Chainer) LocalRegistrationService(name string) *localregistrationserviceGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["localregistrationservices.global.tsm.tanzu.vmware.com"] = name + return &localregistrationserviceGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetLocalRegistrationService calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *allsparkservicesGlobalTsmV1Chainer) GetLocalRegistrationService(ctx context.Context, displayName string) (result *GlobalLocalRegistrationService, err error) { + hashedName := helper.GetHashedName("localregistrationservices.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetLocalRegistrationServiceByName(ctx, hashedName) +} + +// AddLocalRegistrationService calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *allsparkservicesGlobalTsmV1Chainer) AddLocalRegistrationService(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.LocalRegistrationService) (result *GlobalLocalRegistrationService, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("localregistrationservices.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateLocalRegistrationServiceByName(ctx, objToCreate) +} + +// DeleteLocalRegistrationService calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *allsparkservicesGlobalTsmV1Chainer) DeleteLocalRegistrationService(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("localregistrationservices.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteLocalRegistrationServiceByName(ctx, hashedName) +} + +func (c *allsparkservicesGlobalTsmV1Chainer) AwsConnector() *awsconnectorGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["awsconnectors.global.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY + return &awsconnectorGlobalTsmV1Chainer{ + client: c.client, + name: helper.DEFAULT_KEY, + parentLabels: parentLabels, + } +} + +// GetAwsConnector calculates hashed name of the object based on it's parents and returns the object +func (c *allsparkservicesGlobalTsmV1Chainer) GetAwsConnector(ctx context.Context) (result *GlobalAwsConnector, err error) { + hashedName := helper.GetHashedName("awsconnectors.global.tsm.tanzu.vmware.com", c.parentLabels, helper.DEFAULT_KEY) + return c.client.Global().GetAwsConnectorByName(ctx, hashedName) +} + +// AddAwsConnector calculates hashed name of the child to create based on parents names and creates it. +// objToCreate.Name is changed to the hashed name. Original name ('default') is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *allsparkservicesGlobalTsmV1Chainer) AddAwsConnector(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AwsConnector) (result *GlobalAwsConnector, err error) { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("awsconnectors.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAwsConnectorByName(ctx, objToCreate) +} + +// DeleteAwsConnector calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *allsparkservicesGlobalTsmV1Chainer) DeleteAwsConnector(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("awsconnectors.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAwsConnectorByName(ctx, hashedName) +} + +// GetAnnotationByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAnnotationByName(ctx context.Context, hashedName string) (*GlobalAnnotation, error) { + key := "annotations.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Annotation) + return &GlobalAnnotation{ + client: group.client, + Annotation: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Annotations().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAnnotation{ + client: group.client, + Annotation: result, + }, nil + } +} + +// DeleteAnnotationByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAnnotationByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Annotations().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + Annotations().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/annotationsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["tenants.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("tenants.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Tenants().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAnnotationByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAnnotationByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Annotation) (*GlobalAnnotation, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + Annotations().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["tenants.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("tenants.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"annotationsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"Annotation\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Tenants().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAnnotation{ + client: group.client, + Annotation: result, + }, nil +} + +// UpdateAnnotationByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAnnotationByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Annotation) (*GlobalAnnotation, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Annotations().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueData := + objToUpdate.Spec.Data + patchOpData := PatchOp{ + Op: "replace", + Path: "/spec/data", + Value: patchValueData, + } + patch = append(patch, patchOpData) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Annotations().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAnnotation{ + client: group.client, + Annotation: result, + }, nil +} + +// ListAnnotations returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAnnotations(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAnnotation, err error) { + key := "annotations.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAnnotation, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Annotation) + result[k] = &GlobalAnnotation{ + client: group.client, + Annotation: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Annotations().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAnnotation, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAnnotation{ + client: group.client, + Annotation: &item, + } + } + } + return +} + +type GlobalAnnotation struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Annotation +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAnnotation) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAnnotationByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Annotation = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAnnotation) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAnnotationByName(ctx, obj.Annotation) + if err != nil { + return err + } + obj.Annotation = result.Annotation + return nil +} + +func (obj *GlobalAnnotation) GetParent(ctx context.Context) (result *GlobalTenant, err error) { + hashedName := helper.GetHashedName("tenants.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["tenants.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetTenantByName(ctx, hashedName) +} + +type annotationGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *annotationGlobalTsmV1Chainer) Subscribe() { + key := "annotations.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAnnotationInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *annotationGlobalTsmV1Chainer) Unsubscribe() { + key := "annotations.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *annotationGlobalTsmV1Chainer) IsSubscribed() bool { + key := "annotations.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetApiDiscoveryRTByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetApiDiscoveryRTByName(ctx context.Context, hashedName string) (*GlobalApiDiscoveryRT, error) { + key := "apidiscoveryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ApiDiscoveryRT) + return &GlobalApiDiscoveryRT{ + client: group.client, + ApiDiscoveryRT: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ApiDiscoveryRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalApiDiscoveryRT{ + client: group.client, + ApiDiscoveryRT: result, + }, nil + } +} + +// DeleteApiDiscoveryRTByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteApiDiscoveryRTByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ApiDiscoveryRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ApiDiscoveryRTs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/apiDiscoveryGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateApiDiscoveryRTByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateApiDiscoveryRTByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ApiDiscoveryRT) (*GlobalApiDiscoveryRT, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ApiDiscoveryRTs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"apiDiscoveryGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ApiDiscoveryRT\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalApiDiscoveryRT{ + client: group.client, + ApiDiscoveryRT: result, + }, nil +} + +// UpdateApiDiscoveryRTByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateApiDiscoveryRTByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ApiDiscoveryRT) (*GlobalApiDiscoveryRT, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ApiDiscoveryRTs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueGnsid := + objToUpdate.Spec.Gnsid + patchOpGnsid := PatchOp{ + Op: "replace", + Path: "/spec/gnsid", + Value: patchValueGnsid, + } + patch = append(patch, patchOpGnsid) + + patchValueSelectors := + objToUpdate.Spec.Selectors + patchOpSelectors := PatchOp{ + Op: "replace", + Path: "/spec/selectors", + Value: patchValueSelectors, + } + patch = append(patch, patchOpSelectors) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + patchValueCompressionEnabled := + objToUpdate.Spec.CompressionEnabled + patchOpCompressionEnabled := PatchOp{ + Op: "replace", + Path: "/spec/compressionEnabled", + Value: patchValueCompressionEnabled, + } + patch = append(patch, patchOpCompressionEnabled) + + patchValueIsEndpointApiPrechecks := + objToUpdate.Spec.IsEndpointApiPrechecks + patchOpIsEndpointApiPrechecks := PatchOp{ + Op: "replace", + Path: "/spec/isEndpointApiPrechecks", + Value: patchValueIsEndpointApiPrechecks, + } + patch = append(patch, patchOpIsEndpointApiPrechecks) + + patchValueProcessingToggles := + objToUpdate.Spec.ProcessingToggles + patchOpProcessingToggles := PatchOp{ + Op: "replace", + Path: "/spec/processingToggles", + Value: patchValueProcessingToggles, + } + patch = append(patch, patchOpProcessingToggles) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ApiDiscoveryRTs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalApiDiscoveryRT{ + client: group.client, + ApiDiscoveryRT: result, + }, nil +} + +// ListApiDiscoveryRTs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListApiDiscoveryRTs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalApiDiscoveryRT, err error) { + key := "apidiscoveryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalApiDiscoveryRT, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ApiDiscoveryRT) + result[k] = &GlobalApiDiscoveryRT{ + client: group.client, + ApiDiscoveryRT: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ApiDiscoveryRTs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalApiDiscoveryRT, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalApiDiscoveryRT{ + client: group.client, + ApiDiscoveryRT: &item, + } + } + } + return +} + +type GlobalApiDiscoveryRT struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ApiDiscoveryRT +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalApiDiscoveryRT) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteApiDiscoveryRTByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ApiDiscoveryRT = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalApiDiscoveryRT) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateApiDiscoveryRTByName(ctx, obj.ApiDiscoveryRT) + if err != nil { + return err + } + obj.ApiDiscoveryRT = result.ApiDiscoveryRT + return nil +} + +func (obj *GlobalApiDiscoveryRT) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type apidiscoveryrtGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *apidiscoveryrtGlobalTsmV1Chainer) Subscribe() { + key := "apidiscoveryrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewApiDiscoveryRTInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *apidiscoveryrtGlobalTsmV1Chainer) Unsubscribe() { + key := "apidiscoveryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *apidiscoveryrtGlobalTsmV1Chainer) IsSubscribed() bool { + key := "apidiscoveryrts.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetApiDiscoveryByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetApiDiscoveryByName(ctx context.Context, hashedName string) (*GlobalApiDiscovery, error) { + key := "apidiscoveries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ApiDiscovery) + return &GlobalApiDiscovery{ + client: group.client, + ApiDiscovery: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ApiDiscoveries().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalApiDiscovery{ + client: group.client, + ApiDiscovery: result, + }, nil + } +} + +// DeleteApiDiscoveryByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteApiDiscoveryByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ApiDiscoveries().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ApiDiscoveries().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/apiDiscoveryGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateApiDiscoveryByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateApiDiscoveryByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ApiDiscovery) (*GlobalApiDiscovery, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ApiDiscoveries().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"apiDiscoveryGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ApiDiscovery\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalApiDiscovery{ + client: group.client, + ApiDiscovery: result, + }, nil +} + +// UpdateApiDiscoveryByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateApiDiscoveryByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ApiDiscovery) (*GlobalApiDiscovery, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ApiDiscoveries().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ApiDiscoveries().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalApiDiscovery{ + client: group.client, + ApiDiscovery: result, + }, nil +} + +// ListApiDiscoveries returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListApiDiscoveries(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalApiDiscovery, err error) { + key := "apidiscoveries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalApiDiscovery, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ApiDiscovery) + result[k] = &GlobalApiDiscovery{ + client: group.client, + ApiDiscovery: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ApiDiscoveries().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalApiDiscovery, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalApiDiscovery{ + client: group.client, + ApiDiscovery: &item, + } + } + } + return +} + +type GlobalApiDiscovery struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ApiDiscovery +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalApiDiscovery) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteApiDiscoveryByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ApiDiscovery = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalApiDiscovery) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateApiDiscoveryByName(ctx, obj.ApiDiscovery) + if err != nil { + return err + } + obj.ApiDiscovery = result.ApiDiscovery + return nil +} + +func (obj *GlobalApiDiscovery) GetParent(ctx context.Context) (result *GlobalGNS, err error) { + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnss.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGNSByName(ctx, hashedName) +} + +type apidiscoveryGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *apidiscoveryGlobalTsmV1Chainer) Subscribe() { + key := "apidiscoveries.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewApiDiscoveryInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *apidiscoveryGlobalTsmV1Chainer) Unsubscribe() { + key := "apidiscoveries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *apidiscoveryGlobalTsmV1Chainer) IsSubscribed() bool { + key := "apidiscoveries.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetAppFolderByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAppFolderByName(ctx context.Context, hashedName string) (*GlobalAppFolder, error) { + key := "appfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AppFolder) + return &GlobalAppFolder{ + client: group.client, + AppFolder: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AppFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAppFolder{ + client: group.client, + AppFolder: result, + }, nil + } +} + +// DeleteAppFolderByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAppFolderByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AppFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.AppGvk { + err := group.client. + Global().DeleteAppByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + AppFolders().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/appFolderGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAppFolderByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAppFolderByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppFolder) (*GlobalAppFolder, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.AppGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + AppFolders().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/appFolderGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "AppFolder", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAppFolder{ + client: group.client, + AppFolder: result, + }, nil +} + +// UpdateAppFolderByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAppFolderByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AppFolder) (*GlobalAppFolder, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AppFolders().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AppFolders().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAppFolder{ + client: group.client, + AppFolder: result, + }, nil +} + +// ListAppFolders returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAppFolders(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAppFolder, err error) { + key := "appfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAppFolder, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AppFolder) + result[k] = &GlobalAppFolder{ + client: group.client, + AppFolder: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AppFolders().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAppFolder, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAppFolder{ + client: group.client, + AppFolder: &item, + } + } + } + return +} + +type GlobalAppFolder struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AppFolder +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAppFolder) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAppFolderByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AppFolder = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAppFolder) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAppFolderByName(ctx, obj.AppFolder) + if err != nil { + return err + } + obj.AppFolder = result.AppFolder + return nil +} + +func (obj *GlobalAppFolder) GetParent(ctx context.Context) (result *GlobalRuntime, err error) { + hashedName := helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["runtimes.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetRuntimeByName(ctx, hashedName) +} + +// GetAllApp returns all children of given type +func (obj *GlobalAppFolder) GetAllApp(ctx context.Context) ( + result []*GlobalApp, err error) { + result = make([]*GlobalApp, 0, len(obj.Spec.AppGvk)) + for _, v := range obj.Spec.AppGvk { + l, err := obj.client.Global().GetAppByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetApp returns child which has given displayName +func (obj *GlobalAppFolder) GetApp(ctx context.Context, + displayName string) (result *GlobalApp, err error) { + l, ok := obj.Spec.AppGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.AppFolder", "App", displayName) + } + result, err = obj.client.Global().GetAppByName(ctx, l.Name) + return +} + +// AddApp calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalAppFolder) AddApp(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.App) (result *GlobalApp, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["appfolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["appfolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAppByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetAppFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.AppFolder = updatedObj.AppFolder + } + return +} + +// DeleteApp calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalAppFolder) DeleteApp(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.AppGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.AppFolder", "App", displayName) + } + err = obj.client.Global().DeleteAppByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetAppFolderByName(ctx, obj.GetName()) + if err == nil { + obj.AppFolder = updatedObj.AppFolder + } + return +} + +type appfolderGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *appfolderGlobalTsmV1Chainer) Subscribe() { + key := "appfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAppFolderInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *appfolderGlobalTsmV1Chainer) Unsubscribe() { + key := "appfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *appfolderGlobalTsmV1Chainer) IsSubscribed() bool { + key := "appfolders.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *appfolderGlobalTsmV1Chainer) App(name string) *appGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["apps.global.tsm.tanzu.vmware.com"] = name + return &appGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetApp calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *appfolderGlobalTsmV1Chainer) GetApp(ctx context.Context, displayName string) (result *GlobalApp, err error) { + hashedName := helper.GetHashedName("apps.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAppByName(ctx, hashedName) +} + +// AddApp calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *appfolderGlobalTsmV1Chainer) AddApp(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.App) (result *GlobalApp, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("apps.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAppByName(ctx, objToCreate) +} + +// DeleteApp calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *appfolderGlobalTsmV1Chainer) DeleteApp(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("apps.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAppByName(ctx, hashedName) +} + +// GetAppGroupByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAppGroupByName(ctx context.Context, hashedName string) (*GlobalAppGroup, error) { + key := "appgroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AppGroup) + return &GlobalAppGroup{ + client: group.client, + AppGroup: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AppGroups().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAppGroup{ + client: group.client, + AppGroup: result, + }, nil + } +} + +// DeleteAppGroupByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAppGroupByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AppGroups().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + AppGroups().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/appGroupsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["resourcegroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ResourceGroups().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAppGroupByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAppGroupByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppGroup) (*GlobalAppGroup, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ServicesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + AppGroups().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["resourcegroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"appGroupsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"AppGroup\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ResourceGroups().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAppGroup{ + client: group.client, + AppGroup: result, + }, nil +} + +// UpdateAppGroupByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAppGroupByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AppGroup) (*GlobalAppGroup, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AppGroups().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueRules := + objToUpdate.Spec.Rules + patchOpRules := PatchOp{ + Op: "replace", + Path: "/spec/rules", + Value: patchValueRules, + } + patch = append(patch, patchOpRules) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AppGroups().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAppGroup{ + client: group.client, + AppGroup: result, + }, nil +} + +// ListAppGroups returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAppGroups(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAppGroup, err error) { + key := "appgroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAppGroup, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AppGroup) + result[k] = &GlobalAppGroup{ + client: group.client, + AppGroup: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AppGroups().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAppGroup, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAppGroup{ + client: group.client, + AppGroup: &item, + } + } + } + return +} + +type GlobalAppGroup struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AppGroup +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAppGroup) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAppGroupByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AppGroup = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAppGroup) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAppGroupByName(ctx, obj.AppGroup) + if err != nil { + return err + } + obj.AppGroup = result.AppGroup + return nil +} + +func (obj *GlobalAppGroup) GetParent(ctx context.Context) (result *GlobalResourceGroup, err error) { + hashedName := helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["resourcegroups.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetResourceGroupByName(ctx, hashedName) +} + +// GetAllServices returns all links of given type +func (obj *GlobalAppGroup) GetAllServices(ctx context.Context) ( + result []*GlobalService, err error) { + result = make([]*GlobalService, 0, len(obj.Spec.ServicesGvk)) + for _, v := range obj.Spec.ServicesGvk { + l, err := obj.client.Global().GetServiceByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServices returns link which has given displayName +func (obj *GlobalAppGroup) GetServices(ctx context.Context, + displayName string) (result *GlobalService, err error) { + l, ok := obj.Spec.ServicesGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.AppGroup", "Services", displayName) + } + result, err = obj.client.Global().GetServiceByName(ctx, l.Name) + return +} + +// LinkServices links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalAppGroup) LinkServices(ctx context.Context, + linkToAdd *GlobalService) error { + + payload := "{\"spec\": {\"servicesGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"Service\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().AppGroups().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.AppGroup = result + return nil +} + +// UnlinkServices unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalAppGroup) UnlinkServices(ctx context.Context, + linkToRemove *GlobalService) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/servicesGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().AppGroups().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.AppGroup = result + return nil + +} + +type appgroupGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *appgroupGlobalTsmV1Chainer) Subscribe() { + key := "appgroups.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAppGroupInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *appgroupGlobalTsmV1Chainer) Unsubscribe() { + key := "appgroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *appgroupGlobalTsmV1Chainer) IsSubscribed() bool { + key := "appgroups.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetAppTemplateServiceDefinitionByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAppTemplateServiceDefinitionByName(ctx context.Context, hashedName string) (*GlobalAppTemplateServiceDefinition, error) { + key := "apptemplateservicedefinitions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition) + return &GlobalAppTemplateServiceDefinition{ + client: group.client, + AppTemplateServiceDefinition: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AppTemplateServiceDefinitions().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAppTemplateServiceDefinition{ + client: group.client, + AppTemplateServiceDefinition: result, + }, nil + } +} + +// DeleteAppTemplateServiceDefinitionByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAppTemplateServiceDefinitionByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AppTemplateServiceDefinitions().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + AppTemplateServiceDefinitions().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceDefinitionsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["apptemplates.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("apptemplates.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + AppTemplates().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAppTemplateServiceDefinitionByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAppTemplateServiceDefinitionByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition) (*GlobalAppTemplateServiceDefinition, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + AppTemplateServiceDefinitions().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["apptemplates.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("apptemplates.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceDefinitionsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"AppTemplateServiceDefinition\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + AppTemplates().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAppTemplateServiceDefinition{ + client: group.client, + AppTemplateServiceDefinition: result, + }, nil +} + +// UpdateAppTemplateServiceDefinitionByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAppTemplateServiceDefinitionByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition) (*GlobalAppTemplateServiceDefinition, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AppTemplateServiceDefinitions().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueType := + objToUpdate.Spec.Type + patchOpType := PatchOp{ + Op: "replace", + Path: "/spec/type", + Value: patchValueType, + } + patch = append(patch, patchOpType) + + patchValueVersion := + objToUpdate.Spec.Version + patchOpVersion := PatchOp{ + Op: "replace", + Path: "/spec/version", + Value: patchValueVersion, + } + patch = append(patch, patchOpVersion) + + patchValueTemplate := + objToUpdate.Spec.Template + patchOpTemplate := PatchOp{ + Op: "replace", + Path: "/spec/template", + Value: patchValueTemplate, + } + patch = append(patch, patchOpTemplate) + + if objToUpdate.Spec.TemplateArgs != nil { + patchValueTemplateArgs := + objToUpdate.Spec.TemplateArgs + patchOpTemplateArgs := PatchOp{ + Op: "replace", + Path: "/spec/templateArgs", + Value: patchValueTemplateArgs, + } + patch = append(patch, patchOpTemplateArgs) + } + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AppTemplateServiceDefinitions().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAppTemplateServiceDefinition{ + client: group.client, + AppTemplateServiceDefinition: result, + }, nil +} + +// ListAppTemplateServiceDefinitions returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAppTemplateServiceDefinitions(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAppTemplateServiceDefinition, err error) { + key := "apptemplateservicedefinitions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAppTemplateServiceDefinition, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition) + result[k] = &GlobalAppTemplateServiceDefinition{ + client: group.client, + AppTemplateServiceDefinition: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AppTemplateServiceDefinitions().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAppTemplateServiceDefinition, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAppTemplateServiceDefinition{ + client: group.client, + AppTemplateServiceDefinition: &item, + } + } + } + return +} + +type GlobalAppTemplateServiceDefinition struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAppTemplateServiceDefinition) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAppTemplateServiceDefinitionByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AppTemplateServiceDefinition = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAppTemplateServiceDefinition) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAppTemplateServiceDefinitionByName(ctx, obj.AppTemplateServiceDefinition) + if err != nil { + return err + } + obj.AppTemplateServiceDefinition = result.AppTemplateServiceDefinition + return nil +} + +func (obj *GlobalAppTemplateServiceDefinition) GetParent(ctx context.Context) (result *GlobalAppTemplate, err error) { + hashedName := helper.GetHashedName("apptemplates.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["apptemplates.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetAppTemplateByName(ctx, hashedName) +} + +type apptemplateservicedefinitionGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *apptemplateservicedefinitionGlobalTsmV1Chainer) Subscribe() { + key := "apptemplateservicedefinitions.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAppTemplateServiceDefinitionInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *apptemplateservicedefinitionGlobalTsmV1Chainer) Unsubscribe() { + key := "apptemplateservicedefinitions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *apptemplateservicedefinitionGlobalTsmV1Chainer) IsSubscribed() bool { + key := "apptemplateservicedefinitions.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetAppTemplateByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAppTemplateByName(ctx context.Context, hashedName string) (*GlobalAppTemplate, error) { + key := "apptemplates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AppTemplate) + return &GlobalAppTemplate{ + client: group.client, + AppTemplate: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AppTemplates().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAppTemplate{ + client: group.client, + AppTemplate: result, + }, nil + } +} + +// DeleteAppTemplateByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAppTemplateByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AppTemplates().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.ServiceDefinitionsGvk { + err := group.client. + Global().DeleteAppTemplateServiceDefinitionByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + AppTemplates().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/appTemplatesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["templategroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + TemplateGroups().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAppTemplateByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAppTemplateByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppTemplate) (*GlobalAppTemplate, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ServiceDefinitionsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + AppTemplates().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["templategroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"appTemplatesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"AppTemplate\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + TemplateGroups().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAppTemplate{ + client: group.client, + AppTemplate: result, + }, nil +} + +// UpdateAppTemplateByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAppTemplateByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AppTemplate) (*GlobalAppTemplate, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AppTemplates().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueVersion := + objToUpdate.Spec.Version + patchOpVersion := PatchOp{ + Op: "replace", + Path: "/spec/version", + Value: patchValueVersion, + } + patch = append(patch, patchOpVersion) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AppTemplates().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAppTemplate{ + client: group.client, + AppTemplate: result, + }, nil +} + +// ListAppTemplates returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAppTemplates(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAppTemplate, err error) { + key := "apptemplates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAppTemplate, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AppTemplate) + result[k] = &GlobalAppTemplate{ + client: group.client, + AppTemplate: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AppTemplates().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAppTemplate, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAppTemplate{ + client: group.client, + AppTemplate: &item, + } + } + } + return +} + +type GlobalAppTemplate struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AppTemplate +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAppTemplate) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAppTemplateByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AppTemplate = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAppTemplate) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAppTemplateByName(ctx, obj.AppTemplate) + if err != nil { + return err + } + obj.AppTemplate = result.AppTemplate + return nil +} + +func (obj *GlobalAppTemplate) GetParent(ctx context.Context) (result *GlobalTemplateGroup, err error) { + hashedName := helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["templategroups.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetTemplateGroupByName(ctx, hashedName) +} + +// GetAllServiceDefinitions returns all children of given type +func (obj *GlobalAppTemplate) GetAllServiceDefinitions(ctx context.Context) ( + result []*GlobalAppTemplateServiceDefinition, err error) { + result = make([]*GlobalAppTemplateServiceDefinition, 0, len(obj.Spec.ServiceDefinitionsGvk)) + for _, v := range obj.Spec.ServiceDefinitionsGvk { + l, err := obj.client.Global().GetAppTemplateServiceDefinitionByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceDefinitions returns child which has given displayName +func (obj *GlobalAppTemplate) GetServiceDefinitions(ctx context.Context, + displayName string) (result *GlobalAppTemplateServiceDefinition, err error) { + l, ok := obj.Spec.ServiceDefinitionsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.AppTemplate", "ServiceDefinitions", displayName) + } + result, err = obj.client.Global().GetAppTemplateServiceDefinitionByName(ctx, l.Name) + return +} + +// AddServiceDefinitions calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalAppTemplate) AddServiceDefinitions(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition) (result *GlobalAppTemplateServiceDefinition, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["apptemplates.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["apptemplates.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAppTemplateServiceDefinitionByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetAppTemplateByName(ctx, obj.GetName()) + if getErr == nil { + obj.AppTemplate = updatedObj.AppTemplate + } + return +} + +// DeleteServiceDefinitions calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalAppTemplate) DeleteServiceDefinitions(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceDefinitionsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.AppTemplate", "ServiceDefinitions", displayName) + } + err = obj.client.Global().DeleteAppTemplateServiceDefinitionByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetAppTemplateByName(ctx, obj.GetName()) + if err == nil { + obj.AppTemplate = updatedObj.AppTemplate + } + return +} + +type apptemplateGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *apptemplateGlobalTsmV1Chainer) Subscribe() { + key := "apptemplates.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAppTemplateInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *apptemplateGlobalTsmV1Chainer) Unsubscribe() { + key := "apptemplates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *apptemplateGlobalTsmV1Chainer) IsSubscribed() bool { + key := "apptemplates.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *apptemplateGlobalTsmV1Chainer) ServiceDefinitions(name string) *apptemplateservicedefinitionGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["apptemplateservicedefinitions.global.tsm.tanzu.vmware.com"] = name + return &apptemplateservicedefinitionGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceDefinitions calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *apptemplateGlobalTsmV1Chainer) GetServiceDefinitions(ctx context.Context, displayName string) (result *GlobalAppTemplateServiceDefinition, err error) { + hashedName := helper.GetHashedName("apptemplateservicedefinitions.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAppTemplateServiceDefinitionByName(ctx, hashedName) +} + +// AddServiceDefinitions calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *apptemplateGlobalTsmV1Chainer) AddServiceDefinitions(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppTemplateServiceDefinition) (result *GlobalAppTemplateServiceDefinition, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("apptemplateservicedefinitions.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAppTemplateServiceDefinitionByName(ctx, objToCreate) +} + +// DeleteServiceDefinitions calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *apptemplateGlobalTsmV1Chainer) DeleteServiceDefinitions(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("apptemplateservicedefinitions.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAppTemplateServiceDefinitionByName(ctx, hashedName) +} + +// GetAppUserByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAppUserByName(ctx context.Context, hashedName string) (*GlobalAppUser, error) { + key := "appusers.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AppUser) + return &GlobalAppUser{ + client: group.client, + AppUser: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AppUsers().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAppUser{ + client: group.client, + AppUser: result, + }, nil + } +} + +// DeleteAppUserByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAppUserByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AppUsers().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + AppUsers().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/appUsersGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["userfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("userfolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + UserFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAppUserByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAppUserByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppUser) (*GlobalAppUser, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + AppUsers().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["userfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("userfolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"appUsersGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"AppUser\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + UserFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAppUser{ + client: group.client, + AppUser: result, + }, nil +} + +// UpdateAppUserByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAppUserByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AppUser) (*GlobalAppUser, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AppUsers().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AppUsers().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAppUser{ + client: group.client, + AppUser: result, + }, nil +} + +// ListAppUsers returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAppUsers(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAppUser, err error) { + key := "appusers.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAppUser, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AppUser) + result[k] = &GlobalAppUser{ + client: group.client, + AppUser: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AppUsers().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAppUser, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAppUser{ + client: group.client, + AppUser: &item, + } + } + } + return +} + +type GlobalAppUser struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AppUser +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAppUser) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAppUserByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AppUser = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAppUser) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAppUserByName(ctx, obj.AppUser) + if err != nil { + return err + } + obj.AppUser = result.AppUser + return nil +} + +func (obj *GlobalAppUser) GetParent(ctx context.Context) (result *GlobalUserFolder, err error) { + hashedName := helper.GetHashedName("userfolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["userfolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetUserFolderByName(ctx, hashedName) +} + +type appuserGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *appuserGlobalTsmV1Chainer) Subscribe() { + key := "appusers.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAppUserInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *appuserGlobalTsmV1Chainer) Unsubscribe() { + key := "appusers.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *appuserGlobalTsmV1Chainer) IsSubscribed() bool { + key := "appusers.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetAppVersionByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAppVersionByName(ctx context.Context, hashedName string) (*GlobalAppVersion, error) { + key := "appversions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AppVersion) + return &GlobalAppVersion{ + client: group.client, + AppVersion: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AppVersions().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAppVersion{ + client: group.client, + AppVersion: result, + }, nil + } +} + +// DeleteAppVersionByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAppVersionByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AppVersions().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + AppVersions().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/versionGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["apps.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("apps.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Apps().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAppVersionByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAppVersionByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppVersion) (*GlobalAppVersion, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.TemplateGvk = nil + objToCreate.Spec.InventoryGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + AppVersions().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["apps.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("apps.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/versionGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "AppVersion", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Apps().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAppVersion{ + client: group.client, + AppVersion: result, + }, nil +} + +// UpdateAppVersionByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAppVersionByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AppVersion) (*GlobalAppVersion, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AppVersions().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AppVersions().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAppVersion{ + client: group.client, + AppVersion: result, + }, nil +} + +// ListAppVersions returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAppVersions(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAppVersion, err error) { + key := "appversions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAppVersion, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AppVersion) + result[k] = &GlobalAppVersion{ + client: group.client, + AppVersion: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AppVersions().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAppVersion, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAppVersion{ + client: group.client, + AppVersion: &item, + } + } + } + return +} + +type GlobalAppVersion struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AppVersion +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAppVersion) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAppVersionByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AppVersion = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAppVersion) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAppVersionByName(ctx, obj.AppVersion) + if err != nil { + return err + } + obj.AppVersion = result.AppVersion + return nil +} + +func (obj *GlobalAppVersion) GetParent(ctx context.Context) (result *GlobalApp, err error) { + hashedName := helper.GetHashedName("apps.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["apps.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetAppByName(ctx, hashedName) +} + +// GetTemplate returns link of given type +func (obj *GlobalAppVersion) GetTemplate(ctx context.Context) ( + result *GlobalTemplate, err error) { + if obj.Spec.TemplateGvk == nil { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.AppVersion", "Template") + } + return obj.client.Global().GetTemplateByName(ctx, obj.Spec.TemplateGvk.Name) +} + +// LinkTemplate links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalAppVersion) LinkTemplate(ctx context.Context, + linkToAdd *GlobalTemplate) error { + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/templateGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "Template", + Name: linkToAdd.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().AppVersions().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.AppVersion = result + return nil +} + +// UnlinkTemplate unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalAppVersion) UnlinkTemplate(ctx context.Context) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/templateGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().AppVersions().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.AppVersion = result + return nil + +} + +// GetInventory returns link of given type +func (obj *GlobalAppVersion) GetInventory(ctx context.Context) ( + result *GlobalInventory, err error) { + if obj.Spec.InventoryGvk == nil { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.AppVersion", "Inventory") + } + return obj.client.Global().GetInventoryByName(ctx, obj.Spec.InventoryGvk.Name) +} + +// LinkInventory links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalAppVersion) LinkInventory(ctx context.Context, + linkToAdd *GlobalInventory) error { + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/inventoryGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "Inventory", + Name: linkToAdd.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().AppVersions().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.AppVersion = result + return nil +} + +// UnlinkInventory unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalAppVersion) UnlinkInventory(ctx context.Context) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/inventoryGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().AppVersions().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.AppVersion = result + return nil + +} + +type appversionGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *appversionGlobalTsmV1Chainer) Subscribe() { + key := "appversions.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAppVersionInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *appversionGlobalTsmV1Chainer) Unsubscribe() { + key := "appversions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *appversionGlobalTsmV1Chainer) IsSubscribed() bool { + key := "appversions.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetAppByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAppByName(ctx context.Context, hashedName string) (*GlobalApp, error) { + key := "apps.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.App) + return &GlobalApp{ + client: group.client, + App: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Apps().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalApp{ + client: group.client, + App: result, + }, nil + } +} + +// DeleteAppByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAppByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Apps().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + if result.Spec.VersionGvk != nil { + err := group.client. + Global(). + DeleteAppVersionByName(ctx, result.Spec.VersionGvk.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + Apps().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/appGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["appfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("appfolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + AppFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAppByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAppByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.App) (*GlobalApp, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.VersionGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + Apps().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["appfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("appfolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"appGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"App\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + AppFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalApp{ + client: group.client, + App: result, + }, nil +} + +// UpdateAppByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAppByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.App) (*GlobalApp, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Apps().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Apps().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalApp{ + client: group.client, + App: result, + }, nil +} + +// ListApps returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListApps(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalApp, err error) { + key := "apps.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalApp, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.App) + result[k] = &GlobalApp{ + client: group.client, + App: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Apps().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalApp, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalApp{ + client: group.client, + App: &item, + } + } + } + return +} + +type GlobalApp struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.App +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalApp) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAppByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.App = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalApp) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAppByName(ctx, obj.App) + if err != nil { + return err + } + obj.App = result.App + return nil +} + +func (obj *GlobalApp) GetParent(ctx context.Context) (result *GlobalAppFolder, err error) { + hashedName := helper.GetHashedName("appfolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["appfolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetAppFolderByName(ctx, hashedName) +} + +// GetVersion returns child of given type +func (obj *GlobalApp) GetVersion(ctx context.Context) ( + result *GlobalAppVersion, err error) { + if obj.Spec.VersionGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.App", "Version") + } + return obj.client.Global().GetAppVersionByName(ctx, obj.Spec.VersionGvk.Name) +} + +// AddVersion calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalApp) AddVersion(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppVersion) (result *GlobalAppVersion, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["apps.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["apps.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAppVersionByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetAppByName(ctx, obj.GetName()) + if getErr == nil { + obj.App = updatedObj.App + } + return +} + +// DeleteVersion calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalApp) DeleteVersion(ctx context.Context) (err error) { + if obj.Spec.VersionGvk != nil { + err = obj.client. + Global().DeleteAppVersionByName(ctx, obj.Spec.VersionGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetAppByName(ctx, obj.GetName()) + if err == nil { + obj.App = updatedObj.App + } + return +} + +type appGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *appGlobalTsmV1Chainer) Subscribe() { + key := "apps.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAppInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *appGlobalTsmV1Chainer) Unsubscribe() { + key := "apps.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *appGlobalTsmV1Chainer) IsSubscribed() bool { + key := "apps.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *appGlobalTsmV1Chainer) Version(name string) *appversionGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["appversions.global.tsm.tanzu.vmware.com"] = name + return &appversionGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetVersion calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *appGlobalTsmV1Chainer) GetVersion(ctx context.Context, displayName string) (result *GlobalAppVersion, err error) { + hashedName := helper.GetHashedName("appversions.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAppVersionByName(ctx, hashedName) +} + +// AddVersion calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *appGlobalTsmV1Chainer) AddVersion(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppVersion) (result *GlobalAppVersion, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("appversions.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAppVersionByName(ctx, objToCreate) +} + +// DeleteVersion calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *appGlobalTsmV1Chainer) DeleteVersion(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("appversions.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAppVersionByName(ctx, hashedName) +} + +// GetApplicationInfoByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetApplicationInfoByName(ctx context.Context, hashedName string) (*GlobalApplicationInfo, error) { + key := "applicationinfos.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ApplicationInfo) + return &GlobalApplicationInfo{ + client: group.client, + ApplicationInfo: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ApplicationInfos().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalApplicationInfo{ + client: group.client, + ApplicationInfo: result, + }, nil + } +} + +// DeleteApplicationInfoByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteApplicationInfoByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ApplicationInfos().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ApplicationInfos().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/appsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["clusters.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Clusters().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateApplicationInfoByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateApplicationInfoByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ApplicationInfo) (*GlobalApplicationInfo, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ApplicationInfos().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["clusters.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"appsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ApplicationInfo\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Clusters().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalApplicationInfo{ + client: group.client, + ApplicationInfo: result, + }, nil +} + +// UpdateApplicationInfoByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateApplicationInfoByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ApplicationInfo) (*GlobalApplicationInfo, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ApplicationInfos().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueApp := + objToUpdate.Spec.App + patchOpApp := PatchOp{ + Op: "replace", + Path: "/spec/app", + Value: patchValueApp, + } + patch = append(patch, patchOpApp) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ApplicationInfos().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalApplicationInfo{ + client: group.client, + ApplicationInfo: result, + }, nil +} + +// ListApplicationInfos returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListApplicationInfos(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalApplicationInfo, err error) { + key := "applicationinfos.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalApplicationInfo, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ApplicationInfo) + result[k] = &GlobalApplicationInfo{ + client: group.client, + ApplicationInfo: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ApplicationInfos().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalApplicationInfo, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalApplicationInfo{ + client: group.client, + ApplicationInfo: &item, + } + } + } + return +} + +type GlobalApplicationInfo struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ApplicationInfo +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalApplicationInfo) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteApplicationInfoByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ApplicationInfo = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalApplicationInfo) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateApplicationInfoByName(ctx, obj.ApplicationInfo) + if err != nil { + return err + } + obj.ApplicationInfo = result.ApplicationInfo + return nil +} + +func (obj *GlobalApplicationInfo) GetParent(ctx context.Context) (result *GlobalCluster, err error) { + hashedName := helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["clusters.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetClusterByName(ctx, hashedName) +} + +type applicationinfoGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *applicationinfoGlobalTsmV1Chainer) Subscribe() { + key := "applicationinfos.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewApplicationInfoInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *applicationinfoGlobalTsmV1Chainer) Unsubscribe() { + key := "applicationinfos.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *applicationinfoGlobalTsmV1Chainer) IsSubscribed() bool { + key := "applicationinfos.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetAttackDiscoveryRTByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAttackDiscoveryRTByName(ctx context.Context, hashedName string) (*GlobalAttackDiscoveryRT, error) { + key := "attackdiscoveryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AttackDiscoveryRT) + return &GlobalAttackDiscoveryRT{ + client: group.client, + AttackDiscoveryRT: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AttackDiscoveryRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAttackDiscoveryRT{ + client: group.client, + AttackDiscoveryRT: result, + }, nil + } +} + +// DeleteAttackDiscoveryRTByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAttackDiscoveryRTByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AttackDiscoveryRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + AttackDiscoveryRTs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/attackDiscoveryGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAttackDiscoveryRTByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAttackDiscoveryRTByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AttackDiscoveryRT) (*GlobalAttackDiscoveryRT, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + AttackDiscoveryRTs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"attackDiscoveryGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"AttackDiscoveryRT\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAttackDiscoveryRT{ + client: group.client, + AttackDiscoveryRT: result, + }, nil +} + +// UpdateAttackDiscoveryRTByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAttackDiscoveryRTByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AttackDiscoveryRT) (*GlobalAttackDiscoveryRT, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AttackDiscoveryRTs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueGnsid := + objToUpdate.Spec.Gnsid + patchOpGnsid := PatchOp{ + Op: "replace", + Path: "/spec/gnsid", + Value: patchValueGnsid, + } + patch = append(patch, patchOpGnsid) + + patchValueSelectors := + objToUpdate.Spec.Selectors + patchOpSelectors := PatchOp{ + Op: "replace", + Path: "/spec/selectors", + Value: patchValueSelectors, + } + patch = append(patch, patchOpSelectors) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AttackDiscoveryRTs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAttackDiscoveryRT{ + client: group.client, + AttackDiscoveryRT: result, + }, nil +} + +// ListAttackDiscoveryRTs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAttackDiscoveryRTs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAttackDiscoveryRT, err error) { + key := "attackdiscoveryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAttackDiscoveryRT, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AttackDiscoveryRT) + result[k] = &GlobalAttackDiscoveryRT{ + client: group.client, + AttackDiscoveryRT: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AttackDiscoveryRTs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAttackDiscoveryRT, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAttackDiscoveryRT{ + client: group.client, + AttackDiscoveryRT: &item, + } + } + } + return +} + +type GlobalAttackDiscoveryRT struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AttackDiscoveryRT +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAttackDiscoveryRT) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAttackDiscoveryRTByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AttackDiscoveryRT = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAttackDiscoveryRT) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAttackDiscoveryRTByName(ctx, obj.AttackDiscoveryRT) + if err != nil { + return err + } + obj.AttackDiscoveryRT = result.AttackDiscoveryRT + return nil +} + +func (obj *GlobalAttackDiscoveryRT) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type attackdiscoveryrtGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *attackdiscoveryrtGlobalTsmV1Chainer) Subscribe() { + key := "attackdiscoveryrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAttackDiscoveryRTInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *attackdiscoveryrtGlobalTsmV1Chainer) Unsubscribe() { + key := "attackdiscoveryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *attackdiscoveryrtGlobalTsmV1Chainer) IsSubscribed() bool { + key := "attackdiscoveryrts.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetAttackDiscoveryByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAttackDiscoveryByName(ctx context.Context, hashedName string) (*GlobalAttackDiscovery, error) { + key := "attackdiscoveries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AttackDiscovery) + return &GlobalAttackDiscovery{ + client: group.client, + AttackDiscovery: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AttackDiscoveries().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAttackDiscovery{ + client: group.client, + AttackDiscovery: result, + }, nil + } +} + +// DeleteAttackDiscoveryByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAttackDiscoveryByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AttackDiscoveries().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + AttackDiscoveries().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/attackDiscoveryGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAttackDiscoveryByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAttackDiscoveryByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AttackDiscovery) (*GlobalAttackDiscovery, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + AttackDiscoveries().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"attackDiscoveryGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"AttackDiscovery\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAttackDiscovery{ + client: group.client, + AttackDiscovery: result, + }, nil +} + +// UpdateAttackDiscoveryByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAttackDiscoveryByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AttackDiscovery) (*GlobalAttackDiscovery, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AttackDiscoveries().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AttackDiscoveries().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAttackDiscovery{ + client: group.client, + AttackDiscovery: result, + }, nil +} + +// ListAttackDiscoveries returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAttackDiscoveries(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAttackDiscovery, err error) { + key := "attackdiscoveries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAttackDiscovery, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AttackDiscovery) + result[k] = &GlobalAttackDiscovery{ + client: group.client, + AttackDiscovery: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AttackDiscoveries().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAttackDiscovery, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAttackDiscovery{ + client: group.client, + AttackDiscovery: &item, + } + } + } + return +} + +type GlobalAttackDiscovery struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AttackDiscovery +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAttackDiscovery) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAttackDiscoveryByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AttackDiscovery = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAttackDiscovery) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAttackDiscoveryByName(ctx, obj.AttackDiscovery) + if err != nil { + return err + } + obj.AttackDiscovery = result.AttackDiscovery + return nil +} + +func (obj *GlobalAttackDiscovery) GetParent(ctx context.Context) (result *GlobalGNS, err error) { + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnss.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGNSByName(ctx, hashedName) +} + +type attackdiscoveryGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *attackdiscoveryGlobalTsmV1Chainer) Subscribe() { + key := "attackdiscoveries.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAttackDiscoveryInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *attackdiscoveryGlobalTsmV1Chainer) Unsubscribe() { + key := "attackdiscoveries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *attackdiscoveryGlobalTsmV1Chainer) IsSubscribed() bool { + key := "attackdiscoveries.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetAuthenticationPolicyByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAuthenticationPolicyByName(ctx context.Context, hashedName string) (*GlobalAuthenticationPolicy, error) { + key := "authenticationpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AuthenticationPolicy) + return &GlobalAuthenticationPolicy{ + client: group.client, + AuthenticationPolicy: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AuthenticationPolicies().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAuthenticationPolicy{ + client: group.client, + AuthenticationPolicy: result, + }, nil + } +} + +// DeleteAuthenticationPolicyByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAuthenticationPolicyByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AuthenticationPolicies().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + AuthenticationPolicies().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/authenticationPoliciesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAuthenticationPolicyByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAuthenticationPolicyByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AuthenticationPolicy) (*GlobalAuthenticationPolicy, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + AuthenticationPolicies().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"authenticationPoliciesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"AuthenticationPolicy\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAuthenticationPolicy{ + client: group.client, + AuthenticationPolicy: result, + }, nil +} + +// UpdateAuthenticationPolicyByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAuthenticationPolicyByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AuthenticationPolicy) (*GlobalAuthenticationPolicy, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AuthenticationPolicies().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueAnnotations := + objToUpdate.Spec.Annotations + patchOpAnnotations := PatchOp{ + Op: "replace", + Path: "/spec/annotations", + Value: patchValueAnnotations, + } + patch = append(patch, patchOpAnnotations) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AuthenticationPolicies().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAuthenticationPolicy{ + client: group.client, + AuthenticationPolicy: result, + }, nil +} + +// ListAuthenticationPolicies returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAuthenticationPolicies(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAuthenticationPolicy, err error) { + key := "authenticationpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAuthenticationPolicy, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AuthenticationPolicy) + result[k] = &GlobalAuthenticationPolicy{ + client: group.client, + AuthenticationPolicy: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AuthenticationPolicies().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAuthenticationPolicy, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAuthenticationPolicy{ + client: group.client, + AuthenticationPolicy: &item, + } + } + } + return +} + +type GlobalAuthenticationPolicy struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AuthenticationPolicy +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAuthenticationPolicy) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAuthenticationPolicyByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AuthenticationPolicy = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAuthenticationPolicy) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAuthenticationPolicyByName(ctx, obj.AuthenticationPolicy) + if err != nil { + return err + } + obj.AuthenticationPolicy = result.AuthenticationPolicy + return nil +} + +func (obj *GlobalAuthenticationPolicy) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +type authenticationpolicyGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *authenticationpolicyGlobalTsmV1Chainer) Subscribe() { + key := "authenticationpolicies.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAuthenticationPolicyInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *authenticationpolicyGlobalTsmV1Chainer) Unsubscribe() { + key := "authenticationpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *authenticationpolicyGlobalTsmV1Chainer) IsSubscribed() bool { + key := "authenticationpolicies.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetAutoscalerFolderByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAutoscalerFolderByName(ctx context.Context, hashedName string) (*GlobalAutoscalerFolder, error) { + key := "autoscalerfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AutoscalerFolder) + return &GlobalAutoscalerFolder{ + client: group.client, + AutoscalerFolder: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalerFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAutoscalerFolder{ + client: group.client, + AutoscalerFolder: result, + }, nil + } +} + +// DeleteAutoscalerFolderByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAutoscalerFolderByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalerFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.AutoscalersGvk { + err := group.client. + Global().DeleteAutoscalerByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + AutoscalerFolders().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/autoscalerFolderGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAutoscalerFolderByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAutoscalerFolderByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AutoscalerFolder) (*GlobalAutoscalerFolder, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.AutoscalersGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalerFolders().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/autoscalerFolderGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "AutoscalerFolder", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAutoscalerFolder{ + client: group.client, + AutoscalerFolder: result, + }, nil +} + +// UpdateAutoscalerFolderByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAutoscalerFolderByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AutoscalerFolder) (*GlobalAutoscalerFolder, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalerFolders().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalerFolders().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAutoscalerFolder{ + client: group.client, + AutoscalerFolder: result, + }, nil +} + +// ListAutoscalerFolders returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAutoscalerFolders(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAutoscalerFolder, err error) { + key := "autoscalerfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAutoscalerFolder, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AutoscalerFolder) + result[k] = &GlobalAutoscalerFolder{ + client: group.client, + AutoscalerFolder: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AutoscalerFolders().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAutoscalerFolder, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAutoscalerFolder{ + client: group.client, + AutoscalerFolder: &item, + } + } + } + return +} + +type GlobalAutoscalerFolder struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AutoscalerFolder +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAutoscalerFolder) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAutoscalerFolderByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AutoscalerFolder = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAutoscalerFolder) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAutoscalerFolderByName(ctx, obj.AutoscalerFolder) + if err != nil { + return err + } + obj.AutoscalerFolder = result.AutoscalerFolder + return nil +} + +func (obj *GlobalAutoscalerFolder) GetParent(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetConfigByName(ctx, hashedName) +} + +// GetAllAutoscalers returns all children of given type +func (obj *GlobalAutoscalerFolder) GetAllAutoscalers(ctx context.Context) ( + result []*GlobalAutoscaler, err error) { + result = make([]*GlobalAutoscaler, 0, len(obj.Spec.AutoscalersGvk)) + for _, v := range obj.Spec.AutoscalersGvk { + l, err := obj.client.Global().GetAutoscalerByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetAutoscalers returns child which has given displayName +func (obj *GlobalAutoscalerFolder) GetAutoscalers(ctx context.Context, + displayName string) (result *GlobalAutoscaler, err error) { + l, ok := obj.Spec.AutoscalersGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.AutoscalerFolder", "Autoscalers", displayName) + } + result, err = obj.client.Global().GetAutoscalerByName(ctx, l.Name) + return +} + +// AddAutoscalers calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalAutoscalerFolder) AddAutoscalers(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Autoscaler) (result *GlobalAutoscaler, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["autoscalerfolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["autoscalerfolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAutoscalerByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetAutoscalerFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.AutoscalerFolder = updatedObj.AutoscalerFolder + } + return +} + +// DeleteAutoscalers calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalAutoscalerFolder) DeleteAutoscalers(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.AutoscalersGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.AutoscalerFolder", "Autoscalers", displayName) + } + err = obj.client.Global().DeleteAutoscalerByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetAutoscalerFolderByName(ctx, obj.GetName()) + if err == nil { + obj.AutoscalerFolder = updatedObj.AutoscalerFolder + } + return +} + +type autoscalerfolderGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *autoscalerfolderGlobalTsmV1Chainer) Subscribe() { + key := "autoscalerfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAutoscalerFolderInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *autoscalerfolderGlobalTsmV1Chainer) Unsubscribe() { + key := "autoscalerfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *autoscalerfolderGlobalTsmV1Chainer) IsSubscribed() bool { + key := "autoscalerfolders.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *autoscalerfolderGlobalTsmV1Chainer) Autoscalers(name string) *autoscalerGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["autoscalers.global.tsm.tanzu.vmware.com"] = name + return &autoscalerGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetAutoscalers calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *autoscalerfolderGlobalTsmV1Chainer) GetAutoscalers(ctx context.Context, displayName string) (result *GlobalAutoscaler, err error) { + hashedName := helper.GetHashedName("autoscalers.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAutoscalerByName(ctx, hashedName) +} + +// AddAutoscalers calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *autoscalerfolderGlobalTsmV1Chainer) AddAutoscalers(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Autoscaler) (result *GlobalAutoscaler, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("autoscalers.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAutoscalerByName(ctx, objToCreate) +} + +// DeleteAutoscalers calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *autoscalerfolderGlobalTsmV1Chainer) DeleteAutoscalers(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("autoscalers.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAutoscalerByName(ctx, hashedName) +} + +// GetAutoscalerConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAutoscalerConfigByName(ctx context.Context, hashedName string) (*GlobalAutoscalerConfig, error) { + key := "autoscalerconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AutoscalerConfig) + return &GlobalAutoscalerConfig{ + client: group.client, + AutoscalerConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalerConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAutoscalerConfig{ + client: group.client, + AutoscalerConfig: result, + }, nil + } +} + +// DeleteAutoscalerConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAutoscalerConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalerConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + AutoscalerConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/autoscalersGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAutoscalerConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAutoscalerConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AutoscalerConfig) (*GlobalAutoscalerConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalerConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"autoscalersGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"AutoscalerConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAutoscalerConfig{ + client: group.client, + AutoscalerConfig: result, + }, nil +} + +// UpdateAutoscalerConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAutoscalerConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AutoscalerConfig) (*GlobalAutoscalerConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalerConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueConfigSource := + objToUpdate.Spec.ConfigSource + patchOpConfigSource := PatchOp{ + Op: "replace", + Path: "/spec/configSource", + Value: patchValueConfigSource, + } + patch = append(patch, patchOpConfigSource) + + patchValueDesiredState := + objToUpdate.Spec.DesiredState + patchOpDesiredState := PatchOp{ + Op: "replace", + Path: "/spec/desiredState", + Value: patchValueDesiredState, + } + patch = append(patch, patchOpDesiredState) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalerConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAutoscalerConfig{ + client: group.client, + AutoscalerConfig: result, + }, nil +} + +// ListAutoscalerConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAutoscalerConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAutoscalerConfig, err error) { + key := "autoscalerconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAutoscalerConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AutoscalerConfig) + result[k] = &GlobalAutoscalerConfig{ + client: group.client, + AutoscalerConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AutoscalerConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAutoscalerConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAutoscalerConfig{ + client: group.client, + AutoscalerConfig: &item, + } + } + } + return +} + +type GlobalAutoscalerConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AutoscalerConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAutoscalerConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAutoscalerConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AutoscalerConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAutoscalerConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAutoscalerConfigByName(ctx, obj.AutoscalerConfig) + if err != nil { + return err + } + obj.AutoscalerConfig = result.AutoscalerConfig + return nil +} + +func (obj *GlobalAutoscalerConfig) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type autoscalerconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *autoscalerconfigGlobalTsmV1Chainer) Subscribe() { + key := "autoscalerconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAutoscalerConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *autoscalerconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "autoscalerconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *autoscalerconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "autoscalerconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetAutoscalerByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAutoscalerByName(ctx context.Context, hashedName string) (*GlobalAutoscaler, error) { + key := "autoscalers.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Autoscaler) + return &GlobalAutoscaler{ + client: group.client, + Autoscaler: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Autoscalers().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAutoscaler{ + client: group.client, + Autoscaler: result, + }, nil + } +} + +// DeleteAutoscalerByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAutoscalerByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Autoscalers().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + Autoscalers().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/autoscalersGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["autoscalerfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("autoscalerfolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + AutoscalerFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAutoscalerByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAutoscalerByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Autoscaler) (*GlobalAutoscaler, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.AutoscalerGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + Autoscalers().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["autoscalerfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("autoscalerfolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"autoscalersGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"Autoscaler\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + AutoscalerFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAutoscaler{ + client: group.client, + Autoscaler: result, + }, nil +} + +// UpdateAutoscalerByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAutoscalerByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Autoscaler) (*GlobalAutoscaler, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Autoscalers().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueProjectId := + objToUpdate.Spec.ProjectId + patchOpProjectId := PatchOp{ + Op: "replace", + Path: "/spec/projectId", + Value: patchValueProjectId, + } + patch = append(patch, patchOpProjectId) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Autoscalers().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAutoscaler{ + client: group.client, + Autoscaler: result, + }, nil +} + +// ListAutoscalers returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAutoscalers(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAutoscaler, err error) { + key := "autoscalers.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAutoscaler, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Autoscaler) + result[k] = &GlobalAutoscaler{ + client: group.client, + Autoscaler: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Autoscalers().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAutoscaler, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAutoscaler{ + client: group.client, + Autoscaler: &item, + } + } + } + return +} + +type GlobalAutoscaler struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Autoscaler +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAutoscaler) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAutoscalerByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Autoscaler = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAutoscaler) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAutoscalerByName(ctx, obj.Autoscaler) + if err != nil { + return err + } + obj.Autoscaler = result.Autoscaler + return nil +} + +func (obj *GlobalAutoscaler) GetParent(ctx context.Context) (result *GlobalAutoscalerFolder, err error) { + hashedName := helper.GetHashedName("autoscalerfolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["autoscalerfolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetAutoscalerFolderByName(ctx, hashedName) +} + +// GetAutoscaler returns link of given type +func (obj *GlobalAutoscaler) GetAutoscaler(ctx context.Context) ( + result *GlobalAutoscalerCR, err error) { + if obj.Spec.AutoscalerGvk == nil { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.Autoscaler", "Autoscaler") + } + return obj.client.Global().GetAutoscalerCRByName(ctx, obj.Spec.AutoscalerGvk.Name) +} + +// LinkAutoscaler links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalAutoscaler) LinkAutoscaler(ctx context.Context, + linkToAdd *GlobalAutoscalerCR) error { + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/autoscalerGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "AutoscalerCR", + Name: linkToAdd.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Autoscalers().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.Autoscaler = result + return nil +} + +// UnlinkAutoscaler unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalAutoscaler) UnlinkAutoscaler(ctx context.Context) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/autoscalerGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Autoscalers().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.Autoscaler = result + return nil + +} + +type autoscalerGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *autoscalerGlobalTsmV1Chainer) Subscribe() { + key := "autoscalers.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAutoscalerInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *autoscalerGlobalTsmV1Chainer) Unsubscribe() { + key := "autoscalers.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *autoscalerGlobalTsmV1Chainer) IsSubscribed() bool { + key := "autoscalers.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetAutoscalerCRByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAutoscalerCRByName(ctx context.Context, hashedName string) (*GlobalAutoscalerCR, error) { + key := "autoscalercrs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AutoscalerCR) + return &GlobalAutoscalerCR{ + client: group.client, + AutoscalerCR: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalerCRs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAutoscalerCR{ + client: group.client, + AutoscalerCR: result, + }, nil + } +} + +// DeleteAutoscalerCRByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAutoscalerCRByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalerCRs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + AutoscalerCRs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/autoscalersGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAutoscalerCRByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAutoscalerCRByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AutoscalerCR) (*GlobalAutoscalerCR, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalerCRs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"autoscalersGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"AutoscalerCR\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAutoscalerCR{ + client: group.client, + AutoscalerCR: result, + }, nil +} + +// UpdateAutoscalerCRByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAutoscalerCRByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AutoscalerCR) (*GlobalAutoscalerCR, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalerCRs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueAutoscalingDefinition := + objToUpdate.Spec.AutoscalingDefinition + patchOpAutoscalingDefinition := PatchOp{ + Op: "replace", + Path: "/spec/autoscalingDefinition", + Value: patchValueAutoscalingDefinition, + } + patch = append(patch, patchOpAutoscalingDefinition) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalerCRs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAutoscalerCR{ + client: group.client, + AutoscalerCR: result, + }, nil +} + +// ListAutoscalerCRs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAutoscalerCRs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAutoscalerCR, err error) { + key := "autoscalercrs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAutoscalerCR, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AutoscalerCR) + result[k] = &GlobalAutoscalerCR{ + client: group.client, + AutoscalerCR: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AutoscalerCRs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAutoscalerCR, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAutoscalerCR{ + client: group.client, + AutoscalerCR: &item, + } + } + } + return +} + +type GlobalAutoscalerCR struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AutoscalerCR +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAutoscalerCR) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAutoscalerCRByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AutoscalerCR = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAutoscalerCR) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAutoscalerCRByName(ctx, obj.AutoscalerCR) + if err != nil { + return err + } + obj.AutoscalerCR = result.AutoscalerCR + return nil +} + +func (obj *GlobalAutoscalerCR) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +type autoscalercrGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *autoscalercrGlobalTsmV1Chainer) Subscribe() { + key := "autoscalercrs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAutoscalerCRInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *autoscalercrGlobalTsmV1Chainer) Unsubscribe() { + key := "autoscalercrs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *autoscalercrGlobalTsmV1Chainer) IsSubscribed() bool { + key := "autoscalercrs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetAutoscalingPolicyByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAutoscalingPolicyByName(ctx context.Context, hashedName string) (*GlobalAutoscalingPolicy, error) { + key := "autoscalingpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AutoscalingPolicy) + return &GlobalAutoscalingPolicy{ + client: group.client, + AutoscalingPolicy: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalingPolicies().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAutoscalingPolicy{ + client: group.client, + AutoscalingPolicy: result, + }, nil + } +} + +// DeleteAutoscalingPolicyByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAutoscalingPolicyByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalingPolicies().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + AutoscalingPolicies().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/autoscalingPoliciesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAutoscalingPolicyByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAutoscalingPolicyByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AutoscalingPolicy) (*GlobalAutoscalingPolicy, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalingPolicies().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"autoscalingPoliciesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"AutoscalingPolicy\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAutoscalingPolicy{ + client: group.client, + AutoscalingPolicy: result, + }, nil +} + +// UpdateAutoscalingPolicyByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAutoscalingPolicyByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AutoscalingPolicy) (*GlobalAutoscalingPolicy, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalingPolicies().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueServiceName := + objToUpdate.Spec.ServiceName + patchOpServiceName := PatchOp{ + Op: "replace", + Path: "/spec/serviceName", + Value: patchValueServiceName, + } + patch = append(patch, patchOpServiceName) + + patchValueAutoscalerSpec := + objToUpdate.Spec.AutoscalerSpec + patchOpAutoscalerSpec := PatchOp{ + Op: "replace", + Path: "/spec/autoscalerSpec", + Value: patchValueAutoscalerSpec, + } + patch = append(patch, patchOpAutoscalerSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AutoscalingPolicies().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAutoscalingPolicy{ + client: group.client, + AutoscalingPolicy: result, + }, nil +} + +// ListAutoscalingPolicies returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAutoscalingPolicies(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAutoscalingPolicy, err error) { + key := "autoscalingpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAutoscalingPolicy, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AutoscalingPolicy) + result[k] = &GlobalAutoscalingPolicy{ + client: group.client, + AutoscalingPolicy: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AutoscalingPolicies().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAutoscalingPolicy, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAutoscalingPolicy{ + client: group.client, + AutoscalingPolicy: &item, + } + } + } + return +} + +type GlobalAutoscalingPolicy struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AutoscalingPolicy +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAutoscalingPolicy) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAutoscalingPolicyByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AutoscalingPolicy = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAutoscalingPolicy) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAutoscalingPolicyByName(ctx, obj.AutoscalingPolicy) + if err != nil { + return err + } + obj.AutoscalingPolicy = result.AutoscalingPolicy + return nil +} + +func (obj *GlobalAutoscalingPolicy) GetParent(ctx context.Context) (result *GlobalGNS, err error) { + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnss.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGNSByName(ctx, hashedName) +} + +type autoscalingpolicyGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *autoscalingpolicyGlobalTsmV1Chainer) Subscribe() { + key := "autoscalingpolicies.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAutoscalingPolicyInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *autoscalingpolicyGlobalTsmV1Chainer) Unsubscribe() { + key := "autoscalingpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *autoscalingpolicyGlobalTsmV1Chainer) IsSubscribed() bool { + key := "autoscalingpolicies.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetAwsConnectorByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAwsConnectorByName(ctx context.Context, hashedName string) (*GlobalAwsConnector, error) { + key := "awsconnectors.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AwsConnector) + return &GlobalAwsConnector{ + client: group.client, + AwsConnector: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AwsConnectors().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAwsConnector{ + client: group.client, + AwsConnector: result, + }, nil + } +} + +// DeleteAwsConnectorByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAwsConnectorByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AwsConnectors().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.GnsGvk { + err := group.client. + Global().DeleteGlobalNsByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + AwsConnectors().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/awsConnectorGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["allsparkserviceses.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("allsparkserviceses.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + AllSparkServiceses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAwsConnectorByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAwsConnectorByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AwsConnector) (*GlobalAwsConnector, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] == "" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.Labels[common.DISPLAY_NAME_LABEL]) + } + + objToCreate.Spec.GnsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + AwsConnectors().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["allsparkserviceses.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("allsparkserviceses.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/awsConnectorGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "AwsConnector", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + AllSparkServiceses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAwsConnector{ + client: group.client, + AwsConnector: result, + }, nil +} + +// UpdateAwsConnectorByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAwsConnectorByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AwsConnector) (*GlobalAwsConnector, error) { + if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) + } + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AwsConnectors().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AwsConnectors().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAwsConnector{ + client: group.client, + AwsConnector: result, + }, nil +} + +// ListAwsConnectors returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAwsConnectors(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAwsConnector, err error) { + key := "awsconnectors.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAwsConnector, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AwsConnector) + result[k] = &GlobalAwsConnector{ + client: group.client, + AwsConnector: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AwsConnectors().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAwsConnector, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAwsConnector{ + client: group.client, + AwsConnector: &item, + } + } + } + return +} + +type GlobalAwsConnector struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AwsConnector +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAwsConnector) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAwsConnectorByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AwsConnector = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAwsConnector) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAwsConnectorByName(ctx, obj.AwsConnector) + if err != nil { + return err + } + obj.AwsConnector = result.AwsConnector + return nil +} + +func (obj *GlobalAwsConnector) GetParent(ctx context.Context) (result *GlobalAllSparkServices, err error) { + hashedName := helper.GetHashedName("allsparkserviceses.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["allsparkserviceses.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetAllSparkServicesByName(ctx, hashedName) +} + +// GetAllGns returns all children of given type +func (obj *GlobalAwsConnector) GetAllGns(ctx context.Context) ( + result []*GlobalGlobalNs, err error) { + result = make([]*GlobalGlobalNs, 0, len(obj.Spec.GnsGvk)) + for _, v := range obj.Spec.GnsGvk { + l, err := obj.client.Global().GetGlobalNsByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGns returns child which has given displayName +func (obj *GlobalAwsConnector) GetGns(ctx context.Context, + displayName string) (result *GlobalGlobalNs, err error) { + l, ok := obj.Spec.GnsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.AwsConnector", "Gns", displayName) + } + result, err = obj.client.Global().GetGlobalNsByName(ctx, l.Name) + return +} + +// AddGns calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalAwsConnector) AddGns(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GlobalNs) (result *GlobalGlobalNs, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["awsconnectors.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["awsconnectors.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGlobalNsByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetAwsConnectorByName(ctx, obj.GetName()) + if getErr == nil { + obj.AwsConnector = updatedObj.AwsConnector + } + return +} + +// DeleteGns calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalAwsConnector) DeleteGns(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GnsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.AwsConnector", "Gns", displayName) + } + err = obj.client.Global().DeleteGlobalNsByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetAwsConnectorByName(ctx, obj.GetName()) + if err == nil { + obj.AwsConnector = updatedObj.AwsConnector + } + return +} + +type awsconnectorGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *awsconnectorGlobalTsmV1Chainer) Subscribe() { + key := "awsconnectors.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAwsConnectorInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *awsconnectorGlobalTsmV1Chainer) Unsubscribe() { + key := "awsconnectors.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *awsconnectorGlobalTsmV1Chainer) IsSubscribed() bool { + key := "awsconnectors.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *awsconnectorGlobalTsmV1Chainer) Gns(name string) *globalnsGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["globalnses.global.tsm.tanzu.vmware.com"] = name + return &globalnsGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGns calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *awsconnectorGlobalTsmV1Chainer) GetGns(ctx context.Context, displayName string) (result *GlobalGlobalNs, err error) { + hashedName := helper.GetHashedName("globalnses.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGlobalNsByName(ctx, hashedName) +} + +// AddGns calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *awsconnectorGlobalTsmV1Chainer) AddGns(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GlobalNs) (result *GlobalGlobalNs, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("globalnses.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGlobalNsByName(ctx, objToCreate) +} + +// DeleteGns calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *awsconnectorGlobalTsmV1Chainer) DeleteGns(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("globalnses.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGlobalNsByName(ctx, hashedName) +} + +// GetBucketByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetBucketByName(ctx context.Context, hashedName string) (*GlobalBucket, error) { + key := "buckets.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Bucket) + return &GlobalBucket{ + client: group.client, + Bucket: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Buckets().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalBucket{ + client: group.client, + Bucket: result, + }, nil + } +} + +// DeleteBucketByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteBucketByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Buckets().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + Buckets().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/bucketsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["databases.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("databases.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Databases().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateBucketByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateBucketByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Bucket) (*GlobalBucket, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.TemplateGvk = nil + objToCreate.Spec.InventoryGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + Buckets().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["databases.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("databases.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"bucketsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"Bucket\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Databases().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalBucket{ + client: group.client, + Bucket: result, + }, nil +} + +// UpdateBucketByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateBucketByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Bucket) (*GlobalBucket, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Buckets().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Buckets().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalBucket{ + client: group.client, + Bucket: result, + }, nil +} + +// ListBuckets returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListBuckets(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalBucket, err error) { + key := "buckets.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalBucket, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Bucket) + result[k] = &GlobalBucket{ + client: group.client, + Bucket: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Buckets().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalBucket, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalBucket{ + client: group.client, + Bucket: &item, + } + } + } + return +} + +type GlobalBucket struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Bucket +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalBucket) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteBucketByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Bucket = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalBucket) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateBucketByName(ctx, obj.Bucket) + if err != nil { + return err + } + obj.Bucket = result.Bucket + return nil +} + +func (obj *GlobalBucket) GetParent(ctx context.Context) (result *GlobalDatabase, err error) { + hashedName := helper.GetHashedName("databases.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["databases.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDatabaseByName(ctx, hashedName) +} + +// GetTemplate returns link of given type +func (obj *GlobalBucket) GetTemplate(ctx context.Context) ( + result *GlobalTemplate, err error) { + if obj.Spec.TemplateGvk == nil { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.Bucket", "Template") + } + return obj.client.Global().GetTemplateByName(ctx, obj.Spec.TemplateGvk.Name) +} + +// LinkTemplate links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalBucket) LinkTemplate(ctx context.Context, + linkToAdd *GlobalTemplate) error { + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/templateGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "Template", + Name: linkToAdd.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Buckets().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.Bucket = result + return nil +} + +// UnlinkTemplate unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalBucket) UnlinkTemplate(ctx context.Context) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/templateGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Buckets().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.Bucket = result + return nil + +} + +// GetInventory returns link of given type +func (obj *GlobalBucket) GetInventory(ctx context.Context) ( + result *GlobalInventory, err error) { + if obj.Spec.InventoryGvk == nil { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.Bucket", "Inventory") + } + return obj.client.Global().GetInventoryByName(ctx, obj.Spec.InventoryGvk.Name) +} + +// LinkInventory links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalBucket) LinkInventory(ctx context.Context, + linkToAdd *GlobalInventory) error { + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/inventoryGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "Inventory", + Name: linkToAdd.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Buckets().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.Bucket = result + return nil +} + +// UnlinkInventory unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalBucket) UnlinkInventory(ctx context.Context) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/inventoryGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Buckets().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.Bucket = result + return nil + +} + +type bucketGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *bucketGlobalTsmV1Chainer) Subscribe() { + key := "buckets.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewBucketInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *bucketGlobalTsmV1Chainer) Unsubscribe() { + key := "buckets.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *bucketGlobalTsmV1Chainer) IsSubscribed() bool { + key := "buckets.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetCertificateAuthorityRTByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetCertificateAuthorityRTByName(ctx context.Context, hashedName string) (*GlobalCertificateAuthorityRT, error) { + key := "certificateauthorityrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.CertificateAuthorityRT) + return &GlobalCertificateAuthorityRT{ + client: group.client, + CertificateAuthorityRT: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + CertificateAuthorityRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalCertificateAuthorityRT{ + client: group.client, + CertificateAuthorityRT: result, + }, nil + } +} + +// DeleteCertificateAuthorityRTByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteCertificateAuthorityRTByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + CertificateAuthorityRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + CertificateAuthorityRTs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/certificateAuthorityGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateCertificateAuthorityRTByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateCertificateAuthorityRTByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.CertificateAuthorityRT) (*GlobalCertificateAuthorityRT, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + CertificateAuthorityRTs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"certificateAuthorityGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"CertificateAuthorityRT\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalCertificateAuthorityRT{ + client: group.client, + CertificateAuthorityRT: result, + }, nil +} + +// UpdateCertificateAuthorityRTByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateCertificateAuthorityRTByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.CertificateAuthorityRT) (*GlobalCertificateAuthorityRT, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + CertificateAuthorityRTs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueUrl := + objToUpdate.Spec.Url + patchOpUrl := PatchOp{ + Op: "replace", + Path: "/spec/url", + Value: patchValueUrl, + } + patch = append(patch, patchOpUrl) + + patchValueType := + objToUpdate.Spec.Type + patchOpType := PatchOp{ + Op: "replace", + Path: "/spec/type", + Value: patchValueType, + } + patch = append(patch, patchOpType) + + patchValueTemplatePath := + objToUpdate.Spec.TemplatePath + patchOpTemplatePath := PatchOp{ + Op: "replace", + Path: "/spec/templatePath", + Value: patchValueTemplatePath, + } + patch = append(patch, patchOpTemplatePath) + + patchValueSecretRef := + objToUpdate.Spec.SecretRef + patchOpSecretRef := PatchOp{ + Op: "replace", + Path: "/spec/secretRef", + Value: patchValueSecretRef, + } + patch = append(patch, patchOpSecretRef) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + CertificateAuthorityRTs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalCertificateAuthorityRT{ + client: group.client, + CertificateAuthorityRT: result, + }, nil +} + +// ListCertificateAuthorityRTs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListCertificateAuthorityRTs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalCertificateAuthorityRT, err error) { + key := "certificateauthorityrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalCertificateAuthorityRT, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.CertificateAuthorityRT) + result[k] = &GlobalCertificateAuthorityRT{ + client: group.client, + CertificateAuthorityRT: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + CertificateAuthorityRTs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalCertificateAuthorityRT, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalCertificateAuthorityRT{ + client: group.client, + CertificateAuthorityRT: &item, + } + } + } + return +} + +type GlobalCertificateAuthorityRT struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.CertificateAuthorityRT +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalCertificateAuthorityRT) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteCertificateAuthorityRTByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.CertificateAuthorityRT = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalCertificateAuthorityRT) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateCertificateAuthorityRTByName(ctx, obj.CertificateAuthorityRT) + if err != nil { + return err + } + obj.CertificateAuthorityRT = result.CertificateAuthorityRT + return nil +} + +func (obj *GlobalCertificateAuthorityRT) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type certificateauthorityrtGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *certificateauthorityrtGlobalTsmV1Chainer) Subscribe() { + key := "certificateauthorityrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewCertificateAuthorityRTInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *certificateauthorityrtGlobalTsmV1Chainer) Unsubscribe() { + key := "certificateauthorityrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *certificateauthorityrtGlobalTsmV1Chainer) IsSubscribed() bool { + key := "certificateauthorityrts.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetCertificateAuthorityConfigNByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetCertificateAuthorityConfigNByName(ctx context.Context, hashedName string) (*GlobalCertificateAuthorityConfigN, error) { + key := "certificateauthorityconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN) + return &GlobalCertificateAuthorityConfigN{ + client: group.client, + CertificateAuthorityConfigN: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + CertificateAuthorityConfigNs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalCertificateAuthorityConfigN{ + client: group.client, + CertificateAuthorityConfigN: result, + }, nil + } +} + +// DeleteCertificateAuthorityConfigNByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteCertificateAuthorityConfigNByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + CertificateAuthorityConfigNs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + CertificateAuthorityConfigNs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/certificateAuthoritiesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["projectconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("projectconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ProjectConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateCertificateAuthorityConfigNByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateCertificateAuthorityConfigNByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN) (*GlobalCertificateAuthorityConfigN, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + CertificateAuthorityConfigNs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["projectconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("projectconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"certificateAuthoritiesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"CertificateAuthorityConfigN\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ProjectConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalCertificateAuthorityConfigN{ + client: group.client, + CertificateAuthorityConfigN: result, + }, nil +} + +// UpdateCertificateAuthorityConfigNByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateCertificateAuthorityConfigNByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN) (*GlobalCertificateAuthorityConfigN, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + CertificateAuthorityConfigNs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueConfig := + objToUpdate.Spec.Config + patchOpConfig := PatchOp{ + Op: "replace", + Path: "/spec/config", + Value: patchValueConfig, + } + patch = append(patch, patchOpConfig) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + CertificateAuthorityConfigNs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalCertificateAuthorityConfigN{ + client: group.client, + CertificateAuthorityConfigN: result, + }, nil +} + +// ListCertificateAuthorityConfigNs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListCertificateAuthorityConfigNs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalCertificateAuthorityConfigN, err error) { + key := "certificateauthorityconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalCertificateAuthorityConfigN, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN) + result[k] = &GlobalCertificateAuthorityConfigN{ + client: group.client, + CertificateAuthorityConfigN: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + CertificateAuthorityConfigNs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalCertificateAuthorityConfigN, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalCertificateAuthorityConfigN{ + client: group.client, + CertificateAuthorityConfigN: &item, + } + } + } + return +} + +type GlobalCertificateAuthorityConfigN struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalCertificateAuthorityConfigN) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteCertificateAuthorityConfigNByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.CertificateAuthorityConfigN = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalCertificateAuthorityConfigN) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateCertificateAuthorityConfigNByName(ctx, obj.CertificateAuthorityConfigN) + if err != nil { + return err + } + obj.CertificateAuthorityConfigN = result.CertificateAuthorityConfigN + return nil +} + +func (obj *GlobalCertificateAuthorityConfigN) GetParent(ctx context.Context) (result *GlobalProjectConfig, err error) { + hashedName := helper.GetHashedName("projectconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["projectconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetProjectConfigByName(ctx, hashedName) +} + +type certificateauthorityconfignGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *certificateauthorityconfignGlobalTsmV1Chainer) Subscribe() { + key := "certificateauthorityconfigns.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewCertificateAuthorityConfigNInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *certificateauthorityconfignGlobalTsmV1Chainer) Unsubscribe() { + key := "certificateauthorityconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *certificateauthorityconfignGlobalTsmV1Chainer) IsSubscribed() bool { + key := "certificateauthorityconfigns.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetCertificateConfigNByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetCertificateConfigNByName(ctx context.Context, hashedName string) (*GlobalCertificateConfigN, error) { + key := "certificateconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.CertificateConfigN) + return &GlobalCertificateConfigN{ + client: group.client, + CertificateConfigN: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + CertificateConfigNs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalCertificateConfigN{ + client: group.client, + CertificateConfigN: result, + }, nil + } +} + +// DeleteCertificateConfigNByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteCertificateConfigNByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + CertificateConfigNs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + CertificateConfigNs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/certificatesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateCertificateConfigNByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateCertificateConfigNByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.CertificateConfigN) (*GlobalCertificateConfigN, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + CertificateConfigNs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"certificatesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"CertificateConfigN\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalCertificateConfigN{ + client: group.client, + CertificateConfigN: result, + }, nil +} + +// UpdateCertificateConfigNByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateCertificateConfigNByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.CertificateConfigN) (*GlobalCertificateConfigN, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + CertificateConfigNs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueProjectId := + objToUpdate.Spec.ProjectId + patchOpProjectId := PatchOp{ + Op: "replace", + Path: "/spec/projectId", + Value: patchValueProjectId, + } + patch = append(patch, patchOpProjectId) + + patchValueBeginsOn := + objToUpdate.Spec.BeginsOn + patchOpBeginsOn := PatchOp{ + Op: "replace", + Path: "/spec/beginsOn", + Value: patchValueBeginsOn, + } + patch = append(patch, patchOpBeginsOn) + + patchValueExpiresOn := + objToUpdate.Spec.ExpiresOn + patchOpExpiresOn := PatchOp{ + Op: "replace", + Path: "/spec/expiresOn", + Value: patchValueExpiresOn, + } + patch = append(patch, patchOpExpiresOn) + + patchValueIssuedToCN := + objToUpdate.Spec.IssuedToCN + patchOpIssuedToCN := PatchOp{ + Op: "replace", + Path: "/spec/issuedToCN", + Value: patchValueIssuedToCN, + } + patch = append(patch, patchOpIssuedToCN) + + patchValueConfig := + objToUpdate.Spec.Config + patchOpConfig := PatchOp{ + Op: "replace", + Path: "/spec/config", + Value: patchValueConfig, + } + patch = append(patch, patchOpConfig) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + CertificateConfigNs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalCertificateConfigN{ + client: group.client, + CertificateConfigN: result, + }, nil +} + +// ListCertificateConfigNs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListCertificateConfigNs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalCertificateConfigN, err error) { + key := "certificateconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalCertificateConfigN, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.CertificateConfigN) + result[k] = &GlobalCertificateConfigN{ + client: group.client, + CertificateConfigN: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + CertificateConfigNs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalCertificateConfigN, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalCertificateConfigN{ + client: group.client, + CertificateConfigN: &item, + } + } + } + return +} + +type GlobalCertificateConfigN struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.CertificateConfigN +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalCertificateConfigN) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteCertificateConfigNByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.CertificateConfigN = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalCertificateConfigN) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateCertificateConfigNByName(ctx, obj.CertificateConfigN) + if err != nil { + return err + } + obj.CertificateConfigN = result.CertificateConfigN + return nil +} + +func (obj *GlobalCertificateConfigN) GetParent(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetConfigByName(ctx, hashedName) +} + +type certificateconfignGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *certificateconfignGlobalTsmV1Chainer) Subscribe() { + key := "certificateconfigns.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewCertificateConfigNInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *certificateconfignGlobalTsmV1Chainer) Unsubscribe() { + key := "certificateconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *certificateconfignGlobalTsmV1Chainer) IsSubscribed() bool { + key := "certificateconfigns.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetCertificateRequestByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetCertificateRequestByName(ctx context.Context, hashedName string) (*GlobalCertificateRequest, error) { + key := "certificaterequests.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.CertificateRequest) + return &GlobalCertificateRequest{ + client: group.client, + CertificateRequest: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + CertificateRequests().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalCertificateRequest{ + client: group.client, + CertificateRequest: result, + }, nil + } +} + +// DeleteCertificateRequestByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteCertificateRequestByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + CertificateRequests().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + CertificateRequests().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/certificateRequestsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateCertificateRequestByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateCertificateRequestByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.CertificateRequest) (*GlobalCertificateRequest, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + CertificateRequests().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"certificateRequestsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"CertificateRequest\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalCertificateRequest{ + client: group.client, + CertificateRequest: result, + }, nil +} + +// UpdateCertificateRequestByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateCertificateRequestByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.CertificateRequest) (*GlobalCertificateRequest, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + CertificateRequests().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueIssuerRef := + objToUpdate.Spec.IssuerRef + patchOpIssuerRef := PatchOp{ + Op: "replace", + Path: "/spec/issuerRef", + Value: patchValueIssuerRef, + } + patch = append(patch, patchOpIssuerRef) + + patchValueRequest := + objToUpdate.Spec.Request + patchOpRequest := PatchOp{ + Op: "replace", + Path: "/spec/request", + Value: patchValueRequest, + } + patch = append(patch, patchOpRequest) + + patchValueDuration := + objToUpdate.Spec.Duration + patchOpDuration := PatchOp{ + Op: "replace", + Path: "/spec/duration", + Value: patchValueDuration, + } + patch = append(patch, patchOpDuration) + + patchValueUid := + objToUpdate.Spec.Uid + patchOpUid := PatchOp{ + Op: "replace", + Path: "/spec/uid", + Value: patchValueUid, + } + patch = append(patch, patchOpUid) + + patchValueIsCA := + objToUpdate.Spec.IsCA + patchOpIsCA := PatchOp{ + Op: "replace", + Path: "/spec/isCA", + Value: patchValueIsCA, + } + patch = append(patch, patchOpIsCA) + + patchValueUsername := + objToUpdate.Spec.Username + patchOpUsername := PatchOp{ + Op: "replace", + Path: "/spec/username", + Value: patchValueUsername, + } + patch = append(patch, patchOpUsername) + + patchValueUsages := + objToUpdate.Spec.Usages + patchOpUsages := PatchOp{ + Op: "replace", + Path: "/spec/usages", + Value: patchValueUsages, + } + patch = append(patch, patchOpUsages) + + patchValueGroups := + objToUpdate.Spec.Groups + patchOpGroups := PatchOp{ + Op: "replace", + Path: "/spec/groups", + Value: patchValueGroups, + } + patch = append(patch, patchOpGroups) + + patchValueExtra := + objToUpdate.Spec.Extra + patchOpExtra := PatchOp{ + Op: "replace", + Path: "/spec/extra", + Value: patchValueExtra, + } + patch = append(patch, patchOpExtra) + + patchValueStatus := + objToUpdate.Spec.Status + patchOpStatus := PatchOp{ + Op: "replace", + Path: "/spec/status", + Value: patchValueStatus, + } + patch = append(patch, patchOpStatus) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + CertificateRequests().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalCertificateRequest{ + client: group.client, + CertificateRequest: result, + }, nil +} + +// ListCertificateRequests returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListCertificateRequests(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalCertificateRequest, err error) { + key := "certificaterequests.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalCertificateRequest, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.CertificateRequest) + result[k] = &GlobalCertificateRequest{ + client: group.client, + CertificateRequest: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + CertificateRequests().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalCertificateRequest, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalCertificateRequest{ + client: group.client, + CertificateRequest: &item, + } + } + } + return +} + +type GlobalCertificateRequest struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.CertificateRequest +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalCertificateRequest) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteCertificateRequestByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.CertificateRequest = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalCertificateRequest) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateCertificateRequestByName(ctx, obj.CertificateRequest) + if err != nil { + return err + } + obj.CertificateRequest = result.CertificateRequest + return nil +} + +func (obj *GlobalCertificateRequest) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +type certificaterequestGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *certificaterequestGlobalTsmV1Chainer) Subscribe() { + key := "certificaterequests.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewCertificateRequestInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *certificaterequestGlobalTsmV1Chainer) Unsubscribe() { + key := "certificaterequests.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *certificaterequestGlobalTsmV1Chainer) IsSubscribed() bool { + key := "certificaterequests.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetCertificateByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetCertificateByName(ctx context.Context, hashedName string) (*GlobalCertificate, error) { + key := "certificates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Certificate) + return &GlobalCertificate{ + client: group.client, + Certificate: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Certificates().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalCertificate{ + client: group.client, + Certificate: result, + }, nil + } +} + +// DeleteCertificateByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteCertificateByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Certificates().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + Certificates().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/certificatesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateCertificateByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateCertificateByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Certificate) (*GlobalCertificate, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + Certificates().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"certificatesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"Certificate\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalCertificate{ + client: group.client, + Certificate: result, + }, nil +} + +// UpdateCertificateByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateCertificateByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Certificate) (*GlobalCertificate, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Certificates().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueIssuerRef := + objToUpdate.Spec.IssuerRef + patchOpIssuerRef := PatchOp{ + Op: "replace", + Path: "/spec/issuerRef", + Value: patchValueIssuerRef, + } + patch = append(patch, patchOpIssuerRef) + + patchValuePrivateKey := + objToUpdate.Spec.PrivateKey + patchOpPrivateKey := PatchOp{ + Op: "replace", + Path: "/spec/privateKey", + Value: patchValuePrivateKey, + } + patch = append(patch, patchOpPrivateKey) + + patchValueSubject := + objToUpdate.Spec.Subject + patchOpSubject := PatchOp{ + Op: "replace", + Path: "/spec/subject", + Value: patchValueSubject, + } + patch = append(patch, patchOpSubject) + + patchValueCommonName := + objToUpdate.Spec.CommonName + patchOpCommonName := PatchOp{ + Op: "replace", + Path: "/spec/commonName", + Value: patchValueCommonName, + } + patch = append(patch, patchOpCommonName) + + patchValueDuration := + objToUpdate.Spec.Duration + patchOpDuration := PatchOp{ + Op: "replace", + Path: "/spec/duration", + Value: patchValueDuration, + } + patch = append(patch, patchOpDuration) + + if objToUpdate.Spec.DnsNames != nil { + patchValueDnsNames := + objToUpdate.Spec.DnsNames + patchOpDnsNames := PatchOp{ + Op: "replace", + Path: "/spec/dnsNames", + Value: patchValueDnsNames, + } + patch = append(patch, patchOpDnsNames) + } + + if objToUpdate.Spec.IpAddresses != nil { + patchValueIpAddresses := + objToUpdate.Spec.IpAddresses + patchOpIpAddresses := PatchOp{ + Op: "replace", + Path: "/spec/ipAddresses", + Value: patchValueIpAddresses, + } + patch = append(patch, patchOpIpAddresses) + } + + patchValueSecretName := + objToUpdate.Spec.SecretName + patchOpSecretName := PatchOp{ + Op: "replace", + Path: "/spec/secretName", + Value: patchValueSecretName, + } + patch = append(patch, patchOpSecretName) + + patchValueRenewBefore := + objToUpdate.Spec.RenewBefore + patchOpRenewBefore := PatchOp{ + Op: "replace", + Path: "/spec/renewBefore", + Value: patchValueRenewBefore, + } + patch = append(patch, patchOpRenewBefore) + + if objToUpdate.Spec.EmailAddresses != nil { + patchValueEmailAddresses := + objToUpdate.Spec.EmailAddresses + patchOpEmailAddresses := PatchOp{ + Op: "replace", + Path: "/spec/emailAddresses", + Value: patchValueEmailAddresses, + } + patch = append(patch, patchOpEmailAddresses) + } + + if objToUpdate.Spec.Uris != nil { + patchValueUris := + objToUpdate.Spec.Uris + patchOpUris := PatchOp{ + Op: "replace", + Path: "/spec/uris", + Value: patchValueUris, + } + patch = append(patch, patchOpUris) + } + + patchValueSecretTemplate := + objToUpdate.Spec.SecretTemplate + patchOpSecretTemplate := PatchOp{ + Op: "replace", + Path: "/spec/secretTemplate", + Value: patchValueSecretTemplate, + } + patch = append(patch, patchOpSecretTemplate) + + patchValueKeyStores := + objToUpdate.Spec.KeyStores + patchOpKeyStores := PatchOp{ + Op: "replace", + Path: "/spec/keyStores", + Value: patchValueKeyStores, + } + patch = append(patch, patchOpKeyStores) + + patchValueIsCA := + objToUpdate.Spec.IsCA + patchOpIsCA := PatchOp{ + Op: "replace", + Path: "/spec/isCA", + Value: patchValueIsCA, + } + patch = append(patch, patchOpIsCA) + + patchValueEncodeUsagesInRequest := + objToUpdate.Spec.EncodeUsagesInRequest + patchOpEncodeUsagesInRequest := PatchOp{ + Op: "replace", + Path: "/spec/encodeUsagesInRequest", + Value: patchValueEncodeUsagesInRequest, + } + patch = append(patch, patchOpEncodeUsagesInRequest) + + patchValueUsages := + objToUpdate.Spec.Usages + patchOpUsages := PatchOp{ + Op: "replace", + Path: "/spec/usages", + Value: patchValueUsages, + } + patch = append(patch, patchOpUsages) + + patchValueRevisionHistoryLimit := + objToUpdate.Spec.RevisionHistoryLimit + patchOpRevisionHistoryLimit := PatchOp{ + Op: "replace", + Path: "/spec/revisionHistoryLimit", + Value: patchValueRevisionHistoryLimit, + } + patch = append(patch, patchOpRevisionHistoryLimit) + + patchValueAdditionalOutputFormats := + objToUpdate.Spec.AdditionalOutputFormats + patchOpAdditionalOutputFormats := PatchOp{ + Op: "replace", + Path: "/spec/additionalOutputFormats", + Value: patchValueAdditionalOutputFormats, + } + patch = append(patch, patchOpAdditionalOutputFormats) + + patchValueStatus := + objToUpdate.Spec.Status + patchOpStatus := PatchOp{ + Op: "replace", + Path: "/spec/status", + Value: patchValueStatus, + } + patch = append(patch, patchOpStatus) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Certificates().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalCertificate{ + client: group.client, + Certificate: result, + }, nil +} + +// ListCertificates returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListCertificates(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalCertificate, err error) { + key := "certificates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalCertificate, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Certificate) + result[k] = &GlobalCertificate{ + client: group.client, + Certificate: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Certificates().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalCertificate, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalCertificate{ + client: group.client, + Certificate: &item, + } + } + } + return +} + +type GlobalCertificate struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Certificate +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalCertificate) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteCertificateByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Certificate = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalCertificate) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateCertificateByName(ctx, obj.Certificate) + if err != nil { + return err + } + obj.Certificate = result.Certificate + return nil +} + +func (obj *GlobalCertificate) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +type certificateGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *certificateGlobalTsmV1Chainer) Subscribe() { + key := "certificates.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewCertificateInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *certificateGlobalTsmV1Chainer) Unsubscribe() { + key := "certificates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *certificateGlobalTsmV1Chainer) IsSubscribed() bool { + key := "certificates.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetClusterConfigFolderByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetClusterConfigFolderByName(ctx context.Context, hashedName string) (*GlobalClusterConfigFolder, error) { + key := "clusterconfigfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ClusterConfigFolder) + return &GlobalClusterConfigFolder{ + client: group.client, + ClusterConfigFolder: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ClusterConfigFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalClusterConfigFolder{ + client: group.client, + ClusterConfigFolder: result, + }, nil + } +} + +// DeleteClusterConfigFolderByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteClusterConfigFolderByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ClusterConfigFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.ClustersGvk { + err := group.client. + Global().DeleteClusterSettingsByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigFolders().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/clustersGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateClusterConfigFolderByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateClusterConfigFolderByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ClusterConfigFolder) (*GlobalClusterConfigFolder, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ClustersGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ClusterConfigFolders().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/clustersGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ClusterConfigFolder", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalClusterConfigFolder{ + client: group.client, + ClusterConfigFolder: result, + }, nil +} + +// UpdateClusterConfigFolderByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateClusterConfigFolderByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ClusterConfigFolder) (*GlobalClusterConfigFolder, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ClusterConfigFolders().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ClusterConfigFolders().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalClusterConfigFolder{ + client: group.client, + ClusterConfigFolder: result, + }, nil +} + +// ListClusterConfigFolders returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListClusterConfigFolders(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalClusterConfigFolder, err error) { + key := "clusterconfigfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalClusterConfigFolder, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ClusterConfigFolder) + result[k] = &GlobalClusterConfigFolder{ + client: group.client, + ClusterConfigFolder: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ClusterConfigFolders().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalClusterConfigFolder, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalClusterConfigFolder{ + client: group.client, + ClusterConfigFolder: &item, + } + } + } + return +} + +type GlobalClusterConfigFolder struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ClusterConfigFolder +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalClusterConfigFolder) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteClusterConfigFolderByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ClusterConfigFolder = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalClusterConfigFolder) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateClusterConfigFolderByName(ctx, obj.ClusterConfigFolder) + if err != nil { + return err + } + obj.ClusterConfigFolder = result.ClusterConfigFolder + return nil +} + +func (obj *GlobalClusterConfigFolder) GetParent(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetConfigByName(ctx, hashedName) +} + +// GetAllClusters returns all children of given type +func (obj *GlobalClusterConfigFolder) GetAllClusters(ctx context.Context) ( + result []*GlobalClusterSettings, err error) { + result = make([]*GlobalClusterSettings, 0, len(obj.Spec.ClustersGvk)) + for _, v := range obj.Spec.ClustersGvk { + l, err := obj.client.Global().GetClusterSettingsByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetClusters returns child which has given displayName +func (obj *GlobalClusterConfigFolder) GetClusters(ctx context.Context, + displayName string) (result *GlobalClusterSettings, err error) { + l, ok := obj.Spec.ClustersGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ClusterConfigFolder", "Clusters", displayName) + } + result, err = obj.client.Global().GetClusterSettingsByName(ctx, l.Name) + return +} + +// AddClusters calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalClusterConfigFolder) AddClusters(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ClusterSettings) (result *GlobalClusterSettings, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["clusterconfigfolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["clusterconfigfolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateClusterSettingsByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetClusterConfigFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.ClusterConfigFolder = updatedObj.ClusterConfigFolder + } + return +} + +// DeleteClusters calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalClusterConfigFolder) DeleteClusters(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ClustersGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ClusterConfigFolder", "Clusters", displayName) + } + err = obj.client.Global().DeleteClusterSettingsByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetClusterConfigFolderByName(ctx, obj.GetName()) + if err == nil { + obj.ClusterConfigFolder = updatedObj.ClusterConfigFolder + } + return +} + +type clusterconfigfolderGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *clusterconfigfolderGlobalTsmV1Chainer) Subscribe() { + key := "clusterconfigfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewClusterConfigFolderInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *clusterconfigfolderGlobalTsmV1Chainer) Unsubscribe() { + key := "clusterconfigfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *clusterconfigfolderGlobalTsmV1Chainer) IsSubscribed() bool { + key := "clusterconfigfolders.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *clusterconfigfolderGlobalTsmV1Chainer) Clusters(name string) *clustersettingsGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["clustersettingses.global.tsm.tanzu.vmware.com"] = name + return &clustersettingsGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetClusters calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *clusterconfigfolderGlobalTsmV1Chainer) GetClusters(ctx context.Context, displayName string) (result *GlobalClusterSettings, err error) { + hashedName := helper.GetHashedName("clustersettingses.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetClusterSettingsByName(ctx, hashedName) +} + +// AddClusters calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *clusterconfigfolderGlobalTsmV1Chainer) AddClusters(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ClusterSettings) (result *GlobalClusterSettings, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("clustersettingses.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateClusterSettingsByName(ctx, objToCreate) +} + +// DeleteClusters calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *clusterconfigfolderGlobalTsmV1Chainer) DeleteClusters(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("clustersettingses.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteClusterSettingsByName(ctx, hashedName) +} + +// GetClusterConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetClusterConfigByName(ctx context.Context, hashedName string) (*GlobalClusterConfig, error) { + key := "clusterconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ClusterConfig) + return &GlobalClusterConfig{ + client: group.client, + ClusterConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalClusterConfig{ + client: group.client, + ClusterConfig: result, + }, nil + } +} + +// DeleteClusterConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteClusterConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.DomainsGvk { + err := group.client. + Global().DeleteDomainConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.HostConfigGvk { + err := group.client. + Global().DeleteHostConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + if result.Spec.DnsConfigFolderGvk != nil { + err := group.client. + Global(). + DeleteDNSConfigFolderByName(ctx, result.Spec.DnsConfigFolderGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.DnsProbesConfigFolderGvk != nil { + err := group.client. + Global(). + DeleteDNSProbesConfigFolderByName(ctx, result.Spec.DnsProbesConfigFolderGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.LogFolderGvk != nil { + err := group.client. + Global(). + DeleteLogFolderByName(ctx, result.Spec.LogFolderGvk.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.GnsBindingGvk { + err := group.client. + Global().DeleteGnsBindingRTByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.SecurityContextConstraintsGvk { + err := group.client. + Global().DeleteSecurityContextConstraintsConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + if result.Spec.ResourceGroupGvk != nil { + err := group.client. + Global(). + DeleteResourceGroupRTByName(ctx, result.Spec.ResourceGroupGvk.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/clustersGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["clusterfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterfolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateClusterConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateClusterConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ClusterConfig) (*GlobalClusterConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.DomainsGvk = nil + objToCreate.Spec.HostConfigGvk = nil + objToCreate.Spec.DnsConfigFolderGvk = nil + objToCreate.Spec.DnsProbesConfigFolderGvk = nil + objToCreate.Spec.LogFolderGvk = nil + objToCreate.Spec.GnsBindingGvk = nil + objToCreate.Spec.SecurityContextConstraintsGvk = nil + objToCreate.Spec.ResourceGroupGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["clusterfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterfolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"clustersGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ClusterConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalClusterConfig{ + client: group.client, + ClusterConfig: result, + }, nil +} + +// UpdateClusterConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateClusterConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ClusterConfig) (*GlobalClusterConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalClusterConfig{ + client: group.client, + ClusterConfig: result, + }, nil +} + +// ListClusterConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListClusterConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalClusterConfig, err error) { + key := "clusterconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalClusterConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ClusterConfig) + result[k] = &GlobalClusterConfig{ + client: group.client, + ClusterConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ClusterConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalClusterConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalClusterConfig{ + client: group.client, + ClusterConfig: &item, + } + } + } + return +} + +type GlobalClusterConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ClusterConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalClusterConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteClusterConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ClusterConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalClusterConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateClusterConfigByName(ctx, obj.ClusterConfig) + if err != nil { + return err + } + obj.ClusterConfig = result.ClusterConfig + return nil +} + +func (obj *GlobalClusterConfig) GetParent(ctx context.Context) (result *GlobalClusterFolder, err error) { + hashedName := helper.GetHashedName("clusterfolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["clusterfolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetClusterFolderByName(ctx, hashedName) +} + +// GetAllDomains returns all children of given type +func (obj *GlobalClusterConfig) GetAllDomains(ctx context.Context) ( + result []*GlobalDomainConfig, err error) { + result = make([]*GlobalDomainConfig, 0, len(obj.Spec.DomainsGvk)) + for _, v := range obj.Spec.DomainsGvk { + l, err := obj.client.Global().GetDomainConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetDomains returns child which has given displayName +func (obj *GlobalClusterConfig) GetDomains(ctx context.Context, + displayName string) (result *GlobalDomainConfig, err error) { + l, ok := obj.Spec.DomainsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ClusterConfig", "Domains", displayName) + } + result, err = obj.client.Global().GetDomainConfigByName(ctx, l.Name) + return +} + +// AddDomains calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalClusterConfig) AddDomains(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DomainConfig) (result *GlobalDomainConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["clusterconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["clusterconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDomainConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetClusterConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.ClusterConfig = updatedObj.ClusterConfig + } + return +} + +// DeleteDomains calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalClusterConfig) DeleteDomains(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.DomainsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ClusterConfig", "Domains", displayName) + } + err = obj.client.Global().DeleteDomainConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetClusterConfigByName(ctx, obj.GetName()) + if err == nil { + obj.ClusterConfig = updatedObj.ClusterConfig + } + return +} + +// GetAllHostConfig returns all children of given type +func (obj *GlobalClusterConfig) GetAllHostConfig(ctx context.Context) ( + result []*GlobalHostConfig, err error) { + result = make([]*GlobalHostConfig, 0, len(obj.Spec.HostConfigGvk)) + for _, v := range obj.Spec.HostConfigGvk { + l, err := obj.client.Global().GetHostConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetHostConfig returns child which has given displayName +func (obj *GlobalClusterConfig) GetHostConfig(ctx context.Context, + displayName string) (result *GlobalHostConfig, err error) { + l, ok := obj.Spec.HostConfigGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ClusterConfig", "HostConfig", displayName) + } + result, err = obj.client.Global().GetHostConfigByName(ctx, l.Name) + return +} + +// AddHostConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalClusterConfig) AddHostConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.HostConfig) (result *GlobalHostConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["clusterconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["clusterconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateHostConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetClusterConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.ClusterConfig = updatedObj.ClusterConfig + } + return +} + +// DeleteHostConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalClusterConfig) DeleteHostConfig(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.HostConfigGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ClusterConfig", "HostConfig", displayName) + } + err = obj.client.Global().DeleteHostConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetClusterConfigByName(ctx, obj.GetName()) + if err == nil { + obj.ClusterConfig = updatedObj.ClusterConfig + } + return +} + +// GetDnsConfigFolder returns child of given type +func (obj *GlobalClusterConfig) GetDnsConfigFolder(ctx context.Context) ( + result *GlobalDNSConfigFolder, err error) { + if obj.Spec.DnsConfigFolderGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ClusterConfig", "DnsConfigFolder") + } + return obj.client.Global().GetDNSConfigFolderByName(ctx, obj.Spec.DnsConfigFolderGvk.Name) +} + +// AddDnsConfigFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalClusterConfig) AddDnsConfigFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DNSConfigFolder) (result *GlobalDNSConfigFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["clusterconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["clusterconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDNSConfigFolderByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetClusterConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.ClusterConfig = updatedObj.ClusterConfig + } + return +} + +// DeleteDnsConfigFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalClusterConfig) DeleteDnsConfigFolder(ctx context.Context) (err error) { + if obj.Spec.DnsConfigFolderGvk != nil { + err = obj.client. + Global().DeleteDNSConfigFolderByName(ctx, obj.Spec.DnsConfigFolderGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetClusterConfigByName(ctx, obj.GetName()) + if err == nil { + obj.ClusterConfig = updatedObj.ClusterConfig + } + return +} + +// GetDnsProbesConfigFolder returns child of given type +func (obj *GlobalClusterConfig) GetDnsProbesConfigFolder(ctx context.Context) ( + result *GlobalDNSProbesConfigFolder, err error) { + if obj.Spec.DnsProbesConfigFolderGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ClusterConfig", "DnsProbesConfigFolder") + } + return obj.client.Global().GetDNSProbesConfigFolderByName(ctx, obj.Spec.DnsProbesConfigFolderGvk.Name) +} + +// AddDnsProbesConfigFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalClusterConfig) AddDnsProbesConfigFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DNSProbesConfigFolder) (result *GlobalDNSProbesConfigFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["clusterconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["clusterconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDNSProbesConfigFolderByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetClusterConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.ClusterConfig = updatedObj.ClusterConfig + } + return +} + +// DeleteDnsProbesConfigFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalClusterConfig) DeleteDnsProbesConfigFolder(ctx context.Context) (err error) { + if obj.Spec.DnsProbesConfigFolderGvk != nil { + err = obj.client. + Global().DeleteDNSProbesConfigFolderByName(ctx, obj.Spec.DnsProbesConfigFolderGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetClusterConfigByName(ctx, obj.GetName()) + if err == nil { + obj.ClusterConfig = updatedObj.ClusterConfig + } + return +} + +// GetLogFolder returns child of given type +func (obj *GlobalClusterConfig) GetLogFolder(ctx context.Context) ( + result *GlobalLogFolder, err error) { + if obj.Spec.LogFolderGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ClusterConfig", "LogFolder") + } + return obj.client.Global().GetLogFolderByName(ctx, obj.Spec.LogFolderGvk.Name) +} + +// AddLogFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalClusterConfig) AddLogFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.LogFolder) (result *GlobalLogFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["clusterconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["clusterconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateLogFolderByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetClusterConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.ClusterConfig = updatedObj.ClusterConfig + } + return +} + +// DeleteLogFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalClusterConfig) DeleteLogFolder(ctx context.Context) (err error) { + if obj.Spec.LogFolderGvk != nil { + err = obj.client. + Global().DeleteLogFolderByName(ctx, obj.Spec.LogFolderGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetClusterConfigByName(ctx, obj.GetName()) + if err == nil { + obj.ClusterConfig = updatedObj.ClusterConfig + } + return +} + +// GetAllGnsBinding returns all children of given type +func (obj *GlobalClusterConfig) GetAllGnsBinding(ctx context.Context) ( + result []*GlobalGnsBindingRT, err error) { + result = make([]*GlobalGnsBindingRT, 0, len(obj.Spec.GnsBindingGvk)) + for _, v := range obj.Spec.GnsBindingGvk { + l, err := obj.client.Global().GetGnsBindingRTByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGnsBinding returns child which has given displayName +func (obj *GlobalClusterConfig) GetGnsBinding(ctx context.Context, + displayName string) (result *GlobalGnsBindingRT, err error) { + l, ok := obj.Spec.GnsBindingGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ClusterConfig", "GnsBinding", displayName) + } + result, err = obj.client.Global().GetGnsBindingRTByName(ctx, l.Name) + return +} + +// AddGnsBinding calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalClusterConfig) AddGnsBinding(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsBindingRT) (result *GlobalGnsBindingRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["clusterconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["clusterconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGnsBindingRTByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetClusterConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.ClusterConfig = updatedObj.ClusterConfig + } + return +} + +// DeleteGnsBinding calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalClusterConfig) DeleteGnsBinding(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GnsBindingGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ClusterConfig", "GnsBinding", displayName) + } + err = obj.client.Global().DeleteGnsBindingRTByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetClusterConfigByName(ctx, obj.GetName()) + if err == nil { + obj.ClusterConfig = updatedObj.ClusterConfig + } + return +} + +// GetAllSecurityContextConstraints returns all children of given type +func (obj *GlobalClusterConfig) GetAllSecurityContextConstraints(ctx context.Context) ( + result []*GlobalSecurityContextConstraintsConfig, err error) { + result = make([]*GlobalSecurityContextConstraintsConfig, 0, len(obj.Spec.SecurityContextConstraintsGvk)) + for _, v := range obj.Spec.SecurityContextConstraintsGvk { + l, err := obj.client.Global().GetSecurityContextConstraintsConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetSecurityContextConstraints returns child which has given displayName +func (obj *GlobalClusterConfig) GetSecurityContextConstraints(ctx context.Context, + displayName string) (result *GlobalSecurityContextConstraintsConfig, err error) { + l, ok := obj.Spec.SecurityContextConstraintsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ClusterConfig", "SecurityContextConstraints", displayName) + } + result, err = obj.client.Global().GetSecurityContextConstraintsConfigByName(ctx, l.Name) + return +} + +// AddSecurityContextConstraints calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalClusterConfig) AddSecurityContextConstraints(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig) (result *GlobalSecurityContextConstraintsConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["clusterconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["clusterconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateSecurityContextConstraintsConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetClusterConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.ClusterConfig = updatedObj.ClusterConfig + } + return +} + +// DeleteSecurityContextConstraints calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalClusterConfig) DeleteSecurityContextConstraints(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.SecurityContextConstraintsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ClusterConfig", "SecurityContextConstraints", displayName) + } + err = obj.client.Global().DeleteSecurityContextConstraintsConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetClusterConfigByName(ctx, obj.GetName()) + if err == nil { + obj.ClusterConfig = updatedObj.ClusterConfig + } + return +} + +// GetResourceGroup returns child of given type +func (obj *GlobalClusterConfig) GetResourceGroup(ctx context.Context) ( + result *GlobalResourceGroupRT, err error) { + if obj.Spec.ResourceGroupGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ClusterConfig", "ResourceGroup") + } + return obj.client.Global().GetResourceGroupRTByName(ctx, obj.Spec.ResourceGroupGvk.Name) +} + +// AddResourceGroup calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalClusterConfig) AddResourceGroup(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ResourceGroupRT) (result *GlobalResourceGroupRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["clusterconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["clusterconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateResourceGroupRTByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetClusterConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.ClusterConfig = updatedObj.ClusterConfig + } + return +} + +// DeleteResourceGroup calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalClusterConfig) DeleteResourceGroup(ctx context.Context) (err error) { + if obj.Spec.ResourceGroupGvk != nil { + err = obj.client. + Global().DeleteResourceGroupRTByName(ctx, obj.Spec.ResourceGroupGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetClusterConfigByName(ctx, obj.GetName()) + if err == nil { + obj.ClusterConfig = updatedObj.ClusterConfig + } + return +} + +type clusterconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *clusterconfigGlobalTsmV1Chainer) Subscribe() { + key := "clusterconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewClusterConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *clusterconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "clusterconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *clusterconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "clusterconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *clusterconfigGlobalTsmV1Chainer) Domains(name string) *domainconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["domainconfigs.global.tsm.tanzu.vmware.com"] = name + return &domainconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetDomains calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *clusterconfigGlobalTsmV1Chainer) GetDomains(ctx context.Context, displayName string) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +// AddDomains calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *clusterconfigGlobalTsmV1Chainer) AddDomains(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DomainConfig) (result *GlobalDomainConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDomainConfigByName(ctx, objToCreate) +} + +// DeleteDomains calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *clusterconfigGlobalTsmV1Chainer) DeleteDomains(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDomainConfigByName(ctx, hashedName) +} + +func (c *clusterconfigGlobalTsmV1Chainer) HostConfig(name string) *hostconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["hostconfigs.global.tsm.tanzu.vmware.com"] = name + return &hostconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetHostConfig calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *clusterconfigGlobalTsmV1Chainer) GetHostConfig(ctx context.Context, displayName string) (result *GlobalHostConfig, err error) { + hashedName := helper.GetHashedName("hostconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetHostConfigByName(ctx, hashedName) +} + +// AddHostConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *clusterconfigGlobalTsmV1Chainer) AddHostConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.HostConfig) (result *GlobalHostConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("hostconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateHostConfigByName(ctx, objToCreate) +} + +// DeleteHostConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *clusterconfigGlobalTsmV1Chainer) DeleteHostConfig(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("hostconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteHostConfigByName(ctx, hashedName) +} + +func (c *clusterconfigGlobalTsmV1Chainer) DnsConfigFolder(name string) *dnsconfigfolderGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["dnsconfigfolders.global.tsm.tanzu.vmware.com"] = name + return &dnsconfigfolderGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetDnsConfigFolder calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *clusterconfigGlobalTsmV1Chainer) GetDnsConfigFolder(ctx context.Context, displayName string) (result *GlobalDNSConfigFolder, err error) { + hashedName := helper.GetHashedName("dnsconfigfolders.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetDNSConfigFolderByName(ctx, hashedName) +} + +// AddDnsConfigFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *clusterconfigGlobalTsmV1Chainer) AddDnsConfigFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DNSConfigFolder) (result *GlobalDNSConfigFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("dnsconfigfolders.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDNSConfigFolderByName(ctx, objToCreate) +} + +// DeleteDnsConfigFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *clusterconfigGlobalTsmV1Chainer) DeleteDnsConfigFolder(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("dnsconfigfolders.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDNSConfigFolderByName(ctx, hashedName) +} + +func (c *clusterconfigGlobalTsmV1Chainer) DnsProbesConfigFolder() *dnsprobesconfigfolderGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["dnsprobesconfigfolders.global.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY + return &dnsprobesconfigfolderGlobalTsmV1Chainer{ + client: c.client, + name: helper.DEFAULT_KEY, + parentLabels: parentLabels, + } +} + +// GetDnsProbesConfigFolder calculates hashed name of the object based on it's parents and returns the object +func (c *clusterconfigGlobalTsmV1Chainer) GetDnsProbesConfigFolder(ctx context.Context) (result *GlobalDNSProbesConfigFolder, err error) { + hashedName := helper.GetHashedName("dnsprobesconfigfolders.global.tsm.tanzu.vmware.com", c.parentLabels, helper.DEFAULT_KEY) + return c.client.Global().GetDNSProbesConfigFolderByName(ctx, hashedName) +} + +// AddDnsProbesConfigFolder calculates hashed name of the child to create based on parents names and creates it. +// objToCreate.Name is changed to the hashed name. Original name ('default') is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *clusterconfigGlobalTsmV1Chainer) AddDnsProbesConfigFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DNSProbesConfigFolder) (result *GlobalDNSProbesConfigFolder, err error) { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("dnsprobesconfigfolders.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDNSProbesConfigFolderByName(ctx, objToCreate) +} + +// DeleteDnsProbesConfigFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *clusterconfigGlobalTsmV1Chainer) DeleteDnsProbesConfigFolder(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("dnsprobesconfigfolders.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDNSProbesConfigFolderByName(ctx, hashedName) +} + +func (c *clusterconfigGlobalTsmV1Chainer) LogFolder(name string) *logfolderGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["logfolders.global.tsm.tanzu.vmware.com"] = name + return &logfolderGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetLogFolder calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *clusterconfigGlobalTsmV1Chainer) GetLogFolder(ctx context.Context, displayName string) (result *GlobalLogFolder, err error) { + hashedName := helper.GetHashedName("logfolders.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetLogFolderByName(ctx, hashedName) +} + +// AddLogFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *clusterconfigGlobalTsmV1Chainer) AddLogFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.LogFolder) (result *GlobalLogFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("logfolders.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateLogFolderByName(ctx, objToCreate) +} + +// DeleteLogFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *clusterconfigGlobalTsmV1Chainer) DeleteLogFolder(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("logfolders.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteLogFolderByName(ctx, hashedName) +} + +func (c *clusterconfigGlobalTsmV1Chainer) GnsBinding(name string) *gnsbindingrtGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gnsbindingrts.global.tsm.tanzu.vmware.com"] = name + return &gnsbindingrtGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGnsBinding calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *clusterconfigGlobalTsmV1Chainer) GetGnsBinding(ctx context.Context, displayName string) (result *GlobalGnsBindingRT, err error) { + hashedName := helper.GetHashedName("gnsbindingrts.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGnsBindingRTByName(ctx, hashedName) +} + +// AddGnsBinding calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *clusterconfigGlobalTsmV1Chainer) AddGnsBinding(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsBindingRT) (result *GlobalGnsBindingRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsbindingrts.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGnsBindingRTByName(ctx, objToCreate) +} + +// DeleteGnsBinding calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *clusterconfigGlobalTsmV1Chainer) DeleteGnsBinding(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsbindingrts.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGnsBindingRTByName(ctx, hashedName) +} + +func (c *clusterconfigGlobalTsmV1Chainer) SecurityContextConstraints(name string) *securitycontextconstraintsconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["securitycontextconstraintsconfigs.global.tsm.tanzu.vmware.com"] = name + return &securitycontextconstraintsconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetSecurityContextConstraints calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *clusterconfigGlobalTsmV1Chainer) GetSecurityContextConstraints(ctx context.Context, displayName string) (result *GlobalSecurityContextConstraintsConfig, err error) { + hashedName := helper.GetHashedName("securitycontextconstraintsconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetSecurityContextConstraintsConfigByName(ctx, hashedName) +} + +// AddSecurityContextConstraints calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *clusterconfigGlobalTsmV1Chainer) AddSecurityContextConstraints(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig) (result *GlobalSecurityContextConstraintsConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("securitycontextconstraintsconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateSecurityContextConstraintsConfigByName(ctx, objToCreate) +} + +// DeleteSecurityContextConstraints calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *clusterconfigGlobalTsmV1Chainer) DeleteSecurityContextConstraints(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("securitycontextconstraintsconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteSecurityContextConstraintsConfigByName(ctx, hashedName) +} + +func (c *clusterconfigGlobalTsmV1Chainer) ResourceGroup(name string) *resourcegrouprtGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["resourcegrouprts.global.tsm.tanzu.vmware.com"] = name + return &resourcegrouprtGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetResourceGroup calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *clusterconfigGlobalTsmV1Chainer) GetResourceGroup(ctx context.Context, displayName string) (result *GlobalResourceGroupRT, err error) { + hashedName := helper.GetHashedName("resourcegrouprts.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetResourceGroupRTByName(ctx, hashedName) +} + +// AddResourceGroup calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *clusterconfigGlobalTsmV1Chainer) AddResourceGroup(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ResourceGroupRT) (result *GlobalResourceGroupRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("resourcegrouprts.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateResourceGroupRTByName(ctx, objToCreate) +} + +// DeleteResourceGroup calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *clusterconfigGlobalTsmV1Chainer) DeleteResourceGroup(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("resourcegrouprts.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteResourceGroupRTByName(ctx, hashedName) +} + +// GetClusterFolderByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetClusterFolderByName(ctx context.Context, hashedName string) (*GlobalClusterFolder, error) { + key := "clusterfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ClusterFolder) + return &GlobalClusterFolder{ + client: group.client, + ClusterFolder: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ClusterFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalClusterFolder{ + client: group.client, + ClusterFolder: result, + }, nil + } +} + +// DeleteClusterFolderByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteClusterFolderByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ClusterFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.ClustersGvk { + err := group.client. + Global().DeleteClusterConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.RemoteGatewayServiceConfigsGvk { + err := group.client. + Global().DeleteRemoteGatewayServiceConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ClusterFolders().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/clusterFolderGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateClusterFolderByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateClusterFolderByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ClusterFolder) (*GlobalClusterFolder, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ClustersGvk = nil + objToCreate.Spec.RemoteGatewayServiceConfigsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ClusterFolders().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/clusterFolderGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ClusterFolder", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalClusterFolder{ + client: group.client, + ClusterFolder: result, + }, nil +} + +// UpdateClusterFolderByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateClusterFolderByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ClusterFolder) (*GlobalClusterFolder, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ClusterFolders().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ClusterFolders().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalClusterFolder{ + client: group.client, + ClusterFolder: result, + }, nil +} + +// ListClusterFolders returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListClusterFolders(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalClusterFolder, err error) { + key := "clusterfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalClusterFolder, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ClusterFolder) + result[k] = &GlobalClusterFolder{ + client: group.client, + ClusterFolder: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ClusterFolders().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalClusterFolder, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalClusterFolder{ + client: group.client, + ClusterFolder: &item, + } + } + } + return +} + +type GlobalClusterFolder struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ClusterFolder +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalClusterFolder) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteClusterFolderByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ClusterFolder = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalClusterFolder) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateClusterFolderByName(ctx, obj.ClusterFolder) + if err != nil { + return err + } + obj.ClusterFolder = result.ClusterFolder + return nil +} + +func (obj *GlobalClusterFolder) GetParent(ctx context.Context) (result *GlobalRuntime, err error) { + hashedName := helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["runtimes.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetRuntimeByName(ctx, hashedName) +} + +// GetAllClusters returns all children of given type +func (obj *GlobalClusterFolder) GetAllClusters(ctx context.Context) ( + result []*GlobalClusterConfig, err error) { + result = make([]*GlobalClusterConfig, 0, len(obj.Spec.ClustersGvk)) + for _, v := range obj.Spec.ClustersGvk { + l, err := obj.client.Global().GetClusterConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetClusters returns child which has given displayName +func (obj *GlobalClusterFolder) GetClusters(ctx context.Context, + displayName string) (result *GlobalClusterConfig, err error) { + l, ok := obj.Spec.ClustersGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ClusterFolder", "Clusters", displayName) + } + result, err = obj.client.Global().GetClusterConfigByName(ctx, l.Name) + return +} + +// AddClusters calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalClusterFolder) AddClusters(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ClusterConfig) (result *GlobalClusterConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["clusterfolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["clusterfolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateClusterConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetClusterFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.ClusterFolder = updatedObj.ClusterFolder + } + return +} + +// DeleteClusters calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalClusterFolder) DeleteClusters(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ClustersGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ClusterFolder", "Clusters", displayName) + } + err = obj.client.Global().DeleteClusterConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetClusterFolderByName(ctx, obj.GetName()) + if err == nil { + obj.ClusterFolder = updatedObj.ClusterFolder + } + return +} + +// GetAllRemoteGatewayServiceConfigs returns all children of given type +func (obj *GlobalClusterFolder) GetAllRemoteGatewayServiceConfigs(ctx context.Context) ( + result []*GlobalRemoteGatewayServiceConfig, err error) { + result = make([]*GlobalRemoteGatewayServiceConfig, 0, len(obj.Spec.RemoteGatewayServiceConfigsGvk)) + for _, v := range obj.Spec.RemoteGatewayServiceConfigsGvk { + l, err := obj.client.Global().GetRemoteGatewayServiceConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetRemoteGatewayServiceConfigs returns child which has given displayName +func (obj *GlobalClusterFolder) GetRemoteGatewayServiceConfigs(ctx context.Context, + displayName string) (result *GlobalRemoteGatewayServiceConfig, err error) { + l, ok := obj.Spec.RemoteGatewayServiceConfigsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ClusterFolder", "RemoteGatewayServiceConfigs", displayName) + } + result, err = obj.client.Global().GetRemoteGatewayServiceConfigByName(ctx, l.Name) + return +} + +// AddRemoteGatewayServiceConfigs calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalClusterFolder) AddRemoteGatewayServiceConfigs(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig) (result *GlobalRemoteGatewayServiceConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["clusterfolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["clusterfolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateRemoteGatewayServiceConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetClusterFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.ClusterFolder = updatedObj.ClusterFolder + } + return +} + +// DeleteRemoteGatewayServiceConfigs calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalClusterFolder) DeleteRemoteGatewayServiceConfigs(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.RemoteGatewayServiceConfigsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ClusterFolder", "RemoteGatewayServiceConfigs", displayName) + } + err = obj.client.Global().DeleteRemoteGatewayServiceConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetClusterFolderByName(ctx, obj.GetName()) + if err == nil { + obj.ClusterFolder = updatedObj.ClusterFolder + } + return +} + +type clusterfolderGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *clusterfolderGlobalTsmV1Chainer) Subscribe() { + key := "clusterfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewClusterFolderInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *clusterfolderGlobalTsmV1Chainer) Unsubscribe() { + key := "clusterfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *clusterfolderGlobalTsmV1Chainer) IsSubscribed() bool { + key := "clusterfolders.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *clusterfolderGlobalTsmV1Chainer) Clusters(name string) *clusterconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["clusterconfigs.global.tsm.tanzu.vmware.com"] = name + return &clusterconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetClusters calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *clusterfolderGlobalTsmV1Chainer) GetClusters(ctx context.Context, displayName string) (result *GlobalClusterConfig, err error) { + hashedName := helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetClusterConfigByName(ctx, hashedName) +} + +// AddClusters calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *clusterfolderGlobalTsmV1Chainer) AddClusters(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ClusterConfig) (result *GlobalClusterConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateClusterConfigByName(ctx, objToCreate) +} + +// DeleteClusters calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *clusterfolderGlobalTsmV1Chainer) DeleteClusters(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteClusterConfigByName(ctx, hashedName) +} + +func (c *clusterfolderGlobalTsmV1Chainer) RemoteGatewayServiceConfigs(name string) *remotegatewayserviceconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["remotegatewayserviceconfigs.global.tsm.tanzu.vmware.com"] = name + return &remotegatewayserviceconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetRemoteGatewayServiceConfigs calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *clusterfolderGlobalTsmV1Chainer) GetRemoteGatewayServiceConfigs(ctx context.Context, displayName string) (result *GlobalRemoteGatewayServiceConfig, err error) { + hashedName := helper.GetHashedName("remotegatewayserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetRemoteGatewayServiceConfigByName(ctx, hashedName) +} + +// AddRemoteGatewayServiceConfigs calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *clusterfolderGlobalTsmV1Chainer) AddRemoteGatewayServiceConfigs(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig) (result *GlobalRemoteGatewayServiceConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("remotegatewayserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateRemoteGatewayServiceConfigByName(ctx, objToCreate) +} + +// DeleteRemoteGatewayServiceConfigs calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *clusterfolderGlobalTsmV1Chainer) DeleteRemoteGatewayServiceConfigs(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("remotegatewayserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteRemoteGatewayServiceConfigByName(ctx, hashedName) +} + +// GetClusterSettingsByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetClusterSettingsByName(ctx context.Context, hashedName string) (*GlobalClusterSettings, error) { + key := "clustersettingses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ClusterSettings) + return &GlobalClusterSettings{ + client: group.client, + ClusterSettings: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ClusterSettingses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalClusterSettings{ + client: group.client, + ClusterSettings: result, + }, nil + } +} + +// DeleteClusterSettingsByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteClusterSettingsByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ClusterSettingses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ClusterSettingses().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/clustersGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["clusterconfigfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigfolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateClusterSettingsByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateClusterSettingsByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ClusterSettings) (*GlobalClusterSettings, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ClusterSettingses().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["clusterconfigfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigfolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"clustersGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ClusterSettings\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalClusterSettings{ + client: group.client, + ClusterSettings: result, + }, nil +} + +// UpdateClusterSettingsByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateClusterSettingsByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ClusterSettings) (*GlobalClusterSettings, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ClusterSettingses().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueProjectId := + objToUpdate.Spec.ProjectId + patchOpProjectId := PatchOp{ + Op: "replace", + Path: "/spec/projectId", + Value: patchValueProjectId, + } + patch = append(patch, patchOpProjectId) + + patchValueDisplayName := + objToUpdate.Spec.DisplayName + patchOpDisplayName := PatchOp{ + Op: "replace", + Path: "/spec/displayName", + Value: patchValueDisplayName, + } + patch = append(patch, patchOpDisplayName) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueTags := + objToUpdate.Spec.Tags + patchOpTags := PatchOp{ + Op: "replace", + Path: "/spec/tags", + Value: patchValueTags, + } + patch = append(patch, patchOpTags) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueAutoInstallServiceMesh := + objToUpdate.Spec.AutoInstallServiceMesh + patchOpAutoInstallServiceMesh := PatchOp{ + Op: "replace", + Path: "/spec/autoInstallServiceMesh", + Value: patchValueAutoInstallServiceMesh, + } + patch = append(patch, patchOpAutoInstallServiceMesh) + + patchValueEnableNamespaceExclusions := + objToUpdate.Spec.EnableNamespaceExclusions + patchOpEnableNamespaceExclusions := PatchOp{ + Op: "replace", + Path: "/spec/enableNamespaceExclusions", + Value: patchValueEnableNamespaceExclusions, + } + patch = append(patch, patchOpEnableNamespaceExclusions) + + patchValueNamespaceExclusions := + objToUpdate.Spec.NamespaceExclusions + patchOpNamespaceExclusions := PatchOp{ + Op: "replace", + Path: "/spec/namespaceExclusions", + Value: patchValueNamespaceExclusions, + } + patch = append(patch, patchOpNamespaceExclusions) + + patchValueSystemNamespaceExclusions := + objToUpdate.Spec.SystemNamespaceExclusions + patchOpSystemNamespaceExclusions := PatchOp{ + Op: "replace", + Path: "/spec/systemNamespaceExclusions", + Value: patchValueSystemNamespaceExclusions, + } + patch = append(patch, patchOpSystemNamespaceExclusions) + + patchValueAgentDomain := + objToUpdate.Spec.AgentDomain + patchOpAgentDomain := PatchOp{ + Op: "replace", + Path: "/spec/agentDomain", + Value: patchValueAgentDomain, + } + patch = append(patch, patchOpAgentDomain) + + patchValueProxyConfig := + objToUpdate.Spec.ProxyConfig + patchOpProxyConfig := PatchOp{ + Op: "replace", + Path: "/spec/proxyConfig", + Value: patchValueProxyConfig, + } + patch = append(patch, patchOpProxyConfig) + + patchValueAutoInstallServiceMeshConfig := + objToUpdate.Spec.AutoInstallServiceMeshConfig + patchOpAutoInstallServiceMeshConfig := PatchOp{ + Op: "replace", + Path: "/spec/autoInstallServiceMeshConfig", + Value: patchValueAutoInstallServiceMeshConfig, + } + patch = append(patch, patchOpAutoInstallServiceMeshConfig) + + patchValueRegistryAccount := + objToUpdate.Spec.RegistryAccount + patchOpRegistryAccount := PatchOp{ + Op: "replace", + Path: "/spec/registryAccount", + Value: patchValueRegistryAccount, + } + patch = append(patch, patchOpRegistryAccount) + + patchValueCaLabels := + objToUpdate.Spec.CaLabels + patchOpCaLabels := PatchOp{ + Op: "replace", + Path: "/spec/caLabels", + Value: patchValueCaLabels, + } + patch = append(patch, patchOpCaLabels) + + patchValueEnableInternalGateway := + objToUpdate.Spec.EnableInternalGateway + patchOpEnableInternalGateway := PatchOp{ + Op: "replace", + Path: "/spec/enableInternalGateway", + Value: patchValueEnableInternalGateway, + } + patch = append(patch, patchOpEnableInternalGateway) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ClusterSettingses().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalClusterSettings{ + client: group.client, + ClusterSettings: result, + }, nil +} + +// ListClusterSettingses returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListClusterSettingses(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalClusterSettings, err error) { + key := "clustersettingses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalClusterSettings, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ClusterSettings) + result[k] = &GlobalClusterSettings{ + client: group.client, + ClusterSettings: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ClusterSettingses().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalClusterSettings, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalClusterSettings{ + client: group.client, + ClusterSettings: &item, + } + } + } + return +} + +type GlobalClusterSettings struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ClusterSettings +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalClusterSettings) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteClusterSettingsByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ClusterSettings = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalClusterSettings) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateClusterSettingsByName(ctx, obj.ClusterSettings) + if err != nil { + return err + } + obj.ClusterSettings = result.ClusterSettings + return nil +} + +func (obj *GlobalClusterSettings) GetParent(ctx context.Context) (result *GlobalClusterConfigFolder, err error) { + hashedName := helper.GetHashedName("clusterconfigfolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["clusterconfigfolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetClusterConfigFolderByName(ctx, hashedName) +} + +type clustersettingsGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *clustersettingsGlobalTsmV1Chainer) Subscribe() { + key := "clustersettingses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewClusterSettingsInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *clustersettingsGlobalTsmV1Chainer) Unsubscribe() { + key := "clustersettingses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *clustersettingsGlobalTsmV1Chainer) IsSubscribed() bool { + key := "clustersettingses.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetClusterByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetClusterByName(ctx context.Context, hashedName string) (*GlobalCluster, error) { + key := "clusters.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Cluster) + return &GlobalCluster{ + client: group.client, + Cluster: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Clusters().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalCluster{ + client: group.client, + Cluster: result, + }, nil + } +} + +// DeleteClusterByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteClusterByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Clusters().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + if result.Spec.ConnectionStatusGvk != nil { + err := group.client. + Global(). + DeleteConnectionStatusByName(ctx, result.Spec.ConnectionStatusGvk.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.AppsGvk { + err := group.client. + Global().DeleteApplicationInfoByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.DnsProbeStatusGvk { + err := group.client. + Global().DeleteDNSProbeStatusByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.SecurityContextConstraintsGvk { + err := group.client. + Global().DeleteSecurityContextConstraintsByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.DomainsGvk { + err := group.client. + Global().DeleteDomainByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.NodesGvk { + err := group.client. + Global().DeleteNodeByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + Clusters().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/clustersGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["inventories.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("inventories.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Inventories().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateClusterByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateClusterByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Cluster) (*GlobalCluster, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ConnectionStatusGvk = nil + objToCreate.Spec.AppsGvk = nil + objToCreate.Spec.DnsProbeStatusGvk = nil + objToCreate.Spec.SecurityContextConstraintsGvk = nil + objToCreate.Spec.DomainsGvk = nil + objToCreate.Spec.NodesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + Clusters().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["inventories.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("inventories.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"clustersGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"Cluster\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Inventories().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalCluster{ + client: group.client, + Cluster: result, + }, nil +} + +// UpdateClusterByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateClusterByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Cluster) (*GlobalCluster, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Clusters().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueUuid := + objToUpdate.Spec.Uuid + patchOpUuid := PatchOp{ + Op: "replace", + Path: "/spec/uuid", + Value: patchValueUuid, + } + patch = append(patch, patchOpUuid) + + patchValueConnected := + objToUpdate.Spec.Connected + patchOpConnected := PatchOp{ + Op: "replace", + Path: "/spec/connected", + Value: patchValueConnected, + } + patch = append(patch, patchOpConnected) + + patchValueIstioState := + objToUpdate.Spec.IstioState + patchOpIstioState := PatchOp{ + Op: "replace", + Path: "/spec/istioState", + Value: patchValueIstioState, + } + patch = append(patch, patchOpIstioState) + + patchValueStatus := + objToUpdate.Spec.Status + patchOpStatus := PatchOp{ + Op: "replace", + Path: "/spec/status", + Value: patchValueStatus, + } + patch = append(patch, patchOpStatus) + + patchValueStatusHistory := + objToUpdate.Spec.StatusHistory + patchOpStatusHistory := PatchOp{ + Op: "replace", + Path: "/spec/statusHistory", + Value: patchValueStatusHistory, + } + patch = append(patch, patchOpStatusHistory) + + patchValueCastatus := + objToUpdate.Spec.Castatus + patchOpCastatus := PatchOp{ + Op: "replace", + Path: "/spec/castatus", + Value: patchValueCastatus, + } + patch = append(patch, patchOpCastatus) + + patchValueCaStatusHistory := + objToUpdate.Spec.CaStatusHistory + patchOpCaStatusHistory := PatchOp{ + Op: "replace", + Path: "/spec/caStatusHistory", + Value: patchValueCaStatusHistory, + } + patch = append(patch, patchOpCaStatusHistory) + + patchValueComponentStatuses := + objToUpdate.Spec.ComponentStatuses + patchOpComponentStatuses := PatchOp{ + Op: "replace", + Path: "/spec/componentStatuses", + Value: patchValueComponentStatuses, + } + patch = append(patch, patchOpComponentStatuses) + + patchValueComponentStatusesHistory := + objToUpdate.Spec.ComponentStatusesHistory + patchOpComponentStatusesHistory := PatchOp{ + Op: "replace", + Path: "/spec/componentStatusesHistory", + Value: patchValueComponentStatusesHistory, + } + patch = append(patch, patchOpComponentStatusesHistory) + + patchValueType := + objToUpdate.Spec.Type + patchOpType := PatchOp{ + Op: "replace", + Path: "/spec/type", + Value: patchValueType, + } + patch = append(patch, patchOpType) + + patchValueProjectId := + objToUpdate.Spec.ProjectId + patchOpProjectId := PatchOp{ + Op: "replace", + Path: "/spec/projectId", + Value: patchValueProjectId, + } + patch = append(patch, patchOpProjectId) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Clusters().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalCluster{ + client: group.client, + Cluster: result, + }, nil +} + +// ListClusters returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListClusters(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalCluster, err error) { + key := "clusters.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalCluster, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Cluster) + result[k] = &GlobalCluster{ + client: group.client, + Cluster: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Clusters().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalCluster, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalCluster{ + client: group.client, + Cluster: &item, + } + } + } + return +} + +type GlobalCluster struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Cluster +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalCluster) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteClusterByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Cluster = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalCluster) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateClusterByName(ctx, obj.Cluster) + if err != nil { + return err + } + obj.Cluster = result.Cluster + return nil +} + +func (obj *GlobalCluster) GetParent(ctx context.Context) (result *GlobalInventory, err error) { + hashedName := helper.GetHashedName("inventories.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["inventories.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetInventoryByName(ctx, hashedName) +} + +// GetConnectionStatus returns child of given type +func (obj *GlobalCluster) GetConnectionStatus(ctx context.Context) ( + result *GlobalConnectionStatus, err error) { + if obj.Spec.ConnectionStatusGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Cluster", "ConnectionStatus") + } + return obj.client.Global().GetConnectionStatusByName(ctx, obj.Spec.ConnectionStatusGvk.Name) +} + +// AddConnectionStatus calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalCluster) AddConnectionStatus(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ConnectionStatus) (result *GlobalConnectionStatus, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["clusters.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["clusters.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateConnectionStatusByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetClusterByName(ctx, obj.GetName()) + if getErr == nil { + obj.Cluster = updatedObj.Cluster + } + return +} + +// DeleteConnectionStatus calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalCluster) DeleteConnectionStatus(ctx context.Context) (err error) { + if obj.Spec.ConnectionStatusGvk != nil { + err = obj.client. + Global().DeleteConnectionStatusByName(ctx, obj.Spec.ConnectionStatusGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetClusterByName(ctx, obj.GetName()) + if err == nil { + obj.Cluster = updatedObj.Cluster + } + return +} + +// GetAllApps returns all children of given type +func (obj *GlobalCluster) GetAllApps(ctx context.Context) ( + result []*GlobalApplicationInfo, err error) { + result = make([]*GlobalApplicationInfo, 0, len(obj.Spec.AppsGvk)) + for _, v := range obj.Spec.AppsGvk { + l, err := obj.client.Global().GetApplicationInfoByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetApps returns child which has given displayName +func (obj *GlobalCluster) GetApps(ctx context.Context, + displayName string) (result *GlobalApplicationInfo, err error) { + l, ok := obj.Spec.AppsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Cluster", "Apps", displayName) + } + result, err = obj.client.Global().GetApplicationInfoByName(ctx, l.Name) + return +} + +// AddApps calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalCluster) AddApps(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ApplicationInfo) (result *GlobalApplicationInfo, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["clusters.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["clusters.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateApplicationInfoByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetClusterByName(ctx, obj.GetName()) + if getErr == nil { + obj.Cluster = updatedObj.Cluster + } + return +} + +// DeleteApps calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalCluster) DeleteApps(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.AppsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Cluster", "Apps", displayName) + } + err = obj.client.Global().DeleteApplicationInfoByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetClusterByName(ctx, obj.GetName()) + if err == nil { + obj.Cluster = updatedObj.Cluster + } + return +} + +// GetAllDnsProbeStatus returns all children of given type +func (obj *GlobalCluster) GetAllDnsProbeStatus(ctx context.Context) ( + result []*GlobalDNSProbeStatus, err error) { + result = make([]*GlobalDNSProbeStatus, 0, len(obj.Spec.DnsProbeStatusGvk)) + for _, v := range obj.Spec.DnsProbeStatusGvk { + l, err := obj.client.Global().GetDNSProbeStatusByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetDnsProbeStatus returns child which has given displayName +func (obj *GlobalCluster) GetDnsProbeStatus(ctx context.Context, + displayName string) (result *GlobalDNSProbeStatus, err error) { + l, ok := obj.Spec.DnsProbeStatusGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Cluster", "DnsProbeStatus", displayName) + } + result, err = obj.client.Global().GetDNSProbeStatusByName(ctx, l.Name) + return +} + +// AddDnsProbeStatus calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalCluster) AddDnsProbeStatus(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DNSProbeStatus) (result *GlobalDNSProbeStatus, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["clusters.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["clusters.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDNSProbeStatusByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetClusterByName(ctx, obj.GetName()) + if getErr == nil { + obj.Cluster = updatedObj.Cluster + } + return +} + +// DeleteDnsProbeStatus calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalCluster) DeleteDnsProbeStatus(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.DnsProbeStatusGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Cluster", "DnsProbeStatus", displayName) + } + err = obj.client.Global().DeleteDNSProbeStatusByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetClusterByName(ctx, obj.GetName()) + if err == nil { + obj.Cluster = updatedObj.Cluster + } + return +} + +// GetAllSecurityContextConstraints returns all children of given type +func (obj *GlobalCluster) GetAllSecurityContextConstraints(ctx context.Context) ( + result []*GlobalSecurityContextConstraints, err error) { + result = make([]*GlobalSecurityContextConstraints, 0, len(obj.Spec.SecurityContextConstraintsGvk)) + for _, v := range obj.Spec.SecurityContextConstraintsGvk { + l, err := obj.client.Global().GetSecurityContextConstraintsByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetSecurityContextConstraints returns child which has given displayName +func (obj *GlobalCluster) GetSecurityContextConstraints(ctx context.Context, + displayName string) (result *GlobalSecurityContextConstraints, err error) { + l, ok := obj.Spec.SecurityContextConstraintsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Cluster", "SecurityContextConstraints", displayName) + } + result, err = obj.client.Global().GetSecurityContextConstraintsByName(ctx, l.Name) + return +} + +// AddSecurityContextConstraints calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalCluster) AddSecurityContextConstraints(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SecurityContextConstraints) (result *GlobalSecurityContextConstraints, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["clusters.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["clusters.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateSecurityContextConstraintsByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetClusterByName(ctx, obj.GetName()) + if getErr == nil { + obj.Cluster = updatedObj.Cluster + } + return +} + +// DeleteSecurityContextConstraints calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalCluster) DeleteSecurityContextConstraints(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.SecurityContextConstraintsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Cluster", "SecurityContextConstraints", displayName) + } + err = obj.client.Global().DeleteSecurityContextConstraintsByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetClusterByName(ctx, obj.GetName()) + if err == nil { + obj.Cluster = updatedObj.Cluster + } + return +} + +// GetAllDomains returns all children of given type +func (obj *GlobalCluster) GetAllDomains(ctx context.Context) ( + result []*GlobalDomain, err error) { + result = make([]*GlobalDomain, 0, len(obj.Spec.DomainsGvk)) + for _, v := range obj.Spec.DomainsGvk { + l, err := obj.client.Global().GetDomainByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetDomains returns child which has given displayName +func (obj *GlobalCluster) GetDomains(ctx context.Context, + displayName string) (result *GlobalDomain, err error) { + l, ok := obj.Spec.DomainsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Cluster", "Domains", displayName) + } + result, err = obj.client.Global().GetDomainByName(ctx, l.Name) + return +} + +// AddDomains calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalCluster) AddDomains(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Domain) (result *GlobalDomain, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["clusters.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["clusters.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDomainByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetClusterByName(ctx, obj.GetName()) + if getErr == nil { + obj.Cluster = updatedObj.Cluster + } + return +} + +// DeleteDomains calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalCluster) DeleteDomains(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.DomainsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Cluster", "Domains", displayName) + } + err = obj.client.Global().DeleteDomainByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetClusterByName(ctx, obj.GetName()) + if err == nil { + obj.Cluster = updatedObj.Cluster + } + return +} + +// GetAllNodes returns all children of given type +func (obj *GlobalCluster) GetAllNodes(ctx context.Context) ( + result []*GlobalNode, err error) { + result = make([]*GlobalNode, 0, len(obj.Spec.NodesGvk)) + for _, v := range obj.Spec.NodesGvk { + l, err := obj.client.Global().GetNodeByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetNodes returns child which has given displayName +func (obj *GlobalCluster) GetNodes(ctx context.Context, + displayName string) (result *GlobalNode, err error) { + l, ok := obj.Spec.NodesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Cluster", "Nodes", displayName) + } + result, err = obj.client.Global().GetNodeByName(ctx, l.Name) + return +} + +// AddNodes calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalCluster) AddNodes(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Node) (result *GlobalNode, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["clusters.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["clusters.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateNodeByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetClusterByName(ctx, obj.GetName()) + if getErr == nil { + obj.Cluster = updatedObj.Cluster + } + return +} + +// DeleteNodes calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalCluster) DeleteNodes(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.NodesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Cluster", "Nodes", displayName) + } + err = obj.client.Global().DeleteNodeByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetClusterByName(ctx, obj.GetName()) + if err == nil { + obj.Cluster = updatedObj.Cluster + } + return +} + +type clusterGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *clusterGlobalTsmV1Chainer) Subscribe() { + key := "clusters.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewClusterInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *clusterGlobalTsmV1Chainer) Unsubscribe() { + key := "clusters.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *clusterGlobalTsmV1Chainer) IsSubscribed() bool { + key := "clusters.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *clusterGlobalTsmV1Chainer) ConnectionStatus(name string) *connectionstatusGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["connectionstatuses.global.tsm.tanzu.vmware.com"] = name + return &connectionstatusGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetConnectionStatus calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *clusterGlobalTsmV1Chainer) GetConnectionStatus(ctx context.Context, displayName string) (result *GlobalConnectionStatus, err error) { + hashedName := helper.GetHashedName("connectionstatuses.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetConnectionStatusByName(ctx, hashedName) +} + +// AddConnectionStatus calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *clusterGlobalTsmV1Chainer) AddConnectionStatus(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ConnectionStatus) (result *GlobalConnectionStatus, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("connectionstatuses.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateConnectionStatusByName(ctx, objToCreate) +} + +// DeleteConnectionStatus calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *clusterGlobalTsmV1Chainer) DeleteConnectionStatus(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("connectionstatuses.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteConnectionStatusByName(ctx, hashedName) +} + +func (c *clusterGlobalTsmV1Chainer) Apps(name string) *applicationinfoGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["applicationinfos.global.tsm.tanzu.vmware.com"] = name + return &applicationinfoGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetApps calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *clusterGlobalTsmV1Chainer) GetApps(ctx context.Context, displayName string) (result *GlobalApplicationInfo, err error) { + hashedName := helper.GetHashedName("applicationinfos.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetApplicationInfoByName(ctx, hashedName) +} + +// AddApps calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *clusterGlobalTsmV1Chainer) AddApps(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ApplicationInfo) (result *GlobalApplicationInfo, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("applicationinfos.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateApplicationInfoByName(ctx, objToCreate) +} + +// DeleteApps calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *clusterGlobalTsmV1Chainer) DeleteApps(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("applicationinfos.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteApplicationInfoByName(ctx, hashedName) +} + +func (c *clusterGlobalTsmV1Chainer) DnsProbeStatus(name string) *dnsprobestatusGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["dnsprobestatuses.global.tsm.tanzu.vmware.com"] = name + return &dnsprobestatusGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetDnsProbeStatus calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *clusterGlobalTsmV1Chainer) GetDnsProbeStatus(ctx context.Context, displayName string) (result *GlobalDNSProbeStatus, err error) { + hashedName := helper.GetHashedName("dnsprobestatuses.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetDNSProbeStatusByName(ctx, hashedName) +} + +// AddDnsProbeStatus calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *clusterGlobalTsmV1Chainer) AddDnsProbeStatus(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DNSProbeStatus) (result *GlobalDNSProbeStatus, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("dnsprobestatuses.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDNSProbeStatusByName(ctx, objToCreate) +} + +// DeleteDnsProbeStatus calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *clusterGlobalTsmV1Chainer) DeleteDnsProbeStatus(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("dnsprobestatuses.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDNSProbeStatusByName(ctx, hashedName) +} + +func (c *clusterGlobalTsmV1Chainer) SecurityContextConstraints(name string) *securitycontextconstraintsGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["securitycontextconstraintses.global.tsm.tanzu.vmware.com"] = name + return &securitycontextconstraintsGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetSecurityContextConstraints calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *clusterGlobalTsmV1Chainer) GetSecurityContextConstraints(ctx context.Context, displayName string) (result *GlobalSecurityContextConstraints, err error) { + hashedName := helper.GetHashedName("securitycontextconstraintses.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetSecurityContextConstraintsByName(ctx, hashedName) +} + +// AddSecurityContextConstraints calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *clusterGlobalTsmV1Chainer) AddSecurityContextConstraints(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SecurityContextConstraints) (result *GlobalSecurityContextConstraints, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("securitycontextconstraintses.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateSecurityContextConstraintsByName(ctx, objToCreate) +} + +// DeleteSecurityContextConstraints calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *clusterGlobalTsmV1Chainer) DeleteSecurityContextConstraints(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("securitycontextconstraintses.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteSecurityContextConstraintsByName(ctx, hashedName) +} + +func (c *clusterGlobalTsmV1Chainer) Domains(name string) *domainGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["domains.global.tsm.tanzu.vmware.com"] = name + return &domainGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetDomains calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *clusterGlobalTsmV1Chainer) GetDomains(ctx context.Context, displayName string) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetDomainByName(ctx, hashedName) +} + +// AddDomains calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *clusterGlobalTsmV1Chainer) AddDomains(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Domain) (result *GlobalDomain, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDomainByName(ctx, objToCreate) +} + +// DeleteDomains calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *clusterGlobalTsmV1Chainer) DeleteDomains(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDomainByName(ctx, hashedName) +} + +func (c *clusterGlobalTsmV1Chainer) Nodes(name string) *nodeGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["nodes.global.tsm.tanzu.vmware.com"] = name + return &nodeGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetNodes calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *clusterGlobalTsmV1Chainer) GetNodes(ctx context.Context, displayName string) (result *GlobalNode, err error) { + hashedName := helper.GetHashedName("nodes.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetNodeByName(ctx, hashedName) +} + +// AddNodes calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *clusterGlobalTsmV1Chainer) AddNodes(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Node) (result *GlobalNode, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("nodes.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateNodeByName(ctx, objToCreate) +} + +// DeleteNodes calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *clusterGlobalTsmV1Chainer) DeleteNodes(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("nodes.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteNodeByName(ctx, hashedName) +} + +// GetConfigMapByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetConfigMapByName(ctx context.Context, hashedName string) (*GlobalConfigMap, error) { + key := "configmaps.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ConfigMap) + return &GlobalConfigMap{ + client: group.client, + ConfigMap: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ConfigMaps().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalConfigMap{ + client: group.client, + ConfigMap: result, + }, nil + } +} + +// DeleteConfigMapByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteConfigMapByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ConfigMaps().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ConfigMaps().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/configmapGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateConfigMapByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateConfigMapByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ConfigMap) (*GlobalConfigMap, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ConfigMaps().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"configmapGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ConfigMap\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalConfigMap{ + client: group.client, + ConfigMap: result, + }, nil +} + +// UpdateConfigMapByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateConfigMapByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ConfigMap) (*GlobalConfigMap, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ConfigMaps().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueAnnotations := + objToUpdate.Spec.Annotations + patchOpAnnotations := PatchOp{ + Op: "replace", + Path: "/spec/annotations", + Value: patchValueAnnotations, + } + patch = append(patch, patchOpAnnotations) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueData := + objToUpdate.Spec.Data + patchOpData := PatchOp{ + Op: "replace", + Path: "/spec/data", + Value: patchValueData, + } + patch = append(patch, patchOpData) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ConfigMaps().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalConfigMap{ + client: group.client, + ConfigMap: result, + }, nil +} + +// ListConfigMaps returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListConfigMaps(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalConfigMap, err error) { + key := "configmaps.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalConfigMap, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ConfigMap) + result[k] = &GlobalConfigMap{ + client: group.client, + ConfigMap: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ConfigMaps().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalConfigMap, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalConfigMap{ + client: group.client, + ConfigMap: &item, + } + } + } + return +} + +type GlobalConfigMap struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ConfigMap +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalConfigMap) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteConfigMapByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ConfigMap = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalConfigMap) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateConfigMapByName(ctx, obj.ConfigMap) + if err != nil { + return err + } + obj.ConfigMap = result.ConfigMap + return nil +} + +func (obj *GlobalConfigMap) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +type configmapGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *configmapGlobalTsmV1Chainer) Subscribe() { + key := "configmaps.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewConfigMapInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *configmapGlobalTsmV1Chainer) Unsubscribe() { + key := "configmaps.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *configmapGlobalTsmV1Chainer) IsSubscribed() bool { + key := "configmaps.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetConfigByName(ctx context.Context, hashedName string) (*GlobalConfig, error) { + key := "configs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Config) + return &GlobalConfig{ + client: group.client, + Config: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Configs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalConfig{ + client: group.client, + Config: result, + }, nil + } +} + +// DeleteConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Configs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + if result.Spec.ResourceGroupsGvk != nil { + err := group.client. + Global(). + DeleteResourceGroupByName(ctx, result.Spec.ResourceGroupsGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.GlobalNamespaceGvk != nil { + err := group.client. + Global(). + DeleteGlobalNamespaceByName(ctx, result.Spec.GlobalNamespaceGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.PolicyGvk != nil { + err := group.client. + Global(). + DeleteAccessControlPolicyByName(ctx, result.Spec.PolicyGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.TemplatesGvk != nil { + err := group.client. + Global(). + DeleteTemplateByName(ctx, result.Spec.TemplatesGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.ProgressiveUpgradeGvk != nil { + err := group.client. + Global(). + DeleteProgressiveUpgradeByName(ctx, result.Spec.ProgressiveUpgradeGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.ExternalPluginsGvk != nil { + err := group.client. + Global(). + DeleteExternalPluginConfigFolderByName(ctx, result.Spec.ExternalPluginsGvk.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.CertificatesGvk { + err := group.client. + Global().DeleteCertificateConfigNByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ExternalAccountsGvk { + err := group.client. + Global().DeleteExternalAccountConfigNByName(ctx, v.Name) + if err != nil { + return err + } + } + + if result.Spec.ExternalAuditStorageGvk != nil { + err := group.client. + Global(). + DeleteExternalAuditStorageByName(ctx, result.Spec.ExternalAuditStorageGvk.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ExternalDNSGvk { + err := group.client. + Global().DeleteExternalDNSConfigNByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ExternalLBGvk { + err := group.client. + Global().DeleteExternalLBConfigNByName(ctx, v.Name) + if err != nil { + return err + } + } + + if result.Spec.AutoscalerFolderGvk != nil { + err := group.client. + Global(). + DeleteAutoscalerFolderByName(ctx, result.Spec.AutoscalerFolderGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.ClustersGvk != nil { + err := group.client. + Global(). + DeleteClusterConfigFolderByName(ctx, result.Spec.ClustersGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.ServiceLevelObjectiveGvk != nil { + err := group.client. + Global(). + DeleteServiceLevelObjectiveFolderByName(ctx, result.Spec.ServiceLevelObjectiveGvk.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.FeatureFlagsGvk { + err := group.client. + Global().DeleteFeatureFlagByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ProjectsGvk { + err := group.client. + Global().DeleteProjectByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ServiceDirectoryGvk { + err := group.client. + Global().DeleteServiceDirectoryNByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + Configs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/configGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["roots.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("roots.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Roots().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Config) (*GlobalConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] == "" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.Labels[common.DISPLAY_NAME_LABEL]) + } + + objToCreate.Spec.ResourceGroupsGvk = nil + objToCreate.Spec.GlobalNamespaceGvk = nil + objToCreate.Spec.PolicyGvk = nil + objToCreate.Spec.TemplatesGvk = nil + objToCreate.Spec.ProgressiveUpgradeGvk = nil + objToCreate.Spec.ExternalPluginsGvk = nil + objToCreate.Spec.CertificatesGvk = nil + objToCreate.Spec.ExternalAccountsGvk = nil + objToCreate.Spec.ExternalAuditStorageGvk = nil + objToCreate.Spec.ExternalDNSGvk = nil + objToCreate.Spec.ExternalLBGvk = nil + objToCreate.Spec.AutoscalerFolderGvk = nil + objToCreate.Spec.ClustersGvk = nil + objToCreate.Spec.ServiceLevelObjectiveGvk = nil + objToCreate.Spec.FeatureFlagsGvk = nil + objToCreate.Spec.ProjectsGvk = nil + objToCreate.Spec.ServiceDirectoryGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + Configs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["roots.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("roots.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/configGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "Config", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Roots().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalConfig{ + client: group.client, + Config: result, + }, nil +} + +// UpdateConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Config) (*GlobalConfig, error) { + if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) + } + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Configs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalConfig{ + client: group.client, + Config: result, + }, nil +} + +// ListConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalConfig, err error) { + key := "configs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Config) + result[k] = &GlobalConfig{ + client: group.client, + Config: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Configs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalConfig{ + client: group.client, + Config: &item, + } + } + } + return +} + +type GlobalConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Config +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Config = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateConfigByName(ctx, obj.Config) + if err != nil { + return err + } + obj.Config = result.Config + return nil +} + +func (obj *GlobalConfig) GetParent(ctx context.Context) (result *GlobalRoot, err error) { + hashedName := helper.GetHashedName("roots.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["roots.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetRootByName(ctx, hashedName) +} + +// GetResourceGroups returns child of given type +func (obj *GlobalConfig) GetResourceGroups(ctx context.Context) ( + result *GlobalResourceGroup, err error) { + if obj.Spec.ResourceGroupsGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Config", "ResourceGroups") + } + return obj.client.Global().GetResourceGroupByName(ctx, obj.Spec.ResourceGroupsGvk.Name) +} + +// AddResourceGroups calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalConfig) AddResourceGroups(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ResourceGroup) (result *GlobalResourceGroup, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["configs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["configs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateResourceGroupByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.Config = updatedObj.Config + } + return +} + +// DeleteResourceGroups calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalConfig) DeleteResourceGroups(ctx context.Context) (err error) { + if obj.Spec.ResourceGroupsGvk != nil { + err = obj.client. + Global().DeleteResourceGroupByName(ctx, obj.Spec.ResourceGroupsGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetConfigByName(ctx, obj.GetName()) + if err == nil { + obj.Config = updatedObj.Config + } + return +} + +// GetGlobalNamespace returns child of given type +func (obj *GlobalConfig) GetGlobalNamespace(ctx context.Context) ( + result *GlobalGlobalNamespace, err error) { + if obj.Spec.GlobalNamespaceGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Config", "GlobalNamespace") + } + return obj.client.Global().GetGlobalNamespaceByName(ctx, obj.Spec.GlobalNamespaceGvk.Name) +} + +// AddGlobalNamespace calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalConfig) AddGlobalNamespace(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GlobalNamespace) (result *GlobalGlobalNamespace, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["configs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["configs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGlobalNamespaceByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.Config = updatedObj.Config + } + return +} + +// DeleteGlobalNamespace calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalConfig) DeleteGlobalNamespace(ctx context.Context) (err error) { + if obj.Spec.GlobalNamespaceGvk != nil { + err = obj.client. + Global().DeleteGlobalNamespaceByName(ctx, obj.Spec.GlobalNamespaceGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetConfigByName(ctx, obj.GetName()) + if err == nil { + obj.Config = updatedObj.Config + } + return +} + +// GetPolicy returns child of given type +func (obj *GlobalConfig) GetPolicy(ctx context.Context) ( + result *GlobalAccessControlPolicy, err error) { + if obj.Spec.PolicyGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Config", "Policy") + } + return obj.client.Global().GetAccessControlPolicyByName(ctx, obj.Spec.PolicyGvk.Name) +} + +// AddPolicy calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalConfig) AddPolicy(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AccessControlPolicy) (result *GlobalAccessControlPolicy, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["configs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["configs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAccessControlPolicyByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.Config = updatedObj.Config + } + return +} + +// DeletePolicy calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalConfig) DeletePolicy(ctx context.Context) (err error) { + if obj.Spec.PolicyGvk != nil { + err = obj.client. + Global().DeleteAccessControlPolicyByName(ctx, obj.Spec.PolicyGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetConfigByName(ctx, obj.GetName()) + if err == nil { + obj.Config = updatedObj.Config + } + return +} + +// GetTemplates returns child of given type +func (obj *GlobalConfig) GetTemplates(ctx context.Context) ( + result *GlobalTemplate, err error) { + if obj.Spec.TemplatesGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Config", "Templates") + } + return obj.client.Global().GetTemplateByName(ctx, obj.Spec.TemplatesGvk.Name) +} + +// AddTemplates calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalConfig) AddTemplates(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Template) (result *GlobalTemplate, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["configs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["configs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateTemplateByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.Config = updatedObj.Config + } + return +} + +// DeleteTemplates calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalConfig) DeleteTemplates(ctx context.Context) (err error) { + if obj.Spec.TemplatesGvk != nil { + err = obj.client. + Global().DeleteTemplateByName(ctx, obj.Spec.TemplatesGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetConfigByName(ctx, obj.GetName()) + if err == nil { + obj.Config = updatedObj.Config + } + return +} + +// GetProgressiveUpgrade returns child of given type +func (obj *GlobalConfig) GetProgressiveUpgrade(ctx context.Context) ( + result *GlobalProgressiveUpgrade, err error) { + if obj.Spec.ProgressiveUpgradeGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Config", "ProgressiveUpgrade") + } + return obj.client.Global().GetProgressiveUpgradeByName(ctx, obj.Spec.ProgressiveUpgradeGvk.Name) +} + +// AddProgressiveUpgrade calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalConfig) AddProgressiveUpgrade(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgrade) (result *GlobalProgressiveUpgrade, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["configs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["configs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateProgressiveUpgradeByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.Config = updatedObj.Config + } + return +} + +// DeleteProgressiveUpgrade calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalConfig) DeleteProgressiveUpgrade(ctx context.Context) (err error) { + if obj.Spec.ProgressiveUpgradeGvk != nil { + err = obj.client. + Global().DeleteProgressiveUpgradeByName(ctx, obj.Spec.ProgressiveUpgradeGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetConfigByName(ctx, obj.GetName()) + if err == nil { + obj.Config = updatedObj.Config + } + return +} + +// GetExternalPlugins returns child of given type +func (obj *GlobalConfig) GetExternalPlugins(ctx context.Context) ( + result *GlobalExternalPluginConfigFolder, err error) { + if obj.Spec.ExternalPluginsGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Config", "ExternalPlugins") + } + return obj.client.Global().GetExternalPluginConfigFolderByName(ctx, obj.Spec.ExternalPluginsGvk.Name) +} + +// AddExternalPlugins calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalConfig) AddExternalPlugins(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder) (result *GlobalExternalPluginConfigFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["configs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["configs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalPluginConfigFolderByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.Config = updatedObj.Config + } + return +} + +// DeleteExternalPlugins calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalConfig) DeleteExternalPlugins(ctx context.Context) (err error) { + if obj.Spec.ExternalPluginsGvk != nil { + err = obj.client. + Global().DeleteExternalPluginConfigFolderByName(ctx, obj.Spec.ExternalPluginsGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetConfigByName(ctx, obj.GetName()) + if err == nil { + obj.Config = updatedObj.Config + } + return +} + +// GetAllCertificates returns all children of given type +func (obj *GlobalConfig) GetAllCertificates(ctx context.Context) ( + result []*GlobalCertificateConfigN, err error) { + result = make([]*GlobalCertificateConfigN, 0, len(obj.Spec.CertificatesGvk)) + for _, v := range obj.Spec.CertificatesGvk { + l, err := obj.client.Global().GetCertificateConfigNByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetCertificates returns child which has given displayName +func (obj *GlobalConfig) GetCertificates(ctx context.Context, + displayName string) (result *GlobalCertificateConfigN, err error) { + l, ok := obj.Spec.CertificatesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Config", "Certificates", displayName) + } + result, err = obj.client.Global().GetCertificateConfigNByName(ctx, l.Name) + return +} + +// AddCertificates calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalConfig) AddCertificates(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.CertificateConfigN) (result *GlobalCertificateConfigN, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["configs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["configs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateCertificateConfigNByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.Config = updatedObj.Config + } + return +} + +// DeleteCertificates calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalConfig) DeleteCertificates(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.CertificatesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Config", "Certificates", displayName) + } + err = obj.client.Global().DeleteCertificateConfigNByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if err == nil { + obj.Config = updatedObj.Config + } + return +} + +// GetAllExternalAccounts returns all children of given type +func (obj *GlobalConfig) GetAllExternalAccounts(ctx context.Context) ( + result []*GlobalExternalAccountConfigN, err error) { + result = make([]*GlobalExternalAccountConfigN, 0, len(obj.Spec.ExternalAccountsGvk)) + for _, v := range obj.Spec.ExternalAccountsGvk { + l, err := obj.client.Global().GetExternalAccountConfigNByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetExternalAccounts returns child which has given displayName +func (obj *GlobalConfig) GetExternalAccounts(ctx context.Context, + displayName string) (result *GlobalExternalAccountConfigN, err error) { + l, ok := obj.Spec.ExternalAccountsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Config", "ExternalAccounts", displayName) + } + result, err = obj.client.Global().GetExternalAccountConfigNByName(ctx, l.Name) + return +} + +// AddExternalAccounts calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalConfig) AddExternalAccounts(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalAccountConfigN) (result *GlobalExternalAccountConfigN, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["configs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["configs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalAccountConfigNByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.Config = updatedObj.Config + } + return +} + +// DeleteExternalAccounts calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalConfig) DeleteExternalAccounts(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ExternalAccountsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Config", "ExternalAccounts", displayName) + } + err = obj.client.Global().DeleteExternalAccountConfigNByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if err == nil { + obj.Config = updatedObj.Config + } + return +} + +// GetExternalAuditStorage returns child of given type +func (obj *GlobalConfig) GetExternalAuditStorage(ctx context.Context) ( + result *GlobalExternalAuditStorage, err error) { + if obj.Spec.ExternalAuditStorageGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Config", "ExternalAuditStorage") + } + return obj.client.Global().GetExternalAuditStorageByName(ctx, obj.Spec.ExternalAuditStorageGvk.Name) +} + +// AddExternalAuditStorage calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalConfig) AddExternalAuditStorage(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalAuditStorage) (result *GlobalExternalAuditStorage, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["configs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["configs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalAuditStorageByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.Config = updatedObj.Config + } + return +} + +// DeleteExternalAuditStorage calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalConfig) DeleteExternalAuditStorage(ctx context.Context) (err error) { + if obj.Spec.ExternalAuditStorageGvk != nil { + err = obj.client. + Global().DeleteExternalAuditStorageByName(ctx, obj.Spec.ExternalAuditStorageGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetConfigByName(ctx, obj.GetName()) + if err == nil { + obj.Config = updatedObj.Config + } + return +} + +// GetAllExternalDNS returns all children of given type +func (obj *GlobalConfig) GetAllExternalDNS(ctx context.Context) ( + result []*GlobalExternalDNSConfigN, err error) { + result = make([]*GlobalExternalDNSConfigN, 0, len(obj.Spec.ExternalDNSGvk)) + for _, v := range obj.Spec.ExternalDNSGvk { + l, err := obj.client.Global().GetExternalDNSConfigNByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetExternalDNS returns child which has given displayName +func (obj *GlobalConfig) GetExternalDNS(ctx context.Context, + displayName string) (result *GlobalExternalDNSConfigN, err error) { + l, ok := obj.Spec.ExternalDNSGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Config", "ExternalDNS", displayName) + } + result, err = obj.client.Global().GetExternalDNSConfigNByName(ctx, l.Name) + return +} + +// AddExternalDNS calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalConfig) AddExternalDNS(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSConfigN) (result *GlobalExternalDNSConfigN, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["configs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["configs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalDNSConfigNByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.Config = updatedObj.Config + } + return +} + +// DeleteExternalDNS calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalConfig) DeleteExternalDNS(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ExternalDNSGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Config", "ExternalDNS", displayName) + } + err = obj.client.Global().DeleteExternalDNSConfigNByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if err == nil { + obj.Config = updatedObj.Config + } + return +} + +// GetAllExternalLB returns all children of given type +func (obj *GlobalConfig) GetAllExternalLB(ctx context.Context) ( + result []*GlobalExternalLBConfigN, err error) { + result = make([]*GlobalExternalLBConfigN, 0, len(obj.Spec.ExternalLBGvk)) + for _, v := range obj.Spec.ExternalLBGvk { + l, err := obj.client.Global().GetExternalLBConfigNByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetExternalLB returns child which has given displayName +func (obj *GlobalConfig) GetExternalLB(ctx context.Context, + displayName string) (result *GlobalExternalLBConfigN, err error) { + l, ok := obj.Spec.ExternalLBGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Config", "ExternalLB", displayName) + } + result, err = obj.client.Global().GetExternalLBConfigNByName(ctx, l.Name) + return +} + +// AddExternalLB calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalConfig) AddExternalLB(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalLBConfigN) (result *GlobalExternalLBConfigN, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["configs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["configs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalLBConfigNByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.Config = updatedObj.Config + } + return +} + +// DeleteExternalLB calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalConfig) DeleteExternalLB(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ExternalLBGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Config", "ExternalLB", displayName) + } + err = obj.client.Global().DeleteExternalLBConfigNByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if err == nil { + obj.Config = updatedObj.Config + } + return +} + +// GetAutoscalerFolder returns child of given type +func (obj *GlobalConfig) GetAutoscalerFolder(ctx context.Context) ( + result *GlobalAutoscalerFolder, err error) { + if obj.Spec.AutoscalerFolderGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Config", "AutoscalerFolder") + } + return obj.client.Global().GetAutoscalerFolderByName(ctx, obj.Spec.AutoscalerFolderGvk.Name) +} + +// AddAutoscalerFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalConfig) AddAutoscalerFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AutoscalerFolder) (result *GlobalAutoscalerFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["configs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["configs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAutoscalerFolderByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.Config = updatedObj.Config + } + return +} + +// DeleteAutoscalerFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalConfig) DeleteAutoscalerFolder(ctx context.Context) (err error) { + if obj.Spec.AutoscalerFolderGvk != nil { + err = obj.client. + Global().DeleteAutoscalerFolderByName(ctx, obj.Spec.AutoscalerFolderGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetConfigByName(ctx, obj.GetName()) + if err == nil { + obj.Config = updatedObj.Config + } + return +} + +// GetClusters returns child of given type +func (obj *GlobalConfig) GetClusters(ctx context.Context) ( + result *GlobalClusterConfigFolder, err error) { + if obj.Spec.ClustersGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Config", "Clusters") + } + return obj.client.Global().GetClusterConfigFolderByName(ctx, obj.Spec.ClustersGvk.Name) +} + +// AddClusters calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalConfig) AddClusters(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ClusterConfigFolder) (result *GlobalClusterConfigFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["configs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["configs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateClusterConfigFolderByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.Config = updatedObj.Config + } + return +} + +// DeleteClusters calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalConfig) DeleteClusters(ctx context.Context) (err error) { + if obj.Spec.ClustersGvk != nil { + err = obj.client. + Global().DeleteClusterConfigFolderByName(ctx, obj.Spec.ClustersGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetConfigByName(ctx, obj.GetName()) + if err == nil { + obj.Config = updatedObj.Config + } + return +} + +// GetServiceLevelObjective returns child of given type +func (obj *GlobalConfig) GetServiceLevelObjective(ctx context.Context) ( + result *GlobalServiceLevelObjectiveFolder, err error) { + if obj.Spec.ServiceLevelObjectiveGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Config", "ServiceLevelObjective") + } + return obj.client.Global().GetServiceLevelObjectiveFolderByName(ctx, obj.Spec.ServiceLevelObjectiveGvk.Name) +} + +// AddServiceLevelObjective calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalConfig) AddServiceLevelObjective(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder) (result *GlobalServiceLevelObjectiveFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["configs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["configs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceLevelObjectiveFolderByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.Config = updatedObj.Config + } + return +} + +// DeleteServiceLevelObjective calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalConfig) DeleteServiceLevelObjective(ctx context.Context) (err error) { + if obj.Spec.ServiceLevelObjectiveGvk != nil { + err = obj.client. + Global().DeleteServiceLevelObjectiveFolderByName(ctx, obj.Spec.ServiceLevelObjectiveGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetConfigByName(ctx, obj.GetName()) + if err == nil { + obj.Config = updatedObj.Config + } + return +} + +// GetAllFeatureFlags returns all children of given type +func (obj *GlobalConfig) GetAllFeatureFlags(ctx context.Context) ( + result []*GlobalFeatureFlag, err error) { + result = make([]*GlobalFeatureFlag, 0, len(obj.Spec.FeatureFlagsGvk)) + for _, v := range obj.Spec.FeatureFlagsGvk { + l, err := obj.client.Global().GetFeatureFlagByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetFeatureFlags returns child which has given displayName +func (obj *GlobalConfig) GetFeatureFlags(ctx context.Context, + displayName string) (result *GlobalFeatureFlag, err error) { + l, ok := obj.Spec.FeatureFlagsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Config", "FeatureFlags", displayName) + } + result, err = obj.client.Global().GetFeatureFlagByName(ctx, l.Name) + return +} + +// AddFeatureFlags calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalConfig) AddFeatureFlags(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.FeatureFlag) (result *GlobalFeatureFlag, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["configs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["configs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateFeatureFlagByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.Config = updatedObj.Config + } + return +} + +// DeleteFeatureFlags calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalConfig) DeleteFeatureFlags(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.FeatureFlagsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Config", "FeatureFlags", displayName) + } + err = obj.client.Global().DeleteFeatureFlagByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if err == nil { + obj.Config = updatedObj.Config + } + return +} + +// GetAllProjects returns all children of given type +func (obj *GlobalConfig) GetAllProjects(ctx context.Context) ( + result []*GlobalProject, err error) { + result = make([]*GlobalProject, 0, len(obj.Spec.ProjectsGvk)) + for _, v := range obj.Spec.ProjectsGvk { + l, err := obj.client.Global().GetProjectByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetProjects returns child which has given displayName +func (obj *GlobalConfig) GetProjects(ctx context.Context, + displayName string) (result *GlobalProject, err error) { + l, ok := obj.Spec.ProjectsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Config", "Projects", displayName) + } + result, err = obj.client.Global().GetProjectByName(ctx, l.Name) + return +} + +// AddProjects calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalConfig) AddProjects(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Project) (result *GlobalProject, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["configs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["configs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateProjectByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.Config = updatedObj.Config + } + return +} + +// DeleteProjects calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalConfig) DeleteProjects(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ProjectsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Config", "Projects", displayName) + } + err = obj.client.Global().DeleteProjectByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if err == nil { + obj.Config = updatedObj.Config + } + return +} + +// GetAllServiceDirectory returns all children of given type +func (obj *GlobalConfig) GetAllServiceDirectory(ctx context.Context) ( + result []*GlobalServiceDirectoryN, err error) { + result = make([]*GlobalServiceDirectoryN, 0, len(obj.Spec.ServiceDirectoryGvk)) + for _, v := range obj.Spec.ServiceDirectoryGvk { + l, err := obj.client.Global().GetServiceDirectoryNByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceDirectory returns child which has given displayName +func (obj *GlobalConfig) GetServiceDirectory(ctx context.Context, + displayName string) (result *GlobalServiceDirectoryN, err error) { + l, ok := obj.Spec.ServiceDirectoryGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Config", "ServiceDirectory", displayName) + } + result, err = obj.client.Global().GetServiceDirectoryNByName(ctx, l.Name) + return +} + +// AddServiceDirectory calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalConfig) AddServiceDirectory(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryN) (result *GlobalServiceDirectoryN, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["configs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["configs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceDirectoryNByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.Config = updatedObj.Config + } + return +} + +// DeleteServiceDirectory calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalConfig) DeleteServiceDirectory(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceDirectoryGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Config", "ServiceDirectory", displayName) + } + err = obj.client.Global().DeleteServiceDirectoryNByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetConfigByName(ctx, obj.GetName()) + if err == nil { + obj.Config = updatedObj.Config + } + return +} + +type configGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *configGlobalTsmV1Chainer) Subscribe() { + key := "configs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *configGlobalTsmV1Chainer) Unsubscribe() { + key := "configs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *configGlobalTsmV1Chainer) IsSubscribed() bool { + key := "configs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *configGlobalTsmV1Chainer) ResourceGroups(name string) *resourcegroupGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["resourcegroups.global.tsm.tanzu.vmware.com"] = name + return &resourcegroupGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetResourceGroups calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *configGlobalTsmV1Chainer) GetResourceGroups(ctx context.Context, displayName string) (result *GlobalResourceGroup, err error) { + hashedName := helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetResourceGroupByName(ctx, hashedName) +} + +// AddResourceGroups calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *configGlobalTsmV1Chainer) AddResourceGroups(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ResourceGroup) (result *GlobalResourceGroup, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateResourceGroupByName(ctx, objToCreate) +} + +// DeleteResourceGroups calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *configGlobalTsmV1Chainer) DeleteResourceGroups(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteResourceGroupByName(ctx, hashedName) +} + +func (c *configGlobalTsmV1Chainer) GlobalNamespace(name string) *globalnamespaceGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["globalnamespaces.global.tsm.tanzu.vmware.com"] = name + return &globalnamespaceGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGlobalNamespace calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *configGlobalTsmV1Chainer) GetGlobalNamespace(ctx context.Context, displayName string) (result *GlobalGlobalNamespace, err error) { + hashedName := helper.GetHashedName("globalnamespaces.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGlobalNamespaceByName(ctx, hashedName) +} + +// AddGlobalNamespace calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *configGlobalTsmV1Chainer) AddGlobalNamespace(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GlobalNamespace) (result *GlobalGlobalNamespace, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("globalnamespaces.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGlobalNamespaceByName(ctx, objToCreate) +} + +// DeleteGlobalNamespace calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *configGlobalTsmV1Chainer) DeleteGlobalNamespace(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("globalnamespaces.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGlobalNamespaceByName(ctx, hashedName) +} + +func (c *configGlobalTsmV1Chainer) Policy(name string) *accesscontrolpolicyGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["accesscontrolpolicies.global.tsm.tanzu.vmware.com"] = name + return &accesscontrolpolicyGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetPolicy calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *configGlobalTsmV1Chainer) GetPolicy(ctx context.Context, displayName string) (result *GlobalAccessControlPolicy, err error) { + hashedName := helper.GetHashedName("accesscontrolpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAccessControlPolicyByName(ctx, hashedName) +} + +// AddPolicy calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *configGlobalTsmV1Chainer) AddPolicy(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AccessControlPolicy) (result *GlobalAccessControlPolicy, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("accesscontrolpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAccessControlPolicyByName(ctx, objToCreate) +} + +// DeletePolicy calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *configGlobalTsmV1Chainer) DeletePolicy(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("accesscontrolpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAccessControlPolicyByName(ctx, hashedName) +} + +func (c *configGlobalTsmV1Chainer) Templates(name string) *templateGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["templates.global.tsm.tanzu.vmware.com"] = name + return &templateGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetTemplates calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *configGlobalTsmV1Chainer) GetTemplates(ctx context.Context, displayName string) (result *GlobalTemplate, err error) { + hashedName := helper.GetHashedName("templates.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetTemplateByName(ctx, hashedName) +} + +// AddTemplates calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *configGlobalTsmV1Chainer) AddTemplates(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Template) (result *GlobalTemplate, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("templates.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateTemplateByName(ctx, objToCreate) +} + +// DeleteTemplates calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *configGlobalTsmV1Chainer) DeleteTemplates(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("templates.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteTemplateByName(ctx, hashedName) +} + +func (c *configGlobalTsmV1Chainer) ProgressiveUpgrade(name string) *progressiveupgradeGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["progressiveupgrades.global.tsm.tanzu.vmware.com"] = name + return &progressiveupgradeGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetProgressiveUpgrade calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *configGlobalTsmV1Chainer) GetProgressiveUpgrade(ctx context.Context, displayName string) (result *GlobalProgressiveUpgrade, err error) { + hashedName := helper.GetHashedName("progressiveupgrades.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetProgressiveUpgradeByName(ctx, hashedName) +} + +// AddProgressiveUpgrade calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *configGlobalTsmV1Chainer) AddProgressiveUpgrade(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgrade) (result *GlobalProgressiveUpgrade, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("progressiveupgrades.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateProgressiveUpgradeByName(ctx, objToCreate) +} + +// DeleteProgressiveUpgrade calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *configGlobalTsmV1Chainer) DeleteProgressiveUpgrade(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("progressiveupgrades.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteProgressiveUpgradeByName(ctx, hashedName) +} + +func (c *configGlobalTsmV1Chainer) ExternalPlugins(name string) *externalpluginconfigfolderGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externalpluginconfigfolders.global.tsm.tanzu.vmware.com"] = name + return &externalpluginconfigfolderGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetExternalPlugins calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *configGlobalTsmV1Chainer) GetExternalPlugins(ctx context.Context, displayName string) (result *GlobalExternalPluginConfigFolder, err error) { + hashedName := helper.GetHashedName("externalpluginconfigfolders.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalPluginConfigFolderByName(ctx, hashedName) +} + +// AddExternalPlugins calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *configGlobalTsmV1Chainer) AddExternalPlugins(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder) (result *GlobalExternalPluginConfigFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalpluginconfigfolders.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalPluginConfigFolderByName(ctx, objToCreate) +} + +// DeleteExternalPlugins calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *configGlobalTsmV1Chainer) DeleteExternalPlugins(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalpluginconfigfolders.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalPluginConfigFolderByName(ctx, hashedName) +} + +func (c *configGlobalTsmV1Chainer) Certificates(name string) *certificateconfignGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["certificateconfigns.global.tsm.tanzu.vmware.com"] = name + return &certificateconfignGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetCertificates calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *configGlobalTsmV1Chainer) GetCertificates(ctx context.Context, displayName string) (result *GlobalCertificateConfigN, err error) { + hashedName := helper.GetHashedName("certificateconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetCertificateConfigNByName(ctx, hashedName) +} + +// AddCertificates calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *configGlobalTsmV1Chainer) AddCertificates(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.CertificateConfigN) (result *GlobalCertificateConfigN, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("certificateconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateCertificateConfigNByName(ctx, objToCreate) +} + +// DeleteCertificates calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *configGlobalTsmV1Chainer) DeleteCertificates(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("certificateconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteCertificateConfigNByName(ctx, hashedName) +} + +func (c *configGlobalTsmV1Chainer) ExternalAccounts(name string) *externalaccountconfignGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externalaccountconfigns.global.tsm.tanzu.vmware.com"] = name + return &externalaccountconfignGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetExternalAccounts calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *configGlobalTsmV1Chainer) GetExternalAccounts(ctx context.Context, displayName string) (result *GlobalExternalAccountConfigN, err error) { + hashedName := helper.GetHashedName("externalaccountconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalAccountConfigNByName(ctx, hashedName) +} + +// AddExternalAccounts calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *configGlobalTsmV1Chainer) AddExternalAccounts(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalAccountConfigN) (result *GlobalExternalAccountConfigN, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalaccountconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalAccountConfigNByName(ctx, objToCreate) +} + +// DeleteExternalAccounts calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *configGlobalTsmV1Chainer) DeleteExternalAccounts(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalaccountconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalAccountConfigNByName(ctx, hashedName) +} + +func (c *configGlobalTsmV1Chainer) ExternalAuditStorage(name string) *externalauditstorageGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externalauditstorages.global.tsm.tanzu.vmware.com"] = name + return &externalauditstorageGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetExternalAuditStorage calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *configGlobalTsmV1Chainer) GetExternalAuditStorage(ctx context.Context, displayName string) (result *GlobalExternalAuditStorage, err error) { + hashedName := helper.GetHashedName("externalauditstorages.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalAuditStorageByName(ctx, hashedName) +} + +// AddExternalAuditStorage calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *configGlobalTsmV1Chainer) AddExternalAuditStorage(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalAuditStorage) (result *GlobalExternalAuditStorage, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalauditstorages.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalAuditStorageByName(ctx, objToCreate) +} + +// DeleteExternalAuditStorage calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *configGlobalTsmV1Chainer) DeleteExternalAuditStorage(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalauditstorages.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalAuditStorageByName(ctx, hashedName) +} + +func (c *configGlobalTsmV1Chainer) ExternalDNS(name string) *externaldnsconfignGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externaldnsconfigns.global.tsm.tanzu.vmware.com"] = name + return &externaldnsconfignGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetExternalDNS calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *configGlobalTsmV1Chainer) GetExternalDNS(ctx context.Context, displayName string) (result *GlobalExternalDNSConfigN, err error) { + hashedName := helper.GetHashedName("externaldnsconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalDNSConfigNByName(ctx, hashedName) +} + +// AddExternalDNS calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *configGlobalTsmV1Chainer) AddExternalDNS(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSConfigN) (result *GlobalExternalDNSConfigN, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalDNSConfigNByName(ctx, objToCreate) +} + +// DeleteExternalDNS calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *configGlobalTsmV1Chainer) DeleteExternalDNS(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalDNSConfigNByName(ctx, hashedName) +} + +func (c *configGlobalTsmV1Chainer) ExternalLB(name string) *externallbconfignGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externallbconfigns.global.tsm.tanzu.vmware.com"] = name + return &externallbconfignGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetExternalLB calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *configGlobalTsmV1Chainer) GetExternalLB(ctx context.Context, displayName string) (result *GlobalExternalLBConfigN, err error) { + hashedName := helper.GetHashedName("externallbconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalLBConfigNByName(ctx, hashedName) +} + +// AddExternalLB calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *configGlobalTsmV1Chainer) AddExternalLB(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalLBConfigN) (result *GlobalExternalLBConfigN, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externallbconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalLBConfigNByName(ctx, objToCreate) +} + +// DeleteExternalLB calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *configGlobalTsmV1Chainer) DeleteExternalLB(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externallbconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalLBConfigNByName(ctx, hashedName) +} + +func (c *configGlobalTsmV1Chainer) AutoscalerFolder(name string) *autoscalerfolderGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["autoscalerfolders.global.tsm.tanzu.vmware.com"] = name + return &autoscalerfolderGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetAutoscalerFolder calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *configGlobalTsmV1Chainer) GetAutoscalerFolder(ctx context.Context, displayName string) (result *GlobalAutoscalerFolder, err error) { + hashedName := helper.GetHashedName("autoscalerfolders.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAutoscalerFolderByName(ctx, hashedName) +} + +// AddAutoscalerFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *configGlobalTsmV1Chainer) AddAutoscalerFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AutoscalerFolder) (result *GlobalAutoscalerFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("autoscalerfolders.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAutoscalerFolderByName(ctx, objToCreate) +} + +// DeleteAutoscalerFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *configGlobalTsmV1Chainer) DeleteAutoscalerFolder(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("autoscalerfolders.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAutoscalerFolderByName(ctx, hashedName) +} + +func (c *configGlobalTsmV1Chainer) Clusters(name string) *clusterconfigfolderGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["clusterconfigfolders.global.tsm.tanzu.vmware.com"] = name + return &clusterconfigfolderGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetClusters calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *configGlobalTsmV1Chainer) GetClusters(ctx context.Context, displayName string) (result *GlobalClusterConfigFolder, err error) { + hashedName := helper.GetHashedName("clusterconfigfolders.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetClusterConfigFolderByName(ctx, hashedName) +} + +// AddClusters calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *configGlobalTsmV1Chainer) AddClusters(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ClusterConfigFolder) (result *GlobalClusterConfigFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("clusterconfigfolders.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateClusterConfigFolderByName(ctx, objToCreate) +} + +// DeleteClusters calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *configGlobalTsmV1Chainer) DeleteClusters(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("clusterconfigfolders.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteClusterConfigFolderByName(ctx, hashedName) +} + +func (c *configGlobalTsmV1Chainer) ServiceLevelObjective(name string) *servicelevelobjectivefolderGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["servicelevelobjectivefolders.global.tsm.tanzu.vmware.com"] = name + return &servicelevelobjectivefolderGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceLevelObjective calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *configGlobalTsmV1Chainer) GetServiceLevelObjective(ctx context.Context, displayName string) (result *GlobalServiceLevelObjectiveFolder, err error) { + hashedName := helper.GetHashedName("servicelevelobjectivefolders.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceLevelObjectiveFolderByName(ctx, hashedName) +} + +// AddServiceLevelObjective calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *configGlobalTsmV1Chainer) AddServiceLevelObjective(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder) (result *GlobalServiceLevelObjectiveFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicelevelobjectivefolders.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceLevelObjectiveFolderByName(ctx, objToCreate) +} + +// DeleteServiceLevelObjective calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *configGlobalTsmV1Chainer) DeleteServiceLevelObjective(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicelevelobjectivefolders.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceLevelObjectiveFolderByName(ctx, hashedName) +} + +func (c *configGlobalTsmV1Chainer) FeatureFlags(name string) *featureflagGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["featureflags.global.tsm.tanzu.vmware.com"] = name + return &featureflagGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetFeatureFlags calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *configGlobalTsmV1Chainer) GetFeatureFlags(ctx context.Context, displayName string) (result *GlobalFeatureFlag, err error) { + hashedName := helper.GetHashedName("featureflags.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetFeatureFlagByName(ctx, hashedName) +} + +// AddFeatureFlags calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *configGlobalTsmV1Chainer) AddFeatureFlags(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.FeatureFlag) (result *GlobalFeatureFlag, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("featureflags.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateFeatureFlagByName(ctx, objToCreate) +} + +// DeleteFeatureFlags calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *configGlobalTsmV1Chainer) DeleteFeatureFlags(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("featureflags.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteFeatureFlagByName(ctx, hashedName) +} + +func (c *configGlobalTsmV1Chainer) Projects(name string) *projectGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["projects.global.tsm.tanzu.vmware.com"] = name + return &projectGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetProjects calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *configGlobalTsmV1Chainer) GetProjects(ctx context.Context, displayName string) (result *GlobalProject, err error) { + hashedName := helper.GetHashedName("projects.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetProjectByName(ctx, hashedName) +} + +// AddProjects calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *configGlobalTsmV1Chainer) AddProjects(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Project) (result *GlobalProject, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("projects.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateProjectByName(ctx, objToCreate) +} + +// DeleteProjects calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *configGlobalTsmV1Chainer) DeleteProjects(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("projects.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteProjectByName(ctx, hashedName) +} + +func (c *configGlobalTsmV1Chainer) ServiceDirectory(name string) *servicedirectorynGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["servicedirectoryns.global.tsm.tanzu.vmware.com"] = name + return &servicedirectorynGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceDirectory calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *configGlobalTsmV1Chainer) GetServiceDirectory(ctx context.Context, displayName string) (result *GlobalServiceDirectoryN, err error) { + hashedName := helper.GetHashedName("servicedirectoryns.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceDirectoryNByName(ctx, hashedName) +} + +// AddServiceDirectory calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *configGlobalTsmV1Chainer) AddServiceDirectory(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryN) (result *GlobalServiceDirectoryN, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicedirectoryns.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceDirectoryNByName(ctx, objToCreate) +} + +// DeleteServiceDirectory calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *configGlobalTsmV1Chainer) DeleteServiceDirectory(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicedirectoryns.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceDirectoryNByName(ctx, hashedName) +} + +// GetConnectionStatusByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetConnectionStatusByName(ctx context.Context, hashedName string) (*GlobalConnectionStatus, error) { + key := "connectionstatuses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ConnectionStatus) + return &GlobalConnectionStatus{ + client: group.client, + ConnectionStatus: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ConnectionStatuses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalConnectionStatus{ + client: group.client, + ConnectionStatus: result, + }, nil + } +} + +// DeleteConnectionStatusByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteConnectionStatusByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ConnectionStatuses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ConnectionStatuses().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/connectionStatusGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["clusters.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Clusters().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateConnectionStatusByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateConnectionStatusByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ConnectionStatus) (*GlobalConnectionStatus, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ConnectionStatuses().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["clusters.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/connectionStatusGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ConnectionStatus", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Clusters().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalConnectionStatus{ + client: group.client, + ConnectionStatus: result, + }, nil +} + +// UpdateConnectionStatusByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateConnectionStatusByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ConnectionStatus) (*GlobalConnectionStatus, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ConnectionStatuses().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueConnected := + objToUpdate.Spec.Connected + patchOpConnected := PatchOp{ + Op: "replace", + Path: "/spec/connected", + Value: patchValueConnected, + } + patch = append(patch, patchOpConnected) + + patchValueMessage := + objToUpdate.Spec.Message + patchOpMessage := PatchOp{ + Op: "replace", + Path: "/spec/message", + Value: patchValueMessage, + } + patch = append(patch, patchOpMessage) + + patchValueCode := + objToUpdate.Spec.Code + patchOpCode := PatchOp{ + Op: "replace", + Path: "/spec/code", + Value: patchValueCode, + } + patch = append(patch, patchOpCode) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ConnectionStatuses().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalConnectionStatus{ + client: group.client, + ConnectionStatus: result, + }, nil +} + +// ListConnectionStatuses returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListConnectionStatuses(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalConnectionStatus, err error) { + key := "connectionstatuses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalConnectionStatus, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ConnectionStatus) + result[k] = &GlobalConnectionStatus{ + client: group.client, + ConnectionStatus: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ConnectionStatuses().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalConnectionStatus, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalConnectionStatus{ + client: group.client, + ConnectionStatus: &item, + } + } + } + return +} + +type GlobalConnectionStatus struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ConnectionStatus +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalConnectionStatus) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteConnectionStatusByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ConnectionStatus = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalConnectionStatus) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateConnectionStatusByName(ctx, obj.ConnectionStatus) + if err != nil { + return err + } + obj.ConnectionStatus = result.ConnectionStatus + return nil +} + +func (obj *GlobalConnectionStatus) GetParent(ctx context.Context) (result *GlobalCluster, err error) { + hashedName := helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["clusters.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetClusterByName(ctx, hashedName) +} + +type connectionstatusGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *connectionstatusGlobalTsmV1Chainer) Subscribe() { + key := "connectionstatuses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewConnectionStatusInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *connectionstatusGlobalTsmV1Chainer) Unsubscribe() { + key := "connectionstatuses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *connectionstatusGlobalTsmV1Chainer) IsSubscribed() bool { + key := "connectionstatuses.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetDataFolderDomainClusterByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDataFolderDomainClusterByName(ctx context.Context, hashedName string) (*GlobalDataFolderDomainCluster, error) { + key := "datafolderdomainclusters.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.DataFolderDomainCluster) + return &GlobalDataFolderDomainCluster{ + client: group.client, + DataFolderDomainCluster: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainClusters().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDataFolderDomainCluster{ + client: group.client, + DataFolderDomainCluster: result, + }, nil + } +} + +// DeleteDataFolderDomainClusterByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDataFolderDomainClusterByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainClusters().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainClusters().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/clusterGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["datafolderdomains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("datafolderdomains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DataFolderDomains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDataFolderDomainClusterByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDataFolderDomainClusterByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataFolderDomainCluster) (*GlobalDataFolderDomainCluster, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainClusters().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["datafolderdomains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("datafolderdomains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/clusterGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "DataFolderDomainCluster", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DataFolderDomains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDataFolderDomainCluster{ + client: group.client, + DataFolderDomainCluster: result, + }, nil +} + +// UpdateDataFolderDomainClusterByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDataFolderDomainClusterByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.DataFolderDomainCluster) (*GlobalDataFolderDomainCluster, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainClusters().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainClusters().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDataFolderDomainCluster{ + client: group.client, + DataFolderDomainCluster: result, + }, nil +} + +// ListDataFolderDomainClusters returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDataFolderDomainClusters(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDataFolderDomainCluster, err error) { + key := "datafolderdomainclusters.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDataFolderDomainCluster, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.DataFolderDomainCluster) + result[k] = &GlobalDataFolderDomainCluster{ + client: group.client, + DataFolderDomainCluster: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + DataFolderDomainClusters().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDataFolderDomainCluster, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDataFolderDomainCluster{ + client: group.client, + DataFolderDomainCluster: &item, + } + } + } + return +} + +type GlobalDataFolderDomainCluster struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.DataFolderDomainCluster +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDataFolderDomainCluster) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDataFolderDomainClusterByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.DataFolderDomainCluster = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDataFolderDomainCluster) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDataFolderDomainClusterByName(ctx, obj.DataFolderDomainCluster) + if err != nil { + return err + } + obj.DataFolderDomainCluster = result.DataFolderDomainCluster + return nil +} + +func (obj *GlobalDataFolderDomainCluster) GetParent(ctx context.Context) (result *GlobalDataFolderDomain, err error) { + hashedName := helper.GetHashedName("datafolderdomains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["datafolderdomains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDataFolderDomainByName(ctx, hashedName) +} + +type datafolderdomainclusterGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *datafolderdomainclusterGlobalTsmV1Chainer) Subscribe() { + key := "datafolderdomainclusters.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDataFolderDomainClusterInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *datafolderdomainclusterGlobalTsmV1Chainer) Unsubscribe() { + key := "datafolderdomainclusters.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *datafolderdomainclusterGlobalTsmV1Chainer) IsSubscribed() bool { + key := "datafolderdomainclusters.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetDataFolderDomainServiceVersionByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDataFolderDomainServiceVersionByName(ctx context.Context, hashedName string) (*GlobalDataFolderDomainServiceVersion, error) { + key := "datafolderdomainserviceversions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion) + return &GlobalDataFolderDomainServiceVersion{ + client: group.client, + DataFolderDomainServiceVersion: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainServiceVersions().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDataFolderDomainServiceVersion{ + client: group.client, + DataFolderDomainServiceVersion: result, + }, nil + } +} + +// DeleteDataFolderDomainServiceVersionByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDataFolderDomainServiceVersionByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainServiceVersions().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainServiceVersions().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/versionsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["datafolderdomainservices.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("datafolderdomainservices.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainServices().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDataFolderDomainServiceVersionByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDataFolderDomainServiceVersionByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion) (*GlobalDataFolderDomainServiceVersion, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainServiceVersions().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["datafolderdomainservices.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("datafolderdomainservices.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"versionsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"DataFolderDomainServiceVersion\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainServices().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDataFolderDomainServiceVersion{ + client: group.client, + DataFolderDomainServiceVersion: result, + }, nil +} + +// UpdateDataFolderDomainServiceVersionByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDataFolderDomainServiceVersionByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion) (*GlobalDataFolderDomainServiceVersion, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainServiceVersions().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainServiceVersions().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDataFolderDomainServiceVersion{ + client: group.client, + DataFolderDomainServiceVersion: result, + }, nil +} + +// ListDataFolderDomainServiceVersions returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDataFolderDomainServiceVersions(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDataFolderDomainServiceVersion, err error) { + key := "datafolderdomainserviceversions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDataFolderDomainServiceVersion, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion) + result[k] = &GlobalDataFolderDomainServiceVersion{ + client: group.client, + DataFolderDomainServiceVersion: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + DataFolderDomainServiceVersions().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDataFolderDomainServiceVersion, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDataFolderDomainServiceVersion{ + client: group.client, + DataFolderDomainServiceVersion: &item, + } + } + } + return +} + +type GlobalDataFolderDomainServiceVersion struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDataFolderDomainServiceVersion) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDataFolderDomainServiceVersionByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.DataFolderDomainServiceVersion = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDataFolderDomainServiceVersion) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDataFolderDomainServiceVersionByName(ctx, obj.DataFolderDomainServiceVersion) + if err != nil { + return err + } + obj.DataFolderDomainServiceVersion = result.DataFolderDomainServiceVersion + return nil +} + +func (obj *GlobalDataFolderDomainServiceVersion) GetParent(ctx context.Context) (result *GlobalDataFolderDomainService, err error) { + hashedName := helper.GetHashedName("datafolderdomainservices.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["datafolderdomainservices.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDataFolderDomainServiceByName(ctx, hashedName) +} + +type datafolderdomainserviceversionGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *datafolderdomainserviceversionGlobalTsmV1Chainer) Subscribe() { + key := "datafolderdomainserviceversions.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDataFolderDomainServiceVersionInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *datafolderdomainserviceversionGlobalTsmV1Chainer) Unsubscribe() { + key := "datafolderdomainserviceversions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *datafolderdomainserviceversionGlobalTsmV1Chainer) IsSubscribed() bool { + key := "datafolderdomainserviceversions.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetDataFolderDomainServiceByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDataFolderDomainServiceByName(ctx context.Context, hashedName string) (*GlobalDataFolderDomainService, error) { + key := "datafolderdomainservices.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.DataFolderDomainService) + return &GlobalDataFolderDomainService{ + client: group.client, + DataFolderDomainService: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainServices().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDataFolderDomainService{ + client: group.client, + DataFolderDomainService: result, + }, nil + } +} + +// DeleteDataFolderDomainServiceByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDataFolderDomainServiceByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainServices().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.VersionsGvk { + err := group.client. + Global().DeleteDataFolderDomainServiceVersionByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainServices().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["datafolderdomains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("datafolderdomains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DataFolderDomains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDataFolderDomainServiceByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDataFolderDomainServiceByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataFolderDomainService) (*GlobalDataFolderDomainService, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.VersionsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainServices().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["datafolderdomains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("datafolderdomains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"DataFolderDomainService\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DataFolderDomains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDataFolderDomainService{ + client: group.client, + DataFolderDomainService: result, + }, nil +} + +// UpdateDataFolderDomainServiceByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDataFolderDomainServiceByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.DataFolderDomainService) (*GlobalDataFolderDomainService, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainServices().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomainServices().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDataFolderDomainService{ + client: group.client, + DataFolderDomainService: result, + }, nil +} + +// ListDataFolderDomainServices returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDataFolderDomainServices(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDataFolderDomainService, err error) { + key := "datafolderdomainservices.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDataFolderDomainService, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.DataFolderDomainService) + result[k] = &GlobalDataFolderDomainService{ + client: group.client, + DataFolderDomainService: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + DataFolderDomainServices().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDataFolderDomainService, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDataFolderDomainService{ + client: group.client, + DataFolderDomainService: &item, + } + } + } + return +} + +type GlobalDataFolderDomainService struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.DataFolderDomainService +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDataFolderDomainService) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDataFolderDomainServiceByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.DataFolderDomainService = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDataFolderDomainService) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDataFolderDomainServiceByName(ctx, obj.DataFolderDomainService) + if err != nil { + return err + } + obj.DataFolderDomainService = result.DataFolderDomainService + return nil +} + +func (obj *GlobalDataFolderDomainService) GetParent(ctx context.Context) (result *GlobalDataFolderDomain, err error) { + hashedName := helper.GetHashedName("datafolderdomains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["datafolderdomains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDataFolderDomainByName(ctx, hashedName) +} + +// GetAllVersions returns all children of given type +func (obj *GlobalDataFolderDomainService) GetAllVersions(ctx context.Context) ( + result []*GlobalDataFolderDomainServiceVersion, err error) { + result = make([]*GlobalDataFolderDomainServiceVersion, 0, len(obj.Spec.VersionsGvk)) + for _, v := range obj.Spec.VersionsGvk { + l, err := obj.client.Global().GetDataFolderDomainServiceVersionByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetVersions returns child which has given displayName +func (obj *GlobalDataFolderDomainService) GetVersions(ctx context.Context, + displayName string) (result *GlobalDataFolderDomainServiceVersion, err error) { + l, ok := obj.Spec.VersionsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DataFolderDomainService", "Versions", displayName) + } + result, err = obj.client.Global().GetDataFolderDomainServiceVersionByName(ctx, l.Name) + return +} + +// AddVersions calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDataFolderDomainService) AddVersions(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion) (result *GlobalDataFolderDomainServiceVersion, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["datafolderdomainservices.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["datafolderdomainservices.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDataFolderDomainServiceVersionByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDataFolderDomainServiceByName(ctx, obj.GetName()) + if getErr == nil { + obj.DataFolderDomainService = updatedObj.DataFolderDomainService + } + return +} + +// DeleteVersions calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDataFolderDomainService) DeleteVersions(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.VersionsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DataFolderDomainService", "Versions", displayName) + } + err = obj.client.Global().DeleteDataFolderDomainServiceVersionByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDataFolderDomainServiceByName(ctx, obj.GetName()) + if err == nil { + obj.DataFolderDomainService = updatedObj.DataFolderDomainService + } + return +} + +type datafolderdomainserviceGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *datafolderdomainserviceGlobalTsmV1Chainer) Subscribe() { + key := "datafolderdomainservices.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDataFolderDomainServiceInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *datafolderdomainserviceGlobalTsmV1Chainer) Unsubscribe() { + key := "datafolderdomainservices.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *datafolderdomainserviceGlobalTsmV1Chainer) IsSubscribed() bool { + key := "datafolderdomainservices.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *datafolderdomainserviceGlobalTsmV1Chainer) Versions(name string) *datafolderdomainserviceversionGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["datafolderdomainserviceversions.global.tsm.tanzu.vmware.com"] = name + return &datafolderdomainserviceversionGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetVersions calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *datafolderdomainserviceGlobalTsmV1Chainer) GetVersions(ctx context.Context, displayName string) (result *GlobalDataFolderDomainServiceVersion, err error) { + hashedName := helper.GetHashedName("datafolderdomainserviceversions.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetDataFolderDomainServiceVersionByName(ctx, hashedName) +} + +// AddVersions calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *datafolderdomainserviceGlobalTsmV1Chainer) AddVersions(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataFolderDomainServiceVersion) (result *GlobalDataFolderDomainServiceVersion, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("datafolderdomainserviceversions.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDataFolderDomainServiceVersionByName(ctx, objToCreate) +} + +// DeleteVersions calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *datafolderdomainserviceGlobalTsmV1Chainer) DeleteVersions(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("datafolderdomainserviceversions.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDataFolderDomainServiceVersionByName(ctx, hashedName) +} + +// GetDataFolderDomainByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDataFolderDomainByName(ctx context.Context, hashedName string) (*GlobalDataFolderDomain, error) { + key := "datafolderdomains.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.DataFolderDomain) + return &GlobalDataFolderDomain{ + client: group.client, + DataFolderDomain: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomains().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDataFolderDomain{ + client: group.client, + DataFolderDomain: result, + }, nil + } +} + +// DeleteDataFolderDomainByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDataFolderDomainByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomains().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + if result.Spec.ClusterGvk != nil { + err := group.client. + Global(). + DeleteDataFolderDomainClusterByName(ctx, result.Spec.ClusterGvk.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ServiceGvk { + err := group.client. + Global().DeleteDataFolderDomainServiceByName(ctx, v.Name) + if err != nil { + return err + } + } + + if result.Spec.DatabaseGvk != nil { + err := group.client. + Global(). + DeleteDatabaseByName(ctx, result.Spec.DatabaseGvk.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + DataFolderDomains().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/domainGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["datafolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("datafolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DataFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDataFolderDomainByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDataFolderDomainByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataFolderDomain) (*GlobalDataFolderDomain, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ClusterGvk = nil + objToCreate.Spec.ServiceGvk = nil + objToCreate.Spec.DatabaseGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomains().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["datafolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("datafolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/domainGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "DataFolderDomain", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DataFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDataFolderDomain{ + client: group.client, + DataFolderDomain: result, + }, nil +} + +// UpdateDataFolderDomainByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDataFolderDomainByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.DataFolderDomain) (*GlobalDataFolderDomain, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomains().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolderDomains().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDataFolderDomain{ + client: group.client, + DataFolderDomain: result, + }, nil +} + +// ListDataFolderDomains returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDataFolderDomains(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDataFolderDomain, err error) { + key := "datafolderdomains.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDataFolderDomain, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.DataFolderDomain) + result[k] = &GlobalDataFolderDomain{ + client: group.client, + DataFolderDomain: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + DataFolderDomains().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDataFolderDomain, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDataFolderDomain{ + client: group.client, + DataFolderDomain: &item, + } + } + } + return +} + +type GlobalDataFolderDomain struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.DataFolderDomain +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDataFolderDomain) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDataFolderDomainByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.DataFolderDomain = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDataFolderDomain) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDataFolderDomainByName(ctx, obj.DataFolderDomain) + if err != nil { + return err + } + obj.DataFolderDomain = result.DataFolderDomain + return nil +} + +func (obj *GlobalDataFolderDomain) GetParent(ctx context.Context) (result *GlobalDataFolder, err error) { + hashedName := helper.GetHashedName("datafolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["datafolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDataFolderByName(ctx, hashedName) +} + +// GetCluster returns child of given type +func (obj *GlobalDataFolderDomain) GetCluster(ctx context.Context) ( + result *GlobalDataFolderDomainCluster, err error) { + if obj.Spec.ClusterGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DataFolderDomain", "Cluster") + } + return obj.client.Global().GetDataFolderDomainClusterByName(ctx, obj.Spec.ClusterGvk.Name) +} + +// AddCluster calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDataFolderDomain) AddCluster(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataFolderDomainCluster) (result *GlobalDataFolderDomainCluster, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["datafolderdomains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["datafolderdomains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDataFolderDomainClusterByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDataFolderDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.DataFolderDomain = updatedObj.DataFolderDomain + } + return +} + +// DeleteCluster calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDataFolderDomain) DeleteCluster(ctx context.Context) (err error) { + if obj.Spec.ClusterGvk != nil { + err = obj.client. + Global().DeleteDataFolderDomainClusterByName(ctx, obj.Spec.ClusterGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetDataFolderDomainByName(ctx, obj.GetName()) + if err == nil { + obj.DataFolderDomain = updatedObj.DataFolderDomain + } + return +} + +// GetAllService returns all children of given type +func (obj *GlobalDataFolderDomain) GetAllService(ctx context.Context) ( + result []*GlobalDataFolderDomainService, err error) { + result = make([]*GlobalDataFolderDomainService, 0, len(obj.Spec.ServiceGvk)) + for _, v := range obj.Spec.ServiceGvk { + l, err := obj.client.Global().GetDataFolderDomainServiceByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetService returns child which has given displayName +func (obj *GlobalDataFolderDomain) GetService(ctx context.Context, + displayName string) (result *GlobalDataFolderDomainService, err error) { + l, ok := obj.Spec.ServiceGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DataFolderDomain", "Service", displayName) + } + result, err = obj.client.Global().GetDataFolderDomainServiceByName(ctx, l.Name) + return +} + +// AddService calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDataFolderDomain) AddService(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataFolderDomainService) (result *GlobalDataFolderDomainService, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["datafolderdomains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["datafolderdomains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDataFolderDomainServiceByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDataFolderDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.DataFolderDomain = updatedObj.DataFolderDomain + } + return +} + +// DeleteService calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDataFolderDomain) DeleteService(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DataFolderDomain", "Service", displayName) + } + err = obj.client.Global().DeleteDataFolderDomainServiceByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDataFolderDomainByName(ctx, obj.GetName()) + if err == nil { + obj.DataFolderDomain = updatedObj.DataFolderDomain + } + return +} + +// GetDatabase returns child of given type +func (obj *GlobalDataFolderDomain) GetDatabase(ctx context.Context) ( + result *GlobalDatabase, err error) { + if obj.Spec.DatabaseGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DataFolderDomain", "Database") + } + return obj.client.Global().GetDatabaseByName(ctx, obj.Spec.DatabaseGvk.Name) +} + +// AddDatabase calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDataFolderDomain) AddDatabase(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Database) (result *GlobalDatabase, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["datafolderdomains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["datafolderdomains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDatabaseByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDataFolderDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.DataFolderDomain = updatedObj.DataFolderDomain + } + return +} + +// DeleteDatabase calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDataFolderDomain) DeleteDatabase(ctx context.Context) (err error) { + if obj.Spec.DatabaseGvk != nil { + err = obj.client. + Global().DeleteDatabaseByName(ctx, obj.Spec.DatabaseGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetDataFolderDomainByName(ctx, obj.GetName()) + if err == nil { + obj.DataFolderDomain = updatedObj.DataFolderDomain + } + return +} + +type datafolderdomainGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *datafolderdomainGlobalTsmV1Chainer) Subscribe() { + key := "datafolderdomains.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDataFolderDomainInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *datafolderdomainGlobalTsmV1Chainer) Unsubscribe() { + key := "datafolderdomains.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *datafolderdomainGlobalTsmV1Chainer) IsSubscribed() bool { + key := "datafolderdomains.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *datafolderdomainGlobalTsmV1Chainer) Cluster(name string) *datafolderdomainclusterGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["datafolderdomainclusters.global.tsm.tanzu.vmware.com"] = name + return &datafolderdomainclusterGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetCluster calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *datafolderdomainGlobalTsmV1Chainer) GetCluster(ctx context.Context, displayName string) (result *GlobalDataFolderDomainCluster, err error) { + hashedName := helper.GetHashedName("datafolderdomainclusters.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetDataFolderDomainClusterByName(ctx, hashedName) +} + +// AddCluster calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *datafolderdomainGlobalTsmV1Chainer) AddCluster(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataFolderDomainCluster) (result *GlobalDataFolderDomainCluster, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("datafolderdomainclusters.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDataFolderDomainClusterByName(ctx, objToCreate) +} + +// DeleteCluster calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *datafolderdomainGlobalTsmV1Chainer) DeleteCluster(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("datafolderdomainclusters.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDataFolderDomainClusterByName(ctx, hashedName) +} + +func (c *datafolderdomainGlobalTsmV1Chainer) Service(name string) *datafolderdomainserviceGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["datafolderdomainservices.global.tsm.tanzu.vmware.com"] = name + return &datafolderdomainserviceGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetService calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *datafolderdomainGlobalTsmV1Chainer) GetService(ctx context.Context, displayName string) (result *GlobalDataFolderDomainService, err error) { + hashedName := helper.GetHashedName("datafolderdomainservices.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetDataFolderDomainServiceByName(ctx, hashedName) +} + +// AddService calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *datafolderdomainGlobalTsmV1Chainer) AddService(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataFolderDomainService) (result *GlobalDataFolderDomainService, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("datafolderdomainservices.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDataFolderDomainServiceByName(ctx, objToCreate) +} + +// DeleteService calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *datafolderdomainGlobalTsmV1Chainer) DeleteService(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("datafolderdomainservices.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDataFolderDomainServiceByName(ctx, hashedName) +} + +func (c *datafolderdomainGlobalTsmV1Chainer) Database() *databaseGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["databases.global.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY + return &databaseGlobalTsmV1Chainer{ + client: c.client, + name: helper.DEFAULT_KEY, + parentLabels: parentLabels, + } +} + +// GetDatabase calculates hashed name of the object based on it's parents and returns the object +func (c *datafolderdomainGlobalTsmV1Chainer) GetDatabase(ctx context.Context) (result *GlobalDatabase, err error) { + hashedName := helper.GetHashedName("databases.global.tsm.tanzu.vmware.com", c.parentLabels, helper.DEFAULT_KEY) + return c.client.Global().GetDatabaseByName(ctx, hashedName) +} + +// AddDatabase calculates hashed name of the child to create based on parents names and creates it. +// objToCreate.Name is changed to the hashed name. Original name ('default') is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *datafolderdomainGlobalTsmV1Chainer) AddDatabase(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Database) (result *GlobalDatabase, err error) { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("databases.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDatabaseByName(ctx, objToCreate) +} + +// DeleteDatabase calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *datafolderdomainGlobalTsmV1Chainer) DeleteDatabase(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("databases.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDatabaseByName(ctx, hashedName) +} + +// GetDataFolderByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDataFolderByName(ctx context.Context, hashedName string) (*GlobalDataFolder, error) { + key := "datafolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.DataFolder) + return &GlobalDataFolder{ + client: group.client, + DataFolder: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDataFolder{ + client: group.client, + DataFolder: result, + }, nil + } +} + +// DeleteDataFolderByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDataFolderByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + if result.Spec.DomainGvk != nil { + err := group.client. + Global(). + DeleteDataFolderDomainByName(ctx, result.Spec.DomainGvk.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + DataFolders().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/dataFolderGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDataFolderByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDataFolderByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataFolder) (*GlobalDataFolder, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] == "" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.Labels[common.DISPLAY_NAME_LABEL]) + } + + objToCreate.Spec.DomainGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolders().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/dataFolderGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "DataFolder", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDataFolder{ + client: group.client, + DataFolder: result, + }, nil +} + +// UpdateDataFolderByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDataFolderByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.DataFolder) (*GlobalDataFolder, error) { + if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) + } + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + DataFolders().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + DataFolders().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDataFolder{ + client: group.client, + DataFolder: result, + }, nil +} + +// ListDataFolders returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDataFolders(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDataFolder, err error) { + key := "datafolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDataFolder, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.DataFolder) + result[k] = &GlobalDataFolder{ + client: group.client, + DataFolder: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + DataFolders().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDataFolder, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDataFolder{ + client: group.client, + DataFolder: &item, + } + } + } + return +} + +type GlobalDataFolder struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.DataFolder +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDataFolder) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDataFolderByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.DataFolder = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDataFolder) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDataFolderByName(ctx, obj.DataFolder) + if err != nil { + return err + } + obj.DataFolder = result.DataFolder + return nil +} + +func (obj *GlobalDataFolder) GetParent(ctx context.Context) (result *GlobalRuntime, err error) { + hashedName := helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["runtimes.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetRuntimeByName(ctx, hashedName) +} + +// GetDomain returns child of given type +func (obj *GlobalDataFolder) GetDomain(ctx context.Context) ( + result *GlobalDataFolderDomain, err error) { + if obj.Spec.DomainGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DataFolder", "Domain") + } + return obj.client.Global().GetDataFolderDomainByName(ctx, obj.Spec.DomainGvk.Name) +} + +// AddDomain calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDataFolder) AddDomain(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataFolderDomain) (result *GlobalDataFolderDomain, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["datafolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["datafolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDataFolderDomainByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDataFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.DataFolder = updatedObj.DataFolder + } + return +} + +// DeleteDomain calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDataFolder) DeleteDomain(ctx context.Context) (err error) { + if obj.Spec.DomainGvk != nil { + err = obj.client. + Global().DeleteDataFolderDomainByName(ctx, obj.Spec.DomainGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetDataFolderByName(ctx, obj.GetName()) + if err == nil { + obj.DataFolder = updatedObj.DataFolder + } + return +} + +type datafolderGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *datafolderGlobalTsmV1Chainer) Subscribe() { + key := "datafolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDataFolderInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *datafolderGlobalTsmV1Chainer) Unsubscribe() { + key := "datafolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *datafolderGlobalTsmV1Chainer) IsSubscribed() bool { + key := "datafolders.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *datafolderGlobalTsmV1Chainer) Domain(name string) *datafolderdomainGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["datafolderdomains.global.tsm.tanzu.vmware.com"] = name + return &datafolderdomainGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetDomain calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *datafolderGlobalTsmV1Chainer) GetDomain(ctx context.Context, displayName string) (result *GlobalDataFolderDomain, err error) { + hashedName := helper.GetHashedName("datafolderdomains.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetDataFolderDomainByName(ctx, hashedName) +} + +// AddDomain calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *datafolderGlobalTsmV1Chainer) AddDomain(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataFolderDomain) (result *GlobalDataFolderDomain, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("datafolderdomains.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDataFolderDomainByName(ctx, objToCreate) +} + +// DeleteDomain calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *datafolderGlobalTsmV1Chainer) DeleteDomain(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("datafolderdomains.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDataFolderDomainByName(ctx, hashedName) +} + +// GetDataGroupByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDataGroupByName(ctx context.Context, hashedName string) (*GlobalDataGroup, error) { + key := "datagroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.DataGroup) + return &GlobalDataGroup{ + client: group.client, + DataGroup: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + DataGroups().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDataGroup{ + client: group.client, + DataGroup: result, + }, nil + } +} + +// DeleteDataGroupByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDataGroupByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + DataGroups().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + DataGroups().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/dataGroupsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["resourcegroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ResourceGroups().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDataGroupByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDataGroupByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataGroup) (*GlobalDataGroup, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + DataGroups().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["resourcegroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"dataGroupsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"DataGroup\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ResourceGroups().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDataGroup{ + client: group.client, + DataGroup: result, + }, nil +} + +// UpdateDataGroupByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDataGroupByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.DataGroup) (*GlobalDataGroup, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + DataGroups().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueDisplayName := + objToUpdate.Spec.DisplayName + patchOpDisplayName := PatchOp{ + Op: "replace", + Path: "/spec/displayName", + Value: patchValueDisplayName, + } + patch = append(patch, patchOpDisplayName) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueScope := + objToUpdate.Spec.Scope + patchOpScope := PatchOp{ + Op: "replace", + Path: "/spec/scope", + Value: patchValueScope, + } + patch = append(patch, patchOpScope) + + patchValueColor := + objToUpdate.Spec.Color + patchOpColor := PatchOp{ + Op: "replace", + Path: "/spec/color", + Value: patchValueColor, + } + patch = append(patch, patchOpColor) + + patchValueRules := + objToUpdate.Spec.Rules + patchOpRules := PatchOp{ + Op: "replace", + Path: "/spec/rules", + Value: patchValueRules, + } + patch = append(patch, patchOpRules) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + DataGroups().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDataGroup{ + client: group.client, + DataGroup: result, + }, nil +} + +// ListDataGroups returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDataGroups(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDataGroup, err error) { + key := "datagroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDataGroup, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.DataGroup) + result[k] = &GlobalDataGroup{ + client: group.client, + DataGroup: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + DataGroups().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDataGroup, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDataGroup{ + client: group.client, + DataGroup: &item, + } + } + } + return +} + +type GlobalDataGroup struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.DataGroup +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDataGroup) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDataGroupByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.DataGroup = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDataGroup) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDataGroupByName(ctx, obj.DataGroup) + if err != nil { + return err + } + obj.DataGroup = result.DataGroup + return nil +} + +func (obj *GlobalDataGroup) GetParent(ctx context.Context) (result *GlobalResourceGroup, err error) { + hashedName := helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["resourcegroups.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetResourceGroupByName(ctx, hashedName) +} + +type datagroupGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *datagroupGlobalTsmV1Chainer) Subscribe() { + key := "datagroups.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDataGroupInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *datagroupGlobalTsmV1Chainer) Unsubscribe() { + key := "datagroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *datagroupGlobalTsmV1Chainer) IsSubscribed() bool { + key := "datagroups.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetDataTemplateByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDataTemplateByName(ctx context.Context, hashedName string) (*GlobalDataTemplate, error) { + key := "datatemplates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.DataTemplate) + return &GlobalDataTemplate{ + client: group.client, + DataTemplate: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + DataTemplates().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDataTemplate{ + client: group.client, + DataTemplate: result, + }, nil + } +} + +// DeleteDataTemplateByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDataTemplateByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + DataTemplates().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + DataTemplates().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/dataTemplatesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["templategroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + TemplateGroups().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDataTemplateByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDataTemplateByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataTemplate) (*GlobalDataTemplate, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + DataTemplates().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["templategroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"dataTemplatesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"DataTemplate\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + TemplateGroups().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDataTemplate{ + client: group.client, + DataTemplate: result, + }, nil +} + +// UpdateDataTemplateByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDataTemplateByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.DataTemplate) (*GlobalDataTemplate, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + DataTemplates().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + DataTemplates().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDataTemplate{ + client: group.client, + DataTemplate: result, + }, nil +} + +// ListDataTemplates returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDataTemplates(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDataTemplate, err error) { + key := "datatemplates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDataTemplate, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.DataTemplate) + result[k] = &GlobalDataTemplate{ + client: group.client, + DataTemplate: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + DataTemplates().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDataTemplate, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDataTemplate{ + client: group.client, + DataTemplate: &item, + } + } + } + return +} + +type GlobalDataTemplate struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.DataTemplate +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDataTemplate) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDataTemplateByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.DataTemplate = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDataTemplate) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDataTemplateByName(ctx, obj.DataTemplate) + if err != nil { + return err + } + obj.DataTemplate = result.DataTemplate + return nil +} + +func (obj *GlobalDataTemplate) GetParent(ctx context.Context) (result *GlobalTemplateGroup, err error) { + hashedName := helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["templategroups.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetTemplateGroupByName(ctx, hashedName) +} + +type datatemplateGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *datatemplateGlobalTsmV1Chainer) Subscribe() { + key := "datatemplates.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDataTemplateInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *datatemplateGlobalTsmV1Chainer) Unsubscribe() { + key := "datatemplates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *datatemplateGlobalTsmV1Chainer) IsSubscribed() bool { + key := "datatemplates.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetDatabaseByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDatabaseByName(ctx context.Context, hashedName string) (*GlobalDatabase, error) { + key := "databases.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Database) + return &GlobalDatabase{ + client: group.client, + Database: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Databases().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDatabase{ + client: group.client, + Database: result, + }, nil + } +} + +// DeleteDatabaseByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDatabaseByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Databases().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.TablesGvk { + err := group.client. + Global().DeleteTableByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.DirectoriesGvk { + err := group.client. + Global().DeleteDirectoryByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.BucketsGvk { + err := group.client. + Global().DeleteBucketByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + Databases().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/databaseGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["datafolderdomains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("datafolderdomains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DataFolderDomains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDatabaseByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDatabaseByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Database) (*GlobalDatabase, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] == "" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.Labels[common.DISPLAY_NAME_LABEL]) + } + + objToCreate.Spec.TablesGvk = nil + objToCreate.Spec.DirectoriesGvk = nil + objToCreate.Spec.BucketsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + Databases().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["datafolderdomains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("datafolderdomains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/databaseGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "Database", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DataFolderDomains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDatabase{ + client: group.client, + Database: result, + }, nil +} + +// UpdateDatabaseByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDatabaseByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Database) (*GlobalDatabase, error) { + if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) + } + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Databases().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Databases().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDatabase{ + client: group.client, + Database: result, + }, nil +} + +// ListDatabases returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDatabases(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDatabase, err error) { + key := "databases.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDatabase, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Database) + result[k] = &GlobalDatabase{ + client: group.client, + Database: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Databases().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDatabase, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDatabase{ + client: group.client, + Database: &item, + } + } + } + return +} + +type GlobalDatabase struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Database +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDatabase) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDatabaseByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Database = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDatabase) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDatabaseByName(ctx, obj.Database) + if err != nil { + return err + } + obj.Database = result.Database + return nil +} + +func (obj *GlobalDatabase) GetParent(ctx context.Context) (result *GlobalDataFolderDomain, err error) { + hashedName := helper.GetHashedName("datafolderdomains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["datafolderdomains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDataFolderDomainByName(ctx, hashedName) +} + +// GetAllTables returns all children of given type +func (obj *GlobalDatabase) GetAllTables(ctx context.Context) ( + result []*GlobalTable, err error) { + result = make([]*GlobalTable, 0, len(obj.Spec.TablesGvk)) + for _, v := range obj.Spec.TablesGvk { + l, err := obj.client.Global().GetTableByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetTables returns child which has given displayName +func (obj *GlobalDatabase) GetTables(ctx context.Context, + displayName string) (result *GlobalTable, err error) { + l, ok := obj.Spec.TablesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Database", "Tables", displayName) + } + result, err = obj.client.Global().GetTableByName(ctx, l.Name) + return +} + +// AddTables calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDatabase) AddTables(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Table) (result *GlobalTable, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["databases.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["databases.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateTableByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDatabaseByName(ctx, obj.GetName()) + if getErr == nil { + obj.Database = updatedObj.Database + } + return +} + +// DeleteTables calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDatabase) DeleteTables(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.TablesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Database", "Tables", displayName) + } + err = obj.client.Global().DeleteTableByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDatabaseByName(ctx, obj.GetName()) + if err == nil { + obj.Database = updatedObj.Database + } + return +} + +// GetAllDirectories returns all children of given type +func (obj *GlobalDatabase) GetAllDirectories(ctx context.Context) ( + result []*GlobalDirectory, err error) { + result = make([]*GlobalDirectory, 0, len(obj.Spec.DirectoriesGvk)) + for _, v := range obj.Spec.DirectoriesGvk { + l, err := obj.client.Global().GetDirectoryByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetDirectories returns child which has given displayName +func (obj *GlobalDatabase) GetDirectories(ctx context.Context, + displayName string) (result *GlobalDirectory, err error) { + l, ok := obj.Spec.DirectoriesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Database", "Directories", displayName) + } + result, err = obj.client.Global().GetDirectoryByName(ctx, l.Name) + return +} + +// AddDirectories calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDatabase) AddDirectories(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Directory) (result *GlobalDirectory, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["databases.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["databases.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDirectoryByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDatabaseByName(ctx, obj.GetName()) + if getErr == nil { + obj.Database = updatedObj.Database + } + return +} + +// DeleteDirectories calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDatabase) DeleteDirectories(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.DirectoriesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Database", "Directories", displayName) + } + err = obj.client.Global().DeleteDirectoryByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDatabaseByName(ctx, obj.GetName()) + if err == nil { + obj.Database = updatedObj.Database + } + return +} + +// GetAllBuckets returns all children of given type +func (obj *GlobalDatabase) GetAllBuckets(ctx context.Context) ( + result []*GlobalBucket, err error) { + result = make([]*GlobalBucket, 0, len(obj.Spec.BucketsGvk)) + for _, v := range obj.Spec.BucketsGvk { + l, err := obj.client.Global().GetBucketByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetBuckets returns child which has given displayName +func (obj *GlobalDatabase) GetBuckets(ctx context.Context, + displayName string) (result *GlobalBucket, err error) { + l, ok := obj.Spec.BucketsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Database", "Buckets", displayName) + } + result, err = obj.client.Global().GetBucketByName(ctx, l.Name) + return +} + +// AddBuckets calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDatabase) AddBuckets(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Bucket) (result *GlobalBucket, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["databases.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["databases.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateBucketByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDatabaseByName(ctx, obj.GetName()) + if getErr == nil { + obj.Database = updatedObj.Database + } + return +} + +// DeleteBuckets calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDatabase) DeleteBuckets(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.BucketsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Database", "Buckets", displayName) + } + err = obj.client.Global().DeleteBucketByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDatabaseByName(ctx, obj.GetName()) + if err == nil { + obj.Database = updatedObj.Database + } + return +} + +type databaseGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *databaseGlobalTsmV1Chainer) Subscribe() { + key := "databases.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDatabaseInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *databaseGlobalTsmV1Chainer) Unsubscribe() { + key := "databases.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *databaseGlobalTsmV1Chainer) IsSubscribed() bool { + key := "databases.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *databaseGlobalTsmV1Chainer) Tables(name string) *tableGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["tables.global.tsm.tanzu.vmware.com"] = name + return &tableGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetTables calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *databaseGlobalTsmV1Chainer) GetTables(ctx context.Context, displayName string) (result *GlobalTable, err error) { + hashedName := helper.GetHashedName("tables.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetTableByName(ctx, hashedName) +} + +// AddTables calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *databaseGlobalTsmV1Chainer) AddTables(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Table) (result *GlobalTable, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("tables.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateTableByName(ctx, objToCreate) +} + +// DeleteTables calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *databaseGlobalTsmV1Chainer) DeleteTables(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("tables.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteTableByName(ctx, hashedName) +} + +func (c *databaseGlobalTsmV1Chainer) Directories(name string) *directoryGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["directories.global.tsm.tanzu.vmware.com"] = name + return &directoryGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetDirectories calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *databaseGlobalTsmV1Chainer) GetDirectories(ctx context.Context, displayName string) (result *GlobalDirectory, err error) { + hashedName := helper.GetHashedName("directories.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetDirectoryByName(ctx, hashedName) +} + +// AddDirectories calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *databaseGlobalTsmV1Chainer) AddDirectories(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Directory) (result *GlobalDirectory, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("directories.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDirectoryByName(ctx, objToCreate) +} + +// DeleteDirectories calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *databaseGlobalTsmV1Chainer) DeleteDirectories(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("directories.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDirectoryByName(ctx, hashedName) +} + +func (c *databaseGlobalTsmV1Chainer) Buckets(name string) *bucketGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["buckets.global.tsm.tanzu.vmware.com"] = name + return &bucketGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetBuckets calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *databaseGlobalTsmV1Chainer) GetBuckets(ctx context.Context, displayName string) (result *GlobalBucket, err error) { + hashedName := helper.GetHashedName("buckets.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetBucketByName(ctx, hashedName) +} + +// AddBuckets calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *databaseGlobalTsmV1Chainer) AddBuckets(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Bucket) (result *GlobalBucket, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("buckets.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateBucketByName(ctx, objToCreate) +} + +// DeleteBuckets calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *databaseGlobalTsmV1Chainer) DeleteBuckets(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("buckets.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteBucketByName(ctx, hashedName) +} + +// GetDCRegionByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDCRegionByName(ctx context.Context, hashedName string) (*GlobalDCRegion, error) { + key := "dcregions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.DCRegion) + return &GlobalDCRegion{ + client: group.client, + DCRegion: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + DCRegions().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDCRegion{ + client: group.client, + DCRegion: result, + }, nil + } +} + +// DeleteDCRegionByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDCRegionByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + DCRegions().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.ZonesGvk { + err := group.client. + Global().DeleteDCZoneByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + DCRegions().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/regionsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["inventories.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("inventories.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Inventories().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDCRegionByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDCRegionByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DCRegion) (*GlobalDCRegion, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ZonesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + DCRegions().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["inventories.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("inventories.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"regionsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"DCRegion\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Inventories().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDCRegion{ + client: group.client, + DCRegion: result, + }, nil +} + +// UpdateDCRegionByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDCRegionByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.DCRegion) (*GlobalDCRegion, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + DCRegions().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + DCRegions().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDCRegion{ + client: group.client, + DCRegion: result, + }, nil +} + +// ListDCRegions returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDCRegions(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDCRegion, err error) { + key := "dcregions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDCRegion, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.DCRegion) + result[k] = &GlobalDCRegion{ + client: group.client, + DCRegion: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + DCRegions().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDCRegion, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDCRegion{ + client: group.client, + DCRegion: &item, + } + } + } + return +} + +type GlobalDCRegion struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.DCRegion +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDCRegion) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDCRegionByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.DCRegion = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDCRegion) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDCRegionByName(ctx, obj.DCRegion) + if err != nil { + return err + } + obj.DCRegion = result.DCRegion + return nil +} + +func (obj *GlobalDCRegion) GetParent(ctx context.Context) (result *GlobalInventory, err error) { + hashedName := helper.GetHashedName("inventories.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["inventories.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetInventoryByName(ctx, hashedName) +} + +// GetAllZones returns all children of given type +func (obj *GlobalDCRegion) GetAllZones(ctx context.Context) ( + result []*GlobalDCZone, err error) { + result = make([]*GlobalDCZone, 0, len(obj.Spec.ZonesGvk)) + for _, v := range obj.Spec.ZonesGvk { + l, err := obj.client.Global().GetDCZoneByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetZones returns child which has given displayName +func (obj *GlobalDCRegion) GetZones(ctx context.Context, + displayName string) (result *GlobalDCZone, err error) { + l, ok := obj.Spec.ZonesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DCRegion", "Zones", displayName) + } + result, err = obj.client.Global().GetDCZoneByName(ctx, l.Name) + return +} + +// AddZones calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDCRegion) AddZones(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DCZone) (result *GlobalDCZone, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["dcregions.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["dcregions.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDCZoneByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDCRegionByName(ctx, obj.GetName()) + if getErr == nil { + obj.DCRegion = updatedObj.DCRegion + } + return +} + +// DeleteZones calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDCRegion) DeleteZones(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ZonesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DCRegion", "Zones", displayName) + } + err = obj.client.Global().DeleteDCZoneByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDCRegionByName(ctx, obj.GetName()) + if err == nil { + obj.DCRegion = updatedObj.DCRegion + } + return +} + +type dcregionGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *dcregionGlobalTsmV1Chainer) Subscribe() { + key := "dcregions.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDCRegionInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *dcregionGlobalTsmV1Chainer) Unsubscribe() { + key := "dcregions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *dcregionGlobalTsmV1Chainer) IsSubscribed() bool { + key := "dcregions.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *dcregionGlobalTsmV1Chainer) Zones(name string) *dczoneGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["dczones.global.tsm.tanzu.vmware.com"] = name + return &dczoneGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetZones calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *dcregionGlobalTsmV1Chainer) GetZones(ctx context.Context, displayName string) (result *GlobalDCZone, err error) { + hashedName := helper.GetHashedName("dczones.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetDCZoneByName(ctx, hashedName) +} + +// AddZones calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *dcregionGlobalTsmV1Chainer) AddZones(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DCZone) (result *GlobalDCZone, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("dczones.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDCZoneByName(ctx, objToCreate) +} + +// DeleteZones calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *dcregionGlobalTsmV1Chainer) DeleteZones(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("dczones.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDCZoneByName(ctx, hashedName) +} + +// GetDCZoneByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDCZoneByName(ctx context.Context, hashedName string) (*GlobalDCZone, error) { + key := "dczones.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.DCZone) + return &GlobalDCZone{ + client: group.client, + DCZone: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + DCZones().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDCZone{ + client: group.client, + DCZone: result, + }, nil + } +} + +// DeleteDCZoneByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDCZoneByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + DCZones().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + DCZones().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/zonesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["dcregions.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("dcregions.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DCRegions().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDCZoneByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDCZoneByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DCZone) (*GlobalDCZone, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ClustersGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + DCZones().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["dcregions.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("dcregions.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"zonesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"DCZone\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DCRegions().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDCZone{ + client: group.client, + DCZone: result, + }, nil +} + +// UpdateDCZoneByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDCZoneByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.DCZone) (*GlobalDCZone, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + DCZones().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + DCZones().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDCZone{ + client: group.client, + DCZone: result, + }, nil +} + +// ListDCZones returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDCZones(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDCZone, err error) { + key := "dczones.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDCZone, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.DCZone) + result[k] = &GlobalDCZone{ + client: group.client, + DCZone: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + DCZones().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDCZone, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDCZone{ + client: group.client, + DCZone: &item, + } + } + } + return +} + +type GlobalDCZone struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.DCZone +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDCZone) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDCZoneByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.DCZone = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDCZone) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDCZoneByName(ctx, obj.DCZone) + if err != nil { + return err + } + obj.DCZone = result.DCZone + return nil +} + +func (obj *GlobalDCZone) GetParent(ctx context.Context) (result *GlobalDCRegion, err error) { + hashedName := helper.GetHashedName("dcregions.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["dcregions.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDCRegionByName(ctx, hashedName) +} + +// GetAllClusters returns all links of given type +func (obj *GlobalDCZone) GetAllClusters(ctx context.Context) ( + result []*GlobalCluster, err error) { + result = make([]*GlobalCluster, 0, len(obj.Spec.ClustersGvk)) + for _, v := range obj.Spec.ClustersGvk { + l, err := obj.client.Global().GetClusterByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetClusters returns link which has given displayName +func (obj *GlobalDCZone) GetClusters(ctx context.Context, + displayName string) (result *GlobalCluster, err error) { + l, ok := obj.Spec.ClustersGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.DCZone", "Clusters", displayName) + } + result, err = obj.client.Global().GetClusterByName(ctx, l.Name) + return +} + +// LinkClusters links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalDCZone) LinkClusters(ctx context.Context, + linkToAdd *GlobalCluster) error { + + payload := "{\"spec\": {\"clustersGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"Cluster\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().DCZones().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.DCZone = result + return nil +} + +// UnlinkClusters unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalDCZone) UnlinkClusters(ctx context.Context, + linkToRemove *GlobalCluster) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/clustersGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().DCZones().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.DCZone = result + return nil + +} + +type dczoneGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *dczoneGlobalTsmV1Chainer) Subscribe() { + key := "dczones.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDCZoneInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *dczoneGlobalTsmV1Chainer) Unsubscribe() { + key := "dczones.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *dczoneGlobalTsmV1Chainer) IsSubscribed() bool { + key := "dczones.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetDestinationRuleByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDestinationRuleByName(ctx context.Context, hashedName string) (*GlobalDestinationRule, error) { + key := "destinationrules.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.DestinationRule) + return &GlobalDestinationRule{ + client: group.client, + DestinationRule: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + DestinationRules().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDestinationRule{ + client: group.client, + DestinationRule: result, + }, nil + } +} + +// DeleteDestinationRuleByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDestinationRuleByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + DestinationRules().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + DestinationRules().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/destinationRulesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDestinationRuleByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDestinationRuleByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DestinationRule) (*GlobalDestinationRule, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ServiceGvk = nil + objToCreate.Spec.ServiceDeploymentsGvk = nil + objToCreate.Spec.ServiceReplicaSetsGvk = nil + objToCreate.Spec.ServiceStatefulSetsGvk = nil + objToCreate.Spec.ServiceDaemonSetsGvk = nil + objToCreate.Spec.ServiceJobsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + DestinationRules().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"destinationRulesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"DestinationRule\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDestinationRule{ + client: group.client, + DestinationRule: result, + }, nil +} + +// UpdateDestinationRuleByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDestinationRuleByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.DestinationRule) (*GlobalDestinationRule, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + DestinationRules().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueAnnotations := + objToUpdate.Spec.Annotations + patchOpAnnotations := PatchOp{ + Op: "replace", + Path: "/spec/annotations", + Value: patchValueAnnotations, + } + patch = append(patch, patchOpAnnotations) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueCreationTimestamp := + objToUpdate.Spec.CreationTimestamp + patchOpCreationTimestamp := PatchOp{ + Op: "replace", + Path: "/spec/creationTimestamp", + Value: patchValueCreationTimestamp, + } + patch = append(patch, patchOpCreationTimestamp) + + patchValueApiLink := + objToUpdate.Spec.ApiLink + patchOpApiLink := PatchOp{ + Op: "replace", + Path: "/spec/apiLink", + Value: patchValueApiLink, + } + patch = append(patch, patchOpApiLink) + + patchValueUid := + objToUpdate.Spec.Uid + patchOpUid := PatchOp{ + Op: "replace", + Path: "/spec/uid", + Value: patchValueUid, + } + patch = append(patch, patchOpUid) + + patchValueHost := + objToUpdate.Spec.Host + patchOpHost := PatchOp{ + Op: "replace", + Path: "/spec/host", + Value: patchValueHost, + } + patch = append(patch, patchOpHost) + + patchValueTrafficPolicy := + objToUpdate.Spec.TrafficPolicy + patchOpTrafficPolicy := PatchOp{ + Op: "replace", + Path: "/spec/trafficPolicy", + Value: patchValueTrafficPolicy, + } + patch = append(patch, patchOpTrafficPolicy) + + patchValueSubsets := + objToUpdate.Spec.Subsets + patchOpSubsets := PatchOp{ + Op: "replace", + Path: "/spec/subsets", + Value: patchValueSubsets, + } + patch = append(patch, patchOpSubsets) + + if objToUpdate.Spec.ExportTo != nil { + patchValueExportTo := + objToUpdate.Spec.ExportTo + patchOpExportTo := PatchOp{ + Op: "replace", + Path: "/spec/exportTo", + Value: patchValueExportTo, + } + patch = append(patch, patchOpExportTo) + } + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + DestinationRules().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDestinationRule{ + client: group.client, + DestinationRule: result, + }, nil +} + +// ListDestinationRules returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDestinationRules(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDestinationRule, err error) { + key := "destinationrules.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDestinationRule, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.DestinationRule) + result[k] = &GlobalDestinationRule{ + client: group.client, + DestinationRule: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + DestinationRules().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDestinationRule, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDestinationRule{ + client: group.client, + DestinationRule: &item, + } + } + } + return +} + +type GlobalDestinationRule struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.DestinationRule +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDestinationRule) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDestinationRuleByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.DestinationRule = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDestinationRule) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDestinationRuleByName(ctx, obj.DestinationRule) + if err != nil { + return err + } + obj.DestinationRule = result.DestinationRule + return nil +} + +func (obj *GlobalDestinationRule) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +// GetService returns link of given type +func (obj *GlobalDestinationRule) GetService(ctx context.Context) ( + result *GlobalService, err error) { + if obj.Spec.ServiceGvk == nil { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.DestinationRule", "Service") + } + return obj.client.Global().GetServiceByName(ctx, obj.Spec.ServiceGvk.Name) +} + +// LinkService links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalDestinationRule) LinkService(ctx context.Context, + linkToAdd *GlobalService) error { + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/serviceGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "Service", + Name: linkToAdd.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().DestinationRules().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.DestinationRule = result + return nil +} + +// UnlinkService unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalDestinationRule) UnlinkService(ctx context.Context) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().DestinationRules().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.DestinationRule = result + return nil + +} + +// GetAllServiceDeployments returns all links of given type +func (obj *GlobalDestinationRule) GetAllServiceDeployments(ctx context.Context) ( + result []*GlobalServiceDeployment, err error) { + result = make([]*GlobalServiceDeployment, 0, len(obj.Spec.ServiceDeploymentsGvk)) + for _, v := range obj.Spec.ServiceDeploymentsGvk { + l, err := obj.client.Global().GetServiceDeploymentByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceDeployments returns link which has given displayName +func (obj *GlobalDestinationRule) GetServiceDeployments(ctx context.Context, + displayName string) (result *GlobalServiceDeployment, err error) { + l, ok := obj.Spec.ServiceDeploymentsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.DestinationRule", "ServiceDeployments", displayName) + } + result, err = obj.client.Global().GetServiceDeploymentByName(ctx, l.Name) + return +} + +// LinkServiceDeployments links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalDestinationRule) LinkServiceDeployments(ctx context.Context, + linkToAdd *GlobalServiceDeployment) error { + + payload := "{\"spec\": {\"serviceDeploymentsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceDeployment\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().DestinationRules().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.DestinationRule = result + return nil +} + +// UnlinkServiceDeployments unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalDestinationRule) UnlinkServiceDeployments(ctx context.Context, + linkToRemove *GlobalServiceDeployment) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceDeploymentsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().DestinationRules().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.DestinationRule = result + return nil + +} + +// GetAllServiceReplicaSets returns all links of given type +func (obj *GlobalDestinationRule) GetAllServiceReplicaSets(ctx context.Context) ( + result []*GlobalServiceReplicaSet, err error) { + result = make([]*GlobalServiceReplicaSet, 0, len(obj.Spec.ServiceReplicaSetsGvk)) + for _, v := range obj.Spec.ServiceReplicaSetsGvk { + l, err := obj.client.Global().GetServiceReplicaSetByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceReplicaSets returns link which has given displayName +func (obj *GlobalDestinationRule) GetServiceReplicaSets(ctx context.Context, + displayName string) (result *GlobalServiceReplicaSet, err error) { + l, ok := obj.Spec.ServiceReplicaSetsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.DestinationRule", "ServiceReplicaSets", displayName) + } + result, err = obj.client.Global().GetServiceReplicaSetByName(ctx, l.Name) + return +} + +// LinkServiceReplicaSets links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalDestinationRule) LinkServiceReplicaSets(ctx context.Context, + linkToAdd *GlobalServiceReplicaSet) error { + + payload := "{\"spec\": {\"serviceReplicaSetsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceReplicaSet\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().DestinationRules().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.DestinationRule = result + return nil +} + +// UnlinkServiceReplicaSets unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalDestinationRule) UnlinkServiceReplicaSets(ctx context.Context, + linkToRemove *GlobalServiceReplicaSet) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceReplicaSetsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().DestinationRules().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.DestinationRule = result + return nil + +} + +// GetAllServiceStatefulSets returns all links of given type +func (obj *GlobalDestinationRule) GetAllServiceStatefulSets(ctx context.Context) ( + result []*GlobalServiceStatefulSet, err error) { + result = make([]*GlobalServiceStatefulSet, 0, len(obj.Spec.ServiceStatefulSetsGvk)) + for _, v := range obj.Spec.ServiceStatefulSetsGvk { + l, err := obj.client.Global().GetServiceStatefulSetByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceStatefulSets returns link which has given displayName +func (obj *GlobalDestinationRule) GetServiceStatefulSets(ctx context.Context, + displayName string) (result *GlobalServiceStatefulSet, err error) { + l, ok := obj.Spec.ServiceStatefulSetsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.DestinationRule", "ServiceStatefulSets", displayName) + } + result, err = obj.client.Global().GetServiceStatefulSetByName(ctx, l.Name) + return +} + +// LinkServiceStatefulSets links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalDestinationRule) LinkServiceStatefulSets(ctx context.Context, + linkToAdd *GlobalServiceStatefulSet) error { + + payload := "{\"spec\": {\"serviceStatefulSetsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceStatefulSet\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().DestinationRules().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.DestinationRule = result + return nil +} + +// UnlinkServiceStatefulSets unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalDestinationRule) UnlinkServiceStatefulSets(ctx context.Context, + linkToRemove *GlobalServiceStatefulSet) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceStatefulSetsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().DestinationRules().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.DestinationRule = result + return nil + +} + +// GetAllServiceDaemonSets returns all links of given type +func (obj *GlobalDestinationRule) GetAllServiceDaemonSets(ctx context.Context) ( + result []*GlobalServiceDaemonSet, err error) { + result = make([]*GlobalServiceDaemonSet, 0, len(obj.Spec.ServiceDaemonSetsGvk)) + for _, v := range obj.Spec.ServiceDaemonSetsGvk { + l, err := obj.client.Global().GetServiceDaemonSetByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceDaemonSets returns link which has given displayName +func (obj *GlobalDestinationRule) GetServiceDaemonSets(ctx context.Context, + displayName string) (result *GlobalServiceDaemonSet, err error) { + l, ok := obj.Spec.ServiceDaemonSetsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.DestinationRule", "ServiceDaemonSets", displayName) + } + result, err = obj.client.Global().GetServiceDaemonSetByName(ctx, l.Name) + return +} + +// LinkServiceDaemonSets links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalDestinationRule) LinkServiceDaemonSets(ctx context.Context, + linkToAdd *GlobalServiceDaemonSet) error { + + payload := "{\"spec\": {\"serviceDaemonSetsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceDaemonSet\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().DestinationRules().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.DestinationRule = result + return nil +} + +// UnlinkServiceDaemonSets unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalDestinationRule) UnlinkServiceDaemonSets(ctx context.Context, + linkToRemove *GlobalServiceDaemonSet) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceDaemonSetsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().DestinationRules().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.DestinationRule = result + return nil + +} + +// GetAllServiceJobs returns all links of given type +func (obj *GlobalDestinationRule) GetAllServiceJobs(ctx context.Context) ( + result []*GlobalServiceJob, err error) { + result = make([]*GlobalServiceJob, 0, len(obj.Spec.ServiceJobsGvk)) + for _, v := range obj.Spec.ServiceJobsGvk { + l, err := obj.client.Global().GetServiceJobByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceJobs returns link which has given displayName +func (obj *GlobalDestinationRule) GetServiceJobs(ctx context.Context, + displayName string) (result *GlobalServiceJob, err error) { + l, ok := obj.Spec.ServiceJobsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.DestinationRule", "ServiceJobs", displayName) + } + result, err = obj.client.Global().GetServiceJobByName(ctx, l.Name) + return +} + +// LinkServiceJobs links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalDestinationRule) LinkServiceJobs(ctx context.Context, + linkToAdd *GlobalServiceJob) error { + + payload := "{\"spec\": {\"serviceJobsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceJob\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().DestinationRules().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.DestinationRule = result + return nil +} + +// UnlinkServiceJobs unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalDestinationRule) UnlinkServiceJobs(ctx context.Context, + linkToRemove *GlobalServiceJob) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceJobsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().DestinationRules().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.DestinationRule = result + return nil + +} + +type destinationruleGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *destinationruleGlobalTsmV1Chainer) Subscribe() { + key := "destinationrules.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDestinationRuleInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *destinationruleGlobalTsmV1Chainer) Unsubscribe() { + key := "destinationrules.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *destinationruleGlobalTsmV1Chainer) IsSubscribed() bool { + key := "destinationrules.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetDirectoryByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDirectoryByName(ctx context.Context, hashedName string) (*GlobalDirectory, error) { + key := "directories.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Directory) + return &GlobalDirectory{ + client: group.client, + Directory: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Directories().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDirectory{ + client: group.client, + Directory: result, + }, nil + } +} + +// DeleteDirectoryByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDirectoryByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Directories().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + Directories().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/directoriesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["databases.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("databases.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Databases().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDirectoryByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDirectoryByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Directory) (*GlobalDirectory, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.TemplateGvk = nil + objToCreate.Spec.InventoryGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + Directories().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["databases.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("databases.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"directoriesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"Directory\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Databases().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDirectory{ + client: group.client, + Directory: result, + }, nil +} + +// UpdateDirectoryByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDirectoryByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Directory) (*GlobalDirectory, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Directories().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Directories().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDirectory{ + client: group.client, + Directory: result, + }, nil +} + +// ListDirectories returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDirectories(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDirectory, err error) { + key := "directories.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDirectory, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Directory) + result[k] = &GlobalDirectory{ + client: group.client, + Directory: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Directories().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDirectory, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDirectory{ + client: group.client, + Directory: &item, + } + } + } + return +} + +type GlobalDirectory struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Directory +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDirectory) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDirectoryByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Directory = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDirectory) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDirectoryByName(ctx, obj.Directory) + if err != nil { + return err + } + obj.Directory = result.Directory + return nil +} + +func (obj *GlobalDirectory) GetParent(ctx context.Context) (result *GlobalDatabase, err error) { + hashedName := helper.GetHashedName("databases.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["databases.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDatabaseByName(ctx, hashedName) +} + +// GetTemplate returns link of given type +func (obj *GlobalDirectory) GetTemplate(ctx context.Context) ( + result *GlobalTemplate, err error) { + if obj.Spec.TemplateGvk == nil { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.Directory", "Template") + } + return obj.client.Global().GetTemplateByName(ctx, obj.Spec.TemplateGvk.Name) +} + +// LinkTemplate links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalDirectory) LinkTemplate(ctx context.Context, + linkToAdd *GlobalTemplate) error { + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/templateGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "Template", + Name: linkToAdd.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Directories().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.Directory = result + return nil +} + +// UnlinkTemplate unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalDirectory) UnlinkTemplate(ctx context.Context) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/templateGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Directories().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.Directory = result + return nil + +} + +// GetInventory returns link of given type +func (obj *GlobalDirectory) GetInventory(ctx context.Context) ( + result *GlobalInventory, err error) { + if obj.Spec.InventoryGvk == nil { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.Directory", "Inventory") + } + return obj.client.Global().GetInventoryByName(ctx, obj.Spec.InventoryGvk.Name) +} + +// LinkInventory links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalDirectory) LinkInventory(ctx context.Context, + linkToAdd *GlobalInventory) error { + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/inventoryGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "Inventory", + Name: linkToAdd.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Directories().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.Directory = result + return nil +} + +// UnlinkInventory unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalDirectory) UnlinkInventory(ctx context.Context) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/inventoryGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Directories().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.Directory = result + return nil + +} + +type directoryGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *directoryGlobalTsmV1Chainer) Subscribe() { + key := "directories.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDirectoryInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *directoryGlobalTsmV1Chainer) Unsubscribe() { + key := "directories.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *directoryGlobalTsmV1Chainer) IsSubscribed() bool { + key := "directories.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetDNSConfigFolderByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDNSConfigFolderByName(ctx context.Context, hashedName string) (*GlobalDNSConfigFolder, error) { + key := "dnsconfigfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.DNSConfigFolder) + return &GlobalDNSConfigFolder{ + client: group.client, + DNSConfigFolder: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSConfigFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDNSConfigFolder{ + client: group.client, + DNSConfigFolder: result, + }, nil + } +} + +// DeleteDNSConfigFolderByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDNSConfigFolderByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSConfigFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.DnsConfigGvk { + err := group.client. + Global().DeleteDNSConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + DNSConfigFolders().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/dnsConfigFolderGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["clusterconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDNSConfigFolderByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDNSConfigFolderByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DNSConfigFolder) (*GlobalDNSConfigFolder, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.DnsConfigGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSConfigFolders().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["clusterconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/dnsConfigFolderGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "DNSConfigFolder", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDNSConfigFolder{ + client: group.client, + DNSConfigFolder: result, + }, nil +} + +// UpdateDNSConfigFolderByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDNSConfigFolderByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.DNSConfigFolder) (*GlobalDNSConfigFolder, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + DNSConfigFolders().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSConfigFolders().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDNSConfigFolder{ + client: group.client, + DNSConfigFolder: result, + }, nil +} + +// ListDNSConfigFolders returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDNSConfigFolders(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDNSConfigFolder, err error) { + key := "dnsconfigfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDNSConfigFolder, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.DNSConfigFolder) + result[k] = &GlobalDNSConfigFolder{ + client: group.client, + DNSConfigFolder: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + DNSConfigFolders().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDNSConfigFolder, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDNSConfigFolder{ + client: group.client, + DNSConfigFolder: &item, + } + } + } + return +} + +type GlobalDNSConfigFolder struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.DNSConfigFolder +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDNSConfigFolder) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDNSConfigFolderByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.DNSConfigFolder = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDNSConfigFolder) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDNSConfigFolderByName(ctx, obj.DNSConfigFolder) + if err != nil { + return err + } + obj.DNSConfigFolder = result.DNSConfigFolder + return nil +} + +func (obj *GlobalDNSConfigFolder) GetParent(ctx context.Context) (result *GlobalClusterConfig, err error) { + hashedName := helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["clusterconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetClusterConfigByName(ctx, hashedName) +} + +// GetAllDnsConfig returns all children of given type +func (obj *GlobalDNSConfigFolder) GetAllDnsConfig(ctx context.Context) ( + result []*GlobalDNSConfig, err error) { + result = make([]*GlobalDNSConfig, 0, len(obj.Spec.DnsConfigGvk)) + for _, v := range obj.Spec.DnsConfigGvk { + l, err := obj.client.Global().GetDNSConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetDnsConfig returns child which has given displayName +func (obj *GlobalDNSConfigFolder) GetDnsConfig(ctx context.Context, + displayName string) (result *GlobalDNSConfig, err error) { + l, ok := obj.Spec.DnsConfigGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DNSConfigFolder", "DnsConfig", displayName) + } + result, err = obj.client.Global().GetDNSConfigByName(ctx, l.Name) + return +} + +// AddDnsConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDNSConfigFolder) AddDnsConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DNSConfig) (result *GlobalDNSConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["dnsconfigfolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["dnsconfigfolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDNSConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDNSConfigFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.DNSConfigFolder = updatedObj.DNSConfigFolder + } + return +} + +// DeleteDnsConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDNSConfigFolder) DeleteDnsConfig(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.DnsConfigGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DNSConfigFolder", "DnsConfig", displayName) + } + err = obj.client.Global().DeleteDNSConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDNSConfigFolderByName(ctx, obj.GetName()) + if err == nil { + obj.DNSConfigFolder = updatedObj.DNSConfigFolder + } + return +} + +type dnsconfigfolderGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *dnsconfigfolderGlobalTsmV1Chainer) Subscribe() { + key := "dnsconfigfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDNSConfigFolderInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *dnsconfigfolderGlobalTsmV1Chainer) Unsubscribe() { + key := "dnsconfigfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *dnsconfigfolderGlobalTsmV1Chainer) IsSubscribed() bool { + key := "dnsconfigfolders.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *dnsconfigfolderGlobalTsmV1Chainer) DnsConfig(name string) *dnsconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["dnsconfigs.global.tsm.tanzu.vmware.com"] = name + return &dnsconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetDnsConfig calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *dnsconfigfolderGlobalTsmV1Chainer) GetDnsConfig(ctx context.Context, displayName string) (result *GlobalDNSConfig, err error) { + hashedName := helper.GetHashedName("dnsconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetDNSConfigByName(ctx, hashedName) +} + +// AddDnsConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *dnsconfigfolderGlobalTsmV1Chainer) AddDnsConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DNSConfig) (result *GlobalDNSConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("dnsconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDNSConfigByName(ctx, objToCreate) +} + +// DeleteDnsConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *dnsconfigfolderGlobalTsmV1Chainer) DeleteDnsConfig(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("dnsconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDNSConfigByName(ctx, hashedName) +} + +// GetDNSConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDNSConfigByName(ctx context.Context, hashedName string) (*GlobalDNSConfig, error) { + key := "dnsconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.DNSConfig) + return &GlobalDNSConfig{ + client: group.client, + DNSConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDNSConfig{ + client: group.client, + DNSConfig: result, + }, nil + } +} + +// DeleteDNSConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDNSConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + DNSConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/dnsConfigGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["dnsconfigfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("dnsconfigfolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DNSConfigFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDNSConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDNSConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DNSConfig) (*GlobalDNSConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["dnsconfigfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("dnsconfigfolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"dnsConfigGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"DNSConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DNSConfigFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDNSConfig{ + client: group.client, + DNSConfig: result, + }, nil +} + +// UpdateDNSConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDNSConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.DNSConfig) (*GlobalDNSConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + DNSConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueOwnedBy := + objToUpdate.Spec.OwnedBy + patchOpOwnedBy := PatchOp{ + Op: "replace", + Path: "/spec/ownedBy", + Value: patchValueOwnedBy, + } + patch = append(patch, patchOpOwnedBy) + + patchValueDnsSuffix := + objToUpdate.Spec.DnsSuffix + patchOpDnsSuffix := PatchOp{ + Op: "replace", + Path: "/spec/dnsSuffix", + Value: patchValueDnsSuffix, + } + patch = append(patch, patchOpDnsSuffix) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDNSConfig{ + client: group.client, + DNSConfig: result, + }, nil +} + +// ListDNSConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDNSConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDNSConfig, err error) { + key := "dnsconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDNSConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.DNSConfig) + result[k] = &GlobalDNSConfig{ + client: group.client, + DNSConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + DNSConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDNSConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDNSConfig{ + client: group.client, + DNSConfig: &item, + } + } + } + return +} + +type GlobalDNSConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.DNSConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDNSConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDNSConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.DNSConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDNSConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDNSConfigByName(ctx, obj.DNSConfig) + if err != nil { + return err + } + obj.DNSConfig = result.DNSConfig + return nil +} + +func (obj *GlobalDNSConfig) GetParent(ctx context.Context) (result *GlobalDNSConfigFolder, err error) { + hashedName := helper.GetHashedName("dnsconfigfolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["dnsconfigfolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDNSConfigFolderByName(ctx, hashedName) +} + +type dnsconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *dnsconfigGlobalTsmV1Chainer) Subscribe() { + key := "dnsconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDNSConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *dnsconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "dnsconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *dnsconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "dnsconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetDNSProbeConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDNSProbeConfigByName(ctx context.Context, hashedName string) (*GlobalDNSProbeConfig, error) { + key := "dnsprobeconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.DNSProbeConfig) + return &GlobalDNSProbeConfig{ + client: group.client, + DNSProbeConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSProbeConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDNSProbeConfig{ + client: group.client, + DNSProbeConfig: result, + }, nil + } +} + +// DeleteDNSProbeConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDNSProbeConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSProbeConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + DNSProbeConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/dnsProbeConfigsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["dnsprobesconfigfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("dnsprobesconfigfolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DNSProbesConfigFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDNSProbeConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDNSProbeConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DNSProbeConfig) (*GlobalDNSProbeConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSProbeConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["dnsprobesconfigfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("dnsprobesconfigfolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"dnsProbeConfigsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"DNSProbeConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DNSProbesConfigFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDNSProbeConfig{ + client: group.client, + DNSProbeConfig: result, + }, nil +} + +// UpdateDNSProbeConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDNSProbeConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.DNSProbeConfig) (*GlobalDNSProbeConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + DNSProbeConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueDomain := + objToUpdate.Spec.Domain + patchOpDomain := PatchOp{ + Op: "replace", + Path: "/spec/domain", + Value: patchValueDomain, + } + patch = append(patch, patchOpDomain) + + patchValueCreateTimestamp := + objToUpdate.Spec.CreateTimestamp + patchOpCreateTimestamp := PatchOp{ + Op: "replace", + Path: "/spec/createTimestamp", + Value: patchValueCreateTimestamp, + } + patch = append(patch, patchOpCreateTimestamp) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSProbeConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDNSProbeConfig{ + client: group.client, + DNSProbeConfig: result, + }, nil +} + +// ListDNSProbeConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDNSProbeConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDNSProbeConfig, err error) { + key := "dnsprobeconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDNSProbeConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.DNSProbeConfig) + result[k] = &GlobalDNSProbeConfig{ + client: group.client, + DNSProbeConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + DNSProbeConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDNSProbeConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDNSProbeConfig{ + client: group.client, + DNSProbeConfig: &item, + } + } + } + return +} + +type GlobalDNSProbeConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.DNSProbeConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDNSProbeConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDNSProbeConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.DNSProbeConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDNSProbeConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDNSProbeConfigByName(ctx, obj.DNSProbeConfig) + if err != nil { + return err + } + obj.DNSProbeConfig = result.DNSProbeConfig + return nil +} + +func (obj *GlobalDNSProbeConfig) GetParent(ctx context.Context) (result *GlobalDNSProbesConfigFolder, err error) { + hashedName := helper.GetHashedName("dnsprobesconfigfolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["dnsprobesconfigfolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDNSProbesConfigFolderByName(ctx, hashedName) +} + +type dnsprobeconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *dnsprobeconfigGlobalTsmV1Chainer) Subscribe() { + key := "dnsprobeconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDNSProbeConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *dnsprobeconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "dnsprobeconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *dnsprobeconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "dnsprobeconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetDNSProbeStatusByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDNSProbeStatusByName(ctx context.Context, hashedName string) (*GlobalDNSProbeStatus, error) { + key := "dnsprobestatuses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.DNSProbeStatus) + return &GlobalDNSProbeStatus{ + client: group.client, + DNSProbeStatus: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSProbeStatuses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDNSProbeStatus{ + client: group.client, + DNSProbeStatus: result, + }, nil + } +} + +// DeleteDNSProbeStatusByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDNSProbeStatusByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSProbeStatuses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + DNSProbeStatuses().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/dnsProbeStatusGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["clusters.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Clusters().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDNSProbeStatusByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDNSProbeStatusByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DNSProbeStatus) (*GlobalDNSProbeStatus, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSProbeStatuses().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["clusters.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"dnsProbeStatusGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"DNSProbeStatus\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Clusters().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDNSProbeStatus{ + client: group.client, + DNSProbeStatus: result, + }, nil +} + +// UpdateDNSProbeStatusByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDNSProbeStatusByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.DNSProbeStatus) (*GlobalDNSProbeStatus, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + DNSProbeStatuses().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueDomain := + objToUpdate.Spec.Domain + patchOpDomain := PatchOp{ + Op: "replace", + Path: "/spec/domain", + Value: patchValueDomain, + } + patch = append(patch, patchOpDomain) + + patchValueSuccess := + objToUpdate.Spec.Success + patchOpSuccess := PatchOp{ + Op: "replace", + Path: "/spec/success", + Value: patchValueSuccess, + } + patch = append(patch, patchOpSuccess) + + patchValueUpdateTimestamp := + objToUpdate.Spec.UpdateTimestamp + patchOpUpdateTimestamp := PatchOp{ + Op: "replace", + Path: "/spec/updateTimestamp", + Value: patchValueUpdateTimestamp, + } + patch = append(patch, patchOpUpdateTimestamp) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSProbeStatuses().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDNSProbeStatus{ + client: group.client, + DNSProbeStatus: result, + }, nil +} + +// ListDNSProbeStatuses returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDNSProbeStatuses(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDNSProbeStatus, err error) { + key := "dnsprobestatuses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDNSProbeStatus, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.DNSProbeStatus) + result[k] = &GlobalDNSProbeStatus{ + client: group.client, + DNSProbeStatus: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + DNSProbeStatuses().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDNSProbeStatus, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDNSProbeStatus{ + client: group.client, + DNSProbeStatus: &item, + } + } + } + return +} + +type GlobalDNSProbeStatus struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.DNSProbeStatus +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDNSProbeStatus) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDNSProbeStatusByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.DNSProbeStatus = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDNSProbeStatus) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDNSProbeStatusByName(ctx, obj.DNSProbeStatus) + if err != nil { + return err + } + obj.DNSProbeStatus = result.DNSProbeStatus + return nil +} + +func (obj *GlobalDNSProbeStatus) GetParent(ctx context.Context) (result *GlobalCluster, err error) { + hashedName := helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["clusters.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetClusterByName(ctx, hashedName) +} + +type dnsprobestatusGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *dnsprobestatusGlobalTsmV1Chainer) Subscribe() { + key := "dnsprobestatuses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDNSProbeStatusInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *dnsprobestatusGlobalTsmV1Chainer) Unsubscribe() { + key := "dnsprobestatuses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *dnsprobestatusGlobalTsmV1Chainer) IsSubscribed() bool { + key := "dnsprobestatuses.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetDNSProbesConfigFolderByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDNSProbesConfigFolderByName(ctx context.Context, hashedName string) (*GlobalDNSProbesConfigFolder, error) { + key := "dnsprobesconfigfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.DNSProbesConfigFolder) + return &GlobalDNSProbesConfigFolder{ + client: group.client, + DNSProbesConfigFolder: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSProbesConfigFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDNSProbesConfigFolder{ + client: group.client, + DNSProbesConfigFolder: result, + }, nil + } +} + +// DeleteDNSProbesConfigFolderByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDNSProbesConfigFolderByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSProbesConfigFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.DnsProbeConfigsGvk { + err := group.client. + Global().DeleteDNSProbeConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + DNSProbesConfigFolders().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/dnsProbesConfigFolderGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["clusterconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDNSProbesConfigFolderByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDNSProbesConfigFolderByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DNSProbesConfigFolder) (*GlobalDNSProbesConfigFolder, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] == "" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.Labels[common.DISPLAY_NAME_LABEL]) + } + + objToCreate.Spec.DnsProbeConfigsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSProbesConfigFolders().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["clusterconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/dnsProbesConfigFolderGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "DNSProbesConfigFolder", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDNSProbesConfigFolder{ + client: group.client, + DNSProbesConfigFolder: result, + }, nil +} + +// UpdateDNSProbesConfigFolderByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDNSProbesConfigFolderByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.DNSProbesConfigFolder) (*GlobalDNSProbesConfigFolder, error) { + if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) + } + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + DNSProbesConfigFolders().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + DNSProbesConfigFolders().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDNSProbesConfigFolder{ + client: group.client, + DNSProbesConfigFolder: result, + }, nil +} + +// ListDNSProbesConfigFolders returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDNSProbesConfigFolders(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDNSProbesConfigFolder, err error) { + key := "dnsprobesconfigfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDNSProbesConfigFolder, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.DNSProbesConfigFolder) + result[k] = &GlobalDNSProbesConfigFolder{ + client: group.client, + DNSProbesConfigFolder: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + DNSProbesConfigFolders().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDNSProbesConfigFolder, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDNSProbesConfigFolder{ + client: group.client, + DNSProbesConfigFolder: &item, + } + } + } + return +} + +type GlobalDNSProbesConfigFolder struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.DNSProbesConfigFolder +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDNSProbesConfigFolder) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDNSProbesConfigFolderByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.DNSProbesConfigFolder = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDNSProbesConfigFolder) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDNSProbesConfigFolderByName(ctx, obj.DNSProbesConfigFolder) + if err != nil { + return err + } + obj.DNSProbesConfigFolder = result.DNSProbesConfigFolder + return nil +} + +func (obj *GlobalDNSProbesConfigFolder) GetParent(ctx context.Context) (result *GlobalClusterConfig, err error) { + hashedName := helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["clusterconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetClusterConfigByName(ctx, hashedName) +} + +// GetAllDnsProbeConfigs returns all children of given type +func (obj *GlobalDNSProbesConfigFolder) GetAllDnsProbeConfigs(ctx context.Context) ( + result []*GlobalDNSProbeConfig, err error) { + result = make([]*GlobalDNSProbeConfig, 0, len(obj.Spec.DnsProbeConfigsGvk)) + for _, v := range obj.Spec.DnsProbeConfigsGvk { + l, err := obj.client.Global().GetDNSProbeConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetDnsProbeConfigs returns child which has given displayName +func (obj *GlobalDNSProbesConfigFolder) GetDnsProbeConfigs(ctx context.Context, + displayName string) (result *GlobalDNSProbeConfig, err error) { + l, ok := obj.Spec.DnsProbeConfigsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DNSProbesConfigFolder", "DnsProbeConfigs", displayName) + } + result, err = obj.client.Global().GetDNSProbeConfigByName(ctx, l.Name) + return +} + +// AddDnsProbeConfigs calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDNSProbesConfigFolder) AddDnsProbeConfigs(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DNSProbeConfig) (result *GlobalDNSProbeConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["dnsprobesconfigfolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["dnsprobesconfigfolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDNSProbeConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDNSProbesConfigFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.DNSProbesConfigFolder = updatedObj.DNSProbesConfigFolder + } + return +} + +// DeleteDnsProbeConfigs calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDNSProbesConfigFolder) DeleteDnsProbeConfigs(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.DnsProbeConfigsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DNSProbesConfigFolder", "DnsProbeConfigs", displayName) + } + err = obj.client.Global().DeleteDNSProbeConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDNSProbesConfigFolderByName(ctx, obj.GetName()) + if err == nil { + obj.DNSProbesConfigFolder = updatedObj.DNSProbesConfigFolder + } + return +} + +type dnsprobesconfigfolderGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *dnsprobesconfigfolderGlobalTsmV1Chainer) Subscribe() { + key := "dnsprobesconfigfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDNSProbesConfigFolderInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *dnsprobesconfigfolderGlobalTsmV1Chainer) Unsubscribe() { + key := "dnsprobesconfigfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *dnsprobesconfigfolderGlobalTsmV1Chainer) IsSubscribed() bool { + key := "dnsprobesconfigfolders.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *dnsprobesconfigfolderGlobalTsmV1Chainer) DnsProbeConfigs(name string) *dnsprobeconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["dnsprobeconfigs.global.tsm.tanzu.vmware.com"] = name + return &dnsprobeconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetDnsProbeConfigs calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *dnsprobesconfigfolderGlobalTsmV1Chainer) GetDnsProbeConfigs(ctx context.Context, displayName string) (result *GlobalDNSProbeConfig, err error) { + hashedName := helper.GetHashedName("dnsprobeconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetDNSProbeConfigByName(ctx, hashedName) +} + +// AddDnsProbeConfigs calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *dnsprobesconfigfolderGlobalTsmV1Chainer) AddDnsProbeConfigs(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DNSProbeConfig) (result *GlobalDNSProbeConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("dnsprobeconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDNSProbeConfigByName(ctx, objToCreate) +} + +// DeleteDnsProbeConfigs calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *dnsprobesconfigfolderGlobalTsmV1Chainer) DeleteDnsProbeConfigs(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("dnsprobeconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDNSProbeConfigByName(ctx, hashedName) +} + +// GetDomainConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDomainConfigByName(ctx context.Context, hashedName string) (*GlobalDomainConfig, error) { + key := "domainconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.DomainConfig) + return &GlobalDomainConfig{ + client: group.client, + DomainConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDomainConfig{ + client: group.client, + DomainConfig: result, + }, nil + } +} + +// DeleteDomainConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDomainConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.PolicyGvk { + err := group.client. + Global().DeletePolicyConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + if result.Spec.LabelConfigGvk != nil { + err := group.client. + Global(). + DeleteLabelConfigByName(ctx, result.Spec.LabelConfigGvk.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.NetworkAttachmentDefinitionGvk { + err := group.client. + Global().DeleteNetworkAttachmentDefinitionConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ServicesGvk { + err := group.client. + Global().DeleteServiceConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ServiceEntriesGvk { + err := group.client. + Global().DeleteServiceEntryConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.GatewayConfigGvk { + err := group.client. + Global().DeleteGatewayConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.AutoscalersGvk { + err := group.client. + Global().DeleteAutoscalerConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.HostConfigV2Gvk { + err := group.client. + Global().DeleteHostConfigV2ByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.InboundAuthenticationConfigGvk { + err := group.client. + Global().DeleteInboundAuthenticationConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.SlosGvk { + err := group.client. + Global().DeleteSloConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.SecretsGvk { + err := group.client. + Global().DeleteSecretRTConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ExternalServicesGvk { + err := group.client. + Global().DeleteExternalServicesRTByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ApiDiscoveryGvk { + err := group.client. + Global().DeleteApiDiscoveryRTByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.GeoDiscoveryGvk { + err := group.client. + Global().DeleteGeoDiscoveryRTByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.PiiDiscoveryGvk { + err := group.client. + Global().DeletePiiDiscoveryRTByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.AttackDiscoveryGvk { + err := group.client. + Global().DeleteAttackDiscoveryRTByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.UserDiscoveryGvk { + err := group.client. + Global().DeleteUserDiscoveryRTByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.PublicServiceGvk { + err := group.client. + Global().DeletePublicServiceRTByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.GnsAccessControlPolicyGvk { + err := group.client. + Global().DeleteGnsAccessControlPolicyRTByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.GnsSchemaViolationDiscoveryGvk { + err := group.client. + Global().DeleteSchemaViolationDiscoveryRTByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.GnsSegmentationPolicyGvk { + err := group.client. + Global().DeleteGnsSegmentationPolicyRTByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.CertificateAuthorityGvk { + err := group.client. + Global().DeleteCertificateAuthorityRTByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.GnsEndpointsConfigGvk { + err := group.client. + Global().DeleteGnsEndpointsConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/domainsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["clusterconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDomainConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDomainConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DomainConfig) (*GlobalDomainConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.PolicyGvk = nil + objToCreate.Spec.LabelConfigGvk = nil + objToCreate.Spec.NetworkAttachmentDefinitionGvk = nil + objToCreate.Spec.ServicesGvk = nil + objToCreate.Spec.ServiceEntriesGvk = nil + objToCreate.Spec.GatewayConfigGvk = nil + objToCreate.Spec.AutoscalersGvk = nil + objToCreate.Spec.HostConfigV2Gvk = nil + objToCreate.Spec.InboundAuthenticationConfigGvk = nil + objToCreate.Spec.SlosGvk = nil + objToCreate.Spec.SecretsGvk = nil + objToCreate.Spec.ExternalServicesGvk = nil + objToCreate.Spec.ApiDiscoveryGvk = nil + objToCreate.Spec.GeoDiscoveryGvk = nil + objToCreate.Spec.PiiDiscoveryGvk = nil + objToCreate.Spec.AttackDiscoveryGvk = nil + objToCreate.Spec.UserDiscoveryGvk = nil + objToCreate.Spec.PublicServiceGvk = nil + objToCreate.Spec.GnsAccessControlPolicyGvk = nil + objToCreate.Spec.GnsSchemaViolationDiscoveryGvk = nil + objToCreate.Spec.GnsSegmentationPolicyGvk = nil + objToCreate.Spec.CertificateAuthorityGvk = nil + objToCreate.Spec.GnsEndpointsConfigGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["clusterconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"domainsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"DomainConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDomainConfig{ + client: group.client, + DomainConfig: result, + }, nil +} + +// UpdateDomainConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDomainConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.DomainConfig) (*GlobalDomainConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueOwnedBy := + objToUpdate.Spec.OwnedBy + patchOpOwnedBy := PatchOp{ + Op: "replace", + Path: "/spec/ownedBy", + Value: patchValueOwnedBy, + } + patch = append(patch, patchOpOwnedBy) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDomainConfig{ + client: group.client, + DomainConfig: result, + }, nil +} + +// ListDomainConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDomainConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDomainConfig, err error) { + key := "domainconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDomainConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.DomainConfig) + result[k] = &GlobalDomainConfig{ + client: group.client, + DomainConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + DomainConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDomainConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDomainConfig{ + client: group.client, + DomainConfig: &item, + } + } + } + return +} + +type GlobalDomainConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.DomainConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDomainConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDomainConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.DomainConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDomainConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDomainConfigByName(ctx, obj.DomainConfig) + if err != nil { + return err + } + obj.DomainConfig = result.DomainConfig + return nil +} + +func (obj *GlobalDomainConfig) GetParent(ctx context.Context) (result *GlobalClusterConfig, err error) { + hashedName := helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["clusterconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetClusterConfigByName(ctx, hashedName) +} + +// GetAllPolicy returns all children of given type +func (obj *GlobalDomainConfig) GetAllPolicy(ctx context.Context) ( + result []*GlobalPolicyConfig, err error) { + result = make([]*GlobalPolicyConfig, 0, len(obj.Spec.PolicyGvk)) + for _, v := range obj.Spec.PolicyGvk { + l, err := obj.client.Global().GetPolicyConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetPolicy returns child which has given displayName +func (obj *GlobalDomainConfig) GetPolicy(ctx context.Context, + displayName string) (result *GlobalPolicyConfig, err error) { + l, ok := obj.Spec.PolicyGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "Policy", displayName) + } + result, err = obj.client.Global().GetPolicyConfigByName(ctx, l.Name) + return +} + +// AddPolicy calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddPolicy(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PolicyConfig) (result *GlobalPolicyConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreatePolicyConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeletePolicy calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeletePolicy(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.PolicyGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "Policy", displayName) + } + err = obj.client.Global().DeletePolicyConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetLabelConfig returns child of given type +func (obj *GlobalDomainConfig) GetLabelConfig(ctx context.Context) ( + result *GlobalLabelConfig, err error) { + if obj.Spec.LabelConfigGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "LabelConfig") + } + return obj.client.Global().GetLabelConfigByName(ctx, obj.Spec.LabelConfigGvk.Name) +} + +// AddLabelConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddLabelConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.LabelConfig) (result *GlobalLabelConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateLabelConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteLabelConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteLabelConfig(ctx context.Context) (err error) { + if obj.Spec.LabelConfigGvk != nil { + err = obj.client. + Global().DeleteLabelConfigByName(ctx, obj.Spec.LabelConfigGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllNetworkAttachmentDefinition returns all children of given type +func (obj *GlobalDomainConfig) GetAllNetworkAttachmentDefinition(ctx context.Context) ( + result []*GlobalNetworkAttachmentDefinitionConfig, err error) { + result = make([]*GlobalNetworkAttachmentDefinitionConfig, 0, len(obj.Spec.NetworkAttachmentDefinitionGvk)) + for _, v := range obj.Spec.NetworkAttachmentDefinitionGvk { + l, err := obj.client.Global().GetNetworkAttachmentDefinitionConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetNetworkAttachmentDefinition returns child which has given displayName +func (obj *GlobalDomainConfig) GetNetworkAttachmentDefinition(ctx context.Context, + displayName string) (result *GlobalNetworkAttachmentDefinitionConfig, err error) { + l, ok := obj.Spec.NetworkAttachmentDefinitionGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "NetworkAttachmentDefinition", displayName) + } + result, err = obj.client.Global().GetNetworkAttachmentDefinitionConfigByName(ctx, l.Name) + return +} + +// AddNetworkAttachmentDefinition calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddNetworkAttachmentDefinition(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig) (result *GlobalNetworkAttachmentDefinitionConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateNetworkAttachmentDefinitionConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteNetworkAttachmentDefinition calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteNetworkAttachmentDefinition(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.NetworkAttachmentDefinitionGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "NetworkAttachmentDefinition", displayName) + } + err = obj.client.Global().DeleteNetworkAttachmentDefinitionConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllServices returns all children of given type +func (obj *GlobalDomainConfig) GetAllServices(ctx context.Context) ( + result []*GlobalServiceConfig, err error) { + result = make([]*GlobalServiceConfig, 0, len(obj.Spec.ServicesGvk)) + for _, v := range obj.Spec.ServicesGvk { + l, err := obj.client.Global().GetServiceConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServices returns child which has given displayName +func (obj *GlobalDomainConfig) GetServices(ctx context.Context, + displayName string) (result *GlobalServiceConfig, err error) { + l, ok := obj.Spec.ServicesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "Services", displayName) + } + result, err = obj.client.Global().GetServiceConfigByName(ctx, l.Name) + return +} + +// AddServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceConfig) (result *GlobalServiceConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteServices(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServicesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "Services", displayName) + } + err = obj.client.Global().DeleteServiceConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllServiceEntries returns all children of given type +func (obj *GlobalDomainConfig) GetAllServiceEntries(ctx context.Context) ( + result []*GlobalServiceEntryConfig, err error) { + result = make([]*GlobalServiceEntryConfig, 0, len(obj.Spec.ServiceEntriesGvk)) + for _, v := range obj.Spec.ServiceEntriesGvk { + l, err := obj.client.Global().GetServiceEntryConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceEntries returns child which has given displayName +func (obj *GlobalDomainConfig) GetServiceEntries(ctx context.Context, + displayName string) (result *GlobalServiceEntryConfig, err error) { + l, ok := obj.Spec.ServiceEntriesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "ServiceEntries", displayName) + } + result, err = obj.client.Global().GetServiceEntryConfigByName(ctx, l.Name) + return +} + +// AddServiceEntries calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddServiceEntries(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceEntryConfig) (result *GlobalServiceEntryConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceEntryConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteServiceEntries calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteServiceEntries(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceEntriesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "ServiceEntries", displayName) + } + err = obj.client.Global().DeleteServiceEntryConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllGatewayConfig returns all children of given type +func (obj *GlobalDomainConfig) GetAllGatewayConfig(ctx context.Context) ( + result []*GlobalGatewayConfig, err error) { + result = make([]*GlobalGatewayConfig, 0, len(obj.Spec.GatewayConfigGvk)) + for _, v := range obj.Spec.GatewayConfigGvk { + l, err := obj.client.Global().GetGatewayConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGatewayConfig returns child which has given displayName +func (obj *GlobalDomainConfig) GetGatewayConfig(ctx context.Context, + displayName string) (result *GlobalGatewayConfig, err error) { + l, ok := obj.Spec.GatewayConfigGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "GatewayConfig", displayName) + } + result, err = obj.client.Global().GetGatewayConfigByName(ctx, l.Name) + return +} + +// AddGatewayConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddGatewayConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GatewayConfig) (result *GlobalGatewayConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGatewayConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteGatewayConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteGatewayConfig(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GatewayConfigGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "GatewayConfig", displayName) + } + err = obj.client.Global().DeleteGatewayConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllAutoscalers returns all children of given type +func (obj *GlobalDomainConfig) GetAllAutoscalers(ctx context.Context) ( + result []*GlobalAutoscalerConfig, err error) { + result = make([]*GlobalAutoscalerConfig, 0, len(obj.Spec.AutoscalersGvk)) + for _, v := range obj.Spec.AutoscalersGvk { + l, err := obj.client.Global().GetAutoscalerConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetAutoscalers returns child which has given displayName +func (obj *GlobalDomainConfig) GetAutoscalers(ctx context.Context, + displayName string) (result *GlobalAutoscalerConfig, err error) { + l, ok := obj.Spec.AutoscalersGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "Autoscalers", displayName) + } + result, err = obj.client.Global().GetAutoscalerConfigByName(ctx, l.Name) + return +} + +// AddAutoscalers calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddAutoscalers(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AutoscalerConfig) (result *GlobalAutoscalerConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAutoscalerConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteAutoscalers calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteAutoscalers(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.AutoscalersGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "Autoscalers", displayName) + } + err = obj.client.Global().DeleteAutoscalerConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllHostConfigV2 returns all children of given type +func (obj *GlobalDomainConfig) GetAllHostConfigV2(ctx context.Context) ( + result []*GlobalHostConfigV2, err error) { + result = make([]*GlobalHostConfigV2, 0, len(obj.Spec.HostConfigV2Gvk)) + for _, v := range obj.Spec.HostConfigV2Gvk { + l, err := obj.client.Global().GetHostConfigV2ByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetHostConfigV2 returns child which has given displayName +func (obj *GlobalDomainConfig) GetHostConfigV2(ctx context.Context, + displayName string) (result *GlobalHostConfigV2, err error) { + l, ok := obj.Spec.HostConfigV2Gvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "HostConfigV2", displayName) + } + result, err = obj.client.Global().GetHostConfigV2ByName(ctx, l.Name) + return +} + +// AddHostConfigV2 calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddHostConfigV2(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.HostConfigV2) (result *GlobalHostConfigV2, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateHostConfigV2ByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteHostConfigV2 calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteHostConfigV2(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.HostConfigV2Gvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "HostConfigV2", displayName) + } + err = obj.client.Global().DeleteHostConfigV2ByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllInboundAuthenticationConfig returns all children of given type +func (obj *GlobalDomainConfig) GetAllInboundAuthenticationConfig(ctx context.Context) ( + result []*GlobalInboundAuthenticationConfig, err error) { + result = make([]*GlobalInboundAuthenticationConfig, 0, len(obj.Spec.InboundAuthenticationConfigGvk)) + for _, v := range obj.Spec.InboundAuthenticationConfigGvk { + l, err := obj.client.Global().GetInboundAuthenticationConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetInboundAuthenticationConfig returns child which has given displayName +func (obj *GlobalDomainConfig) GetInboundAuthenticationConfig(ctx context.Context, + displayName string) (result *GlobalInboundAuthenticationConfig, err error) { + l, ok := obj.Spec.InboundAuthenticationConfigGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "InboundAuthenticationConfig", displayName) + } + result, err = obj.client.Global().GetInboundAuthenticationConfigByName(ctx, l.Name) + return +} + +// AddInboundAuthenticationConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddInboundAuthenticationConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.InboundAuthenticationConfig) (result *GlobalInboundAuthenticationConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateInboundAuthenticationConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteInboundAuthenticationConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteInboundAuthenticationConfig(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.InboundAuthenticationConfigGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "InboundAuthenticationConfig", displayName) + } + err = obj.client.Global().DeleteInboundAuthenticationConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllSlos returns all children of given type +func (obj *GlobalDomainConfig) GetAllSlos(ctx context.Context) ( + result []*GlobalSloConfig, err error) { + result = make([]*GlobalSloConfig, 0, len(obj.Spec.SlosGvk)) + for _, v := range obj.Spec.SlosGvk { + l, err := obj.client.Global().GetSloConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetSlos returns child which has given displayName +func (obj *GlobalDomainConfig) GetSlos(ctx context.Context, + displayName string) (result *GlobalSloConfig, err error) { + l, ok := obj.Spec.SlosGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "Slos", displayName) + } + result, err = obj.client.Global().GetSloConfigByName(ctx, l.Name) + return +} + +// AddSlos calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddSlos(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SloConfig) (result *GlobalSloConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateSloConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteSlos calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteSlos(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.SlosGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "Slos", displayName) + } + err = obj.client.Global().DeleteSloConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllSecrets returns all children of given type +func (obj *GlobalDomainConfig) GetAllSecrets(ctx context.Context) ( + result []*GlobalSecretRTConfig, err error) { + result = make([]*GlobalSecretRTConfig, 0, len(obj.Spec.SecretsGvk)) + for _, v := range obj.Spec.SecretsGvk { + l, err := obj.client.Global().GetSecretRTConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetSecrets returns child which has given displayName +func (obj *GlobalDomainConfig) GetSecrets(ctx context.Context, + displayName string) (result *GlobalSecretRTConfig, err error) { + l, ok := obj.Spec.SecretsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "Secrets", displayName) + } + result, err = obj.client.Global().GetSecretRTConfigByName(ctx, l.Name) + return +} + +// AddSecrets calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddSecrets(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SecretRTConfig) (result *GlobalSecretRTConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateSecretRTConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteSecrets calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteSecrets(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.SecretsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "Secrets", displayName) + } + err = obj.client.Global().DeleteSecretRTConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllExternalServices returns all children of given type +func (obj *GlobalDomainConfig) GetAllExternalServices(ctx context.Context) ( + result []*GlobalExternalServicesRT, err error) { + result = make([]*GlobalExternalServicesRT, 0, len(obj.Spec.ExternalServicesGvk)) + for _, v := range obj.Spec.ExternalServicesGvk { + l, err := obj.client.Global().GetExternalServicesRTByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetExternalServices returns child which has given displayName +func (obj *GlobalDomainConfig) GetExternalServices(ctx context.Context, + displayName string) (result *GlobalExternalServicesRT, err error) { + l, ok := obj.Spec.ExternalServicesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "ExternalServices", displayName) + } + result, err = obj.client.Global().GetExternalServicesRTByName(ctx, l.Name) + return +} + +// AddExternalServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddExternalServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalServicesRT) (result *GlobalExternalServicesRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalServicesRTByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteExternalServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteExternalServices(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ExternalServicesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "ExternalServices", displayName) + } + err = obj.client.Global().DeleteExternalServicesRTByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllApiDiscovery returns all children of given type +func (obj *GlobalDomainConfig) GetAllApiDiscovery(ctx context.Context) ( + result []*GlobalApiDiscoveryRT, err error) { + result = make([]*GlobalApiDiscoveryRT, 0, len(obj.Spec.ApiDiscoveryGvk)) + for _, v := range obj.Spec.ApiDiscoveryGvk { + l, err := obj.client.Global().GetApiDiscoveryRTByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetApiDiscovery returns child which has given displayName +func (obj *GlobalDomainConfig) GetApiDiscovery(ctx context.Context, + displayName string) (result *GlobalApiDiscoveryRT, err error) { + l, ok := obj.Spec.ApiDiscoveryGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "ApiDiscovery", displayName) + } + result, err = obj.client.Global().GetApiDiscoveryRTByName(ctx, l.Name) + return +} + +// AddApiDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddApiDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ApiDiscoveryRT) (result *GlobalApiDiscoveryRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateApiDiscoveryRTByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteApiDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteApiDiscovery(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ApiDiscoveryGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "ApiDiscovery", displayName) + } + err = obj.client.Global().DeleteApiDiscoveryRTByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllGeoDiscovery returns all children of given type +func (obj *GlobalDomainConfig) GetAllGeoDiscovery(ctx context.Context) ( + result []*GlobalGeoDiscoveryRT, err error) { + result = make([]*GlobalGeoDiscoveryRT, 0, len(obj.Spec.GeoDiscoveryGvk)) + for _, v := range obj.Spec.GeoDiscoveryGvk { + l, err := obj.client.Global().GetGeoDiscoveryRTByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGeoDiscovery returns child which has given displayName +func (obj *GlobalDomainConfig) GetGeoDiscovery(ctx context.Context, + displayName string) (result *GlobalGeoDiscoveryRT, err error) { + l, ok := obj.Spec.GeoDiscoveryGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "GeoDiscovery", displayName) + } + result, err = obj.client.Global().GetGeoDiscoveryRTByName(ctx, l.Name) + return +} + +// AddGeoDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddGeoDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GeoDiscoveryRT) (result *GlobalGeoDiscoveryRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGeoDiscoveryRTByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteGeoDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteGeoDiscovery(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GeoDiscoveryGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "GeoDiscovery", displayName) + } + err = obj.client.Global().DeleteGeoDiscoveryRTByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllPiiDiscovery returns all children of given type +func (obj *GlobalDomainConfig) GetAllPiiDiscovery(ctx context.Context) ( + result []*GlobalPiiDiscoveryRT, err error) { + result = make([]*GlobalPiiDiscoveryRT, 0, len(obj.Spec.PiiDiscoveryGvk)) + for _, v := range obj.Spec.PiiDiscoveryGvk { + l, err := obj.client.Global().GetPiiDiscoveryRTByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetPiiDiscovery returns child which has given displayName +func (obj *GlobalDomainConfig) GetPiiDiscovery(ctx context.Context, + displayName string) (result *GlobalPiiDiscoveryRT, err error) { + l, ok := obj.Spec.PiiDiscoveryGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "PiiDiscovery", displayName) + } + result, err = obj.client.Global().GetPiiDiscoveryRTByName(ctx, l.Name) + return +} + +// AddPiiDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddPiiDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PiiDiscoveryRT) (result *GlobalPiiDiscoveryRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreatePiiDiscoveryRTByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeletePiiDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeletePiiDiscovery(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.PiiDiscoveryGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "PiiDiscovery", displayName) + } + err = obj.client.Global().DeletePiiDiscoveryRTByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllAttackDiscovery returns all children of given type +func (obj *GlobalDomainConfig) GetAllAttackDiscovery(ctx context.Context) ( + result []*GlobalAttackDiscoveryRT, err error) { + result = make([]*GlobalAttackDiscoveryRT, 0, len(obj.Spec.AttackDiscoveryGvk)) + for _, v := range obj.Spec.AttackDiscoveryGvk { + l, err := obj.client.Global().GetAttackDiscoveryRTByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetAttackDiscovery returns child which has given displayName +func (obj *GlobalDomainConfig) GetAttackDiscovery(ctx context.Context, + displayName string) (result *GlobalAttackDiscoveryRT, err error) { + l, ok := obj.Spec.AttackDiscoveryGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "AttackDiscovery", displayName) + } + result, err = obj.client.Global().GetAttackDiscoveryRTByName(ctx, l.Name) + return +} + +// AddAttackDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddAttackDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AttackDiscoveryRT) (result *GlobalAttackDiscoveryRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAttackDiscoveryRTByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteAttackDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteAttackDiscovery(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.AttackDiscoveryGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "AttackDiscovery", displayName) + } + err = obj.client.Global().DeleteAttackDiscoveryRTByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllUserDiscovery returns all children of given type +func (obj *GlobalDomainConfig) GetAllUserDiscovery(ctx context.Context) ( + result []*GlobalUserDiscoveryRT, err error) { + result = make([]*GlobalUserDiscoveryRT, 0, len(obj.Spec.UserDiscoveryGvk)) + for _, v := range obj.Spec.UserDiscoveryGvk { + l, err := obj.client.Global().GetUserDiscoveryRTByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetUserDiscovery returns child which has given displayName +func (obj *GlobalDomainConfig) GetUserDiscovery(ctx context.Context, + displayName string) (result *GlobalUserDiscoveryRT, err error) { + l, ok := obj.Spec.UserDiscoveryGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "UserDiscovery", displayName) + } + result, err = obj.client.Global().GetUserDiscoveryRTByName(ctx, l.Name) + return +} + +// AddUserDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddUserDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.UserDiscoveryRT) (result *GlobalUserDiscoveryRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateUserDiscoveryRTByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteUserDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteUserDiscovery(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.UserDiscoveryGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "UserDiscovery", displayName) + } + err = obj.client.Global().DeleteUserDiscoveryRTByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllPublicService returns all children of given type +func (obj *GlobalDomainConfig) GetAllPublicService(ctx context.Context) ( + result []*GlobalPublicServiceRT, err error) { + result = make([]*GlobalPublicServiceRT, 0, len(obj.Spec.PublicServiceGvk)) + for _, v := range obj.Spec.PublicServiceGvk { + l, err := obj.client.Global().GetPublicServiceRTByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetPublicService returns child which has given displayName +func (obj *GlobalDomainConfig) GetPublicService(ctx context.Context, + displayName string) (result *GlobalPublicServiceRT, err error) { + l, ok := obj.Spec.PublicServiceGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "PublicService", displayName) + } + result, err = obj.client.Global().GetPublicServiceRTByName(ctx, l.Name) + return +} + +// AddPublicService calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddPublicService(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PublicServiceRT) (result *GlobalPublicServiceRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreatePublicServiceRTByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeletePublicService calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeletePublicService(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.PublicServiceGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "PublicService", displayName) + } + err = obj.client.Global().DeletePublicServiceRTByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllGnsAccessControlPolicy returns all children of given type +func (obj *GlobalDomainConfig) GetAllGnsAccessControlPolicy(ctx context.Context) ( + result []*GlobalGnsAccessControlPolicyRT, err error) { + result = make([]*GlobalGnsAccessControlPolicyRT, 0, len(obj.Spec.GnsAccessControlPolicyGvk)) + for _, v := range obj.Spec.GnsAccessControlPolicyGvk { + l, err := obj.client.Global().GetGnsAccessControlPolicyRTByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGnsAccessControlPolicy returns child which has given displayName +func (obj *GlobalDomainConfig) GetGnsAccessControlPolicy(ctx context.Context, + displayName string) (result *GlobalGnsAccessControlPolicyRT, err error) { + l, ok := obj.Spec.GnsAccessControlPolicyGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "GnsAccessControlPolicy", displayName) + } + result, err = obj.client.Global().GetGnsAccessControlPolicyRTByName(ctx, l.Name) + return +} + +// AddGnsAccessControlPolicy calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddGnsAccessControlPolicy(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT) (result *GlobalGnsAccessControlPolicyRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGnsAccessControlPolicyRTByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteGnsAccessControlPolicy calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteGnsAccessControlPolicy(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GnsAccessControlPolicyGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "GnsAccessControlPolicy", displayName) + } + err = obj.client.Global().DeleteGnsAccessControlPolicyRTByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllGnsSchemaViolationDiscovery returns all children of given type +func (obj *GlobalDomainConfig) GetAllGnsSchemaViolationDiscovery(ctx context.Context) ( + result []*GlobalSchemaViolationDiscoveryRT, err error) { + result = make([]*GlobalSchemaViolationDiscoveryRT, 0, len(obj.Spec.GnsSchemaViolationDiscoveryGvk)) + for _, v := range obj.Spec.GnsSchemaViolationDiscoveryGvk { + l, err := obj.client.Global().GetSchemaViolationDiscoveryRTByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGnsSchemaViolationDiscovery returns child which has given displayName +func (obj *GlobalDomainConfig) GetGnsSchemaViolationDiscovery(ctx context.Context, + displayName string) (result *GlobalSchemaViolationDiscoveryRT, err error) { + l, ok := obj.Spec.GnsSchemaViolationDiscoveryGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "GnsSchemaViolationDiscovery", displayName) + } + result, err = obj.client.Global().GetSchemaViolationDiscoveryRTByName(ctx, l.Name) + return +} + +// AddGnsSchemaViolationDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddGnsSchemaViolationDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT) (result *GlobalSchemaViolationDiscoveryRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateSchemaViolationDiscoveryRTByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteGnsSchemaViolationDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteGnsSchemaViolationDiscovery(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GnsSchemaViolationDiscoveryGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "GnsSchemaViolationDiscovery", displayName) + } + err = obj.client.Global().DeleteSchemaViolationDiscoveryRTByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllGnsSegmentationPolicy returns all children of given type +func (obj *GlobalDomainConfig) GetAllGnsSegmentationPolicy(ctx context.Context) ( + result []*GlobalGnsSegmentationPolicyRT, err error) { + result = make([]*GlobalGnsSegmentationPolicyRT, 0, len(obj.Spec.GnsSegmentationPolicyGvk)) + for _, v := range obj.Spec.GnsSegmentationPolicyGvk { + l, err := obj.client.Global().GetGnsSegmentationPolicyRTByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGnsSegmentationPolicy returns child which has given displayName +func (obj *GlobalDomainConfig) GetGnsSegmentationPolicy(ctx context.Context, + displayName string) (result *GlobalGnsSegmentationPolicyRT, err error) { + l, ok := obj.Spec.GnsSegmentationPolicyGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "GnsSegmentationPolicy", displayName) + } + result, err = obj.client.Global().GetGnsSegmentationPolicyRTByName(ctx, l.Name) + return +} + +// AddGnsSegmentationPolicy calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddGnsSegmentationPolicy(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT) (result *GlobalGnsSegmentationPolicyRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGnsSegmentationPolicyRTByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteGnsSegmentationPolicy calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteGnsSegmentationPolicy(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GnsSegmentationPolicyGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "GnsSegmentationPolicy", displayName) + } + err = obj.client.Global().DeleteGnsSegmentationPolicyRTByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllCertificateAuthority returns all children of given type +func (obj *GlobalDomainConfig) GetAllCertificateAuthority(ctx context.Context) ( + result []*GlobalCertificateAuthorityRT, err error) { + result = make([]*GlobalCertificateAuthorityRT, 0, len(obj.Spec.CertificateAuthorityGvk)) + for _, v := range obj.Spec.CertificateAuthorityGvk { + l, err := obj.client.Global().GetCertificateAuthorityRTByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetCertificateAuthority returns child which has given displayName +func (obj *GlobalDomainConfig) GetCertificateAuthority(ctx context.Context, + displayName string) (result *GlobalCertificateAuthorityRT, err error) { + l, ok := obj.Spec.CertificateAuthorityGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "CertificateAuthority", displayName) + } + result, err = obj.client.Global().GetCertificateAuthorityRTByName(ctx, l.Name) + return +} + +// AddCertificateAuthority calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddCertificateAuthority(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.CertificateAuthorityRT) (result *GlobalCertificateAuthorityRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateCertificateAuthorityRTByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteCertificateAuthority calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteCertificateAuthority(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.CertificateAuthorityGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "CertificateAuthority", displayName) + } + err = obj.client.Global().DeleteCertificateAuthorityRTByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// GetAllGnsEndpointsConfig returns all children of given type +func (obj *GlobalDomainConfig) GetAllGnsEndpointsConfig(ctx context.Context) ( + result []*GlobalGnsEndpointsConfig, err error) { + result = make([]*GlobalGnsEndpointsConfig, 0, len(obj.Spec.GnsEndpointsConfigGvk)) + for _, v := range obj.Spec.GnsEndpointsConfigGvk { + l, err := obj.client.Global().GetGnsEndpointsConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGnsEndpointsConfig returns child which has given displayName +func (obj *GlobalDomainConfig) GetGnsEndpointsConfig(ctx context.Context, + displayName string) (result *GlobalGnsEndpointsConfig, err error) { + l, ok := obj.Spec.GnsEndpointsConfigGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "GnsEndpointsConfig", displayName) + } + result, err = obj.client.Global().GetGnsEndpointsConfigByName(ctx, l.Name) + return +} + +// AddGnsEndpointsConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomainConfig) AddGnsEndpointsConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsEndpointsConfig) (result *GlobalGnsEndpointsConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domainconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domainconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGnsEndpointsConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +// DeleteGnsEndpointsConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomainConfig) DeleteGnsEndpointsConfig(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GnsEndpointsConfigGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.DomainConfig", "GnsEndpointsConfig", displayName) + } + err = obj.client.Global().DeleteGnsEndpointsConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainConfigByName(ctx, obj.GetName()) + if err == nil { + obj.DomainConfig = updatedObj.DomainConfig + } + return +} + +type domainconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *domainconfigGlobalTsmV1Chainer) Subscribe() { + key := "domainconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDomainConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *domainconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "domainconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *domainconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "domainconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *domainconfigGlobalTsmV1Chainer) Policy(name string) *policyconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["policyconfigs.global.tsm.tanzu.vmware.com"] = name + return &policyconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetPolicy calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetPolicy(ctx context.Context, displayName string) (result *GlobalPolicyConfig, err error) { + hashedName := helper.GetHashedName("policyconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetPolicyConfigByName(ctx, hashedName) +} + +// AddPolicy calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddPolicy(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PolicyConfig) (result *GlobalPolicyConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("policyconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreatePolicyConfigByName(ctx, objToCreate) +} + +// DeletePolicy calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeletePolicy(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("policyconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeletePolicyConfigByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) LabelConfig(name string) *labelconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["labelconfigs.global.tsm.tanzu.vmware.com"] = name + return &labelconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetLabelConfig calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetLabelConfig(ctx context.Context, displayName string) (result *GlobalLabelConfig, err error) { + hashedName := helper.GetHashedName("labelconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetLabelConfigByName(ctx, hashedName) +} + +// AddLabelConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddLabelConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.LabelConfig) (result *GlobalLabelConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("labelconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateLabelConfigByName(ctx, objToCreate) +} + +// DeleteLabelConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteLabelConfig(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("labelconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteLabelConfigByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) NetworkAttachmentDefinition(name string) *networkattachmentdefinitionconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["networkattachmentdefinitionconfigs.global.tsm.tanzu.vmware.com"] = name + return &networkattachmentdefinitionconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetNetworkAttachmentDefinition calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetNetworkAttachmentDefinition(ctx context.Context, displayName string) (result *GlobalNetworkAttachmentDefinitionConfig, err error) { + hashedName := helper.GetHashedName("networkattachmentdefinitionconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetNetworkAttachmentDefinitionConfigByName(ctx, hashedName) +} + +// AddNetworkAttachmentDefinition calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddNetworkAttachmentDefinition(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig) (result *GlobalNetworkAttachmentDefinitionConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("networkattachmentdefinitionconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateNetworkAttachmentDefinitionConfigByName(ctx, objToCreate) +} + +// DeleteNetworkAttachmentDefinition calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteNetworkAttachmentDefinition(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("networkattachmentdefinitionconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteNetworkAttachmentDefinitionConfigByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) Services(name string) *serviceconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["serviceconfigs.global.tsm.tanzu.vmware.com"] = name + return &serviceconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServices calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetServices(ctx context.Context, displayName string) (result *GlobalServiceConfig, err error) { + hashedName := helper.GetHashedName("serviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceConfigByName(ctx, hashedName) +} + +// AddServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceConfig) (result *GlobalServiceConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("serviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceConfigByName(ctx, objToCreate) +} + +// DeleteServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteServices(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("serviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceConfigByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) ServiceEntries(name string) *serviceentryconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["serviceentryconfigs.global.tsm.tanzu.vmware.com"] = name + return &serviceentryconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceEntries calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetServiceEntries(ctx context.Context, displayName string) (result *GlobalServiceEntryConfig, err error) { + hashedName := helper.GetHashedName("serviceentryconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceEntryConfigByName(ctx, hashedName) +} + +// AddServiceEntries calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddServiceEntries(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceEntryConfig) (result *GlobalServiceEntryConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("serviceentryconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceEntryConfigByName(ctx, objToCreate) +} + +// DeleteServiceEntries calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteServiceEntries(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("serviceentryconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceEntryConfigByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) GatewayConfig(name string) *gatewayconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gatewayconfigs.global.tsm.tanzu.vmware.com"] = name + return &gatewayconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGatewayConfig calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetGatewayConfig(ctx context.Context, displayName string) (result *GlobalGatewayConfig, err error) { + hashedName := helper.GetHashedName("gatewayconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGatewayConfigByName(ctx, hashedName) +} + +// AddGatewayConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddGatewayConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GatewayConfig) (result *GlobalGatewayConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gatewayconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGatewayConfigByName(ctx, objToCreate) +} + +// DeleteGatewayConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteGatewayConfig(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gatewayconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGatewayConfigByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) Autoscalers(name string) *autoscalerconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["autoscalerconfigs.global.tsm.tanzu.vmware.com"] = name + return &autoscalerconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetAutoscalers calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetAutoscalers(ctx context.Context, displayName string) (result *GlobalAutoscalerConfig, err error) { + hashedName := helper.GetHashedName("autoscalerconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAutoscalerConfigByName(ctx, hashedName) +} + +// AddAutoscalers calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddAutoscalers(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AutoscalerConfig) (result *GlobalAutoscalerConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("autoscalerconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAutoscalerConfigByName(ctx, objToCreate) +} + +// DeleteAutoscalers calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteAutoscalers(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("autoscalerconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAutoscalerConfigByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) HostConfigV2(name string) *hostconfigv2GlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["hostconfigv2s.global.tsm.tanzu.vmware.com"] = name + return &hostconfigv2GlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetHostConfigV2 calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetHostConfigV2(ctx context.Context, displayName string) (result *GlobalHostConfigV2, err error) { + hashedName := helper.GetHashedName("hostconfigv2s.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetHostConfigV2ByName(ctx, hashedName) +} + +// AddHostConfigV2 calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddHostConfigV2(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.HostConfigV2) (result *GlobalHostConfigV2, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("hostconfigv2s.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateHostConfigV2ByName(ctx, objToCreate) +} + +// DeleteHostConfigV2 calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteHostConfigV2(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("hostconfigv2s.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteHostConfigV2ByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) InboundAuthenticationConfig(name string) *inboundauthenticationconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["inboundauthenticationconfigs.global.tsm.tanzu.vmware.com"] = name + return &inboundauthenticationconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetInboundAuthenticationConfig calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetInboundAuthenticationConfig(ctx context.Context, displayName string) (result *GlobalInboundAuthenticationConfig, err error) { + hashedName := helper.GetHashedName("inboundauthenticationconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetInboundAuthenticationConfigByName(ctx, hashedName) +} + +// AddInboundAuthenticationConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddInboundAuthenticationConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.InboundAuthenticationConfig) (result *GlobalInboundAuthenticationConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("inboundauthenticationconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateInboundAuthenticationConfigByName(ctx, objToCreate) +} + +// DeleteInboundAuthenticationConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteInboundAuthenticationConfig(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("inboundauthenticationconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteInboundAuthenticationConfigByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) Slos(name string) *sloconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["sloconfigs.global.tsm.tanzu.vmware.com"] = name + return &sloconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetSlos calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetSlos(ctx context.Context, displayName string) (result *GlobalSloConfig, err error) { + hashedName := helper.GetHashedName("sloconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetSloConfigByName(ctx, hashedName) +} + +// AddSlos calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddSlos(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SloConfig) (result *GlobalSloConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("sloconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateSloConfigByName(ctx, objToCreate) +} + +// DeleteSlos calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteSlos(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("sloconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteSloConfigByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) Secrets(name string) *secretrtconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["secretrtconfigs.global.tsm.tanzu.vmware.com"] = name + return &secretrtconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetSecrets calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetSecrets(ctx context.Context, displayName string) (result *GlobalSecretRTConfig, err error) { + hashedName := helper.GetHashedName("secretrtconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetSecretRTConfigByName(ctx, hashedName) +} + +// AddSecrets calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddSecrets(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SecretRTConfig) (result *GlobalSecretRTConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("secretrtconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateSecretRTConfigByName(ctx, objToCreate) +} + +// DeleteSecrets calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteSecrets(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("secretrtconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteSecretRTConfigByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) ExternalServices(name string) *externalservicesrtGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externalservicesrts.global.tsm.tanzu.vmware.com"] = name + return &externalservicesrtGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetExternalServices calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetExternalServices(ctx context.Context, displayName string) (result *GlobalExternalServicesRT, err error) { + hashedName := helper.GetHashedName("externalservicesrts.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalServicesRTByName(ctx, hashedName) +} + +// AddExternalServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddExternalServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalServicesRT) (result *GlobalExternalServicesRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalservicesrts.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalServicesRTByName(ctx, objToCreate) +} + +// DeleteExternalServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteExternalServices(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalservicesrts.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalServicesRTByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) ApiDiscovery(name string) *apidiscoveryrtGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["apidiscoveryrts.global.tsm.tanzu.vmware.com"] = name + return &apidiscoveryrtGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetApiDiscovery calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetApiDiscovery(ctx context.Context, displayName string) (result *GlobalApiDiscoveryRT, err error) { + hashedName := helper.GetHashedName("apidiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetApiDiscoveryRTByName(ctx, hashedName) +} + +// AddApiDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddApiDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ApiDiscoveryRT) (result *GlobalApiDiscoveryRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("apidiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateApiDiscoveryRTByName(ctx, objToCreate) +} + +// DeleteApiDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteApiDiscovery(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("apidiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteApiDiscoveryRTByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) GeoDiscovery(name string) *geodiscoveryrtGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["geodiscoveryrts.global.tsm.tanzu.vmware.com"] = name + return &geodiscoveryrtGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGeoDiscovery calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetGeoDiscovery(ctx context.Context, displayName string) (result *GlobalGeoDiscoveryRT, err error) { + hashedName := helper.GetHashedName("geodiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGeoDiscoveryRTByName(ctx, hashedName) +} + +// AddGeoDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddGeoDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GeoDiscoveryRT) (result *GlobalGeoDiscoveryRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("geodiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGeoDiscoveryRTByName(ctx, objToCreate) +} + +// DeleteGeoDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteGeoDiscovery(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("geodiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGeoDiscoveryRTByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) PiiDiscovery(name string) *piidiscoveryrtGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["piidiscoveryrts.global.tsm.tanzu.vmware.com"] = name + return &piidiscoveryrtGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetPiiDiscovery calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetPiiDiscovery(ctx context.Context, displayName string) (result *GlobalPiiDiscoveryRT, err error) { + hashedName := helper.GetHashedName("piidiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetPiiDiscoveryRTByName(ctx, hashedName) +} + +// AddPiiDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddPiiDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PiiDiscoveryRT) (result *GlobalPiiDiscoveryRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("piidiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreatePiiDiscoveryRTByName(ctx, objToCreate) +} + +// DeletePiiDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeletePiiDiscovery(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("piidiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeletePiiDiscoveryRTByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) AttackDiscovery(name string) *attackdiscoveryrtGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["attackdiscoveryrts.global.tsm.tanzu.vmware.com"] = name + return &attackdiscoveryrtGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetAttackDiscovery calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetAttackDiscovery(ctx context.Context, displayName string) (result *GlobalAttackDiscoveryRT, err error) { + hashedName := helper.GetHashedName("attackdiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAttackDiscoveryRTByName(ctx, hashedName) +} + +// AddAttackDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddAttackDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AttackDiscoveryRT) (result *GlobalAttackDiscoveryRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("attackdiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAttackDiscoveryRTByName(ctx, objToCreate) +} + +// DeleteAttackDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteAttackDiscovery(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("attackdiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAttackDiscoveryRTByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) UserDiscovery(name string) *userdiscoveryrtGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["userdiscoveryrts.global.tsm.tanzu.vmware.com"] = name + return &userdiscoveryrtGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetUserDiscovery calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetUserDiscovery(ctx context.Context, displayName string) (result *GlobalUserDiscoveryRT, err error) { + hashedName := helper.GetHashedName("userdiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetUserDiscoveryRTByName(ctx, hashedName) +} + +// AddUserDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddUserDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.UserDiscoveryRT) (result *GlobalUserDiscoveryRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("userdiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateUserDiscoveryRTByName(ctx, objToCreate) +} + +// DeleteUserDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteUserDiscovery(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("userdiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteUserDiscoveryRTByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) PublicService(name string) *publicservicertGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["publicservicerts.global.tsm.tanzu.vmware.com"] = name + return &publicservicertGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetPublicService calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetPublicService(ctx context.Context, displayName string) (result *GlobalPublicServiceRT, err error) { + hashedName := helper.GetHashedName("publicservicerts.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetPublicServiceRTByName(ctx, hashedName) +} + +// AddPublicService calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddPublicService(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PublicServiceRT) (result *GlobalPublicServiceRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("publicservicerts.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreatePublicServiceRTByName(ctx, objToCreate) +} + +// DeletePublicService calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeletePublicService(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("publicservicerts.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeletePublicServiceRTByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) GnsAccessControlPolicy(name string) *gnsaccesscontrolpolicyrtGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gnsaccesscontrolpolicyrts.global.tsm.tanzu.vmware.com"] = name + return &gnsaccesscontrolpolicyrtGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGnsAccessControlPolicy calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetGnsAccessControlPolicy(ctx context.Context, displayName string) (result *GlobalGnsAccessControlPolicyRT, err error) { + hashedName := helper.GetHashedName("gnsaccesscontrolpolicyrts.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGnsAccessControlPolicyRTByName(ctx, hashedName) +} + +// AddGnsAccessControlPolicy calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddGnsAccessControlPolicy(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT) (result *GlobalGnsAccessControlPolicyRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsaccesscontrolpolicyrts.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGnsAccessControlPolicyRTByName(ctx, objToCreate) +} + +// DeleteGnsAccessControlPolicy calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteGnsAccessControlPolicy(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsaccesscontrolpolicyrts.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGnsAccessControlPolicyRTByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) GnsSchemaViolationDiscovery(name string) *schemaviolationdiscoveryrtGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["schemaviolationdiscoveryrts.global.tsm.tanzu.vmware.com"] = name + return &schemaviolationdiscoveryrtGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGnsSchemaViolationDiscovery calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetGnsSchemaViolationDiscovery(ctx context.Context, displayName string) (result *GlobalSchemaViolationDiscoveryRT, err error) { + hashedName := helper.GetHashedName("schemaviolationdiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetSchemaViolationDiscoveryRTByName(ctx, hashedName) +} + +// AddGnsSchemaViolationDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddGnsSchemaViolationDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT) (result *GlobalSchemaViolationDiscoveryRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("schemaviolationdiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateSchemaViolationDiscoveryRTByName(ctx, objToCreate) +} + +// DeleteGnsSchemaViolationDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteGnsSchemaViolationDiscovery(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("schemaviolationdiscoveryrts.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteSchemaViolationDiscoveryRTByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) GnsSegmentationPolicy(name string) *gnssegmentationpolicyrtGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gnssegmentationpolicyrts.global.tsm.tanzu.vmware.com"] = name + return &gnssegmentationpolicyrtGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGnsSegmentationPolicy calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetGnsSegmentationPolicy(ctx context.Context, displayName string) (result *GlobalGnsSegmentationPolicyRT, err error) { + hashedName := helper.GetHashedName("gnssegmentationpolicyrts.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGnsSegmentationPolicyRTByName(ctx, hashedName) +} + +// AddGnsSegmentationPolicy calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddGnsSegmentationPolicy(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT) (result *GlobalGnsSegmentationPolicyRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnssegmentationpolicyrts.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGnsSegmentationPolicyRTByName(ctx, objToCreate) +} + +// DeleteGnsSegmentationPolicy calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteGnsSegmentationPolicy(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnssegmentationpolicyrts.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGnsSegmentationPolicyRTByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) CertificateAuthority(name string) *certificateauthorityrtGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["certificateauthorityrts.global.tsm.tanzu.vmware.com"] = name + return &certificateauthorityrtGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetCertificateAuthority calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetCertificateAuthority(ctx context.Context, displayName string) (result *GlobalCertificateAuthorityRT, err error) { + hashedName := helper.GetHashedName("certificateauthorityrts.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetCertificateAuthorityRTByName(ctx, hashedName) +} + +// AddCertificateAuthority calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddCertificateAuthority(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.CertificateAuthorityRT) (result *GlobalCertificateAuthorityRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("certificateauthorityrts.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateCertificateAuthorityRTByName(ctx, objToCreate) +} + +// DeleteCertificateAuthority calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteCertificateAuthority(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("certificateauthorityrts.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteCertificateAuthorityRTByName(ctx, hashedName) +} + +func (c *domainconfigGlobalTsmV1Chainer) GnsEndpointsConfig(name string) *gnsendpointsconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gnsendpointsconfigs.global.tsm.tanzu.vmware.com"] = name + return &gnsendpointsconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGnsEndpointsConfig calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainconfigGlobalTsmV1Chainer) GetGnsEndpointsConfig(ctx context.Context, displayName string) (result *GlobalGnsEndpointsConfig, err error) { + hashedName := helper.GetHashedName("gnsendpointsconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGnsEndpointsConfigByName(ctx, hashedName) +} + +// AddGnsEndpointsConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainconfigGlobalTsmV1Chainer) AddGnsEndpointsConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsEndpointsConfig) (result *GlobalGnsEndpointsConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsendpointsconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGnsEndpointsConfigByName(ctx, objToCreate) +} + +// DeleteGnsEndpointsConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainconfigGlobalTsmV1Chainer) DeleteGnsEndpointsConfig(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsendpointsconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGnsEndpointsConfigByName(ctx, hashedName) +} + +// GetDomainByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetDomainByName(ctx context.Context, hashedName string) (*GlobalDomain, error) { + key := "domains.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Domain) + return &GlobalDomain{ + client: group.client, + Domain: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Domains().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDomain{ + client: group.client, + Domain: result, + }, nil + } +} + +// DeleteDomainByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteDomainByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Domains().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.SecretHashesGvk { + err := group.client. + Global().DeleteSecretHashByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ServiceInstancesGvk { + err := group.client. + Global().DeleteServiceInstanceByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ServiceDeploymentsGvk { + err := group.client. + Global().DeleteServiceDeploymentByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ServiceStatefulSetsGvk { + err := group.client. + Global().DeleteServiceStatefulSetByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ServiceDaemonSetsGvk { + err := group.client. + Global().DeleteServiceDaemonSetByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ServiceReplicaSetsGvk { + err := group.client. + Global().DeleteServiceReplicaSetByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ServiceCronJobsGvk { + err := group.client. + Global().DeleteServiceCronJobByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ServiceJobsGvk { + err := group.client. + Global().DeleteServiceJobByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.VirtualServicesGvk { + err := group.client. + Global().DeleteVirtualServiceByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ServiceEntryGvk { + err := group.client. + Global().DeleteServiceEntryByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.WorkloadEntryGvk { + err := group.client. + Global().DeleteWorkloadEntryByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.DestinationRulesGvk { + err := group.client. + Global().DeleteDestinationRuleByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ServicesGvk { + err := group.client. + Global().DeleteServiceByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.EndpointsGvk { + err := group.client. + Global().DeleteEndpointsByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.GatewaysGvk { + err := group.client. + Global().DeleteGatewayByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.AuthenticationPoliciesGvk { + err := group.client. + Global().DeleteAuthenticationPolicyByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ConfigmapGvk { + err := group.client. + Global().DeleteConfigMapByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.EnvoyfilterGvk { + err := group.client. + Global().DeleteEnvoyFilterByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.AutoscalersGvk { + err := group.client. + Global().DeleteAutoscalerCRByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.PeerAuthenticationGvk { + err := group.client. + Global().DeletePeerAuthenticationByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.KnativeIngressesGvk { + err := group.client. + Global().DeleteKnativeIngressByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.NetworkAttachmentDefinitionGvk { + err := group.client. + Global().DeleteNetworkAttachmentDefinitionByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.IssuersGvk { + err := group.client. + Global().DeleteIssuerByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.CertificatesGvk { + err := group.client. + Global().DeleteCertificateByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.CertificateRequestsGvk { + err := group.client. + Global().DeleteCertificateRequestByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + Domains().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/domainsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["clusters.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Clusters().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateDomainByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateDomainByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Domain) (*GlobalDomain, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.SecretHashesGvk = nil + objToCreate.Spec.ServiceInstancesGvk = nil + objToCreate.Spec.ServiceDeploymentsGvk = nil + objToCreate.Spec.ServiceStatefulSetsGvk = nil + objToCreate.Spec.ServiceDaemonSetsGvk = nil + objToCreate.Spec.ServiceReplicaSetsGvk = nil + objToCreate.Spec.ServiceCronJobsGvk = nil + objToCreate.Spec.ServiceJobsGvk = nil + objToCreate.Spec.VirtualServicesGvk = nil + objToCreate.Spec.ServiceEntryGvk = nil + objToCreate.Spec.WorkloadEntryGvk = nil + objToCreate.Spec.DestinationRulesGvk = nil + objToCreate.Spec.ServicesGvk = nil + objToCreate.Spec.EndpointsGvk = nil + objToCreate.Spec.GatewaysGvk = nil + objToCreate.Spec.AuthenticationPoliciesGvk = nil + objToCreate.Spec.ConfigmapGvk = nil + objToCreate.Spec.EnvoyfilterGvk = nil + objToCreate.Spec.AutoscalersGvk = nil + objToCreate.Spec.PeerAuthenticationGvk = nil + objToCreate.Spec.KnativeIngressesGvk = nil + objToCreate.Spec.NetworkAttachmentDefinitionGvk = nil + objToCreate.Spec.IssuersGvk = nil + objToCreate.Spec.CertificatesGvk = nil + objToCreate.Spec.CertificateRequestsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + Domains().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["clusters.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"domainsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"Domain\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Clusters().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalDomain{ + client: group.client, + Domain: result, + }, nil +} + +// UpdateDomainByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateDomainByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Domain) (*GlobalDomain, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Domains().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueEnviornmentType := + objToUpdate.Spec.EnviornmentType + patchOpEnviornmentType := PatchOp{ + Op: "replace", + Path: "/spec/enviornmentType", + Value: patchValueEnviornmentType, + } + patch = append(patch, patchOpEnviornmentType) + + patchValueApiLink := + objToUpdate.Spec.ApiLink + patchOpApiLink := PatchOp{ + Op: "replace", + Path: "/spec/apiLink", + Value: patchValueApiLink, + } + patch = append(patch, patchOpApiLink) + + patchValueAnnotations := + objToUpdate.Spec.Annotations + patchOpAnnotations := PatchOp{ + Op: "replace", + Path: "/spec/annotations", + Value: patchValueAnnotations, + } + patch = append(patch, patchOpAnnotations) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalDomain{ + client: group.client, + Domain: result, + }, nil +} + +// ListDomains returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListDomains(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalDomain, err error) { + key := "domains.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalDomain, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Domain) + result[k] = &GlobalDomain{ + client: group.client, + Domain: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Domains().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalDomain, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalDomain{ + client: group.client, + Domain: &item, + } + } + } + return +} + +type GlobalDomain struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Domain +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalDomain) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteDomainByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Domain = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalDomain) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateDomainByName(ctx, obj.Domain) + if err != nil { + return err + } + obj.Domain = result.Domain + return nil +} + +func (obj *GlobalDomain) GetParent(ctx context.Context) (result *GlobalCluster, err error) { + hashedName := helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["clusters.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetClusterByName(ctx, hashedName) +} + +// GetAllSecretHashes returns all children of given type +func (obj *GlobalDomain) GetAllSecretHashes(ctx context.Context) ( + result []*GlobalSecretHash, err error) { + result = make([]*GlobalSecretHash, 0, len(obj.Spec.SecretHashesGvk)) + for _, v := range obj.Spec.SecretHashesGvk { + l, err := obj.client.Global().GetSecretHashByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetSecretHashes returns child which has given displayName +func (obj *GlobalDomain) GetSecretHashes(ctx context.Context, + displayName string) (result *GlobalSecretHash, err error) { + l, ok := obj.Spec.SecretHashesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "SecretHashes", displayName) + } + result, err = obj.client.Global().GetSecretHashByName(ctx, l.Name) + return +} + +// AddSecretHashes calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddSecretHashes(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SecretHash) (result *GlobalSecretHash, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateSecretHashByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteSecretHashes calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteSecretHashes(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.SecretHashesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "SecretHashes", displayName) + } + err = obj.client.Global().DeleteSecretHashByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllServiceInstances returns all children of given type +func (obj *GlobalDomain) GetAllServiceInstances(ctx context.Context) ( + result []*GlobalServiceInstance, err error) { + result = make([]*GlobalServiceInstance, 0, len(obj.Spec.ServiceInstancesGvk)) + for _, v := range obj.Spec.ServiceInstancesGvk { + l, err := obj.client.Global().GetServiceInstanceByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceInstances returns child which has given displayName +func (obj *GlobalDomain) GetServiceInstances(ctx context.Context, + displayName string) (result *GlobalServiceInstance, err error) { + l, ok := obj.Spec.ServiceInstancesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "ServiceInstances", displayName) + } + result, err = obj.client.Global().GetServiceInstanceByName(ctx, l.Name) + return +} + +// AddServiceInstances calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddServiceInstances(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceInstance) (result *GlobalServiceInstance, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceInstanceByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteServiceInstances calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteServiceInstances(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceInstancesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "ServiceInstances", displayName) + } + err = obj.client.Global().DeleteServiceInstanceByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllServiceDeployments returns all children of given type +func (obj *GlobalDomain) GetAllServiceDeployments(ctx context.Context) ( + result []*GlobalServiceDeployment, err error) { + result = make([]*GlobalServiceDeployment, 0, len(obj.Spec.ServiceDeploymentsGvk)) + for _, v := range obj.Spec.ServiceDeploymentsGvk { + l, err := obj.client.Global().GetServiceDeploymentByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceDeployments returns child which has given displayName +func (obj *GlobalDomain) GetServiceDeployments(ctx context.Context, + displayName string) (result *GlobalServiceDeployment, err error) { + l, ok := obj.Spec.ServiceDeploymentsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "ServiceDeployments", displayName) + } + result, err = obj.client.Global().GetServiceDeploymentByName(ctx, l.Name) + return +} + +// AddServiceDeployments calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddServiceDeployments(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDeployment) (result *GlobalServiceDeployment, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceDeploymentByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteServiceDeployments calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteServiceDeployments(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceDeploymentsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "ServiceDeployments", displayName) + } + err = obj.client.Global().DeleteServiceDeploymentByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllServiceStatefulSets returns all children of given type +func (obj *GlobalDomain) GetAllServiceStatefulSets(ctx context.Context) ( + result []*GlobalServiceStatefulSet, err error) { + result = make([]*GlobalServiceStatefulSet, 0, len(obj.Spec.ServiceStatefulSetsGvk)) + for _, v := range obj.Spec.ServiceStatefulSetsGvk { + l, err := obj.client.Global().GetServiceStatefulSetByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceStatefulSets returns child which has given displayName +func (obj *GlobalDomain) GetServiceStatefulSets(ctx context.Context, + displayName string) (result *GlobalServiceStatefulSet, err error) { + l, ok := obj.Spec.ServiceStatefulSetsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "ServiceStatefulSets", displayName) + } + result, err = obj.client.Global().GetServiceStatefulSetByName(ctx, l.Name) + return +} + +// AddServiceStatefulSets calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddServiceStatefulSets(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceStatefulSet) (result *GlobalServiceStatefulSet, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceStatefulSetByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteServiceStatefulSets calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteServiceStatefulSets(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceStatefulSetsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "ServiceStatefulSets", displayName) + } + err = obj.client.Global().DeleteServiceStatefulSetByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllServiceDaemonSets returns all children of given type +func (obj *GlobalDomain) GetAllServiceDaemonSets(ctx context.Context) ( + result []*GlobalServiceDaemonSet, err error) { + result = make([]*GlobalServiceDaemonSet, 0, len(obj.Spec.ServiceDaemonSetsGvk)) + for _, v := range obj.Spec.ServiceDaemonSetsGvk { + l, err := obj.client.Global().GetServiceDaemonSetByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceDaemonSets returns child which has given displayName +func (obj *GlobalDomain) GetServiceDaemonSets(ctx context.Context, + displayName string) (result *GlobalServiceDaemonSet, err error) { + l, ok := obj.Spec.ServiceDaemonSetsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "ServiceDaemonSets", displayName) + } + result, err = obj.client.Global().GetServiceDaemonSetByName(ctx, l.Name) + return +} + +// AddServiceDaemonSets calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddServiceDaemonSets(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDaemonSet) (result *GlobalServiceDaemonSet, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceDaemonSetByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteServiceDaemonSets calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteServiceDaemonSets(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceDaemonSetsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "ServiceDaemonSets", displayName) + } + err = obj.client.Global().DeleteServiceDaemonSetByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllServiceReplicaSets returns all children of given type +func (obj *GlobalDomain) GetAllServiceReplicaSets(ctx context.Context) ( + result []*GlobalServiceReplicaSet, err error) { + result = make([]*GlobalServiceReplicaSet, 0, len(obj.Spec.ServiceReplicaSetsGvk)) + for _, v := range obj.Spec.ServiceReplicaSetsGvk { + l, err := obj.client.Global().GetServiceReplicaSetByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceReplicaSets returns child which has given displayName +func (obj *GlobalDomain) GetServiceReplicaSets(ctx context.Context, + displayName string) (result *GlobalServiceReplicaSet, err error) { + l, ok := obj.Spec.ServiceReplicaSetsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "ServiceReplicaSets", displayName) + } + result, err = obj.client.Global().GetServiceReplicaSetByName(ctx, l.Name) + return +} + +// AddServiceReplicaSets calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddServiceReplicaSets(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceReplicaSet) (result *GlobalServiceReplicaSet, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceReplicaSetByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteServiceReplicaSets calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteServiceReplicaSets(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceReplicaSetsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "ServiceReplicaSets", displayName) + } + err = obj.client.Global().DeleteServiceReplicaSetByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllServiceCronJobs returns all children of given type +func (obj *GlobalDomain) GetAllServiceCronJobs(ctx context.Context) ( + result []*GlobalServiceCronJob, err error) { + result = make([]*GlobalServiceCronJob, 0, len(obj.Spec.ServiceCronJobsGvk)) + for _, v := range obj.Spec.ServiceCronJobsGvk { + l, err := obj.client.Global().GetServiceCronJobByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceCronJobs returns child which has given displayName +func (obj *GlobalDomain) GetServiceCronJobs(ctx context.Context, + displayName string) (result *GlobalServiceCronJob, err error) { + l, ok := obj.Spec.ServiceCronJobsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "ServiceCronJobs", displayName) + } + result, err = obj.client.Global().GetServiceCronJobByName(ctx, l.Name) + return +} + +// AddServiceCronJobs calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddServiceCronJobs(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceCronJob) (result *GlobalServiceCronJob, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceCronJobByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteServiceCronJobs calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteServiceCronJobs(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceCronJobsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "ServiceCronJobs", displayName) + } + err = obj.client.Global().DeleteServiceCronJobByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllServiceJobs returns all children of given type +func (obj *GlobalDomain) GetAllServiceJobs(ctx context.Context) ( + result []*GlobalServiceJob, err error) { + result = make([]*GlobalServiceJob, 0, len(obj.Spec.ServiceJobsGvk)) + for _, v := range obj.Spec.ServiceJobsGvk { + l, err := obj.client.Global().GetServiceJobByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceJobs returns child which has given displayName +func (obj *GlobalDomain) GetServiceJobs(ctx context.Context, + displayName string) (result *GlobalServiceJob, err error) { + l, ok := obj.Spec.ServiceJobsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "ServiceJobs", displayName) + } + result, err = obj.client.Global().GetServiceJobByName(ctx, l.Name) + return +} + +// AddServiceJobs calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddServiceJobs(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceJob) (result *GlobalServiceJob, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceJobByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteServiceJobs calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteServiceJobs(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceJobsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "ServiceJobs", displayName) + } + err = obj.client.Global().DeleteServiceJobByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllVirtualServices returns all children of given type +func (obj *GlobalDomain) GetAllVirtualServices(ctx context.Context) ( + result []*GlobalVirtualService, err error) { + result = make([]*GlobalVirtualService, 0, len(obj.Spec.VirtualServicesGvk)) + for _, v := range obj.Spec.VirtualServicesGvk { + l, err := obj.client.Global().GetVirtualServiceByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetVirtualServices returns child which has given displayName +func (obj *GlobalDomain) GetVirtualServices(ctx context.Context, + displayName string) (result *GlobalVirtualService, err error) { + l, ok := obj.Spec.VirtualServicesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "VirtualServices", displayName) + } + result, err = obj.client.Global().GetVirtualServiceByName(ctx, l.Name) + return +} + +// AddVirtualServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddVirtualServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.VirtualService) (result *GlobalVirtualService, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateVirtualServiceByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteVirtualServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteVirtualServices(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.VirtualServicesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "VirtualServices", displayName) + } + err = obj.client.Global().DeleteVirtualServiceByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllServiceEntry returns all children of given type +func (obj *GlobalDomain) GetAllServiceEntry(ctx context.Context) ( + result []*GlobalServiceEntry, err error) { + result = make([]*GlobalServiceEntry, 0, len(obj.Spec.ServiceEntryGvk)) + for _, v := range obj.Spec.ServiceEntryGvk { + l, err := obj.client.Global().GetServiceEntryByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceEntry returns child which has given displayName +func (obj *GlobalDomain) GetServiceEntry(ctx context.Context, + displayName string) (result *GlobalServiceEntry, err error) { + l, ok := obj.Spec.ServiceEntryGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "ServiceEntry", displayName) + } + result, err = obj.client.Global().GetServiceEntryByName(ctx, l.Name) + return +} + +// AddServiceEntry calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddServiceEntry(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceEntry) (result *GlobalServiceEntry, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceEntryByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteServiceEntry calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteServiceEntry(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceEntryGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "ServiceEntry", displayName) + } + err = obj.client.Global().DeleteServiceEntryByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllWorkloadEntry returns all children of given type +func (obj *GlobalDomain) GetAllWorkloadEntry(ctx context.Context) ( + result []*GlobalWorkloadEntry, err error) { + result = make([]*GlobalWorkloadEntry, 0, len(obj.Spec.WorkloadEntryGvk)) + for _, v := range obj.Spec.WorkloadEntryGvk { + l, err := obj.client.Global().GetWorkloadEntryByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetWorkloadEntry returns child which has given displayName +func (obj *GlobalDomain) GetWorkloadEntry(ctx context.Context, + displayName string) (result *GlobalWorkloadEntry, err error) { + l, ok := obj.Spec.WorkloadEntryGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "WorkloadEntry", displayName) + } + result, err = obj.client.Global().GetWorkloadEntryByName(ctx, l.Name) + return +} + +// AddWorkloadEntry calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddWorkloadEntry(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.WorkloadEntry) (result *GlobalWorkloadEntry, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateWorkloadEntryByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteWorkloadEntry calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteWorkloadEntry(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.WorkloadEntryGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "WorkloadEntry", displayName) + } + err = obj.client.Global().DeleteWorkloadEntryByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllDestinationRules returns all children of given type +func (obj *GlobalDomain) GetAllDestinationRules(ctx context.Context) ( + result []*GlobalDestinationRule, err error) { + result = make([]*GlobalDestinationRule, 0, len(obj.Spec.DestinationRulesGvk)) + for _, v := range obj.Spec.DestinationRulesGvk { + l, err := obj.client.Global().GetDestinationRuleByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetDestinationRules returns child which has given displayName +func (obj *GlobalDomain) GetDestinationRules(ctx context.Context, + displayName string) (result *GlobalDestinationRule, err error) { + l, ok := obj.Spec.DestinationRulesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "DestinationRules", displayName) + } + result, err = obj.client.Global().GetDestinationRuleByName(ctx, l.Name) + return +} + +// AddDestinationRules calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddDestinationRules(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DestinationRule) (result *GlobalDestinationRule, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDestinationRuleByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteDestinationRules calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteDestinationRules(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.DestinationRulesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "DestinationRules", displayName) + } + err = obj.client.Global().DeleteDestinationRuleByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllServices returns all children of given type +func (obj *GlobalDomain) GetAllServices(ctx context.Context) ( + result []*GlobalService, err error) { + result = make([]*GlobalService, 0, len(obj.Spec.ServicesGvk)) + for _, v := range obj.Spec.ServicesGvk { + l, err := obj.client.Global().GetServiceByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServices returns child which has given displayName +func (obj *GlobalDomain) GetServices(ctx context.Context, + displayName string) (result *GlobalService, err error) { + l, ok := obj.Spec.ServicesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "Services", displayName) + } + result, err = obj.client.Global().GetServiceByName(ctx, l.Name) + return +} + +// AddServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Service) (result *GlobalService, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteServices(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServicesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "Services", displayName) + } + err = obj.client.Global().DeleteServiceByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllEndpoints returns all children of given type +func (obj *GlobalDomain) GetAllEndpoints(ctx context.Context) ( + result []*GlobalEndpoints, err error) { + result = make([]*GlobalEndpoints, 0, len(obj.Spec.EndpointsGvk)) + for _, v := range obj.Spec.EndpointsGvk { + l, err := obj.client.Global().GetEndpointsByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetEndpoints returns child which has given displayName +func (obj *GlobalDomain) GetEndpoints(ctx context.Context, + displayName string) (result *GlobalEndpoints, err error) { + l, ok := obj.Spec.EndpointsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "Endpoints", displayName) + } + result, err = obj.client.Global().GetEndpointsByName(ctx, l.Name) + return +} + +// AddEndpoints calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddEndpoints(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Endpoints) (result *GlobalEndpoints, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateEndpointsByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteEndpoints calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteEndpoints(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.EndpointsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "Endpoints", displayName) + } + err = obj.client.Global().DeleteEndpointsByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllGateways returns all children of given type +func (obj *GlobalDomain) GetAllGateways(ctx context.Context) ( + result []*GlobalGateway, err error) { + result = make([]*GlobalGateway, 0, len(obj.Spec.GatewaysGvk)) + for _, v := range obj.Spec.GatewaysGvk { + l, err := obj.client.Global().GetGatewayByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGateways returns child which has given displayName +func (obj *GlobalDomain) GetGateways(ctx context.Context, + displayName string) (result *GlobalGateway, err error) { + l, ok := obj.Spec.GatewaysGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "Gateways", displayName) + } + result, err = obj.client.Global().GetGatewayByName(ctx, l.Name) + return +} + +// AddGateways calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddGateways(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Gateway) (result *GlobalGateway, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGatewayByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteGateways calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteGateways(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GatewaysGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "Gateways", displayName) + } + err = obj.client.Global().DeleteGatewayByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllAuthenticationPolicies returns all children of given type +func (obj *GlobalDomain) GetAllAuthenticationPolicies(ctx context.Context) ( + result []*GlobalAuthenticationPolicy, err error) { + result = make([]*GlobalAuthenticationPolicy, 0, len(obj.Spec.AuthenticationPoliciesGvk)) + for _, v := range obj.Spec.AuthenticationPoliciesGvk { + l, err := obj.client.Global().GetAuthenticationPolicyByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetAuthenticationPolicies returns child which has given displayName +func (obj *GlobalDomain) GetAuthenticationPolicies(ctx context.Context, + displayName string) (result *GlobalAuthenticationPolicy, err error) { + l, ok := obj.Spec.AuthenticationPoliciesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "AuthenticationPolicies", displayName) + } + result, err = obj.client.Global().GetAuthenticationPolicyByName(ctx, l.Name) + return +} + +// AddAuthenticationPolicies calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddAuthenticationPolicies(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AuthenticationPolicy) (result *GlobalAuthenticationPolicy, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAuthenticationPolicyByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteAuthenticationPolicies calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteAuthenticationPolicies(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.AuthenticationPoliciesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "AuthenticationPolicies", displayName) + } + err = obj.client.Global().DeleteAuthenticationPolicyByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllConfigmap returns all children of given type +func (obj *GlobalDomain) GetAllConfigmap(ctx context.Context) ( + result []*GlobalConfigMap, err error) { + result = make([]*GlobalConfigMap, 0, len(obj.Spec.ConfigmapGvk)) + for _, v := range obj.Spec.ConfigmapGvk { + l, err := obj.client.Global().GetConfigMapByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetConfigmap returns child which has given displayName +func (obj *GlobalDomain) GetConfigmap(ctx context.Context, + displayName string) (result *GlobalConfigMap, err error) { + l, ok := obj.Spec.ConfigmapGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "Configmap", displayName) + } + result, err = obj.client.Global().GetConfigMapByName(ctx, l.Name) + return +} + +// AddConfigmap calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddConfigmap(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ConfigMap) (result *GlobalConfigMap, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateConfigMapByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteConfigmap calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteConfigmap(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ConfigmapGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "Configmap", displayName) + } + err = obj.client.Global().DeleteConfigMapByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllEnvoyfilter returns all children of given type +func (obj *GlobalDomain) GetAllEnvoyfilter(ctx context.Context) ( + result []*GlobalEnvoyFilter, err error) { + result = make([]*GlobalEnvoyFilter, 0, len(obj.Spec.EnvoyfilterGvk)) + for _, v := range obj.Spec.EnvoyfilterGvk { + l, err := obj.client.Global().GetEnvoyFilterByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetEnvoyfilter returns child which has given displayName +func (obj *GlobalDomain) GetEnvoyfilter(ctx context.Context, + displayName string) (result *GlobalEnvoyFilter, err error) { + l, ok := obj.Spec.EnvoyfilterGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "Envoyfilter", displayName) + } + result, err = obj.client.Global().GetEnvoyFilterByName(ctx, l.Name) + return +} + +// AddEnvoyfilter calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddEnvoyfilter(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.EnvoyFilter) (result *GlobalEnvoyFilter, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateEnvoyFilterByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteEnvoyfilter calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteEnvoyfilter(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.EnvoyfilterGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "Envoyfilter", displayName) + } + err = obj.client.Global().DeleteEnvoyFilterByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllAutoscalers returns all children of given type +func (obj *GlobalDomain) GetAllAutoscalers(ctx context.Context) ( + result []*GlobalAutoscalerCR, err error) { + result = make([]*GlobalAutoscalerCR, 0, len(obj.Spec.AutoscalersGvk)) + for _, v := range obj.Spec.AutoscalersGvk { + l, err := obj.client.Global().GetAutoscalerCRByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetAutoscalers returns child which has given displayName +func (obj *GlobalDomain) GetAutoscalers(ctx context.Context, + displayName string) (result *GlobalAutoscalerCR, err error) { + l, ok := obj.Spec.AutoscalersGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "Autoscalers", displayName) + } + result, err = obj.client.Global().GetAutoscalerCRByName(ctx, l.Name) + return +} + +// AddAutoscalers calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddAutoscalers(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AutoscalerCR) (result *GlobalAutoscalerCR, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAutoscalerCRByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteAutoscalers calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteAutoscalers(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.AutoscalersGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "Autoscalers", displayName) + } + err = obj.client.Global().DeleteAutoscalerCRByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllPeerAuthentication returns all children of given type +func (obj *GlobalDomain) GetAllPeerAuthentication(ctx context.Context) ( + result []*GlobalPeerAuthentication, err error) { + result = make([]*GlobalPeerAuthentication, 0, len(obj.Spec.PeerAuthenticationGvk)) + for _, v := range obj.Spec.PeerAuthenticationGvk { + l, err := obj.client.Global().GetPeerAuthenticationByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetPeerAuthentication returns child which has given displayName +func (obj *GlobalDomain) GetPeerAuthentication(ctx context.Context, + displayName string) (result *GlobalPeerAuthentication, err error) { + l, ok := obj.Spec.PeerAuthenticationGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "PeerAuthentication", displayName) + } + result, err = obj.client.Global().GetPeerAuthenticationByName(ctx, l.Name) + return +} + +// AddPeerAuthentication calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddPeerAuthentication(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PeerAuthentication) (result *GlobalPeerAuthentication, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreatePeerAuthenticationByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeletePeerAuthentication calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeletePeerAuthentication(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.PeerAuthenticationGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "PeerAuthentication", displayName) + } + err = obj.client.Global().DeletePeerAuthenticationByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllKnativeIngresses returns all children of given type +func (obj *GlobalDomain) GetAllKnativeIngresses(ctx context.Context) ( + result []*GlobalKnativeIngress, err error) { + result = make([]*GlobalKnativeIngress, 0, len(obj.Spec.KnativeIngressesGvk)) + for _, v := range obj.Spec.KnativeIngressesGvk { + l, err := obj.client.Global().GetKnativeIngressByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetKnativeIngresses returns child which has given displayName +func (obj *GlobalDomain) GetKnativeIngresses(ctx context.Context, + displayName string) (result *GlobalKnativeIngress, err error) { + l, ok := obj.Spec.KnativeIngressesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "KnativeIngresses", displayName) + } + result, err = obj.client.Global().GetKnativeIngressByName(ctx, l.Name) + return +} + +// AddKnativeIngresses calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddKnativeIngresses(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.KnativeIngress) (result *GlobalKnativeIngress, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateKnativeIngressByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteKnativeIngresses calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteKnativeIngresses(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.KnativeIngressesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "KnativeIngresses", displayName) + } + err = obj.client.Global().DeleteKnativeIngressByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllNetworkAttachmentDefinition returns all children of given type +func (obj *GlobalDomain) GetAllNetworkAttachmentDefinition(ctx context.Context) ( + result []*GlobalNetworkAttachmentDefinition, err error) { + result = make([]*GlobalNetworkAttachmentDefinition, 0, len(obj.Spec.NetworkAttachmentDefinitionGvk)) + for _, v := range obj.Spec.NetworkAttachmentDefinitionGvk { + l, err := obj.client.Global().GetNetworkAttachmentDefinitionByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetNetworkAttachmentDefinition returns child which has given displayName +func (obj *GlobalDomain) GetNetworkAttachmentDefinition(ctx context.Context, + displayName string) (result *GlobalNetworkAttachmentDefinition, err error) { + l, ok := obj.Spec.NetworkAttachmentDefinitionGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "NetworkAttachmentDefinition", displayName) + } + result, err = obj.client.Global().GetNetworkAttachmentDefinitionByName(ctx, l.Name) + return +} + +// AddNetworkAttachmentDefinition calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddNetworkAttachmentDefinition(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition) (result *GlobalNetworkAttachmentDefinition, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateNetworkAttachmentDefinitionByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteNetworkAttachmentDefinition calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteNetworkAttachmentDefinition(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.NetworkAttachmentDefinitionGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "NetworkAttachmentDefinition", displayName) + } + err = obj.client.Global().DeleteNetworkAttachmentDefinitionByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllIssuers returns all children of given type +func (obj *GlobalDomain) GetAllIssuers(ctx context.Context) ( + result []*GlobalIssuer, err error) { + result = make([]*GlobalIssuer, 0, len(obj.Spec.IssuersGvk)) + for _, v := range obj.Spec.IssuersGvk { + l, err := obj.client.Global().GetIssuerByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetIssuers returns child which has given displayName +func (obj *GlobalDomain) GetIssuers(ctx context.Context, + displayName string) (result *GlobalIssuer, err error) { + l, ok := obj.Spec.IssuersGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "Issuers", displayName) + } + result, err = obj.client.Global().GetIssuerByName(ctx, l.Name) + return +} + +// AddIssuers calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddIssuers(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Issuer) (result *GlobalIssuer, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateIssuerByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteIssuers calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteIssuers(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.IssuersGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "Issuers", displayName) + } + err = obj.client.Global().DeleteIssuerByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllCertificates returns all children of given type +func (obj *GlobalDomain) GetAllCertificates(ctx context.Context) ( + result []*GlobalCertificate, err error) { + result = make([]*GlobalCertificate, 0, len(obj.Spec.CertificatesGvk)) + for _, v := range obj.Spec.CertificatesGvk { + l, err := obj.client.Global().GetCertificateByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetCertificates returns child which has given displayName +func (obj *GlobalDomain) GetCertificates(ctx context.Context, + displayName string) (result *GlobalCertificate, err error) { + l, ok := obj.Spec.CertificatesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "Certificates", displayName) + } + result, err = obj.client.Global().GetCertificateByName(ctx, l.Name) + return +} + +// AddCertificates calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddCertificates(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Certificate) (result *GlobalCertificate, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateCertificateByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteCertificates calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteCertificates(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.CertificatesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "Certificates", displayName) + } + err = obj.client.Global().DeleteCertificateByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// GetAllCertificateRequests returns all children of given type +func (obj *GlobalDomain) GetAllCertificateRequests(ctx context.Context) ( + result []*GlobalCertificateRequest, err error) { + result = make([]*GlobalCertificateRequest, 0, len(obj.Spec.CertificateRequestsGvk)) + for _, v := range obj.Spec.CertificateRequestsGvk { + l, err := obj.client.Global().GetCertificateRequestByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetCertificateRequests returns child which has given displayName +func (obj *GlobalDomain) GetCertificateRequests(ctx context.Context, + displayName string) (result *GlobalCertificateRequest, err error) { + l, ok := obj.Spec.CertificateRequestsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Domain", "CertificateRequests", displayName) + } + result, err = obj.client.Global().GetCertificateRequestByName(ctx, l.Name) + return +} + +// AddCertificateRequests calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalDomain) AddCertificateRequests(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.CertificateRequest) (result *GlobalCertificateRequest, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["domains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["domains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateCertificateRequestByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.Domain = updatedObj.Domain + } + return +} + +// DeleteCertificateRequests calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalDomain) DeleteCertificateRequests(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.CertificateRequestsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Domain", "CertificateRequests", displayName) + } + err = obj.client.Global().DeleteCertificateRequestByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetDomainByName(ctx, obj.GetName()) + if err == nil { + obj.Domain = updatedObj.Domain + } + return +} + +type domainGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *domainGlobalTsmV1Chainer) Subscribe() { + key := "domains.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewDomainInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *domainGlobalTsmV1Chainer) Unsubscribe() { + key := "domains.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *domainGlobalTsmV1Chainer) IsSubscribed() bool { + key := "domains.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *domainGlobalTsmV1Chainer) SecretHashes(name string) *secrethashGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["secrethashes.global.tsm.tanzu.vmware.com"] = name + return &secrethashGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetSecretHashes calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetSecretHashes(ctx context.Context, displayName string) (result *GlobalSecretHash, err error) { + hashedName := helper.GetHashedName("secrethashes.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetSecretHashByName(ctx, hashedName) +} + +// AddSecretHashes calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddSecretHashes(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SecretHash) (result *GlobalSecretHash, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("secrethashes.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateSecretHashByName(ctx, objToCreate) +} + +// DeleteSecretHashes calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteSecretHashes(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("secrethashes.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteSecretHashByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) ServiceInstances(name string) *serviceinstanceGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["serviceinstances.global.tsm.tanzu.vmware.com"] = name + return &serviceinstanceGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceInstances calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetServiceInstances(ctx context.Context, displayName string) (result *GlobalServiceInstance, err error) { + hashedName := helper.GetHashedName("serviceinstances.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceInstanceByName(ctx, hashedName) +} + +// AddServiceInstances calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddServiceInstances(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceInstance) (result *GlobalServiceInstance, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("serviceinstances.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceInstanceByName(ctx, objToCreate) +} + +// DeleteServiceInstances calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteServiceInstances(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("serviceinstances.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceInstanceByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) ServiceDeployments(name string) *servicedeploymentGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["servicedeployments.global.tsm.tanzu.vmware.com"] = name + return &servicedeploymentGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceDeployments calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetServiceDeployments(ctx context.Context, displayName string) (result *GlobalServiceDeployment, err error) { + hashedName := helper.GetHashedName("servicedeployments.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceDeploymentByName(ctx, hashedName) +} + +// AddServiceDeployments calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddServiceDeployments(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDeployment) (result *GlobalServiceDeployment, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicedeployments.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceDeploymentByName(ctx, objToCreate) +} + +// DeleteServiceDeployments calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteServiceDeployments(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicedeployments.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceDeploymentByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) ServiceStatefulSets(name string) *servicestatefulsetGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["servicestatefulsets.global.tsm.tanzu.vmware.com"] = name + return &servicestatefulsetGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceStatefulSets calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetServiceStatefulSets(ctx context.Context, displayName string) (result *GlobalServiceStatefulSet, err error) { + hashedName := helper.GetHashedName("servicestatefulsets.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceStatefulSetByName(ctx, hashedName) +} + +// AddServiceStatefulSets calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddServiceStatefulSets(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceStatefulSet) (result *GlobalServiceStatefulSet, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicestatefulsets.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceStatefulSetByName(ctx, objToCreate) +} + +// DeleteServiceStatefulSets calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteServiceStatefulSets(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicestatefulsets.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceStatefulSetByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) ServiceDaemonSets(name string) *servicedaemonsetGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["servicedaemonsets.global.tsm.tanzu.vmware.com"] = name + return &servicedaemonsetGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceDaemonSets calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetServiceDaemonSets(ctx context.Context, displayName string) (result *GlobalServiceDaemonSet, err error) { + hashedName := helper.GetHashedName("servicedaemonsets.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceDaemonSetByName(ctx, hashedName) +} + +// AddServiceDaemonSets calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddServiceDaemonSets(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDaemonSet) (result *GlobalServiceDaemonSet, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicedaemonsets.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceDaemonSetByName(ctx, objToCreate) +} + +// DeleteServiceDaemonSets calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteServiceDaemonSets(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicedaemonsets.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceDaemonSetByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) ServiceReplicaSets(name string) *servicereplicasetGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["servicereplicasets.global.tsm.tanzu.vmware.com"] = name + return &servicereplicasetGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceReplicaSets calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetServiceReplicaSets(ctx context.Context, displayName string) (result *GlobalServiceReplicaSet, err error) { + hashedName := helper.GetHashedName("servicereplicasets.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceReplicaSetByName(ctx, hashedName) +} + +// AddServiceReplicaSets calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddServiceReplicaSets(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceReplicaSet) (result *GlobalServiceReplicaSet, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicereplicasets.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceReplicaSetByName(ctx, objToCreate) +} + +// DeleteServiceReplicaSets calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteServiceReplicaSets(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicereplicasets.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceReplicaSetByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) ServiceCronJobs(name string) *servicecronjobGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["servicecronjobs.global.tsm.tanzu.vmware.com"] = name + return &servicecronjobGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceCronJobs calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetServiceCronJobs(ctx context.Context, displayName string) (result *GlobalServiceCronJob, err error) { + hashedName := helper.GetHashedName("servicecronjobs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceCronJobByName(ctx, hashedName) +} + +// AddServiceCronJobs calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddServiceCronJobs(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceCronJob) (result *GlobalServiceCronJob, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicecronjobs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceCronJobByName(ctx, objToCreate) +} + +// DeleteServiceCronJobs calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteServiceCronJobs(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicecronjobs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceCronJobByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) ServiceJobs(name string) *servicejobGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["servicejobs.global.tsm.tanzu.vmware.com"] = name + return &servicejobGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceJobs calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetServiceJobs(ctx context.Context, displayName string) (result *GlobalServiceJob, err error) { + hashedName := helper.GetHashedName("servicejobs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceJobByName(ctx, hashedName) +} + +// AddServiceJobs calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddServiceJobs(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceJob) (result *GlobalServiceJob, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicejobs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceJobByName(ctx, objToCreate) +} + +// DeleteServiceJobs calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteServiceJobs(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicejobs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceJobByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) VirtualServices(name string) *virtualserviceGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["virtualservices.global.tsm.tanzu.vmware.com"] = name + return &virtualserviceGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetVirtualServices calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetVirtualServices(ctx context.Context, displayName string) (result *GlobalVirtualService, err error) { + hashedName := helper.GetHashedName("virtualservices.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetVirtualServiceByName(ctx, hashedName) +} + +// AddVirtualServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddVirtualServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.VirtualService) (result *GlobalVirtualService, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("virtualservices.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateVirtualServiceByName(ctx, objToCreate) +} + +// DeleteVirtualServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteVirtualServices(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("virtualservices.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteVirtualServiceByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) ServiceEntry(name string) *serviceentryGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["serviceentries.global.tsm.tanzu.vmware.com"] = name + return &serviceentryGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceEntry calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetServiceEntry(ctx context.Context, displayName string) (result *GlobalServiceEntry, err error) { + hashedName := helper.GetHashedName("serviceentries.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceEntryByName(ctx, hashedName) +} + +// AddServiceEntry calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddServiceEntry(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceEntry) (result *GlobalServiceEntry, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("serviceentries.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceEntryByName(ctx, objToCreate) +} + +// DeleteServiceEntry calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteServiceEntry(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("serviceentries.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceEntryByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) WorkloadEntry(name string) *workloadentryGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["workloadentries.global.tsm.tanzu.vmware.com"] = name + return &workloadentryGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetWorkloadEntry calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetWorkloadEntry(ctx context.Context, displayName string) (result *GlobalWorkloadEntry, err error) { + hashedName := helper.GetHashedName("workloadentries.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetWorkloadEntryByName(ctx, hashedName) +} + +// AddWorkloadEntry calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddWorkloadEntry(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.WorkloadEntry) (result *GlobalWorkloadEntry, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("workloadentries.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateWorkloadEntryByName(ctx, objToCreate) +} + +// DeleteWorkloadEntry calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteWorkloadEntry(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("workloadentries.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteWorkloadEntryByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) DestinationRules(name string) *destinationruleGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["destinationrules.global.tsm.tanzu.vmware.com"] = name + return &destinationruleGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetDestinationRules calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetDestinationRules(ctx context.Context, displayName string) (result *GlobalDestinationRule, err error) { + hashedName := helper.GetHashedName("destinationrules.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetDestinationRuleByName(ctx, hashedName) +} + +// AddDestinationRules calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddDestinationRules(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DestinationRule) (result *GlobalDestinationRule, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("destinationrules.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDestinationRuleByName(ctx, objToCreate) +} + +// DeleteDestinationRules calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteDestinationRules(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("destinationrules.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDestinationRuleByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) Services(name string) *serviceGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["services.global.tsm.tanzu.vmware.com"] = name + return &serviceGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServices calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetServices(ctx context.Context, displayName string) (result *GlobalService, err error) { + hashedName := helper.GetHashedName("services.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceByName(ctx, hashedName) +} + +// AddServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Service) (result *GlobalService, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("services.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceByName(ctx, objToCreate) +} + +// DeleteServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteServices(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("services.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) Endpoints(name string) *endpointsGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["endpoints.global.tsm.tanzu.vmware.com"] = name + return &endpointsGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetEndpoints calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetEndpoints(ctx context.Context, displayName string) (result *GlobalEndpoints, err error) { + hashedName := helper.GetHashedName("endpoints.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetEndpointsByName(ctx, hashedName) +} + +// AddEndpoints calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddEndpoints(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Endpoints) (result *GlobalEndpoints, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("endpoints.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateEndpointsByName(ctx, objToCreate) +} + +// DeleteEndpoints calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteEndpoints(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("endpoints.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteEndpointsByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) Gateways(name string) *gatewayGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gateways.global.tsm.tanzu.vmware.com"] = name + return &gatewayGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGateways calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetGateways(ctx context.Context, displayName string) (result *GlobalGateway, err error) { + hashedName := helper.GetHashedName("gateways.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGatewayByName(ctx, hashedName) +} + +// AddGateways calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddGateways(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Gateway) (result *GlobalGateway, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gateways.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGatewayByName(ctx, objToCreate) +} + +// DeleteGateways calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteGateways(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gateways.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGatewayByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) AuthenticationPolicies(name string) *authenticationpolicyGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["authenticationpolicies.global.tsm.tanzu.vmware.com"] = name + return &authenticationpolicyGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetAuthenticationPolicies calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetAuthenticationPolicies(ctx context.Context, displayName string) (result *GlobalAuthenticationPolicy, err error) { + hashedName := helper.GetHashedName("authenticationpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAuthenticationPolicyByName(ctx, hashedName) +} + +// AddAuthenticationPolicies calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddAuthenticationPolicies(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AuthenticationPolicy) (result *GlobalAuthenticationPolicy, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("authenticationpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAuthenticationPolicyByName(ctx, objToCreate) +} + +// DeleteAuthenticationPolicies calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteAuthenticationPolicies(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("authenticationpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAuthenticationPolicyByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) Configmap(name string) *configmapGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["configmaps.global.tsm.tanzu.vmware.com"] = name + return &configmapGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetConfigmap calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetConfigmap(ctx context.Context, displayName string) (result *GlobalConfigMap, err error) { + hashedName := helper.GetHashedName("configmaps.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetConfigMapByName(ctx, hashedName) +} + +// AddConfigmap calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddConfigmap(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ConfigMap) (result *GlobalConfigMap, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("configmaps.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateConfigMapByName(ctx, objToCreate) +} + +// DeleteConfigmap calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteConfigmap(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("configmaps.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteConfigMapByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) Envoyfilter(name string) *envoyfilterGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["envoyfilters.global.tsm.tanzu.vmware.com"] = name + return &envoyfilterGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetEnvoyfilter calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetEnvoyfilter(ctx context.Context, displayName string) (result *GlobalEnvoyFilter, err error) { + hashedName := helper.GetHashedName("envoyfilters.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetEnvoyFilterByName(ctx, hashedName) +} + +// AddEnvoyfilter calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddEnvoyfilter(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.EnvoyFilter) (result *GlobalEnvoyFilter, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("envoyfilters.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateEnvoyFilterByName(ctx, objToCreate) +} + +// DeleteEnvoyfilter calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteEnvoyfilter(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("envoyfilters.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteEnvoyFilterByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) Autoscalers(name string) *autoscalercrGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["autoscalercrs.global.tsm.tanzu.vmware.com"] = name + return &autoscalercrGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetAutoscalers calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetAutoscalers(ctx context.Context, displayName string) (result *GlobalAutoscalerCR, err error) { + hashedName := helper.GetHashedName("autoscalercrs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAutoscalerCRByName(ctx, hashedName) +} + +// AddAutoscalers calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddAutoscalers(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AutoscalerCR) (result *GlobalAutoscalerCR, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("autoscalercrs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAutoscalerCRByName(ctx, objToCreate) +} + +// DeleteAutoscalers calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteAutoscalers(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("autoscalercrs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAutoscalerCRByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) PeerAuthentication(name string) *peerauthenticationGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["peerauthentications.global.tsm.tanzu.vmware.com"] = name + return &peerauthenticationGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetPeerAuthentication calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetPeerAuthentication(ctx context.Context, displayName string) (result *GlobalPeerAuthentication, err error) { + hashedName := helper.GetHashedName("peerauthentications.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetPeerAuthenticationByName(ctx, hashedName) +} + +// AddPeerAuthentication calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddPeerAuthentication(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PeerAuthentication) (result *GlobalPeerAuthentication, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("peerauthentications.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreatePeerAuthenticationByName(ctx, objToCreate) +} + +// DeletePeerAuthentication calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeletePeerAuthentication(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("peerauthentications.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeletePeerAuthenticationByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) KnativeIngresses(name string) *knativeingressGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["knativeingresses.global.tsm.tanzu.vmware.com"] = name + return &knativeingressGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetKnativeIngresses calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetKnativeIngresses(ctx context.Context, displayName string) (result *GlobalKnativeIngress, err error) { + hashedName := helper.GetHashedName("knativeingresses.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetKnativeIngressByName(ctx, hashedName) +} + +// AddKnativeIngresses calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddKnativeIngresses(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.KnativeIngress) (result *GlobalKnativeIngress, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("knativeingresses.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateKnativeIngressByName(ctx, objToCreate) +} + +// DeleteKnativeIngresses calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteKnativeIngresses(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("knativeingresses.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteKnativeIngressByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) NetworkAttachmentDefinition(name string) *networkattachmentdefinitionGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["networkattachmentdefinitions.global.tsm.tanzu.vmware.com"] = name + return &networkattachmentdefinitionGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetNetworkAttachmentDefinition calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetNetworkAttachmentDefinition(ctx context.Context, displayName string) (result *GlobalNetworkAttachmentDefinition, err error) { + hashedName := helper.GetHashedName("networkattachmentdefinitions.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetNetworkAttachmentDefinitionByName(ctx, hashedName) +} + +// AddNetworkAttachmentDefinition calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddNetworkAttachmentDefinition(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition) (result *GlobalNetworkAttachmentDefinition, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("networkattachmentdefinitions.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateNetworkAttachmentDefinitionByName(ctx, objToCreate) +} + +// DeleteNetworkAttachmentDefinition calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteNetworkAttachmentDefinition(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("networkattachmentdefinitions.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteNetworkAttachmentDefinitionByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) Issuers(name string) *issuerGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["issuers.global.tsm.tanzu.vmware.com"] = name + return &issuerGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetIssuers calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetIssuers(ctx context.Context, displayName string) (result *GlobalIssuer, err error) { + hashedName := helper.GetHashedName("issuers.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetIssuerByName(ctx, hashedName) +} + +// AddIssuers calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddIssuers(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Issuer) (result *GlobalIssuer, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("issuers.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateIssuerByName(ctx, objToCreate) +} + +// DeleteIssuers calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteIssuers(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("issuers.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteIssuerByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) Certificates(name string) *certificateGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["certificates.global.tsm.tanzu.vmware.com"] = name + return &certificateGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetCertificates calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetCertificates(ctx context.Context, displayName string) (result *GlobalCertificate, err error) { + hashedName := helper.GetHashedName("certificates.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetCertificateByName(ctx, hashedName) +} + +// AddCertificates calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddCertificates(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Certificate) (result *GlobalCertificate, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("certificates.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateCertificateByName(ctx, objToCreate) +} + +// DeleteCertificates calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteCertificates(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("certificates.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteCertificateByName(ctx, hashedName) +} + +func (c *domainGlobalTsmV1Chainer) CertificateRequests(name string) *certificaterequestGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["certificaterequests.global.tsm.tanzu.vmware.com"] = name + return &certificaterequestGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetCertificateRequests calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *domainGlobalTsmV1Chainer) GetCertificateRequests(ctx context.Context, displayName string) (result *GlobalCertificateRequest, err error) { + hashedName := helper.GetHashedName("certificaterequests.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetCertificateRequestByName(ctx, hashedName) +} + +// AddCertificateRequests calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *domainGlobalTsmV1Chainer) AddCertificateRequests(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.CertificateRequest) (result *GlobalCertificateRequest, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("certificaterequests.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateCertificateRequestByName(ctx, objToCreate) +} + +// DeleteCertificateRequests calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *domainGlobalTsmV1Chainer) DeleteCertificateRequests(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("certificaterequests.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteCertificateRequestByName(ctx, hashedName) +} + +// GetEndpointsByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetEndpointsByName(ctx context.Context, hashedName string) (*GlobalEndpoints, error) { + key := "endpoints.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Endpoints) + return &GlobalEndpoints{ + client: group.client, + Endpoints: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Endpoints().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalEndpoints{ + client: group.client, + Endpoints: result, + }, nil + } +} + +// DeleteEndpointsByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteEndpointsByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Endpoints().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + Endpoints().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/endpointsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateEndpointsByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateEndpointsByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Endpoints) (*GlobalEndpoints, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + Endpoints().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"endpointsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"Endpoints\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalEndpoints{ + client: group.client, + Endpoints: result, + }, nil +} + +// UpdateEndpointsByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateEndpointsByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Endpoints) (*GlobalEndpoints, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Endpoints().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueSubsets := + objToUpdate.Spec.Subsets + patchOpSubsets := PatchOp{ + Op: "replace", + Path: "/spec/subsets", + Value: patchValueSubsets, + } + patch = append(patch, patchOpSubsets) + + patchValueGnsId := + objToUpdate.Spec.GnsId + patchOpGnsId := PatchOp{ + Op: "replace", + Path: "/spec/gnsId", + Value: patchValueGnsId, + } + patch = append(patch, patchOpGnsId) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Endpoints().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalEndpoints{ + client: group.client, + Endpoints: result, + }, nil +} + +// ListEndpoints returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListEndpoints(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalEndpoints, err error) { + key := "endpoints.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalEndpoints, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Endpoints) + result[k] = &GlobalEndpoints{ + client: group.client, + Endpoints: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Endpoints().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalEndpoints, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalEndpoints{ + client: group.client, + Endpoints: &item, + } + } + } + return +} + +type GlobalEndpoints struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Endpoints +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalEndpoints) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteEndpointsByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Endpoints = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalEndpoints) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateEndpointsByName(ctx, obj.Endpoints) + if err != nil { + return err + } + obj.Endpoints = result.Endpoints + return nil +} + +func (obj *GlobalEndpoints) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +type endpointsGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *endpointsGlobalTsmV1Chainer) Subscribe() { + key := "endpoints.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewEndpointsInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *endpointsGlobalTsmV1Chainer) Unsubscribe() { + key := "endpoints.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *endpointsGlobalTsmV1Chainer) IsSubscribed() bool { + key := "endpoints.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetEnvoyFilterByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetEnvoyFilterByName(ctx context.Context, hashedName string) (*GlobalEnvoyFilter, error) { + key := "envoyfilters.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.EnvoyFilter) + return &GlobalEnvoyFilter{ + client: group.client, + EnvoyFilter: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + EnvoyFilters().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalEnvoyFilter{ + client: group.client, + EnvoyFilter: result, + }, nil + } +} + +// DeleteEnvoyFilterByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteEnvoyFilterByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + EnvoyFilters().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + EnvoyFilters().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/envoyfilterGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateEnvoyFilterByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateEnvoyFilterByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.EnvoyFilter) (*GlobalEnvoyFilter, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + EnvoyFilters().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"envoyfilterGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"EnvoyFilter\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalEnvoyFilter{ + client: group.client, + EnvoyFilter: result, + }, nil +} + +// UpdateEnvoyFilterByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateEnvoyFilterByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.EnvoyFilter) (*GlobalEnvoyFilter, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + EnvoyFilters().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueAnnotations := + objToUpdate.Spec.Annotations + patchOpAnnotations := PatchOp{ + Op: "replace", + Path: "/spec/annotations", + Value: patchValueAnnotations, + } + patch = append(patch, patchOpAnnotations) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + EnvoyFilters().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalEnvoyFilter{ + client: group.client, + EnvoyFilter: result, + }, nil +} + +// ListEnvoyFilters returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListEnvoyFilters(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalEnvoyFilter, err error) { + key := "envoyfilters.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalEnvoyFilter, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.EnvoyFilter) + result[k] = &GlobalEnvoyFilter{ + client: group.client, + EnvoyFilter: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + EnvoyFilters().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalEnvoyFilter, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalEnvoyFilter{ + client: group.client, + EnvoyFilter: &item, + } + } + } + return +} + +type GlobalEnvoyFilter struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.EnvoyFilter +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalEnvoyFilter) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteEnvoyFilterByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.EnvoyFilter = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalEnvoyFilter) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateEnvoyFilterByName(ctx, obj.EnvoyFilter) + if err != nil { + return err + } + obj.EnvoyFilter = result.EnvoyFilter + return nil +} + +func (obj *GlobalEnvoyFilter) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +type envoyfilterGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *envoyfilterGlobalTsmV1Chainer) Subscribe() { + key := "envoyfilters.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewEnvoyFilterInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *envoyfilterGlobalTsmV1Chainer) Unsubscribe() { + key := "envoyfilters.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *envoyfilterGlobalTsmV1Chainer) IsSubscribed() bool { + key := "envoyfilters.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetExternalAccountConfigNByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalAccountConfigNByName(ctx context.Context, hashedName string) (*GlobalExternalAccountConfigN, error) { + key := "externalaccountconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalAccountConfigN) + return &GlobalExternalAccountConfigN{ + client: group.client, + ExternalAccountConfigN: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalAccountConfigNs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalAccountConfigN{ + client: group.client, + ExternalAccountConfigN: result, + }, nil + } +} + +// DeleteExternalAccountConfigNByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalAccountConfigNByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalAccountConfigNs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalAccountConfigNs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/externalAccountsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalAccountConfigNByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalAccountConfigNByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalAccountConfigN) (*GlobalExternalAccountConfigN, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalAccountConfigNs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"externalAccountsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ExternalAccountConfigN\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalAccountConfigN{ + client: group.client, + ExternalAccountConfigN: result, + }, nil +} + +// UpdateExternalAccountConfigNByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalAccountConfigNByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalAccountConfigN) (*GlobalExternalAccountConfigN, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalAccountConfigNs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueConfig := + objToUpdate.Spec.Config + patchOpConfig := PatchOp{ + Op: "replace", + Path: "/spec/config", + Value: patchValueConfig, + } + patch = append(patch, patchOpConfig) + + patchValueProxyConfig := + objToUpdate.Spec.ProxyConfig + patchOpProxyConfig := PatchOp{ + Op: "replace", + Path: "/spec/proxyConfig", + Value: patchValueProxyConfig, + } + patch = append(patch, patchOpProxyConfig) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalAccountConfigNs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalAccountConfigN{ + client: group.client, + ExternalAccountConfigN: result, + }, nil +} + +// ListExternalAccountConfigNs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalAccountConfigNs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalAccountConfigN, err error) { + key := "externalaccountconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalAccountConfigN, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalAccountConfigN) + result[k] = &GlobalExternalAccountConfigN{ + client: group.client, + ExternalAccountConfigN: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalAccountConfigNs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalAccountConfigN, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalAccountConfigN{ + client: group.client, + ExternalAccountConfigN: &item, + } + } + } + return +} + +type GlobalExternalAccountConfigN struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalAccountConfigN +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalAccountConfigN) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalAccountConfigNByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalAccountConfigN = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalAccountConfigN) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalAccountConfigNByName(ctx, obj.ExternalAccountConfigN) + if err != nil { + return err + } + obj.ExternalAccountConfigN = result.ExternalAccountConfigN + return nil +} + +func (obj *GlobalExternalAccountConfigN) GetParent(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetConfigByName(ctx, hashedName) +} + +type externalaccountconfignGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externalaccountconfignGlobalTsmV1Chainer) Subscribe() { + key := "externalaccountconfigns.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalAccountConfigNInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externalaccountconfignGlobalTsmV1Chainer) Unsubscribe() { + key := "externalaccountconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externalaccountconfignGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externalaccountconfigns.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetExternalAuditStorageByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalAuditStorageByName(ctx context.Context, hashedName string) (*GlobalExternalAuditStorage, error) { + key := "externalauditstorages.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalAuditStorage) + return &GlobalExternalAuditStorage{ + client: group.client, + ExternalAuditStorage: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalAuditStorages().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalAuditStorage{ + client: group.client, + ExternalAuditStorage: result, + }, nil + } +} + +// DeleteExternalAuditStorageByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalAuditStorageByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalAuditStorages().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalAuditStorages().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/externalAuditStorageGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalAuditStorageByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalAuditStorageByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalAuditStorage) (*GlobalExternalAuditStorage, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalAuditStorages().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/externalAuditStorageGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ExternalAuditStorage", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalAuditStorage{ + client: group.client, + ExternalAuditStorage: result, + }, nil +} + +// UpdateExternalAuditStorageByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalAuditStorageByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalAuditStorage) (*GlobalExternalAuditStorage, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalAuditStorages().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueConfig := + objToUpdate.Spec.Config + patchOpConfig := PatchOp{ + Op: "replace", + Path: "/spec/config", + Value: patchValueConfig, + } + patch = append(patch, patchOpConfig) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalAuditStorages().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalAuditStorage{ + client: group.client, + ExternalAuditStorage: result, + }, nil +} + +// ListExternalAuditStorages returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalAuditStorages(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalAuditStorage, err error) { + key := "externalauditstorages.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalAuditStorage, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalAuditStorage) + result[k] = &GlobalExternalAuditStorage{ + client: group.client, + ExternalAuditStorage: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalAuditStorages().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalAuditStorage, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalAuditStorage{ + client: group.client, + ExternalAuditStorage: &item, + } + } + } + return +} + +type GlobalExternalAuditStorage struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalAuditStorage +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalAuditStorage) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalAuditStorageByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalAuditStorage = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalAuditStorage) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalAuditStorageByName(ctx, obj.ExternalAuditStorage) + if err != nil { + return err + } + obj.ExternalAuditStorage = result.ExternalAuditStorage + return nil +} + +func (obj *GlobalExternalAuditStorage) GetParent(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetConfigByName(ctx, hashedName) +} + +type externalauditstorageGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externalauditstorageGlobalTsmV1Chainer) Subscribe() { + key := "externalauditstorages.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalAuditStorageInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externalauditstorageGlobalTsmV1Chainer) Unsubscribe() { + key := "externalauditstorages.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externalauditstorageGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externalauditstorages.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetExternalDNSConfigNByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalDNSConfigNByName(ctx context.Context, hashedName string) (*GlobalExternalDNSConfigN, error) { + key := "externaldnsconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSConfigN) + return &GlobalExternalDNSConfigN{ + client: group.client, + ExternalDNSConfigN: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSConfigNs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSConfigN{ + client: group.client, + ExternalDNSConfigN: result, + }, nil + } +} + +// DeleteExternalDNSConfigNByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalDNSConfigNByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSConfigNs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSConfigNs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/externalDNSGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalDNSConfigNByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalDNSConfigNByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSConfigN) (*GlobalExternalDNSConfigN, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.AccountGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSConfigNs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"externalDNSGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ExternalDNSConfigN\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSConfigN{ + client: group.client, + ExternalDNSConfigN: result, + }, nil +} + +// UpdateExternalDNSConfigNByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalDNSConfigNByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSConfigN) (*GlobalExternalDNSConfigN, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSConfigNs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueConfig := + objToUpdate.Spec.Config + patchOpConfig := PatchOp{ + Op: "replace", + Path: "/spec/config", + Value: patchValueConfig, + } + patch = append(patch, patchOpConfig) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSConfigNs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalDNSConfigN{ + client: group.client, + ExternalDNSConfigN: result, + }, nil +} + +// ListExternalDNSConfigNs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalDNSConfigNs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalDNSConfigN, err error) { + key := "externaldnsconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalDNSConfigN, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSConfigN) + result[k] = &GlobalExternalDNSConfigN{ + client: group.client, + ExternalDNSConfigN: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalDNSConfigNs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalDNSConfigN, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalDNSConfigN{ + client: group.client, + ExternalDNSConfigN: &item, + } + } + } + return +} + +type GlobalExternalDNSConfigN struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalDNSConfigN +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalDNSConfigN) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalDNSConfigNByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalDNSConfigN = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalDNSConfigN) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalDNSConfigNByName(ctx, obj.ExternalDNSConfigN) + if err != nil { + return err + } + obj.ExternalDNSConfigN = result.ExternalDNSConfigN + return nil +} + +func (obj *GlobalExternalDNSConfigN) GetParent(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetConfigByName(ctx, hashedName) +} + +// GetAccount returns link of given type +func (obj *GlobalExternalDNSConfigN) GetAccount(ctx context.Context) ( + result *GlobalExternalAccountConfigN, err error) { + if obj.Spec.AccountGvk == nil { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ExternalDNSConfigN", "Account") + } + return obj.client.Global().GetExternalAccountConfigNByName(ctx, obj.Spec.AccountGvk.Name) +} + +// LinkAccount links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalExternalDNSConfigN) LinkAccount(ctx context.Context, + linkToAdd *GlobalExternalAccountConfigN) error { + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/accountGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ExternalAccountConfigN", + Name: linkToAdd.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ExternalDNSConfigNs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ExternalDNSConfigN = result + return nil +} + +// UnlinkAccount unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalExternalDNSConfigN) UnlinkAccount(ctx context.Context) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/accountGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ExternalDNSConfigNs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ExternalDNSConfigN = result + return nil + +} + +type externaldnsconfignGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externaldnsconfignGlobalTsmV1Chainer) Subscribe() { + key := "externaldnsconfigns.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSConfigNInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externaldnsconfignGlobalTsmV1Chainer) Unsubscribe() { + key := "externaldnsconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externaldnsconfignGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externaldnsconfigns.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetExternalDNSInventoryHealthCheckByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalDNSInventoryHealthCheckByName(ctx context.Context, hashedName string) (*GlobalExternalDNSInventoryHealthCheck, error) { + key := "externaldnsinventoryhealthchecks.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck) + return &GlobalExternalDNSInventoryHealthCheck{ + client: group.client, + ExternalDNSInventoryHealthCheck: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryHealthChecks().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSInventoryHealthCheck{ + client: group.client, + ExternalDNSInventoryHealthCheck: result, + }, nil + } +} + +// DeleteExternalDNSInventoryHealthCheckByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalDNSInventoryHealthCheckByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryHealthChecks().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryHealthChecks().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/healthChecksGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["externaldnsinventories.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externaldnsinventories.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventories().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalDNSInventoryHealthCheckByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalDNSInventoryHealthCheckByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck) (*GlobalExternalDNSInventoryHealthCheck, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryHealthChecks().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["externaldnsinventories.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externaldnsinventories.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"healthChecksGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ExternalDNSInventoryHealthCheck\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventories().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSInventoryHealthCheck{ + client: group.client, + ExternalDNSInventoryHealthCheck: result, + }, nil +} + +// UpdateExternalDNSInventoryHealthCheckByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalDNSInventoryHealthCheckByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck) (*GlobalExternalDNSInventoryHealthCheck, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryHealthChecks().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueProtocol := + objToUpdate.Spec.Protocol + patchOpProtocol := PatchOp{ + Op: "replace", + Path: "/spec/protocol", + Value: patchValueProtocol, + } + patch = append(patch, patchOpProtocol) + + patchValuePort := + objToUpdate.Spec.Port + patchOpPort := PatchOp{ + Op: "replace", + Path: "/spec/port", + Value: patchValuePort, + } + patch = append(patch, patchOpPort) + + patchValuePath := + objToUpdate.Spec.Path + patchOpPath := PatchOp{ + Op: "replace", + Path: "/spec/path", + Value: patchValuePath, + } + patch = append(patch, patchOpPath) + + patchValueHealthThreshold := + objToUpdate.Spec.HealthThreshold + patchOpHealthThreshold := PatchOp{ + Op: "replace", + Path: "/spec/healthThreshold", + Value: patchValueHealthThreshold, + } + patch = append(patch, patchOpHealthThreshold) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryHealthChecks().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalDNSInventoryHealthCheck{ + client: group.client, + ExternalDNSInventoryHealthCheck: result, + }, nil +} + +// ListExternalDNSInventoryHealthChecks returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalDNSInventoryHealthChecks(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalDNSInventoryHealthCheck, err error) { + key := "externaldnsinventoryhealthchecks.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalDNSInventoryHealthCheck, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck) + result[k] = &GlobalExternalDNSInventoryHealthCheck{ + client: group.client, + ExternalDNSInventoryHealthCheck: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalDNSInventoryHealthChecks().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalDNSInventoryHealthCheck, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalDNSInventoryHealthCheck{ + client: group.client, + ExternalDNSInventoryHealthCheck: &item, + } + } + } + return +} + +type GlobalExternalDNSInventoryHealthCheck struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalDNSInventoryHealthCheck) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalDNSInventoryHealthCheckByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalDNSInventoryHealthCheck = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalDNSInventoryHealthCheck) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalDNSInventoryHealthCheckByName(ctx, obj.ExternalDNSInventoryHealthCheck) + if err != nil { + return err + } + obj.ExternalDNSInventoryHealthCheck = result.ExternalDNSInventoryHealthCheck + return nil +} + +func (obj *GlobalExternalDNSInventoryHealthCheck) GetParent(ctx context.Context) (result *GlobalExternalDNSInventory, err error) { + hashedName := helper.GetHashedName("externaldnsinventories.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["externaldnsinventories.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetExternalDNSInventoryByName(ctx, hashedName) +} + +type externaldnsinventoryhealthcheckGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externaldnsinventoryhealthcheckGlobalTsmV1Chainer) Subscribe() { + key := "externaldnsinventoryhealthchecks.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSInventoryHealthCheckInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externaldnsinventoryhealthcheckGlobalTsmV1Chainer) Unsubscribe() { + key := "externaldnsinventoryhealthchecks.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externaldnsinventoryhealthcheckGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externaldnsinventoryhealthchecks.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetExternalDNSInventoryPrimaryDomainByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalDNSInventoryPrimaryDomainByName(ctx context.Context, hashedName string) (*GlobalExternalDNSInventoryPrimaryDomain, error) { + key := "externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain) + return &GlobalExternalDNSInventoryPrimaryDomain{ + client: group.client, + ExternalDNSInventoryPrimaryDomain: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryPrimaryDomains().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSInventoryPrimaryDomain{ + client: group.client, + ExternalDNSInventoryPrimaryDomain: result, + }, nil + } +} + +// DeleteExternalDNSInventoryPrimaryDomainByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalDNSInventoryPrimaryDomainByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryPrimaryDomains().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.DnsRecordsGvk { + err := group.client. + Global().DeleteExternalDNSInventoryRecordByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryPrimaryDomains().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/primaryDomainsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["externaldnsinventories.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externaldnsinventories.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventories().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalDNSInventoryPrimaryDomainByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalDNSInventoryPrimaryDomainByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain) (*GlobalExternalDNSInventoryPrimaryDomain, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.DnsRecordsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryPrimaryDomains().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["externaldnsinventories.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externaldnsinventories.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"primaryDomainsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ExternalDNSInventoryPrimaryDomain\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventories().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSInventoryPrimaryDomain{ + client: group.client, + ExternalDNSInventoryPrimaryDomain: result, + }, nil +} + +// UpdateExternalDNSInventoryPrimaryDomainByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalDNSInventoryPrimaryDomainByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain) (*GlobalExternalDNSInventoryPrimaryDomain, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryPrimaryDomains().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueRegion := + objToUpdate.Spec.Region + patchOpRegion := PatchOp{ + Op: "replace", + Path: "/spec/region", + Value: patchValueRegion, + } + patch = append(patch, patchOpRegion) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryPrimaryDomains().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalDNSInventoryPrimaryDomain{ + client: group.client, + ExternalDNSInventoryPrimaryDomain: result, + }, nil +} + +// ListExternalDNSInventoryPrimaryDomains returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalDNSInventoryPrimaryDomains(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalDNSInventoryPrimaryDomain, err error) { + key := "externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalDNSInventoryPrimaryDomain, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain) + result[k] = &GlobalExternalDNSInventoryPrimaryDomain{ + client: group.client, + ExternalDNSInventoryPrimaryDomain: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalDNSInventoryPrimaryDomains().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalDNSInventoryPrimaryDomain, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalDNSInventoryPrimaryDomain{ + client: group.client, + ExternalDNSInventoryPrimaryDomain: &item, + } + } + } + return +} + +type GlobalExternalDNSInventoryPrimaryDomain struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalDNSInventoryPrimaryDomain) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalDNSInventoryPrimaryDomainByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalDNSInventoryPrimaryDomain = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalDNSInventoryPrimaryDomain) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalDNSInventoryPrimaryDomainByName(ctx, obj.ExternalDNSInventoryPrimaryDomain) + if err != nil { + return err + } + obj.ExternalDNSInventoryPrimaryDomain = result.ExternalDNSInventoryPrimaryDomain + return nil +} + +func (obj *GlobalExternalDNSInventoryPrimaryDomain) GetParent(ctx context.Context) (result *GlobalExternalDNSInventory, err error) { + hashedName := helper.GetHashedName("externaldnsinventories.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["externaldnsinventories.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetExternalDNSInventoryByName(ctx, hashedName) +} + +// GetAllDnsRecords returns all children of given type +func (obj *GlobalExternalDNSInventoryPrimaryDomain) GetAllDnsRecords(ctx context.Context) ( + result []*GlobalExternalDNSInventoryRecord, err error) { + result = make([]*GlobalExternalDNSInventoryRecord, 0, len(obj.Spec.DnsRecordsGvk)) + for _, v := range obj.Spec.DnsRecordsGvk { + l, err := obj.client.Global().GetExternalDNSInventoryRecordByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetDnsRecords returns child which has given displayName +func (obj *GlobalExternalDNSInventoryPrimaryDomain) GetDnsRecords(ctx context.Context, + displayName string) (result *GlobalExternalDNSInventoryRecord, err error) { + l, ok := obj.Spec.DnsRecordsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ExternalDNSInventoryPrimaryDomain", "DnsRecords", displayName) + } + result, err = obj.client.Global().GetExternalDNSInventoryRecordByName(ctx, l.Name) + return +} + +// AddDnsRecords calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalExternalDNSInventoryPrimaryDomain) AddDnsRecords(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord) (result *GlobalExternalDNSInventoryRecord, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalDNSInventoryRecordByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetExternalDNSInventoryPrimaryDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.ExternalDNSInventoryPrimaryDomain = updatedObj.ExternalDNSInventoryPrimaryDomain + } + return +} + +// DeleteDnsRecords calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalExternalDNSInventoryPrimaryDomain) DeleteDnsRecords(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.DnsRecordsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ExternalDNSInventoryPrimaryDomain", "DnsRecords", displayName) + } + err = obj.client.Global().DeleteExternalDNSInventoryRecordByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetExternalDNSInventoryPrimaryDomainByName(ctx, obj.GetName()) + if err == nil { + obj.ExternalDNSInventoryPrimaryDomain = updatedObj.ExternalDNSInventoryPrimaryDomain + } + return +} + +type externaldnsinventoryprimarydomainGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externaldnsinventoryprimarydomainGlobalTsmV1Chainer) Subscribe() { + key := "externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSInventoryPrimaryDomainInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externaldnsinventoryprimarydomainGlobalTsmV1Chainer) Unsubscribe() { + key := "externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externaldnsinventoryprimarydomainGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *externaldnsinventoryprimarydomainGlobalTsmV1Chainer) DnsRecords(name string) *externaldnsinventoryrecordGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externaldnsinventoryrecords.global.tsm.tanzu.vmware.com"] = name + return &externaldnsinventoryrecordGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetDnsRecords calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *externaldnsinventoryprimarydomainGlobalTsmV1Chainer) GetDnsRecords(ctx context.Context, displayName string) (result *GlobalExternalDNSInventoryRecord, err error) { + hashedName := helper.GetHashedName("externaldnsinventoryrecords.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalDNSInventoryRecordByName(ctx, hashedName) +} + +// AddDnsRecords calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *externaldnsinventoryprimarydomainGlobalTsmV1Chainer) AddDnsRecords(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord) (result *GlobalExternalDNSInventoryRecord, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsinventoryrecords.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalDNSInventoryRecordByName(ctx, objToCreate) +} + +// DeleteDnsRecords calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *externaldnsinventoryprimarydomainGlobalTsmV1Chainer) DeleteDnsRecords(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsinventoryrecords.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalDNSInventoryRecordByName(ctx, hashedName) +} + +// GetExternalDNSInventoryRecordByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalDNSInventoryRecordByName(ctx context.Context, hashedName string) (*GlobalExternalDNSInventoryRecord, error) { + key := "externaldnsinventoryrecords.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord) + return &GlobalExternalDNSInventoryRecord{ + client: group.client, + ExternalDNSInventoryRecord: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryRecords().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSInventoryRecord{ + client: group.client, + ExternalDNSInventoryRecord: result, + }, nil + } +} + +// DeleteExternalDNSInventoryRecordByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalDNSInventoryRecordByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryRecords().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryRecords().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/dnsRecordsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryPrimaryDomains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalDNSInventoryRecordByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalDNSInventoryRecordByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord) (*GlobalExternalDNSInventoryRecord, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.HealthCheckGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryRecords().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"dnsRecordsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ExternalDNSInventoryRecord\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryPrimaryDomains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSInventoryRecord{ + client: group.client, + ExternalDNSInventoryRecord: result, + }, nil +} + +// UpdateExternalDNSInventoryRecordByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalDNSInventoryRecordByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord) (*GlobalExternalDNSInventoryRecord, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryRecords().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueDnsRecordType := + objToUpdate.Spec.DnsRecordType + patchOpDnsRecordType := PatchOp{ + Op: "replace", + Path: "/spec/dnsRecordType", + Value: patchValueDnsRecordType, + } + patch = append(patch, patchOpDnsRecordType) + + patchValueTtl := + objToUpdate.Spec.Ttl + patchOpTtl := PatchOp{ + Op: "replace", + Path: "/spec/ttl", + Value: patchValueTtl, + } + patch = append(patch, patchOpTtl) + + patchValueValue := + objToUpdate.Spec.Value + patchOpValue := PatchOp{ + Op: "replace", + Path: "/spec/value", + Value: patchValueValue, + } + patch = append(patch, patchOpValue) + + patchValueWeight := + objToUpdate.Spec.Weight + patchOpWeight := PatchOp{ + Op: "replace", + Path: "/spec/weight", + Value: patchValueWeight, + } + patch = append(patch, patchOpWeight) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryRecords().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalDNSInventoryRecord{ + client: group.client, + ExternalDNSInventoryRecord: result, + }, nil +} + +// ListExternalDNSInventoryRecords returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalDNSInventoryRecords(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalDNSInventoryRecord, err error) { + key := "externaldnsinventoryrecords.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalDNSInventoryRecord, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord) + result[k] = &GlobalExternalDNSInventoryRecord{ + client: group.client, + ExternalDNSInventoryRecord: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalDNSInventoryRecords().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalDNSInventoryRecord, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalDNSInventoryRecord{ + client: group.client, + ExternalDNSInventoryRecord: &item, + } + } + } + return +} + +type GlobalExternalDNSInventoryRecord struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryRecord +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalDNSInventoryRecord) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalDNSInventoryRecordByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalDNSInventoryRecord = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalDNSInventoryRecord) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalDNSInventoryRecordByName(ctx, obj.ExternalDNSInventoryRecord) + if err != nil { + return err + } + obj.ExternalDNSInventoryRecord = result.ExternalDNSInventoryRecord + return nil +} + +func (obj *GlobalExternalDNSInventoryRecord) GetParent(ctx context.Context) (result *GlobalExternalDNSInventoryPrimaryDomain, err error) { + hashedName := helper.GetHashedName("externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetExternalDNSInventoryPrimaryDomainByName(ctx, hashedName) +} + +// GetHealthCheck returns link of given type +func (obj *GlobalExternalDNSInventoryRecord) GetHealthCheck(ctx context.Context) ( + result *GlobalExternalDNSInventoryHealthCheck, err error) { + if obj.Spec.HealthCheckGvk == nil { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ExternalDNSInventoryRecord", "HealthCheck") + } + return obj.client.Global().GetExternalDNSInventoryHealthCheckByName(ctx, obj.Spec.HealthCheckGvk.Name) +} + +// LinkHealthCheck links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalExternalDNSInventoryRecord) LinkHealthCheck(ctx context.Context, + linkToAdd *GlobalExternalDNSInventoryHealthCheck) error { + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/healthCheckGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ExternalDNSInventoryHealthCheck", + Name: linkToAdd.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ExternalDNSInventoryRecords().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ExternalDNSInventoryRecord = result + return nil +} + +// UnlinkHealthCheck unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalExternalDNSInventoryRecord) UnlinkHealthCheck(ctx context.Context) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/healthCheckGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ExternalDNSInventoryRecords().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ExternalDNSInventoryRecord = result + return nil + +} + +type externaldnsinventoryrecordGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externaldnsinventoryrecordGlobalTsmV1Chainer) Subscribe() { + key := "externaldnsinventoryrecords.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSInventoryRecordInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externaldnsinventoryrecordGlobalTsmV1Chainer) Unsubscribe() { + key := "externaldnsinventoryrecords.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externaldnsinventoryrecordGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externaldnsinventoryrecords.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetExternalDNSInventoryZoneByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalDNSInventoryZoneByName(ctx context.Context, hashedName string) (*GlobalExternalDNSInventoryZone, error) { + key := "externaldnsinventoryzones.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone) + return &GlobalExternalDNSInventoryZone{ + client: group.client, + ExternalDNSInventoryZone: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryZones().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSInventoryZone{ + client: group.client, + ExternalDNSInventoryZone: result, + }, nil + } +} + +// DeleteExternalDNSInventoryZoneByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalDNSInventoryZoneByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryZones().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryZones().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/zonesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["externaldnsinventories.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externaldnsinventories.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventories().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalDNSInventoryZoneByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalDNSInventoryZoneByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone) (*GlobalExternalDNSInventoryZone, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.PrimaryDomainsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryZones().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["externaldnsinventories.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externaldnsinventories.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"zonesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ExternalDNSInventoryZone\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventories().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSInventoryZone{ + client: group.client, + ExternalDNSInventoryZone: result, + }, nil +} + +// UpdateExternalDNSInventoryZoneByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalDNSInventoryZoneByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone) (*GlobalExternalDNSInventoryZone, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryZones().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueRecords := + objToUpdate.Spec.Records + patchOpRecords := PatchOp{ + Op: "replace", + Path: "/spec/records", + Value: patchValueRecords, + } + patch = append(patch, patchOpRecords) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventoryZones().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalDNSInventoryZone{ + client: group.client, + ExternalDNSInventoryZone: result, + }, nil +} + +// ListExternalDNSInventoryZones returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalDNSInventoryZones(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalDNSInventoryZone, err error) { + key := "externaldnsinventoryzones.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalDNSInventoryZone, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone) + result[k] = &GlobalExternalDNSInventoryZone{ + client: group.client, + ExternalDNSInventoryZone: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalDNSInventoryZones().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalDNSInventoryZone, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalDNSInventoryZone{ + client: group.client, + ExternalDNSInventoryZone: &item, + } + } + } + return +} + +type GlobalExternalDNSInventoryZone struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalDNSInventoryZone) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalDNSInventoryZoneByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalDNSInventoryZone = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalDNSInventoryZone) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalDNSInventoryZoneByName(ctx, obj.ExternalDNSInventoryZone) + if err != nil { + return err + } + obj.ExternalDNSInventoryZone = result.ExternalDNSInventoryZone + return nil +} + +func (obj *GlobalExternalDNSInventoryZone) GetParent(ctx context.Context) (result *GlobalExternalDNSInventory, err error) { + hashedName := helper.GetHashedName("externaldnsinventories.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["externaldnsinventories.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetExternalDNSInventoryByName(ctx, hashedName) +} + +// GetAllPrimaryDomains returns all links of given type +func (obj *GlobalExternalDNSInventoryZone) GetAllPrimaryDomains(ctx context.Context) ( + result []*GlobalExternalDNSInventoryPrimaryDomain, err error) { + result = make([]*GlobalExternalDNSInventoryPrimaryDomain, 0, len(obj.Spec.PrimaryDomainsGvk)) + for _, v := range obj.Spec.PrimaryDomainsGvk { + l, err := obj.client.Global().GetExternalDNSInventoryPrimaryDomainByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetPrimaryDomains returns link which has given displayName +func (obj *GlobalExternalDNSInventoryZone) GetPrimaryDomains(ctx context.Context, + displayName string) (result *GlobalExternalDNSInventoryPrimaryDomain, err error) { + l, ok := obj.Spec.PrimaryDomainsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ExternalDNSInventoryZone", "PrimaryDomains", displayName) + } + result, err = obj.client.Global().GetExternalDNSInventoryPrimaryDomainByName(ctx, l.Name) + return +} + +// LinkPrimaryDomains links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalExternalDNSInventoryZone) LinkPrimaryDomains(ctx context.Context, + linkToAdd *GlobalExternalDNSInventoryPrimaryDomain) error { + + payload := "{\"spec\": {\"primaryDomainsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ExternalDNSInventoryPrimaryDomain\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ExternalDNSInventoryZones().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ExternalDNSInventoryZone = result + return nil +} + +// UnlinkPrimaryDomains unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalExternalDNSInventoryZone) UnlinkPrimaryDomains(ctx context.Context, + linkToRemove *GlobalExternalDNSInventoryPrimaryDomain) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/primaryDomainsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ExternalDNSInventoryZones().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ExternalDNSInventoryZone = result + return nil + +} + +type externaldnsinventoryzoneGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externaldnsinventoryzoneGlobalTsmV1Chainer) Subscribe() { + key := "externaldnsinventoryzones.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSInventoryZoneInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externaldnsinventoryzoneGlobalTsmV1Chainer) Unsubscribe() { + key := "externaldnsinventoryzones.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externaldnsinventoryzoneGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externaldnsinventoryzones.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetExternalDNSInventoryByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalDNSInventoryByName(ctx context.Context, hashedName string) (*GlobalExternalDNSInventory, error) { + key := "externaldnsinventories.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventory) + return &GlobalExternalDNSInventory{ + client: group.client, + ExternalDNSInventory: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventories().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSInventory{ + client: group.client, + ExternalDNSInventory: result, + }, nil + } +} + +// DeleteExternalDNSInventoryByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalDNSInventoryByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventories().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.ZonesGvk { + err := group.client. + Global().DeleteExternalDNSInventoryZoneByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.PrimaryDomainsGvk { + err := group.client. + Global().DeleteExternalDNSInventoryPrimaryDomainByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.HealthChecksGvk { + err := group.client. + Global().DeleteExternalDNSInventoryHealthCheckByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventories().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/externalDNSGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["inventories.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("inventories.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Inventories().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalDNSInventoryByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalDNSInventoryByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventory) (*GlobalExternalDNSInventory, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ZonesGvk = nil + objToCreate.Spec.PrimaryDomainsGvk = nil + objToCreate.Spec.HealthChecksGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventories().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["inventories.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("inventories.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"externalDNSGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ExternalDNSInventory\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Inventories().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSInventory{ + client: group.client, + ExternalDNSInventory: result, + }, nil +} + +// UpdateExternalDNSInventoryByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalDNSInventoryByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventory) (*GlobalExternalDNSInventory, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventories().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + if objToUpdate.Spec.EnabledForProjects != nil { + patchValueEnabledForProjects := + objToUpdate.Spec.EnabledForProjects + patchOpEnabledForProjects := PatchOp{ + Op: "replace", + Path: "/spec/enabledForProjects", + Value: patchValueEnabledForProjects, + } + patch = append(patch, patchOpEnabledForProjects) + } + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSInventories().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalDNSInventory{ + client: group.client, + ExternalDNSInventory: result, + }, nil +} + +// ListExternalDNSInventories returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalDNSInventories(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalDNSInventory, err error) { + key := "externaldnsinventories.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalDNSInventory, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventory) + result[k] = &GlobalExternalDNSInventory{ + client: group.client, + ExternalDNSInventory: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalDNSInventories().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalDNSInventory, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalDNSInventory{ + client: group.client, + ExternalDNSInventory: &item, + } + } + } + return +} + +type GlobalExternalDNSInventory struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventory +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalDNSInventory) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalDNSInventoryByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalDNSInventory = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalDNSInventory) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalDNSInventoryByName(ctx, obj.ExternalDNSInventory) + if err != nil { + return err + } + obj.ExternalDNSInventory = result.ExternalDNSInventory + return nil +} + +func (obj *GlobalExternalDNSInventory) GetParent(ctx context.Context) (result *GlobalInventory, err error) { + hashedName := helper.GetHashedName("inventories.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["inventories.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetInventoryByName(ctx, hashedName) +} + +// GetAllZones returns all children of given type +func (obj *GlobalExternalDNSInventory) GetAllZones(ctx context.Context) ( + result []*GlobalExternalDNSInventoryZone, err error) { + result = make([]*GlobalExternalDNSInventoryZone, 0, len(obj.Spec.ZonesGvk)) + for _, v := range obj.Spec.ZonesGvk { + l, err := obj.client.Global().GetExternalDNSInventoryZoneByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetZones returns child which has given displayName +func (obj *GlobalExternalDNSInventory) GetZones(ctx context.Context, + displayName string) (result *GlobalExternalDNSInventoryZone, err error) { + l, ok := obj.Spec.ZonesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ExternalDNSInventory", "Zones", displayName) + } + result, err = obj.client.Global().GetExternalDNSInventoryZoneByName(ctx, l.Name) + return +} + +// AddZones calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalExternalDNSInventory) AddZones(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone) (result *GlobalExternalDNSInventoryZone, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["externaldnsinventories.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["externaldnsinventories.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalDNSInventoryZoneByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetExternalDNSInventoryByName(ctx, obj.GetName()) + if getErr == nil { + obj.ExternalDNSInventory = updatedObj.ExternalDNSInventory + } + return +} + +// DeleteZones calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalExternalDNSInventory) DeleteZones(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ZonesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ExternalDNSInventory", "Zones", displayName) + } + err = obj.client.Global().DeleteExternalDNSInventoryZoneByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetExternalDNSInventoryByName(ctx, obj.GetName()) + if err == nil { + obj.ExternalDNSInventory = updatedObj.ExternalDNSInventory + } + return +} + +// GetAllPrimaryDomains returns all children of given type +func (obj *GlobalExternalDNSInventory) GetAllPrimaryDomains(ctx context.Context) ( + result []*GlobalExternalDNSInventoryPrimaryDomain, err error) { + result = make([]*GlobalExternalDNSInventoryPrimaryDomain, 0, len(obj.Spec.PrimaryDomainsGvk)) + for _, v := range obj.Spec.PrimaryDomainsGvk { + l, err := obj.client.Global().GetExternalDNSInventoryPrimaryDomainByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetPrimaryDomains returns child which has given displayName +func (obj *GlobalExternalDNSInventory) GetPrimaryDomains(ctx context.Context, + displayName string) (result *GlobalExternalDNSInventoryPrimaryDomain, err error) { + l, ok := obj.Spec.PrimaryDomainsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ExternalDNSInventory", "PrimaryDomains", displayName) + } + result, err = obj.client.Global().GetExternalDNSInventoryPrimaryDomainByName(ctx, l.Name) + return +} + +// AddPrimaryDomains calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalExternalDNSInventory) AddPrimaryDomains(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain) (result *GlobalExternalDNSInventoryPrimaryDomain, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["externaldnsinventories.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["externaldnsinventories.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalDNSInventoryPrimaryDomainByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetExternalDNSInventoryByName(ctx, obj.GetName()) + if getErr == nil { + obj.ExternalDNSInventory = updatedObj.ExternalDNSInventory + } + return +} + +// DeletePrimaryDomains calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalExternalDNSInventory) DeletePrimaryDomains(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.PrimaryDomainsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ExternalDNSInventory", "PrimaryDomains", displayName) + } + err = obj.client.Global().DeleteExternalDNSInventoryPrimaryDomainByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetExternalDNSInventoryByName(ctx, obj.GetName()) + if err == nil { + obj.ExternalDNSInventory = updatedObj.ExternalDNSInventory + } + return +} + +// GetAllHealthChecks returns all children of given type +func (obj *GlobalExternalDNSInventory) GetAllHealthChecks(ctx context.Context) ( + result []*GlobalExternalDNSInventoryHealthCheck, err error) { + result = make([]*GlobalExternalDNSInventoryHealthCheck, 0, len(obj.Spec.HealthChecksGvk)) + for _, v := range obj.Spec.HealthChecksGvk { + l, err := obj.client.Global().GetExternalDNSInventoryHealthCheckByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetHealthChecks returns child which has given displayName +func (obj *GlobalExternalDNSInventory) GetHealthChecks(ctx context.Context, + displayName string) (result *GlobalExternalDNSInventoryHealthCheck, err error) { + l, ok := obj.Spec.HealthChecksGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ExternalDNSInventory", "HealthChecks", displayName) + } + result, err = obj.client.Global().GetExternalDNSInventoryHealthCheckByName(ctx, l.Name) + return +} + +// AddHealthChecks calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalExternalDNSInventory) AddHealthChecks(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck) (result *GlobalExternalDNSInventoryHealthCheck, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["externaldnsinventories.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["externaldnsinventories.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalDNSInventoryHealthCheckByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetExternalDNSInventoryByName(ctx, obj.GetName()) + if getErr == nil { + obj.ExternalDNSInventory = updatedObj.ExternalDNSInventory + } + return +} + +// DeleteHealthChecks calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalExternalDNSInventory) DeleteHealthChecks(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.HealthChecksGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ExternalDNSInventory", "HealthChecks", displayName) + } + err = obj.client.Global().DeleteExternalDNSInventoryHealthCheckByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetExternalDNSInventoryByName(ctx, obj.GetName()) + if err == nil { + obj.ExternalDNSInventory = updatedObj.ExternalDNSInventory + } + return +} + +type externaldnsinventoryGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externaldnsinventoryGlobalTsmV1Chainer) Subscribe() { + key := "externaldnsinventories.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSInventoryInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externaldnsinventoryGlobalTsmV1Chainer) Unsubscribe() { + key := "externaldnsinventories.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externaldnsinventoryGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externaldnsinventories.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *externaldnsinventoryGlobalTsmV1Chainer) Zones(name string) *externaldnsinventoryzoneGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externaldnsinventoryzones.global.tsm.tanzu.vmware.com"] = name + return &externaldnsinventoryzoneGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetZones calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *externaldnsinventoryGlobalTsmV1Chainer) GetZones(ctx context.Context, displayName string) (result *GlobalExternalDNSInventoryZone, err error) { + hashedName := helper.GetHashedName("externaldnsinventoryzones.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalDNSInventoryZoneByName(ctx, hashedName) +} + +// AddZones calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *externaldnsinventoryGlobalTsmV1Chainer) AddZones(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryZone) (result *GlobalExternalDNSInventoryZone, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsinventoryzones.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalDNSInventoryZoneByName(ctx, objToCreate) +} + +// DeleteZones calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *externaldnsinventoryGlobalTsmV1Chainer) DeleteZones(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsinventoryzones.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalDNSInventoryZoneByName(ctx, hashedName) +} + +func (c *externaldnsinventoryGlobalTsmV1Chainer) PrimaryDomains(name string) *externaldnsinventoryprimarydomainGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com"] = name + return &externaldnsinventoryprimarydomainGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetPrimaryDomains calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *externaldnsinventoryGlobalTsmV1Chainer) GetPrimaryDomains(ctx context.Context, displayName string) (result *GlobalExternalDNSInventoryPrimaryDomain, err error) { + hashedName := helper.GetHashedName("externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalDNSInventoryPrimaryDomainByName(ctx, hashedName) +} + +// AddPrimaryDomains calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *externaldnsinventoryGlobalTsmV1Chainer) AddPrimaryDomains(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryPrimaryDomain) (result *GlobalExternalDNSInventoryPrimaryDomain, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalDNSInventoryPrimaryDomainByName(ctx, objToCreate) +} + +// DeletePrimaryDomains calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *externaldnsinventoryGlobalTsmV1Chainer) DeletePrimaryDomains(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalDNSInventoryPrimaryDomainByName(ctx, hashedName) +} + +func (c *externaldnsinventoryGlobalTsmV1Chainer) HealthChecks(name string) *externaldnsinventoryhealthcheckGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externaldnsinventoryhealthchecks.global.tsm.tanzu.vmware.com"] = name + return &externaldnsinventoryhealthcheckGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetHealthChecks calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *externaldnsinventoryGlobalTsmV1Chainer) GetHealthChecks(ctx context.Context, displayName string) (result *GlobalExternalDNSInventoryHealthCheck, err error) { + hashedName := helper.GetHashedName("externaldnsinventoryhealthchecks.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalDNSInventoryHealthCheckByName(ctx, hashedName) +} + +// AddHealthChecks calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *externaldnsinventoryGlobalTsmV1Chainer) AddHealthChecks(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventoryHealthCheck) (result *GlobalExternalDNSInventoryHealthCheck, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsinventoryhealthchecks.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalDNSInventoryHealthCheckByName(ctx, objToCreate) +} + +// DeleteHealthChecks calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *externaldnsinventoryGlobalTsmV1Chainer) DeleteHealthChecks(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsinventoryhealthchecks.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalDNSInventoryHealthCheckByName(ctx, hashedName) +} + +// GetExternalDNSRuntimeEndpointByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalDNSRuntimeEndpointByName(ctx context.Context, hashedName string) (*GlobalExternalDNSRuntimeEndpoint, error) { + key := "externaldnsruntimeendpoints.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint) + return &GlobalExternalDNSRuntimeEndpoint{ + client: group.client, + ExternalDNSRuntimeEndpoint: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimeEndpoints().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSRuntimeEndpoint{ + client: group.client, + ExternalDNSRuntimeEndpoint: result, + }, nil + } +} + +// DeleteExternalDNSRuntimeEndpointByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalDNSRuntimeEndpointByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimeEndpoints().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimeEndpoints().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/endpointsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimeSubdomains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalDNSRuntimeEndpointByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalDNSRuntimeEndpointByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint) (*GlobalExternalDNSRuntimeEndpoint, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimeEndpoints().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"endpointsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ExternalDNSRuntimeEndpoint\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimeSubdomains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSRuntimeEndpoint{ + client: group.client, + ExternalDNSRuntimeEndpoint: result, + }, nil +} + +// UpdateExternalDNSRuntimeEndpointByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalDNSRuntimeEndpointByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint) (*GlobalExternalDNSRuntimeEndpoint, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimeEndpoints().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueWeight := + objToUpdate.Spec.Weight + patchOpWeight := PatchOp{ + Op: "replace", + Path: "/spec/weight", + Value: patchValueWeight, + } + patch = append(patch, patchOpWeight) + + patchValueActive := + objToUpdate.Spec.Active + patchOpActive := PatchOp{ + Op: "replace", + Path: "/spec/active", + Value: patchValueActive, + } + patch = append(patch, patchOpActive) + + patchValueGnsVersion := + objToUpdate.Spec.GnsVersion + patchOpGnsVersion := PatchOp{ + Op: "replace", + Path: "/spec/gnsVersion", + Value: patchValueGnsVersion, + } + patch = append(patch, patchOpGnsVersion) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimeEndpoints().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalDNSRuntimeEndpoint{ + client: group.client, + ExternalDNSRuntimeEndpoint: result, + }, nil +} + +// ListExternalDNSRuntimeEndpoints returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalDNSRuntimeEndpoints(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalDNSRuntimeEndpoint, err error) { + key := "externaldnsruntimeendpoints.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalDNSRuntimeEndpoint, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint) + result[k] = &GlobalExternalDNSRuntimeEndpoint{ + client: group.client, + ExternalDNSRuntimeEndpoint: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalDNSRuntimeEndpoints().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalDNSRuntimeEndpoint, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalDNSRuntimeEndpoint{ + client: group.client, + ExternalDNSRuntimeEndpoint: &item, + } + } + } + return +} + +type GlobalExternalDNSRuntimeEndpoint struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalDNSRuntimeEndpoint) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalDNSRuntimeEndpointByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalDNSRuntimeEndpoint = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalDNSRuntimeEndpoint) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalDNSRuntimeEndpointByName(ctx, obj.ExternalDNSRuntimeEndpoint) + if err != nil { + return err + } + obj.ExternalDNSRuntimeEndpoint = result.ExternalDNSRuntimeEndpoint + return nil +} + +func (obj *GlobalExternalDNSRuntimeEndpoint) GetParent(ctx context.Context) (result *GlobalExternalDNSRuntimeSubdomain, err error) { + hashedName := helper.GetHashedName("externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetExternalDNSRuntimeSubdomainByName(ctx, hashedName) +} + +type externaldnsruntimeendpointGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externaldnsruntimeendpointGlobalTsmV1Chainer) Subscribe() { + key := "externaldnsruntimeendpoints.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSRuntimeEndpointInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externaldnsruntimeendpointGlobalTsmV1Chainer) Unsubscribe() { + key := "externaldnsruntimeendpoints.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externaldnsruntimeendpointGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externaldnsruntimeendpoints.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetExternalDNSRuntimePrimaryDomainByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalDNSRuntimePrimaryDomainByName(ctx context.Context, hashedName string) (*GlobalExternalDNSRuntimePrimaryDomain, error) { + key := "externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain) + return &GlobalExternalDNSRuntimePrimaryDomain{ + client: group.client, + ExternalDNSRuntimePrimaryDomain: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimePrimaryDomains().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSRuntimePrimaryDomain{ + client: group.client, + ExternalDNSRuntimePrimaryDomain: result, + }, nil + } +} + +// DeleteExternalDNSRuntimePrimaryDomainByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalDNSRuntimePrimaryDomainByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimePrimaryDomains().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.SubdomainsGvk { + err := group.client. + Global().DeleteExternalDNSRuntimeSubdomainByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimePrimaryDomains().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/primaryDomainsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["externaldnsruntimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externaldnsruntimes.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalDNSRuntimePrimaryDomainByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalDNSRuntimePrimaryDomainByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain) (*GlobalExternalDNSRuntimePrimaryDomain, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.SubdomainsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimePrimaryDomains().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["externaldnsruntimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externaldnsruntimes.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"primaryDomainsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ExternalDNSRuntimePrimaryDomain\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimes().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSRuntimePrimaryDomain{ + client: group.client, + ExternalDNSRuntimePrimaryDomain: result, + }, nil +} + +// UpdateExternalDNSRuntimePrimaryDomainByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalDNSRuntimePrimaryDomainByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain) (*GlobalExternalDNSRuntimePrimaryDomain, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimePrimaryDomains().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValuePrimaryDomain := + objToUpdate.Spec.PrimaryDomain + patchOpPrimaryDomain := PatchOp{ + Op: "replace", + Path: "/spec/primaryDomain", + Value: patchValuePrimaryDomain, + } + patch = append(patch, patchOpPrimaryDomain) + + patchValueDnsServerID := + objToUpdate.Spec.DnsServerID + patchOpDnsServerID := PatchOp{ + Op: "replace", + Path: "/spec/dnsServerID", + Value: patchValueDnsServerID, + } + patch = append(patch, patchOpDnsServerID) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimePrimaryDomains().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalDNSRuntimePrimaryDomain{ + client: group.client, + ExternalDNSRuntimePrimaryDomain: result, + }, nil +} + +// ListExternalDNSRuntimePrimaryDomains returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalDNSRuntimePrimaryDomains(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalDNSRuntimePrimaryDomain, err error) { + key := "externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalDNSRuntimePrimaryDomain, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain) + result[k] = &GlobalExternalDNSRuntimePrimaryDomain{ + client: group.client, + ExternalDNSRuntimePrimaryDomain: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalDNSRuntimePrimaryDomains().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalDNSRuntimePrimaryDomain, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalDNSRuntimePrimaryDomain{ + client: group.client, + ExternalDNSRuntimePrimaryDomain: &item, + } + } + } + return +} + +type GlobalExternalDNSRuntimePrimaryDomain struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalDNSRuntimePrimaryDomain) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalDNSRuntimePrimaryDomainByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalDNSRuntimePrimaryDomain = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalDNSRuntimePrimaryDomain) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalDNSRuntimePrimaryDomainByName(ctx, obj.ExternalDNSRuntimePrimaryDomain) + if err != nil { + return err + } + obj.ExternalDNSRuntimePrimaryDomain = result.ExternalDNSRuntimePrimaryDomain + return nil +} + +func (obj *GlobalExternalDNSRuntimePrimaryDomain) GetParent(ctx context.Context) (result *GlobalExternalDNSRuntime, err error) { + hashedName := helper.GetHashedName("externaldnsruntimes.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["externaldnsruntimes.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetExternalDNSRuntimeByName(ctx, hashedName) +} + +// GetAllSubdomains returns all children of given type +func (obj *GlobalExternalDNSRuntimePrimaryDomain) GetAllSubdomains(ctx context.Context) ( + result []*GlobalExternalDNSRuntimeSubdomain, err error) { + result = make([]*GlobalExternalDNSRuntimeSubdomain, 0, len(obj.Spec.SubdomainsGvk)) + for _, v := range obj.Spec.SubdomainsGvk { + l, err := obj.client.Global().GetExternalDNSRuntimeSubdomainByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetSubdomains returns child which has given displayName +func (obj *GlobalExternalDNSRuntimePrimaryDomain) GetSubdomains(ctx context.Context, + displayName string) (result *GlobalExternalDNSRuntimeSubdomain, err error) { + l, ok := obj.Spec.SubdomainsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ExternalDNSRuntimePrimaryDomain", "Subdomains", displayName) + } + result, err = obj.client.Global().GetExternalDNSRuntimeSubdomainByName(ctx, l.Name) + return +} + +// AddSubdomains calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalExternalDNSRuntimePrimaryDomain) AddSubdomains(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain) (result *GlobalExternalDNSRuntimeSubdomain, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalDNSRuntimeSubdomainByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetExternalDNSRuntimePrimaryDomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.ExternalDNSRuntimePrimaryDomain = updatedObj.ExternalDNSRuntimePrimaryDomain + } + return +} + +// DeleteSubdomains calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalExternalDNSRuntimePrimaryDomain) DeleteSubdomains(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.SubdomainsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ExternalDNSRuntimePrimaryDomain", "Subdomains", displayName) + } + err = obj.client.Global().DeleteExternalDNSRuntimeSubdomainByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetExternalDNSRuntimePrimaryDomainByName(ctx, obj.GetName()) + if err == nil { + obj.ExternalDNSRuntimePrimaryDomain = updatedObj.ExternalDNSRuntimePrimaryDomain + } + return +} + +type externaldnsruntimeprimarydomainGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externaldnsruntimeprimarydomainGlobalTsmV1Chainer) Subscribe() { + key := "externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSRuntimePrimaryDomainInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externaldnsruntimeprimarydomainGlobalTsmV1Chainer) Unsubscribe() { + key := "externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externaldnsruntimeprimarydomainGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *externaldnsruntimeprimarydomainGlobalTsmV1Chainer) Subdomains(name string) *externaldnsruntimesubdomainGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com"] = name + return &externaldnsruntimesubdomainGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetSubdomains calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *externaldnsruntimeprimarydomainGlobalTsmV1Chainer) GetSubdomains(ctx context.Context, displayName string) (result *GlobalExternalDNSRuntimeSubdomain, err error) { + hashedName := helper.GetHashedName("externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalDNSRuntimeSubdomainByName(ctx, hashedName) +} + +// AddSubdomains calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *externaldnsruntimeprimarydomainGlobalTsmV1Chainer) AddSubdomains(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain) (result *GlobalExternalDNSRuntimeSubdomain, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalDNSRuntimeSubdomainByName(ctx, objToCreate) +} + +// DeleteSubdomains calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *externaldnsruntimeprimarydomainGlobalTsmV1Chainer) DeleteSubdomains(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalDNSRuntimeSubdomainByName(ctx, hashedName) +} + +// GetExternalDNSRuntimeByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalDNSRuntimeByName(ctx context.Context, hashedName string) (*GlobalExternalDNSRuntime, error) { + key := "externaldnsruntimes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntime) + return &GlobalExternalDNSRuntime{ + client: group.client, + ExternalDNSRuntime: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimes().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSRuntime{ + client: group.client, + ExternalDNSRuntime: result, + }, nil + } +} + +// DeleteExternalDNSRuntimeByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalDNSRuntimeByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimes().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.PrimaryDomainsGvk { + err := group.client. + Global().DeleteExternalDNSRuntimePrimaryDomainByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimes().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/externalDNSGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalDNSRuntimeByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalDNSRuntimeByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntime) (*GlobalExternalDNSRuntime, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] == "" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.Labels[common.DISPLAY_NAME_LABEL]) + } + + objToCreate.Spec.PrimaryDomainsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimes().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/externalDNSGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ExternalDNSRuntime", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSRuntime{ + client: group.client, + ExternalDNSRuntime: result, + }, nil +} + +// UpdateExternalDNSRuntimeByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalDNSRuntimeByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntime) (*GlobalExternalDNSRuntime, error) { + if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) + } + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimes().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimes().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalDNSRuntime{ + client: group.client, + ExternalDNSRuntime: result, + }, nil +} + +// ListExternalDNSRuntimes returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalDNSRuntimes(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalDNSRuntime, err error) { + key := "externaldnsruntimes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalDNSRuntime, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntime) + result[k] = &GlobalExternalDNSRuntime{ + client: group.client, + ExternalDNSRuntime: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalDNSRuntimes().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalDNSRuntime, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalDNSRuntime{ + client: group.client, + ExternalDNSRuntime: &item, + } + } + } + return +} + +type GlobalExternalDNSRuntime struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntime +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalDNSRuntime) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalDNSRuntimeByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalDNSRuntime = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalDNSRuntime) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalDNSRuntimeByName(ctx, obj.ExternalDNSRuntime) + if err != nil { + return err + } + obj.ExternalDNSRuntime = result.ExternalDNSRuntime + return nil +} + +func (obj *GlobalExternalDNSRuntime) GetParent(ctx context.Context) (result *GlobalRuntime, err error) { + hashedName := helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["runtimes.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetRuntimeByName(ctx, hashedName) +} + +// GetAllPrimaryDomains returns all children of given type +func (obj *GlobalExternalDNSRuntime) GetAllPrimaryDomains(ctx context.Context) ( + result []*GlobalExternalDNSRuntimePrimaryDomain, err error) { + result = make([]*GlobalExternalDNSRuntimePrimaryDomain, 0, len(obj.Spec.PrimaryDomainsGvk)) + for _, v := range obj.Spec.PrimaryDomainsGvk { + l, err := obj.client.Global().GetExternalDNSRuntimePrimaryDomainByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetPrimaryDomains returns child which has given displayName +func (obj *GlobalExternalDNSRuntime) GetPrimaryDomains(ctx context.Context, + displayName string) (result *GlobalExternalDNSRuntimePrimaryDomain, err error) { + l, ok := obj.Spec.PrimaryDomainsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ExternalDNSRuntime", "PrimaryDomains", displayName) + } + result, err = obj.client.Global().GetExternalDNSRuntimePrimaryDomainByName(ctx, l.Name) + return +} + +// AddPrimaryDomains calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalExternalDNSRuntime) AddPrimaryDomains(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain) (result *GlobalExternalDNSRuntimePrimaryDomain, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["externaldnsruntimes.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["externaldnsruntimes.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalDNSRuntimePrimaryDomainByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetExternalDNSRuntimeByName(ctx, obj.GetName()) + if getErr == nil { + obj.ExternalDNSRuntime = updatedObj.ExternalDNSRuntime + } + return +} + +// DeletePrimaryDomains calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalExternalDNSRuntime) DeletePrimaryDomains(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.PrimaryDomainsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ExternalDNSRuntime", "PrimaryDomains", displayName) + } + err = obj.client.Global().DeleteExternalDNSRuntimePrimaryDomainByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetExternalDNSRuntimeByName(ctx, obj.GetName()) + if err == nil { + obj.ExternalDNSRuntime = updatedObj.ExternalDNSRuntime + } + return +} + +type externaldnsruntimeGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externaldnsruntimeGlobalTsmV1Chainer) Subscribe() { + key := "externaldnsruntimes.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSRuntimeInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externaldnsruntimeGlobalTsmV1Chainer) Unsubscribe() { + key := "externaldnsruntimes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externaldnsruntimeGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externaldnsruntimes.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *externaldnsruntimeGlobalTsmV1Chainer) PrimaryDomains(name string) *externaldnsruntimeprimarydomainGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com"] = name + return &externaldnsruntimeprimarydomainGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetPrimaryDomains calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *externaldnsruntimeGlobalTsmV1Chainer) GetPrimaryDomains(ctx context.Context, displayName string) (result *GlobalExternalDNSRuntimePrimaryDomain, err error) { + hashedName := helper.GetHashedName("externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalDNSRuntimePrimaryDomainByName(ctx, hashedName) +} + +// AddPrimaryDomains calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *externaldnsruntimeGlobalTsmV1Chainer) AddPrimaryDomains(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimePrimaryDomain) (result *GlobalExternalDNSRuntimePrimaryDomain, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalDNSRuntimePrimaryDomainByName(ctx, objToCreate) +} + +// DeletePrimaryDomains calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *externaldnsruntimeGlobalTsmV1Chainer) DeletePrimaryDomains(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalDNSRuntimePrimaryDomainByName(ctx, hashedName) +} + +// GetExternalDNSRuntimeSubdomainByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalDNSRuntimeSubdomainByName(ctx context.Context, hashedName string) (*GlobalExternalDNSRuntimeSubdomain, error) { + key := "externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain) + return &GlobalExternalDNSRuntimeSubdomain{ + client: group.client, + ExternalDNSRuntimeSubdomain: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimeSubdomains().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSRuntimeSubdomain{ + client: group.client, + ExternalDNSRuntimeSubdomain: result, + }, nil + } +} + +// DeleteExternalDNSRuntimeSubdomainByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalDNSRuntimeSubdomainByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimeSubdomains().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.EndpointsGvk { + err := group.client. + Global().DeleteExternalDNSRuntimeEndpointByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimeSubdomains().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/subdomainsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimePrimaryDomains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalDNSRuntimeSubdomainByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalDNSRuntimeSubdomainByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain) (*GlobalExternalDNSRuntimeSubdomain, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.EndpointsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimeSubdomains().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"subdomainsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ExternalDNSRuntimeSubdomain\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimePrimaryDomains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalDNSRuntimeSubdomain{ + client: group.client, + ExternalDNSRuntimeSubdomain: result, + }, nil +} + +// UpdateExternalDNSRuntimeSubdomainByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalDNSRuntimeSubdomainByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain) (*GlobalExternalDNSRuntimeSubdomain, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimeSubdomains().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueRecordType := + objToUpdate.Spec.RecordType + patchOpRecordType := PatchOp{ + Op: "replace", + Path: "/spec/recordType", + Value: patchValueRecordType, + } + patch = append(patch, patchOpRecordType) + + patchValueTtl := + objToUpdate.Spec.Ttl + patchOpTtl := PatchOp{ + Op: "replace", + Path: "/spec/ttl", + Value: patchValueTtl, + } + patch = append(patch, patchOpTtl) + + patchValueHealthCheckDomain := + objToUpdate.Spec.HealthCheckDomain + patchOpHealthCheckDomain := PatchOp{ + Op: "replace", + Path: "/spec/healthCheckDomain", + Value: patchValueHealthCheckDomain, + } + patch = append(patch, patchOpHealthCheckDomain) + + patchValueHealthCheckExternalPort := + objToUpdate.Spec.HealthCheckExternalPort + patchOpHealthCheckExternalPort := PatchOp{ + Op: "replace", + Path: "/spec/healthCheckExternalPort", + Value: patchValueHealthCheckExternalPort, + } + patch = append(patch, patchOpHealthCheckExternalPort) + + patchValueHealthCheckPort := + objToUpdate.Spec.HealthCheckPort + patchOpHealthCheckPort := PatchOp{ + Op: "replace", + Path: "/spec/healthCheckPort", + Value: patchValueHealthCheckPort, + } + patch = append(patch, patchOpHealthCheckPort) + + patchValueHealthCheckPath := + objToUpdate.Spec.HealthCheckPath + patchOpHealthCheckPath := PatchOp{ + Op: "replace", + Path: "/spec/healthCheckPath", + Value: patchValueHealthCheckPath, + } + patch = append(patch, patchOpHealthCheckPath) + + patchValueHealthCheckThreshold := + objToUpdate.Spec.HealthCheckThreshold + patchOpHealthCheckThreshold := PatchOp{ + Op: "replace", + Path: "/spec/healthCheckThreshold", + Value: patchValueHealthCheckThreshold, + } + patch = append(patch, patchOpHealthCheckThreshold) + + patchValueHealthCheckInterval := + objToUpdate.Spec.HealthCheckInterval + patchOpHealthCheckInterval := PatchOp{ + Op: "replace", + Path: "/spec/healthCheckInterval", + Value: patchValueHealthCheckInterval, + } + patch = append(patch, patchOpHealthCheckInterval) + + patchValueHealthCheckProtocol := + objToUpdate.Spec.HealthCheckProtocol + patchOpHealthCheckProtocol := PatchOp{ + Op: "replace", + Path: "/spec/healthCheckProtocol", + Value: patchValueHealthCheckProtocol, + } + patch = append(patch, patchOpHealthCheckProtocol) + + patchValueGnsVersion := + objToUpdate.Spec.GnsVersion + patchOpGnsVersion := PatchOp{ + Op: "replace", + Path: "/spec/gnsVersion", + Value: patchValueGnsVersion, + } + patch = append(patch, patchOpGnsVersion) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalDNSRuntimeSubdomains().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalDNSRuntimeSubdomain{ + client: group.client, + ExternalDNSRuntimeSubdomain: result, + }, nil +} + +// ListExternalDNSRuntimeSubdomains returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalDNSRuntimeSubdomains(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalDNSRuntimeSubdomain, err error) { + key := "externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalDNSRuntimeSubdomain, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain) + result[k] = &GlobalExternalDNSRuntimeSubdomain{ + client: group.client, + ExternalDNSRuntimeSubdomain: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalDNSRuntimeSubdomains().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalDNSRuntimeSubdomain, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalDNSRuntimeSubdomain{ + client: group.client, + ExternalDNSRuntimeSubdomain: &item, + } + } + } + return +} + +type GlobalExternalDNSRuntimeSubdomain struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimeSubdomain +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalDNSRuntimeSubdomain) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalDNSRuntimeSubdomainByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalDNSRuntimeSubdomain = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalDNSRuntimeSubdomain) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalDNSRuntimeSubdomainByName(ctx, obj.ExternalDNSRuntimeSubdomain) + if err != nil { + return err + } + obj.ExternalDNSRuntimeSubdomain = result.ExternalDNSRuntimeSubdomain + return nil +} + +func (obj *GlobalExternalDNSRuntimeSubdomain) GetParent(ctx context.Context) (result *GlobalExternalDNSRuntimePrimaryDomain, err error) { + hashedName := helper.GetHashedName("externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetExternalDNSRuntimePrimaryDomainByName(ctx, hashedName) +} + +// GetAllEndpoints returns all children of given type +func (obj *GlobalExternalDNSRuntimeSubdomain) GetAllEndpoints(ctx context.Context) ( + result []*GlobalExternalDNSRuntimeEndpoint, err error) { + result = make([]*GlobalExternalDNSRuntimeEndpoint, 0, len(obj.Spec.EndpointsGvk)) + for _, v := range obj.Spec.EndpointsGvk { + l, err := obj.client.Global().GetExternalDNSRuntimeEndpointByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetEndpoints returns child which has given displayName +func (obj *GlobalExternalDNSRuntimeSubdomain) GetEndpoints(ctx context.Context, + displayName string) (result *GlobalExternalDNSRuntimeEndpoint, err error) { + l, ok := obj.Spec.EndpointsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ExternalDNSRuntimeSubdomain", "Endpoints", displayName) + } + result, err = obj.client.Global().GetExternalDNSRuntimeEndpointByName(ctx, l.Name) + return +} + +// AddEndpoints calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalExternalDNSRuntimeSubdomain) AddEndpoints(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint) (result *GlobalExternalDNSRuntimeEndpoint, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalDNSRuntimeEndpointByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetExternalDNSRuntimeSubdomainByName(ctx, obj.GetName()) + if getErr == nil { + obj.ExternalDNSRuntimeSubdomain = updatedObj.ExternalDNSRuntimeSubdomain + } + return +} + +// DeleteEndpoints calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalExternalDNSRuntimeSubdomain) DeleteEndpoints(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.EndpointsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ExternalDNSRuntimeSubdomain", "Endpoints", displayName) + } + err = obj.client.Global().DeleteExternalDNSRuntimeEndpointByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetExternalDNSRuntimeSubdomainByName(ctx, obj.GetName()) + if err == nil { + obj.ExternalDNSRuntimeSubdomain = updatedObj.ExternalDNSRuntimeSubdomain + } + return +} + +type externaldnsruntimesubdomainGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externaldnsruntimesubdomainGlobalTsmV1Chainer) Subscribe() { + key := "externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalDNSRuntimeSubdomainInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externaldnsruntimesubdomainGlobalTsmV1Chainer) Unsubscribe() { + key := "externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externaldnsruntimesubdomainGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *externaldnsruntimesubdomainGlobalTsmV1Chainer) Endpoints(name string) *externaldnsruntimeendpointGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externaldnsruntimeendpoints.global.tsm.tanzu.vmware.com"] = name + return &externaldnsruntimeendpointGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetEndpoints calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *externaldnsruntimesubdomainGlobalTsmV1Chainer) GetEndpoints(ctx context.Context, displayName string) (result *GlobalExternalDNSRuntimeEndpoint, err error) { + hashedName := helper.GetHashedName("externaldnsruntimeendpoints.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalDNSRuntimeEndpointByName(ctx, hashedName) +} + +// AddEndpoints calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *externaldnsruntimesubdomainGlobalTsmV1Chainer) AddEndpoints(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntimeEndpoint) (result *GlobalExternalDNSRuntimeEndpoint, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsruntimeendpoints.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalDNSRuntimeEndpointByName(ctx, objToCreate) +} + +// DeleteEndpoints calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *externaldnsruntimesubdomainGlobalTsmV1Chainer) DeleteEndpoints(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsruntimeendpoints.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalDNSRuntimeEndpointByName(ctx, hashedName) +} + +// GetExternalLBConfigNByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalLBConfigNByName(ctx context.Context, hashedName string) (*GlobalExternalLBConfigN, error) { + key := "externallbconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalLBConfigN) + return &GlobalExternalLBConfigN{ + client: group.client, + ExternalLBConfigN: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalLBConfigNs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalLBConfigN{ + client: group.client, + ExternalLBConfigN: result, + }, nil + } +} + +// DeleteExternalLBConfigNByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalLBConfigNByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalLBConfigNs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalLBConfigNs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/externalLBGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalLBConfigNByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalLBConfigNByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalLBConfigN) (*GlobalExternalLBConfigN, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalLBConfigNs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"externalLBGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ExternalLBConfigN\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalLBConfigN{ + client: group.client, + ExternalLBConfigN: result, + }, nil +} + +// UpdateExternalLBConfigNByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalLBConfigNByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalLBConfigN) (*GlobalExternalLBConfigN, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalLBConfigNs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueConfig := + objToUpdate.Spec.Config + patchOpConfig := PatchOp{ + Op: "replace", + Path: "/spec/config", + Value: patchValueConfig, + } + patch = append(patch, patchOpConfig) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalLBConfigNs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalLBConfigN{ + client: group.client, + ExternalLBConfigN: result, + }, nil +} + +// ListExternalLBConfigNs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalLBConfigNs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalLBConfigN, err error) { + key := "externallbconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalLBConfigN, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalLBConfigN) + result[k] = &GlobalExternalLBConfigN{ + client: group.client, + ExternalLBConfigN: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalLBConfigNs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalLBConfigN, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalLBConfigN{ + client: group.client, + ExternalLBConfigN: &item, + } + } + } + return +} + +type GlobalExternalLBConfigN struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalLBConfigN +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalLBConfigN) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalLBConfigNByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalLBConfigN = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalLBConfigN) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalLBConfigNByName(ctx, obj.ExternalLBConfigN) + if err != nil { + return err + } + obj.ExternalLBConfigN = result.ExternalLBConfigN + return nil +} + +func (obj *GlobalExternalLBConfigN) GetParent(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetConfigByName(ctx, hashedName) +} + +type externallbconfignGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externallbconfignGlobalTsmV1Chainer) Subscribe() { + key := "externallbconfigns.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalLBConfigNInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externallbconfignGlobalTsmV1Chainer) Unsubscribe() { + key := "externallbconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externallbconfignGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externallbconfigns.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetExternalPluginCapabilityByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalPluginCapabilityByName(ctx context.Context, hashedName string) (*GlobalExternalPluginCapability, error) { + key := "externalplugincapabilities.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalPluginCapability) + return &GlobalExternalPluginCapability{ + client: group.client, + ExternalPluginCapability: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginCapabilities().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalPluginCapability{ + client: group.client, + ExternalPluginCapability: result, + }, nil + } +} + +// DeleteExternalPluginCapabilityByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalPluginCapabilityByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginCapabilities().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalPluginCapabilities().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/capabilitiyGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["externalplugininstanceconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externalplugininstanceconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalPluginInstanceConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalPluginCapabilityByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalPluginCapabilityByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginCapability) (*GlobalExternalPluginCapability, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginCapabilities().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["externalplugininstanceconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externalplugininstanceconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/capabilitiyGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ExternalPluginCapability", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalPluginInstanceConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalPluginCapability{ + client: group.client, + ExternalPluginCapability: result, + }, nil +} + +// UpdateExternalPluginCapabilityByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalPluginCapabilityByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginCapability) (*GlobalExternalPluginCapability, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginCapabilities().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueCapability := + objToUpdate.Spec.Capability + patchOpCapability := PatchOp{ + Op: "replace", + Path: "/spec/capability", + Value: patchValueCapability, + } + patch = append(patch, patchOpCapability) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginCapabilities().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalPluginCapability{ + client: group.client, + ExternalPluginCapability: result, + }, nil +} + +// ListExternalPluginCapabilities returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalPluginCapabilities(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalPluginCapability, err error) { + key := "externalplugincapabilities.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalPluginCapability, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalPluginCapability) + result[k] = &GlobalExternalPluginCapability{ + client: group.client, + ExternalPluginCapability: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalPluginCapabilities().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalPluginCapability, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalPluginCapability{ + client: group.client, + ExternalPluginCapability: &item, + } + } + } + return +} + +type GlobalExternalPluginCapability struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalPluginCapability +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalPluginCapability) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalPluginCapabilityByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalPluginCapability = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalPluginCapability) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalPluginCapabilityByName(ctx, obj.ExternalPluginCapability) + if err != nil { + return err + } + obj.ExternalPluginCapability = result.ExternalPluginCapability + return nil +} + +func (obj *GlobalExternalPluginCapability) GetParent(ctx context.Context) (result *GlobalExternalPluginInstanceConfig, err error) { + hashedName := helper.GetHashedName("externalplugininstanceconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["externalplugininstanceconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetExternalPluginInstanceConfigByName(ctx, hashedName) +} + +type externalplugincapabilityGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externalplugincapabilityGlobalTsmV1Chainer) Subscribe() { + key := "externalplugincapabilities.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalPluginCapabilityInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externalplugincapabilityGlobalTsmV1Chainer) Unsubscribe() { + key := "externalplugincapabilities.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externalplugincapabilityGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externalplugincapabilities.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetExternalPluginConfigFolderByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalPluginConfigFolderByName(ctx context.Context, hashedName string) (*GlobalExternalPluginConfigFolder, error) { + key := "externalpluginconfigfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder) + return &GlobalExternalPluginConfigFolder{ + client: group.client, + ExternalPluginConfigFolder: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginConfigFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalPluginConfigFolder{ + client: group.client, + ExternalPluginConfigFolder: result, + }, nil + } +} + +// DeleteExternalPluginConfigFolderByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalPluginConfigFolderByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginConfigFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.PluginsGvk { + err := group.client. + Global().DeleteExternalPluginConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalPluginConfigFolders().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/externalPluginsGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalPluginConfigFolderByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalPluginConfigFolderByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder) (*GlobalExternalPluginConfigFolder, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.PluginsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginConfigFolders().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/externalPluginsGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ExternalPluginConfigFolder", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalPluginConfigFolder{ + client: group.client, + ExternalPluginConfigFolder: result, + }, nil +} + +// UpdateExternalPluginConfigFolderByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalPluginConfigFolderByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder) (*GlobalExternalPluginConfigFolder, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginConfigFolders().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginConfigFolders().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalPluginConfigFolder{ + client: group.client, + ExternalPluginConfigFolder: result, + }, nil +} + +// ListExternalPluginConfigFolders returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalPluginConfigFolders(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalPluginConfigFolder, err error) { + key := "externalpluginconfigfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalPluginConfigFolder, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder) + result[k] = &GlobalExternalPluginConfigFolder{ + client: group.client, + ExternalPluginConfigFolder: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalPluginConfigFolders().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalPluginConfigFolder, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalPluginConfigFolder{ + client: group.client, + ExternalPluginConfigFolder: &item, + } + } + } + return +} + +type GlobalExternalPluginConfigFolder struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalPluginConfigFolder +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalPluginConfigFolder) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalPluginConfigFolderByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalPluginConfigFolder = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalPluginConfigFolder) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalPluginConfigFolderByName(ctx, obj.ExternalPluginConfigFolder) + if err != nil { + return err + } + obj.ExternalPluginConfigFolder = result.ExternalPluginConfigFolder + return nil +} + +func (obj *GlobalExternalPluginConfigFolder) GetParent(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetConfigByName(ctx, hashedName) +} + +// GetAllPlugins returns all children of given type +func (obj *GlobalExternalPluginConfigFolder) GetAllPlugins(ctx context.Context) ( + result []*GlobalExternalPluginConfig, err error) { + result = make([]*GlobalExternalPluginConfig, 0, len(obj.Spec.PluginsGvk)) + for _, v := range obj.Spec.PluginsGvk { + l, err := obj.client.Global().GetExternalPluginConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetPlugins returns child which has given displayName +func (obj *GlobalExternalPluginConfigFolder) GetPlugins(ctx context.Context, + displayName string) (result *GlobalExternalPluginConfig, err error) { + l, ok := obj.Spec.PluginsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ExternalPluginConfigFolder", "Plugins", displayName) + } + result, err = obj.client.Global().GetExternalPluginConfigByName(ctx, l.Name) + return +} + +// AddPlugins calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalExternalPluginConfigFolder) AddPlugins(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginConfig) (result *GlobalExternalPluginConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["externalpluginconfigfolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["externalpluginconfigfolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalPluginConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetExternalPluginConfigFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.ExternalPluginConfigFolder = updatedObj.ExternalPluginConfigFolder + } + return +} + +// DeletePlugins calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalExternalPluginConfigFolder) DeletePlugins(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.PluginsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ExternalPluginConfigFolder", "Plugins", displayName) + } + err = obj.client.Global().DeleteExternalPluginConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetExternalPluginConfigFolderByName(ctx, obj.GetName()) + if err == nil { + obj.ExternalPluginConfigFolder = updatedObj.ExternalPluginConfigFolder + } + return +} + +type externalpluginconfigfolderGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externalpluginconfigfolderGlobalTsmV1Chainer) Subscribe() { + key := "externalpluginconfigfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalPluginConfigFolderInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externalpluginconfigfolderGlobalTsmV1Chainer) Unsubscribe() { + key := "externalpluginconfigfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externalpluginconfigfolderGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externalpluginconfigfolders.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *externalpluginconfigfolderGlobalTsmV1Chainer) Plugins(name string) *externalpluginconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externalpluginconfigs.global.tsm.tanzu.vmware.com"] = name + return &externalpluginconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetPlugins calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *externalpluginconfigfolderGlobalTsmV1Chainer) GetPlugins(ctx context.Context, displayName string) (result *GlobalExternalPluginConfig, err error) { + hashedName := helper.GetHashedName("externalpluginconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalPluginConfigByName(ctx, hashedName) +} + +// AddPlugins calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *externalpluginconfigfolderGlobalTsmV1Chainer) AddPlugins(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginConfig) (result *GlobalExternalPluginConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalpluginconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalPluginConfigByName(ctx, objToCreate) +} + +// DeletePlugins calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *externalpluginconfigfolderGlobalTsmV1Chainer) DeletePlugins(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalpluginconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalPluginConfigByName(ctx, hashedName) +} + +// GetExternalPluginConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalPluginConfigByName(ctx context.Context, hashedName string) (*GlobalExternalPluginConfig, error) { + key := "externalpluginconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalPluginConfig) + return &GlobalExternalPluginConfig{ + client: group.client, + ExternalPluginConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalPluginConfig{ + client: group.client, + ExternalPluginConfig: result, + }, nil + } +} + +// DeleteExternalPluginConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalPluginConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.PluginInstancesGvk { + err := group.client. + Global().DeleteExternalPluginInstanceConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalPluginConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/pluginsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["externalpluginconfigfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externalpluginconfigfolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalPluginConfigFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalPluginConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalPluginConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginConfig) (*GlobalExternalPluginConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.PluginInstancesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["externalpluginconfigfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externalpluginconfigfolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"pluginsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ExternalPluginConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalPluginConfigFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalPluginConfig{ + client: group.client, + ExternalPluginConfig: result, + }, nil +} + +// UpdateExternalPluginConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalPluginConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginConfig) (*GlobalExternalPluginConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueProviderName := + objToUpdate.Spec.ProviderName + patchOpProviderName := PatchOp{ + Op: "replace", + Path: "/spec/providerName", + Value: patchValueProviderName, + } + patch = append(patch, patchOpProviderName) + + patchValueInstallConfig := + objToUpdate.Spec.InstallConfig + patchOpInstallConfig := PatchOp{ + Op: "replace", + Path: "/spec/installConfig", + Value: patchValueInstallConfig, + } + patch = append(patch, patchOpInstallConfig) + + patchValueType := + objToUpdate.Spec.Type + patchOpType := PatchOp{ + Op: "replace", + Path: "/spec/type", + Value: patchValueType, + } + patch = append(patch, patchOpType) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalPluginConfig{ + client: group.client, + ExternalPluginConfig: result, + }, nil +} + +// ListExternalPluginConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalPluginConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalPluginConfig, err error) { + key := "externalpluginconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalPluginConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalPluginConfig) + result[k] = &GlobalExternalPluginConfig{ + client: group.client, + ExternalPluginConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalPluginConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalPluginConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalPluginConfig{ + client: group.client, + ExternalPluginConfig: &item, + } + } + } + return +} + +type GlobalExternalPluginConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalPluginConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalPluginConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalPluginConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalPluginConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalPluginConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalPluginConfigByName(ctx, obj.ExternalPluginConfig) + if err != nil { + return err + } + obj.ExternalPluginConfig = result.ExternalPluginConfig + return nil +} + +func (obj *GlobalExternalPluginConfig) GetParent(ctx context.Context) (result *GlobalExternalPluginConfigFolder, err error) { + hashedName := helper.GetHashedName("externalpluginconfigfolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["externalpluginconfigfolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetExternalPluginConfigFolderByName(ctx, hashedName) +} + +// GetAllPluginInstances returns all children of given type +func (obj *GlobalExternalPluginConfig) GetAllPluginInstances(ctx context.Context) ( + result []*GlobalExternalPluginInstanceConfig, err error) { + result = make([]*GlobalExternalPluginInstanceConfig, 0, len(obj.Spec.PluginInstancesGvk)) + for _, v := range obj.Spec.PluginInstancesGvk { + l, err := obj.client.Global().GetExternalPluginInstanceConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetPluginInstances returns child which has given displayName +func (obj *GlobalExternalPluginConfig) GetPluginInstances(ctx context.Context, + displayName string) (result *GlobalExternalPluginInstanceConfig, err error) { + l, ok := obj.Spec.PluginInstancesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ExternalPluginConfig", "PluginInstances", displayName) + } + result, err = obj.client.Global().GetExternalPluginInstanceConfigByName(ctx, l.Name) + return +} + +// AddPluginInstances calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalExternalPluginConfig) AddPluginInstances(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig) (result *GlobalExternalPluginInstanceConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["externalpluginconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["externalpluginconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalPluginInstanceConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetExternalPluginConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.ExternalPluginConfig = updatedObj.ExternalPluginConfig + } + return +} + +// DeletePluginInstances calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalExternalPluginConfig) DeletePluginInstances(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.PluginInstancesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ExternalPluginConfig", "PluginInstances", displayName) + } + err = obj.client.Global().DeleteExternalPluginInstanceConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetExternalPluginConfigByName(ctx, obj.GetName()) + if err == nil { + obj.ExternalPluginConfig = updatedObj.ExternalPluginConfig + } + return +} + +type externalpluginconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externalpluginconfigGlobalTsmV1Chainer) Subscribe() { + key := "externalpluginconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalPluginConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externalpluginconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "externalpluginconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externalpluginconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externalpluginconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *externalpluginconfigGlobalTsmV1Chainer) PluginInstances(name string) *externalplugininstanceconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externalplugininstanceconfigs.global.tsm.tanzu.vmware.com"] = name + return &externalplugininstanceconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetPluginInstances calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *externalpluginconfigGlobalTsmV1Chainer) GetPluginInstances(ctx context.Context, displayName string) (result *GlobalExternalPluginInstanceConfig, err error) { + hashedName := helper.GetHashedName("externalplugininstanceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalPluginInstanceConfigByName(ctx, hashedName) +} + +// AddPluginInstances calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *externalpluginconfigGlobalTsmV1Chainer) AddPluginInstances(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig) (result *GlobalExternalPluginInstanceConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalplugininstanceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalPluginInstanceConfigByName(ctx, objToCreate) +} + +// DeletePluginInstances calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *externalpluginconfigGlobalTsmV1Chainer) DeletePluginInstances(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalplugininstanceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalPluginInstanceConfigByName(ctx, hashedName) +} + +// GetExternalPluginInstanceConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalPluginInstanceConfigByName(ctx context.Context, hashedName string) (*GlobalExternalPluginInstanceConfig, error) { + key := "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig) + return &GlobalExternalPluginInstanceConfig{ + client: group.client, + ExternalPluginInstanceConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginInstanceConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalPluginInstanceConfig{ + client: group.client, + ExternalPluginInstanceConfig: result, + }, nil + } +} + +// DeleteExternalPluginInstanceConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalPluginInstanceConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginInstanceConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + if result.Spec.CapabilitiyGvk != nil { + err := group.client. + Global(). + DeleteExternalPluginCapabilityByName(ctx, result.Spec.CapabilitiyGvk.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.MonitorsGvk { + err := group.client. + Global().DeleteExternalPluginMonitorByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalPluginInstanceConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/pluginInstancesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["externalpluginconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externalpluginconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalPluginConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalPluginInstanceConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalPluginInstanceConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig) (*GlobalExternalPluginInstanceConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.CapabilitiyGvk = nil + objToCreate.Spec.MonitorsGvk = nil + objToCreate.Spec.ClustersGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginInstanceConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["externalpluginconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externalpluginconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"pluginInstancesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ExternalPluginInstanceConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalPluginConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalPluginInstanceConfig{ + client: group.client, + ExternalPluginInstanceConfig: result, + }, nil +} + +// UpdateExternalPluginInstanceConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalPluginInstanceConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig) (*GlobalExternalPluginInstanceConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginInstanceConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueSecurityToken := + objToUpdate.Spec.SecurityToken + patchOpSecurityToken := PatchOp{ + Op: "replace", + Path: "/spec/securityToken", + Value: patchValueSecurityToken, + } + patch = append(patch, patchOpSecurityToken) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginInstanceConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalPluginInstanceConfig{ + client: group.client, + ExternalPluginInstanceConfig: result, + }, nil +} + +// ListExternalPluginInstanceConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalPluginInstanceConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalPluginInstanceConfig, err error) { + key := "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalPluginInstanceConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig) + result[k] = &GlobalExternalPluginInstanceConfig{ + client: group.client, + ExternalPluginInstanceConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalPluginInstanceConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalPluginInstanceConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalPluginInstanceConfig{ + client: group.client, + ExternalPluginInstanceConfig: &item, + } + } + } + return +} + +type GlobalExternalPluginInstanceConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalPluginInstanceConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalPluginInstanceConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalPluginInstanceConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalPluginInstanceConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalPluginInstanceConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalPluginInstanceConfigByName(ctx, obj.ExternalPluginInstanceConfig) + if err != nil { + return err + } + obj.ExternalPluginInstanceConfig = result.ExternalPluginInstanceConfig + return nil +} + +func (obj *GlobalExternalPluginInstanceConfig) GetParent(ctx context.Context) (result *GlobalExternalPluginConfig, err error) { + hashedName := helper.GetHashedName("externalpluginconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["externalpluginconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetExternalPluginConfigByName(ctx, hashedName) +} + +// GetCapabilitiy returns child of given type +func (obj *GlobalExternalPluginInstanceConfig) GetCapabilitiy(ctx context.Context) ( + result *GlobalExternalPluginCapability, err error) { + if obj.Spec.CapabilitiyGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ExternalPluginInstanceConfig", "Capabilitiy") + } + return obj.client.Global().GetExternalPluginCapabilityByName(ctx, obj.Spec.CapabilitiyGvk.Name) +} + +// AddCapabilitiy calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalExternalPluginInstanceConfig) AddCapabilitiy(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginCapability) (result *GlobalExternalPluginCapability, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["externalplugininstanceconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["externalplugininstanceconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalPluginCapabilityByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetExternalPluginInstanceConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.ExternalPluginInstanceConfig = updatedObj.ExternalPluginInstanceConfig + } + return +} + +// DeleteCapabilitiy calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalExternalPluginInstanceConfig) DeleteCapabilitiy(ctx context.Context) (err error) { + if obj.Spec.CapabilitiyGvk != nil { + err = obj.client. + Global().DeleteExternalPluginCapabilityByName(ctx, obj.Spec.CapabilitiyGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetExternalPluginInstanceConfigByName(ctx, obj.GetName()) + if err == nil { + obj.ExternalPluginInstanceConfig = updatedObj.ExternalPluginInstanceConfig + } + return +} + +// GetAllMonitors returns all children of given type +func (obj *GlobalExternalPluginInstanceConfig) GetAllMonitors(ctx context.Context) ( + result []*GlobalExternalPluginMonitor, err error) { + result = make([]*GlobalExternalPluginMonitor, 0, len(obj.Spec.MonitorsGvk)) + for _, v := range obj.Spec.MonitorsGvk { + l, err := obj.client.Global().GetExternalPluginMonitorByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetMonitors returns child which has given displayName +func (obj *GlobalExternalPluginInstanceConfig) GetMonitors(ctx context.Context, + displayName string) (result *GlobalExternalPluginMonitor, err error) { + l, ok := obj.Spec.MonitorsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ExternalPluginInstanceConfig", "Monitors", displayName) + } + result, err = obj.client.Global().GetExternalPluginMonitorByName(ctx, l.Name) + return +} + +// AddMonitors calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalExternalPluginInstanceConfig) AddMonitors(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginMonitor) (result *GlobalExternalPluginMonitor, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["externalplugininstanceconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["externalplugininstanceconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalPluginMonitorByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetExternalPluginInstanceConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.ExternalPluginInstanceConfig = updatedObj.ExternalPluginInstanceConfig + } + return +} + +// DeleteMonitors calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalExternalPluginInstanceConfig) DeleteMonitors(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.MonitorsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ExternalPluginInstanceConfig", "Monitors", displayName) + } + err = obj.client.Global().DeleteExternalPluginMonitorByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetExternalPluginInstanceConfigByName(ctx, obj.GetName()) + if err == nil { + obj.ExternalPluginInstanceConfig = updatedObj.ExternalPluginInstanceConfig + } + return +} + +// GetAllClusters returns all links of given type +func (obj *GlobalExternalPluginInstanceConfig) GetAllClusters(ctx context.Context) ( + result []*GlobalCluster, err error) { + result = make([]*GlobalCluster, 0, len(obj.Spec.ClustersGvk)) + for _, v := range obj.Spec.ClustersGvk { + l, err := obj.client.Global().GetClusterByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetClusters returns link which has given displayName +func (obj *GlobalExternalPluginInstanceConfig) GetClusters(ctx context.Context, + displayName string) (result *GlobalCluster, err error) { + l, ok := obj.Spec.ClustersGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ExternalPluginInstanceConfig", "Clusters", displayName) + } + result, err = obj.client.Global().GetClusterByName(ctx, l.Name) + return +} + +// LinkClusters links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalExternalPluginInstanceConfig) LinkClusters(ctx context.Context, + linkToAdd *GlobalCluster) error { + + payload := "{\"spec\": {\"clustersGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"Cluster\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ExternalPluginInstanceConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ExternalPluginInstanceConfig = result + return nil +} + +// UnlinkClusters unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalExternalPluginInstanceConfig) UnlinkClusters(ctx context.Context, + linkToRemove *GlobalCluster) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/clustersGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ExternalPluginInstanceConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ExternalPluginInstanceConfig = result + return nil + +} + +type externalplugininstanceconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externalplugininstanceconfigGlobalTsmV1Chainer) Subscribe() { + key := "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalPluginInstanceConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externalplugininstanceconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externalplugininstanceconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *externalplugininstanceconfigGlobalTsmV1Chainer) Capabilitiy(name string) *externalplugincapabilityGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externalplugincapabilities.global.tsm.tanzu.vmware.com"] = name + return &externalplugincapabilityGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetCapabilitiy calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *externalplugininstanceconfigGlobalTsmV1Chainer) GetCapabilitiy(ctx context.Context, displayName string) (result *GlobalExternalPluginCapability, err error) { + hashedName := helper.GetHashedName("externalplugincapabilities.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalPluginCapabilityByName(ctx, hashedName) +} + +// AddCapabilitiy calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *externalplugininstanceconfigGlobalTsmV1Chainer) AddCapabilitiy(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginCapability) (result *GlobalExternalPluginCapability, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalplugincapabilities.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalPluginCapabilityByName(ctx, objToCreate) +} + +// DeleteCapabilitiy calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *externalplugininstanceconfigGlobalTsmV1Chainer) DeleteCapabilitiy(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalplugincapabilities.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalPluginCapabilityByName(ctx, hashedName) +} + +func (c *externalplugininstanceconfigGlobalTsmV1Chainer) Monitors(name string) *externalpluginmonitorGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externalpluginmonitors.global.tsm.tanzu.vmware.com"] = name + return &externalpluginmonitorGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetMonitors calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *externalplugininstanceconfigGlobalTsmV1Chainer) GetMonitors(ctx context.Context, displayName string) (result *GlobalExternalPluginMonitor, err error) { + hashedName := helper.GetHashedName("externalpluginmonitors.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalPluginMonitorByName(ctx, hashedName) +} + +// AddMonitors calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *externalplugininstanceconfigGlobalTsmV1Chainer) AddMonitors(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginMonitor) (result *GlobalExternalPluginMonitor, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalpluginmonitors.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalPluginMonitorByName(ctx, objToCreate) +} + +// DeleteMonitors calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *externalplugininstanceconfigGlobalTsmV1Chainer) DeleteMonitors(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalpluginmonitors.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalPluginMonitorByName(ctx, hashedName) +} + +// GetExternalPluginMonitorByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalPluginMonitorByName(ctx context.Context, hashedName string) (*GlobalExternalPluginMonitor, error) { + key := "externalpluginmonitors.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalPluginMonitor) + return &GlobalExternalPluginMonitor{ + client: group.client, + ExternalPluginMonitor: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginMonitors().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalPluginMonitor{ + client: group.client, + ExternalPluginMonitor: result, + }, nil + } +} + +// DeleteExternalPluginMonitorByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalPluginMonitorByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginMonitors().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalPluginMonitors().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/monitorsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["externalplugininstanceconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externalplugininstanceconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalPluginInstanceConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalPluginMonitorByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalPluginMonitorByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginMonitor) (*GlobalExternalPluginMonitor, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginMonitors().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["externalplugininstanceconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("externalplugininstanceconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"monitorsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ExternalPluginMonitor\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ExternalPluginInstanceConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalPluginMonitor{ + client: group.client, + ExternalPluginMonitor: result, + }, nil +} + +// UpdateExternalPluginMonitorByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalPluginMonitorByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalPluginMonitor) (*GlobalExternalPluginMonitor, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginMonitors().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueObjType := + objToUpdate.Spec.ObjType + patchOpObjType := PatchOp{ + Op: "replace", + Path: "/spec/objType", + Value: patchValueObjType, + } + patch = append(patch, patchOpObjType) + + patchValuePluginCapability := + objToUpdate.Spec.PluginCapability + patchOpPluginCapability := PatchOp{ + Op: "replace", + Path: "/spec/pluginCapability", + Value: patchValuePluginCapability, + } + patch = append(patch, patchOpPluginCapability) + + patchValueFn := + objToUpdate.Spec.Fn + patchOpFn := PatchOp{ + Op: "replace", + Path: "/spec/fn", + Value: patchValueFn, + } + patch = append(patch, patchOpFn) + + patchValueArg1 := + objToUpdate.Spec.Arg1 + patchOpArg1 := PatchOp{ + Op: "replace", + Path: "/spec/arg1", + Value: patchValueArg1, + } + patch = append(patch, patchOpArg1) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalPluginMonitors().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalPluginMonitor{ + client: group.client, + ExternalPluginMonitor: result, + }, nil +} + +// ListExternalPluginMonitors returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalPluginMonitors(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalPluginMonitor, err error) { + key := "externalpluginmonitors.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalPluginMonitor, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalPluginMonitor) + result[k] = &GlobalExternalPluginMonitor{ + client: group.client, + ExternalPluginMonitor: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalPluginMonitors().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalPluginMonitor, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalPluginMonitor{ + client: group.client, + ExternalPluginMonitor: &item, + } + } + } + return +} + +type GlobalExternalPluginMonitor struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalPluginMonitor +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalPluginMonitor) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalPluginMonitorByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalPluginMonitor = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalPluginMonitor) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalPluginMonitorByName(ctx, obj.ExternalPluginMonitor) + if err != nil { + return err + } + obj.ExternalPluginMonitor = result.ExternalPluginMonitor + return nil +} + +func (obj *GlobalExternalPluginMonitor) GetParent(ctx context.Context) (result *GlobalExternalPluginInstanceConfig, err error) { + hashedName := helper.GetHashedName("externalplugininstanceconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["externalplugininstanceconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetExternalPluginInstanceConfigByName(ctx, hashedName) +} + +type externalpluginmonitorGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externalpluginmonitorGlobalTsmV1Chainer) Subscribe() { + key := "externalpluginmonitors.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalPluginMonitorInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externalpluginmonitorGlobalTsmV1Chainer) Unsubscribe() { + key := "externalpluginmonitors.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externalpluginmonitorGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externalpluginmonitors.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetExternalServicesRTByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalServicesRTByName(ctx context.Context, hashedName string) (*GlobalExternalServicesRT, error) { + key := "externalservicesrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalServicesRT) + return &GlobalExternalServicesRT{ + client: group.client, + ExternalServicesRT: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalServicesRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalServicesRT{ + client: group.client, + ExternalServicesRT: result, + }, nil + } +} + +// DeleteExternalServicesRTByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalServicesRTByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalServicesRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalServicesRTs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/externalServicesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalServicesRTByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalServicesRTByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalServicesRT) (*GlobalExternalServicesRT, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalServicesRTs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"externalServicesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ExternalServicesRT\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalServicesRT{ + client: group.client, + ExternalServicesRT: result, + }, nil +} + +// UpdateExternalServicesRTByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalServicesRTByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalServicesRT) (*GlobalExternalServicesRT, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalServicesRTs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueOwnedBy := + objToUpdate.Spec.OwnedBy + patchOpOwnedBy := PatchOp{ + Op: "replace", + Path: "/spec/ownedBy", + Value: patchValueOwnedBy, + } + patch = append(patch, patchOpOwnedBy) + + patchValueCreatedByGNS := + objToUpdate.Spec.CreatedByGNS + patchOpCreatedByGNS := PatchOp{ + Op: "replace", + Path: "/spec/createdByGNS", + Value: patchValueCreatedByGNS, + } + patch = append(patch, patchOpCreatedByGNS) + + patchValueCreatedByESName := + objToUpdate.Spec.CreatedByESName + patchOpCreatedByESName := PatchOp{ + Op: "replace", + Path: "/spec/createdByESName", + Value: patchValueCreatedByESName, + } + patch = append(patch, patchOpCreatedByESName) + + patchValueCreatedBySDFolder := + objToUpdate.Spec.CreatedBySDFolder + patchOpCreatedBySDFolder := PatchOp{ + Op: "replace", + Path: "/spec/createdBySDFolder", + Value: patchValueCreatedBySDFolder, + } + patch = append(patch, patchOpCreatedBySDFolder) + + patchValueCreatedBySDEntry := + objToUpdate.Spec.CreatedBySDEntry + patchOpCreatedBySDEntry := PatchOp{ + Op: "replace", + Path: "/spec/createdBySDEntry", + Value: patchValueCreatedBySDEntry, + } + patch = append(patch, patchOpCreatedBySDEntry) + + patchValueServicePort := + objToUpdate.Spec.ServicePort + patchOpServicePort := PatchOp{ + Op: "replace", + Path: "/spec/servicePort", + Value: patchValueServicePort, + } + patch = append(patch, patchOpServicePort) + + patchValueProtocol := + objToUpdate.Spec.Protocol + patchOpProtocol := PatchOp{ + Op: "replace", + Path: "/spec/protocol", + Value: patchValueProtocol, + } + patch = append(patch, patchOpProtocol) + + patchValueHostname := + objToUpdate.Spec.Hostname + patchOpHostname := PatchOp{ + Op: "replace", + Path: "/spec/hostname", + Value: patchValueHostname, + } + patch = append(patch, patchOpHostname) + + patchValuePort := + objToUpdate.Spec.Port + patchOpPort := PatchOp{ + Op: "replace", + Path: "/spec/port", + Value: patchValuePort, + } + patch = append(patch, patchOpPort) + + patchValueServerCertificate := + objToUpdate.Spec.ServerCertificate + patchOpServerCertificate := PatchOp{ + Op: "replace", + Path: "/spec/serverCertificate", + Value: patchValueServerCertificate, + } + patch = append(patch, patchOpServerCertificate) + + patchValueHostnameAlias := + objToUpdate.Spec.HostnameAlias + patchOpHostnameAlias := PatchOp{ + Op: "replace", + Path: "/spec/hostnameAlias", + Value: patchValueHostnameAlias, + } + patch = append(patch, patchOpHostnameAlias) + + if objToUpdate.Spec.EndpointList != nil { + patchValueEndpointList := + objToUpdate.Spec.EndpointList + patchOpEndpointList := PatchOp{ + Op: "replace", + Path: "/spec/endpointList", + Value: patchValueEndpointList, + } + patch = append(patch, patchOpEndpointList) + } + + if objToUpdate.Spec.EgressGateways != nil { + patchValueEgressGateways := + objToUpdate.Spec.EgressGateways + patchOpEgressGateways := PatchOp{ + Op: "replace", + Path: "/spec/egressGateways", + Value: patchValueEgressGateways, + } + patch = append(patch, patchOpEgressGateways) + } + + patchValueClientCertificate := + objToUpdate.Spec.ClientCertificate + patchOpClientCertificate := PatchOp{ + Op: "replace", + Path: "/spec/clientCertificate", + Value: patchValueClientCertificate, + } + patch = append(patch, patchOpClientCertificate) + + patchValueClientKey := + objToUpdate.Spec.ClientKey + patchOpClientKey := PatchOp{ + Op: "replace", + Path: "/spec/clientKey", + Value: patchValueClientKey, + } + patch = append(patch, patchOpClientKey) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalServicesRTs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalServicesRT{ + client: group.client, + ExternalServicesRT: result, + }, nil +} + +// ListExternalServicesRTs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalServicesRTs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalServicesRT, err error) { + key := "externalservicesrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalServicesRT, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalServicesRT) + result[k] = &GlobalExternalServicesRT{ + client: group.client, + ExternalServicesRT: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalServicesRTs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalServicesRT, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalServicesRT{ + client: group.client, + ExternalServicesRT: &item, + } + } + } + return +} + +type GlobalExternalServicesRT struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalServicesRT +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalServicesRT) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalServicesRTByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalServicesRT = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalServicesRT) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalServicesRTByName(ctx, obj.ExternalServicesRT) + if err != nil { + return err + } + obj.ExternalServicesRT = result.ExternalServicesRT + return nil +} + +func (obj *GlobalExternalServicesRT) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type externalservicesrtGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externalservicesrtGlobalTsmV1Chainer) Subscribe() { + key := "externalservicesrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalServicesRTInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externalservicesrtGlobalTsmV1Chainer) Unsubscribe() { + key := "externalservicesrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externalservicesrtGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externalservicesrts.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetFeatureFlagByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetFeatureFlagByName(ctx context.Context, hashedName string) (*GlobalFeatureFlag, error) { + key := "featureflags.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.FeatureFlag) + return &GlobalFeatureFlag{ + client: group.client, + FeatureFlag: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + FeatureFlags().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalFeatureFlag{ + client: group.client, + FeatureFlag: result, + }, nil + } +} + +// DeleteFeatureFlagByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteFeatureFlagByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + FeatureFlags().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + FeatureFlags().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/featureFlagsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateFeatureFlagByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateFeatureFlagByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.FeatureFlag) (*GlobalFeatureFlag, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + FeatureFlags().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"featureFlagsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"FeatureFlag\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalFeatureFlag{ + client: group.client, + FeatureFlag: result, + }, nil +} + +// UpdateFeatureFlagByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateFeatureFlagByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.FeatureFlag) (*GlobalFeatureFlag, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + FeatureFlags().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueEnable := + objToUpdate.Spec.Enable + patchOpEnable := PatchOp{ + Op: "replace", + Path: "/spec/enable", + Value: patchValueEnable, + } + patch = append(patch, patchOpEnable) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + FeatureFlags().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalFeatureFlag{ + client: group.client, + FeatureFlag: result, + }, nil +} + +// ListFeatureFlags returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListFeatureFlags(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalFeatureFlag, err error) { + key := "featureflags.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalFeatureFlag, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.FeatureFlag) + result[k] = &GlobalFeatureFlag{ + client: group.client, + FeatureFlag: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + FeatureFlags().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalFeatureFlag, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalFeatureFlag{ + client: group.client, + FeatureFlag: &item, + } + } + } + return +} + +type GlobalFeatureFlag struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.FeatureFlag +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalFeatureFlag) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteFeatureFlagByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.FeatureFlag = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalFeatureFlag) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateFeatureFlagByName(ctx, obj.FeatureFlag) + if err != nil { + return err + } + obj.FeatureFlag = result.FeatureFlag + return nil +} + +func (obj *GlobalFeatureFlag) GetParent(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetConfigByName(ctx, hashedName) +} + +type featureflagGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *featureflagGlobalTsmV1Chainer) Subscribe() { + key := "featureflags.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewFeatureFlagInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *featureflagGlobalTsmV1Chainer) Unsubscribe() { + key := "featureflags.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *featureflagGlobalTsmV1Chainer) IsSubscribed() bool { + key := "featureflags.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetGatewayConfigListenerCertificateByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGatewayConfigListenerCertificateByName(ctx context.Context, hashedName string) (*GlobalGatewayConfigListenerCertificate, error) { + key := "gatewayconfiglistenercertificates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate) + return &GlobalGatewayConfigListenerCertificate{ + client: group.client, + GatewayConfigListenerCertificate: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigListenerCertificates().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGatewayConfigListenerCertificate{ + client: group.client, + GatewayConfigListenerCertificate: result, + }, nil + } +} + +// DeleteGatewayConfigListenerCertificateByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGatewayConfigListenerCertificateByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigListenerCertificates().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + GatewayConfigListenerCertificates().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/certificateGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GatewayConfigAdditionalListenerses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGatewayConfigListenerCertificateByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGatewayConfigListenerCertificateByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate) (*GlobalGatewayConfigListenerCertificate, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigListenerCertificates().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/certificateGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "GatewayConfigListenerCertificate", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GatewayConfigAdditionalListenerses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGatewayConfigListenerCertificate{ + client: group.client, + GatewayConfigListenerCertificate: result, + }, nil +} + +// UpdateGatewayConfigListenerCertificateByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGatewayConfigListenerCertificateByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate) (*GlobalGatewayConfigListenerCertificate, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigListenerCertificates().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueEncryptedCertificate := + objToUpdate.Spec.EncryptedCertificate + patchOpEncryptedCertificate := PatchOp{ + Op: "replace", + Path: "/spec/encryptedCertificate", + Value: patchValueEncryptedCertificate, + } + patch = append(patch, patchOpEncryptedCertificate) + + patchValueEncryptedPrivateKey := + objToUpdate.Spec.EncryptedPrivateKey + patchOpEncryptedPrivateKey := PatchOp{ + Op: "replace", + Path: "/spec/encryptedPrivateKey", + Value: patchValueEncryptedPrivateKey, + } + patch = append(patch, patchOpEncryptedPrivateKey) + + patchValueEncryptedCertChain := + objToUpdate.Spec.EncryptedCertChain + patchOpEncryptedCertChain := PatchOp{ + Op: "replace", + Path: "/spec/encryptedCertChain", + Value: patchValueEncryptedCertChain, + } + patch = append(patch, patchOpEncryptedCertChain) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigListenerCertificates().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGatewayConfigListenerCertificate{ + client: group.client, + GatewayConfigListenerCertificate: result, + }, nil +} + +// ListGatewayConfigListenerCertificates returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGatewayConfigListenerCertificates(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGatewayConfigListenerCertificate, err error) { + key := "gatewayconfiglistenercertificates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGatewayConfigListenerCertificate, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate) + result[k] = &GlobalGatewayConfigListenerCertificate{ + client: group.client, + GatewayConfigListenerCertificate: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GatewayConfigListenerCertificates().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGatewayConfigListenerCertificate, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGatewayConfigListenerCertificate{ + client: group.client, + GatewayConfigListenerCertificate: &item, + } + } + } + return +} + +type GlobalGatewayConfigListenerCertificate struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGatewayConfigListenerCertificate) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGatewayConfigListenerCertificateByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GatewayConfigListenerCertificate = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGatewayConfigListenerCertificate) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGatewayConfigListenerCertificateByName(ctx, obj.GatewayConfigListenerCertificate) + if err != nil { + return err + } + obj.GatewayConfigListenerCertificate = result.GatewayConfigListenerCertificate + return nil +} + +func (obj *GlobalGatewayConfigListenerCertificate) GetParent(ctx context.Context) (result *GlobalGatewayConfigAdditionalListeners, err error) { + hashedName := helper.GetHashedName("gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGatewayConfigAdditionalListenersByName(ctx, hashedName) +} + +type gatewayconfiglistenercertificateGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gatewayconfiglistenercertificateGlobalTsmV1Chainer) Subscribe() { + key := "gatewayconfiglistenercertificates.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGatewayConfigListenerCertificateInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gatewayconfiglistenercertificateGlobalTsmV1Chainer) Unsubscribe() { + key := "gatewayconfiglistenercertificates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gatewayconfiglistenercertificateGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gatewayconfiglistenercertificates.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetGatewayConfigAdditionalListenersByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGatewayConfigAdditionalListenersByName(ctx context.Context, hashedName string) (*GlobalGatewayConfigAdditionalListeners, error) { + key := "gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners) + return &GlobalGatewayConfigAdditionalListeners{ + client: group.client, + GatewayConfigAdditionalListeners: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigAdditionalListenerses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGatewayConfigAdditionalListeners{ + client: group.client, + GatewayConfigAdditionalListeners: result, + }, nil + } +} + +// DeleteGatewayConfigAdditionalListenersByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGatewayConfigAdditionalListenersByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigAdditionalListenerses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + if result.Spec.CertificateGvk != nil { + err := group.client. + Global(). + DeleteGatewayConfigListenerCertificateByName(ctx, result.Spec.CertificateGvk.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ListenerRoutesGvk { + err := group.client. + Global().DeleteGatewayConfigListenerDestinationRouteByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + GatewayConfigAdditionalListenerses().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/additionalListenersGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gatewayconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gatewayconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GatewayConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGatewayConfigAdditionalListenersByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGatewayConfigAdditionalListenersByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners) (*GlobalGatewayConfigAdditionalListeners, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.CertificateGvk = nil + objToCreate.Spec.ListenerRoutesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigAdditionalListenerses().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gatewayconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gatewayconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"additionalListenersGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GatewayConfigAdditionalListeners\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GatewayConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGatewayConfigAdditionalListeners{ + client: group.client, + GatewayConfigAdditionalListeners: result, + }, nil +} + +// UpdateGatewayConfigAdditionalListenersByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGatewayConfigAdditionalListenersByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners) (*GlobalGatewayConfigAdditionalListeners, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigAdditionalListenerses().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValuePort := + objToUpdate.Spec.Port + patchOpPort := PatchOp{ + Op: "replace", + Path: "/spec/port", + Value: patchValuePort, + } + patch = append(patch, patchOpPort) + + patchValueProtocol := + objToUpdate.Spec.Protocol + patchOpProtocol := PatchOp{ + Op: "replace", + Path: "/spec/protocol", + Value: patchValueProtocol, + } + patch = append(patch, patchOpProtocol) + + patchValueTlsMode := + objToUpdate.Spec.TlsMode + patchOpTlsMode := PatchOp{ + Op: "replace", + Path: "/spec/tlsMode", + Value: patchValueTlsMode, + } + patch = append(patch, patchOpTlsMode) + + patchValueOwnedBy := + objToUpdate.Spec.OwnedBy + patchOpOwnedBy := PatchOp{ + Op: "replace", + Path: "/spec/ownedBy", + Value: patchValueOwnedBy, + } + patch = append(patch, patchOpOwnedBy) + + if objToUpdate.Spec.Hosts != nil { + patchValueHosts := + objToUpdate.Spec.Hosts + patchOpHosts := PatchOp{ + Op: "replace", + Path: "/spec/hosts", + Value: patchValueHosts, + } + patch = append(patch, patchOpHosts) + } + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigAdditionalListenerses().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGatewayConfigAdditionalListeners{ + client: group.client, + GatewayConfigAdditionalListeners: result, + }, nil +} + +// ListGatewayConfigAdditionalListenerses returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGatewayConfigAdditionalListenerses(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGatewayConfigAdditionalListeners, err error) { + key := "gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGatewayConfigAdditionalListeners, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners) + result[k] = &GlobalGatewayConfigAdditionalListeners{ + client: group.client, + GatewayConfigAdditionalListeners: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GatewayConfigAdditionalListenerses().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGatewayConfigAdditionalListeners, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGatewayConfigAdditionalListeners{ + client: group.client, + GatewayConfigAdditionalListeners: &item, + } + } + } + return +} + +type GlobalGatewayConfigAdditionalListeners struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGatewayConfigAdditionalListeners) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGatewayConfigAdditionalListenersByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GatewayConfigAdditionalListeners = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGatewayConfigAdditionalListeners) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGatewayConfigAdditionalListenersByName(ctx, obj.GatewayConfigAdditionalListeners) + if err != nil { + return err + } + obj.GatewayConfigAdditionalListeners = result.GatewayConfigAdditionalListeners + return nil +} + +func (obj *GlobalGatewayConfigAdditionalListeners) GetParent(ctx context.Context) (result *GlobalGatewayConfig, err error) { + hashedName := helper.GetHashedName("gatewayconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gatewayconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGatewayConfigByName(ctx, hashedName) +} + +// GetCertificate returns child of given type +func (obj *GlobalGatewayConfigAdditionalListeners) GetCertificate(ctx context.Context) ( + result *GlobalGatewayConfigListenerCertificate, err error) { + if obj.Spec.CertificateGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GatewayConfigAdditionalListeners", "Certificate") + } + return obj.client.Global().GetGatewayConfigListenerCertificateByName(ctx, obj.Spec.CertificateGvk.Name) +} + +// AddCertificate calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGatewayConfigAdditionalListeners) AddCertificate(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate) (result *GlobalGatewayConfigListenerCertificate, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGatewayConfigListenerCertificateByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGatewayConfigAdditionalListenersByName(ctx, obj.GetName()) + if getErr == nil { + obj.GatewayConfigAdditionalListeners = updatedObj.GatewayConfigAdditionalListeners + } + return +} + +// DeleteCertificate calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGatewayConfigAdditionalListeners) DeleteCertificate(ctx context.Context) (err error) { + if obj.Spec.CertificateGvk != nil { + err = obj.client. + Global().DeleteGatewayConfigListenerCertificateByName(ctx, obj.Spec.CertificateGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetGatewayConfigAdditionalListenersByName(ctx, obj.GetName()) + if err == nil { + obj.GatewayConfigAdditionalListeners = updatedObj.GatewayConfigAdditionalListeners + } + return +} + +// GetAllListenerRoutes returns all children of given type +func (obj *GlobalGatewayConfigAdditionalListeners) GetAllListenerRoutes(ctx context.Context) ( + result []*GlobalGatewayConfigListenerDestinationRoute, err error) { + result = make([]*GlobalGatewayConfigListenerDestinationRoute, 0, len(obj.Spec.ListenerRoutesGvk)) + for _, v := range obj.Spec.ListenerRoutesGvk { + l, err := obj.client.Global().GetGatewayConfigListenerDestinationRouteByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetListenerRoutes returns child which has given displayName +func (obj *GlobalGatewayConfigAdditionalListeners) GetListenerRoutes(ctx context.Context, + displayName string) (result *GlobalGatewayConfigListenerDestinationRoute, err error) { + l, ok := obj.Spec.ListenerRoutesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GatewayConfigAdditionalListeners", "ListenerRoutes", displayName) + } + result, err = obj.client.Global().GetGatewayConfigListenerDestinationRouteByName(ctx, l.Name) + return +} + +// AddListenerRoutes calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGatewayConfigAdditionalListeners) AddListenerRoutes(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute) (result *GlobalGatewayConfigListenerDestinationRoute, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGatewayConfigListenerDestinationRouteByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGatewayConfigAdditionalListenersByName(ctx, obj.GetName()) + if getErr == nil { + obj.GatewayConfigAdditionalListeners = updatedObj.GatewayConfigAdditionalListeners + } + return +} + +// DeleteListenerRoutes calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGatewayConfigAdditionalListeners) DeleteListenerRoutes(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ListenerRoutesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GatewayConfigAdditionalListeners", "ListenerRoutes", displayName) + } + err = obj.client.Global().DeleteGatewayConfigListenerDestinationRouteByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGatewayConfigAdditionalListenersByName(ctx, obj.GetName()) + if err == nil { + obj.GatewayConfigAdditionalListeners = updatedObj.GatewayConfigAdditionalListeners + } + return +} + +type gatewayconfigadditionallistenersGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gatewayconfigadditionallistenersGlobalTsmV1Chainer) Subscribe() { + key := "gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGatewayConfigAdditionalListenersInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gatewayconfigadditionallistenersGlobalTsmV1Chainer) Unsubscribe() { + key := "gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gatewayconfigadditionallistenersGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *gatewayconfigadditionallistenersGlobalTsmV1Chainer) Certificate(name string) *gatewayconfiglistenercertificateGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gatewayconfiglistenercertificates.global.tsm.tanzu.vmware.com"] = name + return &gatewayconfiglistenercertificateGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetCertificate calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gatewayconfigadditionallistenersGlobalTsmV1Chainer) GetCertificate(ctx context.Context, displayName string) (result *GlobalGatewayConfigListenerCertificate, err error) { + hashedName := helper.GetHashedName("gatewayconfiglistenercertificates.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGatewayConfigListenerCertificateByName(ctx, hashedName) +} + +// AddCertificate calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gatewayconfigadditionallistenersGlobalTsmV1Chainer) AddCertificate(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GatewayConfigListenerCertificate) (result *GlobalGatewayConfigListenerCertificate, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gatewayconfiglistenercertificates.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGatewayConfigListenerCertificateByName(ctx, objToCreate) +} + +// DeleteCertificate calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gatewayconfigadditionallistenersGlobalTsmV1Chainer) DeleteCertificate(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gatewayconfiglistenercertificates.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGatewayConfigListenerCertificateByName(ctx, hashedName) +} + +func (c *gatewayconfigadditionallistenersGlobalTsmV1Chainer) ListenerRoutes(name string) *gatewayconfiglistenerdestinationrouteGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gatewayconfiglistenerdestinationroutes.global.tsm.tanzu.vmware.com"] = name + return &gatewayconfiglistenerdestinationrouteGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetListenerRoutes calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gatewayconfigadditionallistenersGlobalTsmV1Chainer) GetListenerRoutes(ctx context.Context, displayName string) (result *GlobalGatewayConfigListenerDestinationRoute, err error) { + hashedName := helper.GetHashedName("gatewayconfiglistenerdestinationroutes.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGatewayConfigListenerDestinationRouteByName(ctx, hashedName) +} + +// AddListenerRoutes calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gatewayconfigadditionallistenersGlobalTsmV1Chainer) AddListenerRoutes(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute) (result *GlobalGatewayConfigListenerDestinationRoute, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gatewayconfiglistenerdestinationroutes.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGatewayConfigListenerDestinationRouteByName(ctx, objToCreate) +} + +// DeleteListenerRoutes calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gatewayconfigadditionallistenersGlobalTsmV1Chainer) DeleteListenerRoutes(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gatewayconfiglistenerdestinationroutes.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGatewayConfigListenerDestinationRouteByName(ctx, hashedName) +} + +// GetGatewayConfigListenerDestinationRouteByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGatewayConfigListenerDestinationRouteByName(ctx context.Context, hashedName string) (*GlobalGatewayConfigListenerDestinationRoute, error) { + key := "gatewayconfiglistenerdestinationroutes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute) + return &GlobalGatewayConfigListenerDestinationRoute{ + client: group.client, + GatewayConfigListenerDestinationRoute: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigListenerDestinationRoutes().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGatewayConfigListenerDestinationRoute{ + client: group.client, + GatewayConfigListenerDestinationRoute: result, + }, nil + } +} + +// DeleteGatewayConfigListenerDestinationRouteByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGatewayConfigListenerDestinationRouteByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigListenerDestinationRoutes().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + GatewayConfigListenerDestinationRoutes().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/listenerRoutesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GatewayConfigAdditionalListenerses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGatewayConfigListenerDestinationRouteByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGatewayConfigListenerDestinationRouteByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute) (*GlobalGatewayConfigListenerDestinationRoute, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigListenerDestinationRoutes().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"listenerRoutesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GatewayConfigListenerDestinationRoute\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GatewayConfigAdditionalListenerses().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGatewayConfigListenerDestinationRoute{ + client: group.client, + GatewayConfigListenerDestinationRoute: result, + }, nil +} + +// UpdateGatewayConfigListenerDestinationRouteByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGatewayConfigListenerDestinationRouteByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute) (*GlobalGatewayConfigListenerDestinationRoute, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigListenerDestinationRoutes().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueHost := + objToUpdate.Spec.Host + patchOpHost := PatchOp{ + Op: "replace", + Path: "/spec/host", + Value: patchValueHost, + } + patch = append(patch, patchOpHost) + + patchValueTarget := + objToUpdate.Spec.Target + patchOpTarget := PatchOp{ + Op: "replace", + Path: "/spec/target", + Value: patchValueTarget, + } + patch = append(patch, patchOpTarget) + + if objToUpdate.Spec.Paths != nil { + patchValuePaths := + objToUpdate.Spec.Paths + patchOpPaths := PatchOp{ + Op: "replace", + Path: "/spec/paths", + Value: patchValuePaths, + } + patch = append(patch, patchOpPaths) + } + + patchValuePort := + objToUpdate.Spec.Port + patchOpPort := PatchOp{ + Op: "replace", + Path: "/spec/port", + Value: patchValuePort, + } + patch = append(patch, patchOpPort) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigListenerDestinationRoutes().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGatewayConfigListenerDestinationRoute{ + client: group.client, + GatewayConfigListenerDestinationRoute: result, + }, nil +} + +// ListGatewayConfigListenerDestinationRoutes returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGatewayConfigListenerDestinationRoutes(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGatewayConfigListenerDestinationRoute, err error) { + key := "gatewayconfiglistenerdestinationroutes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGatewayConfigListenerDestinationRoute, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute) + result[k] = &GlobalGatewayConfigListenerDestinationRoute{ + client: group.client, + GatewayConfigListenerDestinationRoute: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GatewayConfigListenerDestinationRoutes().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGatewayConfigListenerDestinationRoute, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGatewayConfigListenerDestinationRoute{ + client: group.client, + GatewayConfigListenerDestinationRoute: &item, + } + } + } + return +} + +type GlobalGatewayConfigListenerDestinationRoute struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GatewayConfigListenerDestinationRoute +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGatewayConfigListenerDestinationRoute) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGatewayConfigListenerDestinationRouteByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GatewayConfigListenerDestinationRoute = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGatewayConfigListenerDestinationRoute) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGatewayConfigListenerDestinationRouteByName(ctx, obj.GatewayConfigListenerDestinationRoute) + if err != nil { + return err + } + obj.GatewayConfigListenerDestinationRoute = result.GatewayConfigListenerDestinationRoute + return nil +} + +func (obj *GlobalGatewayConfigListenerDestinationRoute) GetParent(ctx context.Context) (result *GlobalGatewayConfigAdditionalListeners, err error) { + hashedName := helper.GetHashedName("gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGatewayConfigAdditionalListenersByName(ctx, hashedName) +} + +type gatewayconfiglistenerdestinationrouteGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gatewayconfiglistenerdestinationrouteGlobalTsmV1Chainer) Subscribe() { + key := "gatewayconfiglistenerdestinationroutes.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGatewayConfigListenerDestinationRouteInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gatewayconfiglistenerdestinationrouteGlobalTsmV1Chainer) Unsubscribe() { + key := "gatewayconfiglistenerdestinationroutes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gatewayconfiglistenerdestinationrouteGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gatewayconfiglistenerdestinationroutes.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetGatewayConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGatewayConfigByName(ctx context.Context, hashedName string) (*GlobalGatewayConfig, error) { + key := "gatewayconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GatewayConfig) + return &GlobalGatewayConfig{ + client: group.client, + GatewayConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGatewayConfig{ + client: group.client, + GatewayConfig: result, + }, nil + } +} + +// DeleteGatewayConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGatewayConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.AdditionalListenersGvk { + err := group.client. + Global().DeleteGatewayConfigAdditionalListenersByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + GatewayConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/gatewayConfigGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGatewayConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGatewayConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GatewayConfig) (*GlobalGatewayConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.AdditionalListenersGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"gatewayConfigGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GatewayConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGatewayConfig{ + client: group.client, + GatewayConfig: result, + }, nil +} + +// UpdateGatewayConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGatewayConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GatewayConfig) (*GlobalGatewayConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueOwnedBy := + objToUpdate.Spec.OwnedBy + patchOpOwnedBy := PatchOp{ + Op: "replace", + Path: "/spec/ownedBy", + Value: patchValueOwnedBy, + } + patch = append(patch, patchOpOwnedBy) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueListeners := + objToUpdate.Spec.Listeners + patchOpListeners := PatchOp{ + Op: "replace", + Path: "/spec/listeners", + Value: patchValueListeners, + } + patch = append(patch, patchOpListeners) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GatewayConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGatewayConfig{ + client: group.client, + GatewayConfig: result, + }, nil +} + +// ListGatewayConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGatewayConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGatewayConfig, err error) { + key := "gatewayconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGatewayConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GatewayConfig) + result[k] = &GlobalGatewayConfig{ + client: group.client, + GatewayConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GatewayConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGatewayConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGatewayConfig{ + client: group.client, + GatewayConfig: &item, + } + } + } + return +} + +type GlobalGatewayConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GatewayConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGatewayConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGatewayConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GatewayConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGatewayConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGatewayConfigByName(ctx, obj.GatewayConfig) + if err != nil { + return err + } + obj.GatewayConfig = result.GatewayConfig + return nil +} + +func (obj *GlobalGatewayConfig) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +// GetAllAdditionalListeners returns all children of given type +func (obj *GlobalGatewayConfig) GetAllAdditionalListeners(ctx context.Context) ( + result []*GlobalGatewayConfigAdditionalListeners, err error) { + result = make([]*GlobalGatewayConfigAdditionalListeners, 0, len(obj.Spec.AdditionalListenersGvk)) + for _, v := range obj.Spec.AdditionalListenersGvk { + l, err := obj.client.Global().GetGatewayConfigAdditionalListenersByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetAdditionalListeners returns child which has given displayName +func (obj *GlobalGatewayConfig) GetAdditionalListeners(ctx context.Context, + displayName string) (result *GlobalGatewayConfigAdditionalListeners, err error) { + l, ok := obj.Spec.AdditionalListenersGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GatewayConfig", "AdditionalListeners", displayName) + } + result, err = obj.client.Global().GetGatewayConfigAdditionalListenersByName(ctx, l.Name) + return +} + +// AddAdditionalListeners calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGatewayConfig) AddAdditionalListeners(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners) (result *GlobalGatewayConfigAdditionalListeners, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gatewayconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gatewayconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGatewayConfigAdditionalListenersByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGatewayConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.GatewayConfig = updatedObj.GatewayConfig + } + return +} + +// DeleteAdditionalListeners calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGatewayConfig) DeleteAdditionalListeners(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.AdditionalListenersGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GatewayConfig", "AdditionalListeners", displayName) + } + err = obj.client.Global().DeleteGatewayConfigAdditionalListenersByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGatewayConfigByName(ctx, obj.GetName()) + if err == nil { + obj.GatewayConfig = updatedObj.GatewayConfig + } + return +} + +type gatewayconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gatewayconfigGlobalTsmV1Chainer) Subscribe() { + key := "gatewayconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGatewayConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gatewayconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "gatewayconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gatewayconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gatewayconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *gatewayconfigGlobalTsmV1Chainer) AdditionalListeners(name string) *gatewayconfigadditionallistenersGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com"] = name + return &gatewayconfigadditionallistenersGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetAdditionalListeners calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gatewayconfigGlobalTsmV1Chainer) GetAdditionalListeners(ctx context.Context, displayName string) (result *GlobalGatewayConfigAdditionalListeners, err error) { + hashedName := helper.GetHashedName("gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGatewayConfigAdditionalListenersByName(ctx, hashedName) +} + +// AddAdditionalListeners calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gatewayconfigGlobalTsmV1Chainer) AddAdditionalListeners(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GatewayConfigAdditionalListeners) (result *GlobalGatewayConfigAdditionalListeners, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGatewayConfigAdditionalListenersByName(ctx, objToCreate) +} + +// DeleteAdditionalListeners calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gatewayconfigGlobalTsmV1Chainer) DeleteAdditionalListeners(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGatewayConfigAdditionalListenersByName(ctx, hashedName) +} + +// GetGatewayByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGatewayByName(ctx context.Context, hashedName string) (*GlobalGateway, error) { + key := "gateways.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Gateway) + return &GlobalGateway{ + client: group.client, + Gateway: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Gateways().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGateway{ + client: group.client, + Gateway: result, + }, nil + } +} + +// DeleteGatewayByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGatewayByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Gateways().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + Gateways().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/gatewaysGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGatewayByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGatewayByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Gateway) (*GlobalGateway, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ServicesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + Gateways().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"gatewaysGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"Gateway\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGateway{ + client: group.client, + Gateway: result, + }, nil +} + +// UpdateGatewayByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGatewayByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Gateway) (*GlobalGateway, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Gateways().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueAnnotations := + objToUpdate.Spec.Annotations + patchOpAnnotations := PatchOp{ + Op: "replace", + Path: "/spec/annotations", + Value: patchValueAnnotations, + } + patch = append(patch, patchOpAnnotations) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Gateways().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGateway{ + client: group.client, + Gateway: result, + }, nil +} + +// ListGateways returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGateways(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGateway, err error) { + key := "gateways.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGateway, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Gateway) + result[k] = &GlobalGateway{ + client: group.client, + Gateway: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Gateways().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGateway, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGateway{ + client: group.client, + Gateway: &item, + } + } + } + return +} + +type GlobalGateway struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Gateway +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGateway) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGatewayByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Gateway = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGateway) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGatewayByName(ctx, obj.Gateway) + if err != nil { + return err + } + obj.Gateway = result.Gateway + return nil +} + +func (obj *GlobalGateway) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +// GetAllServices returns all links of given type +func (obj *GlobalGateway) GetAllServices(ctx context.Context) ( + result []*GlobalService, err error) { + result = make([]*GlobalService, 0, len(obj.Spec.ServicesGvk)) + for _, v := range obj.Spec.ServicesGvk { + l, err := obj.client.Global().GetServiceByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServices returns link which has given displayName +func (obj *GlobalGateway) GetServices(ctx context.Context, + displayName string) (result *GlobalService, err error) { + l, ok := obj.Spec.ServicesGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.Gateway", "Services", displayName) + } + result, err = obj.client.Global().GetServiceByName(ctx, l.Name) + return +} + +// LinkServices links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalGateway) LinkServices(ctx context.Context, + linkToAdd *GlobalService) error { + + payload := "{\"spec\": {\"servicesGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"Service\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().Gateways().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.Gateway = result + return nil +} + +// UnlinkServices unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalGateway) UnlinkServices(ctx context.Context, + linkToRemove *GlobalService) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/servicesGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Gateways().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.Gateway = result + return nil + +} + +type gatewayGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gatewayGlobalTsmV1Chainer) Subscribe() { + key := "gateways.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGatewayInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gatewayGlobalTsmV1Chainer) Unsubscribe() { + key := "gateways.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gatewayGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gateways.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetGeoDiscoveryRTByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGeoDiscoveryRTByName(ctx context.Context, hashedName string) (*GlobalGeoDiscoveryRT, error) { + key := "geodiscoveryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GeoDiscoveryRT) + return &GlobalGeoDiscoveryRT{ + client: group.client, + GeoDiscoveryRT: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GeoDiscoveryRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGeoDiscoveryRT{ + client: group.client, + GeoDiscoveryRT: result, + }, nil + } +} + +// DeleteGeoDiscoveryRTByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGeoDiscoveryRTByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GeoDiscoveryRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + GeoDiscoveryRTs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/geoDiscoveryGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGeoDiscoveryRTByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGeoDiscoveryRTByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GeoDiscoveryRT) (*GlobalGeoDiscoveryRT, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + GeoDiscoveryRTs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"geoDiscoveryGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GeoDiscoveryRT\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGeoDiscoveryRT{ + client: group.client, + GeoDiscoveryRT: result, + }, nil +} + +// UpdateGeoDiscoveryRTByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGeoDiscoveryRTByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GeoDiscoveryRT) (*GlobalGeoDiscoveryRT, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GeoDiscoveryRTs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueGnsid := + objToUpdate.Spec.Gnsid + patchOpGnsid := PatchOp{ + Op: "replace", + Path: "/spec/gnsid", + Value: patchValueGnsid, + } + patch = append(patch, patchOpGnsid) + + patchValueSelectors := + objToUpdate.Spec.Selectors + patchOpSelectors := PatchOp{ + Op: "replace", + Path: "/spec/selectors", + Value: patchValueSelectors, + } + patch = append(patch, patchOpSelectors) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GeoDiscoveryRTs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGeoDiscoveryRT{ + client: group.client, + GeoDiscoveryRT: result, + }, nil +} + +// ListGeoDiscoveryRTs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGeoDiscoveryRTs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGeoDiscoveryRT, err error) { + key := "geodiscoveryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGeoDiscoveryRT, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GeoDiscoveryRT) + result[k] = &GlobalGeoDiscoveryRT{ + client: group.client, + GeoDiscoveryRT: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GeoDiscoveryRTs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGeoDiscoveryRT, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGeoDiscoveryRT{ + client: group.client, + GeoDiscoveryRT: &item, + } + } + } + return +} + +type GlobalGeoDiscoveryRT struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GeoDiscoveryRT +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGeoDiscoveryRT) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGeoDiscoveryRTByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GeoDiscoveryRT = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGeoDiscoveryRT) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGeoDiscoveryRTByName(ctx, obj.GeoDiscoveryRT) + if err != nil { + return err + } + obj.GeoDiscoveryRT = result.GeoDiscoveryRT + return nil +} + +func (obj *GlobalGeoDiscoveryRT) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type geodiscoveryrtGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *geodiscoveryrtGlobalTsmV1Chainer) Subscribe() { + key := "geodiscoveryrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGeoDiscoveryRTInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *geodiscoveryrtGlobalTsmV1Chainer) Unsubscribe() { + key := "geodiscoveryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *geodiscoveryrtGlobalTsmV1Chainer) IsSubscribed() bool { + key := "geodiscoveryrts.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetGeoDiscoveryByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGeoDiscoveryByName(ctx context.Context, hashedName string) (*GlobalGeoDiscovery, error) { + key := "geodiscoveries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GeoDiscovery) + return &GlobalGeoDiscovery{ + client: group.client, + GeoDiscovery: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GeoDiscoveries().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGeoDiscovery{ + client: group.client, + GeoDiscovery: result, + }, nil + } +} + +// DeleteGeoDiscoveryByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGeoDiscoveryByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GeoDiscoveries().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + GeoDiscoveries().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/geoDiscoveryGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGeoDiscoveryByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGeoDiscoveryByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GeoDiscovery) (*GlobalGeoDiscovery, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + GeoDiscoveries().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"geoDiscoveryGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GeoDiscovery\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGeoDiscovery{ + client: group.client, + GeoDiscovery: result, + }, nil +} + +// UpdateGeoDiscoveryByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGeoDiscoveryByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GeoDiscovery) (*GlobalGeoDiscovery, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GeoDiscoveries().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GeoDiscoveries().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGeoDiscovery{ + client: group.client, + GeoDiscovery: result, + }, nil +} + +// ListGeoDiscoveries returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGeoDiscoveries(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGeoDiscovery, err error) { + key := "geodiscoveries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGeoDiscovery, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GeoDiscovery) + result[k] = &GlobalGeoDiscovery{ + client: group.client, + GeoDiscovery: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GeoDiscoveries().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGeoDiscovery, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGeoDiscovery{ + client: group.client, + GeoDiscovery: &item, + } + } + } + return +} + +type GlobalGeoDiscovery struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GeoDiscovery +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGeoDiscovery) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGeoDiscoveryByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GeoDiscovery = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGeoDiscovery) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGeoDiscoveryByName(ctx, obj.GeoDiscovery) + if err != nil { + return err + } + obj.GeoDiscovery = result.GeoDiscovery + return nil +} + +func (obj *GlobalGeoDiscovery) GetParent(ctx context.Context) (result *GlobalGNS, err error) { + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnss.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGNSByName(ctx, hashedName) +} + +type geodiscoveryGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *geodiscoveryGlobalTsmV1Chainer) Subscribe() { + key := "geodiscoveries.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGeoDiscoveryInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *geodiscoveryGlobalTsmV1Chainer) Unsubscribe() { + key := "geodiscoveries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *geodiscoveryGlobalTsmV1Chainer) IsSubscribed() bool { + key := "geodiscoveries.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetGlobalNsByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGlobalNsByName(ctx context.Context, hashedName string) (*GlobalGlobalNs, error) { + key := "globalnses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GlobalNs) + return &GlobalGlobalNs{ + client: group.client, + GlobalNs: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GlobalNses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGlobalNs{ + client: group.client, + GlobalNs: result, + }, nil + } +} + +// DeleteGlobalNsByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGlobalNsByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GlobalNses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.RoutingPoliciesGvk { + err := group.client. + Global().DeleteRPolicyByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + GlobalNses().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/gnsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["awsconnectors.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("awsconnectors.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + AwsConnectors().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGlobalNsByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGlobalNsByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GlobalNs) (*GlobalGlobalNs, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.RoutingPoliciesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + GlobalNses().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["awsconnectors.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("awsconnectors.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"gnsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GlobalNs\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + AwsConnectors().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGlobalNs{ + client: group.client, + GlobalNs: result, + }, nil +} + +// UpdateGlobalNsByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGlobalNsByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GlobalNs) (*GlobalGlobalNs, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GlobalNses().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueGnsName := + objToUpdate.Spec.GnsName + patchOpGnsName := PatchOp{ + Op: "replace", + Path: "/spec/gnsName", + Value: patchValueGnsName, + } + patch = append(patch, patchOpGnsName) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GlobalNses().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGlobalNs{ + client: group.client, + GlobalNs: result, + }, nil +} + +// ListGlobalNses returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGlobalNses(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGlobalNs, err error) { + key := "globalnses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGlobalNs, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GlobalNs) + result[k] = &GlobalGlobalNs{ + client: group.client, + GlobalNs: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GlobalNses().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGlobalNs, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGlobalNs{ + client: group.client, + GlobalNs: &item, + } + } + } + return +} + +type GlobalGlobalNs struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GlobalNs +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGlobalNs) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGlobalNsByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GlobalNs = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGlobalNs) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGlobalNsByName(ctx, obj.GlobalNs) + if err != nil { + return err + } + obj.GlobalNs = result.GlobalNs + return nil +} + +func (obj *GlobalGlobalNs) GetParent(ctx context.Context) (result *GlobalAwsConnector, err error) { + hashedName := helper.GetHashedName("awsconnectors.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["awsconnectors.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetAwsConnectorByName(ctx, hashedName) +} + +// GetAllRoutingPolicies returns all children of given type +func (obj *GlobalGlobalNs) GetAllRoutingPolicies(ctx context.Context) ( + result []*GlobalRPolicy, err error) { + result = make([]*GlobalRPolicy, 0, len(obj.Spec.RoutingPoliciesGvk)) + for _, v := range obj.Spec.RoutingPoliciesGvk { + l, err := obj.client.Global().GetRPolicyByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetRoutingPolicies returns child which has given displayName +func (obj *GlobalGlobalNs) GetRoutingPolicies(ctx context.Context, + displayName string) (result *GlobalRPolicy, err error) { + l, ok := obj.Spec.RoutingPoliciesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GlobalNs", "RoutingPolicies", displayName) + } + result, err = obj.client.Global().GetRPolicyByName(ctx, l.Name) + return +} + +// AddRoutingPolicies calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGlobalNs) AddRoutingPolicies(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.RPolicy) (result *GlobalRPolicy, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["globalnses.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["globalnses.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateRPolicyByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGlobalNsByName(ctx, obj.GetName()) + if getErr == nil { + obj.GlobalNs = updatedObj.GlobalNs + } + return +} + +// DeleteRoutingPolicies calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGlobalNs) DeleteRoutingPolicies(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.RoutingPoliciesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GlobalNs", "RoutingPolicies", displayName) + } + err = obj.client.Global().DeleteRPolicyByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGlobalNsByName(ctx, obj.GetName()) + if err == nil { + obj.GlobalNs = updatedObj.GlobalNs + } + return +} + +type globalnsGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *globalnsGlobalTsmV1Chainer) Subscribe() { + key := "globalnses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGlobalNsInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *globalnsGlobalTsmV1Chainer) Unsubscribe() { + key := "globalnses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *globalnsGlobalTsmV1Chainer) IsSubscribed() bool { + key := "globalnses.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *globalnsGlobalTsmV1Chainer) RoutingPolicies(name string) *rpolicyGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["rpolicies.global.tsm.tanzu.vmware.com"] = name + return &rpolicyGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetRoutingPolicies calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *globalnsGlobalTsmV1Chainer) GetRoutingPolicies(ctx context.Context, displayName string) (result *GlobalRPolicy, err error) { + hashedName := helper.GetHashedName("rpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetRPolicyByName(ctx, hashedName) +} + +// AddRoutingPolicies calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *globalnsGlobalTsmV1Chainer) AddRoutingPolicies(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.RPolicy) (result *GlobalRPolicy, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("rpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateRPolicyByName(ctx, objToCreate) +} + +// DeleteRoutingPolicies calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *globalnsGlobalTsmV1Chainer) DeleteRoutingPolicies(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("rpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteRPolicyByName(ctx, hashedName) +} + +// GetGlobalRegistrationServiceByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGlobalRegistrationServiceByName(ctx context.Context, hashedName string) (*GlobalGlobalRegistrationService, error) { + key := "globalregistrationservices.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GlobalRegistrationService) + return &GlobalGlobalRegistrationService{ + client: group.client, + GlobalRegistrationService: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GlobalRegistrationServices().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGlobalRegistrationService{ + client: group.client, + GlobalRegistrationService: result, + }, nil + } +} + +// DeleteGlobalRegistrationServiceByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGlobalRegistrationServiceByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GlobalRegistrationServices().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.TenantsGvk { + err := group.client. + Global().DeleteTenantByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.TenantTokenGvk { + err := group.client. + Global().DeleteTenantTokenByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + GlobalRegistrationServices().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/globalRegistrationServiceGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["allsparkserviceses.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("allsparkserviceses.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + AllSparkServiceses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGlobalRegistrationServiceByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGlobalRegistrationServiceByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GlobalRegistrationService) (*GlobalGlobalRegistrationService, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.TenantsGvk = nil + objToCreate.Spec.TenantTokenGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + GlobalRegistrationServices().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["allsparkserviceses.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("allsparkserviceses.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/globalRegistrationServiceGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "GlobalRegistrationService", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + AllSparkServiceses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGlobalRegistrationService{ + client: group.client, + GlobalRegistrationService: result, + }, nil +} + +// UpdateGlobalRegistrationServiceByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGlobalRegistrationServiceByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GlobalRegistrationService) (*GlobalGlobalRegistrationService, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GlobalRegistrationServices().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueBuildID := + objToUpdate.Spec.BuildID + patchOpBuildID := PatchOp{ + Op: "replace", + Path: "/spec/buildID", + Value: patchValueBuildID, + } + patch = append(patch, patchOpBuildID) + + patchValueVersion := + objToUpdate.Spec.Version + patchOpVersion := PatchOp{ + Op: "replace", + Path: "/spec/version", + Value: patchValueVersion, + } + patch = append(patch, patchOpVersion) + + patchValueErrorCount := + objToUpdate.Spec.ErrorCount + patchOpErrorCount := PatchOp{ + Op: "replace", + Path: "/spec/errorCount", + Value: patchValueErrorCount, + } + patch = append(patch, patchOpErrorCount) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GlobalRegistrationServices().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGlobalRegistrationService{ + client: group.client, + GlobalRegistrationService: result, + }, nil +} + +// ListGlobalRegistrationServices returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGlobalRegistrationServices(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGlobalRegistrationService, err error) { + key := "globalregistrationservices.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGlobalRegistrationService, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GlobalRegistrationService) + result[k] = &GlobalGlobalRegistrationService{ + client: group.client, + GlobalRegistrationService: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GlobalRegistrationServices().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGlobalRegistrationService, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGlobalRegistrationService{ + client: group.client, + GlobalRegistrationService: &item, + } + } + } + return +} + +type GlobalGlobalRegistrationService struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GlobalRegistrationService +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGlobalRegistrationService) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGlobalRegistrationServiceByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GlobalRegistrationService = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGlobalRegistrationService) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGlobalRegistrationServiceByName(ctx, obj.GlobalRegistrationService) + if err != nil { + return err + } + obj.GlobalRegistrationService = result.GlobalRegistrationService + return nil +} + +func (obj *GlobalGlobalRegistrationService) GetParent(ctx context.Context) (result *GlobalAllSparkServices, err error) { + hashedName := helper.GetHashedName("allsparkserviceses.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["allsparkserviceses.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetAllSparkServicesByName(ctx, hashedName) +} + +// GetAllTenants returns all children of given type +func (obj *GlobalGlobalRegistrationService) GetAllTenants(ctx context.Context) ( + result []*GlobalTenant, err error) { + result = make([]*GlobalTenant, 0, len(obj.Spec.TenantsGvk)) + for _, v := range obj.Spec.TenantsGvk { + l, err := obj.client.Global().GetTenantByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetTenants returns child which has given displayName +func (obj *GlobalGlobalRegistrationService) GetTenants(ctx context.Context, + displayName string) (result *GlobalTenant, err error) { + l, ok := obj.Spec.TenantsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GlobalRegistrationService", "Tenants", displayName) + } + result, err = obj.client.Global().GetTenantByName(ctx, l.Name) + return +} + +// AddTenants calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGlobalRegistrationService) AddTenants(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Tenant) (result *GlobalTenant, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["globalregistrationservices.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["globalregistrationservices.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateTenantByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGlobalRegistrationServiceByName(ctx, obj.GetName()) + if getErr == nil { + obj.GlobalRegistrationService = updatedObj.GlobalRegistrationService + } + return +} + +// DeleteTenants calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGlobalRegistrationService) DeleteTenants(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.TenantsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GlobalRegistrationService", "Tenants", displayName) + } + err = obj.client.Global().DeleteTenantByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGlobalRegistrationServiceByName(ctx, obj.GetName()) + if err == nil { + obj.GlobalRegistrationService = updatedObj.GlobalRegistrationService + } + return +} + +// GetAllTenantToken returns all children of given type +func (obj *GlobalGlobalRegistrationService) GetAllTenantToken(ctx context.Context) ( + result []*GlobalTenantToken, err error) { + result = make([]*GlobalTenantToken, 0, len(obj.Spec.TenantTokenGvk)) + for _, v := range obj.Spec.TenantTokenGvk { + l, err := obj.client.Global().GetTenantTokenByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetTenantToken returns child which has given displayName +func (obj *GlobalGlobalRegistrationService) GetTenantToken(ctx context.Context, + displayName string) (result *GlobalTenantToken, err error) { + l, ok := obj.Spec.TenantTokenGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GlobalRegistrationService", "TenantToken", displayName) + } + result, err = obj.client.Global().GetTenantTokenByName(ctx, l.Name) + return +} + +// AddTenantToken calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGlobalRegistrationService) AddTenantToken(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.TenantToken) (result *GlobalTenantToken, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["globalregistrationservices.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["globalregistrationservices.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateTenantTokenByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGlobalRegistrationServiceByName(ctx, obj.GetName()) + if getErr == nil { + obj.GlobalRegistrationService = updatedObj.GlobalRegistrationService + } + return +} + +// DeleteTenantToken calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGlobalRegistrationService) DeleteTenantToken(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.TenantTokenGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GlobalRegistrationService", "TenantToken", displayName) + } + err = obj.client.Global().DeleteTenantTokenByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGlobalRegistrationServiceByName(ctx, obj.GetName()) + if err == nil { + obj.GlobalRegistrationService = updatedObj.GlobalRegistrationService + } + return +} + +type globalregistrationserviceGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *globalregistrationserviceGlobalTsmV1Chainer) Subscribe() { + key := "globalregistrationservices.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGlobalRegistrationServiceInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *globalregistrationserviceGlobalTsmV1Chainer) Unsubscribe() { + key := "globalregistrationservices.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *globalregistrationserviceGlobalTsmV1Chainer) IsSubscribed() bool { + key := "globalregistrationservices.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *globalregistrationserviceGlobalTsmV1Chainer) Tenants(name string) *tenantGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["tenants.global.tsm.tanzu.vmware.com"] = name + return &tenantGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetTenants calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *globalregistrationserviceGlobalTsmV1Chainer) GetTenants(ctx context.Context, displayName string) (result *GlobalTenant, err error) { + hashedName := helper.GetHashedName("tenants.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetTenantByName(ctx, hashedName) +} + +// AddTenants calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *globalregistrationserviceGlobalTsmV1Chainer) AddTenants(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Tenant) (result *GlobalTenant, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("tenants.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateTenantByName(ctx, objToCreate) +} + +// DeleteTenants calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *globalregistrationserviceGlobalTsmV1Chainer) DeleteTenants(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("tenants.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteTenantByName(ctx, hashedName) +} + +func (c *globalregistrationserviceGlobalTsmV1Chainer) TenantToken(name string) *tenanttokenGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["tenanttokens.global.tsm.tanzu.vmware.com"] = name + return &tenanttokenGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetTenantToken calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *globalregistrationserviceGlobalTsmV1Chainer) GetTenantToken(ctx context.Context, displayName string) (result *GlobalTenantToken, err error) { + hashedName := helper.GetHashedName("tenanttokens.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetTenantTokenByName(ctx, hashedName) +} + +// AddTenantToken calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *globalregistrationserviceGlobalTsmV1Chainer) AddTenantToken(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.TenantToken) (result *GlobalTenantToken, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("tenanttokens.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateTenantTokenByName(ctx, objToCreate) +} + +// DeleteTenantToken calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *globalregistrationserviceGlobalTsmV1Chainer) DeleteTenantToken(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("tenanttokens.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteTenantTokenByName(ctx, hashedName) +} + +// GetGlobalNamespaceByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGlobalNamespaceByName(ctx context.Context, hashedName string) (*GlobalGlobalNamespace, error) { + key := "globalnamespaces.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GlobalNamespace) + return &GlobalGlobalNamespace{ + client: group.client, + GlobalNamespace: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GlobalNamespaces().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGlobalNamespace{ + client: group.client, + GlobalNamespace: result, + }, nil + } +} + +// DeleteGlobalNamespaceByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGlobalNamespaceByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GlobalNamespaces().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.GnsGvk { + err := group.client. + Global().DeleteGNSByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + GlobalNamespaces().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/globalNamespaceGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGlobalNamespaceByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGlobalNamespaceByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GlobalNamespace) (*GlobalGlobalNamespace, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.GnsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + GlobalNamespaces().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/globalNamespaceGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "GlobalNamespace", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGlobalNamespace{ + client: group.client, + GlobalNamespace: result, + }, nil +} + +// UpdateGlobalNamespaceByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGlobalNamespaceByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GlobalNamespace) (*GlobalGlobalNamespace, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GlobalNamespaces().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GlobalNamespaces().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGlobalNamespace{ + client: group.client, + GlobalNamespace: result, + }, nil +} + +// ListGlobalNamespaces returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGlobalNamespaces(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGlobalNamespace, err error) { + key := "globalnamespaces.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGlobalNamespace, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GlobalNamespace) + result[k] = &GlobalGlobalNamespace{ + client: group.client, + GlobalNamespace: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GlobalNamespaces().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGlobalNamespace, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGlobalNamespace{ + client: group.client, + GlobalNamespace: &item, + } + } + } + return +} + +type GlobalGlobalNamespace struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GlobalNamespace +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGlobalNamespace) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGlobalNamespaceByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GlobalNamespace = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGlobalNamespace) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGlobalNamespaceByName(ctx, obj.GlobalNamespace) + if err != nil { + return err + } + obj.GlobalNamespace = result.GlobalNamespace + return nil +} + +func (obj *GlobalGlobalNamespace) GetParent(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetConfigByName(ctx, hashedName) +} + +// GetAllGns returns all children of given type +func (obj *GlobalGlobalNamespace) GetAllGns(ctx context.Context) ( + result []*GlobalGNS, err error) { + result = make([]*GlobalGNS, 0, len(obj.Spec.GnsGvk)) + for _, v := range obj.Spec.GnsGvk { + l, err := obj.client.Global().GetGNSByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGns returns child which has given displayName +func (obj *GlobalGlobalNamespace) GetGns(ctx context.Context, + displayName string) (result *GlobalGNS, err error) { + l, ok := obj.Spec.GnsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GlobalNamespace", "Gns", displayName) + } + result, err = obj.client.Global().GetGNSByName(ctx, l.Name) + return +} + +// AddGns calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGlobalNamespace) AddGns(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GNS) (result *GlobalGNS, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["globalnamespaces.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["globalnamespaces.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGNSByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGlobalNamespaceByName(ctx, obj.GetName()) + if getErr == nil { + obj.GlobalNamespace = updatedObj.GlobalNamespace + } + return +} + +// DeleteGns calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGlobalNamespace) DeleteGns(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GnsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GlobalNamespace", "Gns", displayName) + } + err = obj.client.Global().DeleteGNSByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGlobalNamespaceByName(ctx, obj.GetName()) + if err == nil { + obj.GlobalNamespace = updatedObj.GlobalNamespace + } + return +} + +type globalnamespaceGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *globalnamespaceGlobalTsmV1Chainer) Subscribe() { + key := "globalnamespaces.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGlobalNamespaceInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *globalnamespaceGlobalTsmV1Chainer) Unsubscribe() { + key := "globalnamespaces.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *globalnamespaceGlobalTsmV1Chainer) IsSubscribed() bool { + key := "globalnamespaces.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *globalnamespaceGlobalTsmV1Chainer) Gns(name string) *gnsGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gnss.global.tsm.tanzu.vmware.com"] = name + return &gnsGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGns calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *globalnamespaceGlobalTsmV1Chainer) GetGns(ctx context.Context, displayName string) (result *GlobalGNS, err error) { + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGNSByName(ctx, hashedName) +} + +// AddGns calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *globalnamespaceGlobalTsmV1Chainer) AddGns(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GNS) (result *GlobalGNS, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGNSByName(ctx, objToCreate) +} + +// DeleteGns calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *globalnamespaceGlobalTsmV1Chainer) DeleteGns(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGNSByName(ctx, hashedName) +} + +// GetGnsAccessControlPolicyRTByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGnsAccessControlPolicyRTByName(ctx context.Context, hashedName string) (*GlobalGnsAccessControlPolicyRT, error) { + key := "gnsaccesscontrolpolicyrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT) + return &GlobalGnsAccessControlPolicyRT{ + client: group.client, + GnsAccessControlPolicyRT: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsAccessControlPolicyRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsAccessControlPolicyRT{ + client: group.client, + GnsAccessControlPolicyRT: result, + }, nil + } +} + +// DeleteGnsAccessControlPolicyRTByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGnsAccessControlPolicyRTByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsAccessControlPolicyRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + GnsAccessControlPolicyRTs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/gnsAccessControlPolicyGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGnsAccessControlPolicyRTByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGnsAccessControlPolicyRTByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT) (*GlobalGnsAccessControlPolicyRT, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsAccessControlPolicyRTs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"gnsAccessControlPolicyGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GnsAccessControlPolicyRT\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsAccessControlPolicyRT{ + client: group.client, + GnsAccessControlPolicyRT: result, + }, nil +} + +// UpdateGnsAccessControlPolicyRTByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGnsAccessControlPolicyRTByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT) (*GlobalGnsAccessControlPolicyRT, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GnsAccessControlPolicyRTs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueGnsid := + objToUpdate.Spec.Gnsid + patchOpGnsid := PatchOp{ + Op: "replace", + Path: "/spec/gnsid", + Value: patchValueGnsid, + } + patch = append(patch, patchOpGnsid) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsAccessControlPolicyRTs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGnsAccessControlPolicyRT{ + client: group.client, + GnsAccessControlPolicyRT: result, + }, nil +} + +// ListGnsAccessControlPolicyRTs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGnsAccessControlPolicyRTs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGnsAccessControlPolicyRT, err error) { + key := "gnsaccesscontrolpolicyrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGnsAccessControlPolicyRT, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT) + result[k] = &GlobalGnsAccessControlPolicyRT{ + client: group.client, + GnsAccessControlPolicyRT: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GnsAccessControlPolicyRTs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGnsAccessControlPolicyRT, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGnsAccessControlPolicyRT{ + client: group.client, + GnsAccessControlPolicyRT: &item, + } + } + } + return +} + +type GlobalGnsAccessControlPolicyRT struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GnsAccessControlPolicyRT +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGnsAccessControlPolicyRT) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGnsAccessControlPolicyRTByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GnsAccessControlPolicyRT = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGnsAccessControlPolicyRT) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGnsAccessControlPolicyRTByName(ctx, obj.GnsAccessControlPolicyRT) + if err != nil { + return err + } + obj.GnsAccessControlPolicyRT = result.GnsAccessControlPolicyRT + return nil +} + +func (obj *GlobalGnsAccessControlPolicyRT) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type gnsaccesscontrolpolicyrtGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gnsaccesscontrolpolicyrtGlobalTsmV1Chainer) Subscribe() { + key := "gnsaccesscontrolpolicyrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsAccessControlPolicyRTInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gnsaccesscontrolpolicyrtGlobalTsmV1Chainer) Unsubscribe() { + key := "gnsaccesscontrolpolicyrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gnsaccesscontrolpolicyrtGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gnsaccesscontrolpolicyrts.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetGnsAccessControlPolicyByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGnsAccessControlPolicyByName(ctx context.Context, hashedName string) (*GlobalGnsAccessControlPolicy, error) { + key := "gnsaccesscontrolpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GnsAccessControlPolicy) + return &GlobalGnsAccessControlPolicy{ + client: group.client, + GnsAccessControlPolicy: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsAccessControlPolicies().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsAccessControlPolicy{ + client: group.client, + GnsAccessControlPolicy: result, + }, nil + } +} + +// DeleteGnsAccessControlPolicyByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGnsAccessControlPolicyByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsAccessControlPolicies().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + GnsAccessControlPolicies().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/gnsAccessControlPolicyGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGnsAccessControlPolicyByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGnsAccessControlPolicyByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsAccessControlPolicy) (*GlobalGnsAccessControlPolicy, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsAccessControlPolicies().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"gnsAccessControlPolicyGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GnsAccessControlPolicy\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsAccessControlPolicy{ + client: group.client, + GnsAccessControlPolicy: result, + }, nil +} + +// UpdateGnsAccessControlPolicyByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGnsAccessControlPolicyByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GnsAccessControlPolicy) (*GlobalGnsAccessControlPolicy, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GnsAccessControlPolicies().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsAccessControlPolicies().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGnsAccessControlPolicy{ + client: group.client, + GnsAccessControlPolicy: result, + }, nil +} + +// ListGnsAccessControlPolicies returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGnsAccessControlPolicies(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGnsAccessControlPolicy, err error) { + key := "gnsaccesscontrolpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGnsAccessControlPolicy, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GnsAccessControlPolicy) + result[k] = &GlobalGnsAccessControlPolicy{ + client: group.client, + GnsAccessControlPolicy: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GnsAccessControlPolicies().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGnsAccessControlPolicy, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGnsAccessControlPolicy{ + client: group.client, + GnsAccessControlPolicy: &item, + } + } + } + return +} + +type GlobalGnsAccessControlPolicy struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GnsAccessControlPolicy +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGnsAccessControlPolicy) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGnsAccessControlPolicyByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GnsAccessControlPolicy = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGnsAccessControlPolicy) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGnsAccessControlPolicyByName(ctx, obj.GnsAccessControlPolicy) + if err != nil { + return err + } + obj.GnsAccessControlPolicy = result.GnsAccessControlPolicy + return nil +} + +func (obj *GlobalGnsAccessControlPolicy) GetParent(ctx context.Context) (result *GlobalGNS, err error) { + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnss.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGNSByName(ctx, hashedName) +} + +type gnsaccesscontrolpolicyGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gnsaccesscontrolpolicyGlobalTsmV1Chainer) Subscribe() { + key := "gnsaccesscontrolpolicies.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsAccessControlPolicyInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gnsaccesscontrolpolicyGlobalTsmV1Chainer) Unsubscribe() { + key := "gnsaccesscontrolpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gnsaccesscontrolpolicyGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gnsaccesscontrolpolicies.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetGnsBindingRTByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGnsBindingRTByName(ctx context.Context, hashedName string) (*GlobalGnsBindingRT, error) { + key := "gnsbindingrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GnsBindingRT) + return &GlobalGnsBindingRT{ + client: group.client, + GnsBindingRT: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsBindingRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsBindingRT{ + client: group.client, + GnsBindingRT: result, + }, nil + } +} + +// DeleteGnsBindingRTByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGnsBindingRTByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsBindingRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.GnsSvcGroupRTGvk { + err := group.client. + Global().DeleteGnsSvcGroupRTByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.GnsRoutingRulesGvk { + err := group.client. + Global().DeleteGnsRoutingRuleConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.GnsServiceEntryConfigGvk { + err := group.client. + Global().DeleteGnsServiceEntryConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + GnsBindingRTs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/gnsBindingGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["clusterconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGnsBindingRTByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGnsBindingRTByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsBindingRT) (*GlobalGnsBindingRT, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.GnsSvcGroupRTGvk = nil + objToCreate.Spec.GnsRoutingRulesGvk = nil + objToCreate.Spec.GnsServiceEntryConfigGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsBindingRTs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["clusterconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"gnsBindingGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GnsBindingRT\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsBindingRT{ + client: group.client, + GnsBindingRT: result, + }, nil +} + +// UpdateGnsBindingRTByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGnsBindingRTByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GnsBindingRT) (*GlobalGnsBindingRT, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GnsBindingRTs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueDomain := + objToUpdate.Spec.Domain + patchOpDomain := PatchOp{ + Op: "replace", + Path: "/spec/domain", + Value: patchValueDomain, + } + patch = append(patch, patchOpDomain) + + if objToUpdate.Spec.Namespaces != nil { + patchValueNamespaces := + objToUpdate.Spec.Namespaces + patchOpNamespaces := PatchOp{ + Op: "replace", + Path: "/spec/namespaces", + Value: patchValueNamespaces, + } + patch = append(patch, patchOpNamespaces) + } + + patchValueApiDiscoveryEnabled := + objToUpdate.Spec.ApiDiscoveryEnabled + patchOpApiDiscoveryEnabled := PatchOp{ + Op: "replace", + Path: "/spec/apiDiscoveryEnabled", + Value: patchValueApiDiscoveryEnabled, + } + patch = append(patch, patchOpApiDiscoveryEnabled) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsBindingRTs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGnsBindingRT{ + client: group.client, + GnsBindingRT: result, + }, nil +} + +// ListGnsBindingRTs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGnsBindingRTs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGnsBindingRT, err error) { + key := "gnsbindingrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGnsBindingRT, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GnsBindingRT) + result[k] = &GlobalGnsBindingRT{ + client: group.client, + GnsBindingRT: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GnsBindingRTs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGnsBindingRT, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGnsBindingRT{ + client: group.client, + GnsBindingRT: &item, + } + } + } + return +} + +type GlobalGnsBindingRT struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GnsBindingRT +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGnsBindingRT) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGnsBindingRTByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GnsBindingRT = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGnsBindingRT) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGnsBindingRTByName(ctx, obj.GnsBindingRT) + if err != nil { + return err + } + obj.GnsBindingRT = result.GnsBindingRT + return nil +} + +func (obj *GlobalGnsBindingRT) GetParent(ctx context.Context) (result *GlobalClusterConfig, err error) { + hashedName := helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["clusterconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetClusterConfigByName(ctx, hashedName) +} + +// GetAllGnsSvcGroupRT returns all children of given type +func (obj *GlobalGnsBindingRT) GetAllGnsSvcGroupRT(ctx context.Context) ( + result []*GlobalGnsSvcGroupRT, err error) { + result = make([]*GlobalGnsSvcGroupRT, 0, len(obj.Spec.GnsSvcGroupRTGvk)) + for _, v := range obj.Spec.GnsSvcGroupRTGvk { + l, err := obj.client.Global().GetGnsSvcGroupRTByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGnsSvcGroupRT returns child which has given displayName +func (obj *GlobalGnsBindingRT) GetGnsSvcGroupRT(ctx context.Context, + displayName string) (result *GlobalGnsSvcGroupRT, err error) { + l, ok := obj.Spec.GnsSvcGroupRTGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GnsBindingRT", "GnsSvcGroupRT", displayName) + } + result, err = obj.client.Global().GetGnsSvcGroupRTByName(ctx, l.Name) + return +} + +// AddGnsSvcGroupRT calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGnsBindingRT) AddGnsSvcGroupRT(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsSvcGroupRT) (result *GlobalGnsSvcGroupRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnsbindingrts.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnsbindingrts.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGnsSvcGroupRTByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGnsBindingRTByName(ctx, obj.GetName()) + if getErr == nil { + obj.GnsBindingRT = updatedObj.GnsBindingRT + } + return +} + +// DeleteGnsSvcGroupRT calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGnsBindingRT) DeleteGnsSvcGroupRT(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GnsSvcGroupRTGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GnsBindingRT", "GnsSvcGroupRT", displayName) + } + err = obj.client.Global().DeleteGnsSvcGroupRTByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGnsBindingRTByName(ctx, obj.GetName()) + if err == nil { + obj.GnsBindingRT = updatedObj.GnsBindingRT + } + return +} + +// GetAllGnsRoutingRules returns all children of given type +func (obj *GlobalGnsBindingRT) GetAllGnsRoutingRules(ctx context.Context) ( + result []*GlobalGnsRoutingRuleConfig, err error) { + result = make([]*GlobalGnsRoutingRuleConfig, 0, len(obj.Spec.GnsRoutingRulesGvk)) + for _, v := range obj.Spec.GnsRoutingRulesGvk { + l, err := obj.client.Global().GetGnsRoutingRuleConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGnsRoutingRules returns child which has given displayName +func (obj *GlobalGnsBindingRT) GetGnsRoutingRules(ctx context.Context, + displayName string) (result *GlobalGnsRoutingRuleConfig, err error) { + l, ok := obj.Spec.GnsRoutingRulesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GnsBindingRT", "GnsRoutingRules", displayName) + } + result, err = obj.client.Global().GetGnsRoutingRuleConfigByName(ctx, l.Name) + return +} + +// AddGnsRoutingRules calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGnsBindingRT) AddGnsRoutingRules(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig) (result *GlobalGnsRoutingRuleConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnsbindingrts.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnsbindingrts.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGnsRoutingRuleConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGnsBindingRTByName(ctx, obj.GetName()) + if getErr == nil { + obj.GnsBindingRT = updatedObj.GnsBindingRT + } + return +} + +// DeleteGnsRoutingRules calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGnsBindingRT) DeleteGnsRoutingRules(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GnsRoutingRulesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GnsBindingRT", "GnsRoutingRules", displayName) + } + err = obj.client.Global().DeleteGnsRoutingRuleConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGnsBindingRTByName(ctx, obj.GetName()) + if err == nil { + obj.GnsBindingRT = updatedObj.GnsBindingRT + } + return +} + +// GetAllGnsServiceEntryConfig returns all children of given type +func (obj *GlobalGnsBindingRT) GetAllGnsServiceEntryConfig(ctx context.Context) ( + result []*GlobalGnsServiceEntryConfig, err error) { + result = make([]*GlobalGnsServiceEntryConfig, 0, len(obj.Spec.GnsServiceEntryConfigGvk)) + for _, v := range obj.Spec.GnsServiceEntryConfigGvk { + l, err := obj.client.Global().GetGnsServiceEntryConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGnsServiceEntryConfig returns child which has given displayName +func (obj *GlobalGnsBindingRT) GetGnsServiceEntryConfig(ctx context.Context, + displayName string) (result *GlobalGnsServiceEntryConfig, err error) { + l, ok := obj.Spec.GnsServiceEntryConfigGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GnsBindingRT", "GnsServiceEntryConfig", displayName) + } + result, err = obj.client.Global().GetGnsServiceEntryConfigByName(ctx, l.Name) + return +} + +// AddGnsServiceEntryConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGnsBindingRT) AddGnsServiceEntryConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsServiceEntryConfig) (result *GlobalGnsServiceEntryConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnsbindingrts.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnsbindingrts.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGnsServiceEntryConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGnsBindingRTByName(ctx, obj.GetName()) + if getErr == nil { + obj.GnsBindingRT = updatedObj.GnsBindingRT + } + return +} + +// DeleteGnsServiceEntryConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGnsBindingRT) DeleteGnsServiceEntryConfig(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GnsServiceEntryConfigGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GnsBindingRT", "GnsServiceEntryConfig", displayName) + } + err = obj.client.Global().DeleteGnsServiceEntryConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGnsBindingRTByName(ctx, obj.GetName()) + if err == nil { + obj.GnsBindingRT = updatedObj.GnsBindingRT + } + return +} + +type gnsbindingrtGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gnsbindingrtGlobalTsmV1Chainer) Subscribe() { + key := "gnsbindingrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsBindingRTInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gnsbindingrtGlobalTsmV1Chainer) Unsubscribe() { + key := "gnsbindingrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gnsbindingrtGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gnsbindingrts.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *gnsbindingrtGlobalTsmV1Chainer) GnsSvcGroupRT(name string) *gnssvcgrouprtGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gnssvcgrouprts.global.tsm.tanzu.vmware.com"] = name + return &gnssvcgrouprtGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGnsSvcGroupRT calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsbindingrtGlobalTsmV1Chainer) GetGnsSvcGroupRT(ctx context.Context, displayName string) (result *GlobalGnsSvcGroupRT, err error) { + hashedName := helper.GetHashedName("gnssvcgrouprts.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGnsSvcGroupRTByName(ctx, hashedName) +} + +// AddGnsSvcGroupRT calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsbindingrtGlobalTsmV1Chainer) AddGnsSvcGroupRT(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsSvcGroupRT) (result *GlobalGnsSvcGroupRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnssvcgrouprts.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGnsSvcGroupRTByName(ctx, objToCreate) +} + +// DeleteGnsSvcGroupRT calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsbindingrtGlobalTsmV1Chainer) DeleteGnsSvcGroupRT(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnssvcgrouprts.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGnsSvcGroupRTByName(ctx, hashedName) +} + +func (c *gnsbindingrtGlobalTsmV1Chainer) GnsRoutingRules(name string) *gnsroutingruleconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gnsroutingruleconfigs.global.tsm.tanzu.vmware.com"] = name + return &gnsroutingruleconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGnsRoutingRules calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsbindingrtGlobalTsmV1Chainer) GetGnsRoutingRules(ctx context.Context, displayName string) (result *GlobalGnsRoutingRuleConfig, err error) { + hashedName := helper.GetHashedName("gnsroutingruleconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGnsRoutingRuleConfigByName(ctx, hashedName) +} + +// AddGnsRoutingRules calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsbindingrtGlobalTsmV1Chainer) AddGnsRoutingRules(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig) (result *GlobalGnsRoutingRuleConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsroutingruleconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGnsRoutingRuleConfigByName(ctx, objToCreate) +} + +// DeleteGnsRoutingRules calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsbindingrtGlobalTsmV1Chainer) DeleteGnsRoutingRules(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsroutingruleconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGnsRoutingRuleConfigByName(ctx, hashedName) +} + +func (c *gnsbindingrtGlobalTsmV1Chainer) GnsServiceEntryConfig(name string) *gnsserviceentryconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gnsserviceentryconfigs.global.tsm.tanzu.vmware.com"] = name + return &gnsserviceentryconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGnsServiceEntryConfig calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsbindingrtGlobalTsmV1Chainer) GetGnsServiceEntryConfig(ctx context.Context, displayName string) (result *GlobalGnsServiceEntryConfig, err error) { + hashedName := helper.GetHashedName("gnsserviceentryconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGnsServiceEntryConfigByName(ctx, hashedName) +} + +// AddGnsServiceEntryConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsbindingrtGlobalTsmV1Chainer) AddGnsServiceEntryConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsServiceEntryConfig) (result *GlobalGnsServiceEntryConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsserviceentryconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGnsServiceEntryConfigByName(ctx, objToCreate) +} + +// DeleteGnsServiceEntryConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsbindingrtGlobalTsmV1Chainer) DeleteGnsServiceEntryConfig(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsserviceentryconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGnsServiceEntryConfigByName(ctx, hashedName) +} + +// GetGnsEndpointsConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGnsEndpointsConfigByName(ctx context.Context, hashedName string) (*GlobalGnsEndpointsConfig, error) { + key := "gnsendpointsconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GnsEndpointsConfig) + return &GlobalGnsEndpointsConfig{ + client: group.client, + GnsEndpointsConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsEndpointsConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsEndpointsConfig{ + client: group.client, + GnsEndpointsConfig: result, + }, nil + } +} + +// DeleteGnsEndpointsConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGnsEndpointsConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsEndpointsConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + GnsEndpointsConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/gnsEndpointsConfigGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGnsEndpointsConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGnsEndpointsConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsEndpointsConfig) (*GlobalGnsEndpointsConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsEndpointsConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"gnsEndpointsConfigGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GnsEndpointsConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsEndpointsConfig{ + client: group.client, + GnsEndpointsConfig: result, + }, nil +} + +// UpdateGnsEndpointsConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGnsEndpointsConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GnsEndpointsConfig) (*GlobalGnsEndpointsConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GnsEndpointsConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueEndpoints := + objToUpdate.Spec.Endpoints + patchOpEndpoints := PatchOp{ + Op: "replace", + Path: "/spec/endpoints", + Value: patchValueEndpoints, + } + patch = append(patch, patchOpEndpoints) + + patchValueGnsId := + objToUpdate.Spec.GnsId + patchOpGnsId := PatchOp{ + Op: "replace", + Path: "/spec/gnsId", + Value: patchValueGnsId, + } + patch = append(patch, patchOpGnsId) + + if objToUpdate.Spec.EndpointServices != nil { + patchValueEndpointServices := + objToUpdate.Spec.EndpointServices + patchOpEndpointServices := PatchOp{ + Op: "replace", + Path: "/spec/endpointServices", + Value: patchValueEndpointServices, + } + patch = append(patch, patchOpEndpointServices) + } + + patchValueServicePortList := + objToUpdate.Spec.ServicePortList + patchOpServicePortList := PatchOp{ + Op: "replace", + Path: "/spec/servicePortList", + Value: patchValueServicePortList, + } + patch = append(patch, patchOpServicePortList) + + patchValueSelector := + objToUpdate.Spec.Selector + patchOpSelector := PatchOp{ + Op: "replace", + Path: "/spec/selector", + Value: patchValueSelector, + } + patch = append(patch, patchOpSelector) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsEndpointsConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGnsEndpointsConfig{ + client: group.client, + GnsEndpointsConfig: result, + }, nil +} + +// ListGnsEndpointsConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGnsEndpointsConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGnsEndpointsConfig, err error) { + key := "gnsendpointsconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGnsEndpointsConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GnsEndpointsConfig) + result[k] = &GlobalGnsEndpointsConfig{ + client: group.client, + GnsEndpointsConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GnsEndpointsConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGnsEndpointsConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGnsEndpointsConfig{ + client: group.client, + GnsEndpointsConfig: &item, + } + } + } + return +} + +type GlobalGnsEndpointsConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GnsEndpointsConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGnsEndpointsConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGnsEndpointsConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GnsEndpointsConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGnsEndpointsConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGnsEndpointsConfigByName(ctx, obj.GnsEndpointsConfig) + if err != nil { + return err + } + obj.GnsEndpointsConfig = result.GnsEndpointsConfig + return nil +} + +func (obj *GlobalGnsEndpointsConfig) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type gnsendpointsconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gnsendpointsconfigGlobalTsmV1Chainer) Subscribe() { + key := "gnsendpointsconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsEndpointsConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gnsendpointsconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "gnsendpointsconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gnsendpointsconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gnsendpointsconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetExternalServiceConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetExternalServiceConfigByName(ctx context.Context, hashedName string) (*GlobalExternalServiceConfig, error) { + key := "externalserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ExternalServiceConfig) + return &GlobalExternalServiceConfig{ + client: group.client, + ExternalServiceConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalServiceConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalServiceConfig{ + client: group.client, + ExternalServiceConfig: result, + }, nil + } +} + +// DeleteExternalServiceConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteExternalServiceConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalServiceConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ExternalServiceConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/externalServicesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateExternalServiceConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateExternalServiceConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalServiceConfig) (*GlobalExternalServiceConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalServiceConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"externalServicesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ExternalServiceConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalExternalServiceConfig{ + client: group.client, + ExternalServiceConfig: result, + }, nil +} + +// UpdateExternalServiceConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateExternalServiceConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ExternalServiceConfig) (*GlobalExternalServiceConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ExternalServiceConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + patchValueSystem := + objToUpdate.Spec.System + patchOpSystem := PatchOp{ + Op: "replace", + Path: "/spec/system", + Value: patchValueSystem, + } + patch = append(patch, patchOpSystem) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ExternalServiceConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalExternalServiceConfig{ + client: group.client, + ExternalServiceConfig: result, + }, nil +} + +// ListExternalServiceConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListExternalServiceConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalExternalServiceConfig, err error) { + key := "externalserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalExternalServiceConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ExternalServiceConfig) + result[k] = &GlobalExternalServiceConfig{ + client: group.client, + ExternalServiceConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ExternalServiceConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalExternalServiceConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalExternalServiceConfig{ + client: group.client, + ExternalServiceConfig: &item, + } + } + } + return +} + +type GlobalExternalServiceConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ExternalServiceConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalExternalServiceConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteExternalServiceConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ExternalServiceConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalExternalServiceConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateExternalServiceConfigByName(ctx, obj.ExternalServiceConfig) + if err != nil { + return err + } + obj.ExternalServiceConfig = result.ExternalServiceConfig + return nil +} + +func (obj *GlobalExternalServiceConfig) GetParent(ctx context.Context) (result *GlobalGNS, err error) { + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnss.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGNSByName(ctx, hashedName) +} + +type externalserviceconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *externalserviceconfigGlobalTsmV1Chainer) Subscribe() { + key := "externalserviceconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewExternalServiceConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *externalserviceconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "externalserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *externalserviceconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "externalserviceconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetPublicServiceRouteConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetPublicServiceRouteConfigByName(ctx context.Context, hashedName string) (*GlobalPublicServiceRouteConfig, error) { + key := "publicservicerouteconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.PublicServiceRouteConfig) + return &GlobalPublicServiceRouteConfig{ + client: group.client, + PublicServiceRouteConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + PublicServiceRouteConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalPublicServiceRouteConfig{ + client: group.client, + PublicServiceRouteConfig: result, + }, nil + } +} + +// DeletePublicServiceRouteConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeletePublicServiceRouteConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + PublicServiceRouteConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + PublicServiceRouteConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/routingConfigsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["publicserviceconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("publicserviceconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + PublicServiceConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreatePublicServiceRouteConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreatePublicServiceRouteConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PublicServiceRouteConfig) (*GlobalPublicServiceRouteConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + PublicServiceRouteConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["publicserviceconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("publicserviceconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"routingConfigsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"PublicServiceRouteConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + PublicServiceConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalPublicServiceRouteConfig{ + client: group.client, + PublicServiceRouteConfig: result, + }, nil +} + +// UpdatePublicServiceRouteConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdatePublicServiceRouteConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.PublicServiceRouteConfig) (*GlobalPublicServiceRouteConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + PublicServiceRouteConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueType := + objToUpdate.Spec.Type + patchOpType := PatchOp{ + Op: "replace", + Path: "/spec/type", + Value: patchValueType, + } + patch = append(patch, patchOpType) + + patchValueRoutes := + objToUpdate.Spec.Routes + patchOpRoutes := PatchOp{ + Op: "replace", + Path: "/spec/routes", + Value: patchValueRoutes, + } + patch = append(patch, patchOpRoutes) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + PublicServiceRouteConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalPublicServiceRouteConfig{ + client: group.client, + PublicServiceRouteConfig: result, + }, nil +} + +// ListPublicServiceRouteConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListPublicServiceRouteConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalPublicServiceRouteConfig, err error) { + key := "publicservicerouteconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalPublicServiceRouteConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.PublicServiceRouteConfig) + result[k] = &GlobalPublicServiceRouteConfig{ + client: group.client, + PublicServiceRouteConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + PublicServiceRouteConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalPublicServiceRouteConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalPublicServiceRouteConfig{ + client: group.client, + PublicServiceRouteConfig: &item, + } + } + } + return +} + +type GlobalPublicServiceRouteConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.PublicServiceRouteConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalPublicServiceRouteConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeletePublicServiceRouteConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.PublicServiceRouteConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalPublicServiceRouteConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdatePublicServiceRouteConfigByName(ctx, obj.PublicServiceRouteConfig) + if err != nil { + return err + } + obj.PublicServiceRouteConfig = result.PublicServiceRouteConfig + return nil +} + +func (obj *GlobalPublicServiceRouteConfig) GetParent(ctx context.Context) (result *GlobalPublicServiceConfig, err error) { + hashedName := helper.GetHashedName("publicserviceconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["publicserviceconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetPublicServiceConfigByName(ctx, hashedName) +} + +type publicservicerouteconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *publicservicerouteconfigGlobalTsmV1Chainer) Subscribe() { + key := "publicservicerouteconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewPublicServiceRouteConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *publicservicerouteconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "publicservicerouteconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *publicservicerouteconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "publicservicerouteconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetPublicServiceConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetPublicServiceConfigByName(ctx context.Context, hashedName string) (*GlobalPublicServiceConfig, error) { + key := "publicserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.PublicServiceConfig) + return &GlobalPublicServiceConfig{ + client: group.client, + PublicServiceConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + PublicServiceConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalPublicServiceConfig{ + client: group.client, + PublicServiceConfig: result, + }, nil + } +} + +// DeletePublicServiceConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeletePublicServiceConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + PublicServiceConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.RoutingConfigsGvk { + err := group.client. + Global().DeletePublicServiceRouteConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + PublicServiceConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/publicServicesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreatePublicServiceConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreatePublicServiceConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PublicServiceConfig) (*GlobalPublicServiceConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.RoutingConfigsGvk = nil + objToCreate.Spec.ExternalDNSGvk = nil + objToCreate.Spec.CertificatesGvk = nil + objToCreate.Spec.HealthChecksGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + PublicServiceConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"publicServicesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"PublicServiceConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalPublicServiceConfig{ + client: group.client, + PublicServiceConfig: result, + }, nil +} + +// UpdatePublicServiceConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdatePublicServiceConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.PublicServiceConfig) (*GlobalPublicServiceConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + PublicServiceConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueFqdn := + objToUpdate.Spec.Fqdn + patchOpFqdn := PatchOp{ + Op: "replace", + Path: "/spec/fqdn", + Value: patchValueFqdn, + } + patch = append(patch, patchOpFqdn) + + patchValueConfig := + objToUpdate.Spec.Config + patchOpConfig := PatchOp{ + Op: "replace", + Path: "/spec/config", + Value: patchValueConfig, + } + patch = append(patch, patchOpConfig) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + PublicServiceConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalPublicServiceConfig{ + client: group.client, + PublicServiceConfig: result, + }, nil +} + +// ListPublicServiceConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListPublicServiceConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalPublicServiceConfig, err error) { + key := "publicserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalPublicServiceConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.PublicServiceConfig) + result[k] = &GlobalPublicServiceConfig{ + client: group.client, + PublicServiceConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + PublicServiceConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalPublicServiceConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalPublicServiceConfig{ + client: group.client, + PublicServiceConfig: &item, + } + } + } + return +} + +type GlobalPublicServiceConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.PublicServiceConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalPublicServiceConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeletePublicServiceConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.PublicServiceConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalPublicServiceConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdatePublicServiceConfigByName(ctx, obj.PublicServiceConfig) + if err != nil { + return err + } + obj.PublicServiceConfig = result.PublicServiceConfig + return nil +} + +func (obj *GlobalPublicServiceConfig) GetParent(ctx context.Context) (result *GlobalGNS, err error) { + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnss.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGNSByName(ctx, hashedName) +} + +// GetAllRoutingConfigs returns all children of given type +func (obj *GlobalPublicServiceConfig) GetAllRoutingConfigs(ctx context.Context) ( + result []*GlobalPublicServiceRouteConfig, err error) { + result = make([]*GlobalPublicServiceRouteConfig, 0, len(obj.Spec.RoutingConfigsGvk)) + for _, v := range obj.Spec.RoutingConfigsGvk { + l, err := obj.client.Global().GetPublicServiceRouteConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetRoutingConfigs returns child which has given displayName +func (obj *GlobalPublicServiceConfig) GetRoutingConfigs(ctx context.Context, + displayName string) (result *GlobalPublicServiceRouteConfig, err error) { + l, ok := obj.Spec.RoutingConfigsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.PublicServiceConfig", "RoutingConfigs", displayName) + } + result, err = obj.client.Global().GetPublicServiceRouteConfigByName(ctx, l.Name) + return +} + +// AddRoutingConfigs calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalPublicServiceConfig) AddRoutingConfigs(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PublicServiceRouteConfig) (result *GlobalPublicServiceRouteConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["publicserviceconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["publicserviceconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreatePublicServiceRouteConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetPublicServiceConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.PublicServiceConfig = updatedObj.PublicServiceConfig + } + return +} + +// DeleteRoutingConfigs calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalPublicServiceConfig) DeleteRoutingConfigs(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.RoutingConfigsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.PublicServiceConfig", "RoutingConfigs", displayName) + } + err = obj.client.Global().DeletePublicServiceRouteConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetPublicServiceConfigByName(ctx, obj.GetName()) + if err == nil { + obj.PublicServiceConfig = updatedObj.PublicServiceConfig + } + return +} + +// GetAllExternalDNS returns all links of given type +func (obj *GlobalPublicServiceConfig) GetAllExternalDNS(ctx context.Context) ( + result []*GlobalExternalDNSConfigN, err error) { + result = make([]*GlobalExternalDNSConfigN, 0, len(obj.Spec.ExternalDNSGvk)) + for _, v := range obj.Spec.ExternalDNSGvk { + l, err := obj.client.Global().GetExternalDNSConfigNByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetExternalDNS returns link which has given displayName +func (obj *GlobalPublicServiceConfig) GetExternalDNS(ctx context.Context, + displayName string) (result *GlobalExternalDNSConfigN, err error) { + l, ok := obj.Spec.ExternalDNSGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.PublicServiceConfig", "ExternalDNS", displayName) + } + result, err = obj.client.Global().GetExternalDNSConfigNByName(ctx, l.Name) + return +} + +// LinkExternalDNS links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalPublicServiceConfig) LinkExternalDNS(ctx context.Context, + linkToAdd *GlobalExternalDNSConfigN) error { + + payload := "{\"spec\": {\"externalDNSGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ExternalDNSConfigN\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().PublicServiceConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.PublicServiceConfig = result + return nil +} + +// UnlinkExternalDNS unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalPublicServiceConfig) UnlinkExternalDNS(ctx context.Context, + linkToRemove *GlobalExternalDNSConfigN) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/externalDNSGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().PublicServiceConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.PublicServiceConfig = result + return nil + +} + +// GetAllCertificates returns all links of given type +func (obj *GlobalPublicServiceConfig) GetAllCertificates(ctx context.Context) ( + result []*GlobalCertificateConfigN, err error) { + result = make([]*GlobalCertificateConfigN, 0, len(obj.Spec.CertificatesGvk)) + for _, v := range obj.Spec.CertificatesGvk { + l, err := obj.client.Global().GetCertificateConfigNByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetCertificates returns link which has given displayName +func (obj *GlobalPublicServiceConfig) GetCertificates(ctx context.Context, + displayName string) (result *GlobalCertificateConfigN, err error) { + l, ok := obj.Spec.CertificatesGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.PublicServiceConfig", "Certificates", displayName) + } + result, err = obj.client.Global().GetCertificateConfigNByName(ctx, l.Name) + return +} + +// LinkCertificates links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalPublicServiceConfig) LinkCertificates(ctx context.Context, + linkToAdd *GlobalCertificateConfigN) error { + + payload := "{\"spec\": {\"certificatesGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"CertificateConfigN\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().PublicServiceConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.PublicServiceConfig = result + return nil +} + +// UnlinkCertificates unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalPublicServiceConfig) UnlinkCertificates(ctx context.Context, + linkToRemove *GlobalCertificateConfigN) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/certificatesGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().PublicServiceConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.PublicServiceConfig = result + return nil + +} + +// GetAllHealthChecks returns all links of given type +func (obj *GlobalPublicServiceConfig) GetAllHealthChecks(ctx context.Context) ( + result []*GlobalHealthCheckConfigN, err error) { + result = make([]*GlobalHealthCheckConfigN, 0, len(obj.Spec.HealthChecksGvk)) + for _, v := range obj.Spec.HealthChecksGvk { + l, err := obj.client.Global().GetHealthCheckConfigNByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetHealthChecks returns link which has given displayName +func (obj *GlobalPublicServiceConfig) GetHealthChecks(ctx context.Context, + displayName string) (result *GlobalHealthCheckConfigN, err error) { + l, ok := obj.Spec.HealthChecksGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.PublicServiceConfig", "HealthChecks", displayName) + } + result, err = obj.client.Global().GetHealthCheckConfigNByName(ctx, l.Name) + return +} + +// LinkHealthChecks links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalPublicServiceConfig) LinkHealthChecks(ctx context.Context, + linkToAdd *GlobalHealthCheckConfigN) error { + + payload := "{\"spec\": {\"healthChecksGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"HealthCheckConfigN\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().PublicServiceConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.PublicServiceConfig = result + return nil +} + +// UnlinkHealthChecks unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalPublicServiceConfig) UnlinkHealthChecks(ctx context.Context, + linkToRemove *GlobalHealthCheckConfigN) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/healthChecksGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().PublicServiceConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.PublicServiceConfig = result + return nil + +} + +type publicserviceconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *publicserviceconfigGlobalTsmV1Chainer) Subscribe() { + key := "publicserviceconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewPublicServiceConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *publicserviceconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "publicserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *publicserviceconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "publicserviceconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *publicserviceconfigGlobalTsmV1Chainer) RoutingConfigs(name string) *publicservicerouteconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["publicservicerouteconfigs.global.tsm.tanzu.vmware.com"] = name + return &publicservicerouteconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetRoutingConfigs calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *publicserviceconfigGlobalTsmV1Chainer) GetRoutingConfigs(ctx context.Context, displayName string) (result *GlobalPublicServiceRouteConfig, err error) { + hashedName := helper.GetHashedName("publicservicerouteconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetPublicServiceRouteConfigByName(ctx, hashedName) +} + +// AddRoutingConfigs calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *publicserviceconfigGlobalTsmV1Chainer) AddRoutingConfigs(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PublicServiceRouteConfig) (result *GlobalPublicServiceRouteConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("publicservicerouteconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreatePublicServiceRouteConfigByName(ctx, objToCreate) +} + +// DeleteRoutingConfigs calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *publicserviceconfigGlobalTsmV1Chainer) DeleteRoutingConfigs(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("publicservicerouteconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeletePublicServiceRouteConfigByName(ctx, hashedName) +} + +// GetGNSRoutingConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGNSRoutingConfigByName(ctx context.Context, hashedName string) (*GlobalGNSRoutingConfig, error) { + key := "gnsroutingconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GNSRoutingConfig) + return &GlobalGNSRoutingConfig{ + client: group.client, + GNSRoutingConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GNSRoutingConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGNSRoutingConfig{ + client: group.client, + GNSRoutingConfig: result, + }, nil + } +} + +// DeleteGNSRoutingConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGNSRoutingConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GNSRoutingConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + GNSRoutingConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/routingPoliciesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGNSRoutingConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGNSRoutingConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GNSRoutingConfig) (*GlobalGNSRoutingConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + GNSRoutingConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"routingPoliciesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GNSRoutingConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGNSRoutingConfig{ + client: group.client, + GNSRoutingConfig: result, + }, nil +} + +// UpdateGNSRoutingConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGNSRoutingConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GNSRoutingConfig) (*GlobalGNSRoutingConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GNSRoutingConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GNSRoutingConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGNSRoutingConfig{ + client: group.client, + GNSRoutingConfig: result, + }, nil +} + +// ListGNSRoutingConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGNSRoutingConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGNSRoutingConfig, err error) { + key := "gnsroutingconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGNSRoutingConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GNSRoutingConfig) + result[k] = &GlobalGNSRoutingConfig{ + client: group.client, + GNSRoutingConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GNSRoutingConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGNSRoutingConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGNSRoutingConfig{ + client: group.client, + GNSRoutingConfig: &item, + } + } + } + return +} + +type GlobalGNSRoutingConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GNSRoutingConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGNSRoutingConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGNSRoutingConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GNSRoutingConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGNSRoutingConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGNSRoutingConfigByName(ctx, obj.GNSRoutingConfig) + if err != nil { + return err + } + obj.GNSRoutingConfig = result.GNSRoutingConfig + return nil +} + +func (obj *GlobalGNSRoutingConfig) GetParent(ctx context.Context) (result *GlobalGNS, err error) { + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnss.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGNSByName(ctx, hashedName) +} + +type gnsroutingconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gnsroutingconfigGlobalTsmV1Chainer) Subscribe() { + key := "gnsroutingconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGNSRoutingConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gnsroutingconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "gnsroutingconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gnsroutingconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gnsroutingconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetGnsRoutingRuleConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGnsRoutingRuleConfigByName(ctx context.Context, hashedName string) (*GlobalGnsRoutingRuleConfig, error) { + key := "gnsroutingruleconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig) + return &GlobalGnsRoutingRuleConfig{ + client: group.client, + GnsRoutingRuleConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsRoutingRuleConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsRoutingRuleConfig{ + client: group.client, + GnsRoutingRuleConfig: result, + }, nil + } +} + +// DeleteGnsRoutingRuleConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGnsRoutingRuleConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsRoutingRuleConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + GnsRoutingRuleConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/gnsRoutingRulesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gnsbindingrts.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnsbindingrts.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GnsBindingRTs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGnsRoutingRuleConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGnsRoutingRuleConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig) (*GlobalGnsRoutingRuleConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsRoutingRuleConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gnsbindingrts.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnsbindingrts.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"gnsRoutingRulesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GnsRoutingRuleConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GnsBindingRTs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsRoutingRuleConfig{ + client: group.client, + GnsRoutingRuleConfig: result, + }, nil +} + +// UpdateGnsRoutingRuleConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGnsRoutingRuleConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig) (*GlobalGnsRoutingRuleConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GnsRoutingRuleConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueOwnedBy := + objToUpdate.Spec.OwnedBy + patchOpOwnedBy := PatchOp{ + Op: "replace", + Path: "/spec/ownedBy", + Value: patchValueOwnedBy, + } + patch = append(patch, patchOpOwnedBy) + + patchValueServiceFQDN := + objToUpdate.Spec.ServiceFQDN + patchOpServiceFQDN := PatchOp{ + Op: "replace", + Path: "/spec/serviceFQDN", + Value: patchValueServiceFQDN, + } + patch = append(patch, patchOpServiceFQDN) + + patchValuePortName := + objToUpdate.Spec.PortName + patchOpPortName := PatchOp{ + Op: "replace", + Path: "/spec/portName", + Value: patchValuePortName, + } + patch = append(patch, patchOpPortName) + + patchValuePort := + objToUpdate.Spec.Port + patchOpPort := PatchOp{ + Op: "replace", + Path: "/spec/port", + Value: patchValuePort, + } + patch = append(patch, patchOpPort) + + patchValueHttpRouteRules := + objToUpdate.Spec.HttpRouteRules + patchOpHttpRouteRules := PatchOp{ + Op: "replace", + Path: "/spec/httpRouteRules", + Value: patchValueHttpRouteRules, + } + patch = append(patch, patchOpHttpRouteRules) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsRoutingRuleConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGnsRoutingRuleConfig{ + client: group.client, + GnsRoutingRuleConfig: result, + }, nil +} + +// ListGnsRoutingRuleConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGnsRoutingRuleConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGnsRoutingRuleConfig, err error) { + key := "gnsroutingruleconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGnsRoutingRuleConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig) + result[k] = &GlobalGnsRoutingRuleConfig{ + client: group.client, + GnsRoutingRuleConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GnsRoutingRuleConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGnsRoutingRuleConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGnsRoutingRuleConfig{ + client: group.client, + GnsRoutingRuleConfig: &item, + } + } + } + return +} + +type GlobalGnsRoutingRuleConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GnsRoutingRuleConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGnsRoutingRuleConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGnsRoutingRuleConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GnsRoutingRuleConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGnsRoutingRuleConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGnsRoutingRuleConfigByName(ctx, obj.GnsRoutingRuleConfig) + if err != nil { + return err + } + obj.GnsRoutingRuleConfig = result.GnsRoutingRuleConfig + return nil +} + +func (obj *GlobalGnsRoutingRuleConfig) GetParent(ctx context.Context) (result *GlobalGnsBindingRT, err error) { + hashedName := helper.GetHashedName("gnsbindingrts.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnsbindingrts.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGnsBindingRTByName(ctx, hashedName) +} + +type gnsroutingruleconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gnsroutingruleconfigGlobalTsmV1Chainer) Subscribe() { + key := "gnsroutingruleconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsRoutingRuleConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gnsroutingruleconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "gnsroutingruleconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gnsroutingruleconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gnsroutingruleconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetGnsSegmentationPolicyRTByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGnsSegmentationPolicyRTByName(ctx context.Context, hashedName string) (*GlobalGnsSegmentationPolicyRT, error) { + key := "gnssegmentationpolicyrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT) + return &GlobalGnsSegmentationPolicyRT{ + client: group.client, + GnsSegmentationPolicyRT: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsSegmentationPolicyRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsSegmentationPolicyRT{ + client: group.client, + GnsSegmentationPolicyRT: result, + }, nil + } +} + +// DeleteGnsSegmentationPolicyRTByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGnsSegmentationPolicyRTByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsSegmentationPolicyRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + GnsSegmentationPolicyRTs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/gnsSegmentationPolicyGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGnsSegmentationPolicyRTByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGnsSegmentationPolicyRTByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT) (*GlobalGnsSegmentationPolicyRT, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsSegmentationPolicyRTs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"gnsSegmentationPolicyGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GnsSegmentationPolicyRT\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsSegmentationPolicyRT{ + client: group.client, + GnsSegmentationPolicyRT: result, + }, nil +} + +// UpdateGnsSegmentationPolicyRTByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGnsSegmentationPolicyRTByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT) (*GlobalGnsSegmentationPolicyRT, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GnsSegmentationPolicyRTs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueGnsid := + objToUpdate.Spec.Gnsid + patchOpGnsid := PatchOp{ + Op: "replace", + Path: "/spec/gnsid", + Value: patchValueGnsid, + } + patch = append(patch, patchOpGnsid) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsSegmentationPolicyRTs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGnsSegmentationPolicyRT{ + client: group.client, + GnsSegmentationPolicyRT: result, + }, nil +} + +// ListGnsSegmentationPolicyRTs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGnsSegmentationPolicyRTs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGnsSegmentationPolicyRT, err error) { + key := "gnssegmentationpolicyrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGnsSegmentationPolicyRT, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT) + result[k] = &GlobalGnsSegmentationPolicyRT{ + client: group.client, + GnsSegmentationPolicyRT: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GnsSegmentationPolicyRTs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGnsSegmentationPolicyRT, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGnsSegmentationPolicyRT{ + client: group.client, + GnsSegmentationPolicyRT: &item, + } + } + } + return +} + +type GlobalGnsSegmentationPolicyRT struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GnsSegmentationPolicyRT +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGnsSegmentationPolicyRT) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGnsSegmentationPolicyRTByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GnsSegmentationPolicyRT = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGnsSegmentationPolicyRT) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGnsSegmentationPolicyRTByName(ctx, obj.GnsSegmentationPolicyRT) + if err != nil { + return err + } + obj.GnsSegmentationPolicyRT = result.GnsSegmentationPolicyRT + return nil +} + +func (obj *GlobalGnsSegmentationPolicyRT) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type gnssegmentationpolicyrtGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gnssegmentationpolicyrtGlobalTsmV1Chainer) Subscribe() { + key := "gnssegmentationpolicyrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsSegmentationPolicyRTInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gnssegmentationpolicyrtGlobalTsmV1Chainer) Unsubscribe() { + key := "gnssegmentationpolicyrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gnssegmentationpolicyrtGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gnssegmentationpolicyrts.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetGnsSegmentationPolicyByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGnsSegmentationPolicyByName(ctx context.Context, hashedName string) (*GlobalGnsSegmentationPolicy, error) { + key := "gnssegmentationpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GnsSegmentationPolicy) + return &GlobalGnsSegmentationPolicy{ + client: group.client, + GnsSegmentationPolicy: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsSegmentationPolicies().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsSegmentationPolicy{ + client: group.client, + GnsSegmentationPolicy: result, + }, nil + } +} + +// DeleteGnsSegmentationPolicyByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGnsSegmentationPolicyByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsSegmentationPolicies().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + GnsSegmentationPolicies().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/gnsSegmentationPolicyGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGnsSegmentationPolicyByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGnsSegmentationPolicyByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsSegmentationPolicy) (*GlobalGnsSegmentationPolicy, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsSegmentationPolicies().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"gnsSegmentationPolicyGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GnsSegmentationPolicy\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsSegmentationPolicy{ + client: group.client, + GnsSegmentationPolicy: result, + }, nil +} + +// UpdateGnsSegmentationPolicyByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGnsSegmentationPolicyByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GnsSegmentationPolicy) (*GlobalGnsSegmentationPolicy, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GnsSegmentationPolicies().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsSegmentationPolicies().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGnsSegmentationPolicy{ + client: group.client, + GnsSegmentationPolicy: result, + }, nil +} + +// ListGnsSegmentationPolicies returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGnsSegmentationPolicies(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGnsSegmentationPolicy, err error) { + key := "gnssegmentationpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGnsSegmentationPolicy, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GnsSegmentationPolicy) + result[k] = &GlobalGnsSegmentationPolicy{ + client: group.client, + GnsSegmentationPolicy: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GnsSegmentationPolicies().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGnsSegmentationPolicy, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGnsSegmentationPolicy{ + client: group.client, + GnsSegmentationPolicy: &item, + } + } + } + return +} + +type GlobalGnsSegmentationPolicy struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GnsSegmentationPolicy +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGnsSegmentationPolicy) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGnsSegmentationPolicyByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GnsSegmentationPolicy = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGnsSegmentationPolicy) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGnsSegmentationPolicyByName(ctx, obj.GnsSegmentationPolicy) + if err != nil { + return err + } + obj.GnsSegmentationPolicy = result.GnsSegmentationPolicy + return nil +} + +func (obj *GlobalGnsSegmentationPolicy) GetParent(ctx context.Context) (result *GlobalGNS, err error) { + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnss.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGNSByName(ctx, hashedName) +} + +type gnssegmentationpolicyGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gnssegmentationpolicyGlobalTsmV1Chainer) Subscribe() { + key := "gnssegmentationpolicies.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsSegmentationPolicyInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gnssegmentationpolicyGlobalTsmV1Chainer) Unsubscribe() { + key := "gnssegmentationpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gnssegmentationpolicyGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gnssegmentationpolicies.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetGnsServiceEntryConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGnsServiceEntryConfigByName(ctx context.Context, hashedName string) (*GlobalGnsServiceEntryConfig, error) { + key := "gnsserviceentryconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GnsServiceEntryConfig) + return &GlobalGnsServiceEntryConfig{ + client: group.client, + GnsServiceEntryConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsServiceEntryConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsServiceEntryConfig{ + client: group.client, + GnsServiceEntryConfig: result, + }, nil + } +} + +// DeleteGnsServiceEntryConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGnsServiceEntryConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsServiceEntryConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + GnsServiceEntryConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/gnsServiceEntryConfigGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gnsbindingrts.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnsbindingrts.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GnsBindingRTs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGnsServiceEntryConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGnsServiceEntryConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsServiceEntryConfig) (*GlobalGnsServiceEntryConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsServiceEntryConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gnsbindingrts.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnsbindingrts.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"gnsServiceEntryConfigGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GnsServiceEntryConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GnsBindingRTs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsServiceEntryConfig{ + client: group.client, + GnsServiceEntryConfig: result, + }, nil +} + +// UpdateGnsServiceEntryConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGnsServiceEntryConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GnsServiceEntryConfig) (*GlobalGnsServiceEntryConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GnsServiceEntryConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueService := + objToUpdate.Spec.Service + patchOpService := PatchOp{ + Op: "replace", + Path: "/spec/service", + Value: patchValueService, + } + patch = append(patch, patchOpService) + + patchValuePorts := + objToUpdate.Spec.Ports + patchOpPorts := PatchOp{ + Op: "replace", + Path: "/spec/ports", + Value: patchValuePorts, + } + patch = append(patch, patchOpPorts) + + patchValueVersions := + objToUpdate.Spec.Versions + patchOpVersions := PatchOp{ + Op: "replace", + Path: "/spec/versions", + Value: patchValueVersions, + } + patch = append(patch, patchOpVersions) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsServiceEntryConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGnsServiceEntryConfig{ + client: group.client, + GnsServiceEntryConfig: result, + }, nil +} + +// ListGnsServiceEntryConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGnsServiceEntryConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGnsServiceEntryConfig, err error) { + key := "gnsserviceentryconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGnsServiceEntryConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GnsServiceEntryConfig) + result[k] = &GlobalGnsServiceEntryConfig{ + client: group.client, + GnsServiceEntryConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GnsServiceEntryConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGnsServiceEntryConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGnsServiceEntryConfig{ + client: group.client, + GnsServiceEntryConfig: &item, + } + } + } + return +} + +type GlobalGnsServiceEntryConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GnsServiceEntryConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGnsServiceEntryConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGnsServiceEntryConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GnsServiceEntryConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGnsServiceEntryConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGnsServiceEntryConfigByName(ctx, obj.GnsServiceEntryConfig) + if err != nil { + return err + } + obj.GnsServiceEntryConfig = result.GnsServiceEntryConfig + return nil +} + +func (obj *GlobalGnsServiceEntryConfig) GetParent(ctx context.Context) (result *GlobalGnsBindingRT, err error) { + hashedName := helper.GetHashedName("gnsbindingrts.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnsbindingrts.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGnsBindingRTByName(ctx, hashedName) +} + +type gnsserviceentryconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gnsserviceentryconfigGlobalTsmV1Chainer) Subscribe() { + key := "gnsserviceentryconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsServiceEntryConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gnsserviceentryconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "gnsserviceentryconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gnsserviceentryconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gnsserviceentryconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetGnsSvcGroupRTByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGnsSvcGroupRTByName(ctx context.Context, hashedName string) (*GlobalGnsSvcGroupRT, error) { + key := "gnssvcgrouprts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GnsSvcGroupRT) + return &GlobalGnsSvcGroupRT{ + client: group.client, + GnsSvcGroupRT: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsSvcGroupRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsSvcGroupRT{ + client: group.client, + GnsSvcGroupRT: result, + }, nil + } +} + +// DeleteGnsSvcGroupRTByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGnsSvcGroupRTByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsSvcGroupRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + GnsSvcGroupRTs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/gnsSvcGroupRTGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gnsbindingrts.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnsbindingrts.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GnsBindingRTs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGnsSvcGroupRTByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGnsSvcGroupRTByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsSvcGroupRT) (*GlobalGnsSvcGroupRT, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsSvcGroupRTs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gnsbindingrts.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnsbindingrts.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"gnsSvcGroupRTGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GnsSvcGroupRT\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GnsBindingRTs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsSvcGroupRT{ + client: group.client, + GnsSvcGroupRT: result, + }, nil +} + +// UpdateGnsSvcGroupRTByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGnsSvcGroupRTByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GnsSvcGroupRT) (*GlobalGnsSvcGroupRT, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GnsSvcGroupRTs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueDisplayName := + objToUpdate.Spec.DisplayName + patchOpDisplayName := PatchOp{ + Op: "replace", + Path: "/spec/displayName", + Value: patchValueDisplayName, + } + patch = append(patch, patchOpDisplayName) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueServices := + objToUpdate.Spec.Services + patchOpServices := PatchOp{ + Op: "replace", + Path: "/spec/services", + Value: patchValueServices, + } + patch = append(patch, patchOpServices) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsSvcGroupRTs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGnsSvcGroupRT{ + client: group.client, + GnsSvcGroupRT: result, + }, nil +} + +// ListGnsSvcGroupRTs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGnsSvcGroupRTs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGnsSvcGroupRT, err error) { + key := "gnssvcgrouprts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGnsSvcGroupRT, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GnsSvcGroupRT) + result[k] = &GlobalGnsSvcGroupRT{ + client: group.client, + GnsSvcGroupRT: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GnsSvcGroupRTs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGnsSvcGroupRT, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGnsSvcGroupRT{ + client: group.client, + GnsSvcGroupRT: &item, + } + } + } + return +} + +type GlobalGnsSvcGroupRT struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GnsSvcGroupRT +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGnsSvcGroupRT) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGnsSvcGroupRTByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GnsSvcGroupRT = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGnsSvcGroupRT) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGnsSvcGroupRTByName(ctx, obj.GnsSvcGroupRT) + if err != nil { + return err + } + obj.GnsSvcGroupRT = result.GnsSvcGroupRT + return nil +} + +func (obj *GlobalGnsSvcGroupRT) GetParent(ctx context.Context) (result *GlobalGnsBindingRT, err error) { + hashedName := helper.GetHashedName("gnsbindingrts.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnsbindingrts.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGnsBindingRTByName(ctx, hashedName) +} + +type gnssvcgrouprtGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gnssvcgrouprtGlobalTsmV1Chainer) Subscribe() { + key := "gnssvcgrouprts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsSvcGroupRTInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gnssvcgrouprtGlobalTsmV1Chainer) Unsubscribe() { + key := "gnssvcgrouprts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gnssvcgrouprtGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gnssvcgrouprts.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetGNSSvcGroupByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGNSSvcGroupByName(ctx context.Context, hashedName string) (*GlobalGNSSvcGroup, error) { + key := "gnssvcgroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GNSSvcGroup) + return &GlobalGNSSvcGroup{ + client: group.client, + GNSSvcGroup: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GNSSvcGroups().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGNSSvcGroup{ + client: group.client, + GNSSvcGroup: result, + }, nil + } +} + +// DeleteGNSSvcGroupByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGNSSvcGroupByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GNSSvcGroups().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + GNSSvcGroups().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/gnsServiceGroupsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGNSSvcGroupByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGNSSvcGroupByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GNSSvcGroup) (*GlobalGNSSvcGroup, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ServicesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + GNSSvcGroups().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"gnsServiceGroupsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GNSSvcGroup\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGNSSvcGroup{ + client: group.client, + GNSSvcGroup: result, + }, nil +} + +// UpdateGNSSvcGroupByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGNSSvcGroupByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GNSSvcGroup) (*GlobalGNSSvcGroup, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GNSSvcGroups().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueDisplayName := + objToUpdate.Spec.DisplayName + patchOpDisplayName := PatchOp{ + Op: "replace", + Path: "/spec/displayName", + Value: patchValueDisplayName, + } + patch = append(patch, patchOpDisplayName) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueColor := + objToUpdate.Spec.Color + patchOpColor := PatchOp{ + Op: "replace", + Path: "/spec/color", + Value: patchValueColor, + } + patch = append(patch, patchOpColor) + + patchValueRules := + objToUpdate.Spec.Rules + patchOpRules := PatchOp{ + Op: "replace", + Path: "/spec/rules", + Value: patchValueRules, + } + patch = append(patch, patchOpRules) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GNSSvcGroups().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGNSSvcGroup{ + client: group.client, + GNSSvcGroup: result, + }, nil +} + +// ListGNSSvcGroups returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGNSSvcGroups(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGNSSvcGroup, err error) { + key := "gnssvcgroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGNSSvcGroup, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GNSSvcGroup) + result[k] = &GlobalGNSSvcGroup{ + client: group.client, + GNSSvcGroup: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GNSSvcGroups().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGNSSvcGroup, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGNSSvcGroup{ + client: group.client, + GNSSvcGroup: &item, + } + } + } + return +} + +type GlobalGNSSvcGroup struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GNSSvcGroup +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGNSSvcGroup) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGNSSvcGroupByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GNSSvcGroup = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGNSSvcGroup) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGNSSvcGroupByName(ctx, obj.GNSSvcGroup) + if err != nil { + return err + } + obj.GNSSvcGroup = result.GNSSvcGroup + return nil +} + +func (obj *GlobalGNSSvcGroup) GetParent(ctx context.Context) (result *GlobalGNS, err error) { + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnss.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGNSByName(ctx, hashedName) +} + +// GetAllServices returns all links of given type +func (obj *GlobalGNSSvcGroup) GetAllServices(ctx context.Context) ( + result []*GlobalService, err error) { + result = make([]*GlobalService, 0, len(obj.Spec.ServicesGvk)) + for _, v := range obj.Spec.ServicesGvk { + l, err := obj.client.Global().GetServiceByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServices returns link which has given displayName +func (obj *GlobalGNSSvcGroup) GetServices(ctx context.Context, + displayName string) (result *GlobalService, err error) { + l, ok := obj.Spec.ServicesGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.GNSSvcGroup", "Services", displayName) + } + result, err = obj.client.Global().GetServiceByName(ctx, l.Name) + return +} + +// LinkServices links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalGNSSvcGroup) LinkServices(ctx context.Context, + linkToAdd *GlobalService) error { + + payload := "{\"spec\": {\"servicesGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"Service\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().GNSSvcGroups().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.GNSSvcGroup = result + return nil +} + +// UnlinkServices unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalGNSSvcGroup) UnlinkServices(ctx context.Context, + linkToRemove *GlobalService) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/servicesGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().GNSSvcGroups().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.GNSSvcGroup = result + return nil + +} + +type gnssvcgroupGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gnssvcgroupGlobalTsmV1Chainer) Subscribe() { + key := "gnssvcgroups.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGNSSvcGroupInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gnssvcgroupGlobalTsmV1Chainer) Unsubscribe() { + key := "gnssvcgroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gnssvcgroupGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gnssvcgroups.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetSharedServiceConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetSharedServiceConfigByName(ctx context.Context, hashedName string) (*GlobalSharedServiceConfig, error) { + key := "sharedserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.SharedServiceConfig) + return &GlobalSharedServiceConfig{ + client: group.client, + SharedServiceConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + SharedServiceConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSharedServiceConfig{ + client: group.client, + SharedServiceConfig: result, + }, nil + } +} + +// DeleteSharedServiceConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteSharedServiceConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + SharedServiceConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + SharedServiceConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/sharedServicesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateSharedServiceConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateSharedServiceConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SharedServiceConfig) (*GlobalSharedServiceConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + SharedServiceConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"sharedServicesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"SharedServiceConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSharedServiceConfig{ + client: group.client, + SharedServiceConfig: result, + }, nil +} + +// UpdateSharedServiceConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateSharedServiceConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.SharedServiceConfig) (*GlobalSharedServiceConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + SharedServiceConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + SharedServiceConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalSharedServiceConfig{ + client: group.client, + SharedServiceConfig: result, + }, nil +} + +// ListSharedServiceConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListSharedServiceConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalSharedServiceConfig, err error) { + key := "sharedserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalSharedServiceConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.SharedServiceConfig) + result[k] = &GlobalSharedServiceConfig{ + client: group.client, + SharedServiceConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + SharedServiceConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalSharedServiceConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalSharedServiceConfig{ + client: group.client, + SharedServiceConfig: &item, + } + } + } + return +} + +type GlobalSharedServiceConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.SharedServiceConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalSharedServiceConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteSharedServiceConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.SharedServiceConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalSharedServiceConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateSharedServiceConfigByName(ctx, obj.SharedServiceConfig) + if err != nil { + return err + } + obj.SharedServiceConfig = result.SharedServiceConfig + return nil +} + +func (obj *GlobalSharedServiceConfig) GetParent(ctx context.Context) (result *GlobalGNS, err error) { + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnss.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGNSByName(ctx, hashedName) +} + +type sharedserviceconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *sharedserviceconfigGlobalTsmV1Chainer) Subscribe() { + key := "sharedserviceconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSharedServiceConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *sharedserviceconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "sharedserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *sharedserviceconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "sharedserviceconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetGNSByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGNSByName(ctx context.Context, hashedName string) (*GlobalGNS, error) { + key := "gnss.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GNS) + return &GlobalGNS{ + client: group.client, + GNS: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GNSs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGNS{ + client: group.client, + GNS: result, + }, nil + } +} + +// DeleteGNSByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGNSByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GNSs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + if result.Spec.RoutingConfigGvk != nil { + err := group.client. + Global(). + DeleteGNSRoutingConfigByName(ctx, result.Spec.RoutingConfigGvk.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.GnsServiceGroupsGvk { + err := group.client. + Global().DeleteGNSSvcGroupByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.PublicServicesGvk { + err := group.client. + Global().DeletePublicServiceConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.SharedServicesGvk { + err := group.client. + Global().DeleteSharedServiceConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.SloPoliciesGvk { + err := group.client. + Global().DeleteSLOPolicyByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ExternalServicesGvk { + err := group.client. + Global().DeleteExternalServiceConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.AutoscalingPoliciesGvk { + err := group.client. + Global().DeleteAutoscalingPolicyByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.RoutingPoliciesGvk { + err := group.client. + Global().DeleteGNSRoutingConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ApiDiscoveryGvk { + err := group.client. + Global().DeleteApiDiscoveryByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.GeoDiscoveryGvk { + err := group.client. + Global().DeleteGeoDiscoveryByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.PiiDiscoveryGvk { + err := group.client. + Global().DeletePiiDiscoveryByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.AttackDiscoveryGvk { + err := group.client. + Global().DeleteAttackDiscoveryByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.UserDiscoveryGvk { + err := group.client. + Global().DeleteUserDiscoveryByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.GnsAccessControlPolicyGvk { + err := group.client. + Global().DeleteGnsAccessControlPolicyByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.GnsSchemaViolationDiscoveryGvk { + err := group.client. + Global().DeleteGnsSchemaViolationDiscoveryByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.GnsSegmentationPolicyGvk { + err := group.client. + Global().DeleteGnsSegmentationPolicyByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/gnsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["globalnamespaces.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("globalnamespaces.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GlobalNamespaces().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGNSByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGNSByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GNS) (*GlobalGNS, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.RoutingConfigGvk = nil + objToCreate.Spec.GnsServiceGroupsGvk = nil + objToCreate.Spec.PublicServicesGvk = nil + objToCreate.Spec.SharedServicesGvk = nil + objToCreate.Spec.SloPoliciesGvk = nil + objToCreate.Spec.ExternalServicesGvk = nil + objToCreate.Spec.AutoscalingPoliciesGvk = nil + objToCreate.Spec.RoutingPoliciesGvk = nil + objToCreate.Spec.ApiDiscoveryGvk = nil + objToCreate.Spec.GeoDiscoveryGvk = nil + objToCreate.Spec.PiiDiscoveryGvk = nil + objToCreate.Spec.AttackDiscoveryGvk = nil + objToCreate.Spec.UserDiscoveryGvk = nil + objToCreate.Spec.GnsAccessControlPolicyGvk = nil + objToCreate.Spec.GnsSchemaViolationDiscoveryGvk = nil + objToCreate.Spec.GnsSegmentationPolicyGvk = nil + objToCreate.Spec.MemberGroupsGvk = nil + objToCreate.Spec.MembersGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + GNSs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["globalnamespaces.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("globalnamespaces.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"gnsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GNS\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GlobalNamespaces().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGNS{ + client: group.client, + GNS: result, + }, nil +} + +// UpdateGNSByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGNSByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GNS) (*GlobalGNS, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GNSs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueDomain := + objToUpdate.Spec.Domain + patchOpDomain := PatchOp{ + Op: "replace", + Path: "/spec/domain", + Value: patchValueDomain, + } + patch = append(patch, patchOpDomain) + + patchValueUseSharedGateway := + objToUpdate.Spec.UseSharedGateway + patchOpUseSharedGateway := PatchOp{ + Op: "replace", + Path: "/spec/useSharedGateway", + Value: patchValueUseSharedGateway, + } + patch = append(patch, patchOpUseSharedGateway) + + patchValueMTLSEnforced := + objToUpdate.Spec.MTLSEnforced + patchOpMTLSEnforced := PatchOp{ + Op: "replace", + Path: "/spec/mTLSEnforced", + Value: patchValueMTLSEnforced, + } + patch = append(patch, patchOpMTLSEnforced) + + patchValueMTLSPermissive := + objToUpdate.Spec.MTLSPermissive + patchOpMTLSPermissive := PatchOp{ + Op: "replace", + Path: "/spec/mTLSPermissive", + Value: patchValueMTLSPermissive, + } + patch = append(patch, patchOpMTLSPermissive) + + patchValueApiDiscoveryEnabled := + objToUpdate.Spec.ApiDiscoveryEnabled + patchOpApiDiscoveryEnabled := PatchOp{ + Op: "replace", + Path: "/spec/apiDiscoveryEnabled", + Value: patchValueApiDiscoveryEnabled, + } + patch = append(patch, patchOpApiDiscoveryEnabled) + + patchValueMTLSExceptions := + objToUpdate.Spec.MTLSExceptions + patchOpMTLSExceptions := PatchOp{ + Op: "replace", + Path: "/spec/mTLSExceptions", + Value: patchValueMTLSExceptions, + } + patch = append(patch, patchOpMTLSExceptions) + + patchValueCaType := + objToUpdate.Spec.CaType + patchOpCaType := PatchOp{ + Op: "replace", + Path: "/spec/caType", + Value: patchValueCaType, + } + patch = append(patch, patchOpCaType) + + patchValueCa := + objToUpdate.Spec.Ca + patchOpCa := PatchOp{ + Op: "replace", + Path: "/spec/ca", + Value: patchValueCa, + } + patch = append(patch, patchOpCa) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueColor := + objToUpdate.Spec.Color + patchOpColor := PatchOp{ + Op: "replace", + Path: "/spec/color", + Value: patchValueColor, + } + patch = append(patch, patchOpColor) + + patchValueVersion := + objToUpdate.Spec.Version + patchOpVersion := PatchOp{ + Op: "replace", + Path: "/spec/version", + Value: patchValueVersion, + } + patch = append(patch, patchOpVersion) + + patchValueProjectId := + objToUpdate.Spec.ProjectId + patchOpProjectId := PatchOp{ + Op: "replace", + Path: "/spec/projectId", + Value: patchValueProjectId, + } + patch = append(patch, patchOpProjectId) + + patchValueMemberDomains := + objToUpdate.Spec.MemberDomains + patchOpMemberDomains := PatchOp{ + Op: "replace", + Path: "/spec/memberDomains", + Value: patchValueMemberDomains, + } + patch = append(patch, patchOpMemberDomains) + + patchValueMatchingConditions := + objToUpdate.Spec.MatchingConditions + patchOpMatchingConditions := PatchOp{ + Op: "replace", + Path: "/spec/matchingConditions", + Value: patchValueMatchingConditions, + } + patch = append(patch, patchOpMatchingConditions) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGNS{ + client: group.client, + GNS: result, + }, nil +} + +// ListGNSs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGNSs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGNS, err error) { + key := "gnss.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGNS, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GNS) + result[k] = &GlobalGNS{ + client: group.client, + GNS: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GNSs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGNS, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGNS{ + client: group.client, + GNS: &item, + } + } + } + return +} + +type GlobalGNS struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GNS +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGNS) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGNSByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GNS = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGNS) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGNSByName(ctx, obj.GNS) + if err != nil { + return err + } + obj.GNS = result.GNS + return nil +} + +func (obj *GlobalGNS) GetParent(ctx context.Context) (result *GlobalGlobalNamespace, err error) { + hashedName := helper.GetHashedName("globalnamespaces.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["globalnamespaces.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGlobalNamespaceByName(ctx, hashedName) +} + +// GetRoutingConfig returns child of given type +func (obj *GlobalGNS) GetRoutingConfig(ctx context.Context) ( + result *GlobalGNSRoutingConfig, err error) { + if obj.Spec.RoutingConfigGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GNS", "RoutingConfig") + } + return obj.client.Global().GetGNSRoutingConfigByName(ctx, obj.Spec.RoutingConfigGvk.Name) +} + +// AddRoutingConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGNS) AddRoutingConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GNSRoutingConfig) (result *GlobalGNSRoutingConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnss.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnss.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGNSRoutingConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if getErr == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// DeleteRoutingConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGNS) DeleteRoutingConfig(ctx context.Context) (err error) { + if obj.Spec.RoutingConfigGvk != nil { + err = obj.client. + Global().DeleteGNSRoutingConfigByName(ctx, obj.Spec.RoutingConfigGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetGNSByName(ctx, obj.GetName()) + if err == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// GetAllGnsServiceGroups returns all children of given type +func (obj *GlobalGNS) GetAllGnsServiceGroups(ctx context.Context) ( + result []*GlobalGNSSvcGroup, err error) { + result = make([]*GlobalGNSSvcGroup, 0, len(obj.Spec.GnsServiceGroupsGvk)) + for _, v := range obj.Spec.GnsServiceGroupsGvk { + l, err := obj.client.Global().GetGNSSvcGroupByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGnsServiceGroups returns child which has given displayName +func (obj *GlobalGNS) GetGnsServiceGroups(ctx context.Context, + displayName string) (result *GlobalGNSSvcGroup, err error) { + l, ok := obj.Spec.GnsServiceGroupsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GNS", "GnsServiceGroups", displayName) + } + result, err = obj.client.Global().GetGNSSvcGroupByName(ctx, l.Name) + return +} + +// AddGnsServiceGroups calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGNS) AddGnsServiceGroups(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GNSSvcGroup) (result *GlobalGNSSvcGroup, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnss.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnss.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGNSSvcGroupByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if getErr == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// DeleteGnsServiceGroups calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGNS) DeleteGnsServiceGroups(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GnsServiceGroupsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GNS", "GnsServiceGroups", displayName) + } + err = obj.client.Global().DeleteGNSSvcGroupByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if err == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// GetAllPublicServices returns all children of given type +func (obj *GlobalGNS) GetAllPublicServices(ctx context.Context) ( + result []*GlobalPublicServiceConfig, err error) { + result = make([]*GlobalPublicServiceConfig, 0, len(obj.Spec.PublicServicesGvk)) + for _, v := range obj.Spec.PublicServicesGvk { + l, err := obj.client.Global().GetPublicServiceConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetPublicServices returns child which has given displayName +func (obj *GlobalGNS) GetPublicServices(ctx context.Context, + displayName string) (result *GlobalPublicServiceConfig, err error) { + l, ok := obj.Spec.PublicServicesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GNS", "PublicServices", displayName) + } + result, err = obj.client.Global().GetPublicServiceConfigByName(ctx, l.Name) + return +} + +// AddPublicServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGNS) AddPublicServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PublicServiceConfig) (result *GlobalPublicServiceConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnss.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnss.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreatePublicServiceConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if getErr == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// DeletePublicServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGNS) DeletePublicServices(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.PublicServicesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GNS", "PublicServices", displayName) + } + err = obj.client.Global().DeletePublicServiceConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if err == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// GetAllSharedServices returns all children of given type +func (obj *GlobalGNS) GetAllSharedServices(ctx context.Context) ( + result []*GlobalSharedServiceConfig, err error) { + result = make([]*GlobalSharedServiceConfig, 0, len(obj.Spec.SharedServicesGvk)) + for _, v := range obj.Spec.SharedServicesGvk { + l, err := obj.client.Global().GetSharedServiceConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetSharedServices returns child which has given displayName +func (obj *GlobalGNS) GetSharedServices(ctx context.Context, + displayName string) (result *GlobalSharedServiceConfig, err error) { + l, ok := obj.Spec.SharedServicesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GNS", "SharedServices", displayName) + } + result, err = obj.client.Global().GetSharedServiceConfigByName(ctx, l.Name) + return +} + +// AddSharedServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGNS) AddSharedServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SharedServiceConfig) (result *GlobalSharedServiceConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnss.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnss.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateSharedServiceConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if getErr == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// DeleteSharedServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGNS) DeleteSharedServices(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.SharedServicesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GNS", "SharedServices", displayName) + } + err = obj.client.Global().DeleteSharedServiceConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if err == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// GetAllSloPolicies returns all children of given type +func (obj *GlobalGNS) GetAllSloPolicies(ctx context.Context) ( + result []*GlobalSLOPolicy, err error) { + result = make([]*GlobalSLOPolicy, 0, len(obj.Spec.SloPoliciesGvk)) + for _, v := range obj.Spec.SloPoliciesGvk { + l, err := obj.client.Global().GetSLOPolicyByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetSloPolicies returns child which has given displayName +func (obj *GlobalGNS) GetSloPolicies(ctx context.Context, + displayName string) (result *GlobalSLOPolicy, err error) { + l, ok := obj.Spec.SloPoliciesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GNS", "SloPolicies", displayName) + } + result, err = obj.client.Global().GetSLOPolicyByName(ctx, l.Name) + return +} + +// AddSloPolicies calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGNS) AddSloPolicies(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SLOPolicy) (result *GlobalSLOPolicy, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnss.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnss.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateSLOPolicyByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if getErr == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// DeleteSloPolicies calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGNS) DeleteSloPolicies(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.SloPoliciesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GNS", "SloPolicies", displayName) + } + err = obj.client.Global().DeleteSLOPolicyByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if err == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// GetAllExternalServices returns all children of given type +func (obj *GlobalGNS) GetAllExternalServices(ctx context.Context) ( + result []*GlobalExternalServiceConfig, err error) { + result = make([]*GlobalExternalServiceConfig, 0, len(obj.Spec.ExternalServicesGvk)) + for _, v := range obj.Spec.ExternalServicesGvk { + l, err := obj.client.Global().GetExternalServiceConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetExternalServices returns child which has given displayName +func (obj *GlobalGNS) GetExternalServices(ctx context.Context, + displayName string) (result *GlobalExternalServiceConfig, err error) { + l, ok := obj.Spec.ExternalServicesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GNS", "ExternalServices", displayName) + } + result, err = obj.client.Global().GetExternalServiceConfigByName(ctx, l.Name) + return +} + +// AddExternalServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGNS) AddExternalServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalServiceConfig) (result *GlobalExternalServiceConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnss.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnss.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalServiceConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if getErr == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// DeleteExternalServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGNS) DeleteExternalServices(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ExternalServicesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GNS", "ExternalServices", displayName) + } + err = obj.client.Global().DeleteExternalServiceConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if err == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// GetAllAutoscalingPolicies returns all children of given type +func (obj *GlobalGNS) GetAllAutoscalingPolicies(ctx context.Context) ( + result []*GlobalAutoscalingPolicy, err error) { + result = make([]*GlobalAutoscalingPolicy, 0, len(obj.Spec.AutoscalingPoliciesGvk)) + for _, v := range obj.Spec.AutoscalingPoliciesGvk { + l, err := obj.client.Global().GetAutoscalingPolicyByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetAutoscalingPolicies returns child which has given displayName +func (obj *GlobalGNS) GetAutoscalingPolicies(ctx context.Context, + displayName string) (result *GlobalAutoscalingPolicy, err error) { + l, ok := obj.Spec.AutoscalingPoliciesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GNS", "AutoscalingPolicies", displayName) + } + result, err = obj.client.Global().GetAutoscalingPolicyByName(ctx, l.Name) + return +} + +// AddAutoscalingPolicies calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGNS) AddAutoscalingPolicies(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AutoscalingPolicy) (result *GlobalAutoscalingPolicy, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnss.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnss.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAutoscalingPolicyByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if getErr == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// DeleteAutoscalingPolicies calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGNS) DeleteAutoscalingPolicies(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.AutoscalingPoliciesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GNS", "AutoscalingPolicies", displayName) + } + err = obj.client.Global().DeleteAutoscalingPolicyByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if err == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// GetAllRoutingPolicies returns all children of given type +func (obj *GlobalGNS) GetAllRoutingPolicies(ctx context.Context) ( + result []*GlobalGNSRoutingConfig, err error) { + result = make([]*GlobalGNSRoutingConfig, 0, len(obj.Spec.RoutingPoliciesGvk)) + for _, v := range obj.Spec.RoutingPoliciesGvk { + l, err := obj.client.Global().GetGNSRoutingConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetRoutingPolicies returns child which has given displayName +func (obj *GlobalGNS) GetRoutingPolicies(ctx context.Context, + displayName string) (result *GlobalGNSRoutingConfig, err error) { + l, ok := obj.Spec.RoutingPoliciesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GNS", "RoutingPolicies", displayName) + } + result, err = obj.client.Global().GetGNSRoutingConfigByName(ctx, l.Name) + return +} + +// AddRoutingPolicies calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGNS) AddRoutingPolicies(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GNSRoutingConfig) (result *GlobalGNSRoutingConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnss.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnss.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGNSRoutingConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if getErr == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// DeleteRoutingPolicies calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGNS) DeleteRoutingPolicies(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.RoutingPoliciesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GNS", "RoutingPolicies", displayName) + } + err = obj.client.Global().DeleteGNSRoutingConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if err == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// GetAllApiDiscovery returns all children of given type +func (obj *GlobalGNS) GetAllApiDiscovery(ctx context.Context) ( + result []*GlobalApiDiscovery, err error) { + result = make([]*GlobalApiDiscovery, 0, len(obj.Spec.ApiDiscoveryGvk)) + for _, v := range obj.Spec.ApiDiscoveryGvk { + l, err := obj.client.Global().GetApiDiscoveryByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetApiDiscovery returns child which has given displayName +func (obj *GlobalGNS) GetApiDiscovery(ctx context.Context, + displayName string) (result *GlobalApiDiscovery, err error) { + l, ok := obj.Spec.ApiDiscoveryGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GNS", "ApiDiscovery", displayName) + } + result, err = obj.client.Global().GetApiDiscoveryByName(ctx, l.Name) + return +} + +// AddApiDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGNS) AddApiDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ApiDiscovery) (result *GlobalApiDiscovery, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnss.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnss.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateApiDiscoveryByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if getErr == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// DeleteApiDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGNS) DeleteApiDiscovery(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ApiDiscoveryGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GNS", "ApiDiscovery", displayName) + } + err = obj.client.Global().DeleteApiDiscoveryByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if err == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// GetAllGeoDiscovery returns all children of given type +func (obj *GlobalGNS) GetAllGeoDiscovery(ctx context.Context) ( + result []*GlobalGeoDiscovery, err error) { + result = make([]*GlobalGeoDiscovery, 0, len(obj.Spec.GeoDiscoveryGvk)) + for _, v := range obj.Spec.GeoDiscoveryGvk { + l, err := obj.client.Global().GetGeoDiscoveryByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGeoDiscovery returns child which has given displayName +func (obj *GlobalGNS) GetGeoDiscovery(ctx context.Context, + displayName string) (result *GlobalGeoDiscovery, err error) { + l, ok := obj.Spec.GeoDiscoveryGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GNS", "GeoDiscovery", displayName) + } + result, err = obj.client.Global().GetGeoDiscoveryByName(ctx, l.Name) + return +} + +// AddGeoDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGNS) AddGeoDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GeoDiscovery) (result *GlobalGeoDiscovery, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnss.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnss.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGeoDiscoveryByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if getErr == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// DeleteGeoDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGNS) DeleteGeoDiscovery(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GeoDiscoveryGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GNS", "GeoDiscovery", displayName) + } + err = obj.client.Global().DeleteGeoDiscoveryByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if err == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// GetAllPiiDiscovery returns all children of given type +func (obj *GlobalGNS) GetAllPiiDiscovery(ctx context.Context) ( + result []*GlobalPiiDiscovery, err error) { + result = make([]*GlobalPiiDiscovery, 0, len(obj.Spec.PiiDiscoveryGvk)) + for _, v := range obj.Spec.PiiDiscoveryGvk { + l, err := obj.client.Global().GetPiiDiscoveryByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetPiiDiscovery returns child which has given displayName +func (obj *GlobalGNS) GetPiiDiscovery(ctx context.Context, + displayName string) (result *GlobalPiiDiscovery, err error) { + l, ok := obj.Spec.PiiDiscoveryGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GNS", "PiiDiscovery", displayName) + } + result, err = obj.client.Global().GetPiiDiscoveryByName(ctx, l.Name) + return +} + +// AddPiiDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGNS) AddPiiDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PiiDiscovery) (result *GlobalPiiDiscovery, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnss.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnss.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreatePiiDiscoveryByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if getErr == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// DeletePiiDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGNS) DeletePiiDiscovery(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.PiiDiscoveryGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GNS", "PiiDiscovery", displayName) + } + err = obj.client.Global().DeletePiiDiscoveryByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if err == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// GetAllAttackDiscovery returns all children of given type +func (obj *GlobalGNS) GetAllAttackDiscovery(ctx context.Context) ( + result []*GlobalAttackDiscovery, err error) { + result = make([]*GlobalAttackDiscovery, 0, len(obj.Spec.AttackDiscoveryGvk)) + for _, v := range obj.Spec.AttackDiscoveryGvk { + l, err := obj.client.Global().GetAttackDiscoveryByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetAttackDiscovery returns child which has given displayName +func (obj *GlobalGNS) GetAttackDiscovery(ctx context.Context, + displayName string) (result *GlobalAttackDiscovery, err error) { + l, ok := obj.Spec.AttackDiscoveryGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GNS", "AttackDiscovery", displayName) + } + result, err = obj.client.Global().GetAttackDiscoveryByName(ctx, l.Name) + return +} + +// AddAttackDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGNS) AddAttackDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AttackDiscovery) (result *GlobalAttackDiscovery, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnss.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnss.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAttackDiscoveryByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if getErr == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// DeleteAttackDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGNS) DeleteAttackDiscovery(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.AttackDiscoveryGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GNS", "AttackDiscovery", displayName) + } + err = obj.client.Global().DeleteAttackDiscoveryByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if err == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// GetAllUserDiscovery returns all children of given type +func (obj *GlobalGNS) GetAllUserDiscovery(ctx context.Context) ( + result []*GlobalUserDiscovery, err error) { + result = make([]*GlobalUserDiscovery, 0, len(obj.Spec.UserDiscoveryGvk)) + for _, v := range obj.Spec.UserDiscoveryGvk { + l, err := obj.client.Global().GetUserDiscoveryByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetUserDiscovery returns child which has given displayName +func (obj *GlobalGNS) GetUserDiscovery(ctx context.Context, + displayName string) (result *GlobalUserDiscovery, err error) { + l, ok := obj.Spec.UserDiscoveryGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GNS", "UserDiscovery", displayName) + } + result, err = obj.client.Global().GetUserDiscoveryByName(ctx, l.Name) + return +} + +// AddUserDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGNS) AddUserDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.UserDiscovery) (result *GlobalUserDiscovery, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnss.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnss.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateUserDiscoveryByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if getErr == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// DeleteUserDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGNS) DeleteUserDiscovery(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.UserDiscoveryGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GNS", "UserDiscovery", displayName) + } + err = obj.client.Global().DeleteUserDiscoveryByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if err == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// GetAllGnsAccessControlPolicy returns all children of given type +func (obj *GlobalGNS) GetAllGnsAccessControlPolicy(ctx context.Context) ( + result []*GlobalGnsAccessControlPolicy, err error) { + result = make([]*GlobalGnsAccessControlPolicy, 0, len(obj.Spec.GnsAccessControlPolicyGvk)) + for _, v := range obj.Spec.GnsAccessControlPolicyGvk { + l, err := obj.client.Global().GetGnsAccessControlPolicyByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGnsAccessControlPolicy returns child which has given displayName +func (obj *GlobalGNS) GetGnsAccessControlPolicy(ctx context.Context, + displayName string) (result *GlobalGnsAccessControlPolicy, err error) { + l, ok := obj.Spec.GnsAccessControlPolicyGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GNS", "GnsAccessControlPolicy", displayName) + } + result, err = obj.client.Global().GetGnsAccessControlPolicyByName(ctx, l.Name) + return +} + +// AddGnsAccessControlPolicy calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGNS) AddGnsAccessControlPolicy(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsAccessControlPolicy) (result *GlobalGnsAccessControlPolicy, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnss.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnss.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGnsAccessControlPolicyByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if getErr == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// DeleteGnsAccessControlPolicy calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGNS) DeleteGnsAccessControlPolicy(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GnsAccessControlPolicyGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GNS", "GnsAccessControlPolicy", displayName) + } + err = obj.client.Global().DeleteGnsAccessControlPolicyByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if err == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// GetAllGnsSchemaViolationDiscovery returns all children of given type +func (obj *GlobalGNS) GetAllGnsSchemaViolationDiscovery(ctx context.Context) ( + result []*GlobalGnsSchemaViolationDiscovery, err error) { + result = make([]*GlobalGnsSchemaViolationDiscovery, 0, len(obj.Spec.GnsSchemaViolationDiscoveryGvk)) + for _, v := range obj.Spec.GnsSchemaViolationDiscoveryGvk { + l, err := obj.client.Global().GetGnsSchemaViolationDiscoveryByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGnsSchemaViolationDiscovery returns child which has given displayName +func (obj *GlobalGNS) GetGnsSchemaViolationDiscovery(ctx context.Context, + displayName string) (result *GlobalGnsSchemaViolationDiscovery, err error) { + l, ok := obj.Spec.GnsSchemaViolationDiscoveryGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GNS", "GnsSchemaViolationDiscovery", displayName) + } + result, err = obj.client.Global().GetGnsSchemaViolationDiscoveryByName(ctx, l.Name) + return +} + +// AddGnsSchemaViolationDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGNS) AddGnsSchemaViolationDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery) (result *GlobalGnsSchemaViolationDiscovery, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnss.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnss.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGnsSchemaViolationDiscoveryByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if getErr == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// DeleteGnsSchemaViolationDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGNS) DeleteGnsSchemaViolationDiscovery(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GnsSchemaViolationDiscoveryGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GNS", "GnsSchemaViolationDiscovery", displayName) + } + err = obj.client.Global().DeleteGnsSchemaViolationDiscoveryByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if err == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// GetAllGnsSegmentationPolicy returns all children of given type +func (obj *GlobalGNS) GetAllGnsSegmentationPolicy(ctx context.Context) ( + result []*GlobalGnsSegmentationPolicy, err error) { + result = make([]*GlobalGnsSegmentationPolicy, 0, len(obj.Spec.GnsSegmentationPolicyGvk)) + for _, v := range obj.Spec.GnsSegmentationPolicyGvk { + l, err := obj.client.Global().GetGnsSegmentationPolicyByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGnsSegmentationPolicy returns child which has given displayName +func (obj *GlobalGNS) GetGnsSegmentationPolicy(ctx context.Context, + displayName string) (result *GlobalGnsSegmentationPolicy, err error) { + l, ok := obj.Spec.GnsSegmentationPolicyGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.GNS", "GnsSegmentationPolicy", displayName) + } + result, err = obj.client.Global().GetGnsSegmentationPolicyByName(ctx, l.Name) + return +} + +// AddGnsSegmentationPolicy calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalGNS) AddGnsSegmentationPolicy(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsSegmentationPolicy) (result *GlobalGnsSegmentationPolicy, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["gnss.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["gnss.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateGnsSegmentationPolicyByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if getErr == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// DeleteGnsSegmentationPolicy calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalGNS) DeleteGnsSegmentationPolicy(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.GnsSegmentationPolicyGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.GNS", "GnsSegmentationPolicy", displayName) + } + err = obj.client.Global().DeleteGnsSegmentationPolicyByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetGNSByName(ctx, obj.GetName()) + if err == nil { + obj.GNS = updatedObj.GNS + } + return +} + +// GetAllMemberGroups returns all links of given type +func (obj *GlobalGNS) GetAllMemberGroups(ctx context.Context) ( + result []*GlobalSvcGroup, err error) { + result = make([]*GlobalSvcGroup, 0, len(obj.Spec.MemberGroupsGvk)) + for _, v := range obj.Spec.MemberGroupsGvk { + l, err := obj.client.Global().GetSvcGroupByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetMemberGroups returns link which has given displayName +func (obj *GlobalGNS) GetMemberGroups(ctx context.Context, + displayName string) (result *GlobalSvcGroup, err error) { + l, ok := obj.Spec.MemberGroupsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.GNS", "MemberGroups", displayName) + } + result, err = obj.client.Global().GetSvcGroupByName(ctx, l.Name) + return +} + +// LinkMemberGroups links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalGNS) LinkMemberGroups(ctx context.Context, + linkToAdd *GlobalSvcGroup) error { + + payload := "{\"spec\": {\"memberGroupsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"SvcGroup\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().GNSs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.GNS = result + return nil +} + +// UnlinkMemberGroups unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalGNS) UnlinkMemberGroups(ctx context.Context, + linkToRemove *GlobalSvcGroup) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/memberGroupsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().GNSs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.GNS = result + return nil + +} + +// GetAllMembers returns all links of given type +func (obj *GlobalGNS) GetAllMembers(ctx context.Context) ( + result []*GlobalDomain, err error) { + result = make([]*GlobalDomain, 0, len(obj.Spec.MembersGvk)) + for _, v := range obj.Spec.MembersGvk { + l, err := obj.client.Global().GetDomainByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetMembers returns link which has given displayName +func (obj *GlobalGNS) GetMembers(ctx context.Context, + displayName string) (result *GlobalDomain, err error) { + l, ok := obj.Spec.MembersGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.GNS", "Members", displayName) + } + result, err = obj.client.Global().GetDomainByName(ctx, l.Name) + return +} + +// LinkMembers links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalGNS) LinkMembers(ctx context.Context, + linkToAdd *GlobalDomain) error { + + payload := "{\"spec\": {\"membersGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"Domain\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().GNSs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.GNS = result + return nil +} + +// UnlinkMembers unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalGNS) UnlinkMembers(ctx context.Context, + linkToRemove *GlobalDomain) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/membersGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().GNSs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.GNS = result + return nil + +} + +type gnsGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gnsGlobalTsmV1Chainer) Subscribe() { + key := "gnss.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGNSInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gnsGlobalTsmV1Chainer) Unsubscribe() { + key := "gnss.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gnsGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gnss.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *gnsGlobalTsmV1Chainer) RoutingConfig(name string) *gnsroutingconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gnsroutingconfigs.global.tsm.tanzu.vmware.com"] = name + return &gnsroutingconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetRoutingConfig calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsGlobalTsmV1Chainer) GetRoutingConfig(ctx context.Context, displayName string) (result *GlobalGNSRoutingConfig, err error) { + hashedName := helper.GetHashedName("gnsroutingconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGNSRoutingConfigByName(ctx, hashedName) +} + +// AddRoutingConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsGlobalTsmV1Chainer) AddRoutingConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GNSRoutingConfig) (result *GlobalGNSRoutingConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsroutingconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGNSRoutingConfigByName(ctx, objToCreate) +} + +// DeleteRoutingConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsGlobalTsmV1Chainer) DeleteRoutingConfig(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsroutingconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGNSRoutingConfigByName(ctx, hashedName) +} + +func (c *gnsGlobalTsmV1Chainer) GnsServiceGroups(name string) *gnssvcgroupGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gnssvcgroups.global.tsm.tanzu.vmware.com"] = name + return &gnssvcgroupGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGnsServiceGroups calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsGlobalTsmV1Chainer) GetGnsServiceGroups(ctx context.Context, displayName string) (result *GlobalGNSSvcGroup, err error) { + hashedName := helper.GetHashedName("gnssvcgroups.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGNSSvcGroupByName(ctx, hashedName) +} + +// AddGnsServiceGroups calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsGlobalTsmV1Chainer) AddGnsServiceGroups(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GNSSvcGroup) (result *GlobalGNSSvcGroup, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnssvcgroups.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGNSSvcGroupByName(ctx, objToCreate) +} + +// DeleteGnsServiceGroups calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsGlobalTsmV1Chainer) DeleteGnsServiceGroups(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnssvcgroups.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGNSSvcGroupByName(ctx, hashedName) +} + +func (c *gnsGlobalTsmV1Chainer) PublicServices(name string) *publicserviceconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["publicserviceconfigs.global.tsm.tanzu.vmware.com"] = name + return &publicserviceconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetPublicServices calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsGlobalTsmV1Chainer) GetPublicServices(ctx context.Context, displayName string) (result *GlobalPublicServiceConfig, err error) { + hashedName := helper.GetHashedName("publicserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetPublicServiceConfigByName(ctx, hashedName) +} + +// AddPublicServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsGlobalTsmV1Chainer) AddPublicServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PublicServiceConfig) (result *GlobalPublicServiceConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("publicserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreatePublicServiceConfigByName(ctx, objToCreate) +} + +// DeletePublicServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsGlobalTsmV1Chainer) DeletePublicServices(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("publicserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeletePublicServiceConfigByName(ctx, hashedName) +} + +func (c *gnsGlobalTsmV1Chainer) SharedServices(name string) *sharedserviceconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["sharedserviceconfigs.global.tsm.tanzu.vmware.com"] = name + return &sharedserviceconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetSharedServices calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsGlobalTsmV1Chainer) GetSharedServices(ctx context.Context, displayName string) (result *GlobalSharedServiceConfig, err error) { + hashedName := helper.GetHashedName("sharedserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetSharedServiceConfigByName(ctx, hashedName) +} + +// AddSharedServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsGlobalTsmV1Chainer) AddSharedServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SharedServiceConfig) (result *GlobalSharedServiceConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("sharedserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateSharedServiceConfigByName(ctx, objToCreate) +} + +// DeleteSharedServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsGlobalTsmV1Chainer) DeleteSharedServices(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("sharedserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteSharedServiceConfigByName(ctx, hashedName) +} + +func (c *gnsGlobalTsmV1Chainer) SloPolicies(name string) *slopolicyGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["slopolicies.global.tsm.tanzu.vmware.com"] = name + return &slopolicyGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetSloPolicies calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsGlobalTsmV1Chainer) GetSloPolicies(ctx context.Context, displayName string) (result *GlobalSLOPolicy, err error) { + hashedName := helper.GetHashedName("slopolicies.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetSLOPolicyByName(ctx, hashedName) +} + +// AddSloPolicies calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsGlobalTsmV1Chainer) AddSloPolicies(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SLOPolicy) (result *GlobalSLOPolicy, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("slopolicies.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateSLOPolicyByName(ctx, objToCreate) +} + +// DeleteSloPolicies calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsGlobalTsmV1Chainer) DeleteSloPolicies(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("slopolicies.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteSLOPolicyByName(ctx, hashedName) +} + +func (c *gnsGlobalTsmV1Chainer) ExternalServices(name string) *externalserviceconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externalserviceconfigs.global.tsm.tanzu.vmware.com"] = name + return &externalserviceconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetExternalServices calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsGlobalTsmV1Chainer) GetExternalServices(ctx context.Context, displayName string) (result *GlobalExternalServiceConfig, err error) { + hashedName := helper.GetHashedName("externalserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalServiceConfigByName(ctx, hashedName) +} + +// AddExternalServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsGlobalTsmV1Chainer) AddExternalServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalServiceConfig) (result *GlobalExternalServiceConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalServiceConfigByName(ctx, objToCreate) +} + +// DeleteExternalServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsGlobalTsmV1Chainer) DeleteExternalServices(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externalserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalServiceConfigByName(ctx, hashedName) +} + +func (c *gnsGlobalTsmV1Chainer) AutoscalingPolicies(name string) *autoscalingpolicyGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["autoscalingpolicies.global.tsm.tanzu.vmware.com"] = name + return &autoscalingpolicyGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetAutoscalingPolicies calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsGlobalTsmV1Chainer) GetAutoscalingPolicies(ctx context.Context, displayName string) (result *GlobalAutoscalingPolicy, err error) { + hashedName := helper.GetHashedName("autoscalingpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAutoscalingPolicyByName(ctx, hashedName) +} + +// AddAutoscalingPolicies calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsGlobalTsmV1Chainer) AddAutoscalingPolicies(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AutoscalingPolicy) (result *GlobalAutoscalingPolicy, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("autoscalingpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAutoscalingPolicyByName(ctx, objToCreate) +} + +// DeleteAutoscalingPolicies calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsGlobalTsmV1Chainer) DeleteAutoscalingPolicies(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("autoscalingpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAutoscalingPolicyByName(ctx, hashedName) +} + +func (c *gnsGlobalTsmV1Chainer) RoutingPolicies(name string) *gnsroutingconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gnsroutingconfigs.global.tsm.tanzu.vmware.com"] = name + return &gnsroutingconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetRoutingPolicies calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsGlobalTsmV1Chainer) GetRoutingPolicies(ctx context.Context, displayName string) (result *GlobalGNSRoutingConfig, err error) { + hashedName := helper.GetHashedName("gnsroutingconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGNSRoutingConfigByName(ctx, hashedName) +} + +// AddRoutingPolicies calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsGlobalTsmV1Chainer) AddRoutingPolicies(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GNSRoutingConfig) (result *GlobalGNSRoutingConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsroutingconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGNSRoutingConfigByName(ctx, objToCreate) +} + +// DeleteRoutingPolicies calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsGlobalTsmV1Chainer) DeleteRoutingPolicies(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsroutingconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGNSRoutingConfigByName(ctx, hashedName) +} + +func (c *gnsGlobalTsmV1Chainer) ApiDiscovery(name string) *apidiscoveryGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["apidiscoveries.global.tsm.tanzu.vmware.com"] = name + return &apidiscoveryGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetApiDiscovery calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsGlobalTsmV1Chainer) GetApiDiscovery(ctx context.Context, displayName string) (result *GlobalApiDiscovery, err error) { + hashedName := helper.GetHashedName("apidiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetApiDiscoveryByName(ctx, hashedName) +} + +// AddApiDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsGlobalTsmV1Chainer) AddApiDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ApiDiscovery) (result *GlobalApiDiscovery, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("apidiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateApiDiscoveryByName(ctx, objToCreate) +} + +// DeleteApiDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsGlobalTsmV1Chainer) DeleteApiDiscovery(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("apidiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteApiDiscoveryByName(ctx, hashedName) +} + +func (c *gnsGlobalTsmV1Chainer) GeoDiscovery(name string) *geodiscoveryGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["geodiscoveries.global.tsm.tanzu.vmware.com"] = name + return &geodiscoveryGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGeoDiscovery calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsGlobalTsmV1Chainer) GetGeoDiscovery(ctx context.Context, displayName string) (result *GlobalGeoDiscovery, err error) { + hashedName := helper.GetHashedName("geodiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGeoDiscoveryByName(ctx, hashedName) +} + +// AddGeoDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsGlobalTsmV1Chainer) AddGeoDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GeoDiscovery) (result *GlobalGeoDiscovery, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("geodiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGeoDiscoveryByName(ctx, objToCreate) +} + +// DeleteGeoDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsGlobalTsmV1Chainer) DeleteGeoDiscovery(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("geodiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGeoDiscoveryByName(ctx, hashedName) +} + +func (c *gnsGlobalTsmV1Chainer) PiiDiscovery(name string) *piidiscoveryGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["piidiscoveries.global.tsm.tanzu.vmware.com"] = name + return &piidiscoveryGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetPiiDiscovery calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsGlobalTsmV1Chainer) GetPiiDiscovery(ctx context.Context, displayName string) (result *GlobalPiiDiscovery, err error) { + hashedName := helper.GetHashedName("piidiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetPiiDiscoveryByName(ctx, hashedName) +} + +// AddPiiDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsGlobalTsmV1Chainer) AddPiiDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PiiDiscovery) (result *GlobalPiiDiscovery, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("piidiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreatePiiDiscoveryByName(ctx, objToCreate) +} + +// DeletePiiDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsGlobalTsmV1Chainer) DeletePiiDiscovery(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("piidiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeletePiiDiscoveryByName(ctx, hashedName) +} + +func (c *gnsGlobalTsmV1Chainer) AttackDiscovery(name string) *attackdiscoveryGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["attackdiscoveries.global.tsm.tanzu.vmware.com"] = name + return &attackdiscoveryGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetAttackDiscovery calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsGlobalTsmV1Chainer) GetAttackDiscovery(ctx context.Context, displayName string) (result *GlobalAttackDiscovery, err error) { + hashedName := helper.GetHashedName("attackdiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAttackDiscoveryByName(ctx, hashedName) +} + +// AddAttackDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsGlobalTsmV1Chainer) AddAttackDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AttackDiscovery) (result *GlobalAttackDiscovery, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("attackdiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAttackDiscoveryByName(ctx, objToCreate) +} + +// DeleteAttackDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsGlobalTsmV1Chainer) DeleteAttackDiscovery(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("attackdiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAttackDiscoveryByName(ctx, hashedName) +} + +func (c *gnsGlobalTsmV1Chainer) UserDiscovery(name string) *userdiscoveryGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["userdiscoveries.global.tsm.tanzu.vmware.com"] = name + return &userdiscoveryGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetUserDiscovery calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsGlobalTsmV1Chainer) GetUserDiscovery(ctx context.Context, displayName string) (result *GlobalUserDiscovery, err error) { + hashedName := helper.GetHashedName("userdiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetUserDiscoveryByName(ctx, hashedName) +} + +// AddUserDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsGlobalTsmV1Chainer) AddUserDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.UserDiscovery) (result *GlobalUserDiscovery, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("userdiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateUserDiscoveryByName(ctx, objToCreate) +} + +// DeleteUserDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsGlobalTsmV1Chainer) DeleteUserDiscovery(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("userdiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteUserDiscoveryByName(ctx, hashedName) +} + +func (c *gnsGlobalTsmV1Chainer) GnsAccessControlPolicy(name string) *gnsaccesscontrolpolicyGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gnsaccesscontrolpolicies.global.tsm.tanzu.vmware.com"] = name + return &gnsaccesscontrolpolicyGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGnsAccessControlPolicy calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsGlobalTsmV1Chainer) GetGnsAccessControlPolicy(ctx context.Context, displayName string) (result *GlobalGnsAccessControlPolicy, err error) { + hashedName := helper.GetHashedName("gnsaccesscontrolpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGnsAccessControlPolicyByName(ctx, hashedName) +} + +// AddGnsAccessControlPolicy calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsGlobalTsmV1Chainer) AddGnsAccessControlPolicy(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsAccessControlPolicy) (result *GlobalGnsAccessControlPolicy, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsaccesscontrolpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGnsAccessControlPolicyByName(ctx, objToCreate) +} + +// DeleteGnsAccessControlPolicy calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsGlobalTsmV1Chainer) DeleteGnsAccessControlPolicy(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsaccesscontrolpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGnsAccessControlPolicyByName(ctx, hashedName) +} + +func (c *gnsGlobalTsmV1Chainer) GnsSchemaViolationDiscovery(name string) *gnsschemaviolationdiscoveryGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gnsschemaviolationdiscoveries.global.tsm.tanzu.vmware.com"] = name + return &gnsschemaviolationdiscoveryGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGnsSchemaViolationDiscovery calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsGlobalTsmV1Chainer) GetGnsSchemaViolationDiscovery(ctx context.Context, displayName string) (result *GlobalGnsSchemaViolationDiscovery, err error) { + hashedName := helper.GetHashedName("gnsschemaviolationdiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGnsSchemaViolationDiscoveryByName(ctx, hashedName) +} + +// AddGnsSchemaViolationDiscovery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsGlobalTsmV1Chainer) AddGnsSchemaViolationDiscovery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery) (result *GlobalGnsSchemaViolationDiscovery, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsschemaviolationdiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGnsSchemaViolationDiscoveryByName(ctx, objToCreate) +} + +// DeleteGnsSchemaViolationDiscovery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsGlobalTsmV1Chainer) DeleteGnsSchemaViolationDiscovery(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnsschemaviolationdiscoveries.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGnsSchemaViolationDiscoveryByName(ctx, hashedName) +} + +func (c *gnsGlobalTsmV1Chainer) GnsSegmentationPolicy(name string) *gnssegmentationpolicyGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["gnssegmentationpolicies.global.tsm.tanzu.vmware.com"] = name + return &gnssegmentationpolicyGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetGnsSegmentationPolicy calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *gnsGlobalTsmV1Chainer) GetGnsSegmentationPolicy(ctx context.Context, displayName string) (result *GlobalGnsSegmentationPolicy, err error) { + hashedName := helper.GetHashedName("gnssegmentationpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetGnsSegmentationPolicyByName(ctx, hashedName) +} + +// AddGnsSegmentationPolicy calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *gnsGlobalTsmV1Chainer) AddGnsSegmentationPolicy(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsSegmentationPolicy) (result *GlobalGnsSegmentationPolicy, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnssegmentationpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateGnsSegmentationPolicyByName(ctx, objToCreate) +} + +// DeleteGnsSegmentationPolicy calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *gnsGlobalTsmV1Chainer) DeleteGnsSegmentationPolicy(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("gnssegmentationpolicies.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteGnsSegmentationPolicyByName(ctx, hashedName) +} + +// GetHaConfigV2ByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetHaConfigV2ByName(ctx context.Context, hashedName string) (*GlobalHaConfigV2, error) { + key := "haconfigv2s.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.HaConfigV2) + return &GlobalHaConfigV2{ + client: group.client, + HaConfigV2: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + HaConfigV2s().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalHaConfigV2{ + client: group.client, + HaConfigV2: result, + }, nil + } +} + +// DeleteHaConfigV2ByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteHaConfigV2ByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + HaConfigV2s().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + HaConfigV2s().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/haConfigV2Gvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["hostconfigv2s.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("hostconfigv2s.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + HostConfigV2s().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateHaConfigV2ByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateHaConfigV2ByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.HaConfigV2) (*GlobalHaConfigV2, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + HaConfigV2s().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["hostconfigv2s.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("hostconfigv2s.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/haConfigV2Gvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "HaConfigV2", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + HostConfigV2s().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalHaConfigV2{ + client: group.client, + HaConfigV2: result, + }, nil +} + +// UpdateHaConfigV2ByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateHaConfigV2ByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.HaConfigV2) (*GlobalHaConfigV2, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + HaConfigV2s().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueConfigType := + objToUpdate.Spec.ConfigType + patchOpConfigType := PatchOp{ + Op: "replace", + Path: "/spec/configType", + Value: patchValueConfigType, + } + patch = append(patch, patchOpConfigType) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + HaConfigV2s().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalHaConfigV2{ + client: group.client, + HaConfigV2: result, + }, nil +} + +// ListHaConfigV2s returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListHaConfigV2s(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalHaConfigV2, err error) { + key := "haconfigv2s.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalHaConfigV2, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.HaConfigV2) + result[k] = &GlobalHaConfigV2{ + client: group.client, + HaConfigV2: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + HaConfigV2s().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalHaConfigV2, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalHaConfigV2{ + client: group.client, + HaConfigV2: &item, + } + } + } + return +} + +type GlobalHaConfigV2 struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.HaConfigV2 +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalHaConfigV2) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteHaConfigV2ByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.HaConfigV2 = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalHaConfigV2) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateHaConfigV2ByName(ctx, obj.HaConfigV2) + if err != nil { + return err + } + obj.HaConfigV2 = result.HaConfigV2 + return nil +} + +func (obj *GlobalHaConfigV2) GetParent(ctx context.Context) (result *GlobalHostConfigV2, err error) { + hashedName := helper.GetHashedName("hostconfigv2s.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["hostconfigv2s.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetHostConfigV2ByName(ctx, hashedName) +} + +type haconfigv2GlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *haconfigv2GlobalTsmV1Chainer) Subscribe() { + key := "haconfigv2s.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewHaConfigV2Informer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *haconfigv2GlobalTsmV1Chainer) Unsubscribe() { + key := "haconfigv2s.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *haconfigv2GlobalTsmV1Chainer) IsSubscribed() bool { + key := "haconfigv2s.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetHaConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetHaConfigByName(ctx context.Context, hashedName string) (*GlobalHaConfig, error) { + key := "haconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.HaConfig) + return &GlobalHaConfig{ + client: group.client, + HaConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + HaConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalHaConfig{ + client: group.client, + HaConfig: result, + }, nil + } +} + +// DeleteHaConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteHaConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + HaConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + HaConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/haConfigGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["hostconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("hostconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + HostConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateHaConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateHaConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.HaConfig) (*GlobalHaConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + HaConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["hostconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("hostconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/haConfigGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "HaConfig", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + HostConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalHaConfig{ + client: group.client, + HaConfig: result, + }, nil +} + +// UpdateHaConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateHaConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.HaConfig) (*GlobalHaConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + HaConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueConfigType := + objToUpdate.Spec.ConfigType + patchOpConfigType := PatchOp{ + Op: "replace", + Path: "/spec/configType", + Value: patchValueConfigType, + } + patch = append(patch, patchOpConfigType) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + HaConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalHaConfig{ + client: group.client, + HaConfig: result, + }, nil +} + +// ListHaConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListHaConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalHaConfig, err error) { + key := "haconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalHaConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.HaConfig) + result[k] = &GlobalHaConfig{ + client: group.client, + HaConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + HaConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalHaConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalHaConfig{ + client: group.client, + HaConfig: &item, + } + } + } + return +} + +type GlobalHaConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.HaConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalHaConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteHaConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.HaConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalHaConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateHaConfigByName(ctx, obj.HaConfig) + if err != nil { + return err + } + obj.HaConfig = result.HaConfig + return nil +} + +func (obj *GlobalHaConfig) GetParent(ctx context.Context) (result *GlobalHostConfig, err error) { + hashedName := helper.GetHashedName("hostconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["hostconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetHostConfigByName(ctx, hashedName) +} + +type haconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *haconfigGlobalTsmV1Chainer) Subscribe() { + key := "haconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewHaConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *haconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "haconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *haconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "haconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetHealthCheckConfigNByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetHealthCheckConfigNByName(ctx context.Context, hashedName string) (*GlobalHealthCheckConfigN, error) { + key := "healthcheckconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.HealthCheckConfigN) + return &GlobalHealthCheckConfigN{ + client: group.client, + HealthCheckConfigN: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + HealthCheckConfigNs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalHealthCheckConfigN{ + client: group.client, + HealthCheckConfigN: result, + }, nil + } +} + +// DeleteHealthCheckConfigNByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteHealthCheckConfigNByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + HealthCheckConfigNs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + HealthCheckConfigNs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/healthChecksGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["templates.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("templates.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Templates().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateHealthCheckConfigNByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateHealthCheckConfigNByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.HealthCheckConfigN) (*GlobalHealthCheckConfigN, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + HealthCheckConfigNs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["templates.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("templates.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"healthChecksGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"HealthCheckConfigN\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Templates().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalHealthCheckConfigN{ + client: group.client, + HealthCheckConfigN: result, + }, nil +} + +// UpdateHealthCheckConfigNByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateHealthCheckConfigNByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.HealthCheckConfigN) (*GlobalHealthCheckConfigN, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + HealthCheckConfigNs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueProjectId := + objToUpdate.Spec.ProjectId + patchOpProjectId := PatchOp{ + Op: "replace", + Path: "/spec/projectId", + Value: patchValueProjectId, + } + patch = append(patch, patchOpProjectId) + + patchValueConfig := + objToUpdate.Spec.Config + patchOpConfig := PatchOp{ + Op: "replace", + Path: "/spec/config", + Value: patchValueConfig, + } + patch = append(patch, patchOpConfig) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + HealthCheckConfigNs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalHealthCheckConfigN{ + client: group.client, + HealthCheckConfigN: result, + }, nil +} + +// ListHealthCheckConfigNs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListHealthCheckConfigNs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalHealthCheckConfigN, err error) { + key := "healthcheckconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalHealthCheckConfigN, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.HealthCheckConfigN) + result[k] = &GlobalHealthCheckConfigN{ + client: group.client, + HealthCheckConfigN: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + HealthCheckConfigNs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalHealthCheckConfigN, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalHealthCheckConfigN{ + client: group.client, + HealthCheckConfigN: &item, + } + } + } + return +} + +type GlobalHealthCheckConfigN struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.HealthCheckConfigN +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalHealthCheckConfigN) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteHealthCheckConfigNByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.HealthCheckConfigN = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalHealthCheckConfigN) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateHealthCheckConfigNByName(ctx, obj.HealthCheckConfigN) + if err != nil { + return err + } + obj.HealthCheckConfigN = result.HealthCheckConfigN + return nil +} + +func (obj *GlobalHealthCheckConfigN) GetParent(ctx context.Context) (result *GlobalTemplate, err error) { + hashedName := helper.GetHashedName("templates.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["templates.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetTemplateByName(ctx, hashedName) +} + +type healthcheckconfignGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *healthcheckconfignGlobalTsmV1Chainer) Subscribe() { + key := "healthcheckconfigns.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewHealthCheckConfigNInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *healthcheckconfignGlobalTsmV1Chainer) Unsubscribe() { + key := "healthcheckconfigns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *healthcheckconfignGlobalTsmV1Chainer) IsSubscribed() bool { + key := "healthcheckconfigns.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetHostConfigV2ByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetHostConfigV2ByName(ctx context.Context, hashedName string) (*GlobalHostConfigV2, error) { + key := "hostconfigv2s.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.HostConfigV2) + return &GlobalHostConfigV2{ + client: group.client, + HostConfigV2: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + HostConfigV2s().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalHostConfigV2{ + client: group.client, + HostConfigV2: result, + }, nil + } +} + +// DeleteHostConfigV2ByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteHostConfigV2ByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + HostConfigV2s().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + if result.Spec.HaConfigV2Gvk != nil { + err := group.client. + Global(). + DeleteHaConfigV2ByName(ctx, result.Spec.HaConfigV2Gvk.Name) + if err != nil { + return err + } + } + + if result.Spec.OutboundAuthenticationModeGvk != nil { + err := group.client. + Global(). + DeleteOutboundAuthenticationModeByName(ctx, result.Spec.OutboundAuthenticationModeGvk.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + HostConfigV2s().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/hostConfigV2Gvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateHostConfigV2ByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateHostConfigV2ByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.HostConfigV2) (*GlobalHostConfigV2, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.HaConfigV2Gvk = nil + objToCreate.Spec.OutboundAuthenticationModeGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + HostConfigV2s().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"hostConfigV2Gvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"HostConfigV2\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalHostConfigV2{ + client: group.client, + HostConfigV2: result, + }, nil +} + +// UpdateHostConfigV2ByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateHostConfigV2ByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.HostConfigV2) (*GlobalHostConfigV2, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + HostConfigV2s().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueHost := + objToUpdate.Spec.Host + patchOpHost := PatchOp{ + Op: "replace", + Path: "/spec/host", + Value: patchValueHost, + } + patch = append(patch, patchOpHost) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + HostConfigV2s().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalHostConfigV2{ + client: group.client, + HostConfigV2: result, + }, nil +} + +// ListHostConfigV2s returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListHostConfigV2s(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalHostConfigV2, err error) { + key := "hostconfigv2s.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalHostConfigV2, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.HostConfigV2) + result[k] = &GlobalHostConfigV2{ + client: group.client, + HostConfigV2: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + HostConfigV2s().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalHostConfigV2, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalHostConfigV2{ + client: group.client, + HostConfigV2: &item, + } + } + } + return +} + +type GlobalHostConfigV2 struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.HostConfigV2 +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalHostConfigV2) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteHostConfigV2ByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.HostConfigV2 = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalHostConfigV2) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateHostConfigV2ByName(ctx, obj.HostConfigV2) + if err != nil { + return err + } + obj.HostConfigV2 = result.HostConfigV2 + return nil +} + +func (obj *GlobalHostConfigV2) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +// GetHaConfigV2 returns child of given type +func (obj *GlobalHostConfigV2) GetHaConfigV2(ctx context.Context) ( + result *GlobalHaConfigV2, err error) { + if obj.Spec.HaConfigV2Gvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.HostConfigV2", "HaConfigV2") + } + return obj.client.Global().GetHaConfigV2ByName(ctx, obj.Spec.HaConfigV2Gvk.Name) +} + +// AddHaConfigV2 calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalHostConfigV2) AddHaConfigV2(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.HaConfigV2) (result *GlobalHaConfigV2, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["hostconfigv2s.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["hostconfigv2s.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateHaConfigV2ByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetHostConfigV2ByName(ctx, obj.GetName()) + if getErr == nil { + obj.HostConfigV2 = updatedObj.HostConfigV2 + } + return +} + +// DeleteHaConfigV2 calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalHostConfigV2) DeleteHaConfigV2(ctx context.Context) (err error) { + if obj.Spec.HaConfigV2Gvk != nil { + err = obj.client. + Global().DeleteHaConfigV2ByName(ctx, obj.Spec.HaConfigV2Gvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetHostConfigV2ByName(ctx, obj.GetName()) + if err == nil { + obj.HostConfigV2 = updatedObj.HostConfigV2 + } + return +} + +// GetOutboundAuthenticationMode returns child of given type +func (obj *GlobalHostConfigV2) GetOutboundAuthenticationMode(ctx context.Context) ( + result *GlobalOutboundAuthenticationMode, err error) { + if obj.Spec.OutboundAuthenticationModeGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.HostConfigV2", "OutboundAuthenticationMode") + } + return obj.client.Global().GetOutboundAuthenticationModeByName(ctx, obj.Spec.OutboundAuthenticationModeGvk.Name) +} + +// AddOutboundAuthenticationMode calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalHostConfigV2) AddOutboundAuthenticationMode(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.OutboundAuthenticationMode) (result *GlobalOutboundAuthenticationMode, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["hostconfigv2s.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["hostconfigv2s.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateOutboundAuthenticationModeByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetHostConfigV2ByName(ctx, obj.GetName()) + if getErr == nil { + obj.HostConfigV2 = updatedObj.HostConfigV2 + } + return +} + +// DeleteOutboundAuthenticationMode calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalHostConfigV2) DeleteOutboundAuthenticationMode(ctx context.Context) (err error) { + if obj.Spec.OutboundAuthenticationModeGvk != nil { + err = obj.client. + Global().DeleteOutboundAuthenticationModeByName(ctx, obj.Spec.OutboundAuthenticationModeGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetHostConfigV2ByName(ctx, obj.GetName()) + if err == nil { + obj.HostConfigV2 = updatedObj.HostConfigV2 + } + return +} + +type hostconfigv2GlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *hostconfigv2GlobalTsmV1Chainer) Subscribe() { + key := "hostconfigv2s.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewHostConfigV2Informer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *hostconfigv2GlobalTsmV1Chainer) Unsubscribe() { + key := "hostconfigv2s.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *hostconfigv2GlobalTsmV1Chainer) IsSubscribed() bool { + key := "hostconfigv2s.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *hostconfigv2GlobalTsmV1Chainer) HaConfigV2(name string) *haconfigv2GlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["haconfigv2s.global.tsm.tanzu.vmware.com"] = name + return &haconfigv2GlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetHaConfigV2 calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *hostconfigv2GlobalTsmV1Chainer) GetHaConfigV2(ctx context.Context, displayName string) (result *GlobalHaConfigV2, err error) { + hashedName := helper.GetHashedName("haconfigv2s.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetHaConfigV2ByName(ctx, hashedName) +} + +// AddHaConfigV2 calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *hostconfigv2GlobalTsmV1Chainer) AddHaConfigV2(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.HaConfigV2) (result *GlobalHaConfigV2, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("haconfigv2s.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateHaConfigV2ByName(ctx, objToCreate) +} + +// DeleteHaConfigV2 calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *hostconfigv2GlobalTsmV1Chainer) DeleteHaConfigV2(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("haconfigv2s.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteHaConfigV2ByName(ctx, hashedName) +} + +func (c *hostconfigv2GlobalTsmV1Chainer) OutboundAuthenticationMode(name string) *outboundauthenticationmodeGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["outboundauthenticationmodes.global.tsm.tanzu.vmware.com"] = name + return &outboundauthenticationmodeGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetOutboundAuthenticationMode calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *hostconfigv2GlobalTsmV1Chainer) GetOutboundAuthenticationMode(ctx context.Context, displayName string) (result *GlobalOutboundAuthenticationMode, err error) { + hashedName := helper.GetHashedName("outboundauthenticationmodes.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetOutboundAuthenticationModeByName(ctx, hashedName) +} + +// AddOutboundAuthenticationMode calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *hostconfigv2GlobalTsmV1Chainer) AddOutboundAuthenticationMode(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.OutboundAuthenticationMode) (result *GlobalOutboundAuthenticationMode, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("outboundauthenticationmodes.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateOutboundAuthenticationModeByName(ctx, objToCreate) +} + +// DeleteOutboundAuthenticationMode calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *hostconfigv2GlobalTsmV1Chainer) DeleteOutboundAuthenticationMode(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("outboundauthenticationmodes.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteOutboundAuthenticationModeByName(ctx, hashedName) +} + +// GetHostConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetHostConfigByName(ctx context.Context, hashedName string) (*GlobalHostConfig, error) { + key := "hostconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.HostConfig) + return &GlobalHostConfig{ + client: group.client, + HostConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + HostConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalHostConfig{ + client: group.client, + HostConfig: result, + }, nil + } +} + +// DeleteHostConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteHostConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + HostConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + if result.Spec.HaConfigGvk != nil { + err := group.client. + Global(). + DeleteHaConfigByName(ctx, result.Spec.HaConfigGvk.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + HostConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/hostConfigGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["clusterconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateHostConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateHostConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.HostConfig) (*GlobalHostConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.HaConfigGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + HostConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["clusterconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"hostConfigGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"HostConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalHostConfig{ + client: group.client, + HostConfig: result, + }, nil +} + +// UpdateHostConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateHostConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.HostConfig) (*GlobalHostConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + HostConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueHost := + objToUpdate.Spec.Host + patchOpHost := PatchOp{ + Op: "replace", + Path: "/spec/host", + Value: patchValueHost, + } + patch = append(patch, patchOpHost) + + patchValueOwnedBy := + objToUpdate.Spec.OwnedBy + patchOpOwnedBy := PatchOp{ + Op: "replace", + Path: "/spec/ownedBy", + Value: patchValueOwnedBy, + } + patch = append(patch, patchOpOwnedBy) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + HostConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalHostConfig{ + client: group.client, + HostConfig: result, + }, nil +} + +// ListHostConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListHostConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalHostConfig, err error) { + key := "hostconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalHostConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.HostConfig) + result[k] = &GlobalHostConfig{ + client: group.client, + HostConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + HostConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalHostConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalHostConfig{ + client: group.client, + HostConfig: &item, + } + } + } + return +} + +type GlobalHostConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.HostConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalHostConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteHostConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.HostConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalHostConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateHostConfigByName(ctx, obj.HostConfig) + if err != nil { + return err + } + obj.HostConfig = result.HostConfig + return nil +} + +func (obj *GlobalHostConfig) GetParent(ctx context.Context) (result *GlobalClusterConfig, err error) { + hashedName := helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["clusterconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetClusterConfigByName(ctx, hashedName) +} + +// GetHaConfig returns child of given type +func (obj *GlobalHostConfig) GetHaConfig(ctx context.Context) ( + result *GlobalHaConfig, err error) { + if obj.Spec.HaConfigGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.HostConfig", "HaConfig") + } + return obj.client.Global().GetHaConfigByName(ctx, obj.Spec.HaConfigGvk.Name) +} + +// AddHaConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalHostConfig) AddHaConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.HaConfig) (result *GlobalHaConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["hostconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["hostconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateHaConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetHostConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.HostConfig = updatedObj.HostConfig + } + return +} + +// DeleteHaConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalHostConfig) DeleteHaConfig(ctx context.Context) (err error) { + if obj.Spec.HaConfigGvk != nil { + err = obj.client. + Global().DeleteHaConfigByName(ctx, obj.Spec.HaConfigGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetHostConfigByName(ctx, obj.GetName()) + if err == nil { + obj.HostConfig = updatedObj.HostConfig + } + return +} + +type hostconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *hostconfigGlobalTsmV1Chainer) Subscribe() { + key := "hostconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewHostConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *hostconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "hostconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *hostconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "hostconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *hostconfigGlobalTsmV1Chainer) HaConfig(name string) *haconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["haconfigs.global.tsm.tanzu.vmware.com"] = name + return &haconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetHaConfig calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *hostconfigGlobalTsmV1Chainer) GetHaConfig(ctx context.Context, displayName string) (result *GlobalHaConfig, err error) { + hashedName := helper.GetHashedName("haconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetHaConfigByName(ctx, hashedName) +} + +// AddHaConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *hostconfigGlobalTsmV1Chainer) AddHaConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.HaConfig) (result *GlobalHaConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("haconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateHaConfigByName(ctx, objToCreate) +} + +// DeleteHaConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *hostconfigGlobalTsmV1Chainer) DeleteHaConfig(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("haconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteHaConfigByName(ctx, hashedName) +} + +// GetInboundAuthenticationConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetInboundAuthenticationConfigByName(ctx context.Context, hashedName string) (*GlobalInboundAuthenticationConfig, error) { + key := "inboundauthenticationconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.InboundAuthenticationConfig) + return &GlobalInboundAuthenticationConfig{ + client: group.client, + InboundAuthenticationConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + InboundAuthenticationConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalInboundAuthenticationConfig{ + client: group.client, + InboundAuthenticationConfig: result, + }, nil + } +} + +// DeleteInboundAuthenticationConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteInboundAuthenticationConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + InboundAuthenticationConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + InboundAuthenticationConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/inboundAuthenticationConfigGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateInboundAuthenticationConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateInboundAuthenticationConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.InboundAuthenticationConfig) (*GlobalInboundAuthenticationConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + InboundAuthenticationConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"inboundAuthenticationConfigGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"InboundAuthenticationConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalInboundAuthenticationConfig{ + client: group.client, + InboundAuthenticationConfig: result, + }, nil +} + +// UpdateInboundAuthenticationConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateInboundAuthenticationConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.InboundAuthenticationConfig) (*GlobalInboundAuthenticationConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + InboundAuthenticationConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueOwnedBy := + objToUpdate.Spec.OwnedBy + patchOpOwnedBy := PatchOp{ + Op: "replace", + Path: "/spec/ownedBy", + Value: patchValueOwnedBy, + } + patch = append(patch, patchOpOwnedBy) + + patchValueMode := + objToUpdate.Spec.Mode + patchOpMode := PatchOp{ + Op: "replace", + Path: "/spec/mode", + Value: patchValueMode, + } + patch = append(patch, patchOpMode) + + patchValuePorts := + objToUpdate.Spec.Ports + patchOpPorts := PatchOp{ + Op: "replace", + Path: "/spec/ports", + Value: patchValuePorts, + } + patch = append(patch, patchOpPorts) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + InboundAuthenticationConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalInboundAuthenticationConfig{ + client: group.client, + InboundAuthenticationConfig: result, + }, nil +} + +// ListInboundAuthenticationConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListInboundAuthenticationConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalInboundAuthenticationConfig, err error) { + key := "inboundauthenticationconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalInboundAuthenticationConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.InboundAuthenticationConfig) + result[k] = &GlobalInboundAuthenticationConfig{ + client: group.client, + InboundAuthenticationConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + InboundAuthenticationConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalInboundAuthenticationConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalInboundAuthenticationConfig{ + client: group.client, + InboundAuthenticationConfig: &item, + } + } + } + return +} + +type GlobalInboundAuthenticationConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.InboundAuthenticationConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalInboundAuthenticationConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteInboundAuthenticationConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.InboundAuthenticationConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalInboundAuthenticationConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateInboundAuthenticationConfigByName(ctx, obj.InboundAuthenticationConfig) + if err != nil { + return err + } + obj.InboundAuthenticationConfig = result.InboundAuthenticationConfig + return nil +} + +func (obj *GlobalInboundAuthenticationConfig) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type inboundauthenticationconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *inboundauthenticationconfigGlobalTsmV1Chainer) Subscribe() { + key := "inboundauthenticationconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewInboundAuthenticationConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *inboundauthenticationconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "inboundauthenticationconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *inboundauthenticationconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "inboundauthenticationconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetInventoryByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetInventoryByName(ctx context.Context, hashedName string) (*GlobalInventory, error) { + key := "inventories.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Inventory) + return &GlobalInventory{ + client: group.client, + Inventory: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Inventories().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalInventory{ + client: group.client, + Inventory: result, + }, nil + } +} + +// DeleteInventoryByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteInventoryByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Inventories().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.RegionsGvk { + err := group.client. + Global().DeleteDCRegionByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ClustersGvk { + err := group.client. + Global().DeleteClusterByName(ctx, v.Name) + if err != nil { + return err + } + } + + if result.Spec.JobFolderGvk != nil { + err := group.client. + Global(). + DeleteJobFolderByName(ctx, result.Spec.JobFolderGvk.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ExternalDNSGvk { + err := group.client. + Global().DeleteExternalDNSInventoryByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + Inventories().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/inventoryGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["roots.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("roots.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Roots().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateInventoryByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateInventoryByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Inventory) (*GlobalInventory, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] == "" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.Labels[common.DISPLAY_NAME_LABEL]) + } + + objToCreate.Spec.RegionsGvk = nil + objToCreate.Spec.ClustersGvk = nil + objToCreate.Spec.JobFolderGvk = nil + objToCreate.Spec.ExternalDNSGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + Inventories().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["roots.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("roots.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/inventoryGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "Inventory", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Roots().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalInventory{ + client: group.client, + Inventory: result, + }, nil +} + +// UpdateInventoryByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateInventoryByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Inventory) (*GlobalInventory, error) { + if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) + } + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Inventories().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Inventories().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalInventory{ + client: group.client, + Inventory: result, + }, nil +} + +// ListInventories returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListInventories(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalInventory, err error) { + key := "inventories.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalInventory, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Inventory) + result[k] = &GlobalInventory{ + client: group.client, + Inventory: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Inventories().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalInventory, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalInventory{ + client: group.client, + Inventory: &item, + } + } + } + return +} + +type GlobalInventory struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Inventory +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalInventory) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteInventoryByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Inventory = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalInventory) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateInventoryByName(ctx, obj.Inventory) + if err != nil { + return err + } + obj.Inventory = result.Inventory + return nil +} + +func (obj *GlobalInventory) GetParent(ctx context.Context) (result *GlobalRoot, err error) { + hashedName := helper.GetHashedName("roots.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["roots.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetRootByName(ctx, hashedName) +} + +// GetAllRegions returns all children of given type +func (obj *GlobalInventory) GetAllRegions(ctx context.Context) ( + result []*GlobalDCRegion, err error) { + result = make([]*GlobalDCRegion, 0, len(obj.Spec.RegionsGvk)) + for _, v := range obj.Spec.RegionsGvk { + l, err := obj.client.Global().GetDCRegionByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetRegions returns child which has given displayName +func (obj *GlobalInventory) GetRegions(ctx context.Context, + displayName string) (result *GlobalDCRegion, err error) { + l, ok := obj.Spec.RegionsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Inventory", "Regions", displayName) + } + result, err = obj.client.Global().GetDCRegionByName(ctx, l.Name) + return +} + +// AddRegions calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalInventory) AddRegions(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DCRegion) (result *GlobalDCRegion, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["inventories.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["inventories.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDCRegionByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetInventoryByName(ctx, obj.GetName()) + if getErr == nil { + obj.Inventory = updatedObj.Inventory + } + return +} + +// DeleteRegions calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalInventory) DeleteRegions(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.RegionsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Inventory", "Regions", displayName) + } + err = obj.client.Global().DeleteDCRegionByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetInventoryByName(ctx, obj.GetName()) + if err == nil { + obj.Inventory = updatedObj.Inventory + } + return +} + +// GetAllClusters returns all children of given type +func (obj *GlobalInventory) GetAllClusters(ctx context.Context) ( + result []*GlobalCluster, err error) { + result = make([]*GlobalCluster, 0, len(obj.Spec.ClustersGvk)) + for _, v := range obj.Spec.ClustersGvk { + l, err := obj.client.Global().GetClusterByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetClusters returns child which has given displayName +func (obj *GlobalInventory) GetClusters(ctx context.Context, + displayName string) (result *GlobalCluster, err error) { + l, ok := obj.Spec.ClustersGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Inventory", "Clusters", displayName) + } + result, err = obj.client.Global().GetClusterByName(ctx, l.Name) + return +} + +// AddClusters calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalInventory) AddClusters(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Cluster) (result *GlobalCluster, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["inventories.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["inventories.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateClusterByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetInventoryByName(ctx, obj.GetName()) + if getErr == nil { + obj.Inventory = updatedObj.Inventory + } + return +} + +// DeleteClusters calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalInventory) DeleteClusters(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ClustersGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Inventory", "Clusters", displayName) + } + err = obj.client.Global().DeleteClusterByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetInventoryByName(ctx, obj.GetName()) + if err == nil { + obj.Inventory = updatedObj.Inventory + } + return +} + +// GetJobFolder returns child of given type +func (obj *GlobalInventory) GetJobFolder(ctx context.Context) ( + result *GlobalJobFolder, err error) { + if obj.Spec.JobFolderGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Inventory", "JobFolder") + } + return obj.client.Global().GetJobFolderByName(ctx, obj.Spec.JobFolderGvk.Name) +} + +// AddJobFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalInventory) AddJobFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.JobFolder) (result *GlobalJobFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["inventories.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["inventories.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateJobFolderByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetInventoryByName(ctx, obj.GetName()) + if getErr == nil { + obj.Inventory = updatedObj.Inventory + } + return +} + +// DeleteJobFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalInventory) DeleteJobFolder(ctx context.Context) (err error) { + if obj.Spec.JobFolderGvk != nil { + err = obj.client. + Global().DeleteJobFolderByName(ctx, obj.Spec.JobFolderGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetInventoryByName(ctx, obj.GetName()) + if err == nil { + obj.Inventory = updatedObj.Inventory + } + return +} + +// GetAllExternalDNS returns all children of given type +func (obj *GlobalInventory) GetAllExternalDNS(ctx context.Context) ( + result []*GlobalExternalDNSInventory, err error) { + result = make([]*GlobalExternalDNSInventory, 0, len(obj.Spec.ExternalDNSGvk)) + for _, v := range obj.Spec.ExternalDNSGvk { + l, err := obj.client.Global().GetExternalDNSInventoryByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetExternalDNS returns child which has given displayName +func (obj *GlobalInventory) GetExternalDNS(ctx context.Context, + displayName string) (result *GlobalExternalDNSInventory, err error) { + l, ok := obj.Spec.ExternalDNSGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Inventory", "ExternalDNS", displayName) + } + result, err = obj.client.Global().GetExternalDNSInventoryByName(ctx, l.Name) + return +} + +// AddExternalDNS calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalInventory) AddExternalDNS(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventory) (result *GlobalExternalDNSInventory, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["inventories.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["inventories.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalDNSInventoryByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetInventoryByName(ctx, obj.GetName()) + if getErr == nil { + obj.Inventory = updatedObj.Inventory + } + return +} + +// DeleteExternalDNS calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalInventory) DeleteExternalDNS(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ExternalDNSGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Inventory", "ExternalDNS", displayName) + } + err = obj.client.Global().DeleteExternalDNSInventoryByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetInventoryByName(ctx, obj.GetName()) + if err == nil { + obj.Inventory = updatedObj.Inventory + } + return +} + +type inventoryGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *inventoryGlobalTsmV1Chainer) Subscribe() { + key := "inventories.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewInventoryInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *inventoryGlobalTsmV1Chainer) Unsubscribe() { + key := "inventories.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *inventoryGlobalTsmV1Chainer) IsSubscribed() bool { + key := "inventories.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *inventoryGlobalTsmV1Chainer) Regions(name string) *dcregionGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["dcregions.global.tsm.tanzu.vmware.com"] = name + return &dcregionGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetRegions calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *inventoryGlobalTsmV1Chainer) GetRegions(ctx context.Context, displayName string) (result *GlobalDCRegion, err error) { + hashedName := helper.GetHashedName("dcregions.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetDCRegionByName(ctx, hashedName) +} + +// AddRegions calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *inventoryGlobalTsmV1Chainer) AddRegions(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DCRegion) (result *GlobalDCRegion, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("dcregions.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDCRegionByName(ctx, objToCreate) +} + +// DeleteRegions calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *inventoryGlobalTsmV1Chainer) DeleteRegions(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("dcregions.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDCRegionByName(ctx, hashedName) +} + +func (c *inventoryGlobalTsmV1Chainer) Clusters(name string) *clusterGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["clusters.global.tsm.tanzu.vmware.com"] = name + return &clusterGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetClusters calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *inventoryGlobalTsmV1Chainer) GetClusters(ctx context.Context, displayName string) (result *GlobalCluster, err error) { + hashedName := helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetClusterByName(ctx, hashedName) +} + +// AddClusters calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *inventoryGlobalTsmV1Chainer) AddClusters(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Cluster) (result *GlobalCluster, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateClusterByName(ctx, objToCreate) +} + +// DeleteClusters calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *inventoryGlobalTsmV1Chainer) DeleteClusters(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteClusterByName(ctx, hashedName) +} + +func (c *inventoryGlobalTsmV1Chainer) JobFolder(name string) *jobfolderGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["jobfolders.global.tsm.tanzu.vmware.com"] = name + return &jobfolderGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetJobFolder calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *inventoryGlobalTsmV1Chainer) GetJobFolder(ctx context.Context, displayName string) (result *GlobalJobFolder, err error) { + hashedName := helper.GetHashedName("jobfolders.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetJobFolderByName(ctx, hashedName) +} + +// AddJobFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *inventoryGlobalTsmV1Chainer) AddJobFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.JobFolder) (result *GlobalJobFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("jobfolders.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateJobFolderByName(ctx, objToCreate) +} + +// DeleteJobFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *inventoryGlobalTsmV1Chainer) DeleteJobFolder(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("jobfolders.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteJobFolderByName(ctx, hashedName) +} + +func (c *inventoryGlobalTsmV1Chainer) ExternalDNS(name string) *externaldnsinventoryGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externaldnsinventories.global.tsm.tanzu.vmware.com"] = name + return &externaldnsinventoryGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetExternalDNS calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *inventoryGlobalTsmV1Chainer) GetExternalDNS(ctx context.Context, displayName string) (result *GlobalExternalDNSInventory, err error) { + hashedName := helper.GetHashedName("externaldnsinventories.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetExternalDNSInventoryByName(ctx, hashedName) +} + +// AddExternalDNS calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *inventoryGlobalTsmV1Chainer) AddExternalDNS(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSInventory) (result *GlobalExternalDNSInventory, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsinventories.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalDNSInventoryByName(ctx, objToCreate) +} + +// DeleteExternalDNS calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *inventoryGlobalTsmV1Chainer) DeleteExternalDNS(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsinventories.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalDNSInventoryByName(ctx, hashedName) +} + +// GetIssuerByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetIssuerByName(ctx context.Context, hashedName string) (*GlobalIssuer, error) { + key := "issuers.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Issuer) + return &GlobalIssuer{ + client: group.client, + Issuer: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Issuers().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalIssuer{ + client: group.client, + Issuer: result, + }, nil + } +} + +// DeleteIssuerByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteIssuerByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Issuers().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + Issuers().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/issuersGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateIssuerByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateIssuerByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Issuer) (*GlobalIssuer, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + Issuers().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"issuersGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"Issuer\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalIssuer{ + client: group.client, + Issuer: result, + }, nil +} + +// UpdateIssuerByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateIssuerByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Issuer) (*GlobalIssuer, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Issuers().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueVenafi := + objToUpdate.Spec.Venafi + patchOpVenafi := PatchOp{ + Op: "replace", + Path: "/spec/venafi", + Value: patchValueVenafi, + } + patch = append(patch, patchOpVenafi) + + patchValueStatus := + objToUpdate.Spec.Status + patchOpStatus := PatchOp{ + Op: "replace", + Path: "/spec/status", + Value: patchValueStatus, + } + patch = append(patch, patchOpStatus) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Issuers().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalIssuer{ + client: group.client, + Issuer: result, + }, nil +} + +// ListIssuers returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListIssuers(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalIssuer, err error) { + key := "issuers.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalIssuer, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Issuer) + result[k] = &GlobalIssuer{ + client: group.client, + Issuer: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Issuers().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalIssuer, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalIssuer{ + client: group.client, + Issuer: &item, + } + } + } + return +} + +type GlobalIssuer struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Issuer +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalIssuer) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteIssuerByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Issuer = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalIssuer) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateIssuerByName(ctx, obj.Issuer) + if err != nil { + return err + } + obj.Issuer = result.Issuer + return nil +} + +func (obj *GlobalIssuer) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +type issuerGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *issuerGlobalTsmV1Chainer) Subscribe() { + key := "issuers.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewIssuerInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *issuerGlobalTsmV1Chainer) Unsubscribe() { + key := "issuers.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *issuerGlobalTsmV1Chainer) IsSubscribed() bool { + key := "issuers.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetJobConfigFolderByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetJobConfigFolderByName(ctx context.Context, hashedName string) (*GlobalJobConfigFolder, error) { + key := "jobconfigfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.JobConfigFolder) + return &GlobalJobConfigFolder{ + client: group.client, + JobConfigFolder: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + JobConfigFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalJobConfigFolder{ + client: group.client, + JobConfigFolder: result, + }, nil + } +} + +// DeleteJobConfigFolderByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteJobConfigFolderByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + JobConfigFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.JobConfigGvk { + err := group.client. + Global().DeleteJobConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + JobConfigFolders().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/jobConfigFolderGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateJobConfigFolderByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateJobConfigFolderByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.JobConfigFolder) (*GlobalJobConfigFolder, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] == "" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.Labels[common.DISPLAY_NAME_LABEL]) + } + + objToCreate.Spec.JobConfigGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + JobConfigFolders().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/jobConfigFolderGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "JobConfigFolder", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalJobConfigFolder{ + client: group.client, + JobConfigFolder: result, + }, nil +} + +// UpdateJobConfigFolderByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateJobConfigFolderByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.JobConfigFolder) (*GlobalJobConfigFolder, error) { + if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) + } + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + JobConfigFolders().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + JobConfigFolders().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalJobConfigFolder{ + client: group.client, + JobConfigFolder: result, + }, nil +} + +// ListJobConfigFolders returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListJobConfigFolders(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalJobConfigFolder, err error) { + key := "jobconfigfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalJobConfigFolder, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.JobConfigFolder) + result[k] = &GlobalJobConfigFolder{ + client: group.client, + JobConfigFolder: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + JobConfigFolders().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalJobConfigFolder, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalJobConfigFolder{ + client: group.client, + JobConfigFolder: &item, + } + } + } + return +} + +type GlobalJobConfigFolder struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.JobConfigFolder +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalJobConfigFolder) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteJobConfigFolderByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.JobConfigFolder = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalJobConfigFolder) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateJobConfigFolderByName(ctx, obj.JobConfigFolder) + if err != nil { + return err + } + obj.JobConfigFolder = result.JobConfigFolder + return nil +} + +func (obj *GlobalJobConfigFolder) GetParent(ctx context.Context) (result *GlobalRuntime, err error) { + hashedName := helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["runtimes.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetRuntimeByName(ctx, hashedName) +} + +// GetAllJobConfig returns all children of given type +func (obj *GlobalJobConfigFolder) GetAllJobConfig(ctx context.Context) ( + result []*GlobalJobConfig, err error) { + result = make([]*GlobalJobConfig, 0, len(obj.Spec.JobConfigGvk)) + for _, v := range obj.Spec.JobConfigGvk { + l, err := obj.client.Global().GetJobConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetJobConfig returns child which has given displayName +func (obj *GlobalJobConfigFolder) GetJobConfig(ctx context.Context, + displayName string) (result *GlobalJobConfig, err error) { + l, ok := obj.Spec.JobConfigGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.JobConfigFolder", "JobConfig", displayName) + } + result, err = obj.client.Global().GetJobConfigByName(ctx, l.Name) + return +} + +// AddJobConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalJobConfigFolder) AddJobConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.JobConfig) (result *GlobalJobConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["jobconfigfolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["jobconfigfolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateJobConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetJobConfigFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.JobConfigFolder = updatedObj.JobConfigFolder + } + return +} + +// DeleteJobConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalJobConfigFolder) DeleteJobConfig(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.JobConfigGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.JobConfigFolder", "JobConfig", displayName) + } + err = obj.client.Global().DeleteJobConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetJobConfigFolderByName(ctx, obj.GetName()) + if err == nil { + obj.JobConfigFolder = updatedObj.JobConfigFolder + } + return +} + +type jobconfigfolderGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *jobconfigfolderGlobalTsmV1Chainer) Subscribe() { + key := "jobconfigfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewJobConfigFolderInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *jobconfigfolderGlobalTsmV1Chainer) Unsubscribe() { + key := "jobconfigfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *jobconfigfolderGlobalTsmV1Chainer) IsSubscribed() bool { + key := "jobconfigfolders.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *jobconfigfolderGlobalTsmV1Chainer) JobConfig(name string) *jobconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["jobconfigs.global.tsm.tanzu.vmware.com"] = name + return &jobconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetJobConfig calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *jobconfigfolderGlobalTsmV1Chainer) GetJobConfig(ctx context.Context, displayName string) (result *GlobalJobConfig, err error) { + hashedName := helper.GetHashedName("jobconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetJobConfigByName(ctx, hashedName) +} + +// AddJobConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *jobconfigfolderGlobalTsmV1Chainer) AddJobConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.JobConfig) (result *GlobalJobConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("jobconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateJobConfigByName(ctx, objToCreate) +} + +// DeleteJobConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *jobconfigfolderGlobalTsmV1Chainer) DeleteJobConfig(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("jobconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteJobConfigByName(ctx, hashedName) +} + +// GetJobConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetJobConfigByName(ctx context.Context, hashedName string) (*GlobalJobConfig, error) { + key := "jobconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.JobConfig) + return &GlobalJobConfig{ + client: group.client, + JobConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + JobConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalJobConfig{ + client: group.client, + JobConfig: result, + }, nil + } +} + +// DeleteJobConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteJobConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + JobConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + JobConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/jobConfigGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["jobconfigfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("jobconfigfolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + JobConfigFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateJobConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateJobConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.JobConfig) (*GlobalJobConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + JobConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["jobconfigfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("jobconfigfolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"jobConfigGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"JobConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + JobConfigFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalJobConfig{ + client: group.client, + JobConfig: result, + }, nil +} + +// UpdateJobConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateJobConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.JobConfig) (*GlobalJobConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + JobConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueConfig := + objToUpdate.Spec.Config + patchOpConfig := PatchOp{ + Op: "replace", + Path: "/spec/config", + Value: patchValueConfig, + } + patch = append(patch, patchOpConfig) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + JobConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalJobConfig{ + client: group.client, + JobConfig: result, + }, nil +} + +// ListJobConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListJobConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalJobConfig, err error) { + key := "jobconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalJobConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.JobConfig) + result[k] = &GlobalJobConfig{ + client: group.client, + JobConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + JobConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalJobConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalJobConfig{ + client: group.client, + JobConfig: &item, + } + } + } + return +} + +type GlobalJobConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.JobConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalJobConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteJobConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.JobConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalJobConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateJobConfigByName(ctx, obj.JobConfig) + if err != nil { + return err + } + obj.JobConfig = result.JobConfig + return nil +} + +func (obj *GlobalJobConfig) GetParent(ctx context.Context) (result *GlobalJobConfigFolder, err error) { + hashedName := helper.GetHashedName("jobconfigfolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["jobconfigfolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetJobConfigFolderByName(ctx, hashedName) +} + +type jobconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *jobconfigGlobalTsmV1Chainer) Subscribe() { + key := "jobconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewJobConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *jobconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "jobconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *jobconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "jobconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetJobFolderByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetJobFolderByName(ctx context.Context, hashedName string) (*GlobalJobFolder, error) { + key := "jobfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.JobFolder) + return &GlobalJobFolder{ + client: group.client, + JobFolder: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + JobFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalJobFolder{ + client: group.client, + JobFolder: result, + }, nil + } +} + +// DeleteJobFolderByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteJobFolderByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + JobFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.JobsGvk { + err := group.client. + Global().DeleteJobByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + JobFolders().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/jobFolderGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["inventories.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("inventories.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Inventories().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateJobFolderByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateJobFolderByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.JobFolder) (*GlobalJobFolder, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.JobsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + JobFolders().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["inventories.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("inventories.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/jobFolderGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "JobFolder", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Inventories().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalJobFolder{ + client: group.client, + JobFolder: result, + }, nil +} + +// UpdateJobFolderByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateJobFolderByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.JobFolder) (*GlobalJobFolder, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + JobFolders().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + JobFolders().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalJobFolder{ + client: group.client, + JobFolder: result, + }, nil +} + +// ListJobFolders returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListJobFolders(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalJobFolder, err error) { + key := "jobfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalJobFolder, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.JobFolder) + result[k] = &GlobalJobFolder{ + client: group.client, + JobFolder: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + JobFolders().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalJobFolder, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalJobFolder{ + client: group.client, + JobFolder: &item, + } + } + } + return +} + +type GlobalJobFolder struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.JobFolder +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalJobFolder) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteJobFolderByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.JobFolder = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalJobFolder) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateJobFolderByName(ctx, obj.JobFolder) + if err != nil { + return err + } + obj.JobFolder = result.JobFolder + return nil +} + +func (obj *GlobalJobFolder) GetParent(ctx context.Context) (result *GlobalInventory, err error) { + hashedName := helper.GetHashedName("inventories.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["inventories.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetInventoryByName(ctx, hashedName) +} + +// GetAllJobs returns all children of given type +func (obj *GlobalJobFolder) GetAllJobs(ctx context.Context) ( + result []*GlobalJob, err error) { + result = make([]*GlobalJob, 0, len(obj.Spec.JobsGvk)) + for _, v := range obj.Spec.JobsGvk { + l, err := obj.client.Global().GetJobByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetJobs returns child which has given displayName +func (obj *GlobalJobFolder) GetJobs(ctx context.Context, + displayName string) (result *GlobalJob, err error) { + l, ok := obj.Spec.JobsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.JobFolder", "Jobs", displayName) + } + result, err = obj.client.Global().GetJobByName(ctx, l.Name) + return +} + +// AddJobs calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalJobFolder) AddJobs(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Job) (result *GlobalJob, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["jobfolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["jobfolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateJobByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetJobFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.JobFolder = updatedObj.JobFolder + } + return +} + +// DeleteJobs calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalJobFolder) DeleteJobs(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.JobsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.JobFolder", "Jobs", displayName) + } + err = obj.client.Global().DeleteJobByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetJobFolderByName(ctx, obj.GetName()) + if err == nil { + obj.JobFolder = updatedObj.JobFolder + } + return +} + +type jobfolderGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *jobfolderGlobalTsmV1Chainer) Subscribe() { + key := "jobfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewJobFolderInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *jobfolderGlobalTsmV1Chainer) Unsubscribe() { + key := "jobfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *jobfolderGlobalTsmV1Chainer) IsSubscribed() bool { + key := "jobfolders.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *jobfolderGlobalTsmV1Chainer) Jobs(name string) *jobGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["jobs.global.tsm.tanzu.vmware.com"] = name + return &jobGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetJobs calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *jobfolderGlobalTsmV1Chainer) GetJobs(ctx context.Context, displayName string) (result *GlobalJob, err error) { + hashedName := helper.GetHashedName("jobs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetJobByName(ctx, hashedName) +} + +// AddJobs calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *jobfolderGlobalTsmV1Chainer) AddJobs(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Job) (result *GlobalJob, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("jobs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateJobByName(ctx, objToCreate) +} + +// DeleteJobs calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *jobfolderGlobalTsmV1Chainer) DeleteJobs(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("jobs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteJobByName(ctx, hashedName) +} + +// GetJobByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetJobByName(ctx context.Context, hashedName string) (*GlobalJob, error) { + key := "jobs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Job) + return &GlobalJob{ + client: group.client, + Job: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Jobs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalJob{ + client: group.client, + Job: result, + }, nil + } +} + +// DeleteJobByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteJobByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Jobs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + Jobs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/jobsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["jobfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("jobfolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + JobFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateJobByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateJobByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Job) (*GlobalJob, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + Jobs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["jobfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("jobfolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"jobsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"Job\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + JobFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalJob{ + client: group.client, + Job: result, + }, nil +} + +// UpdateJobByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateJobByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Job) (*GlobalJob, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Jobs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueStatus := + objToUpdate.Spec.Status + patchOpStatus := PatchOp{ + Op: "replace", + Path: "/spec/status", + Value: patchValueStatus, + } + patch = append(patch, patchOpStatus) + + patchValueProjectId := + objToUpdate.Spec.ProjectId + patchOpProjectId := PatchOp{ + Op: "replace", + Path: "/spec/projectId", + Value: patchValueProjectId, + } + patch = append(patch, patchOpProjectId) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Jobs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalJob{ + client: group.client, + Job: result, + }, nil +} + +// ListJobs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListJobs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalJob, err error) { + key := "jobs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalJob, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Job) + result[k] = &GlobalJob{ + client: group.client, + Job: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Jobs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalJob, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalJob{ + client: group.client, + Job: &item, + } + } + } + return +} + +type GlobalJob struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Job +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalJob) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteJobByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Job = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalJob) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateJobByName(ctx, obj.Job) + if err != nil { + return err + } + obj.Job = result.Job + return nil +} + +func (obj *GlobalJob) GetParent(ctx context.Context) (result *GlobalJobFolder, err error) { + hashedName := helper.GetHashedName("jobfolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["jobfolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetJobFolderByName(ctx, hashedName) +} + +type jobGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *jobGlobalTsmV1Chainer) Subscribe() { + key := "jobs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewJobInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *jobGlobalTsmV1Chainer) Unsubscribe() { + key := "jobs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *jobGlobalTsmV1Chainer) IsSubscribed() bool { + key := "jobs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetKnativeIngressByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetKnativeIngressByName(ctx context.Context, hashedName string) (*GlobalKnativeIngress, error) { + key := "knativeingresses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.KnativeIngress) + return &GlobalKnativeIngress{ + client: group.client, + KnativeIngress: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + KnativeIngresses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalKnativeIngress{ + client: group.client, + KnativeIngress: result, + }, nil + } +} + +// DeleteKnativeIngressByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteKnativeIngressByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + KnativeIngresses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + KnativeIngresses().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/knativeIngressesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateKnativeIngressByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateKnativeIngressByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.KnativeIngress) (*GlobalKnativeIngress, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + KnativeIngresses().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"knativeIngressesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"KnativeIngress\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalKnativeIngress{ + client: group.client, + KnativeIngress: result, + }, nil +} + +// UpdateKnativeIngressByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateKnativeIngressByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.KnativeIngress) (*GlobalKnativeIngress, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + KnativeIngresses().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueCreationTimestamp := + objToUpdate.Spec.CreationTimestamp + patchOpCreationTimestamp := PatchOp{ + Op: "replace", + Path: "/spec/creationTimestamp", + Value: patchValueCreationTimestamp, + } + patch = append(patch, patchOpCreationTimestamp) + + patchValueApiLink := + objToUpdate.Spec.ApiLink + patchOpApiLink := PatchOp{ + Op: "replace", + Path: "/spec/apiLink", + Value: patchValueApiLink, + } + patch = append(patch, patchOpApiLink) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueAnnotations := + objToUpdate.Spec.Annotations + patchOpAnnotations := PatchOp{ + Op: "replace", + Path: "/spec/annotations", + Value: patchValueAnnotations, + } + patch = append(patch, patchOpAnnotations) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + KnativeIngresses().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalKnativeIngress{ + client: group.client, + KnativeIngress: result, + }, nil +} + +// ListKnativeIngresses returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListKnativeIngresses(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalKnativeIngress, err error) { + key := "knativeingresses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalKnativeIngress, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.KnativeIngress) + result[k] = &GlobalKnativeIngress{ + client: group.client, + KnativeIngress: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + KnativeIngresses().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalKnativeIngress, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalKnativeIngress{ + client: group.client, + KnativeIngress: &item, + } + } + } + return +} + +type GlobalKnativeIngress struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.KnativeIngress +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalKnativeIngress) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteKnativeIngressByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.KnativeIngress = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalKnativeIngress) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateKnativeIngressByName(ctx, obj.KnativeIngress) + if err != nil { + return err + } + obj.KnativeIngress = result.KnativeIngress + return nil +} + +func (obj *GlobalKnativeIngress) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +type knativeingressGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *knativeingressGlobalTsmV1Chainer) Subscribe() { + key := "knativeingresses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewKnativeIngressInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *knativeingressGlobalTsmV1Chainer) Unsubscribe() { + key := "knativeingresses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *knativeingressGlobalTsmV1Chainer) IsSubscribed() bool { + key := "knativeingresses.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetLabelConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetLabelConfigByName(ctx context.Context, hashedName string) (*GlobalLabelConfig, error) { + key := "labelconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.LabelConfig) + return &GlobalLabelConfig{ + client: group.client, + LabelConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + LabelConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalLabelConfig{ + client: group.client, + LabelConfig: result, + }, nil + } +} + +// DeleteLabelConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteLabelConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + LabelConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + LabelConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/labelConfigGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateLabelConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateLabelConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.LabelConfig) (*GlobalLabelConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + LabelConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/labelConfigGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "LabelConfig", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalLabelConfig{ + client: group.client, + LabelConfig: result, + }, nil +} + +// UpdateLabelConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateLabelConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.LabelConfig) (*GlobalLabelConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + LabelConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + LabelConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalLabelConfig{ + client: group.client, + LabelConfig: result, + }, nil +} + +// ListLabelConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListLabelConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalLabelConfig, err error) { + key := "labelconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalLabelConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.LabelConfig) + result[k] = &GlobalLabelConfig{ + client: group.client, + LabelConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + LabelConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalLabelConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalLabelConfig{ + client: group.client, + LabelConfig: &item, + } + } + } + return +} + +type GlobalLabelConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.LabelConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalLabelConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteLabelConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.LabelConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalLabelConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateLabelConfigByName(ctx, obj.LabelConfig) + if err != nil { + return err + } + obj.LabelConfig = result.LabelConfig + return nil +} + +func (obj *GlobalLabelConfig) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type labelconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *labelconfigGlobalTsmV1Chainer) Subscribe() { + key := "labelconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewLabelConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *labelconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "labelconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *labelconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "labelconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetLocalRegistrationServiceClusterByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetLocalRegistrationServiceClusterByName(ctx context.Context, hashedName string) (*GlobalLocalRegistrationServiceCluster, error) { + key := "localregistrationserviceclusters.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster) + return &GlobalLocalRegistrationServiceCluster{ + client: group.client, + LocalRegistrationServiceCluster: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServiceClusters().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalLocalRegistrationServiceCluster{ + client: group.client, + LocalRegistrationServiceCluster: result, + }, nil + } +} + +// DeleteLocalRegistrationServiceClusterByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteLocalRegistrationServiceClusterByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServiceClusters().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.ResourcesGvk { + err := group.client. + Global().DeleteLocalRegistrationServiceResourceByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServiceClusters().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/clustersGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["localregistrationservices.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("localregistrationservices.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServices().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateLocalRegistrationServiceClusterByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateLocalRegistrationServiceClusterByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster) (*GlobalLocalRegistrationServiceCluster, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ResourcesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServiceClusters().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["localregistrationservices.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("localregistrationservices.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"clustersGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"LocalRegistrationServiceCluster\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServices().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalLocalRegistrationServiceCluster{ + client: group.client, + LocalRegistrationServiceCluster: result, + }, nil +} + +// UpdateLocalRegistrationServiceClusterByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateLocalRegistrationServiceClusterByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster) (*GlobalLocalRegistrationServiceCluster, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServiceClusters().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueTenant := + objToUpdate.Spec.Tenant + patchOpTenant := PatchOp{ + Op: "replace", + Path: "/spec/tenant", + Value: patchValueTenant, + } + patch = append(patch, patchOpTenant) + + patchValueType := + objToUpdate.Spec.Type + patchOpType := PatchOp{ + Op: "replace", + Path: "/spec/type", + Value: patchValueType, + } + patch = append(patch, patchOpType) + + patchValueVersion := + objToUpdate.Spec.Version + patchOpVersion := PatchOp{ + Op: "replace", + Path: "/spec/version", + Value: patchValueVersion, + } + patch = append(patch, patchOpVersion) + + patchValueErrorCount := + objToUpdate.Spec.ErrorCount + patchOpErrorCount := PatchOp{ + Op: "replace", + Path: "/spec/errorCount", + Value: patchValueErrorCount, + } + patch = append(patch, patchOpErrorCount) + + patchValueRestartCount := + objToUpdate.Spec.RestartCount + patchOpRestartCount := PatchOp{ + Op: "replace", + Path: "/spec/restartCount", + Value: patchValueRestartCount, + } + patch = append(patch, patchOpRestartCount) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServiceClusters().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalLocalRegistrationServiceCluster{ + client: group.client, + LocalRegistrationServiceCluster: result, + }, nil +} + +// ListLocalRegistrationServiceClusters returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListLocalRegistrationServiceClusters(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalLocalRegistrationServiceCluster, err error) { + key := "localregistrationserviceclusters.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalLocalRegistrationServiceCluster, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster) + result[k] = &GlobalLocalRegistrationServiceCluster{ + client: group.client, + LocalRegistrationServiceCluster: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + LocalRegistrationServiceClusters().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalLocalRegistrationServiceCluster, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalLocalRegistrationServiceCluster{ + client: group.client, + LocalRegistrationServiceCluster: &item, + } + } + } + return +} + +type GlobalLocalRegistrationServiceCluster struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalLocalRegistrationServiceCluster) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteLocalRegistrationServiceClusterByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.LocalRegistrationServiceCluster = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalLocalRegistrationServiceCluster) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateLocalRegistrationServiceClusterByName(ctx, obj.LocalRegistrationServiceCluster) + if err != nil { + return err + } + obj.LocalRegistrationServiceCluster = result.LocalRegistrationServiceCluster + return nil +} + +func (obj *GlobalLocalRegistrationServiceCluster) GetParent(ctx context.Context) (result *GlobalLocalRegistrationService, err error) { + hashedName := helper.GetHashedName("localregistrationservices.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["localregistrationservices.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetLocalRegistrationServiceByName(ctx, hashedName) +} + +// GetAllResources returns all children of given type +func (obj *GlobalLocalRegistrationServiceCluster) GetAllResources(ctx context.Context) ( + result []*GlobalLocalRegistrationServiceResource, err error) { + result = make([]*GlobalLocalRegistrationServiceResource, 0, len(obj.Spec.ResourcesGvk)) + for _, v := range obj.Spec.ResourcesGvk { + l, err := obj.client.Global().GetLocalRegistrationServiceResourceByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetResources returns child which has given displayName +func (obj *GlobalLocalRegistrationServiceCluster) GetResources(ctx context.Context, + displayName string) (result *GlobalLocalRegistrationServiceResource, err error) { + l, ok := obj.Spec.ResourcesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.LocalRegistrationServiceCluster", "Resources", displayName) + } + result, err = obj.client.Global().GetLocalRegistrationServiceResourceByName(ctx, l.Name) + return +} + +// AddResources calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalLocalRegistrationServiceCluster) AddResources(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource) (result *GlobalLocalRegistrationServiceResource, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["localregistrationserviceclusters.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["localregistrationserviceclusters.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateLocalRegistrationServiceResourceByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetLocalRegistrationServiceClusterByName(ctx, obj.GetName()) + if getErr == nil { + obj.LocalRegistrationServiceCluster = updatedObj.LocalRegistrationServiceCluster + } + return +} + +// DeleteResources calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalLocalRegistrationServiceCluster) DeleteResources(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ResourcesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.LocalRegistrationServiceCluster", "Resources", displayName) + } + err = obj.client.Global().DeleteLocalRegistrationServiceResourceByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetLocalRegistrationServiceClusterByName(ctx, obj.GetName()) + if err == nil { + obj.LocalRegistrationServiceCluster = updatedObj.LocalRegistrationServiceCluster + } + return +} + +type localregistrationserviceclusterGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *localregistrationserviceclusterGlobalTsmV1Chainer) Subscribe() { + key := "localregistrationserviceclusters.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewLocalRegistrationServiceClusterInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *localregistrationserviceclusterGlobalTsmV1Chainer) Unsubscribe() { + key := "localregistrationserviceclusters.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *localregistrationserviceclusterGlobalTsmV1Chainer) IsSubscribed() bool { + key := "localregistrationserviceclusters.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *localregistrationserviceclusterGlobalTsmV1Chainer) Resources(name string) *localregistrationserviceresourceGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["localregistrationserviceresources.global.tsm.tanzu.vmware.com"] = name + return &localregistrationserviceresourceGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetResources calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *localregistrationserviceclusterGlobalTsmV1Chainer) GetResources(ctx context.Context, displayName string) (result *GlobalLocalRegistrationServiceResource, err error) { + hashedName := helper.GetHashedName("localregistrationserviceresources.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetLocalRegistrationServiceResourceByName(ctx, hashedName) +} + +// AddResources calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *localregistrationserviceclusterGlobalTsmV1Chainer) AddResources(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource) (result *GlobalLocalRegistrationServiceResource, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("localregistrationserviceresources.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateLocalRegistrationServiceResourceByName(ctx, objToCreate) +} + +// DeleteResources calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *localregistrationserviceclusterGlobalTsmV1Chainer) DeleteResources(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("localregistrationserviceresources.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteLocalRegistrationServiceResourceByName(ctx, hashedName) +} + +// GetLocalRegistrationServiceResourceByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetLocalRegistrationServiceResourceByName(ctx context.Context, hashedName string) (*GlobalLocalRegistrationServiceResource, error) { + key := "localregistrationserviceresources.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource) + return &GlobalLocalRegistrationServiceResource{ + client: group.client, + LocalRegistrationServiceResource: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServiceResources().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalLocalRegistrationServiceResource{ + client: group.client, + LocalRegistrationServiceResource: result, + }, nil + } +} + +// DeleteLocalRegistrationServiceResourceByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteLocalRegistrationServiceResourceByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServiceResources().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServiceResources().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/resourcesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["localregistrationserviceclusters.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("localregistrationserviceclusters.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServiceClusters().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateLocalRegistrationServiceResourceByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateLocalRegistrationServiceResourceByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource) (*GlobalLocalRegistrationServiceResource, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServiceResources().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["localregistrationserviceclusters.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("localregistrationserviceclusters.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"resourcesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"LocalRegistrationServiceResource\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServiceClusters().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalLocalRegistrationServiceResource{ + client: group.client, + LocalRegistrationServiceResource: result, + }, nil +} + +// UpdateLocalRegistrationServiceResourceByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateLocalRegistrationServiceResourceByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource) (*GlobalLocalRegistrationServiceResource, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServiceResources().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueType := + objToUpdate.Spec.Type + patchOpType := PatchOp{ + Op: "replace", + Path: "/spec/type", + Value: patchValueType, + } + patch = append(patch, patchOpType) + + patchValueLocation := + objToUpdate.Spec.Location + patchOpLocation := PatchOp{ + Op: "replace", + Path: "/spec/location", + Value: patchValueLocation, + } + patch = append(patch, patchOpLocation) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServiceResources().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalLocalRegistrationServiceResource{ + client: group.client, + LocalRegistrationServiceResource: result, + }, nil +} + +// ListLocalRegistrationServiceResources returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListLocalRegistrationServiceResources(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalLocalRegistrationServiceResource, err error) { + key := "localregistrationserviceresources.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalLocalRegistrationServiceResource, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource) + result[k] = &GlobalLocalRegistrationServiceResource{ + client: group.client, + LocalRegistrationServiceResource: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + LocalRegistrationServiceResources().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalLocalRegistrationServiceResource, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalLocalRegistrationServiceResource{ + client: group.client, + LocalRegistrationServiceResource: &item, + } + } + } + return +} + +type GlobalLocalRegistrationServiceResource struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.LocalRegistrationServiceResource +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalLocalRegistrationServiceResource) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteLocalRegistrationServiceResourceByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.LocalRegistrationServiceResource = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalLocalRegistrationServiceResource) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateLocalRegistrationServiceResourceByName(ctx, obj.LocalRegistrationServiceResource) + if err != nil { + return err + } + obj.LocalRegistrationServiceResource = result.LocalRegistrationServiceResource + return nil +} + +func (obj *GlobalLocalRegistrationServiceResource) GetParent(ctx context.Context) (result *GlobalLocalRegistrationServiceCluster, err error) { + hashedName := helper.GetHashedName("localregistrationserviceclusters.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["localregistrationserviceclusters.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetLocalRegistrationServiceClusterByName(ctx, hashedName) +} + +type localregistrationserviceresourceGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *localregistrationserviceresourceGlobalTsmV1Chainer) Subscribe() { + key := "localregistrationserviceresources.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewLocalRegistrationServiceResourceInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *localregistrationserviceresourceGlobalTsmV1Chainer) Unsubscribe() { + key := "localregistrationserviceresources.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *localregistrationserviceresourceGlobalTsmV1Chainer) IsSubscribed() bool { + key := "localregistrationserviceresources.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetLocalRegistrationServiceByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetLocalRegistrationServiceByName(ctx context.Context, hashedName string) (*GlobalLocalRegistrationService, error) { + key := "localregistrationservices.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.LocalRegistrationService) + return &GlobalLocalRegistrationService{ + client: group.client, + LocalRegistrationService: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServices().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalLocalRegistrationService{ + client: group.client, + LocalRegistrationService: result, + }, nil + } +} + +// DeleteLocalRegistrationServiceByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteLocalRegistrationServiceByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServices().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.ClustersGvk { + err := group.client. + Global().DeleteLocalRegistrationServiceClusterByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServices().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/localRegistrationServiceGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["allsparkserviceses.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("allsparkserviceses.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + AllSparkServiceses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateLocalRegistrationServiceByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateLocalRegistrationServiceByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.LocalRegistrationService) (*GlobalLocalRegistrationService, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ClustersGvk = nil + objToCreate.Spec.TemplateGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServices().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["allsparkserviceses.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("allsparkserviceses.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/localRegistrationServiceGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "LocalRegistrationService", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + AllSparkServiceses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalLocalRegistrationService{ + client: group.client, + LocalRegistrationService: result, + }, nil +} + +// UpdateLocalRegistrationServiceByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateLocalRegistrationServiceByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.LocalRegistrationService) (*GlobalLocalRegistrationService, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServices().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueBuildID := + objToUpdate.Spec.BuildID + patchOpBuildID := PatchOp{ + Op: "replace", + Path: "/spec/buildID", + Value: patchValueBuildID, + } + patch = append(patch, patchOpBuildID) + + patchValueVersion := + objToUpdate.Spec.Version + patchOpVersion := PatchOp{ + Op: "replace", + Path: "/spec/version", + Value: patchValueVersion, + } + patch = append(patch, patchOpVersion) + + patchValueErrorCount := + objToUpdate.Spec.ErrorCount + patchOpErrorCount := PatchOp{ + Op: "replace", + Path: "/spec/errorCount", + Value: patchValueErrorCount, + } + patch = append(patch, patchOpErrorCount) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + LocalRegistrationServices().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalLocalRegistrationService{ + client: group.client, + LocalRegistrationService: result, + }, nil +} + +// ListLocalRegistrationServices returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListLocalRegistrationServices(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalLocalRegistrationService, err error) { + key := "localregistrationservices.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalLocalRegistrationService, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.LocalRegistrationService) + result[k] = &GlobalLocalRegistrationService{ + client: group.client, + LocalRegistrationService: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + LocalRegistrationServices().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalLocalRegistrationService, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalLocalRegistrationService{ + client: group.client, + LocalRegistrationService: &item, + } + } + } + return +} + +type GlobalLocalRegistrationService struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.LocalRegistrationService +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalLocalRegistrationService) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteLocalRegistrationServiceByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.LocalRegistrationService = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalLocalRegistrationService) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateLocalRegistrationServiceByName(ctx, obj.LocalRegistrationService) + if err != nil { + return err + } + obj.LocalRegistrationService = result.LocalRegistrationService + return nil +} + +func (obj *GlobalLocalRegistrationService) GetParent(ctx context.Context) (result *GlobalAllSparkServices, err error) { + hashedName := helper.GetHashedName("allsparkserviceses.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["allsparkserviceses.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetAllSparkServicesByName(ctx, hashedName) +} + +// GetAllClusters returns all children of given type +func (obj *GlobalLocalRegistrationService) GetAllClusters(ctx context.Context) ( + result []*GlobalLocalRegistrationServiceCluster, err error) { + result = make([]*GlobalLocalRegistrationServiceCluster, 0, len(obj.Spec.ClustersGvk)) + for _, v := range obj.Spec.ClustersGvk { + l, err := obj.client.Global().GetLocalRegistrationServiceClusterByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetClusters returns child which has given displayName +func (obj *GlobalLocalRegistrationService) GetClusters(ctx context.Context, + displayName string) (result *GlobalLocalRegistrationServiceCluster, err error) { + l, ok := obj.Spec.ClustersGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.LocalRegistrationService", "Clusters", displayName) + } + result, err = obj.client.Global().GetLocalRegistrationServiceClusterByName(ctx, l.Name) + return +} + +// AddClusters calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalLocalRegistrationService) AddClusters(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster) (result *GlobalLocalRegistrationServiceCluster, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["localregistrationservices.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["localregistrationservices.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateLocalRegistrationServiceClusterByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetLocalRegistrationServiceByName(ctx, obj.GetName()) + if getErr == nil { + obj.LocalRegistrationService = updatedObj.LocalRegistrationService + } + return +} + +// DeleteClusters calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalLocalRegistrationService) DeleteClusters(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ClustersGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.LocalRegistrationService", "Clusters", displayName) + } + err = obj.client.Global().DeleteLocalRegistrationServiceClusterByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetLocalRegistrationServiceByName(ctx, obj.GetName()) + if err == nil { + obj.LocalRegistrationService = updatedObj.LocalRegistrationService + } + return +} + +// GetTemplate returns link of given type +func (obj *GlobalLocalRegistrationService) GetTemplate(ctx context.Context) ( + result *GlobalServiceTemplate, err error) { + if obj.Spec.TemplateGvk == nil { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.LocalRegistrationService", "Template") + } + return obj.client.Global().GetServiceTemplateByName(ctx, obj.Spec.TemplateGvk.Name) +} + +// LinkTemplate links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalLocalRegistrationService) LinkTemplate(ctx context.Context, + linkToAdd *GlobalServiceTemplate) error { + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/templateGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ServiceTemplate", + Name: linkToAdd.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().LocalRegistrationServices().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.LocalRegistrationService = result + return nil +} + +// UnlinkTemplate unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalLocalRegistrationService) UnlinkTemplate(ctx context.Context) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/templateGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().LocalRegistrationServices().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.LocalRegistrationService = result + return nil + +} + +type localregistrationserviceGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *localregistrationserviceGlobalTsmV1Chainer) Subscribe() { + key := "localregistrationservices.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewLocalRegistrationServiceInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *localregistrationserviceGlobalTsmV1Chainer) Unsubscribe() { + key := "localregistrationservices.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *localregistrationserviceGlobalTsmV1Chainer) IsSubscribed() bool { + key := "localregistrationservices.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *localregistrationserviceGlobalTsmV1Chainer) Clusters(name string) *localregistrationserviceclusterGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["localregistrationserviceclusters.global.tsm.tanzu.vmware.com"] = name + return &localregistrationserviceclusterGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetClusters calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *localregistrationserviceGlobalTsmV1Chainer) GetClusters(ctx context.Context, displayName string) (result *GlobalLocalRegistrationServiceCluster, err error) { + hashedName := helper.GetHashedName("localregistrationserviceclusters.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetLocalRegistrationServiceClusterByName(ctx, hashedName) +} + +// AddClusters calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *localregistrationserviceGlobalTsmV1Chainer) AddClusters(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.LocalRegistrationServiceCluster) (result *GlobalLocalRegistrationServiceCluster, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("localregistrationserviceclusters.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateLocalRegistrationServiceClusterByName(ctx, objToCreate) +} + +// DeleteClusters calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *localregistrationserviceGlobalTsmV1Chainer) DeleteClusters(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("localregistrationserviceclusters.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteLocalRegistrationServiceClusterByName(ctx, hashedName) +} + +// GetLogFolderByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetLogFolderByName(ctx context.Context, hashedName string) (*GlobalLogFolder, error) { + key := "logfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.LogFolder) + return &GlobalLogFolder{ + client: group.client, + LogFolder: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + LogFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalLogFolder{ + client: group.client, + LogFolder: result, + }, nil + } +} + +// DeleteLogFolderByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteLogFolderByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + LogFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.LogGvk { + err := group.client. + Global().DeleteLogByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + LogFolders().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/logFolderGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["clusterconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateLogFolderByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateLogFolderByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.LogFolder) (*GlobalLogFolder, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.LogGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + LogFolders().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["clusterconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/logFolderGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "LogFolder", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalLogFolder{ + client: group.client, + LogFolder: result, + }, nil +} + +// UpdateLogFolderByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateLogFolderByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.LogFolder) (*GlobalLogFolder, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + LogFolders().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + LogFolders().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalLogFolder{ + client: group.client, + LogFolder: result, + }, nil +} + +// ListLogFolders returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListLogFolders(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalLogFolder, err error) { + key := "logfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalLogFolder, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.LogFolder) + result[k] = &GlobalLogFolder{ + client: group.client, + LogFolder: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + LogFolders().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalLogFolder, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalLogFolder{ + client: group.client, + LogFolder: &item, + } + } + } + return +} + +type GlobalLogFolder struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.LogFolder +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalLogFolder) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteLogFolderByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.LogFolder = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalLogFolder) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateLogFolderByName(ctx, obj.LogFolder) + if err != nil { + return err + } + obj.LogFolder = result.LogFolder + return nil +} + +func (obj *GlobalLogFolder) GetParent(ctx context.Context) (result *GlobalClusterConfig, err error) { + hashedName := helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["clusterconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetClusterConfigByName(ctx, hashedName) +} + +// GetAllLog returns all children of given type +func (obj *GlobalLogFolder) GetAllLog(ctx context.Context) ( + result []*GlobalLog, err error) { + result = make([]*GlobalLog, 0, len(obj.Spec.LogGvk)) + for _, v := range obj.Spec.LogGvk { + l, err := obj.client.Global().GetLogByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetLog returns child which has given displayName +func (obj *GlobalLogFolder) GetLog(ctx context.Context, + displayName string) (result *GlobalLog, err error) { + l, ok := obj.Spec.LogGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.LogFolder", "Log", displayName) + } + result, err = obj.client.Global().GetLogByName(ctx, l.Name) + return +} + +// AddLog calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalLogFolder) AddLog(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Log) (result *GlobalLog, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["logfolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["logfolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateLogByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetLogFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.LogFolder = updatedObj.LogFolder + } + return +} + +// DeleteLog calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalLogFolder) DeleteLog(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.LogGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.LogFolder", "Log", displayName) + } + err = obj.client.Global().DeleteLogByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetLogFolderByName(ctx, obj.GetName()) + if err == nil { + obj.LogFolder = updatedObj.LogFolder + } + return +} + +type logfolderGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *logfolderGlobalTsmV1Chainer) Subscribe() { + key := "logfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewLogFolderInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *logfolderGlobalTsmV1Chainer) Unsubscribe() { + key := "logfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *logfolderGlobalTsmV1Chainer) IsSubscribed() bool { + key := "logfolders.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *logfolderGlobalTsmV1Chainer) Log(name string) *logGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["logs.global.tsm.tanzu.vmware.com"] = name + return &logGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetLog calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *logfolderGlobalTsmV1Chainer) GetLog(ctx context.Context, displayName string) (result *GlobalLog, err error) { + hashedName := helper.GetHashedName("logs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetLogByName(ctx, hashedName) +} + +// AddLog calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *logfolderGlobalTsmV1Chainer) AddLog(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Log) (result *GlobalLog, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("logs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateLogByName(ctx, objToCreate) +} + +// DeleteLog calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *logfolderGlobalTsmV1Chainer) DeleteLog(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("logs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteLogByName(ctx, hashedName) +} + +// GetLogByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetLogByName(ctx context.Context, hashedName string) (*GlobalLog, error) { + key := "logs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Log) + return &GlobalLog{ + client: group.client, + Log: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Logs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalLog{ + client: group.client, + Log: result, + }, nil + } +} + +// DeleteLogByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteLogByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Logs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + Logs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/logGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["logfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("logfolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + LogFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateLogByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateLogByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Log) (*GlobalLog, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + Logs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["logfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("logfolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"logGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"Log\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + LogFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalLog{ + client: group.client, + Log: result, + }, nil +} + +// UpdateLogByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateLogByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Log) (*GlobalLog, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Logs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueRequest := + objToUpdate.Spec.Request + patchOpRequest := PatchOp{ + Op: "replace", + Path: "/spec/request", + Value: patchValueRequest, + } + patch = append(patch, patchOpRequest) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Logs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalLog{ + client: group.client, + Log: result, + }, nil +} + +// ListLogs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListLogs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalLog, err error) { + key := "logs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalLog, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Log) + result[k] = &GlobalLog{ + client: group.client, + Log: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Logs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalLog, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalLog{ + client: group.client, + Log: &item, + } + } + } + return +} + +type GlobalLog struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Log +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalLog) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteLogByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Log = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalLog) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateLogByName(ctx, obj.Log) + if err != nil { + return err + } + obj.Log = result.Log + return nil +} + +func (obj *GlobalLog) GetParent(ctx context.Context) (result *GlobalLogFolder, err error) { + hashedName := helper.GetHashedName("logfolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["logfolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetLogFolderByName(ctx, hashedName) +} + +type logGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *logGlobalTsmV1Chainer) Subscribe() { + key := "logs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewLogInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *logGlobalTsmV1Chainer) Unsubscribe() { + key := "logs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *logGlobalTsmV1Chainer) IsSubscribed() bool { + key := "logs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetNetworkAttachmentDefinitionConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetNetworkAttachmentDefinitionConfigByName(ctx context.Context, hashedName string) (*GlobalNetworkAttachmentDefinitionConfig, error) { + key := "networkattachmentdefinitionconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig) + return &GlobalNetworkAttachmentDefinitionConfig{ + client: group.client, + NetworkAttachmentDefinitionConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + NetworkAttachmentDefinitionConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNetworkAttachmentDefinitionConfig{ + client: group.client, + NetworkAttachmentDefinitionConfig: result, + }, nil + } +} + +// DeleteNetworkAttachmentDefinitionConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteNetworkAttachmentDefinitionConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + NetworkAttachmentDefinitionConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + NetworkAttachmentDefinitionConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/networkAttachmentDefinitionGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateNetworkAttachmentDefinitionConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateNetworkAttachmentDefinitionConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig) (*GlobalNetworkAttachmentDefinitionConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + NetworkAttachmentDefinitionConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"networkAttachmentDefinitionGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"NetworkAttachmentDefinitionConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNetworkAttachmentDefinitionConfig{ + client: group.client, + NetworkAttachmentDefinitionConfig: result, + }, nil +} + +// UpdateNetworkAttachmentDefinitionConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateNetworkAttachmentDefinitionConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig) (*GlobalNetworkAttachmentDefinitionConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + NetworkAttachmentDefinitionConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueNamespace := + objToUpdate.Spec.Namespace + patchOpNamespace := PatchOp{ + Op: "replace", + Path: "/spec/namespace", + Value: patchValueNamespace, + } + patch = append(patch, patchOpNamespace) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + NetworkAttachmentDefinitionConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalNetworkAttachmentDefinitionConfig{ + client: group.client, + NetworkAttachmentDefinitionConfig: result, + }, nil +} + +// ListNetworkAttachmentDefinitionConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListNetworkAttachmentDefinitionConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalNetworkAttachmentDefinitionConfig, err error) { + key := "networkattachmentdefinitionconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalNetworkAttachmentDefinitionConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig) + result[k] = &GlobalNetworkAttachmentDefinitionConfig{ + client: group.client, + NetworkAttachmentDefinitionConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + NetworkAttachmentDefinitionConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalNetworkAttachmentDefinitionConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalNetworkAttachmentDefinitionConfig{ + client: group.client, + NetworkAttachmentDefinitionConfig: &item, + } + } + } + return +} + +type GlobalNetworkAttachmentDefinitionConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.NetworkAttachmentDefinitionConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalNetworkAttachmentDefinitionConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteNetworkAttachmentDefinitionConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.NetworkAttachmentDefinitionConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalNetworkAttachmentDefinitionConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateNetworkAttachmentDefinitionConfigByName(ctx, obj.NetworkAttachmentDefinitionConfig) + if err != nil { + return err + } + obj.NetworkAttachmentDefinitionConfig = result.NetworkAttachmentDefinitionConfig + return nil +} + +func (obj *GlobalNetworkAttachmentDefinitionConfig) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type networkattachmentdefinitionconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *networkattachmentdefinitionconfigGlobalTsmV1Chainer) Subscribe() { + key := "networkattachmentdefinitionconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewNetworkAttachmentDefinitionConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *networkattachmentdefinitionconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "networkattachmentdefinitionconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *networkattachmentdefinitionconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "networkattachmentdefinitionconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetNetworkAttachmentDefinitionByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetNetworkAttachmentDefinitionByName(ctx context.Context, hashedName string) (*GlobalNetworkAttachmentDefinition, error) { + key := "networkattachmentdefinitions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition) + return &GlobalNetworkAttachmentDefinition{ + client: group.client, + NetworkAttachmentDefinition: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + NetworkAttachmentDefinitions().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNetworkAttachmentDefinition{ + client: group.client, + NetworkAttachmentDefinition: result, + }, nil + } +} + +// DeleteNetworkAttachmentDefinitionByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteNetworkAttachmentDefinitionByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + NetworkAttachmentDefinitions().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + NetworkAttachmentDefinitions().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/networkAttachmentDefinitionGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateNetworkAttachmentDefinitionByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateNetworkAttachmentDefinitionByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition) (*GlobalNetworkAttachmentDefinition, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + NetworkAttachmentDefinitions().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"networkAttachmentDefinitionGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"NetworkAttachmentDefinition\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNetworkAttachmentDefinition{ + client: group.client, + NetworkAttachmentDefinition: result, + }, nil +} + +// UpdateNetworkAttachmentDefinitionByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateNetworkAttachmentDefinitionByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition) (*GlobalNetworkAttachmentDefinition, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + NetworkAttachmentDefinitions().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueNamespace := + objToUpdate.Spec.Namespace + patchOpNamespace := PatchOp{ + Op: "replace", + Path: "/spec/namespace", + Value: patchValueNamespace, + } + patch = append(patch, patchOpNamespace) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + NetworkAttachmentDefinitions().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalNetworkAttachmentDefinition{ + client: group.client, + NetworkAttachmentDefinition: result, + }, nil +} + +// ListNetworkAttachmentDefinitions returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListNetworkAttachmentDefinitions(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalNetworkAttachmentDefinition, err error) { + key := "networkattachmentdefinitions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalNetworkAttachmentDefinition, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition) + result[k] = &GlobalNetworkAttachmentDefinition{ + client: group.client, + NetworkAttachmentDefinition: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + NetworkAttachmentDefinitions().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalNetworkAttachmentDefinition, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalNetworkAttachmentDefinition{ + client: group.client, + NetworkAttachmentDefinition: &item, + } + } + } + return +} + +type GlobalNetworkAttachmentDefinition struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.NetworkAttachmentDefinition +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalNetworkAttachmentDefinition) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteNetworkAttachmentDefinitionByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.NetworkAttachmentDefinition = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalNetworkAttachmentDefinition) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateNetworkAttachmentDefinitionByName(ctx, obj.NetworkAttachmentDefinition) + if err != nil { + return err + } + obj.NetworkAttachmentDefinition = result.NetworkAttachmentDefinition + return nil +} + +func (obj *GlobalNetworkAttachmentDefinition) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +type networkattachmentdefinitionGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *networkattachmentdefinitionGlobalTsmV1Chainer) Subscribe() { + key := "networkattachmentdefinitions.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewNetworkAttachmentDefinitionInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *networkattachmentdefinitionGlobalTsmV1Chainer) Unsubscribe() { + key := "networkattachmentdefinitions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *networkattachmentdefinitionGlobalTsmV1Chainer) IsSubscribed() bool { + key := "networkattachmentdefinitions.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetNodeDefinitionByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetNodeDefinitionByName(ctx context.Context, hashedName string) (*GlobalNodeDefinition, error) { + key := "nodedefinitions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.NodeDefinition) + return &GlobalNodeDefinition{ + client: group.client, + NodeDefinition: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeDefinitions().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNodeDefinition{ + client: group.client, + NodeDefinition: result, + }, nil + } +} + +// DeleteNodeDefinitionByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteNodeDefinitionByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeDefinitions().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + NodeDefinitions().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/definitionVersionsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["nodetemplates.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("nodetemplates.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + NodeTemplates().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateNodeDefinitionByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateNodeDefinitionByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeDefinition) (*GlobalNodeDefinition, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeDefinitions().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["nodetemplates.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("nodetemplates.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"definitionVersionsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"NodeDefinition\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + NodeTemplates().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNodeDefinition{ + client: group.client, + NodeDefinition: result, + }, nil +} + +// UpdateNodeDefinitionByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateNodeDefinitionByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.NodeDefinition) (*GlobalNodeDefinition, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + NodeDefinitions().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueType := + objToUpdate.Spec.Type + patchOpType := PatchOp{ + Op: "replace", + Path: "/spec/type", + Value: patchValueType, + } + patch = append(patch, patchOpType) + + patchValueVersion := + objToUpdate.Spec.Version + patchOpVersion := PatchOp{ + Op: "replace", + Path: "/spec/version", + Value: patchValueVersion, + } + patch = append(patch, patchOpVersion) + + patchValueProvider := + objToUpdate.Spec.Provider + patchOpProvider := PatchOp{ + Op: "replace", + Path: "/spec/provider", + Value: patchValueProvider, + } + patch = append(patch, patchOpProvider) + + patchValueImageInfo := + objToUpdate.Spec.ImageInfo + patchOpImageInfo := PatchOp{ + Op: "replace", + Path: "/spec/imageInfo", + Value: patchValueImageInfo, + } + patch = append(patch, patchOpImageInfo) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeDefinitions().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalNodeDefinition{ + client: group.client, + NodeDefinition: result, + }, nil +} + +// ListNodeDefinitions returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListNodeDefinitions(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalNodeDefinition, err error) { + key := "nodedefinitions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalNodeDefinition, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.NodeDefinition) + result[k] = &GlobalNodeDefinition{ + client: group.client, + NodeDefinition: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + NodeDefinitions().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalNodeDefinition, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalNodeDefinition{ + client: group.client, + NodeDefinition: &item, + } + } + } + return +} + +type GlobalNodeDefinition struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.NodeDefinition +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalNodeDefinition) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteNodeDefinitionByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.NodeDefinition = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalNodeDefinition) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateNodeDefinitionByName(ctx, obj.NodeDefinition) + if err != nil { + return err + } + obj.NodeDefinition = result.NodeDefinition + return nil +} + +func (obj *GlobalNodeDefinition) GetParent(ctx context.Context) (result *GlobalNodeTemplate, err error) { + hashedName := helper.GetHashedName("nodetemplates.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["nodetemplates.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetNodeTemplateByName(ctx, hashedName) +} + +type nodedefinitionGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *nodedefinitionGlobalTsmV1Chainer) Subscribe() { + key := "nodedefinitions.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewNodeDefinitionInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *nodedefinitionGlobalTsmV1Chainer) Unsubscribe() { + key := "nodedefinitions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *nodedefinitionGlobalTsmV1Chainer) IsSubscribed() bool { + key := "nodedefinitions.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetNodeFolderClusterByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetNodeFolderClusterByName(ctx context.Context, hashedName string) (*GlobalNodeFolderCluster, error) { + key := "nodefolderclusters.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.NodeFolderCluster) + return &GlobalNodeFolderCluster{ + client: group.client, + NodeFolderCluster: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeFolderClusters().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNodeFolderCluster{ + client: group.client, + NodeFolderCluster: result, + }, nil + } +} + +// DeleteNodeFolderClusterByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteNodeFolderClusterByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeFolderClusters().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + NodeFolderClusters().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/clustersGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["nodefolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("nodefolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + NodeFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateNodeFolderClusterByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateNodeFolderClusterByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeFolderCluster) (*GlobalNodeFolderCluster, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeFolderClusters().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["nodefolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("nodefolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"clustersGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"NodeFolderCluster\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + NodeFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNodeFolderCluster{ + client: group.client, + NodeFolderCluster: result, + }, nil +} + +// UpdateNodeFolderClusterByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateNodeFolderClusterByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.NodeFolderCluster) (*GlobalNodeFolderCluster, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + NodeFolderClusters().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeFolderClusters().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalNodeFolderCluster{ + client: group.client, + NodeFolderCluster: result, + }, nil +} + +// ListNodeFolderClusters returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListNodeFolderClusters(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalNodeFolderCluster, err error) { + key := "nodefolderclusters.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalNodeFolderCluster, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.NodeFolderCluster) + result[k] = &GlobalNodeFolderCluster{ + client: group.client, + NodeFolderCluster: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + NodeFolderClusters().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalNodeFolderCluster, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalNodeFolderCluster{ + client: group.client, + NodeFolderCluster: &item, + } + } + } + return +} + +type GlobalNodeFolderCluster struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.NodeFolderCluster +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalNodeFolderCluster) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteNodeFolderClusterByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.NodeFolderCluster = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalNodeFolderCluster) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateNodeFolderClusterByName(ctx, obj.NodeFolderCluster) + if err != nil { + return err + } + obj.NodeFolderCluster = result.NodeFolderCluster + return nil +} + +func (obj *GlobalNodeFolderCluster) GetParent(ctx context.Context) (result *GlobalNodeFolder, err error) { + hashedName := helper.GetHashedName("nodefolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["nodefolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetNodeFolderByName(ctx, hashedName) +} + +type nodefolderclusterGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *nodefolderclusterGlobalTsmV1Chainer) Subscribe() { + key := "nodefolderclusters.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewNodeFolderClusterInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *nodefolderclusterGlobalTsmV1Chainer) Unsubscribe() { + key := "nodefolderclusters.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *nodefolderclusterGlobalTsmV1Chainer) IsSubscribed() bool { + key := "nodefolderclusters.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetNodeFolderByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetNodeFolderByName(ctx context.Context, hashedName string) (*GlobalNodeFolder, error) { + key := "nodefolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.NodeFolder) + return &GlobalNodeFolder{ + client: group.client, + NodeFolder: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNodeFolder{ + client: group.client, + NodeFolder: result, + }, nil + } +} + +// DeleteNodeFolderByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteNodeFolderByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.ClustersGvk { + err := group.client. + Global().DeleteNodeFolderClusterByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + NodeFolders().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/nodeFolderGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateNodeFolderByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateNodeFolderByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeFolder) (*GlobalNodeFolder, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] == "" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.Labels[common.DISPLAY_NAME_LABEL]) + } + + objToCreate.Spec.ClustersGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeFolders().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/nodeFolderGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "NodeFolder", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNodeFolder{ + client: group.client, + NodeFolder: result, + }, nil +} + +// UpdateNodeFolderByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateNodeFolderByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.NodeFolder) (*GlobalNodeFolder, error) { + if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) + } + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + NodeFolders().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeFolders().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalNodeFolder{ + client: group.client, + NodeFolder: result, + }, nil +} + +// ListNodeFolders returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListNodeFolders(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalNodeFolder, err error) { + key := "nodefolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalNodeFolder, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.NodeFolder) + result[k] = &GlobalNodeFolder{ + client: group.client, + NodeFolder: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + NodeFolders().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalNodeFolder, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalNodeFolder{ + client: group.client, + NodeFolder: &item, + } + } + } + return +} + +type GlobalNodeFolder struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.NodeFolder +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalNodeFolder) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteNodeFolderByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.NodeFolder = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalNodeFolder) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateNodeFolderByName(ctx, obj.NodeFolder) + if err != nil { + return err + } + obj.NodeFolder = result.NodeFolder + return nil +} + +func (obj *GlobalNodeFolder) GetParent(ctx context.Context) (result *GlobalRuntime, err error) { + hashedName := helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["runtimes.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetRuntimeByName(ctx, hashedName) +} + +// GetAllClusters returns all children of given type +func (obj *GlobalNodeFolder) GetAllClusters(ctx context.Context) ( + result []*GlobalNodeFolderCluster, err error) { + result = make([]*GlobalNodeFolderCluster, 0, len(obj.Spec.ClustersGvk)) + for _, v := range obj.Spec.ClustersGvk { + l, err := obj.client.Global().GetNodeFolderClusterByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetClusters returns child which has given displayName +func (obj *GlobalNodeFolder) GetClusters(ctx context.Context, + displayName string) (result *GlobalNodeFolderCluster, err error) { + l, ok := obj.Spec.ClustersGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.NodeFolder", "Clusters", displayName) + } + result, err = obj.client.Global().GetNodeFolderClusterByName(ctx, l.Name) + return +} + +// AddClusters calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalNodeFolder) AddClusters(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeFolderCluster) (result *GlobalNodeFolderCluster, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["nodefolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["nodefolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateNodeFolderClusterByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetNodeFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.NodeFolder = updatedObj.NodeFolder + } + return +} + +// DeleteClusters calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalNodeFolder) DeleteClusters(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ClustersGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.NodeFolder", "Clusters", displayName) + } + err = obj.client.Global().DeleteNodeFolderClusterByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetNodeFolderByName(ctx, obj.GetName()) + if err == nil { + obj.NodeFolder = updatedObj.NodeFolder + } + return +} + +type nodefolderGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *nodefolderGlobalTsmV1Chainer) Subscribe() { + key := "nodefolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewNodeFolderInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *nodefolderGlobalTsmV1Chainer) Unsubscribe() { + key := "nodefolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *nodefolderGlobalTsmV1Chainer) IsSubscribed() bool { + key := "nodefolders.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *nodefolderGlobalTsmV1Chainer) Clusters(name string) *nodefolderclusterGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["nodefolderclusters.global.tsm.tanzu.vmware.com"] = name + return &nodefolderclusterGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetClusters calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *nodefolderGlobalTsmV1Chainer) GetClusters(ctx context.Context, displayName string) (result *GlobalNodeFolderCluster, err error) { + hashedName := helper.GetHashedName("nodefolderclusters.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetNodeFolderClusterByName(ctx, hashedName) +} + +// AddClusters calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *nodefolderGlobalTsmV1Chainer) AddClusters(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeFolderCluster) (result *GlobalNodeFolderCluster, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("nodefolderclusters.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateNodeFolderClusterByName(ctx, objToCreate) +} + +// DeleteClusters calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *nodefolderGlobalTsmV1Chainer) DeleteClusters(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("nodefolderclusters.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteNodeFolderClusterByName(ctx, hashedName) +} + +// GetNodeGroupByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetNodeGroupByName(ctx context.Context, hashedName string) (*GlobalNodeGroup, error) { + key := "nodegroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.NodeGroup) + return &GlobalNodeGroup{ + client: group.client, + NodeGroup: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeGroups().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNodeGroup{ + client: group.client, + NodeGroup: result, + }, nil + } +} + +// DeleteNodeGroupByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteNodeGroupByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeGroups().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + NodeGroups().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/nodeGroupsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["resourcegroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ResourceGroups().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateNodeGroupByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateNodeGroupByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeGroup) (*GlobalNodeGroup, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeGroups().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["resourcegroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"nodeGroupsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"NodeGroup\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ResourceGroups().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNodeGroup{ + client: group.client, + NodeGroup: result, + }, nil +} + +// UpdateNodeGroupByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateNodeGroupByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.NodeGroup) (*GlobalNodeGroup, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + NodeGroups().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueDisplayName := + objToUpdate.Spec.DisplayName + patchOpDisplayName := PatchOp{ + Op: "replace", + Path: "/spec/displayName", + Value: patchValueDisplayName, + } + patch = append(patch, patchOpDisplayName) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueScope := + objToUpdate.Spec.Scope + patchOpScope := PatchOp{ + Op: "replace", + Path: "/spec/scope", + Value: patchValueScope, + } + patch = append(patch, patchOpScope) + + patchValueColor := + objToUpdate.Spec.Color + patchOpColor := PatchOp{ + Op: "replace", + Path: "/spec/color", + Value: patchValueColor, + } + patch = append(patch, patchOpColor) + + patchValueRules := + objToUpdate.Spec.Rules + patchOpRules := PatchOp{ + Op: "replace", + Path: "/spec/rules", + Value: patchValueRules, + } + patch = append(patch, patchOpRules) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeGroups().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalNodeGroup{ + client: group.client, + NodeGroup: result, + }, nil +} + +// ListNodeGroups returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListNodeGroups(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalNodeGroup, err error) { + key := "nodegroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalNodeGroup, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.NodeGroup) + result[k] = &GlobalNodeGroup{ + client: group.client, + NodeGroup: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + NodeGroups().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalNodeGroup, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalNodeGroup{ + client: group.client, + NodeGroup: &item, + } + } + } + return +} + +type GlobalNodeGroup struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.NodeGroup +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalNodeGroup) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteNodeGroupByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.NodeGroup = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalNodeGroup) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateNodeGroupByName(ctx, obj.NodeGroup) + if err != nil { + return err + } + obj.NodeGroup = result.NodeGroup + return nil +} + +func (obj *GlobalNodeGroup) GetParent(ctx context.Context) (result *GlobalResourceGroup, err error) { + hashedName := helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["resourcegroups.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetResourceGroupByName(ctx, hashedName) +} + +type nodegroupGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *nodegroupGlobalTsmV1Chainer) Subscribe() { + key := "nodegroups.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewNodeGroupInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *nodegroupGlobalTsmV1Chainer) Unsubscribe() { + key := "nodegroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *nodegroupGlobalTsmV1Chainer) IsSubscribed() bool { + key := "nodegroups.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetNodeStatusByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetNodeStatusByName(ctx context.Context, hashedName string) (*GlobalNodeStatus, error) { + key := "nodestatuses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.NodeStatus) + return &GlobalNodeStatus{ + client: group.client, + NodeStatus: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeStatuses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNodeStatus{ + client: group.client, + NodeStatus: result, + }, nil + } +} + +// DeleteNodeStatusByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteNodeStatusByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeStatuses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + NodeStatuses().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/statusGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["nodes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("nodes.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Nodes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateNodeStatusByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateNodeStatusByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeStatus) (*GlobalNodeStatus, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeStatuses().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["nodes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("nodes.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/statusGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "NodeStatus", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Nodes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNodeStatus{ + client: group.client, + NodeStatus: result, + }, nil +} + +// UpdateNodeStatusByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateNodeStatusByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.NodeStatus) (*GlobalNodeStatus, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + NodeStatuses().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueAddresses := + objToUpdate.Spec.Addresses + patchOpAddresses := PatchOp{ + Op: "replace", + Path: "/spec/addresses", + Value: patchValueAddresses, + } + patch = append(patch, patchOpAddresses) + + patchValueAllocatable := + objToUpdate.Spec.Allocatable + patchOpAllocatable := PatchOp{ + Op: "replace", + Path: "/spec/allocatable", + Value: patchValueAllocatable, + } + patch = append(patch, patchOpAllocatable) + + patchValueCapacity := + objToUpdate.Spec.Capacity + patchOpCapacity := PatchOp{ + Op: "replace", + Path: "/spec/capacity", + Value: patchValueCapacity, + } + patch = append(patch, patchOpCapacity) + + patchValueDaemonEndpoints := + objToUpdate.Spec.DaemonEndpoints + patchOpDaemonEndpoints := PatchOp{ + Op: "replace", + Path: "/spec/daemonEndpoints", + Value: patchValueDaemonEndpoints, + } + patch = append(patch, patchOpDaemonEndpoints) + + patchValueConditions := + objToUpdate.Spec.Conditions + patchOpConditions := PatchOp{ + Op: "replace", + Path: "/spec/conditions", + Value: patchValueConditions, + } + patch = append(patch, patchOpConditions) + + patchValueImages := + objToUpdate.Spec.Images + patchOpImages := PatchOp{ + Op: "replace", + Path: "/spec/images", + Value: patchValueImages, + } + patch = append(patch, patchOpImages) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeStatuses().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalNodeStatus{ + client: group.client, + NodeStatus: result, + }, nil +} + +// ListNodeStatuses returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListNodeStatuses(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalNodeStatus, err error) { + key := "nodestatuses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalNodeStatus, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.NodeStatus) + result[k] = &GlobalNodeStatus{ + client: group.client, + NodeStatus: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + NodeStatuses().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalNodeStatus, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalNodeStatus{ + client: group.client, + NodeStatus: &item, + } + } + } + return +} + +type GlobalNodeStatus struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.NodeStatus +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalNodeStatus) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteNodeStatusByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.NodeStatus = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalNodeStatus) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateNodeStatusByName(ctx, obj.NodeStatus) + if err != nil { + return err + } + obj.NodeStatus = result.NodeStatus + return nil +} + +func (obj *GlobalNodeStatus) GetParent(ctx context.Context) (result *GlobalNode, err error) { + hashedName := helper.GetHashedName("nodes.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["nodes.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetNodeByName(ctx, hashedName) +} + +type nodestatusGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *nodestatusGlobalTsmV1Chainer) Subscribe() { + key := "nodestatuses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewNodeStatusInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *nodestatusGlobalTsmV1Chainer) Unsubscribe() { + key := "nodestatuses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *nodestatusGlobalTsmV1Chainer) IsSubscribed() bool { + key := "nodestatuses.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetNodeTemplateByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetNodeTemplateByName(ctx context.Context, hashedName string) (*GlobalNodeTemplate, error) { + key := "nodetemplates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.NodeTemplate) + return &GlobalNodeTemplate{ + client: group.client, + NodeTemplate: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeTemplates().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNodeTemplate{ + client: group.client, + NodeTemplate: result, + }, nil + } +} + +// DeleteNodeTemplateByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteNodeTemplateByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeTemplates().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.DefinitionVersionsGvk { + err := group.client. + Global().DeleteNodeDefinitionByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + NodeTemplates().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/nodeTemplatesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["templategroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + TemplateGroups().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateNodeTemplateByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateNodeTemplateByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeTemplate) (*GlobalNodeTemplate, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.DefinitionVersionsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeTemplates().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["templategroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"nodeTemplatesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"NodeTemplate\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + TemplateGroups().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNodeTemplate{ + client: group.client, + NodeTemplate: result, + }, nil +} + +// UpdateNodeTemplateByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateNodeTemplateByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.NodeTemplate) (*GlobalNodeTemplate, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + NodeTemplates().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + NodeTemplates().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalNodeTemplate{ + client: group.client, + NodeTemplate: result, + }, nil +} + +// ListNodeTemplates returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListNodeTemplates(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalNodeTemplate, err error) { + key := "nodetemplates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalNodeTemplate, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.NodeTemplate) + result[k] = &GlobalNodeTemplate{ + client: group.client, + NodeTemplate: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + NodeTemplates().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalNodeTemplate, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalNodeTemplate{ + client: group.client, + NodeTemplate: &item, + } + } + } + return +} + +type GlobalNodeTemplate struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.NodeTemplate +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalNodeTemplate) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteNodeTemplateByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.NodeTemplate = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalNodeTemplate) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateNodeTemplateByName(ctx, obj.NodeTemplate) + if err != nil { + return err + } + obj.NodeTemplate = result.NodeTemplate + return nil +} + +func (obj *GlobalNodeTemplate) GetParent(ctx context.Context) (result *GlobalTemplateGroup, err error) { + hashedName := helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["templategroups.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetTemplateGroupByName(ctx, hashedName) +} + +// GetAllDefinitionVersions returns all children of given type +func (obj *GlobalNodeTemplate) GetAllDefinitionVersions(ctx context.Context) ( + result []*GlobalNodeDefinition, err error) { + result = make([]*GlobalNodeDefinition, 0, len(obj.Spec.DefinitionVersionsGvk)) + for _, v := range obj.Spec.DefinitionVersionsGvk { + l, err := obj.client.Global().GetNodeDefinitionByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetDefinitionVersions returns child which has given displayName +func (obj *GlobalNodeTemplate) GetDefinitionVersions(ctx context.Context, + displayName string) (result *GlobalNodeDefinition, err error) { + l, ok := obj.Spec.DefinitionVersionsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.NodeTemplate", "DefinitionVersions", displayName) + } + result, err = obj.client.Global().GetNodeDefinitionByName(ctx, l.Name) + return +} + +// AddDefinitionVersions calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalNodeTemplate) AddDefinitionVersions(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeDefinition) (result *GlobalNodeDefinition, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["nodetemplates.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["nodetemplates.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateNodeDefinitionByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetNodeTemplateByName(ctx, obj.GetName()) + if getErr == nil { + obj.NodeTemplate = updatedObj.NodeTemplate + } + return +} + +// DeleteDefinitionVersions calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalNodeTemplate) DeleteDefinitionVersions(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.DefinitionVersionsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.NodeTemplate", "DefinitionVersions", displayName) + } + err = obj.client.Global().DeleteNodeDefinitionByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetNodeTemplateByName(ctx, obj.GetName()) + if err == nil { + obj.NodeTemplate = updatedObj.NodeTemplate + } + return +} + +type nodetemplateGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *nodetemplateGlobalTsmV1Chainer) Subscribe() { + key := "nodetemplates.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewNodeTemplateInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *nodetemplateGlobalTsmV1Chainer) Unsubscribe() { + key := "nodetemplates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *nodetemplateGlobalTsmV1Chainer) IsSubscribed() bool { + key := "nodetemplates.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *nodetemplateGlobalTsmV1Chainer) DefinitionVersions(name string) *nodedefinitionGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["nodedefinitions.global.tsm.tanzu.vmware.com"] = name + return &nodedefinitionGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetDefinitionVersions calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *nodetemplateGlobalTsmV1Chainer) GetDefinitionVersions(ctx context.Context, displayName string) (result *GlobalNodeDefinition, err error) { + hashedName := helper.GetHashedName("nodedefinitions.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetNodeDefinitionByName(ctx, hashedName) +} + +// AddDefinitionVersions calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *nodetemplateGlobalTsmV1Chainer) AddDefinitionVersions(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeDefinition) (result *GlobalNodeDefinition, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("nodedefinitions.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateNodeDefinitionByName(ctx, objToCreate) +} + +// DeleteDefinitionVersions calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *nodetemplateGlobalTsmV1Chainer) DeleteDefinitionVersions(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("nodedefinitions.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteNodeDefinitionByName(ctx, hashedName) +} + +// GetNodeByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetNodeByName(ctx context.Context, hashedName string) (*GlobalNode, error) { + key := "nodes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Node) + return &GlobalNode{ + client: group.client, + Node: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Nodes().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNode{ + client: group.client, + Node: result, + }, nil + } +} + +// DeleteNodeByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteNodeByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Nodes().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + if result.Spec.StatusGvk != nil { + err := group.client. + Global(). + DeleteNodeStatusByName(ctx, result.Spec.StatusGvk.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + Nodes().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/nodesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["clusters.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Clusters().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateNodeByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateNodeByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Node) (*GlobalNode, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.StatusGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + Nodes().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["clusters.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"nodesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"Node\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Clusters().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalNode{ + client: group.client, + Node: result, + }, nil +} + +// UpdateNodeByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateNodeByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Node) (*GlobalNode, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Nodes().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueExternalID := + objToUpdate.Spec.ExternalID + patchOpExternalID := PatchOp{ + Op: "replace", + Path: "/spec/externalID", + Value: patchValueExternalID, + } + patch = append(patch, patchOpExternalID) + + patchValueProviderID := + objToUpdate.Spec.ProviderID + patchOpProviderID := PatchOp{ + Op: "replace", + Path: "/spec/providerID", + Value: patchValueProviderID, + } + patch = append(patch, patchOpProviderID) + + patchValueArchitecture := + objToUpdate.Spec.Architecture + patchOpArchitecture := PatchOp{ + Op: "replace", + Path: "/spec/architecture", + Value: patchValueArchitecture, + } + patch = append(patch, patchOpArchitecture) + + patchValueContainerRuntimeVersion := + objToUpdate.Spec.ContainerRuntimeVersion + patchOpContainerRuntimeVersion := PatchOp{ + Op: "replace", + Path: "/spec/containerRuntimeVersion", + Value: patchValueContainerRuntimeVersion, + } + patch = append(patch, patchOpContainerRuntimeVersion) + + patchValueKernelVersion := + objToUpdate.Spec.KernelVersion + patchOpKernelVersion := PatchOp{ + Op: "replace", + Path: "/spec/kernelVersion", + Value: patchValueKernelVersion, + } + patch = append(patch, patchOpKernelVersion) + + patchValueOperatingSystem := + objToUpdate.Spec.OperatingSystem + patchOpOperatingSystem := PatchOp{ + Op: "replace", + Path: "/spec/operatingSystem", + Value: patchValueOperatingSystem, + } + patch = append(patch, patchOpOperatingSystem) + + patchValueOsImage := + objToUpdate.Spec.OsImage + patchOpOsImage := PatchOp{ + Op: "replace", + Path: "/spec/osImage", + Value: patchValueOsImage, + } + patch = append(patch, patchOpOsImage) + + patchValueSystemUUID := + objToUpdate.Spec.SystemUUID + patchOpSystemUUID := PatchOp{ + Op: "replace", + Path: "/spec/systemUUID", + Value: patchValueSystemUUID, + } + patch = append(patch, patchOpSystemUUID) + + patchValueHostName := + objToUpdate.Spec.HostName + patchOpHostName := PatchOp{ + Op: "replace", + Path: "/spec/hostName", + Value: patchValueHostName, + } + patch = append(patch, patchOpHostName) + + patchValueApiLink := + objToUpdate.Spec.ApiLink + patchOpApiLink := PatchOp{ + Op: "replace", + Path: "/spec/apiLink", + Value: patchValueApiLink, + } + patch = append(patch, patchOpApiLink) + + patchValueBootID := + objToUpdate.Spec.BootID + patchOpBootID := PatchOp{ + Op: "replace", + Path: "/spec/bootID", + Value: patchValueBootID, + } + patch = append(patch, patchOpBootID) + + patchValueKubeletVersion := + objToUpdate.Spec.KubeletVersion + patchOpKubeletVersion := PatchOp{ + Op: "replace", + Path: "/spec/kubeletVersion", + Value: patchValueKubeletVersion, + } + patch = append(patch, patchOpKubeletVersion) + + patchValueMachineID := + objToUpdate.Spec.MachineID + patchOpMachineID := PatchOp{ + Op: "replace", + Path: "/spec/machineID", + Value: patchValueMachineID, + } + patch = append(patch, patchOpMachineID) + + patchValueCreationTimestamp := + objToUpdate.Spec.CreationTimestamp + patchOpCreationTimestamp := PatchOp{ + Op: "replace", + Path: "/spec/creationTimestamp", + Value: patchValueCreationTimestamp, + } + patch = append(patch, patchOpCreationTimestamp) + + patchValueAnnotations := + objToUpdate.Spec.Annotations + patchOpAnnotations := PatchOp{ + Op: "replace", + Path: "/spec/annotations", + Value: patchValueAnnotations, + } + patch = append(patch, patchOpAnnotations) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueUid := + objToUpdate.Spec.Uid + patchOpUid := PatchOp{ + Op: "replace", + Path: "/spec/uid", + Value: patchValueUid, + } + patch = append(patch, patchOpUid) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + patchValueKStatus := + objToUpdate.Spec.KStatus + patchOpKStatus := PatchOp{ + Op: "replace", + Path: "/spec/kStatus", + Value: patchValueKStatus, + } + patch = append(patch, patchOpKStatus) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Nodes().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalNode{ + client: group.client, + Node: result, + }, nil +} + +// ListNodes returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListNodes(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalNode, err error) { + key := "nodes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalNode, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Node) + result[k] = &GlobalNode{ + client: group.client, + Node: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Nodes().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalNode, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalNode{ + client: group.client, + Node: &item, + } + } + } + return +} + +type GlobalNode struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Node +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalNode) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteNodeByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Node = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalNode) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateNodeByName(ctx, obj.Node) + if err != nil { + return err + } + obj.Node = result.Node + return nil +} + +func (obj *GlobalNode) GetParent(ctx context.Context) (result *GlobalCluster, err error) { + hashedName := helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["clusters.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetClusterByName(ctx, hashedName) +} + +// GetStatus returns child of given type +func (obj *GlobalNode) GetStatus(ctx context.Context) ( + result *GlobalNodeStatus, err error) { + if obj.Spec.StatusGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Node", "Status") + } + return obj.client.Global().GetNodeStatusByName(ctx, obj.Spec.StatusGvk.Name) +} + +// AddStatus calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalNode) AddStatus(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeStatus) (result *GlobalNodeStatus, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["nodes.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["nodes.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateNodeStatusByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetNodeByName(ctx, obj.GetName()) + if getErr == nil { + obj.Node = updatedObj.Node + } + return +} + +// DeleteStatus calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalNode) DeleteStatus(ctx context.Context) (err error) { + if obj.Spec.StatusGvk != nil { + err = obj.client. + Global().DeleteNodeStatusByName(ctx, obj.Spec.StatusGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetNodeByName(ctx, obj.GetName()) + if err == nil { + obj.Node = updatedObj.Node + } + return +} + +type nodeGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *nodeGlobalTsmV1Chainer) Subscribe() { + key := "nodes.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewNodeInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *nodeGlobalTsmV1Chainer) Unsubscribe() { + key := "nodes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *nodeGlobalTsmV1Chainer) IsSubscribed() bool { + key := "nodes.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *nodeGlobalTsmV1Chainer) Status(name string) *nodestatusGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["nodestatuses.global.tsm.tanzu.vmware.com"] = name + return &nodestatusGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetStatus calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *nodeGlobalTsmV1Chainer) GetStatus(ctx context.Context, displayName string) (result *GlobalNodeStatus, err error) { + hashedName := helper.GetHashedName("nodestatuses.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetNodeStatusByName(ctx, hashedName) +} + +// AddStatus calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *nodeGlobalTsmV1Chainer) AddStatus(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeStatus) (result *GlobalNodeStatus, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("nodestatuses.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateNodeStatusByName(ctx, objToCreate) +} + +// DeleteStatus calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *nodeGlobalTsmV1Chainer) DeleteStatus(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("nodestatuses.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteNodeStatusByName(ctx, hashedName) +} + +// GetOutboundAuthenticationModeByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetOutboundAuthenticationModeByName(ctx context.Context, hashedName string) (*GlobalOutboundAuthenticationMode, error) { + key := "outboundauthenticationmodes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.OutboundAuthenticationMode) + return &GlobalOutboundAuthenticationMode{ + client: group.client, + OutboundAuthenticationMode: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + OutboundAuthenticationModes().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalOutboundAuthenticationMode{ + client: group.client, + OutboundAuthenticationMode: result, + }, nil + } +} + +// DeleteOutboundAuthenticationModeByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteOutboundAuthenticationModeByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + OutboundAuthenticationModes().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + OutboundAuthenticationModes().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/outboundAuthenticationModeGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["hostconfigv2s.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("hostconfigv2s.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + HostConfigV2s().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateOutboundAuthenticationModeByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateOutboundAuthenticationModeByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.OutboundAuthenticationMode) (*GlobalOutboundAuthenticationMode, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + OutboundAuthenticationModes().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["hostconfigv2s.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("hostconfigv2s.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/outboundAuthenticationModeGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "OutboundAuthenticationMode", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + HostConfigV2s().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalOutboundAuthenticationMode{ + client: group.client, + OutboundAuthenticationMode: result, + }, nil +} + +// UpdateOutboundAuthenticationModeByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateOutboundAuthenticationModeByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.OutboundAuthenticationMode) (*GlobalOutboundAuthenticationMode, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + OutboundAuthenticationModes().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueMode := + objToUpdate.Spec.Mode + patchOpMode := PatchOp{ + Op: "replace", + Path: "/spec/mode", + Value: patchValueMode, + } + patch = append(patch, patchOpMode) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + OutboundAuthenticationModes().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalOutboundAuthenticationMode{ + client: group.client, + OutboundAuthenticationMode: result, + }, nil +} + +// ListOutboundAuthenticationModes returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListOutboundAuthenticationModes(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalOutboundAuthenticationMode, err error) { + key := "outboundauthenticationmodes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalOutboundAuthenticationMode, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.OutboundAuthenticationMode) + result[k] = &GlobalOutboundAuthenticationMode{ + client: group.client, + OutboundAuthenticationMode: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + OutboundAuthenticationModes().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalOutboundAuthenticationMode, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalOutboundAuthenticationMode{ + client: group.client, + OutboundAuthenticationMode: &item, + } + } + } + return +} + +type GlobalOutboundAuthenticationMode struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.OutboundAuthenticationMode +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalOutboundAuthenticationMode) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteOutboundAuthenticationModeByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.OutboundAuthenticationMode = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalOutboundAuthenticationMode) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateOutboundAuthenticationModeByName(ctx, obj.OutboundAuthenticationMode) + if err != nil { + return err + } + obj.OutboundAuthenticationMode = result.OutboundAuthenticationMode + return nil +} + +func (obj *GlobalOutboundAuthenticationMode) GetParent(ctx context.Context) (result *GlobalHostConfigV2, err error) { + hashedName := helper.GetHashedName("hostconfigv2s.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["hostconfigv2s.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetHostConfigV2ByName(ctx, hashedName) +} + +type outboundauthenticationmodeGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *outboundauthenticationmodeGlobalTsmV1Chainer) Subscribe() { + key := "outboundauthenticationmodes.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewOutboundAuthenticationModeInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *outboundauthenticationmodeGlobalTsmV1Chainer) Unsubscribe() { + key := "outboundauthenticationmodes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *outboundauthenticationmodeGlobalTsmV1Chainer) IsSubscribed() bool { + key := "outboundauthenticationmodes.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetPeerAuthenticationByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetPeerAuthenticationByName(ctx context.Context, hashedName string) (*GlobalPeerAuthentication, error) { + key := "peerauthentications.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.PeerAuthentication) + return &GlobalPeerAuthentication{ + client: group.client, + PeerAuthentication: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + PeerAuthentications().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalPeerAuthentication{ + client: group.client, + PeerAuthentication: result, + }, nil + } +} + +// DeletePeerAuthenticationByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeletePeerAuthenticationByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + PeerAuthentications().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + PeerAuthentications().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/peerAuthenticationGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreatePeerAuthenticationByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreatePeerAuthenticationByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PeerAuthentication) (*GlobalPeerAuthentication, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + PeerAuthentications().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"peerAuthenticationGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"PeerAuthentication\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalPeerAuthentication{ + client: group.client, + PeerAuthentication: result, + }, nil +} + +// UpdatePeerAuthenticationByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdatePeerAuthenticationByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.PeerAuthentication) (*GlobalPeerAuthentication, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + PeerAuthentications().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueAnnotations := + objToUpdate.Spec.Annotations + patchOpAnnotations := PatchOp{ + Op: "replace", + Path: "/spec/annotations", + Value: patchValueAnnotations, + } + patch = append(patch, patchOpAnnotations) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + PeerAuthentications().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalPeerAuthentication{ + client: group.client, + PeerAuthentication: result, + }, nil +} + +// ListPeerAuthentications returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListPeerAuthentications(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalPeerAuthentication, err error) { + key := "peerauthentications.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalPeerAuthentication, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.PeerAuthentication) + result[k] = &GlobalPeerAuthentication{ + client: group.client, + PeerAuthentication: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + PeerAuthentications().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalPeerAuthentication, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalPeerAuthentication{ + client: group.client, + PeerAuthentication: &item, + } + } + } + return +} + +type GlobalPeerAuthentication struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.PeerAuthentication +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalPeerAuthentication) Delete(ctx context.Context) error { + err := obj.client.Global().DeletePeerAuthenticationByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.PeerAuthentication = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalPeerAuthentication) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdatePeerAuthenticationByName(ctx, obj.PeerAuthentication) + if err != nil { + return err + } + obj.PeerAuthentication = result.PeerAuthentication + return nil +} + +func (obj *GlobalPeerAuthentication) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +type peerauthenticationGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *peerauthenticationGlobalTsmV1Chainer) Subscribe() { + key := "peerauthentications.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewPeerAuthenticationInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *peerauthenticationGlobalTsmV1Chainer) Unsubscribe() { + key := "peerauthentications.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *peerauthenticationGlobalTsmV1Chainer) IsSubscribed() bool { + key := "peerauthentications.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetPiiDiscoveryRTByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetPiiDiscoveryRTByName(ctx context.Context, hashedName string) (*GlobalPiiDiscoveryRT, error) { + key := "piidiscoveryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.PiiDiscoveryRT) + return &GlobalPiiDiscoveryRT{ + client: group.client, + PiiDiscoveryRT: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + PiiDiscoveryRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalPiiDiscoveryRT{ + client: group.client, + PiiDiscoveryRT: result, + }, nil + } +} + +// DeletePiiDiscoveryRTByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeletePiiDiscoveryRTByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + PiiDiscoveryRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + PiiDiscoveryRTs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/piiDiscoveryGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreatePiiDiscoveryRTByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreatePiiDiscoveryRTByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PiiDiscoveryRT) (*GlobalPiiDiscoveryRT, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + PiiDiscoveryRTs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"piiDiscoveryGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"PiiDiscoveryRT\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalPiiDiscoveryRT{ + client: group.client, + PiiDiscoveryRT: result, + }, nil +} + +// UpdatePiiDiscoveryRTByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdatePiiDiscoveryRTByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.PiiDiscoveryRT) (*GlobalPiiDiscoveryRT, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + PiiDiscoveryRTs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueGnsid := + objToUpdate.Spec.Gnsid + patchOpGnsid := PatchOp{ + Op: "replace", + Path: "/spec/gnsid", + Value: patchValueGnsid, + } + patch = append(patch, patchOpGnsid) + + patchValueSelectors := + objToUpdate.Spec.Selectors + patchOpSelectors := PatchOp{ + Op: "replace", + Path: "/spec/selectors", + Value: patchValueSelectors, + } + patch = append(patch, patchOpSelectors) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + PiiDiscoveryRTs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalPiiDiscoveryRT{ + client: group.client, + PiiDiscoveryRT: result, + }, nil +} + +// ListPiiDiscoveryRTs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListPiiDiscoveryRTs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalPiiDiscoveryRT, err error) { + key := "piidiscoveryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalPiiDiscoveryRT, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.PiiDiscoveryRT) + result[k] = &GlobalPiiDiscoveryRT{ + client: group.client, + PiiDiscoveryRT: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + PiiDiscoveryRTs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalPiiDiscoveryRT, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalPiiDiscoveryRT{ + client: group.client, + PiiDiscoveryRT: &item, + } + } + } + return +} + +type GlobalPiiDiscoveryRT struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.PiiDiscoveryRT +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalPiiDiscoveryRT) Delete(ctx context.Context) error { + err := obj.client.Global().DeletePiiDiscoveryRTByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.PiiDiscoveryRT = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalPiiDiscoveryRT) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdatePiiDiscoveryRTByName(ctx, obj.PiiDiscoveryRT) + if err != nil { + return err + } + obj.PiiDiscoveryRT = result.PiiDiscoveryRT + return nil +} + +func (obj *GlobalPiiDiscoveryRT) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type piidiscoveryrtGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *piidiscoveryrtGlobalTsmV1Chainer) Subscribe() { + key := "piidiscoveryrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewPiiDiscoveryRTInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *piidiscoveryrtGlobalTsmV1Chainer) Unsubscribe() { + key := "piidiscoveryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *piidiscoveryrtGlobalTsmV1Chainer) IsSubscribed() bool { + key := "piidiscoveryrts.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetPiiDiscoveryByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetPiiDiscoveryByName(ctx context.Context, hashedName string) (*GlobalPiiDiscovery, error) { + key := "piidiscoveries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.PiiDiscovery) + return &GlobalPiiDiscovery{ + client: group.client, + PiiDiscovery: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + PiiDiscoveries().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalPiiDiscovery{ + client: group.client, + PiiDiscovery: result, + }, nil + } +} + +// DeletePiiDiscoveryByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeletePiiDiscoveryByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + PiiDiscoveries().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + PiiDiscoveries().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/piiDiscoveryGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreatePiiDiscoveryByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreatePiiDiscoveryByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PiiDiscovery) (*GlobalPiiDiscovery, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + PiiDiscoveries().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"piiDiscoveryGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"PiiDiscovery\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalPiiDiscovery{ + client: group.client, + PiiDiscovery: result, + }, nil +} + +// UpdatePiiDiscoveryByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdatePiiDiscoveryByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.PiiDiscovery) (*GlobalPiiDiscovery, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + PiiDiscoveries().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + PiiDiscoveries().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalPiiDiscovery{ + client: group.client, + PiiDiscovery: result, + }, nil +} + +// ListPiiDiscoveries returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListPiiDiscoveries(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalPiiDiscovery, err error) { + key := "piidiscoveries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalPiiDiscovery, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.PiiDiscovery) + result[k] = &GlobalPiiDiscovery{ + client: group.client, + PiiDiscovery: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + PiiDiscoveries().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalPiiDiscovery, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalPiiDiscovery{ + client: group.client, + PiiDiscovery: &item, + } + } + } + return +} + +type GlobalPiiDiscovery struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.PiiDiscovery +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalPiiDiscovery) Delete(ctx context.Context) error { + err := obj.client.Global().DeletePiiDiscoveryByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.PiiDiscovery = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalPiiDiscovery) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdatePiiDiscoveryByName(ctx, obj.PiiDiscovery) + if err != nil { + return err + } + obj.PiiDiscovery = result.PiiDiscovery + return nil +} + +func (obj *GlobalPiiDiscovery) GetParent(ctx context.Context) (result *GlobalGNS, err error) { + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnss.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGNSByName(ctx, hashedName) +} + +type piidiscoveryGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *piidiscoveryGlobalTsmV1Chainer) Subscribe() { + key := "piidiscoveries.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewPiiDiscoveryInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *piidiscoveryGlobalTsmV1Chainer) Unsubscribe() { + key := "piidiscoveries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *piidiscoveryGlobalTsmV1Chainer) IsSubscribed() bool { + key := "piidiscoveries.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetPolicyConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetPolicyConfigByName(ctx context.Context, hashedName string) (*GlobalPolicyConfig, error) { + key := "policyconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.PolicyConfig) + return &GlobalPolicyConfig{ + client: group.client, + PolicyConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + PolicyConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalPolicyConfig{ + client: group.client, + PolicyConfig: result, + }, nil + } +} + +// DeletePolicyConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeletePolicyConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + PolicyConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + PolicyConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/policyGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreatePolicyConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreatePolicyConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PolicyConfig) (*GlobalPolicyConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + PolicyConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"policyGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"PolicyConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalPolicyConfig{ + client: group.client, + PolicyConfig: result, + }, nil +} + +// UpdatePolicyConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdatePolicyConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.PolicyConfig) (*GlobalPolicyConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + PolicyConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueSrc := + objToUpdate.Spec.Src + patchOpSrc := PatchOp{ + Op: "replace", + Path: "/spec/src", + Value: patchValueSrc, + } + patch = append(patch, patchOpSrc) + + patchValueDst := + objToUpdate.Spec.Dst + patchOpDst := PatchOp{ + Op: "replace", + Path: "/spec/dst", + Value: patchValueDst, + } + patch = append(patch, patchOpDst) + + patchValueAction := + objToUpdate.Spec.Action + patchOpAction := PatchOp{ + Op: "replace", + Path: "/spec/action", + Value: patchValueAction, + } + patch = append(patch, patchOpAction) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + PolicyConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalPolicyConfig{ + client: group.client, + PolicyConfig: result, + }, nil +} + +// ListPolicyConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListPolicyConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalPolicyConfig, err error) { + key := "policyconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalPolicyConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.PolicyConfig) + result[k] = &GlobalPolicyConfig{ + client: group.client, + PolicyConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + PolicyConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalPolicyConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalPolicyConfig{ + client: group.client, + PolicyConfig: &item, + } + } + } + return +} + +type GlobalPolicyConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.PolicyConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalPolicyConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeletePolicyConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.PolicyConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalPolicyConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdatePolicyConfigByName(ctx, obj.PolicyConfig) + if err != nil { + return err + } + obj.PolicyConfig = result.PolicyConfig + return nil +} + +func (obj *GlobalPolicyConfig) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type policyconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *policyconfigGlobalTsmV1Chainer) Subscribe() { + key := "policyconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewPolicyConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *policyconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "policyconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *policyconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "policyconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetPolicyTemplateByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetPolicyTemplateByName(ctx context.Context, hashedName string) (*GlobalPolicyTemplate, error) { + key := "policytemplates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.PolicyTemplate) + return &GlobalPolicyTemplate{ + client: group.client, + PolicyTemplate: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + PolicyTemplates().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalPolicyTemplate{ + client: group.client, + PolicyTemplate: result, + }, nil + } +} + +// DeletePolicyTemplateByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeletePolicyTemplateByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + PolicyTemplates().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + PolicyTemplates().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/policyTemplatesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["templategroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + TemplateGroups().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreatePolicyTemplateByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreatePolicyTemplateByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PolicyTemplate) (*GlobalPolicyTemplate, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + PolicyTemplates().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["templategroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"policyTemplatesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"PolicyTemplate\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + TemplateGroups().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalPolicyTemplate{ + client: group.client, + PolicyTemplate: result, + }, nil +} + +// UpdatePolicyTemplateByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdatePolicyTemplateByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.PolicyTemplate) (*GlobalPolicyTemplate, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + PolicyTemplates().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + PolicyTemplates().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalPolicyTemplate{ + client: group.client, + PolicyTemplate: result, + }, nil +} + +// ListPolicyTemplates returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListPolicyTemplates(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalPolicyTemplate, err error) { + key := "policytemplates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalPolicyTemplate, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.PolicyTemplate) + result[k] = &GlobalPolicyTemplate{ + client: group.client, + PolicyTemplate: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + PolicyTemplates().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalPolicyTemplate, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalPolicyTemplate{ + client: group.client, + PolicyTemplate: &item, + } + } + } + return +} + +type GlobalPolicyTemplate struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.PolicyTemplate +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalPolicyTemplate) Delete(ctx context.Context) error { + err := obj.client.Global().DeletePolicyTemplateByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.PolicyTemplate = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalPolicyTemplate) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdatePolicyTemplateByName(ctx, obj.PolicyTemplate) + if err != nil { + return err + } + obj.PolicyTemplate = result.PolicyTemplate + return nil +} + +func (obj *GlobalPolicyTemplate) GetParent(ctx context.Context) (result *GlobalTemplateGroup, err error) { + hashedName := helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["templategroups.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetTemplateGroupByName(ctx, hashedName) +} + +type policytemplateGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *policytemplateGlobalTsmV1Chainer) Subscribe() { + key := "policytemplates.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewPolicyTemplateInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *policytemplateGlobalTsmV1Chainer) Unsubscribe() { + key := "policytemplates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *policytemplateGlobalTsmV1Chainer) IsSubscribed() bool { + key := "policytemplates.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetAccessControlPolicyByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetAccessControlPolicyByName(ctx context.Context, hashedName string) (*GlobalAccessControlPolicy, error) { + key := "accesscontrolpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.AccessControlPolicy) + return &GlobalAccessControlPolicy{ + client: group.client, + AccessControlPolicy: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + AccessControlPolicies().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAccessControlPolicy{ + client: group.client, + AccessControlPolicy: result, + }, nil + } +} + +// DeleteAccessControlPolicyByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteAccessControlPolicyByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + AccessControlPolicies().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.PolicyConfigsGvk { + err := group.client. + Global().DeleteACPConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + AccessControlPolicies().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/policyGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateAccessControlPolicyByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateAccessControlPolicyByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AccessControlPolicy) (*GlobalAccessControlPolicy, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.PolicyConfigsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + AccessControlPolicies().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/policyGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "AccessControlPolicy", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalAccessControlPolicy{ + client: group.client, + AccessControlPolicy: result, + }, nil +} + +// UpdateAccessControlPolicyByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateAccessControlPolicyByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.AccessControlPolicy) (*GlobalAccessControlPolicy, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + AccessControlPolicies().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + AccessControlPolicies().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalAccessControlPolicy{ + client: group.client, + AccessControlPolicy: result, + }, nil +} + +// ListAccessControlPolicies returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListAccessControlPolicies(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalAccessControlPolicy, err error) { + key := "accesscontrolpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalAccessControlPolicy, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.AccessControlPolicy) + result[k] = &GlobalAccessControlPolicy{ + client: group.client, + AccessControlPolicy: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + AccessControlPolicies().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalAccessControlPolicy, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalAccessControlPolicy{ + client: group.client, + AccessControlPolicy: &item, + } + } + } + return +} + +type GlobalAccessControlPolicy struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.AccessControlPolicy +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalAccessControlPolicy) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteAccessControlPolicyByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.AccessControlPolicy = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalAccessControlPolicy) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateAccessControlPolicyByName(ctx, obj.AccessControlPolicy) + if err != nil { + return err + } + obj.AccessControlPolicy = result.AccessControlPolicy + return nil +} + +func (obj *GlobalAccessControlPolicy) GetParent(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetConfigByName(ctx, hashedName) +} + +// GetAllPolicyConfigs returns all children of given type +func (obj *GlobalAccessControlPolicy) GetAllPolicyConfigs(ctx context.Context) ( + result []*GlobalACPConfig, err error) { + result = make([]*GlobalACPConfig, 0, len(obj.Spec.PolicyConfigsGvk)) + for _, v := range obj.Spec.PolicyConfigsGvk { + l, err := obj.client.Global().GetACPConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetPolicyConfigs returns child which has given displayName +func (obj *GlobalAccessControlPolicy) GetPolicyConfigs(ctx context.Context, + displayName string) (result *GlobalACPConfig, err error) { + l, ok := obj.Spec.PolicyConfigsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.AccessControlPolicy", "PolicyConfigs", displayName) + } + result, err = obj.client.Global().GetACPConfigByName(ctx, l.Name) + return +} + +// AddPolicyConfigs calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalAccessControlPolicy) AddPolicyConfigs(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ACPConfig) (result *GlobalACPConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["accesscontrolpolicies.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["accesscontrolpolicies.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateACPConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetAccessControlPolicyByName(ctx, obj.GetName()) + if getErr == nil { + obj.AccessControlPolicy = updatedObj.AccessControlPolicy + } + return +} + +// DeletePolicyConfigs calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalAccessControlPolicy) DeletePolicyConfigs(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.PolicyConfigsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.AccessControlPolicy", "PolicyConfigs", displayName) + } + err = obj.client.Global().DeleteACPConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetAccessControlPolicyByName(ctx, obj.GetName()) + if err == nil { + obj.AccessControlPolicy = updatedObj.AccessControlPolicy + } + return +} + +type accesscontrolpolicyGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *accesscontrolpolicyGlobalTsmV1Chainer) Subscribe() { + key := "accesscontrolpolicies.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewAccessControlPolicyInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *accesscontrolpolicyGlobalTsmV1Chainer) Unsubscribe() { + key := "accesscontrolpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *accesscontrolpolicyGlobalTsmV1Chainer) IsSubscribed() bool { + key := "accesscontrolpolicies.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *accesscontrolpolicyGlobalTsmV1Chainer) PolicyConfigs(name string) *acpconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["acpconfigs.global.tsm.tanzu.vmware.com"] = name + return &acpconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetPolicyConfigs calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *accesscontrolpolicyGlobalTsmV1Chainer) GetPolicyConfigs(ctx context.Context, displayName string) (result *GlobalACPConfig, err error) { + hashedName := helper.GetHashedName("acpconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetACPConfigByName(ctx, hashedName) +} + +// AddPolicyConfigs calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *accesscontrolpolicyGlobalTsmV1Chainer) AddPolicyConfigs(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ACPConfig) (result *GlobalACPConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("acpconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateACPConfigByName(ctx, objToCreate) +} + +// DeletePolicyConfigs calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *accesscontrolpolicyGlobalTsmV1Chainer) DeletePolicyConfigs(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("acpconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteACPConfigByName(ctx, hashedName) +} + +// GetProgressiveUpgradeByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetProgressiveUpgradeByName(ctx context.Context, hashedName string) (*GlobalProgressiveUpgrade, error) { + key := "progressiveupgrades.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgrade) + return &GlobalProgressiveUpgrade{ + client: group.client, + ProgressiveUpgrade: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgrades().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalProgressiveUpgrade{ + client: group.client, + ProgressiveUpgrade: result, + }, nil + } +} + +// DeleteProgressiveUpgradeByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteProgressiveUpgradeByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgrades().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.UpgradeGvk { + err := group.client. + Global().DeleteProgressiveUpgradeConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgrades().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/progressiveUpgradeGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateProgressiveUpgradeByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateProgressiveUpgradeByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgrade) (*GlobalProgressiveUpgrade, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.UpgradeGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgrades().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/progressiveUpgradeGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ProgressiveUpgrade", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalProgressiveUpgrade{ + client: group.client, + ProgressiveUpgrade: result, + }, nil +} + +// UpdateProgressiveUpgradeByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateProgressiveUpgradeByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgrade) (*GlobalProgressiveUpgrade, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgrades().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgrades().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalProgressiveUpgrade{ + client: group.client, + ProgressiveUpgrade: result, + }, nil +} + +// ListProgressiveUpgrades returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListProgressiveUpgrades(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalProgressiveUpgrade, err error) { + key := "progressiveupgrades.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalProgressiveUpgrade, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgrade) + result[k] = &GlobalProgressiveUpgrade{ + client: group.client, + ProgressiveUpgrade: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ProgressiveUpgrades().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalProgressiveUpgrade, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalProgressiveUpgrade{ + client: group.client, + ProgressiveUpgrade: &item, + } + } + } + return +} + +type GlobalProgressiveUpgrade struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgrade +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalProgressiveUpgrade) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteProgressiveUpgradeByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ProgressiveUpgrade = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalProgressiveUpgrade) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateProgressiveUpgradeByName(ctx, obj.ProgressiveUpgrade) + if err != nil { + return err + } + obj.ProgressiveUpgrade = result.ProgressiveUpgrade + return nil +} + +func (obj *GlobalProgressiveUpgrade) GetParent(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetConfigByName(ctx, hashedName) +} + +// GetAllUpgrade returns all children of given type +func (obj *GlobalProgressiveUpgrade) GetAllUpgrade(ctx context.Context) ( + result []*GlobalProgressiveUpgradeConfig, err error) { + result = make([]*GlobalProgressiveUpgradeConfig, 0, len(obj.Spec.UpgradeGvk)) + for _, v := range obj.Spec.UpgradeGvk { + l, err := obj.client.Global().GetProgressiveUpgradeConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetUpgrade returns child which has given displayName +func (obj *GlobalProgressiveUpgrade) GetUpgrade(ctx context.Context, + displayName string) (result *GlobalProgressiveUpgradeConfig, err error) { + l, ok := obj.Spec.UpgradeGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ProgressiveUpgrade", "Upgrade", displayName) + } + result, err = obj.client.Global().GetProgressiveUpgradeConfigByName(ctx, l.Name) + return +} + +// AddUpgrade calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalProgressiveUpgrade) AddUpgrade(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig) (result *GlobalProgressiveUpgradeConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["progressiveupgrades.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["progressiveupgrades.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateProgressiveUpgradeConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetProgressiveUpgradeByName(ctx, obj.GetName()) + if getErr == nil { + obj.ProgressiveUpgrade = updatedObj.ProgressiveUpgrade + } + return +} + +// DeleteUpgrade calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalProgressiveUpgrade) DeleteUpgrade(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.UpgradeGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ProgressiveUpgrade", "Upgrade", displayName) + } + err = obj.client.Global().DeleteProgressiveUpgradeConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetProgressiveUpgradeByName(ctx, obj.GetName()) + if err == nil { + obj.ProgressiveUpgrade = updatedObj.ProgressiveUpgrade + } + return +} + +type progressiveupgradeGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *progressiveupgradeGlobalTsmV1Chainer) Subscribe() { + key := "progressiveupgrades.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewProgressiveUpgradeInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *progressiveupgradeGlobalTsmV1Chainer) Unsubscribe() { + key := "progressiveupgrades.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *progressiveupgradeGlobalTsmV1Chainer) IsSubscribed() bool { + key := "progressiveupgrades.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *progressiveupgradeGlobalTsmV1Chainer) Upgrade(name string) *progressiveupgradeconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["progressiveupgradeconfigs.global.tsm.tanzu.vmware.com"] = name + return &progressiveupgradeconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetUpgrade calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *progressiveupgradeGlobalTsmV1Chainer) GetUpgrade(ctx context.Context, displayName string) (result *GlobalProgressiveUpgradeConfig, err error) { + hashedName := helper.GetHashedName("progressiveupgradeconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetProgressiveUpgradeConfigByName(ctx, hashedName) +} + +// AddUpgrade calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *progressiveupgradeGlobalTsmV1Chainer) AddUpgrade(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig) (result *GlobalProgressiveUpgradeConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("progressiveupgradeconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateProgressiveUpgradeConfigByName(ctx, objToCreate) +} + +// DeleteUpgrade calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *progressiveupgradeGlobalTsmV1Chainer) DeleteUpgrade(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("progressiveupgradeconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteProgressiveUpgradeConfigByName(ctx, hashedName) +} + +// GetProgressiveUpgradeConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetProgressiveUpgradeConfigByName(ctx context.Context, hashedName string) (*GlobalProgressiveUpgradeConfig, error) { + key := "progressiveupgradeconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig) + return &GlobalProgressiveUpgradeConfig{ + client: group.client, + ProgressiveUpgradeConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalProgressiveUpgradeConfig{ + client: group.client, + ProgressiveUpgradeConfig: result, + }, nil + } +} + +// DeleteProgressiveUpgradeConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteProgressiveUpgradeConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/upgradeGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["progressiveupgrades.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("progressiveupgrades.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgrades().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateProgressiveUpgradeConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateProgressiveUpgradeConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig) (*GlobalProgressiveUpgradeConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["progressiveupgrades.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("progressiveupgrades.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"upgradeGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ProgressiveUpgradeConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgrades().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalProgressiveUpgradeConfig{ + client: group.client, + ProgressiveUpgradeConfig: result, + }, nil +} + +// UpdateProgressiveUpgradeConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateProgressiveUpgradeConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig) (*GlobalProgressiveUpgradeConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueServices := + objToUpdate.Spec.Services + patchOpServices := PatchOp{ + Op: "replace", + Path: "/spec/services", + Value: patchValueServices, + } + patch = append(patch, patchOpServices) + + patchValueUpgradeStrategy := + objToUpdate.Spec.UpgradeStrategy + patchOpUpgradeStrategy := PatchOp{ + Op: "replace", + Path: "/spec/upgradeStrategy", + Value: patchValueUpgradeStrategy, + } + patch = append(patch, patchOpUpgradeStrategy) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalProgressiveUpgradeConfig{ + client: group.client, + ProgressiveUpgradeConfig: result, + }, nil +} + +// ListProgressiveUpgradeConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListProgressiveUpgradeConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalProgressiveUpgradeConfig, err error) { + key := "progressiveupgradeconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalProgressiveUpgradeConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig) + result[k] = &GlobalProgressiveUpgradeConfig{ + client: group.client, + ProgressiveUpgradeConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ProgressiveUpgradeConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalProgressiveUpgradeConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalProgressiveUpgradeConfig{ + client: group.client, + ProgressiveUpgradeConfig: &item, + } + } + } + return +} + +type GlobalProgressiveUpgradeConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalProgressiveUpgradeConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteProgressiveUpgradeConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ProgressiveUpgradeConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalProgressiveUpgradeConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateProgressiveUpgradeConfigByName(ctx, obj.ProgressiveUpgradeConfig) + if err != nil { + return err + } + obj.ProgressiveUpgradeConfig = result.ProgressiveUpgradeConfig + return nil +} + +func (obj *GlobalProgressiveUpgradeConfig) GetParent(ctx context.Context) (result *GlobalProgressiveUpgrade, err error) { + hashedName := helper.GetHashedName("progressiveupgrades.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["progressiveupgrades.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetProgressiveUpgradeByName(ctx, hashedName) +} + +type progressiveupgradeconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *progressiveupgradeconfigGlobalTsmV1Chainer) Subscribe() { + key := "progressiveupgradeconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewProgressiveUpgradeConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *progressiveupgradeconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "progressiveupgradeconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *progressiveupgradeconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "progressiveupgradeconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetProgressiveUpgradeFolderByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetProgressiveUpgradeFolderByName(ctx context.Context, hashedName string) (*GlobalProgressiveUpgradeFolder, error) { + key := "progressiveupgradefolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder) + return &GlobalProgressiveUpgradeFolder{ + client: group.client, + ProgressiveUpgradeFolder: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalProgressiveUpgradeFolder{ + client: group.client, + ProgressiveUpgradeFolder: result, + }, nil + } +} + +// DeleteProgressiveUpgradeFolderByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteProgressiveUpgradeFolderByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.UpgradesGvk { + err := group.client. + Global().DeleteProgressiveUpgradeRuntimeByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeFolders().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/progressiveUpgradeGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateProgressiveUpgradeFolderByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateProgressiveUpgradeFolderByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder) (*GlobalProgressiveUpgradeFolder, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] == "" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.Labels[common.DISPLAY_NAME_LABEL]) + } + + objToCreate.Spec.UpgradesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeFolders().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/progressiveUpgradeGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ProgressiveUpgradeFolder", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalProgressiveUpgradeFolder{ + client: group.client, + ProgressiveUpgradeFolder: result, + }, nil +} + +// UpdateProgressiveUpgradeFolderByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateProgressiveUpgradeFolderByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder) (*GlobalProgressiveUpgradeFolder, error) { + if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) + } + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeFolders().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeFolders().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalProgressiveUpgradeFolder{ + client: group.client, + ProgressiveUpgradeFolder: result, + }, nil +} + +// ListProgressiveUpgradeFolders returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListProgressiveUpgradeFolders(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalProgressiveUpgradeFolder, err error) { + key := "progressiveupgradefolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalProgressiveUpgradeFolder, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder) + result[k] = &GlobalProgressiveUpgradeFolder{ + client: group.client, + ProgressiveUpgradeFolder: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ProgressiveUpgradeFolders().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalProgressiveUpgradeFolder, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalProgressiveUpgradeFolder{ + client: group.client, + ProgressiveUpgradeFolder: &item, + } + } + } + return +} + +type GlobalProgressiveUpgradeFolder struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalProgressiveUpgradeFolder) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteProgressiveUpgradeFolderByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ProgressiveUpgradeFolder = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalProgressiveUpgradeFolder) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateProgressiveUpgradeFolderByName(ctx, obj.ProgressiveUpgradeFolder) + if err != nil { + return err + } + obj.ProgressiveUpgradeFolder = result.ProgressiveUpgradeFolder + return nil +} + +func (obj *GlobalProgressiveUpgradeFolder) GetParent(ctx context.Context) (result *GlobalRuntime, err error) { + hashedName := helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["runtimes.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetRuntimeByName(ctx, hashedName) +} + +// GetAllUpgrades returns all children of given type +func (obj *GlobalProgressiveUpgradeFolder) GetAllUpgrades(ctx context.Context) ( + result []*GlobalProgressiveUpgradeRuntime, err error) { + result = make([]*GlobalProgressiveUpgradeRuntime, 0, len(obj.Spec.UpgradesGvk)) + for _, v := range obj.Spec.UpgradesGvk { + l, err := obj.client.Global().GetProgressiveUpgradeRuntimeByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetUpgrades returns child which has given displayName +func (obj *GlobalProgressiveUpgradeFolder) GetUpgrades(ctx context.Context, + displayName string) (result *GlobalProgressiveUpgradeRuntime, err error) { + l, ok := obj.Spec.UpgradesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ProgressiveUpgradeFolder", "Upgrades", displayName) + } + result, err = obj.client.Global().GetProgressiveUpgradeRuntimeByName(ctx, l.Name) + return +} + +// AddUpgrades calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalProgressiveUpgradeFolder) AddUpgrades(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime) (result *GlobalProgressiveUpgradeRuntime, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["progressiveupgradefolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["progressiveupgradefolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateProgressiveUpgradeRuntimeByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetProgressiveUpgradeFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.ProgressiveUpgradeFolder = updatedObj.ProgressiveUpgradeFolder + } + return +} + +// DeleteUpgrades calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalProgressiveUpgradeFolder) DeleteUpgrades(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.UpgradesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ProgressiveUpgradeFolder", "Upgrades", displayName) + } + err = obj.client.Global().DeleteProgressiveUpgradeRuntimeByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetProgressiveUpgradeFolderByName(ctx, obj.GetName()) + if err == nil { + obj.ProgressiveUpgradeFolder = updatedObj.ProgressiveUpgradeFolder + } + return +} + +type progressiveupgradefolderGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *progressiveupgradefolderGlobalTsmV1Chainer) Subscribe() { + key := "progressiveupgradefolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewProgressiveUpgradeFolderInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *progressiveupgradefolderGlobalTsmV1Chainer) Unsubscribe() { + key := "progressiveupgradefolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *progressiveupgradefolderGlobalTsmV1Chainer) IsSubscribed() bool { + key := "progressiveupgradefolders.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *progressiveupgradefolderGlobalTsmV1Chainer) Upgrades(name string) *progressiveupgraderuntimeGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["progressiveupgraderuntimes.global.tsm.tanzu.vmware.com"] = name + return &progressiveupgraderuntimeGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetUpgrades calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *progressiveupgradefolderGlobalTsmV1Chainer) GetUpgrades(ctx context.Context, displayName string) (result *GlobalProgressiveUpgradeRuntime, err error) { + hashedName := helper.GetHashedName("progressiveupgraderuntimes.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetProgressiveUpgradeRuntimeByName(ctx, hashedName) +} + +// AddUpgrades calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *progressiveupgradefolderGlobalTsmV1Chainer) AddUpgrades(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime) (result *GlobalProgressiveUpgradeRuntime, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("progressiveupgraderuntimes.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateProgressiveUpgradeRuntimeByName(ctx, objToCreate) +} + +// DeleteUpgrades calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *progressiveupgradefolderGlobalTsmV1Chainer) DeleteUpgrades(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("progressiveupgraderuntimes.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteProgressiveUpgradeRuntimeByName(ctx, hashedName) +} + +// GetProgressiveUpgradeRuntimeByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetProgressiveUpgradeRuntimeByName(ctx context.Context, hashedName string) (*GlobalProgressiveUpgradeRuntime, error) { + key := "progressiveupgraderuntimes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime) + return &GlobalProgressiveUpgradeRuntime{ + client: group.client, + ProgressiveUpgradeRuntime: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeRuntimes().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalProgressiveUpgradeRuntime{ + client: group.client, + ProgressiveUpgradeRuntime: result, + }, nil + } +} + +// DeleteProgressiveUpgradeRuntimeByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteProgressiveUpgradeRuntimeByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeRuntimes().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeRuntimes().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/upgradesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["progressiveupgradefolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("progressiveupgradefolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateProgressiveUpgradeRuntimeByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateProgressiveUpgradeRuntimeByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime) (*GlobalProgressiveUpgradeRuntime, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeRuntimes().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["progressiveupgradefolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("progressiveupgradefolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"upgradesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ProgressiveUpgradeRuntime\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalProgressiveUpgradeRuntime{ + client: group.client, + ProgressiveUpgradeRuntime: result, + }, nil +} + +// UpdateProgressiveUpgradeRuntimeByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateProgressiveUpgradeRuntimeByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime) (*GlobalProgressiveUpgradeRuntime, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeRuntimes().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueUpgradeName := + objToUpdate.Spec.UpgradeName + patchOpUpgradeName := PatchOp{ + Op: "replace", + Path: "/spec/upgradeName", + Value: patchValueUpgradeName, + } + patch = append(patch, patchOpUpgradeName) + + patchValueStatus := + objToUpdate.Spec.Status + patchOpStatus := PatchOp{ + Op: "replace", + Path: "/spec/status", + Value: patchValueStatus, + } + patch = append(patch, patchOpStatus) + + patchValueStep := + objToUpdate.Spec.Step + patchOpStep := PatchOp{ + Op: "replace", + Path: "/spec/step", + Value: patchValueStep, + } + patch = append(patch, patchOpStep) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ProgressiveUpgradeRuntimes().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalProgressiveUpgradeRuntime{ + client: group.client, + ProgressiveUpgradeRuntime: result, + }, nil +} + +// ListProgressiveUpgradeRuntimes returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListProgressiveUpgradeRuntimes(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalProgressiveUpgradeRuntime, err error) { + key := "progressiveupgraderuntimes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalProgressiveUpgradeRuntime, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime) + result[k] = &GlobalProgressiveUpgradeRuntime{ + client: group.client, + ProgressiveUpgradeRuntime: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ProgressiveUpgradeRuntimes().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalProgressiveUpgradeRuntime, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalProgressiveUpgradeRuntime{ + client: group.client, + ProgressiveUpgradeRuntime: &item, + } + } + } + return +} + +type GlobalProgressiveUpgradeRuntime struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeRuntime +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalProgressiveUpgradeRuntime) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteProgressiveUpgradeRuntimeByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ProgressiveUpgradeRuntime = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalProgressiveUpgradeRuntime) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateProgressiveUpgradeRuntimeByName(ctx, obj.ProgressiveUpgradeRuntime) + if err != nil { + return err + } + obj.ProgressiveUpgradeRuntime = result.ProgressiveUpgradeRuntime + return nil +} + +func (obj *GlobalProgressiveUpgradeRuntime) GetParent(ctx context.Context) (result *GlobalProgressiveUpgradeFolder, err error) { + hashedName := helper.GetHashedName("progressiveupgradefolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["progressiveupgradefolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetProgressiveUpgradeFolderByName(ctx, hashedName) +} + +type progressiveupgraderuntimeGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *progressiveupgraderuntimeGlobalTsmV1Chainer) Subscribe() { + key := "progressiveupgraderuntimes.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewProgressiveUpgradeRuntimeInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *progressiveupgraderuntimeGlobalTsmV1Chainer) Unsubscribe() { + key := "progressiveupgraderuntimes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *progressiveupgraderuntimeGlobalTsmV1Chainer) IsSubscribed() bool { + key := "progressiveupgraderuntimes.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetProjectConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetProjectConfigByName(ctx context.Context, hashedName string) (*GlobalProjectConfig, error) { + key := "projectconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ProjectConfig) + return &GlobalProjectConfig{ + client: group.client, + ProjectConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ProjectConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalProjectConfig{ + client: group.client, + ProjectConfig: result, + }, nil + } +} + +// DeleteProjectConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteProjectConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ProjectConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.CertificateAuthoritiesGvk { + err := group.client. + Global().DeleteCertificateAuthorityConfigNByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ProjectConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/configGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["projects.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("projects.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Projects().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateProjectConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateProjectConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProjectConfig) (*GlobalProjectConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.CertificateAuthoritiesGvk = nil + objToCreate.Spec.SvcGroupsGvk = nil + objToCreate.Spec.GnsGvk = nil + objToCreate.Spec.PolicyConfigsGvk = nil + objToCreate.Spec.TemplateGroupsGvk = nil + objToCreate.Spec.CertificatesGvk = nil + objToCreate.Spec.ExternalAccountsGvk = nil + objToCreate.Spec.ExternalDNSGvk = nil + objToCreate.Spec.AutoscalersGvk = nil + objToCreate.Spec.ClustersGvk = nil + objToCreate.Spec.ServiceLevelObjectivesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ProjectConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["projects.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("projects.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/configGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ProjectConfig", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Projects().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalProjectConfig{ + client: group.client, + ProjectConfig: result, + }, nil +} + +// UpdateProjectConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateProjectConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ProjectConfig) (*GlobalProjectConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ProjectConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ProjectConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalProjectConfig{ + client: group.client, + ProjectConfig: result, + }, nil +} + +// ListProjectConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListProjectConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalProjectConfig, err error) { + key := "projectconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalProjectConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ProjectConfig) + result[k] = &GlobalProjectConfig{ + client: group.client, + ProjectConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ProjectConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalProjectConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalProjectConfig{ + client: group.client, + ProjectConfig: &item, + } + } + } + return +} + +type GlobalProjectConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ProjectConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalProjectConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteProjectConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ProjectConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalProjectConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateProjectConfigByName(ctx, obj.ProjectConfig) + if err != nil { + return err + } + obj.ProjectConfig = result.ProjectConfig + return nil +} + +func (obj *GlobalProjectConfig) GetParent(ctx context.Context) (result *GlobalProject, err error) { + hashedName := helper.GetHashedName("projects.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["projects.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetProjectByName(ctx, hashedName) +} + +// GetAllCertificateAuthorities returns all children of given type +func (obj *GlobalProjectConfig) GetAllCertificateAuthorities(ctx context.Context) ( + result []*GlobalCertificateAuthorityConfigN, err error) { + result = make([]*GlobalCertificateAuthorityConfigN, 0, len(obj.Spec.CertificateAuthoritiesGvk)) + for _, v := range obj.Spec.CertificateAuthoritiesGvk { + l, err := obj.client.Global().GetCertificateAuthorityConfigNByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetCertificateAuthorities returns child which has given displayName +func (obj *GlobalProjectConfig) GetCertificateAuthorities(ctx context.Context, + displayName string) (result *GlobalCertificateAuthorityConfigN, err error) { + l, ok := obj.Spec.CertificateAuthoritiesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ProjectConfig", "CertificateAuthorities", displayName) + } + result, err = obj.client.Global().GetCertificateAuthorityConfigNByName(ctx, l.Name) + return +} + +// AddCertificateAuthorities calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalProjectConfig) AddCertificateAuthorities(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN) (result *GlobalCertificateAuthorityConfigN, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["projectconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["projectconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateCertificateAuthorityConfigNByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetProjectConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.ProjectConfig = updatedObj.ProjectConfig + } + return +} + +// DeleteCertificateAuthorities calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalProjectConfig) DeleteCertificateAuthorities(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.CertificateAuthoritiesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ProjectConfig", "CertificateAuthorities", displayName) + } + err = obj.client.Global().DeleteCertificateAuthorityConfigNByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetProjectConfigByName(ctx, obj.GetName()) + if err == nil { + obj.ProjectConfig = updatedObj.ProjectConfig + } + return +} + +// GetAllSvcGroups returns all links of given type +func (obj *GlobalProjectConfig) GetAllSvcGroups(ctx context.Context) ( + result []*GlobalSvcGroup, err error) { + result = make([]*GlobalSvcGroup, 0, len(obj.Spec.SvcGroupsGvk)) + for _, v := range obj.Spec.SvcGroupsGvk { + l, err := obj.client.Global().GetSvcGroupByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetSvcGroups returns link which has given displayName +func (obj *GlobalProjectConfig) GetSvcGroups(ctx context.Context, + displayName string) (result *GlobalSvcGroup, err error) { + l, ok := obj.Spec.SvcGroupsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ProjectConfig", "SvcGroups", displayName) + } + result, err = obj.client.Global().GetSvcGroupByName(ctx, l.Name) + return +} + +// LinkSvcGroups links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalProjectConfig) LinkSvcGroups(ctx context.Context, + linkToAdd *GlobalSvcGroup) error { + + payload := "{\"spec\": {\"svcGroupsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"SvcGroup\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ProjectConfig = result + return nil +} + +// UnlinkSvcGroups unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalProjectConfig) UnlinkSvcGroups(ctx context.Context, + linkToRemove *GlobalSvcGroup) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/svcGroupsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ProjectConfig = result + return nil + +} + +// GetAllGns returns all links of given type +func (obj *GlobalProjectConfig) GetAllGns(ctx context.Context) ( + result []*GlobalGNS, err error) { + result = make([]*GlobalGNS, 0, len(obj.Spec.GnsGvk)) + for _, v := range obj.Spec.GnsGvk { + l, err := obj.client.Global().GetGNSByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetGns returns link which has given displayName +func (obj *GlobalProjectConfig) GetGns(ctx context.Context, + displayName string) (result *GlobalGNS, err error) { + l, ok := obj.Spec.GnsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ProjectConfig", "Gns", displayName) + } + result, err = obj.client.Global().GetGNSByName(ctx, l.Name) + return +} + +// LinkGns links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalProjectConfig) LinkGns(ctx context.Context, + linkToAdd *GlobalGNS) error { + + payload := "{\"spec\": {\"gnsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"GNS\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ProjectConfig = result + return nil +} + +// UnlinkGns unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalProjectConfig) UnlinkGns(ctx context.Context, + linkToRemove *GlobalGNS) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/gnsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ProjectConfig = result + return nil + +} + +// GetAllPolicyConfigs returns all links of given type +func (obj *GlobalProjectConfig) GetAllPolicyConfigs(ctx context.Context) ( + result []*GlobalACPConfig, err error) { + result = make([]*GlobalACPConfig, 0, len(obj.Spec.PolicyConfigsGvk)) + for _, v := range obj.Spec.PolicyConfigsGvk { + l, err := obj.client.Global().GetACPConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetPolicyConfigs returns link which has given displayName +func (obj *GlobalProjectConfig) GetPolicyConfigs(ctx context.Context, + displayName string) (result *GlobalACPConfig, err error) { + l, ok := obj.Spec.PolicyConfigsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ProjectConfig", "PolicyConfigs", displayName) + } + result, err = obj.client.Global().GetACPConfigByName(ctx, l.Name) + return +} + +// LinkPolicyConfigs links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalProjectConfig) LinkPolicyConfigs(ctx context.Context, + linkToAdd *GlobalACPConfig) error { + + payload := "{\"spec\": {\"policyConfigsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ACPConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ProjectConfig = result + return nil +} + +// UnlinkPolicyConfigs unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalProjectConfig) UnlinkPolicyConfigs(ctx context.Context, + linkToRemove *GlobalACPConfig) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/policyConfigsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ProjectConfig = result + return nil + +} + +// GetAllTemplateGroups returns all links of given type +func (obj *GlobalProjectConfig) GetAllTemplateGroups(ctx context.Context) ( + result []*GlobalTemplateGroup, err error) { + result = make([]*GlobalTemplateGroup, 0, len(obj.Spec.TemplateGroupsGvk)) + for _, v := range obj.Spec.TemplateGroupsGvk { + l, err := obj.client.Global().GetTemplateGroupByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetTemplateGroups returns link which has given displayName +func (obj *GlobalProjectConfig) GetTemplateGroups(ctx context.Context, + displayName string) (result *GlobalTemplateGroup, err error) { + l, ok := obj.Spec.TemplateGroupsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ProjectConfig", "TemplateGroups", displayName) + } + result, err = obj.client.Global().GetTemplateGroupByName(ctx, l.Name) + return +} + +// LinkTemplateGroups links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalProjectConfig) LinkTemplateGroups(ctx context.Context, + linkToAdd *GlobalTemplateGroup) error { + + payload := "{\"spec\": {\"templateGroupsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"TemplateGroup\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ProjectConfig = result + return nil +} + +// UnlinkTemplateGroups unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalProjectConfig) UnlinkTemplateGroups(ctx context.Context, + linkToRemove *GlobalTemplateGroup) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/templateGroupsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ProjectConfig = result + return nil + +} + +// GetAllCertificates returns all links of given type +func (obj *GlobalProjectConfig) GetAllCertificates(ctx context.Context) ( + result []*GlobalCertificateConfigN, err error) { + result = make([]*GlobalCertificateConfigN, 0, len(obj.Spec.CertificatesGvk)) + for _, v := range obj.Spec.CertificatesGvk { + l, err := obj.client.Global().GetCertificateConfigNByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetCertificates returns link which has given displayName +func (obj *GlobalProjectConfig) GetCertificates(ctx context.Context, + displayName string) (result *GlobalCertificateConfigN, err error) { + l, ok := obj.Spec.CertificatesGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ProjectConfig", "Certificates", displayName) + } + result, err = obj.client.Global().GetCertificateConfigNByName(ctx, l.Name) + return +} + +// LinkCertificates links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalProjectConfig) LinkCertificates(ctx context.Context, + linkToAdd *GlobalCertificateConfigN) error { + + payload := "{\"spec\": {\"certificatesGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"CertificateConfigN\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ProjectConfig = result + return nil +} + +// UnlinkCertificates unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalProjectConfig) UnlinkCertificates(ctx context.Context, + linkToRemove *GlobalCertificateConfigN) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/certificatesGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ProjectConfig = result + return nil + +} + +// GetAllExternalAccounts returns all links of given type +func (obj *GlobalProjectConfig) GetAllExternalAccounts(ctx context.Context) ( + result []*GlobalExternalAccountConfigN, err error) { + result = make([]*GlobalExternalAccountConfigN, 0, len(obj.Spec.ExternalAccountsGvk)) + for _, v := range obj.Spec.ExternalAccountsGvk { + l, err := obj.client.Global().GetExternalAccountConfigNByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetExternalAccounts returns link which has given displayName +func (obj *GlobalProjectConfig) GetExternalAccounts(ctx context.Context, + displayName string) (result *GlobalExternalAccountConfigN, err error) { + l, ok := obj.Spec.ExternalAccountsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ProjectConfig", "ExternalAccounts", displayName) + } + result, err = obj.client.Global().GetExternalAccountConfigNByName(ctx, l.Name) + return +} + +// LinkExternalAccounts links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalProjectConfig) LinkExternalAccounts(ctx context.Context, + linkToAdd *GlobalExternalAccountConfigN) error { + + payload := "{\"spec\": {\"externalAccountsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ExternalAccountConfigN\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ProjectConfig = result + return nil +} + +// UnlinkExternalAccounts unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalProjectConfig) UnlinkExternalAccounts(ctx context.Context, + linkToRemove *GlobalExternalAccountConfigN) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/externalAccountsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ProjectConfig = result + return nil + +} + +// GetAllExternalDNS returns all links of given type +func (obj *GlobalProjectConfig) GetAllExternalDNS(ctx context.Context) ( + result []*GlobalExternalDNSConfigN, err error) { + result = make([]*GlobalExternalDNSConfigN, 0, len(obj.Spec.ExternalDNSGvk)) + for _, v := range obj.Spec.ExternalDNSGvk { + l, err := obj.client.Global().GetExternalDNSConfigNByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetExternalDNS returns link which has given displayName +func (obj *GlobalProjectConfig) GetExternalDNS(ctx context.Context, + displayName string) (result *GlobalExternalDNSConfigN, err error) { + l, ok := obj.Spec.ExternalDNSGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ProjectConfig", "ExternalDNS", displayName) + } + result, err = obj.client.Global().GetExternalDNSConfigNByName(ctx, l.Name) + return +} + +// LinkExternalDNS links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalProjectConfig) LinkExternalDNS(ctx context.Context, + linkToAdd *GlobalExternalDNSConfigN) error { + + payload := "{\"spec\": {\"externalDNSGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ExternalDNSConfigN\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ProjectConfig = result + return nil +} + +// UnlinkExternalDNS unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalProjectConfig) UnlinkExternalDNS(ctx context.Context, + linkToRemove *GlobalExternalDNSConfigN) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/externalDNSGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ProjectConfig = result + return nil + +} + +// GetAllAutoscalers returns all links of given type +func (obj *GlobalProjectConfig) GetAllAutoscalers(ctx context.Context) ( + result []*GlobalAutoscaler, err error) { + result = make([]*GlobalAutoscaler, 0, len(obj.Spec.AutoscalersGvk)) + for _, v := range obj.Spec.AutoscalersGvk { + l, err := obj.client.Global().GetAutoscalerByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetAutoscalers returns link which has given displayName +func (obj *GlobalProjectConfig) GetAutoscalers(ctx context.Context, + displayName string) (result *GlobalAutoscaler, err error) { + l, ok := obj.Spec.AutoscalersGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ProjectConfig", "Autoscalers", displayName) + } + result, err = obj.client.Global().GetAutoscalerByName(ctx, l.Name) + return +} + +// LinkAutoscalers links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalProjectConfig) LinkAutoscalers(ctx context.Context, + linkToAdd *GlobalAutoscaler) error { + + payload := "{\"spec\": {\"autoscalersGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"Autoscaler\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ProjectConfig = result + return nil +} + +// UnlinkAutoscalers unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalProjectConfig) UnlinkAutoscalers(ctx context.Context, + linkToRemove *GlobalAutoscaler) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/autoscalersGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ProjectConfig = result + return nil + +} + +// GetAllClusters returns all links of given type +func (obj *GlobalProjectConfig) GetAllClusters(ctx context.Context) ( + result []*GlobalClusterSettings, err error) { + result = make([]*GlobalClusterSettings, 0, len(obj.Spec.ClustersGvk)) + for _, v := range obj.Spec.ClustersGvk { + l, err := obj.client.Global().GetClusterSettingsByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetClusters returns link which has given displayName +func (obj *GlobalProjectConfig) GetClusters(ctx context.Context, + displayName string) (result *GlobalClusterSettings, err error) { + l, ok := obj.Spec.ClustersGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ProjectConfig", "Clusters", displayName) + } + result, err = obj.client.Global().GetClusterSettingsByName(ctx, l.Name) + return +} + +// LinkClusters links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalProjectConfig) LinkClusters(ctx context.Context, + linkToAdd *GlobalClusterSettings) error { + + payload := "{\"spec\": {\"clustersGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ClusterSettings\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ProjectConfig = result + return nil +} + +// UnlinkClusters unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalProjectConfig) UnlinkClusters(ctx context.Context, + linkToRemove *GlobalClusterSettings) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/clustersGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ProjectConfig = result + return nil + +} + +// GetAllServiceLevelObjectives returns all links of given type +func (obj *GlobalProjectConfig) GetAllServiceLevelObjectives(ctx context.Context) ( + result []*GlobalServiceLevelObjective, err error) { + result = make([]*GlobalServiceLevelObjective, 0, len(obj.Spec.ServiceLevelObjectivesGvk)) + for _, v := range obj.Spec.ServiceLevelObjectivesGvk { + l, err := obj.client.Global().GetServiceLevelObjectiveByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceLevelObjectives returns link which has given displayName +func (obj *GlobalProjectConfig) GetServiceLevelObjectives(ctx context.Context, + displayName string) (result *GlobalServiceLevelObjective, err error) { + l, ok := obj.Spec.ServiceLevelObjectivesGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ProjectConfig", "ServiceLevelObjectives", displayName) + } + result, err = obj.client.Global().GetServiceLevelObjectiveByName(ctx, l.Name) + return +} + +// LinkServiceLevelObjectives links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalProjectConfig) LinkServiceLevelObjectives(ctx context.Context, + linkToAdd *GlobalServiceLevelObjective) error { + + payload := "{\"spec\": {\"serviceLevelObjectivesGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceLevelObjective\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ProjectConfig = result + return nil +} + +// UnlinkServiceLevelObjectives unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalProjectConfig) UnlinkServiceLevelObjectives(ctx context.Context, + linkToRemove *GlobalServiceLevelObjective) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceLevelObjectivesGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ProjectConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ProjectConfig = result + return nil + +} + +type projectconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *projectconfigGlobalTsmV1Chainer) Subscribe() { + key := "projectconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewProjectConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *projectconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "projectconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *projectconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "projectconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *projectconfigGlobalTsmV1Chainer) CertificateAuthorities(name string) *certificateauthorityconfignGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["certificateauthorityconfigns.global.tsm.tanzu.vmware.com"] = name + return &certificateauthorityconfignGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetCertificateAuthorities calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *projectconfigGlobalTsmV1Chainer) GetCertificateAuthorities(ctx context.Context, displayName string) (result *GlobalCertificateAuthorityConfigN, err error) { + hashedName := helper.GetHashedName("certificateauthorityconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetCertificateAuthorityConfigNByName(ctx, hashedName) +} + +// AddCertificateAuthorities calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *projectconfigGlobalTsmV1Chainer) AddCertificateAuthorities(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.CertificateAuthorityConfigN) (result *GlobalCertificateAuthorityConfigN, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("certificateauthorityconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateCertificateAuthorityConfigNByName(ctx, objToCreate) +} + +// DeleteCertificateAuthorities calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *projectconfigGlobalTsmV1Chainer) DeleteCertificateAuthorities(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("certificateauthorityconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteCertificateAuthorityConfigNByName(ctx, hashedName) +} + +// GetProjectInventoryByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetProjectInventoryByName(ctx context.Context, hashedName string) (*GlobalProjectInventory, error) { + key := "projectinventories.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ProjectInventory) + return &GlobalProjectInventory{ + client: group.client, + ProjectInventory: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ProjectInventories().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalProjectInventory{ + client: group.client, + ProjectInventory: result, + }, nil + } +} + +// DeleteProjectInventoryByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteProjectInventoryByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ProjectInventories().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ProjectInventories().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/inventoryGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["projects.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("projects.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Projects().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateProjectInventoryByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateProjectInventoryByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProjectInventory) (*GlobalProjectInventory, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ClustersGvk = nil + objToCreate.Spec.ExternalDNSGvk = nil + objToCreate.Spec.JobsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ProjectInventories().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["projects.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("projects.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/inventoryGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ProjectInventory", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Projects().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalProjectInventory{ + client: group.client, + ProjectInventory: result, + }, nil +} + +// UpdateProjectInventoryByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateProjectInventoryByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ProjectInventory) (*GlobalProjectInventory, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ProjectInventories().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ProjectInventories().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalProjectInventory{ + client: group.client, + ProjectInventory: result, + }, nil +} + +// ListProjectInventories returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListProjectInventories(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalProjectInventory, err error) { + key := "projectinventories.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalProjectInventory, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ProjectInventory) + result[k] = &GlobalProjectInventory{ + client: group.client, + ProjectInventory: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ProjectInventories().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalProjectInventory, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalProjectInventory{ + client: group.client, + ProjectInventory: &item, + } + } + } + return +} + +type GlobalProjectInventory struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ProjectInventory +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalProjectInventory) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteProjectInventoryByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ProjectInventory = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalProjectInventory) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateProjectInventoryByName(ctx, obj.ProjectInventory) + if err != nil { + return err + } + obj.ProjectInventory = result.ProjectInventory + return nil +} + +func (obj *GlobalProjectInventory) GetParent(ctx context.Context) (result *GlobalProject, err error) { + hashedName := helper.GetHashedName("projects.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["projects.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetProjectByName(ctx, hashedName) +} + +// GetAllClusters returns all links of given type +func (obj *GlobalProjectInventory) GetAllClusters(ctx context.Context) ( + result []*GlobalCluster, err error) { + result = make([]*GlobalCluster, 0, len(obj.Spec.ClustersGvk)) + for _, v := range obj.Spec.ClustersGvk { + l, err := obj.client.Global().GetClusterByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetClusters returns link which has given displayName +func (obj *GlobalProjectInventory) GetClusters(ctx context.Context, + displayName string) (result *GlobalCluster, err error) { + l, ok := obj.Spec.ClustersGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ProjectInventory", "Clusters", displayName) + } + result, err = obj.client.Global().GetClusterByName(ctx, l.Name) + return +} + +// LinkClusters links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalProjectInventory) LinkClusters(ctx context.Context, + linkToAdd *GlobalCluster) error { + + payload := "{\"spec\": {\"clustersGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"Cluster\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ProjectInventories().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ProjectInventory = result + return nil +} + +// UnlinkClusters unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalProjectInventory) UnlinkClusters(ctx context.Context, + linkToRemove *GlobalCluster) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/clustersGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ProjectInventories().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ProjectInventory = result + return nil + +} + +// GetAllExternalDNS returns all links of given type +func (obj *GlobalProjectInventory) GetAllExternalDNS(ctx context.Context) ( + result []*GlobalExternalDNSInventory, err error) { + result = make([]*GlobalExternalDNSInventory, 0, len(obj.Spec.ExternalDNSGvk)) + for _, v := range obj.Spec.ExternalDNSGvk { + l, err := obj.client.Global().GetExternalDNSInventoryByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetExternalDNS returns link which has given displayName +func (obj *GlobalProjectInventory) GetExternalDNS(ctx context.Context, + displayName string) (result *GlobalExternalDNSInventory, err error) { + l, ok := obj.Spec.ExternalDNSGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ProjectInventory", "ExternalDNS", displayName) + } + result, err = obj.client.Global().GetExternalDNSInventoryByName(ctx, l.Name) + return +} + +// LinkExternalDNS links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalProjectInventory) LinkExternalDNS(ctx context.Context, + linkToAdd *GlobalExternalDNSInventory) error { + + payload := "{\"spec\": {\"externalDNSGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ExternalDNSInventory\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ProjectInventories().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ProjectInventory = result + return nil +} + +// UnlinkExternalDNS unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalProjectInventory) UnlinkExternalDNS(ctx context.Context, + linkToRemove *GlobalExternalDNSInventory) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/externalDNSGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ProjectInventories().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ProjectInventory = result + return nil + +} + +// GetAllJobs returns all links of given type +func (obj *GlobalProjectInventory) GetAllJobs(ctx context.Context) ( + result []*GlobalJob, err error) { + result = make([]*GlobalJob, 0, len(obj.Spec.JobsGvk)) + for _, v := range obj.Spec.JobsGvk { + l, err := obj.client.Global().GetJobByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetJobs returns link which has given displayName +func (obj *GlobalProjectInventory) GetJobs(ctx context.Context, + displayName string) (result *GlobalJob, err error) { + l, ok := obj.Spec.JobsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ProjectInventory", "Jobs", displayName) + } + result, err = obj.client.Global().GetJobByName(ctx, l.Name) + return +} + +// LinkJobs links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalProjectInventory) LinkJobs(ctx context.Context, + linkToAdd *GlobalJob) error { + + payload := "{\"spec\": {\"jobsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"Job\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ProjectInventories().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ProjectInventory = result + return nil +} + +// UnlinkJobs unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalProjectInventory) UnlinkJobs(ctx context.Context, + linkToRemove *GlobalJob) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/jobsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ProjectInventories().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ProjectInventory = result + return nil + +} + +type projectinventoryGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *projectinventoryGlobalTsmV1Chainer) Subscribe() { + key := "projectinventories.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewProjectInventoryInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *projectinventoryGlobalTsmV1Chainer) Unsubscribe() { + key := "projectinventories.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *projectinventoryGlobalTsmV1Chainer) IsSubscribed() bool { + key := "projectinventories.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetProjectQueryByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetProjectQueryByName(ctx context.Context, hashedName string) (*GlobalProjectQuery, error) { + key := "projectqueries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ProjectQuery) + return &GlobalProjectQuery{ + client: group.client, + ProjectQuery: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ProjectQueries().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalProjectQuery{ + client: group.client, + ProjectQuery: result, + }, nil + } +} + +// DeleteProjectQueryByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteProjectQueryByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ProjectQueries().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ProjectQueries().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/queryGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["projects.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("projects.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Projects().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateProjectQueryByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateProjectQueryByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProjectQuery) (*GlobalProjectQuery, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ProjectQueries().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["projects.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("projects.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/queryGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ProjectQuery", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Projects().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalProjectQuery{ + client: group.client, + ProjectQuery: result, + }, nil +} + +// UpdateProjectQueryByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateProjectQueryByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ProjectQuery) (*GlobalProjectQuery, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ProjectQueries().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ProjectQueries().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalProjectQuery{ + client: group.client, + ProjectQuery: result, + }, nil +} + +// ListProjectQueries returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListProjectQueries(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalProjectQuery, err error) { + key := "projectqueries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalProjectQuery, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ProjectQuery) + result[k] = &GlobalProjectQuery{ + client: group.client, + ProjectQuery: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ProjectQueries().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalProjectQuery, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalProjectQuery{ + client: group.client, + ProjectQuery: &item, + } + } + } + return +} + +type GlobalProjectQuery struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ProjectQuery +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalProjectQuery) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteProjectQueryByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ProjectQuery = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalProjectQuery) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateProjectQueryByName(ctx, obj.ProjectQuery) + if err != nil { + return err + } + obj.ProjectQuery = result.ProjectQuery + return nil +} + +func (obj *GlobalProjectQuery) GetParent(ctx context.Context) (result *GlobalProject, err error) { + hashedName := helper.GetHashedName("projects.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["projects.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetProjectByName(ctx, hashedName) +} + +type projectqueryGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *projectqueryGlobalTsmV1Chainer) Subscribe() { + key := "projectqueries.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewProjectQueryInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *projectqueryGlobalTsmV1Chainer) Unsubscribe() { + key := "projectqueries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *projectqueryGlobalTsmV1Chainer) IsSubscribed() bool { + key := "projectqueries.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetProjectByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetProjectByName(ctx context.Context, hashedName string) (*GlobalProject, error) { + key := "projects.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Project) + return &GlobalProject{ + client: group.client, + Project: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Projects().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalProject{ + client: group.client, + Project: result, + }, nil + } +} + +// DeleteProjectByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteProjectByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Projects().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + if result.Spec.ConfigGvk != nil { + err := group.client. + Global(). + DeleteProjectConfigByName(ctx, result.Spec.ConfigGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.InventoryGvk != nil { + err := group.client. + Global(). + DeleteProjectInventoryByName(ctx, result.Spec.InventoryGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.QueryGvk != nil { + err := group.client. + Global(). + DeleteProjectQueryByName(ctx, result.Spec.QueryGvk.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + Projects().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/projectsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateProjectByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateProjectByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Project) (*GlobalProject, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ConfigGvk = nil + objToCreate.Spec.InventoryGvk = nil + objToCreate.Spec.QueryGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + Projects().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"projectsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"Project\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalProject{ + client: group.client, + Project: result, + }, nil +} + +// UpdateProjectByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateProjectByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Project) (*GlobalProject, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Projects().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Projects().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalProject{ + client: group.client, + Project: result, + }, nil +} + +// ListProjects returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListProjects(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalProject, err error) { + key := "projects.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalProject, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Project) + result[k] = &GlobalProject{ + client: group.client, + Project: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Projects().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalProject, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalProject{ + client: group.client, + Project: &item, + } + } + } + return +} + +type GlobalProject struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Project +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalProject) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteProjectByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Project = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalProject) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateProjectByName(ctx, obj.Project) + if err != nil { + return err + } + obj.Project = result.Project + return nil +} + +func (obj *GlobalProject) GetParent(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetConfigByName(ctx, hashedName) +} + +// GetConfig returns child of given type +func (obj *GlobalProject) GetConfig(ctx context.Context) ( + result *GlobalProjectConfig, err error) { + if obj.Spec.ConfigGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Project", "Config") + } + return obj.client.Global().GetProjectConfigByName(ctx, obj.Spec.ConfigGvk.Name) +} + +// AddConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalProject) AddConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProjectConfig) (result *GlobalProjectConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["projects.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["projects.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateProjectConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetProjectByName(ctx, obj.GetName()) + if getErr == nil { + obj.Project = updatedObj.Project + } + return +} + +// DeleteConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalProject) DeleteConfig(ctx context.Context) (err error) { + if obj.Spec.ConfigGvk != nil { + err = obj.client. + Global().DeleteProjectConfigByName(ctx, obj.Spec.ConfigGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetProjectByName(ctx, obj.GetName()) + if err == nil { + obj.Project = updatedObj.Project + } + return +} + +// GetInventory returns child of given type +func (obj *GlobalProject) GetInventory(ctx context.Context) ( + result *GlobalProjectInventory, err error) { + if obj.Spec.InventoryGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Project", "Inventory") + } + return obj.client.Global().GetProjectInventoryByName(ctx, obj.Spec.InventoryGvk.Name) +} + +// AddInventory calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalProject) AddInventory(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProjectInventory) (result *GlobalProjectInventory, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["projects.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["projects.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateProjectInventoryByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetProjectByName(ctx, obj.GetName()) + if getErr == nil { + obj.Project = updatedObj.Project + } + return +} + +// DeleteInventory calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalProject) DeleteInventory(ctx context.Context) (err error) { + if obj.Spec.InventoryGvk != nil { + err = obj.client. + Global().DeleteProjectInventoryByName(ctx, obj.Spec.InventoryGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetProjectByName(ctx, obj.GetName()) + if err == nil { + obj.Project = updatedObj.Project + } + return +} + +// GetQuery returns child of given type +func (obj *GlobalProject) GetQuery(ctx context.Context) ( + result *GlobalProjectQuery, err error) { + if obj.Spec.QueryGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Project", "Query") + } + return obj.client.Global().GetProjectQueryByName(ctx, obj.Spec.QueryGvk.Name) +} + +// AddQuery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalProject) AddQuery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProjectQuery) (result *GlobalProjectQuery, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["projects.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["projects.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateProjectQueryByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetProjectByName(ctx, obj.GetName()) + if getErr == nil { + obj.Project = updatedObj.Project + } + return +} + +// DeleteQuery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalProject) DeleteQuery(ctx context.Context) (err error) { + if obj.Spec.QueryGvk != nil { + err = obj.client. + Global().DeleteProjectQueryByName(ctx, obj.Spec.QueryGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetProjectByName(ctx, obj.GetName()) + if err == nil { + obj.Project = updatedObj.Project + } + return +} + +type projectGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *projectGlobalTsmV1Chainer) Subscribe() { + key := "projects.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewProjectInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *projectGlobalTsmV1Chainer) Unsubscribe() { + key := "projects.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *projectGlobalTsmV1Chainer) IsSubscribed() bool { + key := "projects.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *projectGlobalTsmV1Chainer) Config(name string) *projectconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["projectconfigs.global.tsm.tanzu.vmware.com"] = name + return &projectconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetConfig calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *projectGlobalTsmV1Chainer) GetConfig(ctx context.Context, displayName string) (result *GlobalProjectConfig, err error) { + hashedName := helper.GetHashedName("projectconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetProjectConfigByName(ctx, hashedName) +} + +// AddConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *projectGlobalTsmV1Chainer) AddConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProjectConfig) (result *GlobalProjectConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("projectconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateProjectConfigByName(ctx, objToCreate) +} + +// DeleteConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *projectGlobalTsmV1Chainer) DeleteConfig(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("projectconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteProjectConfigByName(ctx, hashedName) +} + +func (c *projectGlobalTsmV1Chainer) Inventory(name string) *projectinventoryGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["projectinventories.global.tsm.tanzu.vmware.com"] = name + return &projectinventoryGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetInventory calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *projectGlobalTsmV1Chainer) GetInventory(ctx context.Context, displayName string) (result *GlobalProjectInventory, err error) { + hashedName := helper.GetHashedName("projectinventories.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetProjectInventoryByName(ctx, hashedName) +} + +// AddInventory calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *projectGlobalTsmV1Chainer) AddInventory(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProjectInventory) (result *GlobalProjectInventory, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("projectinventories.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateProjectInventoryByName(ctx, objToCreate) +} + +// DeleteInventory calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *projectGlobalTsmV1Chainer) DeleteInventory(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("projectinventories.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteProjectInventoryByName(ctx, hashedName) +} + +func (c *projectGlobalTsmV1Chainer) Query(name string) *projectqueryGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["projectqueries.global.tsm.tanzu.vmware.com"] = name + return &projectqueryGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetQuery calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *projectGlobalTsmV1Chainer) GetQuery(ctx context.Context, displayName string) (result *GlobalProjectQuery, err error) { + hashedName := helper.GetHashedName("projectqueries.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetProjectQueryByName(ctx, hashedName) +} + +// AddQuery calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *projectGlobalTsmV1Chainer) AddQuery(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProjectQuery) (result *GlobalProjectQuery, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("projectqueries.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateProjectQueryByName(ctx, objToCreate) +} + +// DeleteQuery calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *projectGlobalTsmV1Chainer) DeleteQuery(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("projectqueries.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteProjectQueryByName(ctx, hashedName) +} + +// GetPublicServiceRTByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetPublicServiceRTByName(ctx context.Context, hashedName string) (*GlobalPublicServiceRT, error) { + key := "publicservicerts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.PublicServiceRT) + return &GlobalPublicServiceRT{ + client: group.client, + PublicServiceRT: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + PublicServiceRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalPublicServiceRT{ + client: group.client, + PublicServiceRT: result, + }, nil + } +} + +// DeletePublicServiceRTByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeletePublicServiceRTByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + PublicServiceRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + PublicServiceRTs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/publicServiceGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreatePublicServiceRTByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreatePublicServiceRTByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PublicServiceRT) (*GlobalPublicServiceRT, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + PublicServiceRTs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"publicServiceGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"PublicServiceRT\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalPublicServiceRT{ + client: group.client, + PublicServiceRT: result, + }, nil +} + +// UpdatePublicServiceRTByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdatePublicServiceRTByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.PublicServiceRT) (*GlobalPublicServiceRT, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + PublicServiceRTs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueOwnedBy := + objToUpdate.Spec.OwnedBy + patchOpOwnedBy := PatchOp{ + Op: "replace", + Path: "/spec/ownedBy", + Value: patchValueOwnedBy, + } + patch = append(patch, patchOpOwnedBy) + + if objToUpdate.Spec.FqdnList != nil { + patchValueFqdnList := + objToUpdate.Spec.FqdnList + patchOpFqdnList := PatchOp{ + Op: "replace", + Path: "/spec/fqdnList", + Value: patchValueFqdnList, + } + patch = append(patch, patchOpFqdnList) + } + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + PublicServiceRTs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalPublicServiceRT{ + client: group.client, + PublicServiceRT: result, + }, nil +} + +// ListPublicServiceRTs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListPublicServiceRTs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalPublicServiceRT, err error) { + key := "publicservicerts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalPublicServiceRT, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.PublicServiceRT) + result[k] = &GlobalPublicServiceRT{ + client: group.client, + PublicServiceRT: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + PublicServiceRTs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalPublicServiceRT, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalPublicServiceRT{ + client: group.client, + PublicServiceRT: &item, + } + } + } + return +} + +type GlobalPublicServiceRT struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.PublicServiceRT +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalPublicServiceRT) Delete(ctx context.Context) error { + err := obj.client.Global().DeletePublicServiceRTByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.PublicServiceRT = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalPublicServiceRT) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdatePublicServiceRTByName(ctx, obj.PublicServiceRT) + if err != nil { + return err + } + obj.PublicServiceRT = result.PublicServiceRT + return nil +} + +func (obj *GlobalPublicServiceRT) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type publicservicertGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *publicservicertGlobalTsmV1Chainer) Subscribe() { + key := "publicservicerts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewPublicServiceRTInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *publicservicertGlobalTsmV1Chainer) Unsubscribe() { + key := "publicservicerts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *publicservicertGlobalTsmV1Chainer) IsSubscribed() bool { + key := "publicservicerts.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetRemoteGatewayServiceConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetRemoteGatewayServiceConfigByName(ctx context.Context, hashedName string) (*GlobalRemoteGatewayServiceConfig, error) { + key := "remotegatewayserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig) + return &GlobalRemoteGatewayServiceConfig{ + client: group.client, + RemoteGatewayServiceConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + RemoteGatewayServiceConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalRemoteGatewayServiceConfig{ + client: group.client, + RemoteGatewayServiceConfig: result, + }, nil + } +} + +// DeleteRemoteGatewayServiceConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteRemoteGatewayServiceConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + RemoteGatewayServiceConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + RemoteGatewayServiceConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/remoteGatewayServiceConfigsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["clusterfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterfolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateRemoteGatewayServiceConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateRemoteGatewayServiceConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig) (*GlobalRemoteGatewayServiceConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + RemoteGatewayServiceConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["clusterfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterfolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"remoteGatewayServiceConfigsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"RemoteGatewayServiceConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalRemoteGatewayServiceConfig{ + client: group.client, + RemoteGatewayServiceConfig: result, + }, nil +} + +// UpdateRemoteGatewayServiceConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateRemoteGatewayServiceConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig) (*GlobalRemoteGatewayServiceConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + RemoteGatewayServiceConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueOwnedBy := + objToUpdate.Spec.OwnedBy + patchOpOwnedBy := PatchOp{ + Op: "replace", + Path: "/spec/ownedBy", + Value: patchValueOwnedBy, + } + patch = append(patch, patchOpOwnedBy) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueNodeIPs := + objToUpdate.Spec.NodeIPs + patchOpNodeIPs := PatchOp{ + Op: "replace", + Path: "/spec/nodeIPs", + Value: patchValueNodeIPs, + } + patch = append(patch, patchOpNodeIPs) + + patchValuePorts := + objToUpdate.Spec.Ports + patchOpPorts := PatchOp{ + Op: "replace", + Path: "/spec/ports", + Value: patchValuePorts, + } + patch = append(patch, patchOpPorts) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + RemoteGatewayServiceConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalRemoteGatewayServiceConfig{ + client: group.client, + RemoteGatewayServiceConfig: result, + }, nil +} + +// ListRemoteGatewayServiceConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListRemoteGatewayServiceConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalRemoteGatewayServiceConfig, err error) { + key := "remotegatewayserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalRemoteGatewayServiceConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig) + result[k] = &GlobalRemoteGatewayServiceConfig{ + client: group.client, + RemoteGatewayServiceConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + RemoteGatewayServiceConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalRemoteGatewayServiceConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalRemoteGatewayServiceConfig{ + client: group.client, + RemoteGatewayServiceConfig: &item, + } + } + } + return +} + +type GlobalRemoteGatewayServiceConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.RemoteGatewayServiceConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalRemoteGatewayServiceConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteRemoteGatewayServiceConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.RemoteGatewayServiceConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalRemoteGatewayServiceConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateRemoteGatewayServiceConfigByName(ctx, obj.RemoteGatewayServiceConfig) + if err != nil { + return err + } + obj.RemoteGatewayServiceConfig = result.RemoteGatewayServiceConfig + return nil +} + +func (obj *GlobalRemoteGatewayServiceConfig) GetParent(ctx context.Context) (result *GlobalClusterFolder, err error) { + hashedName := helper.GetHashedName("clusterfolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["clusterfolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetClusterFolderByName(ctx, hashedName) +} + +type remotegatewayserviceconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *remotegatewayserviceconfigGlobalTsmV1Chainer) Subscribe() { + key := "remotegatewayserviceconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewRemoteGatewayServiceConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *remotegatewayserviceconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "remotegatewayserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *remotegatewayserviceconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "remotegatewayserviceconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetResourceGroupRTByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetResourceGroupRTByName(ctx context.Context, hashedName string) (*GlobalResourceGroupRT, error) { + key := "resourcegrouprts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ResourceGroupRT) + return &GlobalResourceGroupRT{ + client: group.client, + ResourceGroupRT: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ResourceGroupRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalResourceGroupRT{ + client: group.client, + ResourceGroupRT: result, + }, nil + } +} + +// DeleteResourceGroupRTByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteResourceGroupRTByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ResourceGroupRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.SvcGroupRTGvk { + err := group.client. + Global().DeleteSvcGroupRTByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ResourceGroupRTs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/resourceGroupGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["clusterconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateResourceGroupRTByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateResourceGroupRTByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ResourceGroupRT) (*GlobalResourceGroupRT, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.SvcGroupRTGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ResourceGroupRTs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["clusterconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/resourceGroupGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ResourceGroupRT", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalResourceGroupRT{ + client: group.client, + ResourceGroupRT: result, + }, nil +} + +// UpdateResourceGroupRTByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateResourceGroupRTByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ResourceGroupRT) (*GlobalResourceGroupRT, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ResourceGroupRTs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ResourceGroupRTs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalResourceGroupRT{ + client: group.client, + ResourceGroupRT: result, + }, nil +} + +// ListResourceGroupRTs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListResourceGroupRTs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalResourceGroupRT, err error) { + key := "resourcegrouprts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalResourceGroupRT, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ResourceGroupRT) + result[k] = &GlobalResourceGroupRT{ + client: group.client, + ResourceGroupRT: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ResourceGroupRTs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalResourceGroupRT, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalResourceGroupRT{ + client: group.client, + ResourceGroupRT: &item, + } + } + } + return +} + +type GlobalResourceGroupRT struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ResourceGroupRT +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalResourceGroupRT) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteResourceGroupRTByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ResourceGroupRT = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalResourceGroupRT) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateResourceGroupRTByName(ctx, obj.ResourceGroupRT) + if err != nil { + return err + } + obj.ResourceGroupRT = result.ResourceGroupRT + return nil +} + +func (obj *GlobalResourceGroupRT) GetParent(ctx context.Context) (result *GlobalClusterConfig, err error) { + hashedName := helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["clusterconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetClusterConfigByName(ctx, hashedName) +} + +// GetAllSvcGroupRT returns all children of given type +func (obj *GlobalResourceGroupRT) GetAllSvcGroupRT(ctx context.Context) ( + result []*GlobalSvcGroupRT, err error) { + result = make([]*GlobalSvcGroupRT, 0, len(obj.Spec.SvcGroupRTGvk)) + for _, v := range obj.Spec.SvcGroupRTGvk { + l, err := obj.client.Global().GetSvcGroupRTByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetSvcGroupRT returns child which has given displayName +func (obj *GlobalResourceGroupRT) GetSvcGroupRT(ctx context.Context, + displayName string) (result *GlobalSvcGroupRT, err error) { + l, ok := obj.Spec.SvcGroupRTGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ResourceGroupRT", "SvcGroupRT", displayName) + } + result, err = obj.client.Global().GetSvcGroupRTByName(ctx, l.Name) + return +} + +// AddSvcGroupRT calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalResourceGroupRT) AddSvcGroupRT(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SvcGroupRT) (result *GlobalSvcGroupRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["resourcegrouprts.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["resourcegrouprts.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateSvcGroupRTByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetResourceGroupRTByName(ctx, obj.GetName()) + if getErr == nil { + obj.ResourceGroupRT = updatedObj.ResourceGroupRT + } + return +} + +// DeleteSvcGroupRT calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalResourceGroupRT) DeleteSvcGroupRT(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.SvcGroupRTGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ResourceGroupRT", "SvcGroupRT", displayName) + } + err = obj.client.Global().DeleteSvcGroupRTByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetResourceGroupRTByName(ctx, obj.GetName()) + if err == nil { + obj.ResourceGroupRT = updatedObj.ResourceGroupRT + } + return +} + +type resourcegrouprtGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *resourcegrouprtGlobalTsmV1Chainer) Subscribe() { + key := "resourcegrouprts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewResourceGroupRTInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *resourcegrouprtGlobalTsmV1Chainer) Unsubscribe() { + key := "resourcegrouprts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *resourcegrouprtGlobalTsmV1Chainer) IsSubscribed() bool { + key := "resourcegrouprts.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *resourcegrouprtGlobalTsmV1Chainer) SvcGroupRT(name string) *svcgrouprtGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["svcgrouprts.global.tsm.tanzu.vmware.com"] = name + return &svcgrouprtGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetSvcGroupRT calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *resourcegrouprtGlobalTsmV1Chainer) GetSvcGroupRT(ctx context.Context, displayName string) (result *GlobalSvcGroupRT, err error) { + hashedName := helper.GetHashedName("svcgrouprts.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetSvcGroupRTByName(ctx, hashedName) +} + +// AddSvcGroupRT calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *resourcegrouprtGlobalTsmV1Chainer) AddSvcGroupRT(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SvcGroupRT) (result *GlobalSvcGroupRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("svcgrouprts.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateSvcGroupRTByName(ctx, objToCreate) +} + +// DeleteSvcGroupRT calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *resourcegrouprtGlobalTsmV1Chainer) DeleteSvcGroupRT(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("svcgrouprts.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteSvcGroupRTByName(ctx, hashedName) +} + +// GetResourceGroupByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetResourceGroupByName(ctx context.Context, hashedName string) (*GlobalResourceGroup, error) { + key := "resourcegroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ResourceGroup) + return &GlobalResourceGroup{ + client: group.client, + ResourceGroup: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ResourceGroups().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalResourceGroup{ + client: group.client, + ResourceGroup: result, + }, nil + } +} + +// DeleteResourceGroupByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteResourceGroupByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ResourceGroups().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.AppGroupsGvk { + err := group.client. + Global().DeleteAppGroupByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.SvcGroupsGvk { + err := group.client. + Global().DeleteSvcGroupByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.NodeGroupsGvk { + err := group.client. + Global().DeleteNodeGroupByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.DataGroupsGvk { + err := group.client. + Global().DeleteDataGroupByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.UserGroupsGvk { + err := group.client. + Global().DeleteUserGroupByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ResourceGroups().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/resourceGroupsGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateResourceGroupByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateResourceGroupByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ResourceGroup) (*GlobalResourceGroup, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.AppGroupsGvk = nil + objToCreate.Spec.SvcGroupsGvk = nil + objToCreate.Spec.NodeGroupsGvk = nil + objToCreate.Spec.DataGroupsGvk = nil + objToCreate.Spec.UserGroupsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ResourceGroups().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/resourceGroupsGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ResourceGroup", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalResourceGroup{ + client: group.client, + ResourceGroup: result, + }, nil +} + +// UpdateResourceGroupByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateResourceGroupByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ResourceGroup) (*GlobalResourceGroup, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ResourceGroups().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ResourceGroups().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalResourceGroup{ + client: group.client, + ResourceGroup: result, + }, nil +} + +// ListResourceGroups returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListResourceGroups(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalResourceGroup, err error) { + key := "resourcegroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalResourceGroup, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ResourceGroup) + result[k] = &GlobalResourceGroup{ + client: group.client, + ResourceGroup: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ResourceGroups().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalResourceGroup, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalResourceGroup{ + client: group.client, + ResourceGroup: &item, + } + } + } + return +} + +type GlobalResourceGroup struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ResourceGroup +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalResourceGroup) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteResourceGroupByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ResourceGroup = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalResourceGroup) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateResourceGroupByName(ctx, obj.ResourceGroup) + if err != nil { + return err + } + obj.ResourceGroup = result.ResourceGroup + return nil +} + +func (obj *GlobalResourceGroup) GetParent(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetConfigByName(ctx, hashedName) +} + +// GetAllAppGroups returns all children of given type +func (obj *GlobalResourceGroup) GetAllAppGroups(ctx context.Context) ( + result []*GlobalAppGroup, err error) { + result = make([]*GlobalAppGroup, 0, len(obj.Spec.AppGroupsGvk)) + for _, v := range obj.Spec.AppGroupsGvk { + l, err := obj.client.Global().GetAppGroupByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetAppGroups returns child which has given displayName +func (obj *GlobalResourceGroup) GetAppGroups(ctx context.Context, + displayName string) (result *GlobalAppGroup, err error) { + l, ok := obj.Spec.AppGroupsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ResourceGroup", "AppGroups", displayName) + } + result, err = obj.client.Global().GetAppGroupByName(ctx, l.Name) + return +} + +// AddAppGroups calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalResourceGroup) AddAppGroups(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppGroup) (result *GlobalAppGroup, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["resourcegroups.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["resourcegroups.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAppGroupByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetResourceGroupByName(ctx, obj.GetName()) + if getErr == nil { + obj.ResourceGroup = updatedObj.ResourceGroup + } + return +} + +// DeleteAppGroups calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalResourceGroup) DeleteAppGroups(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.AppGroupsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ResourceGroup", "AppGroups", displayName) + } + err = obj.client.Global().DeleteAppGroupByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetResourceGroupByName(ctx, obj.GetName()) + if err == nil { + obj.ResourceGroup = updatedObj.ResourceGroup + } + return +} + +// GetAllSvcGroups returns all children of given type +func (obj *GlobalResourceGroup) GetAllSvcGroups(ctx context.Context) ( + result []*GlobalSvcGroup, err error) { + result = make([]*GlobalSvcGroup, 0, len(obj.Spec.SvcGroupsGvk)) + for _, v := range obj.Spec.SvcGroupsGvk { + l, err := obj.client.Global().GetSvcGroupByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetSvcGroups returns child which has given displayName +func (obj *GlobalResourceGroup) GetSvcGroups(ctx context.Context, + displayName string) (result *GlobalSvcGroup, err error) { + l, ok := obj.Spec.SvcGroupsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ResourceGroup", "SvcGroups", displayName) + } + result, err = obj.client.Global().GetSvcGroupByName(ctx, l.Name) + return +} + +// AddSvcGroups calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalResourceGroup) AddSvcGroups(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SvcGroup) (result *GlobalSvcGroup, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["resourcegroups.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["resourcegroups.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateSvcGroupByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetResourceGroupByName(ctx, obj.GetName()) + if getErr == nil { + obj.ResourceGroup = updatedObj.ResourceGroup + } + return +} + +// DeleteSvcGroups calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalResourceGroup) DeleteSvcGroups(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.SvcGroupsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ResourceGroup", "SvcGroups", displayName) + } + err = obj.client.Global().DeleteSvcGroupByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetResourceGroupByName(ctx, obj.GetName()) + if err == nil { + obj.ResourceGroup = updatedObj.ResourceGroup + } + return +} + +// GetAllNodeGroups returns all children of given type +func (obj *GlobalResourceGroup) GetAllNodeGroups(ctx context.Context) ( + result []*GlobalNodeGroup, err error) { + result = make([]*GlobalNodeGroup, 0, len(obj.Spec.NodeGroupsGvk)) + for _, v := range obj.Spec.NodeGroupsGvk { + l, err := obj.client.Global().GetNodeGroupByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetNodeGroups returns child which has given displayName +func (obj *GlobalResourceGroup) GetNodeGroups(ctx context.Context, + displayName string) (result *GlobalNodeGroup, err error) { + l, ok := obj.Spec.NodeGroupsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ResourceGroup", "NodeGroups", displayName) + } + result, err = obj.client.Global().GetNodeGroupByName(ctx, l.Name) + return +} + +// AddNodeGroups calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalResourceGroup) AddNodeGroups(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeGroup) (result *GlobalNodeGroup, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["resourcegroups.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["resourcegroups.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateNodeGroupByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetResourceGroupByName(ctx, obj.GetName()) + if getErr == nil { + obj.ResourceGroup = updatedObj.ResourceGroup + } + return +} + +// DeleteNodeGroups calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalResourceGroup) DeleteNodeGroups(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.NodeGroupsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ResourceGroup", "NodeGroups", displayName) + } + err = obj.client.Global().DeleteNodeGroupByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetResourceGroupByName(ctx, obj.GetName()) + if err == nil { + obj.ResourceGroup = updatedObj.ResourceGroup + } + return +} + +// GetAllDataGroups returns all children of given type +func (obj *GlobalResourceGroup) GetAllDataGroups(ctx context.Context) ( + result []*GlobalDataGroup, err error) { + result = make([]*GlobalDataGroup, 0, len(obj.Spec.DataGroupsGvk)) + for _, v := range obj.Spec.DataGroupsGvk { + l, err := obj.client.Global().GetDataGroupByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetDataGroups returns child which has given displayName +func (obj *GlobalResourceGroup) GetDataGroups(ctx context.Context, + displayName string) (result *GlobalDataGroup, err error) { + l, ok := obj.Spec.DataGroupsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ResourceGroup", "DataGroups", displayName) + } + result, err = obj.client.Global().GetDataGroupByName(ctx, l.Name) + return +} + +// AddDataGroups calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalResourceGroup) AddDataGroups(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataGroup) (result *GlobalDataGroup, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["resourcegroups.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["resourcegroups.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDataGroupByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetResourceGroupByName(ctx, obj.GetName()) + if getErr == nil { + obj.ResourceGroup = updatedObj.ResourceGroup + } + return +} + +// DeleteDataGroups calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalResourceGroup) DeleteDataGroups(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.DataGroupsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ResourceGroup", "DataGroups", displayName) + } + err = obj.client.Global().DeleteDataGroupByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetResourceGroupByName(ctx, obj.GetName()) + if err == nil { + obj.ResourceGroup = updatedObj.ResourceGroup + } + return +} + +// GetAllUserGroups returns all children of given type +func (obj *GlobalResourceGroup) GetAllUserGroups(ctx context.Context) ( + result []*GlobalUserGroup, err error) { + result = make([]*GlobalUserGroup, 0, len(obj.Spec.UserGroupsGvk)) + for _, v := range obj.Spec.UserGroupsGvk { + l, err := obj.client.Global().GetUserGroupByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetUserGroups returns child which has given displayName +func (obj *GlobalResourceGroup) GetUserGroups(ctx context.Context, + displayName string) (result *GlobalUserGroup, err error) { + l, ok := obj.Spec.UserGroupsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ResourceGroup", "UserGroups", displayName) + } + result, err = obj.client.Global().GetUserGroupByName(ctx, l.Name) + return +} + +// AddUserGroups calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalResourceGroup) AddUserGroups(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.UserGroup) (result *GlobalUserGroup, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["resourcegroups.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["resourcegroups.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateUserGroupByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetResourceGroupByName(ctx, obj.GetName()) + if getErr == nil { + obj.ResourceGroup = updatedObj.ResourceGroup + } + return +} + +// DeleteUserGroups calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalResourceGroup) DeleteUserGroups(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.UserGroupsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ResourceGroup", "UserGroups", displayName) + } + err = obj.client.Global().DeleteUserGroupByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetResourceGroupByName(ctx, obj.GetName()) + if err == nil { + obj.ResourceGroup = updatedObj.ResourceGroup + } + return +} + +type resourcegroupGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *resourcegroupGlobalTsmV1Chainer) Subscribe() { + key := "resourcegroups.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewResourceGroupInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *resourcegroupGlobalTsmV1Chainer) Unsubscribe() { + key := "resourcegroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *resourcegroupGlobalTsmV1Chainer) IsSubscribed() bool { + key := "resourcegroups.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *resourcegroupGlobalTsmV1Chainer) AppGroups(name string) *appgroupGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["appgroups.global.tsm.tanzu.vmware.com"] = name + return &appgroupGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetAppGroups calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *resourcegroupGlobalTsmV1Chainer) GetAppGroups(ctx context.Context, displayName string) (result *GlobalAppGroup, err error) { + hashedName := helper.GetHashedName("appgroups.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAppGroupByName(ctx, hashedName) +} + +// AddAppGroups calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *resourcegroupGlobalTsmV1Chainer) AddAppGroups(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppGroup) (result *GlobalAppGroup, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("appgroups.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAppGroupByName(ctx, objToCreate) +} + +// DeleteAppGroups calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *resourcegroupGlobalTsmV1Chainer) DeleteAppGroups(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("appgroups.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAppGroupByName(ctx, hashedName) +} + +func (c *resourcegroupGlobalTsmV1Chainer) SvcGroups(name string) *svcgroupGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["svcgroups.global.tsm.tanzu.vmware.com"] = name + return &svcgroupGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetSvcGroups calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *resourcegroupGlobalTsmV1Chainer) GetSvcGroups(ctx context.Context, displayName string) (result *GlobalSvcGroup, err error) { + hashedName := helper.GetHashedName("svcgroups.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetSvcGroupByName(ctx, hashedName) +} + +// AddSvcGroups calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *resourcegroupGlobalTsmV1Chainer) AddSvcGroups(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SvcGroup) (result *GlobalSvcGroup, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("svcgroups.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateSvcGroupByName(ctx, objToCreate) +} + +// DeleteSvcGroups calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *resourcegroupGlobalTsmV1Chainer) DeleteSvcGroups(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("svcgroups.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteSvcGroupByName(ctx, hashedName) +} + +func (c *resourcegroupGlobalTsmV1Chainer) NodeGroups(name string) *nodegroupGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["nodegroups.global.tsm.tanzu.vmware.com"] = name + return &nodegroupGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetNodeGroups calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *resourcegroupGlobalTsmV1Chainer) GetNodeGroups(ctx context.Context, displayName string) (result *GlobalNodeGroup, err error) { + hashedName := helper.GetHashedName("nodegroups.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetNodeGroupByName(ctx, hashedName) +} + +// AddNodeGroups calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *resourcegroupGlobalTsmV1Chainer) AddNodeGroups(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeGroup) (result *GlobalNodeGroup, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("nodegroups.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateNodeGroupByName(ctx, objToCreate) +} + +// DeleteNodeGroups calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *resourcegroupGlobalTsmV1Chainer) DeleteNodeGroups(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("nodegroups.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteNodeGroupByName(ctx, hashedName) +} + +func (c *resourcegroupGlobalTsmV1Chainer) DataGroups(name string) *datagroupGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["datagroups.global.tsm.tanzu.vmware.com"] = name + return &datagroupGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetDataGroups calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *resourcegroupGlobalTsmV1Chainer) GetDataGroups(ctx context.Context, displayName string) (result *GlobalDataGroup, err error) { + hashedName := helper.GetHashedName("datagroups.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetDataGroupByName(ctx, hashedName) +} + +// AddDataGroups calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *resourcegroupGlobalTsmV1Chainer) AddDataGroups(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataGroup) (result *GlobalDataGroup, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("datagroups.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDataGroupByName(ctx, objToCreate) +} + +// DeleteDataGroups calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *resourcegroupGlobalTsmV1Chainer) DeleteDataGroups(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("datagroups.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDataGroupByName(ctx, hashedName) +} + +func (c *resourcegroupGlobalTsmV1Chainer) UserGroups(name string) *usergroupGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["usergroups.global.tsm.tanzu.vmware.com"] = name + return &usergroupGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetUserGroups calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *resourcegroupGlobalTsmV1Chainer) GetUserGroups(ctx context.Context, displayName string) (result *GlobalUserGroup, err error) { + hashedName := helper.GetHashedName("usergroups.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetUserGroupByName(ctx, hashedName) +} + +// AddUserGroups calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *resourcegroupGlobalTsmV1Chainer) AddUserGroups(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.UserGroup) (result *GlobalUserGroup, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("usergroups.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateUserGroupByName(ctx, objToCreate) +} + +// DeleteUserGroups calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *resourcegroupGlobalTsmV1Chainer) DeleteUserGroups(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("usergroups.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteUserGroupByName(ctx, hashedName) +} + +// GetRootByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetRootByName(ctx context.Context, hashedName string) (*GlobalRoot, error) { + key := "roots.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Root) + return &GlobalRoot{ + client: group.client, + Root: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Roots().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalRoot{ + client: group.client, + Root: result, + }, nil + } +} + +// DeleteRootByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteRootByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Roots().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + if result.Spec.ConfigGvk != nil { + err := group.client. + Global(). + DeleteConfigByName(ctx, result.Spec.ConfigGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.InventoryGvk != nil { + err := group.client. + Global(). + DeleteInventoryByName(ctx, result.Spec.InventoryGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.RuntimeGvk != nil { + err := group.client. + Global(). + DeleteRuntimeByName(ctx, result.Spec.RuntimeGvk.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + Roots().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + return +} + +// CreateRootByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateRootByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Root) (*GlobalRoot, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] == "" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.Labels[common.DISPLAY_NAME_LABEL]) + } + + objToCreate.Spec.ConfigGvk = nil + objToCreate.Spec.InventoryGvk = nil + objToCreate.Spec.RuntimeGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + Roots().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + return &GlobalRoot{ + client: group.client, + Root: result, + }, nil +} + +// UpdateRootByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateRootByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Root) (*GlobalRoot, error) { + if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) + } + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Roots().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Roots().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalRoot{ + client: group.client, + Root: result, + }, nil +} + +// ListRoots returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListRoots(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalRoot, err error) { + key := "roots.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalRoot, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Root) + result[k] = &GlobalRoot{ + client: group.client, + Root: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Roots().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalRoot, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalRoot{ + client: group.client, + Root: &item, + } + } + } + return +} + +type GlobalRoot struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Root +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalRoot) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteRootByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Root = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalRoot) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateRootByName(ctx, obj.Root) + if err != nil { + return err + } + obj.Root = result.Root + return nil +} + +// GetGlobalRoot calculates the hashed name based on parents and +// returns given object +func (c *Clientset) GetGlobalRoot(ctx context.Context) (result *GlobalRoot, err error) { + hashedName := helper.GetHashedName("roots.global.tsm.tanzu.vmware.com", nil, helper.DEFAULT_KEY) + return c.Global().GetRootByName(ctx, hashedName) +} + +func (c *Clientset) GlobalRoot() *rootGlobalTsmV1Chainer { + parentLabels := make(map[string]string) + parentLabels["roots.global.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY + return &rootGlobalTsmV1Chainer{ + client: c, + name: helper.DEFAULT_KEY, + parentLabels: parentLabels, + } +} + +// AddGlobalRoot calculates hashed name of the object based on +// parents names and creates it. objToCreate.Name is changed to the hashed name. Original name (helper.DEFAULT_KEY) is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *Clientset) AddGlobalRoot(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Root) (result *GlobalRoot, err error) { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), nil, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.Global().CreateRootByName(ctx, objToCreate) +} + +// DeleteGlobalRoot calculates hashedName of object based on +// parents and deletes given object +func (c *Clientset) DeleteGlobalRoot(ctx context.Context) (err error) { + hashedName := helper.GetHashedName("roots.global.tsm.tanzu.vmware.com", nil, helper.DEFAULT_KEY) + return c.Global().DeleteRootByName(ctx, hashedName) +} + +// GetConfig returns child of given type +func (obj *GlobalRoot) GetConfig(ctx context.Context) ( + result *GlobalConfig, err error) { + if obj.Spec.ConfigGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Root", "Config") + } + return obj.client.Global().GetConfigByName(ctx, obj.Spec.ConfigGvk.Name) +} + +// AddConfig calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalRoot) AddConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Config) (result *GlobalConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["roots.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["roots.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetRootByName(ctx, obj.GetName()) + if getErr == nil { + obj.Root = updatedObj.Root + } + return +} + +// DeleteConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalRoot) DeleteConfig(ctx context.Context) (err error) { + if obj.Spec.ConfigGvk != nil { + err = obj.client. + Global().DeleteConfigByName(ctx, obj.Spec.ConfigGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetRootByName(ctx, obj.GetName()) + if err == nil { + obj.Root = updatedObj.Root + } + return +} + +// GetInventory returns child of given type +func (obj *GlobalRoot) GetInventory(ctx context.Context) ( + result *GlobalInventory, err error) { + if obj.Spec.InventoryGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Root", "Inventory") + } + return obj.client.Global().GetInventoryByName(ctx, obj.Spec.InventoryGvk.Name) +} + +// AddInventory calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalRoot) AddInventory(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Inventory) (result *GlobalInventory, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["roots.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["roots.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateInventoryByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetRootByName(ctx, obj.GetName()) + if getErr == nil { + obj.Root = updatedObj.Root + } + return +} + +// DeleteInventory calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalRoot) DeleteInventory(ctx context.Context) (err error) { + if obj.Spec.InventoryGvk != nil { + err = obj.client. + Global().DeleteInventoryByName(ctx, obj.Spec.InventoryGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetRootByName(ctx, obj.GetName()) + if err == nil { + obj.Root = updatedObj.Root + } + return +} + +// GetRuntime returns child of given type +func (obj *GlobalRoot) GetRuntime(ctx context.Context) ( + result *GlobalRuntime, err error) { + if obj.Spec.RuntimeGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Root", "Runtime") + } + return obj.client.Global().GetRuntimeByName(ctx, obj.Spec.RuntimeGvk.Name) +} + +// AddRuntime calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalRoot) AddRuntime(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Runtime) (result *GlobalRuntime, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["roots.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["roots.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateRuntimeByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetRootByName(ctx, obj.GetName()) + if getErr == nil { + obj.Root = updatedObj.Root + } + return +} + +// DeleteRuntime calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalRoot) DeleteRuntime(ctx context.Context) (err error) { + if obj.Spec.RuntimeGvk != nil { + err = obj.client. + Global().DeleteRuntimeByName(ctx, obj.Spec.RuntimeGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetRootByName(ctx, obj.GetName()) + if err == nil { + obj.Root = updatedObj.Root + } + return +} + +type rootGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *rootGlobalTsmV1Chainer) Subscribe() { + key := "roots.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewRootInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *rootGlobalTsmV1Chainer) Unsubscribe() { + key := "roots.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *rootGlobalTsmV1Chainer) IsSubscribed() bool { + key := "roots.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *rootGlobalTsmV1Chainer) Config() *configGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["configs.global.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY + return &configGlobalTsmV1Chainer{ + client: c.client, + name: helper.DEFAULT_KEY, + parentLabels: parentLabels, + } +} + +// GetConfig calculates hashed name of the object based on it's parents and returns the object +func (c *rootGlobalTsmV1Chainer) GetConfig(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", c.parentLabels, helper.DEFAULT_KEY) + return c.client.Global().GetConfigByName(ctx, hashedName) +} + +// AddConfig calculates hashed name of the child to create based on parents names and creates it. +// objToCreate.Name is changed to the hashed name. Original name ('default') is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *rootGlobalTsmV1Chainer) AddConfig(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Config) (result *GlobalConfig, err error) { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateConfigByName(ctx, objToCreate) +} + +// DeleteConfig calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *rootGlobalTsmV1Chainer) DeleteConfig(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteConfigByName(ctx, hashedName) +} + +func (c *rootGlobalTsmV1Chainer) Inventory() *inventoryGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["inventories.global.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY + return &inventoryGlobalTsmV1Chainer{ + client: c.client, + name: helper.DEFAULT_KEY, + parentLabels: parentLabels, + } +} + +// GetInventory calculates hashed name of the object based on it's parents and returns the object +func (c *rootGlobalTsmV1Chainer) GetInventory(ctx context.Context) (result *GlobalInventory, err error) { + hashedName := helper.GetHashedName("inventories.global.tsm.tanzu.vmware.com", c.parentLabels, helper.DEFAULT_KEY) + return c.client.Global().GetInventoryByName(ctx, hashedName) +} + +// AddInventory calculates hashed name of the child to create based on parents names and creates it. +// objToCreate.Name is changed to the hashed name. Original name ('default') is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *rootGlobalTsmV1Chainer) AddInventory(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Inventory) (result *GlobalInventory, err error) { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("inventories.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateInventoryByName(ctx, objToCreate) +} + +// DeleteInventory calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *rootGlobalTsmV1Chainer) DeleteInventory(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("inventories.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteInventoryByName(ctx, hashedName) +} + +func (c *rootGlobalTsmV1Chainer) Runtime() *runtimeGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["runtimes.global.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY + return &runtimeGlobalTsmV1Chainer{ + client: c.client, + name: helper.DEFAULT_KEY, + parentLabels: parentLabels, + } +} + +// GetRuntime calculates hashed name of the object based on it's parents and returns the object +func (c *rootGlobalTsmV1Chainer) GetRuntime(ctx context.Context) (result *GlobalRuntime, err error) { + hashedName := helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", c.parentLabels, helper.DEFAULT_KEY) + return c.client.Global().GetRuntimeByName(ctx, hashedName) +} + +// AddRuntime calculates hashed name of the child to create based on parents names and creates it. +// objToCreate.Name is changed to the hashed name. Original name ('default') is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *rootGlobalTsmV1Chainer) AddRuntime(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Runtime) (result *GlobalRuntime, err error) { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateRuntimeByName(ctx, objToCreate) +} + +// DeleteRuntime calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *rootGlobalTsmV1Chainer) DeleteRuntime(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteRuntimeByName(ctx, hashedName) +} + +// GetRPolicyByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetRPolicyByName(ctx context.Context, hashedName string) (*GlobalRPolicy, error) { + key := "rpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.RPolicy) + return &GlobalRPolicy{ + client: group.client, + RPolicy: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + RPolicies().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalRPolicy{ + client: group.client, + RPolicy: result, + }, nil + } +} + +// DeleteRPolicyByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteRPolicyByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + RPolicies().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + RPolicies().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/routingPoliciesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["globalnses.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("globalnses.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GlobalNses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateRPolicyByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateRPolicyByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.RPolicy) (*GlobalRPolicy, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + RPolicies().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["globalnses.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("globalnses.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"routingPoliciesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"RPolicy\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GlobalNses().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalRPolicy{ + client: group.client, + RPolicy: result, + }, nil +} + +// UpdateRPolicyByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateRPolicyByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.RPolicy) (*GlobalRPolicy, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + RPolicies().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueHealthCheckId := + objToUpdate.Spec.HealthCheckId + patchOpHealthCheckId := PatchOp{ + Op: "replace", + Path: "/spec/healthCheckId", + Value: patchValueHealthCheckId, + } + patch = append(patch, patchOpHealthCheckId) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + RPolicies().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalRPolicy{ + client: group.client, + RPolicy: result, + }, nil +} + +// ListRPolicies returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListRPolicies(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalRPolicy, err error) { + key := "rpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalRPolicy, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.RPolicy) + result[k] = &GlobalRPolicy{ + client: group.client, + RPolicy: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + RPolicies().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalRPolicy, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalRPolicy{ + client: group.client, + RPolicy: &item, + } + } + } + return +} + +type GlobalRPolicy struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.RPolicy +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalRPolicy) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteRPolicyByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.RPolicy = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalRPolicy) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateRPolicyByName(ctx, obj.RPolicy) + if err != nil { + return err + } + obj.RPolicy = result.RPolicy + return nil +} + +func (obj *GlobalRPolicy) GetParent(ctx context.Context) (result *GlobalGlobalNs, err error) { + hashedName := helper.GetHashedName("globalnses.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["globalnses.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGlobalNsByName(ctx, hashedName) +} + +type rpolicyGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *rpolicyGlobalTsmV1Chainer) Subscribe() { + key := "rpolicies.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewRPolicyInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *rpolicyGlobalTsmV1Chainer) Unsubscribe() { + key := "rpolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *rpolicyGlobalTsmV1Chainer) IsSubscribed() bool { + key := "rpolicies.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetRuntimeByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetRuntimeByName(ctx context.Context, hashedName string) (*GlobalRuntime, error) { + key := "runtimes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Runtime) + return &GlobalRuntime{ + client: group.client, + Runtime: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Runtimes().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalRuntime{ + client: group.client, + Runtime: result, + }, nil + } +} + +// DeleteRuntimeByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteRuntimeByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Runtimes().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + if result.Spec.AllsparkServicesGvk != nil { + err := group.client. + Global(). + DeleteAllSparkServicesByName(ctx, result.Spec.AllsparkServicesGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.UserFolderGvk != nil { + err := group.client. + Global(). + DeleteUserFolderByName(ctx, result.Spec.UserFolderGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.DataFolderGvk != nil { + err := group.client. + Global(). + DeleteDataFolderByName(ctx, result.Spec.DataFolderGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.AppFolderGvk != nil { + err := group.client. + Global(). + DeleteAppFolderByName(ctx, result.Spec.AppFolderGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.NodeFolderGvk != nil { + err := group.client. + Global(). + DeleteNodeFolderByName(ctx, result.Spec.NodeFolderGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.ClusterFolderGvk != nil { + err := group.client. + Global(). + DeleteClusterFolderByName(ctx, result.Spec.ClusterFolderGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.ProgressiveUpgradeGvk != nil { + err := group.client. + Global(). + DeleteProgressiveUpgradeFolderByName(ctx, result.Spec.ProgressiveUpgradeGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.JobConfigFolderGvk != nil { + err := group.client. + Global(). + DeleteJobConfigFolderByName(ctx, result.Spec.JobConfigFolderGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.ExternalDNSGvk != nil { + err := group.client. + Global(). + DeleteExternalDNSRuntimeByName(ctx, result.Spec.ExternalDNSGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.SloFolderGvk != nil { + err := group.client. + Global(). + DeleteSLOFolderByName(ctx, result.Spec.SloFolderGvk.Name) + if err != nil { + return err + } + } + + if result.Spec.ServiceDirectoryRTGvk != nil { + err := group.client. + Global(). + DeleteServiceDirectoryRTByName(ctx, result.Spec.ServiceDirectoryRTGvk.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/runtimeGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["roots.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("roots.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Roots().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateRuntimeByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateRuntimeByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Runtime) (*GlobalRuntime, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] == "" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.Labels[common.DISPLAY_NAME_LABEL]) + } + + objToCreate.Spec.AllsparkServicesGvk = nil + objToCreate.Spec.UserFolderGvk = nil + objToCreate.Spec.DataFolderGvk = nil + objToCreate.Spec.AppFolderGvk = nil + objToCreate.Spec.NodeFolderGvk = nil + objToCreate.Spec.ClusterFolderGvk = nil + objToCreate.Spec.ProgressiveUpgradeGvk = nil + objToCreate.Spec.JobConfigFolderGvk = nil + objToCreate.Spec.ExternalDNSGvk = nil + objToCreate.Spec.SloFolderGvk = nil + objToCreate.Spec.ServiceDirectoryRTGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + Runtimes().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["roots.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("roots.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/runtimeGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "Runtime", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Roots().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalRuntime{ + client: group.client, + Runtime: result, + }, nil +} + +// UpdateRuntimeByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateRuntimeByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Runtime) (*GlobalRuntime, error) { + if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) + } + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Runtimes().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalRuntime{ + client: group.client, + Runtime: result, + }, nil +} + +// ListRuntimes returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListRuntimes(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalRuntime, err error) { + key := "runtimes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalRuntime, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Runtime) + result[k] = &GlobalRuntime{ + client: group.client, + Runtime: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Runtimes().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalRuntime, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalRuntime{ + client: group.client, + Runtime: &item, + } + } + } + return +} + +type GlobalRuntime struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Runtime +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalRuntime) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteRuntimeByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Runtime = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalRuntime) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateRuntimeByName(ctx, obj.Runtime) + if err != nil { + return err + } + obj.Runtime = result.Runtime + return nil +} + +func (obj *GlobalRuntime) GetParent(ctx context.Context) (result *GlobalRoot, err error) { + hashedName := helper.GetHashedName("roots.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["roots.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetRootByName(ctx, hashedName) +} + +// GetAllsparkServices returns child of given type +func (obj *GlobalRuntime) GetAllsparkServices(ctx context.Context) ( + result *GlobalAllSparkServices, err error) { + if obj.Spec.AllsparkServicesGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Runtime", "AllsparkServices") + } + return obj.client.Global().GetAllSparkServicesByName(ctx, obj.Spec.AllsparkServicesGvk.Name) +} + +// AddAllsparkServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalRuntime) AddAllsparkServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AllSparkServices) (result *GlobalAllSparkServices, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["runtimes.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["runtimes.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAllSparkServicesByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetRuntimeByName(ctx, obj.GetName()) + if getErr == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// DeleteAllsparkServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalRuntime) DeleteAllsparkServices(ctx context.Context) (err error) { + if obj.Spec.AllsparkServicesGvk != nil { + err = obj.client. + Global().DeleteAllSparkServicesByName(ctx, obj.Spec.AllsparkServicesGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetRuntimeByName(ctx, obj.GetName()) + if err == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// GetUserFolder returns child of given type +func (obj *GlobalRuntime) GetUserFolder(ctx context.Context) ( + result *GlobalUserFolder, err error) { + if obj.Spec.UserFolderGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Runtime", "UserFolder") + } + return obj.client.Global().GetUserFolderByName(ctx, obj.Spec.UserFolderGvk.Name) +} + +// AddUserFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalRuntime) AddUserFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.UserFolder) (result *GlobalUserFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["runtimes.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["runtimes.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateUserFolderByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetRuntimeByName(ctx, obj.GetName()) + if getErr == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// DeleteUserFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalRuntime) DeleteUserFolder(ctx context.Context) (err error) { + if obj.Spec.UserFolderGvk != nil { + err = obj.client. + Global().DeleteUserFolderByName(ctx, obj.Spec.UserFolderGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetRuntimeByName(ctx, obj.GetName()) + if err == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// GetDataFolder returns child of given type +func (obj *GlobalRuntime) GetDataFolder(ctx context.Context) ( + result *GlobalDataFolder, err error) { + if obj.Spec.DataFolderGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Runtime", "DataFolder") + } + return obj.client.Global().GetDataFolderByName(ctx, obj.Spec.DataFolderGvk.Name) +} + +// AddDataFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalRuntime) AddDataFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataFolder) (result *GlobalDataFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["runtimes.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["runtimes.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateDataFolderByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetRuntimeByName(ctx, obj.GetName()) + if getErr == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// DeleteDataFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalRuntime) DeleteDataFolder(ctx context.Context) (err error) { + if obj.Spec.DataFolderGvk != nil { + err = obj.client. + Global().DeleteDataFolderByName(ctx, obj.Spec.DataFolderGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetRuntimeByName(ctx, obj.GetName()) + if err == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// GetAppFolder returns child of given type +func (obj *GlobalRuntime) GetAppFolder(ctx context.Context) ( + result *GlobalAppFolder, err error) { + if obj.Spec.AppFolderGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Runtime", "AppFolder") + } + return obj.client.Global().GetAppFolderByName(ctx, obj.Spec.AppFolderGvk.Name) +} + +// AddAppFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalRuntime) AddAppFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppFolder) (result *GlobalAppFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["runtimes.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["runtimes.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAppFolderByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetRuntimeByName(ctx, obj.GetName()) + if getErr == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// DeleteAppFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalRuntime) DeleteAppFolder(ctx context.Context) (err error) { + if obj.Spec.AppFolderGvk != nil { + err = obj.client. + Global().DeleteAppFolderByName(ctx, obj.Spec.AppFolderGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetRuntimeByName(ctx, obj.GetName()) + if err == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// GetNodeFolder returns child of given type +func (obj *GlobalRuntime) GetNodeFolder(ctx context.Context) ( + result *GlobalNodeFolder, err error) { + if obj.Spec.NodeFolderGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Runtime", "NodeFolder") + } + return obj.client.Global().GetNodeFolderByName(ctx, obj.Spec.NodeFolderGvk.Name) +} + +// AddNodeFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalRuntime) AddNodeFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeFolder) (result *GlobalNodeFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["runtimes.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["runtimes.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateNodeFolderByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetRuntimeByName(ctx, obj.GetName()) + if getErr == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// DeleteNodeFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalRuntime) DeleteNodeFolder(ctx context.Context) (err error) { + if obj.Spec.NodeFolderGvk != nil { + err = obj.client. + Global().DeleteNodeFolderByName(ctx, obj.Spec.NodeFolderGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetRuntimeByName(ctx, obj.GetName()) + if err == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// GetClusterFolder returns child of given type +func (obj *GlobalRuntime) GetClusterFolder(ctx context.Context) ( + result *GlobalClusterFolder, err error) { + if obj.Spec.ClusterFolderGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Runtime", "ClusterFolder") + } + return obj.client.Global().GetClusterFolderByName(ctx, obj.Spec.ClusterFolderGvk.Name) +} + +// AddClusterFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalRuntime) AddClusterFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ClusterFolder) (result *GlobalClusterFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["runtimes.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["runtimes.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateClusterFolderByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetRuntimeByName(ctx, obj.GetName()) + if getErr == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// DeleteClusterFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalRuntime) DeleteClusterFolder(ctx context.Context) (err error) { + if obj.Spec.ClusterFolderGvk != nil { + err = obj.client. + Global().DeleteClusterFolderByName(ctx, obj.Spec.ClusterFolderGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetRuntimeByName(ctx, obj.GetName()) + if err == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// GetProgressiveUpgrade returns child of given type +func (obj *GlobalRuntime) GetProgressiveUpgrade(ctx context.Context) ( + result *GlobalProgressiveUpgradeFolder, err error) { + if obj.Spec.ProgressiveUpgradeGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Runtime", "ProgressiveUpgrade") + } + return obj.client.Global().GetProgressiveUpgradeFolderByName(ctx, obj.Spec.ProgressiveUpgradeGvk.Name) +} + +// AddProgressiveUpgrade calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalRuntime) AddProgressiveUpgrade(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder) (result *GlobalProgressiveUpgradeFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["runtimes.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["runtimes.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateProgressiveUpgradeFolderByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetRuntimeByName(ctx, obj.GetName()) + if getErr == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// DeleteProgressiveUpgrade calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalRuntime) DeleteProgressiveUpgrade(ctx context.Context) (err error) { + if obj.Spec.ProgressiveUpgradeGvk != nil { + err = obj.client. + Global().DeleteProgressiveUpgradeFolderByName(ctx, obj.Spec.ProgressiveUpgradeGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetRuntimeByName(ctx, obj.GetName()) + if err == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// GetJobConfigFolder returns child of given type +func (obj *GlobalRuntime) GetJobConfigFolder(ctx context.Context) ( + result *GlobalJobConfigFolder, err error) { + if obj.Spec.JobConfigFolderGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Runtime", "JobConfigFolder") + } + return obj.client.Global().GetJobConfigFolderByName(ctx, obj.Spec.JobConfigFolderGvk.Name) +} + +// AddJobConfigFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalRuntime) AddJobConfigFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.JobConfigFolder) (result *GlobalJobConfigFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["runtimes.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["runtimes.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateJobConfigFolderByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetRuntimeByName(ctx, obj.GetName()) + if getErr == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// DeleteJobConfigFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalRuntime) DeleteJobConfigFolder(ctx context.Context) (err error) { + if obj.Spec.JobConfigFolderGvk != nil { + err = obj.client. + Global().DeleteJobConfigFolderByName(ctx, obj.Spec.JobConfigFolderGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetRuntimeByName(ctx, obj.GetName()) + if err == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// GetExternalDNS returns child of given type +func (obj *GlobalRuntime) GetExternalDNS(ctx context.Context) ( + result *GlobalExternalDNSRuntime, err error) { + if obj.Spec.ExternalDNSGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Runtime", "ExternalDNS") + } + return obj.client.Global().GetExternalDNSRuntimeByName(ctx, obj.Spec.ExternalDNSGvk.Name) +} + +// AddExternalDNS calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalRuntime) AddExternalDNS(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntime) (result *GlobalExternalDNSRuntime, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["runtimes.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["runtimes.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateExternalDNSRuntimeByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetRuntimeByName(ctx, obj.GetName()) + if getErr == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// DeleteExternalDNS calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalRuntime) DeleteExternalDNS(ctx context.Context) (err error) { + if obj.Spec.ExternalDNSGvk != nil { + err = obj.client. + Global().DeleteExternalDNSRuntimeByName(ctx, obj.Spec.ExternalDNSGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetRuntimeByName(ctx, obj.GetName()) + if err == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// GetSloFolder returns child of given type +func (obj *GlobalRuntime) GetSloFolder(ctx context.Context) ( + result *GlobalSLOFolder, err error) { + if obj.Spec.SloFolderGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Runtime", "SloFolder") + } + return obj.client.Global().GetSLOFolderByName(ctx, obj.Spec.SloFolderGvk.Name) +} + +// AddSloFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalRuntime) AddSloFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SLOFolder) (result *GlobalSLOFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["runtimes.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["runtimes.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateSLOFolderByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetRuntimeByName(ctx, obj.GetName()) + if getErr == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// DeleteSloFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalRuntime) DeleteSloFolder(ctx context.Context) (err error) { + if obj.Spec.SloFolderGvk != nil { + err = obj.client. + Global().DeleteSLOFolderByName(ctx, obj.Spec.SloFolderGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetRuntimeByName(ctx, obj.GetName()) + if err == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// GetServiceDirectoryRT returns child of given type +func (obj *GlobalRuntime) GetServiceDirectoryRT(ctx context.Context) ( + result *GlobalServiceDirectoryRT, err error) { + if obj.Spec.ServiceDirectoryRTGvk == nil { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Runtime", "ServiceDirectoryRT") + } + return obj.client.Global().GetServiceDirectoryRTByName(ctx, obj.Spec.ServiceDirectoryRTGvk.Name) +} + +// AddServiceDirectoryRT calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalRuntime) AddServiceDirectoryRT(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRT) (result *GlobalServiceDirectoryRT, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["runtimes.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["runtimes.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceDirectoryRTByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetRuntimeByName(ctx, obj.GetName()) + if getErr == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +// DeleteServiceDirectoryRT calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalRuntime) DeleteServiceDirectoryRT(ctx context.Context) (err error) { + if obj.Spec.ServiceDirectoryRTGvk != nil { + err = obj.client. + Global().DeleteServiceDirectoryRTByName(ctx, obj.Spec.ServiceDirectoryRTGvk.Name) + if err != nil { + return err + } + } + updatedObj, err := obj.client. + Global().GetRuntimeByName(ctx, obj.GetName()) + if err == nil { + obj.Runtime = updatedObj.Runtime + } + return +} + +type runtimeGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *runtimeGlobalTsmV1Chainer) Subscribe() { + key := "runtimes.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewRuntimeInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *runtimeGlobalTsmV1Chainer) Unsubscribe() { + key := "runtimes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *runtimeGlobalTsmV1Chainer) IsSubscribed() bool { + key := "runtimes.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *runtimeGlobalTsmV1Chainer) AllsparkServices() *allsparkservicesGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["allsparkserviceses.global.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY + return &allsparkservicesGlobalTsmV1Chainer{ + client: c.client, + name: helper.DEFAULT_KEY, + parentLabels: parentLabels, + } +} + +// GetAllsparkServices calculates hashed name of the object based on it's parents and returns the object +func (c *runtimeGlobalTsmV1Chainer) GetAllsparkServices(ctx context.Context) (result *GlobalAllSparkServices, err error) { + hashedName := helper.GetHashedName("allsparkserviceses.global.tsm.tanzu.vmware.com", c.parentLabels, helper.DEFAULT_KEY) + return c.client.Global().GetAllSparkServicesByName(ctx, hashedName) +} + +// AddAllsparkServices calculates hashed name of the child to create based on parents names and creates it. +// objToCreate.Name is changed to the hashed name. Original name ('default') is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *runtimeGlobalTsmV1Chainer) AddAllsparkServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AllSparkServices) (result *GlobalAllSparkServices, err error) { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("allsparkserviceses.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAllSparkServicesByName(ctx, objToCreate) +} + +// DeleteAllsparkServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *runtimeGlobalTsmV1Chainer) DeleteAllsparkServices(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("allsparkserviceses.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAllSparkServicesByName(ctx, hashedName) +} + +func (c *runtimeGlobalTsmV1Chainer) UserFolder() *userfolderGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["userfolders.global.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY + return &userfolderGlobalTsmV1Chainer{ + client: c.client, + name: helper.DEFAULT_KEY, + parentLabels: parentLabels, + } +} + +// GetUserFolder calculates hashed name of the object based on it's parents and returns the object +func (c *runtimeGlobalTsmV1Chainer) GetUserFolder(ctx context.Context) (result *GlobalUserFolder, err error) { + hashedName := helper.GetHashedName("userfolders.global.tsm.tanzu.vmware.com", c.parentLabels, helper.DEFAULT_KEY) + return c.client.Global().GetUserFolderByName(ctx, hashedName) +} + +// AddUserFolder calculates hashed name of the child to create based on parents names and creates it. +// objToCreate.Name is changed to the hashed name. Original name ('default') is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *runtimeGlobalTsmV1Chainer) AddUserFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.UserFolder) (result *GlobalUserFolder, err error) { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("userfolders.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateUserFolderByName(ctx, objToCreate) +} + +// DeleteUserFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *runtimeGlobalTsmV1Chainer) DeleteUserFolder(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("userfolders.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteUserFolderByName(ctx, hashedName) +} + +func (c *runtimeGlobalTsmV1Chainer) DataFolder() *datafolderGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["datafolders.global.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY + return &datafolderGlobalTsmV1Chainer{ + client: c.client, + name: helper.DEFAULT_KEY, + parentLabels: parentLabels, + } +} + +// GetDataFolder calculates hashed name of the object based on it's parents and returns the object +func (c *runtimeGlobalTsmV1Chainer) GetDataFolder(ctx context.Context) (result *GlobalDataFolder, err error) { + hashedName := helper.GetHashedName("datafolders.global.tsm.tanzu.vmware.com", c.parentLabels, helper.DEFAULT_KEY) + return c.client.Global().GetDataFolderByName(ctx, hashedName) +} + +// AddDataFolder calculates hashed name of the child to create based on parents names and creates it. +// objToCreate.Name is changed to the hashed name. Original name ('default') is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *runtimeGlobalTsmV1Chainer) AddDataFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataFolder) (result *GlobalDataFolder, err error) { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("datafolders.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateDataFolderByName(ctx, objToCreate) +} + +// DeleteDataFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *runtimeGlobalTsmV1Chainer) DeleteDataFolder(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("datafolders.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDataFolderByName(ctx, hashedName) +} + +func (c *runtimeGlobalTsmV1Chainer) AppFolder(name string) *appfolderGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["appfolders.global.tsm.tanzu.vmware.com"] = name + return &appfolderGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetAppFolder calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *runtimeGlobalTsmV1Chainer) GetAppFolder(ctx context.Context, displayName string) (result *GlobalAppFolder, err error) { + hashedName := helper.GetHashedName("appfolders.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAppFolderByName(ctx, hashedName) +} + +// AddAppFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *runtimeGlobalTsmV1Chainer) AddAppFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppFolder) (result *GlobalAppFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("appfolders.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAppFolderByName(ctx, objToCreate) +} + +// DeleteAppFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *runtimeGlobalTsmV1Chainer) DeleteAppFolder(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("appfolders.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAppFolderByName(ctx, hashedName) +} + +func (c *runtimeGlobalTsmV1Chainer) NodeFolder() *nodefolderGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["nodefolders.global.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY + return &nodefolderGlobalTsmV1Chainer{ + client: c.client, + name: helper.DEFAULT_KEY, + parentLabels: parentLabels, + } +} + +// GetNodeFolder calculates hashed name of the object based on it's parents and returns the object +func (c *runtimeGlobalTsmV1Chainer) GetNodeFolder(ctx context.Context) (result *GlobalNodeFolder, err error) { + hashedName := helper.GetHashedName("nodefolders.global.tsm.tanzu.vmware.com", c.parentLabels, helper.DEFAULT_KEY) + return c.client.Global().GetNodeFolderByName(ctx, hashedName) +} + +// AddNodeFolder calculates hashed name of the child to create based on parents names and creates it. +// objToCreate.Name is changed to the hashed name. Original name ('default') is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *runtimeGlobalTsmV1Chainer) AddNodeFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeFolder) (result *GlobalNodeFolder, err error) { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("nodefolders.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateNodeFolderByName(ctx, objToCreate) +} + +// DeleteNodeFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *runtimeGlobalTsmV1Chainer) DeleteNodeFolder(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("nodefolders.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteNodeFolderByName(ctx, hashedName) +} + +func (c *runtimeGlobalTsmV1Chainer) ClusterFolder(name string) *clusterfolderGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["clusterfolders.global.tsm.tanzu.vmware.com"] = name + return &clusterfolderGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetClusterFolder calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *runtimeGlobalTsmV1Chainer) GetClusterFolder(ctx context.Context, displayName string) (result *GlobalClusterFolder, err error) { + hashedName := helper.GetHashedName("clusterfolders.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetClusterFolderByName(ctx, hashedName) +} + +// AddClusterFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *runtimeGlobalTsmV1Chainer) AddClusterFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ClusterFolder) (result *GlobalClusterFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("clusterfolders.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateClusterFolderByName(ctx, objToCreate) +} + +// DeleteClusterFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *runtimeGlobalTsmV1Chainer) DeleteClusterFolder(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("clusterfolders.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteClusterFolderByName(ctx, hashedName) +} + +func (c *runtimeGlobalTsmV1Chainer) ProgressiveUpgrade() *progressiveupgradefolderGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["progressiveupgradefolders.global.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY + return &progressiveupgradefolderGlobalTsmV1Chainer{ + client: c.client, + name: helper.DEFAULT_KEY, + parentLabels: parentLabels, + } +} + +// GetProgressiveUpgrade calculates hashed name of the object based on it's parents and returns the object +func (c *runtimeGlobalTsmV1Chainer) GetProgressiveUpgrade(ctx context.Context) (result *GlobalProgressiveUpgradeFolder, err error) { + hashedName := helper.GetHashedName("progressiveupgradefolders.global.tsm.tanzu.vmware.com", c.parentLabels, helper.DEFAULT_KEY) + return c.client.Global().GetProgressiveUpgradeFolderByName(ctx, hashedName) +} + +// AddProgressiveUpgrade calculates hashed name of the child to create based on parents names and creates it. +// objToCreate.Name is changed to the hashed name. Original name ('default') is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *runtimeGlobalTsmV1Chainer) AddProgressiveUpgrade(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ProgressiveUpgradeFolder) (result *GlobalProgressiveUpgradeFolder, err error) { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("progressiveupgradefolders.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateProgressiveUpgradeFolderByName(ctx, objToCreate) +} + +// DeleteProgressiveUpgrade calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *runtimeGlobalTsmV1Chainer) DeleteProgressiveUpgrade(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("progressiveupgradefolders.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteProgressiveUpgradeFolderByName(ctx, hashedName) +} + +func (c *runtimeGlobalTsmV1Chainer) JobConfigFolder() *jobconfigfolderGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["jobconfigfolders.global.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY + return &jobconfigfolderGlobalTsmV1Chainer{ + client: c.client, + name: helper.DEFAULT_KEY, + parentLabels: parentLabels, + } +} + +// GetJobConfigFolder calculates hashed name of the object based on it's parents and returns the object +func (c *runtimeGlobalTsmV1Chainer) GetJobConfigFolder(ctx context.Context) (result *GlobalJobConfigFolder, err error) { + hashedName := helper.GetHashedName("jobconfigfolders.global.tsm.tanzu.vmware.com", c.parentLabels, helper.DEFAULT_KEY) + return c.client.Global().GetJobConfigFolderByName(ctx, hashedName) +} + +// AddJobConfigFolder calculates hashed name of the child to create based on parents names and creates it. +// objToCreate.Name is changed to the hashed name. Original name ('default') is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *runtimeGlobalTsmV1Chainer) AddJobConfigFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.JobConfigFolder) (result *GlobalJobConfigFolder, err error) { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("jobconfigfolders.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateJobConfigFolderByName(ctx, objToCreate) +} + +// DeleteJobConfigFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *runtimeGlobalTsmV1Chainer) DeleteJobConfigFolder(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("jobconfigfolders.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteJobConfigFolderByName(ctx, hashedName) +} + +func (c *runtimeGlobalTsmV1Chainer) ExternalDNS() *externaldnsruntimeGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["externaldnsruntimes.global.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY + return &externaldnsruntimeGlobalTsmV1Chainer{ + client: c.client, + name: helper.DEFAULT_KEY, + parentLabels: parentLabels, + } +} + +// GetExternalDNS calculates hashed name of the object based on it's parents and returns the object +func (c *runtimeGlobalTsmV1Chainer) GetExternalDNS(ctx context.Context) (result *GlobalExternalDNSRuntime, err error) { + hashedName := helper.GetHashedName("externaldnsruntimes.global.tsm.tanzu.vmware.com", c.parentLabels, helper.DEFAULT_KEY) + return c.client.Global().GetExternalDNSRuntimeByName(ctx, hashedName) +} + +// AddExternalDNS calculates hashed name of the child to create based on parents names and creates it. +// objToCreate.Name is changed to the hashed name. Original name ('default') is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *runtimeGlobalTsmV1Chainer) AddExternalDNS(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ExternalDNSRuntime) (result *GlobalExternalDNSRuntime, err error) { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsruntimes.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateExternalDNSRuntimeByName(ctx, objToCreate) +} + +// DeleteExternalDNS calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *runtimeGlobalTsmV1Chainer) DeleteExternalDNS(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("externaldnsruntimes.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteExternalDNSRuntimeByName(ctx, hashedName) +} + +func (c *runtimeGlobalTsmV1Chainer) SloFolder(name string) *slofolderGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["slofolders.global.tsm.tanzu.vmware.com"] = name + return &slofolderGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetSloFolder calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *runtimeGlobalTsmV1Chainer) GetSloFolder(ctx context.Context, displayName string) (result *GlobalSLOFolder, err error) { + hashedName := helper.GetHashedName("slofolders.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetSLOFolderByName(ctx, hashedName) +} + +// AddSloFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *runtimeGlobalTsmV1Chainer) AddSloFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SLOFolder) (result *GlobalSLOFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("slofolders.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateSLOFolderByName(ctx, objToCreate) +} + +// DeleteSloFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *runtimeGlobalTsmV1Chainer) DeleteSloFolder(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("slofolders.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteSLOFolderByName(ctx, hashedName) +} + +func (c *runtimeGlobalTsmV1Chainer) ServiceDirectoryRT() *servicedirectoryrtGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["servicedirectoryrts.global.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY + return &servicedirectoryrtGlobalTsmV1Chainer{ + client: c.client, + name: helper.DEFAULT_KEY, + parentLabels: parentLabels, + } +} + +// GetServiceDirectoryRT calculates hashed name of the object based on it's parents and returns the object +func (c *runtimeGlobalTsmV1Chainer) GetServiceDirectoryRT(ctx context.Context) (result *GlobalServiceDirectoryRT, err error) { + hashedName := helper.GetHashedName("servicedirectoryrts.global.tsm.tanzu.vmware.com", c.parentLabels, helper.DEFAULT_KEY) + return c.client.Global().GetServiceDirectoryRTByName(ctx, hashedName) +} + +// AddServiceDirectoryRT calculates hashed name of the child to create based on parents names and creates it. +// objToCreate.Name is changed to the hashed name. Original name ('default') is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *runtimeGlobalTsmV1Chainer) AddServiceDirectoryRT(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRT) (result *GlobalServiceDirectoryRT, err error) { + if objToCreate.GetName() == "" { + objToCreate.SetName(helper.DEFAULT_KEY) + } + if objToCreate.GetName() != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.GetName()) + } + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicedirectoryrts.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceDirectoryRTByName(ctx, objToCreate) +} + +// DeleteServiceDirectoryRT calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *runtimeGlobalTsmV1Chainer) DeleteServiceDirectoryRT(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicedirectoryrts.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceDirectoryRTByName(ctx, hashedName) +} + +// GetSchemaViolationDiscoveryRTByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetSchemaViolationDiscoveryRTByName(ctx context.Context, hashedName string) (*GlobalSchemaViolationDiscoveryRT, error) { + key := "schemaviolationdiscoveryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT) + return &GlobalSchemaViolationDiscoveryRT{ + client: group.client, + SchemaViolationDiscoveryRT: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + SchemaViolationDiscoveryRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSchemaViolationDiscoveryRT{ + client: group.client, + SchemaViolationDiscoveryRT: result, + }, nil + } +} + +// DeleteSchemaViolationDiscoveryRTByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteSchemaViolationDiscoveryRTByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + SchemaViolationDiscoveryRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + SchemaViolationDiscoveryRTs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/gnsSchemaViolationDiscoveryGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateSchemaViolationDiscoveryRTByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateSchemaViolationDiscoveryRTByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT) (*GlobalSchemaViolationDiscoveryRT, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + SchemaViolationDiscoveryRTs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"gnsSchemaViolationDiscoveryGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"SchemaViolationDiscoveryRT\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSchemaViolationDiscoveryRT{ + client: group.client, + SchemaViolationDiscoveryRT: result, + }, nil +} + +// UpdateSchemaViolationDiscoveryRTByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateSchemaViolationDiscoveryRTByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT) (*GlobalSchemaViolationDiscoveryRT, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + SchemaViolationDiscoveryRTs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueGnsid := + objToUpdate.Spec.Gnsid + patchOpGnsid := PatchOp{ + Op: "replace", + Path: "/spec/gnsid", + Value: patchValueGnsid, + } + patch = append(patch, patchOpGnsid) + + patchValueSelectors := + objToUpdate.Spec.Selectors + patchOpSelectors := PatchOp{ + Op: "replace", + Path: "/spec/selectors", + Value: patchValueSelectors, + } + patch = append(patch, patchOpSelectors) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + SchemaViolationDiscoveryRTs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalSchemaViolationDiscoveryRT{ + client: group.client, + SchemaViolationDiscoveryRT: result, + }, nil +} + +// ListSchemaViolationDiscoveryRTs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListSchemaViolationDiscoveryRTs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalSchemaViolationDiscoveryRT, err error) { + key := "schemaviolationdiscoveryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalSchemaViolationDiscoveryRT, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT) + result[k] = &GlobalSchemaViolationDiscoveryRT{ + client: group.client, + SchemaViolationDiscoveryRT: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + SchemaViolationDiscoveryRTs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalSchemaViolationDiscoveryRT, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalSchemaViolationDiscoveryRT{ + client: group.client, + SchemaViolationDiscoveryRT: &item, + } + } + } + return +} + +type GlobalSchemaViolationDiscoveryRT struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.SchemaViolationDiscoveryRT +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalSchemaViolationDiscoveryRT) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteSchemaViolationDiscoveryRTByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.SchemaViolationDiscoveryRT = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalSchemaViolationDiscoveryRT) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateSchemaViolationDiscoveryRTByName(ctx, obj.SchemaViolationDiscoveryRT) + if err != nil { + return err + } + obj.SchemaViolationDiscoveryRT = result.SchemaViolationDiscoveryRT + return nil +} + +func (obj *GlobalSchemaViolationDiscoveryRT) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type schemaviolationdiscoveryrtGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *schemaviolationdiscoveryrtGlobalTsmV1Chainer) Subscribe() { + key := "schemaviolationdiscoveryrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSchemaViolationDiscoveryRTInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *schemaviolationdiscoveryrtGlobalTsmV1Chainer) Unsubscribe() { + key := "schemaviolationdiscoveryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *schemaviolationdiscoveryrtGlobalTsmV1Chainer) IsSubscribed() bool { + key := "schemaviolationdiscoveryrts.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetGnsSchemaViolationDiscoveryByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetGnsSchemaViolationDiscoveryByName(ctx context.Context, hashedName string) (*GlobalGnsSchemaViolationDiscovery, error) { + key := "gnsschemaviolationdiscoveries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery) + return &GlobalGnsSchemaViolationDiscovery{ + client: group.client, + GnsSchemaViolationDiscovery: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsSchemaViolationDiscoveries().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsSchemaViolationDiscovery{ + client: group.client, + GnsSchemaViolationDiscovery: result, + }, nil + } +} + +// DeleteGnsSchemaViolationDiscoveryByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteGnsSchemaViolationDiscoveryByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsSchemaViolationDiscoveries().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + GnsSchemaViolationDiscoveries().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/gnsSchemaViolationDiscoveryGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateGnsSchemaViolationDiscoveryByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateGnsSchemaViolationDiscoveryByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery) (*GlobalGnsSchemaViolationDiscovery, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsSchemaViolationDiscoveries().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"gnsSchemaViolationDiscoveryGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"GnsSchemaViolationDiscovery\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalGnsSchemaViolationDiscovery{ + client: group.client, + GnsSchemaViolationDiscovery: result, + }, nil +} + +// UpdateGnsSchemaViolationDiscoveryByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateGnsSchemaViolationDiscoveryByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery) (*GlobalGnsSchemaViolationDiscovery, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + GnsSchemaViolationDiscoveries().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + GnsSchemaViolationDiscoveries().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalGnsSchemaViolationDiscovery{ + client: group.client, + GnsSchemaViolationDiscovery: result, + }, nil +} + +// ListGnsSchemaViolationDiscoveries returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListGnsSchemaViolationDiscoveries(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalGnsSchemaViolationDiscovery, err error) { + key := "gnsschemaviolationdiscoveries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalGnsSchemaViolationDiscovery, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery) + result[k] = &GlobalGnsSchemaViolationDiscovery{ + client: group.client, + GnsSchemaViolationDiscovery: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + GnsSchemaViolationDiscoveries().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalGnsSchemaViolationDiscovery, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalGnsSchemaViolationDiscovery{ + client: group.client, + GnsSchemaViolationDiscovery: &item, + } + } + } + return +} + +type GlobalGnsSchemaViolationDiscovery struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.GnsSchemaViolationDiscovery +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalGnsSchemaViolationDiscovery) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteGnsSchemaViolationDiscoveryByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.GnsSchemaViolationDiscovery = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalGnsSchemaViolationDiscovery) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateGnsSchemaViolationDiscoveryByName(ctx, obj.GnsSchemaViolationDiscovery) + if err != nil { + return err + } + obj.GnsSchemaViolationDiscovery = result.GnsSchemaViolationDiscovery + return nil +} + +func (obj *GlobalGnsSchemaViolationDiscovery) GetParent(ctx context.Context) (result *GlobalGNS, err error) { + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnss.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGNSByName(ctx, hashedName) +} + +type gnsschemaviolationdiscoveryGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *gnsschemaviolationdiscoveryGlobalTsmV1Chainer) Subscribe() { + key := "gnsschemaviolationdiscoveries.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewGnsSchemaViolationDiscoveryInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *gnsschemaviolationdiscoveryGlobalTsmV1Chainer) Unsubscribe() { + key := "gnsschemaviolationdiscoveries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *gnsschemaviolationdiscoveryGlobalTsmV1Chainer) IsSubscribed() bool { + key := "gnsschemaviolationdiscoveries.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetSecretRTConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetSecretRTConfigByName(ctx context.Context, hashedName string) (*GlobalSecretRTConfig, error) { + key := "secretrtconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.SecretRTConfig) + return &GlobalSecretRTConfig{ + client: group.client, + SecretRTConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + SecretRTConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSecretRTConfig{ + client: group.client, + SecretRTConfig: result, + }, nil + } +} + +// DeleteSecretRTConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteSecretRTConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + SecretRTConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + SecretRTConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/secretsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateSecretRTConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateSecretRTConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SecretRTConfig) (*GlobalSecretRTConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + SecretRTConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"secretsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"SecretRTConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSecretRTConfig{ + client: group.client, + SecretRTConfig: result, + }, nil +} + +// UpdateSecretRTConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateSecretRTConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.SecretRTConfig) (*GlobalSecretRTConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + SecretRTConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueType := + objToUpdate.Spec.Type + patchOpType := PatchOp{ + Op: "replace", + Path: "/spec/type", + Value: patchValueType, + } + patch = append(patch, patchOpType) + + patchValueData := + objToUpdate.Spec.Data + patchOpData := PatchOp{ + Op: "replace", + Path: "/spec/data", + Value: patchValueData, + } + patch = append(patch, patchOpData) + + patchValueIsBase64Encoded := + objToUpdate.Spec.IsBase64Encoded + patchOpIsBase64Encoded := PatchOp{ + Op: "replace", + Path: "/spec/isBase64Encoded", + Value: patchValueIsBase64Encoded, + } + patch = append(patch, patchOpIsBase64Encoded) + + patchValueOwnedBy := + objToUpdate.Spec.OwnedBy + patchOpOwnedBy := PatchOp{ + Op: "replace", + Path: "/spec/ownedBy", + Value: patchValueOwnedBy, + } + patch = append(patch, patchOpOwnedBy) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + SecretRTConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalSecretRTConfig{ + client: group.client, + SecretRTConfig: result, + }, nil +} + +// ListSecretRTConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListSecretRTConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalSecretRTConfig, err error) { + key := "secretrtconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalSecretRTConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.SecretRTConfig) + result[k] = &GlobalSecretRTConfig{ + client: group.client, + SecretRTConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + SecretRTConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalSecretRTConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalSecretRTConfig{ + client: group.client, + SecretRTConfig: &item, + } + } + } + return +} + +type GlobalSecretRTConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.SecretRTConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalSecretRTConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteSecretRTConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.SecretRTConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalSecretRTConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateSecretRTConfigByName(ctx, obj.SecretRTConfig) + if err != nil { + return err + } + obj.SecretRTConfig = result.SecretRTConfig + return nil +} + +func (obj *GlobalSecretRTConfig) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type secretrtconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *secretrtconfigGlobalTsmV1Chainer) Subscribe() { + key := "secretrtconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSecretRTConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *secretrtconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "secretrtconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *secretrtconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "secretrtconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetSecretHashByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetSecretHashByName(ctx context.Context, hashedName string) (*GlobalSecretHash, error) { + key := "secrethashes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.SecretHash) + return &GlobalSecretHash{ + client: group.client, + SecretHash: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + SecretHashes().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSecretHash{ + client: group.client, + SecretHash: result, + }, nil + } +} + +// DeleteSecretHashByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteSecretHashByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + SecretHashes().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + SecretHashes().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/secretHashesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateSecretHashByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateSecretHashByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SecretHash) (*GlobalSecretHash, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + SecretHashes().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"secretHashesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"SecretHash\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSecretHash{ + client: group.client, + SecretHash: result, + }, nil +} + +// UpdateSecretHashByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateSecretHashByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.SecretHash) (*GlobalSecretHash, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + SecretHashes().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueType := + objToUpdate.Spec.Type + patchOpType := PatchOp{ + Op: "replace", + Path: "/spec/type", + Value: patchValueType, + } + patch = append(patch, patchOpType) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueDataHash := + objToUpdate.Spec.DataHash + patchOpDataHash := PatchOp{ + Op: "replace", + Path: "/spec/dataHash", + Value: patchValueDataHash, + } + patch = append(patch, patchOpDataHash) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + SecretHashes().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalSecretHash{ + client: group.client, + SecretHash: result, + }, nil +} + +// ListSecretHashes returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListSecretHashes(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalSecretHash, err error) { + key := "secrethashes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalSecretHash, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.SecretHash) + result[k] = &GlobalSecretHash{ + client: group.client, + SecretHash: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + SecretHashes().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalSecretHash, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalSecretHash{ + client: group.client, + SecretHash: &item, + } + } + } + return +} + +type GlobalSecretHash struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.SecretHash +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalSecretHash) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteSecretHashByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.SecretHash = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalSecretHash) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateSecretHashByName(ctx, obj.SecretHash) + if err != nil { + return err + } + obj.SecretHash = result.SecretHash + return nil +} + +func (obj *GlobalSecretHash) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +type secrethashGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *secrethashGlobalTsmV1Chainer) Subscribe() { + key := "secrethashes.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSecretHashInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *secrethashGlobalTsmV1Chainer) Unsubscribe() { + key := "secrethashes.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *secrethashGlobalTsmV1Chainer) IsSubscribed() bool { + key := "secrethashes.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetSecurityContextConstraintsConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetSecurityContextConstraintsConfigByName(ctx context.Context, hashedName string) (*GlobalSecurityContextConstraintsConfig, error) { + key := "securitycontextconstraintsconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig) + return &GlobalSecurityContextConstraintsConfig{ + client: group.client, + SecurityContextConstraintsConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + SecurityContextConstraintsConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSecurityContextConstraintsConfig{ + client: group.client, + SecurityContextConstraintsConfig: result, + }, nil + } +} + +// DeleteSecurityContextConstraintsConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteSecurityContextConstraintsConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + SecurityContextConstraintsConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + SecurityContextConstraintsConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/securityContextConstraintsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["clusterconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateSecurityContextConstraintsConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateSecurityContextConstraintsConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig) (*GlobalSecurityContextConstraintsConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + SecurityContextConstraintsConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["clusterconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"securityContextConstraintsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"SecurityContextConstraintsConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ClusterConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSecurityContextConstraintsConfig{ + client: group.client, + SecurityContextConstraintsConfig: result, + }, nil +} + +// UpdateSecurityContextConstraintsConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateSecurityContextConstraintsConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig) (*GlobalSecurityContextConstraintsConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + SecurityContextConstraintsConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + if objToUpdate.Spec.Groups != nil { + patchValueGroups := + objToUpdate.Spec.Groups + patchOpGroups := PatchOp{ + Op: "replace", + Path: "/spec/groups", + Value: patchValueGroups, + } + patch = append(patch, patchOpGroups) + } + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + SecurityContextConstraintsConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalSecurityContextConstraintsConfig{ + client: group.client, + SecurityContextConstraintsConfig: result, + }, nil +} + +// ListSecurityContextConstraintsConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListSecurityContextConstraintsConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalSecurityContextConstraintsConfig, err error) { + key := "securitycontextconstraintsconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalSecurityContextConstraintsConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig) + result[k] = &GlobalSecurityContextConstraintsConfig{ + client: group.client, + SecurityContextConstraintsConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + SecurityContextConstraintsConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalSecurityContextConstraintsConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalSecurityContextConstraintsConfig{ + client: group.client, + SecurityContextConstraintsConfig: &item, + } + } + } + return +} + +type GlobalSecurityContextConstraintsConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.SecurityContextConstraintsConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalSecurityContextConstraintsConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteSecurityContextConstraintsConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.SecurityContextConstraintsConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalSecurityContextConstraintsConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateSecurityContextConstraintsConfigByName(ctx, obj.SecurityContextConstraintsConfig) + if err != nil { + return err + } + obj.SecurityContextConstraintsConfig = result.SecurityContextConstraintsConfig + return nil +} + +func (obj *GlobalSecurityContextConstraintsConfig) GetParent(ctx context.Context) (result *GlobalClusterConfig, err error) { + hashedName := helper.GetHashedName("clusterconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["clusterconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetClusterConfigByName(ctx, hashedName) +} + +type securitycontextconstraintsconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *securitycontextconstraintsconfigGlobalTsmV1Chainer) Subscribe() { + key := "securitycontextconstraintsconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSecurityContextConstraintsConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *securitycontextconstraintsconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "securitycontextconstraintsconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *securitycontextconstraintsconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "securitycontextconstraintsconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetSecurityContextConstraintsByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetSecurityContextConstraintsByName(ctx context.Context, hashedName string) (*GlobalSecurityContextConstraints, error) { + key := "securitycontextconstraintses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.SecurityContextConstraints) + return &GlobalSecurityContextConstraints{ + client: group.client, + SecurityContextConstraints: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + SecurityContextConstraintses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSecurityContextConstraints{ + client: group.client, + SecurityContextConstraints: result, + }, nil + } +} + +// DeleteSecurityContextConstraintsByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteSecurityContextConstraintsByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + SecurityContextConstraintses().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + SecurityContextConstraintses().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/securityContextConstraintsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["clusters.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Clusters().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateSecurityContextConstraintsByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateSecurityContextConstraintsByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SecurityContextConstraints) (*GlobalSecurityContextConstraints, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + SecurityContextConstraintses().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["clusters.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"securityContextConstraintsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"SecurityContextConstraints\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Clusters().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSecurityContextConstraints{ + client: group.client, + SecurityContextConstraints: result, + }, nil +} + +// UpdateSecurityContextConstraintsByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateSecurityContextConstraintsByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.SecurityContextConstraints) (*GlobalSecurityContextConstraints, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + SecurityContextConstraintses().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + if objToUpdate.Spec.Groups != nil { + patchValueGroups := + objToUpdate.Spec.Groups + patchOpGroups := PatchOp{ + Op: "replace", + Path: "/spec/groups", + Value: patchValueGroups, + } + patch = append(patch, patchOpGroups) + } + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + SecurityContextConstraintses().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalSecurityContextConstraints{ + client: group.client, + SecurityContextConstraints: result, + }, nil +} + +// ListSecurityContextConstraintses returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListSecurityContextConstraintses(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalSecurityContextConstraints, err error) { + key := "securitycontextconstraintses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalSecurityContextConstraints, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.SecurityContextConstraints) + result[k] = &GlobalSecurityContextConstraints{ + client: group.client, + SecurityContextConstraints: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + SecurityContextConstraintses().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalSecurityContextConstraints, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalSecurityContextConstraints{ + client: group.client, + SecurityContextConstraints: &item, + } + } + } + return +} + +type GlobalSecurityContextConstraints struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.SecurityContextConstraints +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalSecurityContextConstraints) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteSecurityContextConstraintsByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.SecurityContextConstraints = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalSecurityContextConstraints) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateSecurityContextConstraintsByName(ctx, obj.SecurityContextConstraints) + if err != nil { + return err + } + obj.SecurityContextConstraints = result.SecurityContextConstraints + return nil +} + +func (obj *GlobalSecurityContextConstraints) GetParent(ctx context.Context) (result *GlobalCluster, err error) { + hashedName := helper.GetHashedName("clusters.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["clusters.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetClusterByName(ctx, hashedName) +} + +type securitycontextconstraintsGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *securitycontextconstraintsGlobalTsmV1Chainer) Subscribe() { + key := "securitycontextconstraintses.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSecurityContextConstraintsInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *securitycontextconstraintsGlobalTsmV1Chainer) Unsubscribe() { + key := "securitycontextconstraintses.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *securitycontextconstraintsGlobalTsmV1Chainer) IsSubscribed() bool { + key := "securitycontextconstraintses.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetServiceConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceConfigByName(ctx context.Context, hashedName string) (*GlobalServiceConfig, error) { + key := "serviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceConfig) + return &GlobalServiceConfig{ + client: group.client, + ServiceConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceConfig{ + client: group.client, + ServiceConfig: result, + }, nil + } +} + +// DeleteServiceConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.ServiceVersionGvk { + err := group.client. + Global().DeleteServiceVersionConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/servicesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceConfig) (*GlobalServiceConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ServiceVersionGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"servicesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceConfig{ + client: group.client, + ServiceConfig: result, + }, nil +} + +// UpdateServiceConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceConfig) (*GlobalServiceConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueOwnedBy := + objToUpdate.Spec.OwnedBy + patchOpOwnedBy := PatchOp{ + Op: "replace", + Path: "/spec/ownedBy", + Value: patchValueOwnedBy, + } + patch = append(patch, patchOpOwnedBy) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceConfig{ + client: group.client, + ServiceConfig: result, + }, nil +} + +// ListServiceConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceConfig, err error) { + key := "serviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceConfig) + result[k] = &GlobalServiceConfig{ + client: group.client, + ServiceConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceConfig{ + client: group.client, + ServiceConfig: &item, + } + } + } + return +} + +type GlobalServiceConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceConfigByName(ctx, obj.ServiceConfig) + if err != nil { + return err + } + obj.ServiceConfig = result.ServiceConfig + return nil +} + +func (obj *GlobalServiceConfig) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +// GetAllServiceVersion returns all children of given type +func (obj *GlobalServiceConfig) GetAllServiceVersion(ctx context.Context) ( + result []*GlobalServiceVersionConfig, err error) { + result = make([]*GlobalServiceVersionConfig, 0, len(obj.Spec.ServiceVersionGvk)) + for _, v := range obj.Spec.ServiceVersionGvk { + l, err := obj.client.Global().GetServiceVersionConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceVersion returns child which has given displayName +func (obj *GlobalServiceConfig) GetServiceVersion(ctx context.Context, + displayName string) (result *GlobalServiceVersionConfig, err error) { + l, ok := obj.Spec.ServiceVersionGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ServiceConfig", "ServiceVersion", displayName) + } + result, err = obj.client.Global().GetServiceVersionConfigByName(ctx, l.Name) + return +} + +// AddServiceVersion calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalServiceConfig) AddServiceVersion(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceVersionConfig) (result *GlobalServiceVersionConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["serviceconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["serviceconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceVersionConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetServiceConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.ServiceConfig = updatedObj.ServiceConfig + } + return +} + +// DeleteServiceVersion calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalServiceConfig) DeleteServiceVersion(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceVersionGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ServiceConfig", "ServiceVersion", displayName) + } + err = obj.client.Global().DeleteServiceVersionConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetServiceConfigByName(ctx, obj.GetName()) + if err == nil { + obj.ServiceConfig = updatedObj.ServiceConfig + } + return +} + +type serviceconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *serviceconfigGlobalTsmV1Chainer) Subscribe() { + key := "serviceconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *serviceconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "serviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *serviceconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "serviceconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *serviceconfigGlobalTsmV1Chainer) ServiceVersion(name string) *serviceversionconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["serviceversionconfigs.global.tsm.tanzu.vmware.com"] = name + return &serviceversionconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceVersion calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *serviceconfigGlobalTsmV1Chainer) GetServiceVersion(ctx context.Context, displayName string) (result *GlobalServiceVersionConfig, err error) { + hashedName := helper.GetHashedName("serviceversionconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceVersionConfigByName(ctx, hashedName) +} + +// AddServiceVersion calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *serviceconfigGlobalTsmV1Chainer) AddServiceVersion(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceVersionConfig) (result *GlobalServiceVersionConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("serviceversionconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceVersionConfigByName(ctx, objToCreate) +} + +// DeleteServiceVersion calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *serviceconfigGlobalTsmV1Chainer) DeleteServiceVersion(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("serviceversionconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceVersionConfigByName(ctx, hashedName) +} + +// GetServiceCronJobByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceCronJobByName(ctx context.Context, hashedName string) (*GlobalServiceCronJob, error) { + key := "servicecronjobs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceCronJob) + return &GlobalServiceCronJob{ + client: group.client, + ServiceCronJob: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceCronJobs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceCronJob{ + client: group.client, + ServiceCronJob: result, + }, nil + } +} + +// DeleteServiceCronJobByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceCronJobByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceCronJobs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceCronJobs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceCronJobsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceCronJobByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceCronJobByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceCronJob) (*GlobalServiceCronJob, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ServiceInstancesGvk = nil + objToCreate.Spec.ServiceJobsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceCronJobs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceCronJobsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceCronJob\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceCronJob{ + client: group.client, + ServiceCronJob: result, + }, nil +} + +// UpdateServiceCronJobByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceCronJobByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceCronJob) (*GlobalServiceCronJob, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceCronJobs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + patchValueStatus := + objToUpdate.Spec.Status + patchOpStatus := PatchOp{ + Op: "replace", + Path: "/spec/status", + Value: patchValueStatus, + } + patch = append(patch, patchOpStatus) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceCronJobs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceCronJob{ + client: group.client, + ServiceCronJob: result, + }, nil +} + +// ListServiceCronJobs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceCronJobs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceCronJob, err error) { + key := "servicecronjobs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceCronJob, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceCronJob) + result[k] = &GlobalServiceCronJob{ + client: group.client, + ServiceCronJob: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceCronJobs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceCronJob, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceCronJob{ + client: group.client, + ServiceCronJob: &item, + } + } + } + return +} + +type GlobalServiceCronJob struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceCronJob +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceCronJob) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceCronJobByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceCronJob = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceCronJob) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceCronJobByName(ctx, obj.ServiceCronJob) + if err != nil { + return err + } + obj.ServiceCronJob = result.ServiceCronJob + return nil +} + +func (obj *GlobalServiceCronJob) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +// GetAllServiceInstances returns all links of given type +func (obj *GlobalServiceCronJob) GetAllServiceInstances(ctx context.Context) ( + result []*GlobalServiceInstance, err error) { + result = make([]*GlobalServiceInstance, 0, len(obj.Spec.ServiceInstancesGvk)) + for _, v := range obj.Spec.ServiceInstancesGvk { + l, err := obj.client.Global().GetServiceInstanceByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceInstances returns link which has given displayName +func (obj *GlobalServiceCronJob) GetServiceInstances(ctx context.Context, + displayName string) (result *GlobalServiceInstance, err error) { + l, ok := obj.Spec.ServiceInstancesGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ServiceCronJob", "ServiceInstances", displayName) + } + result, err = obj.client.Global().GetServiceInstanceByName(ctx, l.Name) + return +} + +// LinkServiceInstances links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalServiceCronJob) LinkServiceInstances(ctx context.Context, + linkToAdd *GlobalServiceInstance) error { + + payload := "{\"spec\": {\"serviceInstancesGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceInstance\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ServiceCronJobs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ServiceCronJob = result + return nil +} + +// UnlinkServiceInstances unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalServiceCronJob) UnlinkServiceInstances(ctx context.Context, + linkToRemove *GlobalServiceInstance) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceInstancesGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ServiceCronJobs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ServiceCronJob = result + return nil + +} + +// GetAllServiceJobs returns all links of given type +func (obj *GlobalServiceCronJob) GetAllServiceJobs(ctx context.Context) ( + result []*GlobalServiceJob, err error) { + result = make([]*GlobalServiceJob, 0, len(obj.Spec.ServiceJobsGvk)) + for _, v := range obj.Spec.ServiceJobsGvk { + l, err := obj.client.Global().GetServiceJobByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceJobs returns link which has given displayName +func (obj *GlobalServiceCronJob) GetServiceJobs(ctx context.Context, + displayName string) (result *GlobalServiceJob, err error) { + l, ok := obj.Spec.ServiceJobsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ServiceCronJob", "ServiceJobs", displayName) + } + result, err = obj.client.Global().GetServiceJobByName(ctx, l.Name) + return +} + +// LinkServiceJobs links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalServiceCronJob) LinkServiceJobs(ctx context.Context, + linkToAdd *GlobalServiceJob) error { + + payload := "{\"spec\": {\"serviceJobsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceJob\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ServiceCronJobs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ServiceCronJob = result + return nil +} + +// UnlinkServiceJobs unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalServiceCronJob) UnlinkServiceJobs(ctx context.Context, + linkToRemove *GlobalServiceJob) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceJobsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ServiceCronJobs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ServiceCronJob = result + return nil + +} + +type servicecronjobGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *servicecronjobGlobalTsmV1Chainer) Subscribe() { + key := "servicecronjobs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceCronJobInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *servicecronjobGlobalTsmV1Chainer) Unsubscribe() { + key := "servicecronjobs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *servicecronjobGlobalTsmV1Chainer) IsSubscribed() bool { + key := "servicecronjobs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetServiceDaemonSetByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceDaemonSetByName(ctx context.Context, hashedName string) (*GlobalServiceDaemonSet, error) { + key := "servicedaemonsets.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceDaemonSet) + return &GlobalServiceDaemonSet{ + client: group.client, + ServiceDaemonSet: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDaemonSets().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceDaemonSet{ + client: group.client, + ServiceDaemonSet: result, + }, nil + } +} + +// DeleteServiceDaemonSetByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceDaemonSetByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDaemonSets().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceDaemonSets().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceDaemonSetsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceDaemonSetByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceDaemonSetByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDaemonSet) (*GlobalServiceDaemonSet, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ServiceInstancesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDaemonSets().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceDaemonSetsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceDaemonSet\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceDaemonSet{ + client: group.client, + ServiceDaemonSet: result, + }, nil +} + +// UpdateServiceDaemonSetByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceDaemonSetByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceDaemonSet) (*GlobalServiceDaemonSet, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDaemonSets().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + patchValueStatus := + objToUpdate.Spec.Status + patchOpStatus := PatchOp{ + Op: "replace", + Path: "/spec/status", + Value: patchValueStatus, + } + patch = append(patch, patchOpStatus) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDaemonSets().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceDaemonSet{ + client: group.client, + ServiceDaemonSet: result, + }, nil +} + +// ListServiceDaemonSets returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceDaemonSets(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceDaemonSet, err error) { + key := "servicedaemonsets.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceDaemonSet, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceDaemonSet) + result[k] = &GlobalServiceDaemonSet{ + client: group.client, + ServiceDaemonSet: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceDaemonSets().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceDaemonSet, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceDaemonSet{ + client: group.client, + ServiceDaemonSet: &item, + } + } + } + return +} + +type GlobalServiceDaemonSet struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceDaemonSet +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceDaemonSet) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceDaemonSetByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceDaemonSet = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceDaemonSet) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceDaemonSetByName(ctx, obj.ServiceDaemonSet) + if err != nil { + return err + } + obj.ServiceDaemonSet = result.ServiceDaemonSet + return nil +} + +func (obj *GlobalServiceDaemonSet) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +// GetAllServiceInstances returns all links of given type +func (obj *GlobalServiceDaemonSet) GetAllServiceInstances(ctx context.Context) ( + result []*GlobalServiceInstance, err error) { + result = make([]*GlobalServiceInstance, 0, len(obj.Spec.ServiceInstancesGvk)) + for _, v := range obj.Spec.ServiceInstancesGvk { + l, err := obj.client.Global().GetServiceInstanceByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceInstances returns link which has given displayName +func (obj *GlobalServiceDaemonSet) GetServiceInstances(ctx context.Context, + displayName string) (result *GlobalServiceInstance, err error) { + l, ok := obj.Spec.ServiceInstancesGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ServiceDaemonSet", "ServiceInstances", displayName) + } + result, err = obj.client.Global().GetServiceInstanceByName(ctx, l.Name) + return +} + +// LinkServiceInstances links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalServiceDaemonSet) LinkServiceInstances(ctx context.Context, + linkToAdd *GlobalServiceInstance) error { + + payload := "{\"spec\": {\"serviceInstancesGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceInstance\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ServiceDaemonSets().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ServiceDaemonSet = result + return nil +} + +// UnlinkServiceInstances unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalServiceDaemonSet) UnlinkServiceInstances(ctx context.Context, + linkToRemove *GlobalServiceInstance) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceInstancesGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ServiceDaemonSets().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ServiceDaemonSet = result + return nil + +} + +type servicedaemonsetGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *servicedaemonsetGlobalTsmV1Chainer) Subscribe() { + key := "servicedaemonsets.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceDaemonSetInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *servicedaemonsetGlobalTsmV1Chainer) Unsubscribe() { + key := "servicedaemonsets.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *servicedaemonsetGlobalTsmV1Chainer) IsSubscribed() bool { + key := "servicedaemonsets.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetServiceDeploymentContainerByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceDeploymentContainerByName(ctx context.Context, hashedName string) (*GlobalServiceDeploymentContainer, error) { + key := "servicedeploymentcontainers.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceDeploymentContainer) + return &GlobalServiceDeploymentContainer{ + client: group.client, + ServiceDeploymentContainer: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDeploymentContainers().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceDeploymentContainer{ + client: group.client, + ServiceDeploymentContainer: result, + }, nil + } +} + +// DeleteServiceDeploymentContainerByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceDeploymentContainerByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDeploymentContainers().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceDeploymentContainers().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/containersGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["servicedeployments.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("servicedeployments.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceDeployments().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceDeploymentContainerByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceDeploymentContainerByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDeploymentContainer) (*GlobalServiceDeploymentContainer, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDeploymentContainers().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["servicedeployments.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("servicedeployments.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"containersGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceDeploymentContainer\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceDeployments().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceDeploymentContainer{ + client: group.client, + ServiceDeploymentContainer: result, + }, nil +} + +// UpdateServiceDeploymentContainerByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceDeploymentContainerByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceDeploymentContainer) (*GlobalServiceDeploymentContainer, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDeploymentContainers().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueImage := + objToUpdate.Spec.Image + patchOpImage := PatchOp{ + Op: "replace", + Path: "/spec/image", + Value: patchValueImage, + } + patch = append(patch, patchOpImage) + + patchValueImagePullPolicy := + objToUpdate.Spec.ImagePullPolicy + patchOpImagePullPolicy := PatchOp{ + Op: "replace", + Path: "/spec/imagePullPolicy", + Value: patchValueImagePullPolicy, + } + patch = append(patch, patchOpImagePullPolicy) + + patchValueTerminationMessagePath := + objToUpdate.Spec.TerminationMessagePath + patchOpTerminationMessagePath := PatchOp{ + Op: "replace", + Path: "/spec/terminationMessagePath", + Value: patchValueTerminationMessagePath, + } + patch = append(patch, patchOpTerminationMessagePath) + + patchValueTerminationMessagePolicy := + objToUpdate.Spec.TerminationMessagePolicy + patchOpTerminationMessagePolicy := PatchOp{ + Op: "replace", + Path: "/spec/terminationMessagePolicy", + Value: patchValueTerminationMessagePolicy, + } + patch = append(patch, patchOpTerminationMessagePolicy) + + patchValueArgs := + objToUpdate.Spec.Args + patchOpArgs := PatchOp{ + Op: "replace", + Path: "/spec/args", + Value: patchValueArgs, + } + patch = append(patch, patchOpArgs) + + patchValueEnv := + objToUpdate.Spec.Env + patchOpEnv := PatchOp{ + Op: "replace", + Path: "/spec/env", + Value: patchValueEnv, + } + patch = append(patch, patchOpEnv) + + patchValueLivenessProbe := + objToUpdate.Spec.LivenessProbe + patchOpLivenessProbe := PatchOp{ + Op: "replace", + Path: "/spec/livenessProbe", + Value: patchValueLivenessProbe, + } + patch = append(patch, patchOpLivenessProbe) + + patchValueReadinessProbe := + objToUpdate.Spec.ReadinessProbe + patchOpReadinessProbe := PatchOp{ + Op: "replace", + Path: "/spec/readinessProbe", + Value: patchValueReadinessProbe, + } + patch = append(patch, patchOpReadinessProbe) + + patchValuePorts := + objToUpdate.Spec.Ports + patchOpPorts := PatchOp{ + Op: "replace", + Path: "/spec/ports", + Value: patchValuePorts, + } + patch = append(patch, patchOpPorts) + + patchValueResources := + objToUpdate.Spec.Resources + patchOpResources := PatchOp{ + Op: "replace", + Path: "/spec/resources", + Value: patchValueResources, + } + patch = append(patch, patchOpResources) + + patchValueVolumeMounts := + objToUpdate.Spec.VolumeMounts + patchOpVolumeMounts := PatchOp{ + Op: "replace", + Path: "/spec/volumeMounts", + Value: patchValueVolumeMounts, + } + patch = append(patch, patchOpVolumeMounts) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDeploymentContainers().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceDeploymentContainer{ + client: group.client, + ServiceDeploymentContainer: result, + }, nil +} + +// ListServiceDeploymentContainers returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceDeploymentContainers(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceDeploymentContainer, err error) { + key := "servicedeploymentcontainers.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceDeploymentContainer, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceDeploymentContainer) + result[k] = &GlobalServiceDeploymentContainer{ + client: group.client, + ServiceDeploymentContainer: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceDeploymentContainers().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceDeploymentContainer, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceDeploymentContainer{ + client: group.client, + ServiceDeploymentContainer: &item, + } + } + } + return +} + +type GlobalServiceDeploymentContainer struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceDeploymentContainer +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceDeploymentContainer) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceDeploymentContainerByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceDeploymentContainer = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceDeploymentContainer) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceDeploymentContainerByName(ctx, obj.ServiceDeploymentContainer) + if err != nil { + return err + } + obj.ServiceDeploymentContainer = result.ServiceDeploymentContainer + return nil +} + +func (obj *GlobalServiceDeploymentContainer) GetParent(ctx context.Context) (result *GlobalServiceDeployment, err error) { + hashedName := helper.GetHashedName("servicedeployments.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["servicedeployments.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetServiceDeploymentByName(ctx, hashedName) +} + +type servicedeploymentcontainerGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *servicedeploymentcontainerGlobalTsmV1Chainer) Subscribe() { + key := "servicedeploymentcontainers.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceDeploymentContainerInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *servicedeploymentcontainerGlobalTsmV1Chainer) Unsubscribe() { + key := "servicedeploymentcontainers.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *servicedeploymentcontainerGlobalTsmV1Chainer) IsSubscribed() bool { + key := "servicedeploymentcontainers.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetServiceDeploymentByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceDeploymentByName(ctx context.Context, hashedName string) (*GlobalServiceDeployment, error) { + key := "servicedeployments.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceDeployment) + return &GlobalServiceDeployment{ + client: group.client, + ServiceDeployment: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDeployments().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceDeployment{ + client: group.client, + ServiceDeployment: result, + }, nil + } +} + +// DeleteServiceDeploymentByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceDeploymentByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDeployments().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.ContainersGvk { + err := group.client. + Global().DeleteServiceDeploymentContainerByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceDeployments().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceDeploymentsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceDeploymentByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceDeploymentByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDeployment) (*GlobalServiceDeployment, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ContainersGvk = nil + objToCreate.Spec.ServiceInstancesGvk = nil + objToCreate.Spec.ServiceReplicaSetGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDeployments().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceDeploymentsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceDeployment\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceDeployment{ + client: group.client, + ServiceDeployment: result, + }, nil +} + +// UpdateServiceDeploymentByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceDeploymentByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceDeployment) (*GlobalServiceDeployment, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDeployments().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + patchValueStatus := + objToUpdate.Spec.Status + patchOpStatus := PatchOp{ + Op: "replace", + Path: "/spec/status", + Value: patchValueStatus, + } + patch = append(patch, patchOpStatus) + + patchValueNamespace := + objToUpdate.Spec.Namespace + patchOpNamespace := PatchOp{ + Op: "replace", + Path: "/spec/namespace", + Value: patchValueNamespace, + } + patch = append(patch, patchOpNamespace) + + patchValueAnnotations := + objToUpdate.Spec.Annotations + patchOpAnnotations := PatchOp{ + Op: "replace", + Path: "/spec/annotations", + Value: patchValueAnnotations, + } + patch = append(patch, patchOpAnnotations) + + patchValueCreationTimestamp := + objToUpdate.Spec.CreationTimestamp + patchOpCreationTimestamp := PatchOp{ + Op: "replace", + Path: "/spec/creationTimestamp", + Value: patchValueCreationTimestamp, + } + patch = append(patch, patchOpCreationTimestamp) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueApiLink := + objToUpdate.Spec.ApiLink + patchOpApiLink := PatchOp{ + Op: "replace", + Path: "/spec/apiLink", + Value: patchValueApiLink, + } + patch = append(patch, patchOpApiLink) + + patchValueUid := + objToUpdate.Spec.Uid + patchOpUid := PatchOp{ + Op: "replace", + Path: "/spec/uid", + Value: patchValueUid, + } + patch = append(patch, patchOpUid) + + patchValueGeneration := + objToUpdate.Spec.Generation + patchOpGeneration := PatchOp{ + Op: "replace", + Path: "/spec/generation", + Value: patchValueGeneration, + } + patch = append(patch, patchOpGeneration) + + patchValueSelector := + objToUpdate.Spec.Selector + patchOpSelector := PatchOp{ + Op: "replace", + Path: "/spec/selector", + Value: patchValueSelector, + } + patch = append(patch, patchOpSelector) + + patchValueReplicas := + objToUpdate.Spec.Replicas + patchOpReplicas := PatchOp{ + Op: "replace", + Path: "/spec/replicas", + Value: patchValueReplicas, + } + patch = append(patch, patchOpReplicas) + + patchValueDnsPolicy := + objToUpdate.Spec.DnsPolicy + patchOpDnsPolicy := PatchOp{ + Op: "replace", + Path: "/spec/dnsPolicy", + Value: patchValueDnsPolicy, + } + patch = append(patch, patchOpDnsPolicy) + + patchValueRestartPolicy := + objToUpdate.Spec.RestartPolicy + patchOpRestartPolicy := PatchOp{ + Op: "replace", + Path: "/spec/restartPolicy", + Value: patchValueRestartPolicy, + } + patch = append(patch, patchOpRestartPolicy) + + patchValueSchedulerName := + objToUpdate.Spec.SchedulerName + patchOpSchedulerName := PatchOp{ + Op: "replace", + Path: "/spec/schedulerName", + Value: patchValueSchedulerName, + } + patch = append(patch, patchOpSchedulerName) + + patchValueSecurityContext := + objToUpdate.Spec.SecurityContext + patchOpSecurityContext := PatchOp{ + Op: "replace", + Path: "/spec/securityContext", + Value: patchValueSecurityContext, + } + patch = append(patch, patchOpSecurityContext) + + patchValueServiceAccount := + objToUpdate.Spec.ServiceAccount + patchOpServiceAccount := PatchOp{ + Op: "replace", + Path: "/spec/serviceAccount", + Value: patchValueServiceAccount, + } + patch = append(patch, patchOpServiceAccount) + + patchValueServiceAccountName := + objToUpdate.Spec.ServiceAccountName + patchOpServiceAccountName := PatchOp{ + Op: "replace", + Path: "/spec/serviceAccountName", + Value: patchValueServiceAccountName, + } + patch = append(patch, patchOpServiceAccountName) + + patchValueTerminationGracePeriodSeconds := + objToUpdate.Spec.TerminationGracePeriodSeconds + patchOpTerminationGracePeriodSeconds := PatchOp{ + Op: "replace", + Path: "/spec/terminationGracePeriodSeconds", + Value: patchValueTerminationGracePeriodSeconds, + } + patch = append(patch, patchOpTerminationGracePeriodSeconds) + + patchValueVolumes := + objToUpdate.Spec.Volumes + patchOpVolumes := PatchOp{ + Op: "replace", + Path: "/spec/volumes", + Value: patchValueVolumes, + } + patch = append(patch, patchOpVolumes) + + patchValueTemplateLabels := + objToUpdate.Spec.TemplateLabels + patchOpTemplateLabels := PatchOp{ + Op: "replace", + Path: "/spec/templateLabels", + Value: patchValueTemplateLabels, + } + patch = append(patch, patchOpTemplateLabels) + + patchValueStatusReplicas := + objToUpdate.Spec.StatusReplicas + patchOpStatusReplicas := PatchOp{ + Op: "replace", + Path: "/spec/statusReplicas", + Value: patchValueStatusReplicas, + } + patch = append(patch, patchOpStatusReplicas) + + patchValueAvailableReplicas := + objToUpdate.Spec.AvailableReplicas + patchOpAvailableReplicas := PatchOp{ + Op: "replace", + Path: "/spec/availableReplicas", + Value: patchValueAvailableReplicas, + } + patch = append(patch, patchOpAvailableReplicas) + + patchValueUpdatedReplicas := + objToUpdate.Spec.UpdatedReplicas + patchOpUpdatedReplicas := PatchOp{ + Op: "replace", + Path: "/spec/updatedReplicas", + Value: patchValueUpdatedReplicas, + } + patch = append(patch, patchOpUpdatedReplicas) + + patchValueReadyReplicas := + objToUpdate.Spec.ReadyReplicas + patchOpReadyReplicas := PatchOp{ + Op: "replace", + Path: "/spec/readyReplicas", + Value: patchValueReadyReplicas, + } + patch = append(patch, patchOpReadyReplicas) + + patchValueObservedGeneration := + objToUpdate.Spec.ObservedGeneration + patchOpObservedGeneration := PatchOp{ + Op: "replace", + Path: "/spec/observedGeneration", + Value: patchValueObservedGeneration, + } + patch = append(patch, patchOpObservedGeneration) + + patchValueConditions := + objToUpdate.Spec.Conditions + patchOpConditions := PatchOp{ + Op: "replace", + Path: "/spec/conditions", + Value: patchValueConditions, + } + patch = append(patch, patchOpConditions) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDeployments().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceDeployment{ + client: group.client, + ServiceDeployment: result, + }, nil +} + +// ListServiceDeployments returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceDeployments(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceDeployment, err error) { + key := "servicedeployments.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceDeployment, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceDeployment) + result[k] = &GlobalServiceDeployment{ + client: group.client, + ServiceDeployment: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceDeployments().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceDeployment, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceDeployment{ + client: group.client, + ServiceDeployment: &item, + } + } + } + return +} + +type GlobalServiceDeployment struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceDeployment +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceDeployment) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceDeploymentByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceDeployment = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceDeployment) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceDeploymentByName(ctx, obj.ServiceDeployment) + if err != nil { + return err + } + obj.ServiceDeployment = result.ServiceDeployment + return nil +} + +func (obj *GlobalServiceDeployment) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +// GetAllContainers returns all children of given type +func (obj *GlobalServiceDeployment) GetAllContainers(ctx context.Context) ( + result []*GlobalServiceDeploymentContainer, err error) { + result = make([]*GlobalServiceDeploymentContainer, 0, len(obj.Spec.ContainersGvk)) + for _, v := range obj.Spec.ContainersGvk { + l, err := obj.client.Global().GetServiceDeploymentContainerByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetContainers returns child which has given displayName +func (obj *GlobalServiceDeployment) GetContainers(ctx context.Context, + displayName string) (result *GlobalServiceDeploymentContainer, err error) { + l, ok := obj.Spec.ContainersGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ServiceDeployment", "Containers", displayName) + } + result, err = obj.client.Global().GetServiceDeploymentContainerByName(ctx, l.Name) + return +} + +// AddContainers calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalServiceDeployment) AddContainers(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDeploymentContainer) (result *GlobalServiceDeploymentContainer, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["servicedeployments.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["servicedeployments.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceDeploymentContainerByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetServiceDeploymentByName(ctx, obj.GetName()) + if getErr == nil { + obj.ServiceDeployment = updatedObj.ServiceDeployment + } + return +} + +// DeleteContainers calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalServiceDeployment) DeleteContainers(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ContainersGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ServiceDeployment", "Containers", displayName) + } + err = obj.client.Global().DeleteServiceDeploymentContainerByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetServiceDeploymentByName(ctx, obj.GetName()) + if err == nil { + obj.ServiceDeployment = updatedObj.ServiceDeployment + } + return +} + +// GetAllServiceInstances returns all links of given type +func (obj *GlobalServiceDeployment) GetAllServiceInstances(ctx context.Context) ( + result []*GlobalServiceInstance, err error) { + result = make([]*GlobalServiceInstance, 0, len(obj.Spec.ServiceInstancesGvk)) + for _, v := range obj.Spec.ServiceInstancesGvk { + l, err := obj.client.Global().GetServiceInstanceByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceInstances returns link which has given displayName +func (obj *GlobalServiceDeployment) GetServiceInstances(ctx context.Context, + displayName string) (result *GlobalServiceInstance, err error) { + l, ok := obj.Spec.ServiceInstancesGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ServiceDeployment", "ServiceInstances", displayName) + } + result, err = obj.client.Global().GetServiceInstanceByName(ctx, l.Name) + return +} + +// LinkServiceInstances links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalServiceDeployment) LinkServiceInstances(ctx context.Context, + linkToAdd *GlobalServiceInstance) error { + + payload := "{\"spec\": {\"serviceInstancesGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceInstance\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ServiceDeployments().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ServiceDeployment = result + return nil +} + +// UnlinkServiceInstances unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalServiceDeployment) UnlinkServiceInstances(ctx context.Context, + linkToRemove *GlobalServiceInstance) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceInstancesGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ServiceDeployments().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ServiceDeployment = result + return nil + +} + +// GetAllServiceReplicaSet returns all links of given type +func (obj *GlobalServiceDeployment) GetAllServiceReplicaSet(ctx context.Context) ( + result []*GlobalServiceReplicaSet, err error) { + result = make([]*GlobalServiceReplicaSet, 0, len(obj.Spec.ServiceReplicaSetGvk)) + for _, v := range obj.Spec.ServiceReplicaSetGvk { + l, err := obj.client.Global().GetServiceReplicaSetByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceReplicaSet returns link which has given displayName +func (obj *GlobalServiceDeployment) GetServiceReplicaSet(ctx context.Context, + displayName string) (result *GlobalServiceReplicaSet, err error) { + l, ok := obj.Spec.ServiceReplicaSetGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ServiceDeployment", "ServiceReplicaSet", displayName) + } + result, err = obj.client.Global().GetServiceReplicaSetByName(ctx, l.Name) + return +} + +// LinkServiceReplicaSet links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalServiceDeployment) LinkServiceReplicaSet(ctx context.Context, + linkToAdd *GlobalServiceReplicaSet) error { + + payload := "{\"spec\": {\"serviceReplicaSetGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceReplicaSet\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ServiceDeployments().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ServiceDeployment = result + return nil +} + +// UnlinkServiceReplicaSet unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalServiceDeployment) UnlinkServiceReplicaSet(ctx context.Context, + linkToRemove *GlobalServiceReplicaSet) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceReplicaSetGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ServiceDeployments().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ServiceDeployment = result + return nil + +} + +type servicedeploymentGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *servicedeploymentGlobalTsmV1Chainer) Subscribe() { + key := "servicedeployments.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceDeploymentInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *servicedeploymentGlobalTsmV1Chainer) Unsubscribe() { + key := "servicedeployments.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *servicedeploymentGlobalTsmV1Chainer) IsSubscribed() bool { + key := "servicedeployments.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *servicedeploymentGlobalTsmV1Chainer) Containers(name string) *servicedeploymentcontainerGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["servicedeploymentcontainers.global.tsm.tanzu.vmware.com"] = name + return &servicedeploymentcontainerGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetContainers calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *servicedeploymentGlobalTsmV1Chainer) GetContainers(ctx context.Context, displayName string) (result *GlobalServiceDeploymentContainer, err error) { + hashedName := helper.GetHashedName("servicedeploymentcontainers.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceDeploymentContainerByName(ctx, hashedName) +} + +// AddContainers calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *servicedeploymentGlobalTsmV1Chainer) AddContainers(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDeploymentContainer) (result *GlobalServiceDeploymentContainer, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicedeploymentcontainers.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceDeploymentContainerByName(ctx, objToCreate) +} + +// DeleteContainers calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *servicedeploymentGlobalTsmV1Chainer) DeleteContainers(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicedeploymentcontainers.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceDeploymentContainerByName(ctx, hashedName) +} + +// GetServiceDirectoryEntryConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceDirectoryEntryConfigByName(ctx context.Context, hashedName string) (*GlobalServiceDirectoryEntryConfig, error) { + key := "servicedirectoryentryconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig) + return &GlobalServiceDirectoryEntryConfig{ + client: group.client, + ServiceDirectoryEntryConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryEntryConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceDirectoryEntryConfig{ + client: group.client, + ServiceDirectoryEntryConfig: result, + }, nil + } +} + +// DeleteServiceDirectoryEntryConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceDirectoryEntryConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryEntryConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryEntryConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/entriesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["servicedirectoryns.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("servicedirectoryns.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryNs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceDirectoryEntryConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceDirectoryEntryConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig) (*GlobalServiceDirectoryEntryConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryEntryConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["servicedirectoryns.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("servicedirectoryns.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"entriesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceDirectoryEntryConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryNs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceDirectoryEntryConfig{ + client: group.client, + ServiceDirectoryEntryConfig: result, + }, nil +} + +// UpdateServiceDirectoryEntryConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceDirectoryEntryConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig) (*GlobalServiceDirectoryEntryConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryEntryConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryEntryConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceDirectoryEntryConfig{ + client: group.client, + ServiceDirectoryEntryConfig: result, + }, nil +} + +// ListServiceDirectoryEntryConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceDirectoryEntryConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceDirectoryEntryConfig, err error) { + key := "servicedirectoryentryconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceDirectoryEntryConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig) + result[k] = &GlobalServiceDirectoryEntryConfig{ + client: group.client, + ServiceDirectoryEntryConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceDirectoryEntryConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceDirectoryEntryConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceDirectoryEntryConfig{ + client: group.client, + ServiceDirectoryEntryConfig: &item, + } + } + } + return +} + +type GlobalServiceDirectoryEntryConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceDirectoryEntryConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceDirectoryEntryConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceDirectoryEntryConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceDirectoryEntryConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceDirectoryEntryConfigByName(ctx, obj.ServiceDirectoryEntryConfig) + if err != nil { + return err + } + obj.ServiceDirectoryEntryConfig = result.ServiceDirectoryEntryConfig + return nil +} + +func (obj *GlobalServiceDirectoryEntryConfig) GetParent(ctx context.Context) (result *GlobalServiceDirectoryN, err error) { + hashedName := helper.GetHashedName("servicedirectoryns.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["servicedirectoryns.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetServiceDirectoryNByName(ctx, hashedName) +} + +type servicedirectoryentryconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *servicedirectoryentryconfigGlobalTsmV1Chainer) Subscribe() { + key := "servicedirectoryentryconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceDirectoryEntryConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *servicedirectoryentryconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "servicedirectoryentryconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *servicedirectoryentryconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "servicedirectoryentryconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetServiceDirectoryRTFolderEntryByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceDirectoryRTFolderEntryByName(ctx context.Context, hashedName string) (*GlobalServiceDirectoryRTFolderEntry, error) { + key := "servicedirectoryrtfolderentries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry) + return &GlobalServiceDirectoryRTFolderEntry{ + client: group.client, + ServiceDirectoryRTFolderEntry: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTFolderEntries().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceDirectoryRTFolderEntry{ + client: group.client, + ServiceDirectoryRTFolderEntry: result, + }, nil + } +} + +// DeleteServiceDirectoryRTFolderEntryByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceDirectoryRTFolderEntryByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTFolderEntries().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTFolderEntries().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceDirectoryRTFolderEntryGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["servicedirectoryrtfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("servicedirectoryrtfolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceDirectoryRTFolderEntryByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceDirectoryRTFolderEntryByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry) (*GlobalServiceDirectoryRTFolderEntry, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTFolderEntries().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["servicedirectoryrtfolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("servicedirectoryrtfolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceDirectoryRTFolderEntryGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceDirectoryRTFolderEntry\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceDirectoryRTFolderEntry{ + client: group.client, + ServiceDirectoryRTFolderEntry: result, + }, nil +} + +// UpdateServiceDirectoryRTFolderEntryByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceDirectoryRTFolderEntryByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry) (*GlobalServiceDirectoryRTFolderEntry, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTFolderEntries().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + patchValueSpec_type := + objToUpdate.Spec.Spec_type + patchOpSpec_type := PatchOp{ + Op: "replace", + Path: "/spec/spec_type", + Value: patchValueSpec_type, + } + patch = append(patch, patchOpSpec_type) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTFolderEntries().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceDirectoryRTFolderEntry{ + client: group.client, + ServiceDirectoryRTFolderEntry: result, + }, nil +} + +// ListServiceDirectoryRTFolderEntries returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceDirectoryRTFolderEntries(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceDirectoryRTFolderEntry, err error) { + key := "servicedirectoryrtfolderentries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceDirectoryRTFolderEntry, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry) + result[k] = &GlobalServiceDirectoryRTFolderEntry{ + client: group.client, + ServiceDirectoryRTFolderEntry: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceDirectoryRTFolderEntries().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceDirectoryRTFolderEntry, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceDirectoryRTFolderEntry{ + client: group.client, + ServiceDirectoryRTFolderEntry: &item, + } + } + } + return +} + +type GlobalServiceDirectoryRTFolderEntry struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceDirectoryRTFolderEntry) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceDirectoryRTFolderEntryByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceDirectoryRTFolderEntry = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceDirectoryRTFolderEntry) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceDirectoryRTFolderEntryByName(ctx, obj.ServiceDirectoryRTFolderEntry) + if err != nil { + return err + } + obj.ServiceDirectoryRTFolderEntry = result.ServiceDirectoryRTFolderEntry + return nil +} + +func (obj *GlobalServiceDirectoryRTFolderEntry) GetParent(ctx context.Context) (result *GlobalServiceDirectoryRTFolder, err error) { + hashedName := helper.GetHashedName("servicedirectoryrtfolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["servicedirectoryrtfolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetServiceDirectoryRTFolderByName(ctx, hashedName) +} + +type servicedirectoryrtfolderentryGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *servicedirectoryrtfolderentryGlobalTsmV1Chainer) Subscribe() { + key := "servicedirectoryrtfolderentries.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceDirectoryRTFolderEntryInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *servicedirectoryrtfolderentryGlobalTsmV1Chainer) Unsubscribe() { + key := "servicedirectoryrtfolderentries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *servicedirectoryrtfolderentryGlobalTsmV1Chainer) IsSubscribed() bool { + key := "servicedirectoryrtfolderentries.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetServiceDirectoryRTFolderByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceDirectoryRTFolderByName(ctx context.Context, hashedName string) (*GlobalServiceDirectoryRTFolder, error) { + key := "servicedirectoryrtfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder) + return &GlobalServiceDirectoryRTFolder{ + client: group.client, + ServiceDirectoryRTFolder: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceDirectoryRTFolder{ + client: group.client, + ServiceDirectoryRTFolder: result, + }, nil + } +} + +// DeleteServiceDirectoryRTFolderByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceDirectoryRTFolderByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.ServiceDirectoryRTFolderEntryGvk { + err := group.client. + Global().DeleteServiceDirectoryRTFolderEntryByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTFolders().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceDirectoryRTFolderGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["servicedirectoryrts.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("servicedirectoryrts.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceDirectoryRTFolderByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceDirectoryRTFolderByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder) (*GlobalServiceDirectoryRTFolder, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ServiceDirectoryRTFolderEntryGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTFolders().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["servicedirectoryrts.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("servicedirectoryrts.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceDirectoryRTFolderGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceDirectoryRTFolder\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceDirectoryRTFolder{ + client: group.client, + ServiceDirectoryRTFolder: result, + }, nil +} + +// UpdateServiceDirectoryRTFolderByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceDirectoryRTFolderByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder) (*GlobalServiceDirectoryRTFolder, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTFolders().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTFolders().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceDirectoryRTFolder{ + client: group.client, + ServiceDirectoryRTFolder: result, + }, nil +} + +// ListServiceDirectoryRTFolders returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceDirectoryRTFolders(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceDirectoryRTFolder, err error) { + key := "servicedirectoryrtfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceDirectoryRTFolder, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder) + result[k] = &GlobalServiceDirectoryRTFolder{ + client: group.client, + ServiceDirectoryRTFolder: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceDirectoryRTFolders().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceDirectoryRTFolder, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceDirectoryRTFolder{ + client: group.client, + ServiceDirectoryRTFolder: &item, + } + } + } + return +} + +type GlobalServiceDirectoryRTFolder struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceDirectoryRTFolder) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceDirectoryRTFolderByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceDirectoryRTFolder = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceDirectoryRTFolder) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceDirectoryRTFolderByName(ctx, obj.ServiceDirectoryRTFolder) + if err != nil { + return err + } + obj.ServiceDirectoryRTFolder = result.ServiceDirectoryRTFolder + return nil +} + +func (obj *GlobalServiceDirectoryRTFolder) GetParent(ctx context.Context) (result *GlobalServiceDirectoryRT, err error) { + hashedName := helper.GetHashedName("servicedirectoryrts.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["servicedirectoryrts.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetServiceDirectoryRTByName(ctx, hashedName) +} + +// GetAllServiceDirectoryRTFolderEntry returns all children of given type +func (obj *GlobalServiceDirectoryRTFolder) GetAllServiceDirectoryRTFolderEntry(ctx context.Context) ( + result []*GlobalServiceDirectoryRTFolderEntry, err error) { + result = make([]*GlobalServiceDirectoryRTFolderEntry, 0, len(obj.Spec.ServiceDirectoryRTFolderEntryGvk)) + for _, v := range obj.Spec.ServiceDirectoryRTFolderEntryGvk { + l, err := obj.client.Global().GetServiceDirectoryRTFolderEntryByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceDirectoryRTFolderEntry returns child which has given displayName +func (obj *GlobalServiceDirectoryRTFolder) GetServiceDirectoryRTFolderEntry(ctx context.Context, + displayName string) (result *GlobalServiceDirectoryRTFolderEntry, err error) { + l, ok := obj.Spec.ServiceDirectoryRTFolderEntryGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ServiceDirectoryRTFolder", "ServiceDirectoryRTFolderEntry", displayName) + } + result, err = obj.client.Global().GetServiceDirectoryRTFolderEntryByName(ctx, l.Name) + return +} + +// AddServiceDirectoryRTFolderEntry calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalServiceDirectoryRTFolder) AddServiceDirectoryRTFolderEntry(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry) (result *GlobalServiceDirectoryRTFolderEntry, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["servicedirectoryrtfolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["servicedirectoryrtfolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceDirectoryRTFolderEntryByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetServiceDirectoryRTFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.ServiceDirectoryRTFolder = updatedObj.ServiceDirectoryRTFolder + } + return +} + +// DeleteServiceDirectoryRTFolderEntry calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalServiceDirectoryRTFolder) DeleteServiceDirectoryRTFolderEntry(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceDirectoryRTFolderEntryGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ServiceDirectoryRTFolder", "ServiceDirectoryRTFolderEntry", displayName) + } + err = obj.client.Global().DeleteServiceDirectoryRTFolderEntryByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetServiceDirectoryRTFolderByName(ctx, obj.GetName()) + if err == nil { + obj.ServiceDirectoryRTFolder = updatedObj.ServiceDirectoryRTFolder + } + return +} + +type servicedirectoryrtfolderGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *servicedirectoryrtfolderGlobalTsmV1Chainer) Subscribe() { + key := "servicedirectoryrtfolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceDirectoryRTFolderInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *servicedirectoryrtfolderGlobalTsmV1Chainer) Unsubscribe() { + key := "servicedirectoryrtfolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *servicedirectoryrtfolderGlobalTsmV1Chainer) IsSubscribed() bool { + key := "servicedirectoryrtfolders.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *servicedirectoryrtfolderGlobalTsmV1Chainer) ServiceDirectoryRTFolderEntry(name string) *servicedirectoryrtfolderentryGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["servicedirectoryrtfolderentries.global.tsm.tanzu.vmware.com"] = name + return &servicedirectoryrtfolderentryGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceDirectoryRTFolderEntry calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *servicedirectoryrtfolderGlobalTsmV1Chainer) GetServiceDirectoryRTFolderEntry(ctx context.Context, displayName string) (result *GlobalServiceDirectoryRTFolderEntry, err error) { + hashedName := helper.GetHashedName("servicedirectoryrtfolderentries.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceDirectoryRTFolderEntryByName(ctx, hashedName) +} + +// AddServiceDirectoryRTFolderEntry calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *servicedirectoryrtfolderGlobalTsmV1Chainer) AddServiceDirectoryRTFolderEntry(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolderEntry) (result *GlobalServiceDirectoryRTFolderEntry, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicedirectoryrtfolderentries.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceDirectoryRTFolderEntryByName(ctx, objToCreate) +} + +// DeleteServiceDirectoryRTFolderEntry calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *servicedirectoryrtfolderGlobalTsmV1Chainer) DeleteServiceDirectoryRTFolderEntry(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicedirectoryrtfolderentries.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceDirectoryRTFolderEntryByName(ctx, hashedName) +} + +// GetServiceDirectoryRTByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceDirectoryRTByName(ctx context.Context, hashedName string) (*GlobalServiceDirectoryRT, error) { + key := "servicedirectoryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRT) + return &GlobalServiceDirectoryRT{ + client: group.client, + ServiceDirectoryRT: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceDirectoryRT{ + client: group.client, + ServiceDirectoryRT: result, + }, nil + } +} + +// DeleteServiceDirectoryRTByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceDirectoryRTByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.ServiceDirectoryRTFolderGvk { + err := group.client. + Global().DeleteServiceDirectoryRTFolderByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceDirectoryRTGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceDirectoryRTByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceDirectoryRTByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRT) (*GlobalServiceDirectoryRT, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] == "" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToCreate.Labels[common.DISPLAY_NAME_LABEL]) + } + + objToCreate.Spec.ServiceDirectoryRTFolderGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/serviceDirectoryRTGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ServiceDirectoryRT", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceDirectoryRT{ + client: group.client, + ServiceDirectoryRT: result, + }, nil +} + +// UpdateServiceDirectoryRTByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceDirectoryRTByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRT) (*GlobalServiceDirectoryRT, error) { + if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) + } + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryRTs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceDirectoryRT{ + client: group.client, + ServiceDirectoryRT: result, + }, nil +} + +// ListServiceDirectoryRTs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceDirectoryRTs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceDirectoryRT, err error) { + key := "servicedirectoryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceDirectoryRT, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRT) + result[k] = &GlobalServiceDirectoryRT{ + client: group.client, + ServiceDirectoryRT: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceDirectoryRTs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceDirectoryRT, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceDirectoryRT{ + client: group.client, + ServiceDirectoryRT: &item, + } + } + } + return +} + +type GlobalServiceDirectoryRT struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRT +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceDirectoryRT) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceDirectoryRTByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceDirectoryRT = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceDirectoryRT) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceDirectoryRTByName(ctx, obj.ServiceDirectoryRT) + if err != nil { + return err + } + obj.ServiceDirectoryRT = result.ServiceDirectoryRT + return nil +} + +func (obj *GlobalServiceDirectoryRT) GetParent(ctx context.Context) (result *GlobalRuntime, err error) { + hashedName := helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["runtimes.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetRuntimeByName(ctx, hashedName) +} + +// GetAllServiceDirectoryRTFolder returns all children of given type +func (obj *GlobalServiceDirectoryRT) GetAllServiceDirectoryRTFolder(ctx context.Context) ( + result []*GlobalServiceDirectoryRTFolder, err error) { + result = make([]*GlobalServiceDirectoryRTFolder, 0, len(obj.Spec.ServiceDirectoryRTFolderGvk)) + for _, v := range obj.Spec.ServiceDirectoryRTFolderGvk { + l, err := obj.client.Global().GetServiceDirectoryRTFolderByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceDirectoryRTFolder returns child which has given displayName +func (obj *GlobalServiceDirectoryRT) GetServiceDirectoryRTFolder(ctx context.Context, + displayName string) (result *GlobalServiceDirectoryRTFolder, err error) { + l, ok := obj.Spec.ServiceDirectoryRTFolderGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ServiceDirectoryRT", "ServiceDirectoryRTFolder", displayName) + } + result, err = obj.client.Global().GetServiceDirectoryRTFolderByName(ctx, l.Name) + return +} + +// AddServiceDirectoryRTFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalServiceDirectoryRT) AddServiceDirectoryRTFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder) (result *GlobalServiceDirectoryRTFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["servicedirectoryrts.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["servicedirectoryrts.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceDirectoryRTFolderByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetServiceDirectoryRTByName(ctx, obj.GetName()) + if getErr == nil { + obj.ServiceDirectoryRT = updatedObj.ServiceDirectoryRT + } + return +} + +// DeleteServiceDirectoryRTFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalServiceDirectoryRT) DeleteServiceDirectoryRTFolder(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceDirectoryRTFolderGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ServiceDirectoryRT", "ServiceDirectoryRTFolder", displayName) + } + err = obj.client.Global().DeleteServiceDirectoryRTFolderByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetServiceDirectoryRTByName(ctx, obj.GetName()) + if err == nil { + obj.ServiceDirectoryRT = updatedObj.ServiceDirectoryRT + } + return +} + +type servicedirectoryrtGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *servicedirectoryrtGlobalTsmV1Chainer) Subscribe() { + key := "servicedirectoryrts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceDirectoryRTInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *servicedirectoryrtGlobalTsmV1Chainer) Unsubscribe() { + key := "servicedirectoryrts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *servicedirectoryrtGlobalTsmV1Chainer) IsSubscribed() bool { + key := "servicedirectoryrts.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *servicedirectoryrtGlobalTsmV1Chainer) ServiceDirectoryRTFolder(name string) *servicedirectoryrtfolderGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["servicedirectoryrtfolders.global.tsm.tanzu.vmware.com"] = name + return &servicedirectoryrtfolderGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceDirectoryRTFolder calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *servicedirectoryrtGlobalTsmV1Chainer) GetServiceDirectoryRTFolder(ctx context.Context, displayName string) (result *GlobalServiceDirectoryRTFolder, err error) { + hashedName := helper.GetHashedName("servicedirectoryrtfolders.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceDirectoryRTFolderByName(ctx, hashedName) +} + +// AddServiceDirectoryRTFolder calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *servicedirectoryrtGlobalTsmV1Chainer) AddServiceDirectoryRTFolder(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryRTFolder) (result *GlobalServiceDirectoryRTFolder, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicedirectoryrtfolders.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceDirectoryRTFolderByName(ctx, objToCreate) +} + +// DeleteServiceDirectoryRTFolder calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *servicedirectoryrtGlobalTsmV1Chainer) DeleteServiceDirectoryRTFolder(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicedirectoryrtfolders.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceDirectoryRTFolderByName(ctx, hashedName) +} + +// GetServiceDirectoryNByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceDirectoryNByName(ctx context.Context, hashedName string) (*GlobalServiceDirectoryN, error) { + key := "servicedirectoryns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryN) + return &GlobalServiceDirectoryN{ + client: group.client, + ServiceDirectoryN: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryNs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceDirectoryN{ + client: group.client, + ServiceDirectoryN: result, + }, nil + } +} + +// DeleteServiceDirectoryNByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceDirectoryNByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryNs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.EntriesGvk { + err := group.client. + Global().DeleteServiceDirectoryEntryConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryNs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceDirectoryGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceDirectoryNByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceDirectoryNByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryN) (*GlobalServiceDirectoryN, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.EntriesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryNs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceDirectoryGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceDirectoryN\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceDirectoryN{ + client: group.client, + ServiceDirectoryN: result, + }, nil +} + +// UpdateServiceDirectoryNByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceDirectoryNByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryN) (*GlobalServiceDirectoryN, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryNs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceDirectoryNs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceDirectoryN{ + client: group.client, + ServiceDirectoryN: result, + }, nil +} + +// ListServiceDirectoryNs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceDirectoryNs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceDirectoryN, err error) { + key := "servicedirectoryns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceDirectoryN, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryN) + result[k] = &GlobalServiceDirectoryN{ + client: group.client, + ServiceDirectoryN: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceDirectoryNs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceDirectoryN, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceDirectoryN{ + client: group.client, + ServiceDirectoryN: &item, + } + } + } + return +} + +type GlobalServiceDirectoryN struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryN +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceDirectoryN) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceDirectoryNByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceDirectoryN = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceDirectoryN) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceDirectoryNByName(ctx, obj.ServiceDirectoryN) + if err != nil { + return err + } + obj.ServiceDirectoryN = result.ServiceDirectoryN + return nil +} + +func (obj *GlobalServiceDirectoryN) GetParent(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetConfigByName(ctx, hashedName) +} + +// GetAllEntries returns all children of given type +func (obj *GlobalServiceDirectoryN) GetAllEntries(ctx context.Context) ( + result []*GlobalServiceDirectoryEntryConfig, err error) { + result = make([]*GlobalServiceDirectoryEntryConfig, 0, len(obj.Spec.EntriesGvk)) + for _, v := range obj.Spec.EntriesGvk { + l, err := obj.client.Global().GetServiceDirectoryEntryConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetEntries returns child which has given displayName +func (obj *GlobalServiceDirectoryN) GetEntries(ctx context.Context, + displayName string) (result *GlobalServiceDirectoryEntryConfig, err error) { + l, ok := obj.Spec.EntriesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ServiceDirectoryN", "Entries", displayName) + } + result, err = obj.client.Global().GetServiceDirectoryEntryConfigByName(ctx, l.Name) + return +} + +// AddEntries calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalServiceDirectoryN) AddEntries(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig) (result *GlobalServiceDirectoryEntryConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["servicedirectoryns.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["servicedirectoryns.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceDirectoryEntryConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetServiceDirectoryNByName(ctx, obj.GetName()) + if getErr == nil { + obj.ServiceDirectoryN = updatedObj.ServiceDirectoryN + } + return +} + +// DeleteEntries calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalServiceDirectoryN) DeleteEntries(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.EntriesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ServiceDirectoryN", "Entries", displayName) + } + err = obj.client.Global().DeleteServiceDirectoryEntryConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetServiceDirectoryNByName(ctx, obj.GetName()) + if err == nil { + obj.ServiceDirectoryN = updatedObj.ServiceDirectoryN + } + return +} + +type servicedirectorynGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *servicedirectorynGlobalTsmV1Chainer) Subscribe() { + key := "servicedirectoryns.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceDirectoryNInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *servicedirectorynGlobalTsmV1Chainer) Unsubscribe() { + key := "servicedirectoryns.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *servicedirectorynGlobalTsmV1Chainer) IsSubscribed() bool { + key := "servicedirectoryns.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *servicedirectorynGlobalTsmV1Chainer) Entries(name string) *servicedirectoryentryconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["servicedirectoryentryconfigs.global.tsm.tanzu.vmware.com"] = name + return &servicedirectoryentryconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetEntries calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *servicedirectorynGlobalTsmV1Chainer) GetEntries(ctx context.Context, displayName string) (result *GlobalServiceDirectoryEntryConfig, err error) { + hashedName := helper.GetHashedName("servicedirectoryentryconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceDirectoryEntryConfigByName(ctx, hashedName) +} + +// AddEntries calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *servicedirectorynGlobalTsmV1Chainer) AddEntries(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceDirectoryEntryConfig) (result *GlobalServiceDirectoryEntryConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicedirectoryentryconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceDirectoryEntryConfigByName(ctx, objToCreate) +} + +// DeleteEntries calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *servicedirectorynGlobalTsmV1Chainer) DeleteEntries(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicedirectoryentryconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceDirectoryEntryConfigByName(ctx, hashedName) +} + +// GetServiceEntryConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceEntryConfigByName(ctx context.Context, hashedName string) (*GlobalServiceEntryConfig, error) { + key := "serviceentryconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceEntryConfig) + return &GlobalServiceEntryConfig{ + client: group.client, + ServiceEntryConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceEntryConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceEntryConfig{ + client: group.client, + ServiceEntryConfig: result, + }, nil + } +} + +// DeleteServiceEntryConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceEntryConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceEntryConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceEntryConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceEntriesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceEntryConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceEntryConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceEntryConfig) (*GlobalServiceEntryConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceEntryConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceEntriesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceEntryConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceEntryConfig{ + client: group.client, + ServiceEntryConfig: result, + }, nil +} + +// UpdateServiceEntryConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceEntryConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceEntryConfig) (*GlobalServiceEntryConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceEntryConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueOwnedBy := + objToUpdate.Spec.OwnedBy + patchOpOwnedBy := PatchOp{ + Op: "replace", + Path: "/spec/ownedBy", + Value: patchValueOwnedBy, + } + patch = append(patch, patchOpOwnedBy) + + patchValueService := + objToUpdate.Spec.Service + patchOpService := PatchOp{ + Op: "replace", + Path: "/spec/service", + Value: patchValueService, + } + patch = append(patch, patchOpService) + + patchValueServiceFQDN := + objToUpdate.Spec.ServiceFQDN + patchOpServiceFQDN := PatchOp{ + Op: "replace", + Path: "/spec/serviceFQDN", + Value: patchValueServiceFQDN, + } + patch = append(patch, patchOpServiceFQDN) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueServicePortList := + objToUpdate.Spec.ServicePortList + patchOpServicePortList := PatchOp{ + Op: "replace", + Path: "/spec/servicePortList", + Value: patchValueServicePortList, + } + patch = append(patch, patchOpServicePortList) + + if objToUpdate.Spec.Tags != nil { + patchValueTags := + objToUpdate.Spec.Tags + patchOpTags := PatchOp{ + Op: "replace", + Path: "/spec/tags", + Value: patchValueTags, + } + patch = append(patch, patchOpTags) + } + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + if objToUpdate.Spec.Endpoints != nil { + patchValueEndpoints := + objToUpdate.Spec.Endpoints + patchOpEndpoints := PatchOp{ + Op: "replace", + Path: "/spec/endpoints", + Value: patchValueEndpoints, + } + patch = append(patch, patchOpEndpoints) + } + + patchValueEndpointList := + objToUpdate.Spec.EndpointList + patchOpEndpointList := PatchOp{ + Op: "replace", + Path: "/spec/endpointList", + Value: patchValueEndpointList, + } + patch = append(patch, patchOpEndpointList) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceEntryConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceEntryConfig{ + client: group.client, + ServiceEntryConfig: result, + }, nil +} + +// ListServiceEntryConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceEntryConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceEntryConfig, err error) { + key := "serviceentryconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceEntryConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceEntryConfig) + result[k] = &GlobalServiceEntryConfig{ + client: group.client, + ServiceEntryConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceEntryConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceEntryConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceEntryConfig{ + client: group.client, + ServiceEntryConfig: &item, + } + } + } + return +} + +type GlobalServiceEntryConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceEntryConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceEntryConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceEntryConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceEntryConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceEntryConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceEntryConfigByName(ctx, obj.ServiceEntryConfig) + if err != nil { + return err + } + obj.ServiceEntryConfig = result.ServiceEntryConfig + return nil +} + +func (obj *GlobalServiceEntryConfig) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +type serviceentryconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *serviceentryconfigGlobalTsmV1Chainer) Subscribe() { + key := "serviceentryconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceEntryConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *serviceentryconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "serviceentryconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *serviceentryconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "serviceentryconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetServiceEntryByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceEntryByName(ctx context.Context, hashedName string) (*GlobalServiceEntry, error) { + key := "serviceentries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceEntry) + return &GlobalServiceEntry{ + client: group.client, + ServiceEntry: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceEntries().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceEntry{ + client: group.client, + ServiceEntry: result, + }, nil + } +} + +// DeleteServiceEntryByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceEntryByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceEntries().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceEntries().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceEntryGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceEntryByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceEntryByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceEntry) (*GlobalServiceEntry, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceEntries().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceEntryGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceEntry\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceEntry{ + client: group.client, + ServiceEntry: result, + }, nil +} + +// UpdateServiceEntryByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceEntryByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceEntry) (*GlobalServiceEntry, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceEntries().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueAnnotations := + objToUpdate.Spec.Annotations + patchOpAnnotations := PatchOp{ + Op: "replace", + Path: "/spec/annotations", + Value: patchValueAnnotations, + } + patch = append(patch, patchOpAnnotations) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueCreationTimestamp := + objToUpdate.Spec.CreationTimestamp + patchOpCreationTimestamp := PatchOp{ + Op: "replace", + Path: "/spec/creationTimestamp", + Value: patchValueCreationTimestamp, + } + patch = append(patch, patchOpCreationTimestamp) + + patchValueApiLink := + objToUpdate.Spec.ApiLink + patchOpApiLink := PatchOp{ + Op: "replace", + Path: "/spec/apiLink", + Value: patchValueApiLink, + } + patch = append(patch, patchOpApiLink) + + patchValueUid := + objToUpdate.Spec.Uid + patchOpUid := PatchOp{ + Op: "replace", + Path: "/spec/uid", + Value: patchValueUid, + } + patch = append(patch, patchOpUid) + + patchValueHosts := + objToUpdate.Spec.Hosts + patchOpHosts := PatchOp{ + Op: "replace", + Path: "/spec/hosts", + Value: patchValueHosts, + } + patch = append(patch, patchOpHosts) + + patchValueAddresses := + objToUpdate.Spec.Addresses + patchOpAddresses := PatchOp{ + Op: "replace", + Path: "/spec/addresses", + Value: patchValueAddresses, + } + patch = append(patch, patchOpAddresses) + + patchValuePorts := + objToUpdate.Spec.Ports + patchOpPorts := PatchOp{ + Op: "replace", + Path: "/spec/ports", + Value: patchValuePorts, + } + patch = append(patch, patchOpPorts) + + patchValueLocation := + objToUpdate.Spec.Location + patchOpLocation := PatchOp{ + Op: "replace", + Path: "/spec/location", + Value: patchValueLocation, + } + patch = append(patch, patchOpLocation) + + patchValueResolution := + objToUpdate.Spec.Resolution + patchOpResolution := PatchOp{ + Op: "replace", + Path: "/spec/resolution", + Value: patchValueResolution, + } + patch = append(patch, patchOpResolution) + + patchValueEndpoints := + objToUpdate.Spec.Endpoints + patchOpEndpoints := PatchOp{ + Op: "replace", + Path: "/spec/endpoints", + Value: patchValueEndpoints, + } + patch = append(patch, patchOpEndpoints) + + if objToUpdate.Spec.ExportTo != nil { + patchValueExportTo := + objToUpdate.Spec.ExportTo + patchOpExportTo := PatchOp{ + Op: "replace", + Path: "/spec/exportTo", + Value: patchValueExportTo, + } + patch = append(patch, patchOpExportTo) + } + + patchValueWorkloadSelectorLabels := + objToUpdate.Spec.WorkloadSelectorLabels + patchOpWorkloadSelectorLabels := PatchOp{ + Op: "replace", + Path: "/spec/workloadSelectorLabels", + Value: patchValueWorkloadSelectorLabels, + } + patch = append(patch, patchOpWorkloadSelectorLabels) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceEntries().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceEntry{ + client: group.client, + ServiceEntry: result, + }, nil +} + +// ListServiceEntries returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceEntries(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceEntry, err error) { + key := "serviceentries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceEntry, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceEntry) + result[k] = &GlobalServiceEntry{ + client: group.client, + ServiceEntry: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceEntries().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceEntry, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceEntry{ + client: group.client, + ServiceEntry: &item, + } + } + } + return +} + +type GlobalServiceEntry struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceEntry +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceEntry) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceEntryByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceEntry = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceEntry) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceEntryByName(ctx, obj.ServiceEntry) + if err != nil { + return err + } + obj.ServiceEntry = result.ServiceEntry + return nil +} + +func (obj *GlobalServiceEntry) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +type serviceentryGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *serviceentryGlobalTsmV1Chainer) Subscribe() { + key := "serviceentries.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceEntryInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *serviceentryGlobalTsmV1Chainer) Unsubscribe() { + key := "serviceentries.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *serviceentryGlobalTsmV1Chainer) IsSubscribed() bool { + key := "serviceentries.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetSvcGroupRTByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetSvcGroupRTByName(ctx context.Context, hashedName string) (*GlobalSvcGroupRT, error) { + key := "svcgrouprts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.SvcGroupRT) + return &GlobalSvcGroupRT{ + client: group.client, + SvcGroupRT: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + SvcGroupRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSvcGroupRT{ + client: group.client, + SvcGroupRT: result, + }, nil + } +} + +// DeleteSvcGroupRTByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteSvcGroupRTByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + SvcGroupRTs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + SvcGroupRTs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/svcGroupRTGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["resourcegrouprts.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("resourcegrouprts.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ResourceGroupRTs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateSvcGroupRTByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateSvcGroupRTByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SvcGroupRT) (*GlobalSvcGroupRT, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + SvcGroupRTs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["resourcegrouprts.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("resourcegrouprts.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"svcGroupRTGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"SvcGroupRT\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ResourceGroupRTs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSvcGroupRT{ + client: group.client, + SvcGroupRT: result, + }, nil +} + +// UpdateSvcGroupRTByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateSvcGroupRTByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.SvcGroupRT) (*GlobalSvcGroupRT, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + SvcGroupRTs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueDisplayName := + objToUpdate.Spec.DisplayName + patchOpDisplayName := PatchOp{ + Op: "replace", + Path: "/spec/displayName", + Value: patchValueDisplayName, + } + patch = append(patch, patchOpDisplayName) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueServices := + objToUpdate.Spec.Services + patchOpServices := PatchOp{ + Op: "replace", + Path: "/spec/services", + Value: patchValueServices, + } + patch = append(patch, patchOpServices) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + SvcGroupRTs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalSvcGroupRT{ + client: group.client, + SvcGroupRT: result, + }, nil +} + +// ListSvcGroupRTs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListSvcGroupRTs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalSvcGroupRT, err error) { + key := "svcgrouprts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalSvcGroupRT, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.SvcGroupRT) + result[k] = &GlobalSvcGroupRT{ + client: group.client, + SvcGroupRT: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + SvcGroupRTs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalSvcGroupRT, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalSvcGroupRT{ + client: group.client, + SvcGroupRT: &item, + } + } + } + return +} + +type GlobalSvcGroupRT struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.SvcGroupRT +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalSvcGroupRT) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteSvcGroupRTByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.SvcGroupRT = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalSvcGroupRT) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateSvcGroupRTByName(ctx, obj.SvcGroupRT) + if err != nil { + return err + } + obj.SvcGroupRT = result.SvcGroupRT + return nil +} + +func (obj *GlobalSvcGroupRT) GetParent(ctx context.Context) (result *GlobalResourceGroupRT, err error) { + hashedName := helper.GetHashedName("resourcegrouprts.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["resourcegrouprts.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetResourceGroupRTByName(ctx, hashedName) +} + +type svcgrouprtGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *svcgrouprtGlobalTsmV1Chainer) Subscribe() { + key := "svcgrouprts.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSvcGroupRTInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *svcgrouprtGlobalTsmV1Chainer) Unsubscribe() { + key := "svcgrouprts.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *svcgrouprtGlobalTsmV1Chainer) IsSubscribed() bool { + key := "svcgrouprts.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetServiceInstanceContainerByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceInstanceContainerByName(ctx context.Context, hashedName string) (*GlobalServiceInstanceContainer, error) { + key := "serviceinstancecontainers.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceInstanceContainer) + return &GlobalServiceInstanceContainer{ + client: group.client, + ServiceInstanceContainer: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceInstanceContainers().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceInstanceContainer{ + client: group.client, + ServiceInstanceContainer: result, + }, nil + } +} + +// DeleteServiceInstanceContainerByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceInstanceContainerByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceInstanceContainers().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceInstanceContainers().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/containersGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["serviceinstances.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("serviceinstances.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceInstances().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceInstanceContainerByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceInstanceContainerByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceInstanceContainer) (*GlobalServiceInstanceContainer, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceInstanceContainers().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["serviceinstances.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("serviceinstances.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"containersGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceInstanceContainer\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceInstances().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceInstanceContainer{ + client: group.client, + ServiceInstanceContainer: result, + }, nil +} + +// UpdateServiceInstanceContainerByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceInstanceContainerByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceInstanceContainer) (*GlobalServiceInstanceContainer, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceInstanceContainers().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueImage := + objToUpdate.Spec.Image + patchOpImage := PatchOp{ + Op: "replace", + Path: "/spec/image", + Value: patchValueImage, + } + patch = append(patch, patchOpImage) + + patchValueImagePullPolicy := + objToUpdate.Spec.ImagePullPolicy + patchOpImagePullPolicy := PatchOp{ + Op: "replace", + Path: "/spec/imagePullPolicy", + Value: patchValueImagePullPolicy, + } + patch = append(patch, patchOpImagePullPolicy) + + patchValueTerminationMessagePath := + objToUpdate.Spec.TerminationMessagePath + patchOpTerminationMessagePath := PatchOp{ + Op: "replace", + Path: "/spec/terminationMessagePath", + Value: patchValueTerminationMessagePath, + } + patch = append(patch, patchOpTerminationMessagePath) + + patchValueTerminationMessagePolicy := + objToUpdate.Spec.TerminationMessagePolicy + patchOpTerminationMessagePolicy := PatchOp{ + Op: "replace", + Path: "/spec/terminationMessagePolicy", + Value: patchValueTerminationMessagePolicy, + } + patch = append(patch, patchOpTerminationMessagePolicy) + + patchValueResources := + objToUpdate.Spec.Resources + patchOpResources := PatchOp{ + Op: "replace", + Path: "/spec/resources", + Value: patchValueResources, + } + patch = append(patch, patchOpResources) + + patchValueVolumeMounts := + objToUpdate.Spec.VolumeMounts + patchOpVolumeMounts := PatchOp{ + Op: "replace", + Path: "/spec/volumeMounts", + Value: patchValueVolumeMounts, + } + patch = append(patch, patchOpVolumeMounts) + + patchValueCommand := + objToUpdate.Spec.Command + patchOpCommand := PatchOp{ + Op: "replace", + Path: "/spec/command", + Value: patchValueCommand, + } + patch = append(patch, patchOpCommand) + + patchValueSecurityContext := + objToUpdate.Spec.SecurityContext + patchOpSecurityContext := PatchOp{ + Op: "replace", + Path: "/spec/securityContext", + Value: patchValueSecurityContext, + } + patch = append(patch, patchOpSecurityContext) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceInstanceContainers().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceInstanceContainer{ + client: group.client, + ServiceInstanceContainer: result, + }, nil +} + +// ListServiceInstanceContainers returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceInstanceContainers(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceInstanceContainer, err error) { + key := "serviceinstancecontainers.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceInstanceContainer, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceInstanceContainer) + result[k] = &GlobalServiceInstanceContainer{ + client: group.client, + ServiceInstanceContainer: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceInstanceContainers().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceInstanceContainer, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceInstanceContainer{ + client: group.client, + ServiceInstanceContainer: &item, + } + } + } + return +} + +type GlobalServiceInstanceContainer struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceInstanceContainer +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceInstanceContainer) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceInstanceContainerByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceInstanceContainer = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceInstanceContainer) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceInstanceContainerByName(ctx, obj.ServiceInstanceContainer) + if err != nil { + return err + } + obj.ServiceInstanceContainer = result.ServiceInstanceContainer + return nil +} + +func (obj *GlobalServiceInstanceContainer) GetParent(ctx context.Context) (result *GlobalServiceInstance, err error) { + hashedName := helper.GetHashedName("serviceinstances.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["serviceinstances.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetServiceInstanceByName(ctx, hashedName) +} + +type serviceinstancecontainerGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *serviceinstancecontainerGlobalTsmV1Chainer) Subscribe() { + key := "serviceinstancecontainers.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceInstanceContainerInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *serviceinstancecontainerGlobalTsmV1Chainer) Unsubscribe() { + key := "serviceinstancecontainers.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *serviceinstancecontainerGlobalTsmV1Chainer) IsSubscribed() bool { + key := "serviceinstancecontainers.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetServiceInstanceByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceInstanceByName(ctx context.Context, hashedName string) (*GlobalServiceInstance, error) { + key := "serviceinstances.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceInstance) + return &GlobalServiceInstance{ + client: group.client, + ServiceInstance: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceInstances().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceInstance{ + client: group.client, + ServiceInstance: result, + }, nil + } +} + +// DeleteServiceInstanceByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceInstanceByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceInstances().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.ContainersGvk { + err := group.client. + Global().DeleteServiceInstanceContainerByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceInstances().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceInstancesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceInstanceByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceInstanceByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceInstance) (*GlobalServiceInstance, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ContainersGvk = nil + objToCreate.Spec.NodeGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceInstances().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceInstancesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceInstance\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceInstance{ + client: group.client, + ServiceInstance: result, + }, nil +} + +// UpdateServiceInstanceByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceInstanceByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceInstance) (*GlobalServiceInstance, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceInstances().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + patchValueStatus := + objToUpdate.Spec.Status + patchOpStatus := PatchOp{ + Op: "replace", + Path: "/spec/status", + Value: patchValueStatus, + } + patch = append(patch, patchOpStatus) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueNamespace := + objToUpdate.Spec.Namespace + patchOpNamespace := PatchOp{ + Op: "replace", + Path: "/spec/namespace", + Value: patchValueNamespace, + } + patch = append(patch, patchOpNamespace) + + patchValueAnnotations := + objToUpdate.Spec.Annotations + patchOpAnnotations := PatchOp{ + Op: "replace", + Path: "/spec/annotations", + Value: patchValueAnnotations, + } + patch = append(patch, patchOpAnnotations) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueApiLink := + objToUpdate.Spec.ApiLink + patchOpApiLink := PatchOp{ + Op: "replace", + Path: "/spec/apiLink", + Value: patchValueApiLink, + } + patch = append(patch, patchOpApiLink) + + patchValueUid := + objToUpdate.Spec.Uid + patchOpUid := PatchOp{ + Op: "replace", + Path: "/spec/uid", + Value: patchValueUid, + } + patch = append(patch, patchOpUid) + + patchValueRestartPolicy := + objToUpdate.Spec.RestartPolicy + patchOpRestartPolicy := PatchOp{ + Op: "replace", + Path: "/spec/restartPolicy", + Value: patchValueRestartPolicy, + } + patch = append(patch, patchOpRestartPolicy) + + patchValueDnsPolicy := + objToUpdate.Spec.DnsPolicy + patchOpDnsPolicy := PatchOp{ + Op: "replace", + Path: "/spec/dnsPolicy", + Value: patchValueDnsPolicy, + } + patch = append(patch, patchOpDnsPolicy) + + patchValueHostNetwork := + objToUpdate.Spec.HostNetwork + patchOpHostNetwork := PatchOp{ + Op: "replace", + Path: "/spec/hostNetwork", + Value: patchValueHostNetwork, + } + patch = append(patch, patchOpHostNetwork) + + patchValueSecurityContext := + objToUpdate.Spec.SecurityContext + patchOpSecurityContext := PatchOp{ + Op: "replace", + Path: "/spec/securityContext", + Value: patchValueSecurityContext, + } + patch = append(patch, patchOpSecurityContext) + + patchValueTerminationGracePeriodSeconds := + objToUpdate.Spec.TerminationGracePeriodSeconds + patchOpTerminationGracePeriodSeconds := PatchOp{ + Op: "replace", + Path: "/spec/terminationGracePeriodSeconds", + Value: patchValueTerminationGracePeriodSeconds, + } + patch = append(patch, patchOpTerminationGracePeriodSeconds) + + patchValueTolerations := + objToUpdate.Spec.Tolerations + patchOpTolerations := PatchOp{ + Op: "replace", + Path: "/spec/tolerations", + Value: patchValueTolerations, + } + patch = append(patch, patchOpTolerations) + + patchValueStatusConditions := + objToUpdate.Spec.StatusConditions + patchOpStatusConditions := PatchOp{ + Op: "replace", + Path: "/spec/statusConditions", + Value: patchValueStatusConditions, + } + patch = append(patch, patchOpStatusConditions) + + patchValueStatusContainer := + objToUpdate.Spec.StatusContainer + patchOpStatusContainer := PatchOp{ + Op: "replace", + Path: "/spec/statusContainer", + Value: patchValueStatusContainer, + } + patch = append(patch, patchOpStatusContainer) + + patchValuePodIP := + objToUpdate.Spec.PodIP + patchOpPodIP := PatchOp{ + Op: "replace", + Path: "/spec/podIP", + Value: patchValuePodIP, + } + patch = append(patch, patchOpPodIP) + + patchValueQosClass := + objToUpdate.Spec.QosClass + patchOpQosClass := PatchOp{ + Op: "replace", + Path: "/spec/qosClass", + Value: patchValueQosClass, + } + patch = append(patch, patchOpQosClass) + + patchValuePhase := + objToUpdate.Spec.Phase + patchOpPhase := PatchOp{ + Op: "replace", + Path: "/spec/phase", + Value: patchValuePhase, + } + patch = append(patch, patchOpPhase) + + patchValueStartTime := + objToUpdate.Spec.StartTime + patchOpStartTime := PatchOp{ + Op: "replace", + Path: "/spec/startTime", + Value: patchValueStartTime, + } + patch = append(patch, patchOpStartTime) + + patchValueNodeName := + objToUpdate.Spec.NodeName + patchOpNodeName := PatchOp{ + Op: "replace", + Path: "/spec/nodeName", + Value: patchValueNodeName, + } + patch = append(patch, patchOpNodeName) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceInstances().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceInstance{ + client: group.client, + ServiceInstance: result, + }, nil +} + +// ListServiceInstances returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceInstances(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceInstance, err error) { + key := "serviceinstances.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceInstance, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceInstance) + result[k] = &GlobalServiceInstance{ + client: group.client, + ServiceInstance: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceInstances().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceInstance, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceInstance{ + client: group.client, + ServiceInstance: &item, + } + } + } + return +} + +type GlobalServiceInstance struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceInstance +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceInstance) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceInstanceByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceInstance = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceInstance) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceInstanceByName(ctx, obj.ServiceInstance) + if err != nil { + return err + } + obj.ServiceInstance = result.ServiceInstance + return nil +} + +func (obj *GlobalServiceInstance) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +// GetAllContainers returns all children of given type +func (obj *GlobalServiceInstance) GetAllContainers(ctx context.Context) ( + result []*GlobalServiceInstanceContainer, err error) { + result = make([]*GlobalServiceInstanceContainer, 0, len(obj.Spec.ContainersGvk)) + for _, v := range obj.Spec.ContainersGvk { + l, err := obj.client.Global().GetServiceInstanceContainerByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetContainers returns child which has given displayName +func (obj *GlobalServiceInstance) GetContainers(ctx context.Context, + displayName string) (result *GlobalServiceInstanceContainer, err error) { + l, ok := obj.Spec.ContainersGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ServiceInstance", "Containers", displayName) + } + result, err = obj.client.Global().GetServiceInstanceContainerByName(ctx, l.Name) + return +} + +// AddContainers calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalServiceInstance) AddContainers(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceInstanceContainer) (result *GlobalServiceInstanceContainer, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["serviceinstances.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["serviceinstances.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceInstanceContainerByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetServiceInstanceByName(ctx, obj.GetName()) + if getErr == nil { + obj.ServiceInstance = updatedObj.ServiceInstance + } + return +} + +// DeleteContainers calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalServiceInstance) DeleteContainers(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ContainersGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ServiceInstance", "Containers", displayName) + } + err = obj.client.Global().DeleteServiceInstanceContainerByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetServiceInstanceByName(ctx, obj.GetName()) + if err == nil { + obj.ServiceInstance = updatedObj.ServiceInstance + } + return +} + +// GetNode returns link of given type +func (obj *GlobalServiceInstance) GetNode(ctx context.Context) ( + result *GlobalNode, err error) { + if obj.Spec.NodeGvk == nil { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ServiceInstance", "Node") + } + return obj.client.Global().GetNodeByName(ctx, obj.Spec.NodeGvk.Name) +} + +// LinkNode links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalServiceInstance) LinkNode(ctx context.Context, + linkToAdd *GlobalNode) error { + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/nodeGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "Node", + Name: linkToAdd.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ServiceInstances().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ServiceInstance = result + return nil +} + +// UnlinkNode unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalServiceInstance) UnlinkNode(ctx context.Context) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/nodeGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ServiceInstances().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ServiceInstance = result + return nil + +} + +type serviceinstanceGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *serviceinstanceGlobalTsmV1Chainer) Subscribe() { + key := "serviceinstances.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceInstanceInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *serviceinstanceGlobalTsmV1Chainer) Unsubscribe() { + key := "serviceinstances.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *serviceinstanceGlobalTsmV1Chainer) IsSubscribed() bool { + key := "serviceinstances.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *serviceinstanceGlobalTsmV1Chainer) Containers(name string) *serviceinstancecontainerGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["serviceinstancecontainers.global.tsm.tanzu.vmware.com"] = name + return &serviceinstancecontainerGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetContainers calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *serviceinstanceGlobalTsmV1Chainer) GetContainers(ctx context.Context, displayName string) (result *GlobalServiceInstanceContainer, err error) { + hashedName := helper.GetHashedName("serviceinstancecontainers.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceInstanceContainerByName(ctx, hashedName) +} + +// AddContainers calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *serviceinstanceGlobalTsmV1Chainer) AddContainers(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceInstanceContainer) (result *GlobalServiceInstanceContainer, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("serviceinstancecontainers.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceInstanceContainerByName(ctx, objToCreate) +} + +// DeleteContainers calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *serviceinstanceGlobalTsmV1Chainer) DeleteContainers(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("serviceinstancecontainers.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceInstanceContainerByName(ctx, hashedName) +} + +// GetServiceJobByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceJobByName(ctx context.Context, hashedName string) (*GlobalServiceJob, error) { + key := "servicejobs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceJob) + return &GlobalServiceJob{ + client: group.client, + ServiceJob: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceJobs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceJob{ + client: group.client, + ServiceJob: result, + }, nil + } +} + +// DeleteServiceJobByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceJobByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceJobs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceJobs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceJobsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceJobByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceJobByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceJob) (*GlobalServiceJob, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ServiceInstancesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceJobs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceJobsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceJob\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceJob{ + client: group.client, + ServiceJob: result, + }, nil +} + +// UpdateServiceJobByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceJobByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceJob) (*GlobalServiceJob, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceJobs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + patchValueStatus := + objToUpdate.Spec.Status + patchOpStatus := PatchOp{ + Op: "replace", + Path: "/spec/status", + Value: patchValueStatus, + } + patch = append(patch, patchOpStatus) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceJobs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceJob{ + client: group.client, + ServiceJob: result, + }, nil +} + +// ListServiceJobs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceJobs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceJob, err error) { + key := "servicejobs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceJob, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceJob) + result[k] = &GlobalServiceJob{ + client: group.client, + ServiceJob: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceJobs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceJob, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceJob{ + client: group.client, + ServiceJob: &item, + } + } + } + return +} + +type GlobalServiceJob struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceJob +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceJob) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceJobByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceJob = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceJob) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceJobByName(ctx, obj.ServiceJob) + if err != nil { + return err + } + obj.ServiceJob = result.ServiceJob + return nil +} + +func (obj *GlobalServiceJob) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +// GetAllServiceInstances returns all links of given type +func (obj *GlobalServiceJob) GetAllServiceInstances(ctx context.Context) ( + result []*GlobalServiceInstance, err error) { + result = make([]*GlobalServiceInstance, 0, len(obj.Spec.ServiceInstancesGvk)) + for _, v := range obj.Spec.ServiceInstancesGvk { + l, err := obj.client.Global().GetServiceInstanceByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceInstances returns link which has given displayName +func (obj *GlobalServiceJob) GetServiceInstances(ctx context.Context, + displayName string) (result *GlobalServiceInstance, err error) { + l, ok := obj.Spec.ServiceInstancesGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ServiceJob", "ServiceInstances", displayName) + } + result, err = obj.client.Global().GetServiceInstanceByName(ctx, l.Name) + return +} + +// LinkServiceInstances links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalServiceJob) LinkServiceInstances(ctx context.Context, + linkToAdd *GlobalServiceInstance) error { + + payload := "{\"spec\": {\"serviceInstancesGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceInstance\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ServiceJobs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ServiceJob = result + return nil +} + +// UnlinkServiceInstances unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalServiceJob) UnlinkServiceInstances(ctx context.Context, + linkToRemove *GlobalServiceInstance) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceInstancesGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ServiceJobs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ServiceJob = result + return nil + +} + +type servicejobGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *servicejobGlobalTsmV1Chainer) Subscribe() { + key := "servicejobs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceJobInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *servicejobGlobalTsmV1Chainer) Unsubscribe() { + key := "servicejobs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *servicejobGlobalTsmV1Chainer) IsSubscribed() bool { + key := "servicejobs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetServiceLevelObjectiveFolderByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceLevelObjectiveFolderByName(ctx context.Context, hashedName string) (*GlobalServiceLevelObjectiveFolder, error) { + key := "servicelevelobjectivefolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder) + return &GlobalServiceLevelObjectiveFolder{ + client: group.client, + ServiceLevelObjectiveFolder: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceLevelObjectiveFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceLevelObjectiveFolder{ + client: group.client, + ServiceLevelObjectiveFolder: result, + }, nil + } +} + +// DeleteServiceLevelObjectiveFolderByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceLevelObjectiveFolderByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceLevelObjectiveFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.ServiceLevelObjectivesGvk { + err := group.client. + Global().DeleteServiceLevelObjectiveByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceLevelObjectiveFolders().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceLevelObjectiveGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceLevelObjectiveFolderByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceLevelObjectiveFolderByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder) (*GlobalServiceLevelObjectiveFolder, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ServiceLevelObjectivesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceLevelObjectiveFolders().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["configs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/serviceLevelObjectiveGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ServiceLevelObjectiveFolder", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceLevelObjectiveFolder{ + client: group.client, + ServiceLevelObjectiveFolder: result, + }, nil +} + +// UpdateServiceLevelObjectiveFolderByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceLevelObjectiveFolderByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder) (*GlobalServiceLevelObjectiveFolder, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceLevelObjectiveFolders().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceLevelObjectiveFolders().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceLevelObjectiveFolder{ + client: group.client, + ServiceLevelObjectiveFolder: result, + }, nil +} + +// ListServiceLevelObjectiveFolders returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceLevelObjectiveFolders(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceLevelObjectiveFolder, err error) { + key := "servicelevelobjectivefolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceLevelObjectiveFolder, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder) + result[k] = &GlobalServiceLevelObjectiveFolder{ + client: group.client, + ServiceLevelObjectiveFolder: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceLevelObjectiveFolders().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceLevelObjectiveFolder, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceLevelObjectiveFolder{ + client: group.client, + ServiceLevelObjectiveFolder: &item, + } + } + } + return +} + +type GlobalServiceLevelObjectiveFolder struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceLevelObjectiveFolder +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceLevelObjectiveFolder) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceLevelObjectiveFolderByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceLevelObjectiveFolder = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceLevelObjectiveFolder) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceLevelObjectiveFolderByName(ctx, obj.ServiceLevelObjectiveFolder) + if err != nil { + return err + } + obj.ServiceLevelObjectiveFolder = result.ServiceLevelObjectiveFolder + return nil +} + +func (obj *GlobalServiceLevelObjectiveFolder) GetParent(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetConfigByName(ctx, hashedName) +} + +// GetAllServiceLevelObjectives returns all children of given type +func (obj *GlobalServiceLevelObjectiveFolder) GetAllServiceLevelObjectives(ctx context.Context) ( + result []*GlobalServiceLevelObjective, err error) { + result = make([]*GlobalServiceLevelObjective, 0, len(obj.Spec.ServiceLevelObjectivesGvk)) + for _, v := range obj.Spec.ServiceLevelObjectivesGvk { + l, err := obj.client.Global().GetServiceLevelObjectiveByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceLevelObjectives returns child which has given displayName +func (obj *GlobalServiceLevelObjectiveFolder) GetServiceLevelObjectives(ctx context.Context, + displayName string) (result *GlobalServiceLevelObjective, err error) { + l, ok := obj.Spec.ServiceLevelObjectivesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ServiceLevelObjectiveFolder", "ServiceLevelObjectives", displayName) + } + result, err = obj.client.Global().GetServiceLevelObjectiveByName(ctx, l.Name) + return +} + +// AddServiceLevelObjectives calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalServiceLevelObjectiveFolder) AddServiceLevelObjectives(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceLevelObjective) (result *GlobalServiceLevelObjective, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["servicelevelobjectivefolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["servicelevelobjectivefolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceLevelObjectiveByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetServiceLevelObjectiveFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.ServiceLevelObjectiveFolder = updatedObj.ServiceLevelObjectiveFolder + } + return +} + +// DeleteServiceLevelObjectives calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalServiceLevelObjectiveFolder) DeleteServiceLevelObjectives(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceLevelObjectivesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ServiceLevelObjectiveFolder", "ServiceLevelObjectives", displayName) + } + err = obj.client.Global().DeleteServiceLevelObjectiveByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetServiceLevelObjectiveFolderByName(ctx, obj.GetName()) + if err == nil { + obj.ServiceLevelObjectiveFolder = updatedObj.ServiceLevelObjectiveFolder + } + return +} + +type servicelevelobjectivefolderGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *servicelevelobjectivefolderGlobalTsmV1Chainer) Subscribe() { + key := "servicelevelobjectivefolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceLevelObjectiveFolderInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *servicelevelobjectivefolderGlobalTsmV1Chainer) Unsubscribe() { + key := "servicelevelobjectivefolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *servicelevelobjectivefolderGlobalTsmV1Chainer) IsSubscribed() bool { + key := "servicelevelobjectivefolders.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *servicelevelobjectivefolderGlobalTsmV1Chainer) ServiceLevelObjectives(name string) *servicelevelobjectiveGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["servicelevelobjectives.global.tsm.tanzu.vmware.com"] = name + return &servicelevelobjectiveGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceLevelObjectives calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *servicelevelobjectivefolderGlobalTsmV1Chainer) GetServiceLevelObjectives(ctx context.Context, displayName string) (result *GlobalServiceLevelObjective, err error) { + hashedName := helper.GetHashedName("servicelevelobjectives.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceLevelObjectiveByName(ctx, hashedName) +} + +// AddServiceLevelObjectives calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *servicelevelobjectivefolderGlobalTsmV1Chainer) AddServiceLevelObjectives(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceLevelObjective) (result *GlobalServiceLevelObjective, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicelevelobjectives.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceLevelObjectiveByName(ctx, objToCreate) +} + +// DeleteServiceLevelObjectives calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *servicelevelobjectivefolderGlobalTsmV1Chainer) DeleteServiceLevelObjectives(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicelevelobjectives.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceLevelObjectiveByName(ctx, hashedName) +} + +// GetServiceLevelObjectiveByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceLevelObjectiveByName(ctx context.Context, hashedName string) (*GlobalServiceLevelObjective, error) { + key := "servicelevelobjectives.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceLevelObjective) + return &GlobalServiceLevelObjective{ + client: group.client, + ServiceLevelObjective: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceLevelObjectives().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceLevelObjective{ + client: group.client, + ServiceLevelObjective: result, + }, nil + } +} + +// DeleteServiceLevelObjectiveByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceLevelObjectiveByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceLevelObjectives().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceLevelObjectives().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceLevelObjectivesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["servicelevelobjectivefolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("servicelevelobjectivefolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceLevelObjectiveFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceLevelObjectiveByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceLevelObjectiveByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceLevelObjective) (*GlobalServiceLevelObjective, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceLevelObjectives().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["servicelevelobjectivefolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("servicelevelobjectivefolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceLevelObjectivesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceLevelObjective\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceLevelObjectiveFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceLevelObjective{ + client: group.client, + ServiceLevelObjective: result, + }, nil +} + +// UpdateServiceLevelObjectiveByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceLevelObjectiveByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceLevelObjective) (*GlobalServiceLevelObjective, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceLevelObjectives().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueProjectId := + objToUpdate.Spec.ProjectId + patchOpProjectId := PatchOp{ + Op: "replace", + Path: "/spec/projectId", + Value: patchValueProjectId, + } + patch = append(patch, patchOpProjectId) + + patchValueDisabled := + objToUpdate.Spec.Disabled + patchOpDisabled := PatchOp{ + Op: "replace", + Path: "/spec/disabled", + Value: patchValueDisabled, + } + patch = append(patch, patchOpDisabled) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueSlis := + objToUpdate.Spec.Slis + patchOpSlis := PatchOp{ + Op: "replace", + Path: "/spec/slis", + Value: patchValueSlis, + } + patch = append(patch, patchOpSlis) + + patchValueSloServices := + objToUpdate.Spec.SloServices + patchOpSloServices := PatchOp{ + Op: "replace", + Path: "/spec/sloServices", + Value: patchValueSloServices, + } + patch = append(patch, patchOpSloServices) + + patchValueSloTargetValue := + objToUpdate.Spec.SloTargetValue + patchOpSloTargetValue := PatchOp{ + Op: "replace", + Path: "/spec/sloTargetValue", + Value: patchValueSloTargetValue, + } + patch = append(patch, patchOpSloTargetValue) + + patchValueSloPeriod := + objToUpdate.Spec.SloPeriod + patchOpSloPeriod := PatchOp{ + Op: "replace", + Path: "/spec/sloPeriod", + Value: patchValueSloPeriod, + } + patch = append(patch, patchOpSloPeriod) + + patchValueSloCreationTime := + objToUpdate.Spec.SloCreationTime + patchOpSloCreationTime := PatchOp{ + Op: "replace", + Path: "/spec/sloCreationTime", + Value: patchValueSloCreationTime, + } + patch = append(patch, patchOpSloCreationTime) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceLevelObjectives().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceLevelObjective{ + client: group.client, + ServiceLevelObjective: result, + }, nil +} + +// ListServiceLevelObjectives returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceLevelObjectives(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceLevelObjective, err error) { + key := "servicelevelobjectives.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceLevelObjective, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceLevelObjective) + result[k] = &GlobalServiceLevelObjective{ + client: group.client, + ServiceLevelObjective: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceLevelObjectives().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceLevelObjective, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceLevelObjective{ + client: group.client, + ServiceLevelObjective: &item, + } + } + } + return +} + +type GlobalServiceLevelObjective struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceLevelObjective +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceLevelObjective) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceLevelObjectiveByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceLevelObjective = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceLevelObjective) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceLevelObjectiveByName(ctx, obj.ServiceLevelObjective) + if err != nil { + return err + } + obj.ServiceLevelObjective = result.ServiceLevelObjective + return nil +} + +func (obj *GlobalServiceLevelObjective) GetParent(ctx context.Context) (result *GlobalServiceLevelObjectiveFolder, err error) { + hashedName := helper.GetHashedName("servicelevelobjectivefolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["servicelevelobjectivefolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetServiceLevelObjectiveFolderByName(ctx, hashedName) +} + +type servicelevelobjectiveGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *servicelevelobjectiveGlobalTsmV1Chainer) Subscribe() { + key := "servicelevelobjectives.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceLevelObjectiveInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *servicelevelobjectiveGlobalTsmV1Chainer) Unsubscribe() { + key := "servicelevelobjectives.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *servicelevelobjectiveGlobalTsmV1Chainer) IsSubscribed() bool { + key := "servicelevelobjectives.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetServiceReplicaSetByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceReplicaSetByName(ctx context.Context, hashedName string) (*GlobalServiceReplicaSet, error) { + key := "servicereplicasets.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceReplicaSet) + return &GlobalServiceReplicaSet{ + client: group.client, + ServiceReplicaSet: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceReplicaSets().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceReplicaSet{ + client: group.client, + ServiceReplicaSet: result, + }, nil + } +} + +// DeleteServiceReplicaSetByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceReplicaSetByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceReplicaSets().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceReplicaSets().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceReplicaSetsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceReplicaSetByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceReplicaSetByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceReplicaSet) (*GlobalServiceReplicaSet, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ServiceInstancesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceReplicaSets().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceReplicaSetsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceReplicaSet\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceReplicaSet{ + client: group.client, + ServiceReplicaSet: result, + }, nil +} + +// UpdateServiceReplicaSetByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceReplicaSetByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceReplicaSet) (*GlobalServiceReplicaSet, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceReplicaSets().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + patchValueStatus := + objToUpdate.Spec.Status + patchOpStatus := PatchOp{ + Op: "replace", + Path: "/spec/status", + Value: patchValueStatus, + } + patch = append(patch, patchOpStatus) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceReplicaSets().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceReplicaSet{ + client: group.client, + ServiceReplicaSet: result, + }, nil +} + +// ListServiceReplicaSets returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceReplicaSets(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceReplicaSet, err error) { + key := "servicereplicasets.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceReplicaSet, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceReplicaSet) + result[k] = &GlobalServiceReplicaSet{ + client: group.client, + ServiceReplicaSet: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceReplicaSets().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceReplicaSet, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceReplicaSet{ + client: group.client, + ServiceReplicaSet: &item, + } + } + } + return +} + +type GlobalServiceReplicaSet struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceReplicaSet +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceReplicaSet) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceReplicaSetByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceReplicaSet = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceReplicaSet) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceReplicaSetByName(ctx, obj.ServiceReplicaSet) + if err != nil { + return err + } + obj.ServiceReplicaSet = result.ServiceReplicaSet + return nil +} + +func (obj *GlobalServiceReplicaSet) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +// GetAllServiceInstances returns all links of given type +func (obj *GlobalServiceReplicaSet) GetAllServiceInstances(ctx context.Context) ( + result []*GlobalServiceInstance, err error) { + result = make([]*GlobalServiceInstance, 0, len(obj.Spec.ServiceInstancesGvk)) + for _, v := range obj.Spec.ServiceInstancesGvk { + l, err := obj.client.Global().GetServiceInstanceByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceInstances returns link which has given displayName +func (obj *GlobalServiceReplicaSet) GetServiceInstances(ctx context.Context, + displayName string) (result *GlobalServiceInstance, err error) { + l, ok := obj.Spec.ServiceInstancesGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ServiceReplicaSet", "ServiceInstances", displayName) + } + result, err = obj.client.Global().GetServiceInstanceByName(ctx, l.Name) + return +} + +// LinkServiceInstances links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalServiceReplicaSet) LinkServiceInstances(ctx context.Context, + linkToAdd *GlobalServiceInstance) error { + + payload := "{\"spec\": {\"serviceInstancesGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceInstance\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ServiceReplicaSets().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ServiceReplicaSet = result + return nil +} + +// UnlinkServiceInstances unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalServiceReplicaSet) UnlinkServiceInstances(ctx context.Context, + linkToRemove *GlobalServiceInstance) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceInstancesGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ServiceReplicaSets().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ServiceReplicaSet = result + return nil + +} + +type servicereplicasetGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *servicereplicasetGlobalTsmV1Chainer) Subscribe() { + key := "servicereplicasets.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceReplicaSetInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *servicereplicasetGlobalTsmV1Chainer) Unsubscribe() { + key := "servicereplicasets.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *servicereplicasetGlobalTsmV1Chainer) IsSubscribed() bool { + key := "servicereplicasets.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetServiceStatefulSetByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceStatefulSetByName(ctx context.Context, hashedName string) (*GlobalServiceStatefulSet, error) { + key := "servicestatefulsets.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceStatefulSet) + return &GlobalServiceStatefulSet{ + client: group.client, + ServiceStatefulSet: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceStatefulSets().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceStatefulSet{ + client: group.client, + ServiceStatefulSet: result, + }, nil + } +} + +// DeleteServiceStatefulSetByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceStatefulSetByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceStatefulSets().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceStatefulSets().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceStatefulSetsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceStatefulSetByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceStatefulSetByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceStatefulSet) (*GlobalServiceStatefulSet, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ServiceInstancesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceStatefulSets().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceStatefulSetsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceStatefulSet\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceStatefulSet{ + client: group.client, + ServiceStatefulSet: result, + }, nil +} + +// UpdateServiceStatefulSetByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceStatefulSetByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceStatefulSet) (*GlobalServiceStatefulSet, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceStatefulSets().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + patchValueStatus := + objToUpdate.Spec.Status + patchOpStatus := PatchOp{ + Op: "replace", + Path: "/spec/status", + Value: patchValueStatus, + } + patch = append(patch, patchOpStatus) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceStatefulSets().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceStatefulSet{ + client: group.client, + ServiceStatefulSet: result, + }, nil +} + +// ListServiceStatefulSets returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceStatefulSets(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceStatefulSet, err error) { + key := "servicestatefulsets.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceStatefulSet, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceStatefulSet) + result[k] = &GlobalServiceStatefulSet{ + client: group.client, + ServiceStatefulSet: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceStatefulSets().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceStatefulSet, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceStatefulSet{ + client: group.client, + ServiceStatefulSet: &item, + } + } + } + return +} + +type GlobalServiceStatefulSet struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceStatefulSet +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceStatefulSet) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceStatefulSetByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceStatefulSet = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceStatefulSet) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceStatefulSetByName(ctx, obj.ServiceStatefulSet) + if err != nil { + return err + } + obj.ServiceStatefulSet = result.ServiceStatefulSet + return nil +} + +func (obj *GlobalServiceStatefulSet) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +// GetAllServiceInstances returns all links of given type +func (obj *GlobalServiceStatefulSet) GetAllServiceInstances(ctx context.Context) ( + result []*GlobalServiceInstance, err error) { + result = make([]*GlobalServiceInstance, 0, len(obj.Spec.ServiceInstancesGvk)) + for _, v := range obj.Spec.ServiceInstancesGvk { + l, err := obj.client.Global().GetServiceInstanceByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceInstances returns link which has given displayName +func (obj *GlobalServiceStatefulSet) GetServiceInstances(ctx context.Context, + displayName string) (result *GlobalServiceInstance, err error) { + l, ok := obj.Spec.ServiceInstancesGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ServiceStatefulSet", "ServiceInstances", displayName) + } + result, err = obj.client.Global().GetServiceInstanceByName(ctx, l.Name) + return +} + +// LinkServiceInstances links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalServiceStatefulSet) LinkServiceInstances(ctx context.Context, + linkToAdd *GlobalServiceInstance) error { + + payload := "{\"spec\": {\"serviceInstancesGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceInstance\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ServiceStatefulSets().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ServiceStatefulSet = result + return nil +} + +// UnlinkServiceInstances unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalServiceStatefulSet) UnlinkServiceInstances(ctx context.Context, + linkToRemove *GlobalServiceInstance) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceInstancesGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ServiceStatefulSets().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ServiceStatefulSet = result + return nil + +} + +type servicestatefulsetGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *servicestatefulsetGlobalTsmV1Chainer) Subscribe() { + key := "servicestatefulsets.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceStatefulSetInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *servicestatefulsetGlobalTsmV1Chainer) Unsubscribe() { + key := "servicestatefulsets.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *servicestatefulsetGlobalTsmV1Chainer) IsSubscribed() bool { + key := "servicestatefulsets.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetServiceTemplateServiceDefinitionByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceTemplateServiceDefinitionByName(ctx context.Context, hashedName string) (*GlobalServiceTemplateServiceDefinition, error) { + key := "servicetemplateservicedefinitions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition) + return &GlobalServiceTemplateServiceDefinition{ + client: group.client, + ServiceTemplateServiceDefinition: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceTemplateServiceDefinitions().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceTemplateServiceDefinition{ + client: group.client, + ServiceTemplateServiceDefinition: result, + }, nil + } +} + +// DeleteServiceTemplateServiceDefinitionByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceTemplateServiceDefinitionByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceTemplateServiceDefinitions().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceTemplateServiceDefinitions().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceDefinitionsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["servicetemplates.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("servicetemplates.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceTemplates().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceTemplateServiceDefinitionByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceTemplateServiceDefinitionByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition) (*GlobalServiceTemplateServiceDefinition, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceTemplateServiceDefinitions().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["servicetemplates.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("servicetemplates.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceDefinitionsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceTemplateServiceDefinition\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceTemplates().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceTemplateServiceDefinition{ + client: group.client, + ServiceTemplateServiceDefinition: result, + }, nil +} + +// UpdateServiceTemplateServiceDefinitionByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceTemplateServiceDefinitionByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition) (*GlobalServiceTemplateServiceDefinition, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceTemplateServiceDefinitions().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueType := + objToUpdate.Spec.Type + patchOpType := PatchOp{ + Op: "replace", + Path: "/spec/type", + Value: patchValueType, + } + patch = append(patch, patchOpType) + + patchValueVersion := + objToUpdate.Spec.Version + patchOpVersion := PatchOp{ + Op: "replace", + Path: "/spec/version", + Value: patchValueVersion, + } + patch = append(patch, patchOpVersion) + + patchValueTemplate := + objToUpdate.Spec.Template + patchOpTemplate := PatchOp{ + Op: "replace", + Path: "/spec/template", + Value: patchValueTemplate, + } + patch = append(patch, patchOpTemplate) + + if objToUpdate.Spec.TemplateArgs != nil { + patchValueTemplateArgs := + objToUpdate.Spec.TemplateArgs + patchOpTemplateArgs := PatchOp{ + Op: "replace", + Path: "/spec/templateArgs", + Value: patchValueTemplateArgs, + } + patch = append(patch, patchOpTemplateArgs) + } + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceTemplateServiceDefinitions().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceTemplateServiceDefinition{ + client: group.client, + ServiceTemplateServiceDefinition: result, + }, nil +} + +// ListServiceTemplateServiceDefinitions returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceTemplateServiceDefinitions(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceTemplateServiceDefinition, err error) { + key := "servicetemplateservicedefinitions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceTemplateServiceDefinition, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition) + result[k] = &GlobalServiceTemplateServiceDefinition{ + client: group.client, + ServiceTemplateServiceDefinition: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceTemplateServiceDefinitions().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceTemplateServiceDefinition, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceTemplateServiceDefinition{ + client: group.client, + ServiceTemplateServiceDefinition: &item, + } + } + } + return +} + +type GlobalServiceTemplateServiceDefinition struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceTemplateServiceDefinition) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceTemplateServiceDefinitionByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceTemplateServiceDefinition = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceTemplateServiceDefinition) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceTemplateServiceDefinitionByName(ctx, obj.ServiceTemplateServiceDefinition) + if err != nil { + return err + } + obj.ServiceTemplateServiceDefinition = result.ServiceTemplateServiceDefinition + return nil +} + +func (obj *GlobalServiceTemplateServiceDefinition) GetParent(ctx context.Context) (result *GlobalServiceTemplate, err error) { + hashedName := helper.GetHashedName("servicetemplates.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["servicetemplates.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetServiceTemplateByName(ctx, hashedName) +} + +type servicetemplateservicedefinitionGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *servicetemplateservicedefinitionGlobalTsmV1Chainer) Subscribe() { + key := "servicetemplateservicedefinitions.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceTemplateServiceDefinitionInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *servicetemplateservicedefinitionGlobalTsmV1Chainer) Unsubscribe() { + key := "servicetemplateservicedefinitions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *servicetemplateservicedefinitionGlobalTsmV1Chainer) IsSubscribed() bool { + key := "servicetemplateservicedefinitions.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetServiceTemplateByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceTemplateByName(ctx context.Context, hashedName string) (*GlobalServiceTemplate, error) { + key := "servicetemplates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceTemplate) + return &GlobalServiceTemplate{ + client: group.client, + ServiceTemplate: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceTemplates().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceTemplate{ + client: group.client, + ServiceTemplate: result, + }, nil + } +} + +// DeleteServiceTemplateByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceTemplateByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceTemplates().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.ServiceDefinitionsGvk { + err := group.client. + Global().DeleteServiceTemplateServiceDefinitionByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceTemplates().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceTemplatesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["templategroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + TemplateGroups().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceTemplateByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceTemplateByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceTemplate) (*GlobalServiceTemplate, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ServiceDefinitionsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceTemplates().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["templategroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceTemplatesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceTemplate\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + TemplateGroups().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceTemplate{ + client: group.client, + ServiceTemplate: result, + }, nil +} + +// UpdateServiceTemplateByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceTemplateByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceTemplate) (*GlobalServiceTemplate, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceTemplates().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueVersion := + objToUpdate.Spec.Version + patchOpVersion := PatchOp{ + Op: "replace", + Path: "/spec/version", + Value: patchValueVersion, + } + patch = append(patch, patchOpVersion) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceTemplates().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceTemplate{ + client: group.client, + ServiceTemplate: result, + }, nil +} + +// ListServiceTemplates returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceTemplates(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceTemplate, err error) { + key := "servicetemplates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceTemplate, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceTemplate) + result[k] = &GlobalServiceTemplate{ + client: group.client, + ServiceTemplate: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceTemplates().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceTemplate, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceTemplate{ + client: group.client, + ServiceTemplate: &item, + } + } + } + return +} + +type GlobalServiceTemplate struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceTemplate +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceTemplate) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceTemplateByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceTemplate = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceTemplate) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceTemplateByName(ctx, obj.ServiceTemplate) + if err != nil { + return err + } + obj.ServiceTemplate = result.ServiceTemplate + return nil +} + +func (obj *GlobalServiceTemplate) GetParent(ctx context.Context) (result *GlobalTemplateGroup, err error) { + hashedName := helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["templategroups.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetTemplateGroupByName(ctx, hashedName) +} + +// GetAllServiceDefinitions returns all children of given type +func (obj *GlobalServiceTemplate) GetAllServiceDefinitions(ctx context.Context) ( + result []*GlobalServiceTemplateServiceDefinition, err error) { + result = make([]*GlobalServiceTemplateServiceDefinition, 0, len(obj.Spec.ServiceDefinitionsGvk)) + for _, v := range obj.Spec.ServiceDefinitionsGvk { + l, err := obj.client.Global().GetServiceTemplateServiceDefinitionByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceDefinitions returns child which has given displayName +func (obj *GlobalServiceTemplate) GetServiceDefinitions(ctx context.Context, + displayName string) (result *GlobalServiceTemplateServiceDefinition, err error) { + l, ok := obj.Spec.ServiceDefinitionsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ServiceTemplate", "ServiceDefinitions", displayName) + } + result, err = obj.client.Global().GetServiceTemplateServiceDefinitionByName(ctx, l.Name) + return +} + +// AddServiceDefinitions calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalServiceTemplate) AddServiceDefinitions(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition) (result *GlobalServiceTemplateServiceDefinition, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["servicetemplates.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["servicetemplates.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceTemplateServiceDefinitionByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetServiceTemplateByName(ctx, obj.GetName()) + if getErr == nil { + obj.ServiceTemplate = updatedObj.ServiceTemplate + } + return +} + +// DeleteServiceDefinitions calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalServiceTemplate) DeleteServiceDefinitions(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceDefinitionsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ServiceTemplate", "ServiceDefinitions", displayName) + } + err = obj.client.Global().DeleteServiceTemplateServiceDefinitionByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetServiceTemplateByName(ctx, obj.GetName()) + if err == nil { + obj.ServiceTemplate = updatedObj.ServiceTemplate + } + return +} + +type servicetemplateGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *servicetemplateGlobalTsmV1Chainer) Subscribe() { + key := "servicetemplates.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceTemplateInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *servicetemplateGlobalTsmV1Chainer) Unsubscribe() { + key := "servicetemplates.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *servicetemplateGlobalTsmV1Chainer) IsSubscribed() bool { + key := "servicetemplates.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *servicetemplateGlobalTsmV1Chainer) ServiceDefinitions(name string) *servicetemplateservicedefinitionGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["servicetemplateservicedefinitions.global.tsm.tanzu.vmware.com"] = name + return &servicetemplateservicedefinitionGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceDefinitions calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *servicetemplateGlobalTsmV1Chainer) GetServiceDefinitions(ctx context.Context, displayName string) (result *GlobalServiceTemplateServiceDefinition, err error) { + hashedName := helper.GetHashedName("servicetemplateservicedefinitions.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceTemplateServiceDefinitionByName(ctx, hashedName) +} + +// AddServiceDefinitions calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *servicetemplateGlobalTsmV1Chainer) AddServiceDefinitions(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceTemplateServiceDefinition) (result *GlobalServiceTemplateServiceDefinition, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicetemplateservicedefinitions.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceTemplateServiceDefinitionByName(ctx, objToCreate) +} + +// DeleteServiceDefinitions calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *servicetemplateGlobalTsmV1Chainer) DeleteServiceDefinitions(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("servicetemplateservicedefinitions.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceTemplateServiceDefinitionByName(ctx, hashedName) +} + +// GetServiceVersionConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceVersionConfigByName(ctx context.Context, hashedName string) (*GlobalServiceVersionConfig, error) { + key := "serviceversionconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceVersionConfig) + return &GlobalServiceVersionConfig{ + client: group.client, + ServiceVersionConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceVersionConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceVersionConfig{ + client: group.client, + ServiceVersionConfig: result, + }, nil + } +} + +// DeleteServiceVersionConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceVersionConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceVersionConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.MetricMonitorsGvk { + err := group.client. + Global().DeleteMetricMonitorByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceVersionConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceVersionGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["serviceconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("serviceconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceVersionConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceVersionConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceVersionConfig) (*GlobalServiceVersionConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.MetricMonitorsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceVersionConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["serviceconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("serviceconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceVersionGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceVersionConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceVersionConfig{ + client: group.client, + ServiceVersionConfig: result, + }, nil +} + +// UpdateServiceVersionConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceVersionConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceVersionConfig) (*GlobalServiceVersionConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceVersionConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueVersion := + objToUpdate.Spec.Version + patchOpVersion := PatchOp{ + Op: "replace", + Path: "/spec/version", + Value: patchValueVersion, + } + patch = append(patch, patchOpVersion) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceVersionConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceVersionConfig{ + client: group.client, + ServiceVersionConfig: result, + }, nil +} + +// ListServiceVersionConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceVersionConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceVersionConfig, err error) { + key := "serviceversionconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceVersionConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceVersionConfig) + result[k] = &GlobalServiceVersionConfig{ + client: group.client, + ServiceVersionConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceVersionConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceVersionConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceVersionConfig{ + client: group.client, + ServiceVersionConfig: &item, + } + } + } + return +} + +type GlobalServiceVersionConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceVersionConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceVersionConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceVersionConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceVersionConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceVersionConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceVersionConfigByName(ctx, obj.ServiceVersionConfig) + if err != nil { + return err + } + obj.ServiceVersionConfig = result.ServiceVersionConfig + return nil +} + +func (obj *GlobalServiceVersionConfig) GetParent(ctx context.Context) (result *GlobalServiceConfig, err error) { + hashedName := helper.GetHashedName("serviceconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["serviceconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetServiceConfigByName(ctx, hashedName) +} + +// GetAllMetricMonitors returns all children of given type +func (obj *GlobalServiceVersionConfig) GetAllMetricMonitors(ctx context.Context) ( + result []*GlobalMetricMonitor, err error) { + result = make([]*GlobalMetricMonitor, 0, len(obj.Spec.MetricMonitorsGvk)) + for _, v := range obj.Spec.MetricMonitorsGvk { + l, err := obj.client.Global().GetMetricMonitorByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetMetricMonitors returns child which has given displayName +func (obj *GlobalServiceVersionConfig) GetMetricMonitors(ctx context.Context, + displayName string) (result *GlobalMetricMonitor, err error) { + l, ok := obj.Spec.MetricMonitorsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.ServiceVersionConfig", "MetricMonitors", displayName) + } + result, err = obj.client.Global().GetMetricMonitorByName(ctx, l.Name) + return +} + +// AddMetricMonitors calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalServiceVersionConfig) AddMetricMonitors(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.MetricMonitor) (result *GlobalMetricMonitor, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["serviceversionconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["serviceversionconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateMetricMonitorByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetServiceVersionConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.ServiceVersionConfig = updatedObj.ServiceVersionConfig + } + return +} + +// DeleteMetricMonitors calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalServiceVersionConfig) DeleteMetricMonitors(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.MetricMonitorsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.ServiceVersionConfig", "MetricMonitors", displayName) + } + err = obj.client.Global().DeleteMetricMonitorByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetServiceVersionConfigByName(ctx, obj.GetName()) + if err == nil { + obj.ServiceVersionConfig = updatedObj.ServiceVersionConfig + } + return +} + +type serviceversionconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *serviceversionconfigGlobalTsmV1Chainer) Subscribe() { + key := "serviceversionconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceVersionConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *serviceversionconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "serviceversionconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *serviceversionconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "serviceversionconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *serviceversionconfigGlobalTsmV1Chainer) MetricMonitors(name string) *metricmonitorGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["metricmonitors.global.tsm.tanzu.vmware.com"] = name + return &metricmonitorGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetMetricMonitors calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *serviceversionconfigGlobalTsmV1Chainer) GetMetricMonitors(ctx context.Context, displayName string) (result *GlobalMetricMonitor, err error) { + hashedName := helper.GetHashedName("metricmonitors.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetMetricMonitorByName(ctx, hashedName) +} + +// AddMetricMonitors calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *serviceversionconfigGlobalTsmV1Chainer) AddMetricMonitors(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.MetricMonitor) (result *GlobalMetricMonitor, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("metricmonitors.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateMetricMonitorByName(ctx, objToCreate) +} + +// DeleteMetricMonitors calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *serviceversionconfigGlobalTsmV1Chainer) DeleteMetricMonitors(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("metricmonitors.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteMetricMonitorByName(ctx, hashedName) +} + +// GetMetricMonitorByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetMetricMonitorByName(ctx context.Context, hashedName string) (*GlobalMetricMonitor, error) { + key := "metricmonitors.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.MetricMonitor) + return &GlobalMetricMonitor{ + client: group.client, + MetricMonitor: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + MetricMonitors().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalMetricMonitor{ + client: group.client, + MetricMonitor: result, + }, nil + } +} + +// DeleteMetricMonitorByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteMetricMonitorByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + MetricMonitors().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + MetricMonitors().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/metricMonitorsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["serviceversionconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("serviceversionconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceVersionConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateMetricMonitorByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateMetricMonitorByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.MetricMonitor) (*GlobalMetricMonitor, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + MetricMonitors().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["serviceversionconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("serviceversionconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"metricMonitorsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"MetricMonitor\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ServiceVersionConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalMetricMonitor{ + client: group.client, + MetricMonitor: result, + }, nil +} + +// UpdateMetricMonitorByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateMetricMonitorByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.MetricMonitor) (*GlobalMetricMonitor, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + MetricMonitors().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueOwnedBy := + objToUpdate.Spec.OwnedBy + patchOpOwnedBy := PatchOp{ + Op: "replace", + Path: "/spec/ownedBy", + Value: patchValueOwnedBy, + } + patch = append(patch, patchOpOwnedBy) + + patchValueSvcMetric := + objToUpdate.Spec.SvcMetric + patchOpSvcMetric := PatchOp{ + Op: "replace", + Path: "/spec/svcMetric", + Value: patchValueSvcMetric, + } + patch = append(patch, patchOpSvcMetric) + + patchValueFunctionType := + objToUpdate.Spec.FunctionType + patchOpFunctionType := PatchOp{ + Op: "replace", + Path: "/spec/functionType", + Value: patchValueFunctionType, + } + patch = append(patch, patchOpFunctionType) + + patchValueFunctionArgs := + objToUpdate.Spec.FunctionArgs + patchOpFunctionArgs := PatchOp{ + Op: "replace", + Path: "/spec/functionArgs", + Value: patchValueFunctionArgs, + } + patch = append(patch, patchOpFunctionArgs) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + MetricMonitors().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalMetricMonitor{ + client: group.client, + MetricMonitor: result, + }, nil +} + +// ListMetricMonitors returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListMetricMonitors(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalMetricMonitor, err error) { + key := "metricmonitors.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalMetricMonitor, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.MetricMonitor) + result[k] = &GlobalMetricMonitor{ + client: group.client, + MetricMonitor: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + MetricMonitors().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalMetricMonitor, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalMetricMonitor{ + client: group.client, + MetricMonitor: &item, + } + } + } + return +} + +type GlobalMetricMonitor struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.MetricMonitor +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalMetricMonitor) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteMetricMonitorByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.MetricMonitor = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalMetricMonitor) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateMetricMonitorByName(ctx, obj.MetricMonitor) + if err != nil { + return err + } + obj.MetricMonitor = result.MetricMonitor + return nil +} + +func (obj *GlobalMetricMonitor) GetParent(ctx context.Context) (result *GlobalServiceVersionConfig, err error) { + hashedName := helper.GetHashedName("serviceversionconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["serviceversionconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetServiceVersionConfigByName(ctx, hashedName) +} + +type metricmonitorGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *metricmonitorGlobalTsmV1Chainer) Subscribe() { + key := "metricmonitors.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewMetricMonitorInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *metricmonitorGlobalTsmV1Chainer) Unsubscribe() { + key := "metricmonitors.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *metricmonitorGlobalTsmV1Chainer) IsSubscribed() bool { + key := "metricmonitors.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetServiceVersionByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceVersionByName(ctx context.Context, hashedName string) (*GlobalServiceVersion, error) { + key := "serviceversions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.ServiceVersion) + return &GlobalServiceVersion{ + client: group.client, + ServiceVersion: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceVersions().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceVersion{ + client: group.client, + ServiceVersion: result, + }, nil + } +} + +// DeleteServiceVersionByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceVersionByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceVersions().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + ServiceVersions().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceVersionsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["services.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("services.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Services().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceVersionByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceVersionByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceVersion) (*GlobalServiceVersion, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ServiceDeploymentsGvk = nil + objToCreate.Spec.ServiceDaemonSetsGvk = nil + objToCreate.Spec.ServiceStatefulSetsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceVersions().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["services.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("services.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"serviceVersionsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ServiceVersion\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Services().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalServiceVersion{ + client: group.client, + ServiceVersion: result, + }, nil +} + +// UpdateServiceVersionByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceVersionByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.ServiceVersion) (*GlobalServiceVersion, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + ServiceVersions().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + ServiceVersions().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalServiceVersion{ + client: group.client, + ServiceVersion: result, + }, nil +} + +// ListServiceVersions returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServiceVersions(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalServiceVersion, err error) { + key := "serviceversions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalServiceVersion, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.ServiceVersion) + result[k] = &GlobalServiceVersion{ + client: group.client, + ServiceVersion: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + ServiceVersions().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalServiceVersion, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalServiceVersion{ + client: group.client, + ServiceVersion: &item, + } + } + } + return +} + +type GlobalServiceVersion struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.ServiceVersion +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalServiceVersion) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceVersionByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.ServiceVersion = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalServiceVersion) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceVersionByName(ctx, obj.ServiceVersion) + if err != nil { + return err + } + obj.ServiceVersion = result.ServiceVersion + return nil +} + +func (obj *GlobalServiceVersion) GetParent(ctx context.Context) (result *GlobalService, err error) { + hashedName := helper.GetHashedName("services.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["services.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetServiceByName(ctx, hashedName) +} + +// GetAllServiceDeployments returns all links of given type +func (obj *GlobalServiceVersion) GetAllServiceDeployments(ctx context.Context) ( + result []*GlobalServiceDeployment, err error) { + result = make([]*GlobalServiceDeployment, 0, len(obj.Spec.ServiceDeploymentsGvk)) + for _, v := range obj.Spec.ServiceDeploymentsGvk { + l, err := obj.client.Global().GetServiceDeploymentByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceDeployments returns link which has given displayName +func (obj *GlobalServiceVersion) GetServiceDeployments(ctx context.Context, + displayName string) (result *GlobalServiceDeployment, err error) { + l, ok := obj.Spec.ServiceDeploymentsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ServiceVersion", "ServiceDeployments", displayName) + } + result, err = obj.client.Global().GetServiceDeploymentByName(ctx, l.Name) + return +} + +// LinkServiceDeployments links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalServiceVersion) LinkServiceDeployments(ctx context.Context, + linkToAdd *GlobalServiceDeployment) error { + + payload := "{\"spec\": {\"serviceDeploymentsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceDeployment\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ServiceVersions().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ServiceVersion = result + return nil +} + +// UnlinkServiceDeployments unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalServiceVersion) UnlinkServiceDeployments(ctx context.Context, + linkToRemove *GlobalServiceDeployment) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceDeploymentsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ServiceVersions().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ServiceVersion = result + return nil + +} + +// GetAllServiceDaemonSets returns all links of given type +func (obj *GlobalServiceVersion) GetAllServiceDaemonSets(ctx context.Context) ( + result []*GlobalServiceDaemonSet, err error) { + result = make([]*GlobalServiceDaemonSet, 0, len(obj.Spec.ServiceDaemonSetsGvk)) + for _, v := range obj.Spec.ServiceDaemonSetsGvk { + l, err := obj.client.Global().GetServiceDaemonSetByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceDaemonSets returns link which has given displayName +func (obj *GlobalServiceVersion) GetServiceDaemonSets(ctx context.Context, + displayName string) (result *GlobalServiceDaemonSet, err error) { + l, ok := obj.Spec.ServiceDaemonSetsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ServiceVersion", "ServiceDaemonSets", displayName) + } + result, err = obj.client.Global().GetServiceDaemonSetByName(ctx, l.Name) + return +} + +// LinkServiceDaemonSets links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalServiceVersion) LinkServiceDaemonSets(ctx context.Context, + linkToAdd *GlobalServiceDaemonSet) error { + + payload := "{\"spec\": {\"serviceDaemonSetsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceDaemonSet\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ServiceVersions().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ServiceVersion = result + return nil +} + +// UnlinkServiceDaemonSets unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalServiceVersion) UnlinkServiceDaemonSets(ctx context.Context, + linkToRemove *GlobalServiceDaemonSet) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceDaemonSetsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ServiceVersions().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ServiceVersion = result + return nil + +} + +// GetAllServiceStatefulSets returns all links of given type +func (obj *GlobalServiceVersion) GetAllServiceStatefulSets(ctx context.Context) ( + result []*GlobalServiceStatefulSet, err error) { + result = make([]*GlobalServiceStatefulSet, 0, len(obj.Spec.ServiceStatefulSetsGvk)) + for _, v := range obj.Spec.ServiceStatefulSetsGvk { + l, err := obj.client.Global().GetServiceStatefulSetByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceStatefulSets returns link which has given displayName +func (obj *GlobalServiceVersion) GetServiceStatefulSets(ctx context.Context, + displayName string) (result *GlobalServiceStatefulSet, err error) { + l, ok := obj.Spec.ServiceStatefulSetsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.ServiceVersion", "ServiceStatefulSets", displayName) + } + result, err = obj.client.Global().GetServiceStatefulSetByName(ctx, l.Name) + return +} + +// LinkServiceStatefulSets links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalServiceVersion) LinkServiceStatefulSets(ctx context.Context, + linkToAdd *GlobalServiceStatefulSet) error { + + payload := "{\"spec\": {\"serviceStatefulSetsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceStatefulSet\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().ServiceVersions().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.ServiceVersion = result + return nil +} + +// UnlinkServiceStatefulSets unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalServiceVersion) UnlinkServiceStatefulSets(ctx context.Context, + linkToRemove *GlobalServiceStatefulSet) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceStatefulSetsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().ServiceVersions().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.ServiceVersion = result + return nil + +} + +type serviceversionGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *serviceversionGlobalTsmV1Chainer) Subscribe() { + key := "serviceversions.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceVersionInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *serviceversionGlobalTsmV1Chainer) Unsubscribe() { + key := "serviceversions.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *serviceversionGlobalTsmV1Chainer) IsSubscribed() bool { + key := "serviceversions.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetServiceByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetServiceByName(ctx context.Context, hashedName string) (*GlobalService, error) { + key := "services.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Service) + return &GlobalService{ + client: group.client, + Service: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + Services().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalService{ + client: group.client, + Service: result, + }, nil + } +} + +// DeleteServiceByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteServiceByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + Services().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.AdditionalAttributesGvk { + err := group.client. + Global().DeleteAdditionalAttributesByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.ServiceVersionsGvk { + err := group.client. + Global().DeleteServiceVersionByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + Services().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/servicesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateServiceByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateServiceByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Service) (*GlobalService, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.AdditionalAttributesGvk = nil + objToCreate.Spec.ServiceVersionsGvk = nil + objToCreate.Spec.ServiceDeploymentsGvk = nil + objToCreate.Spec.ServiceStatefulSetsGvk = nil + objToCreate.Spec.ServiceDaemonSetsGvk = nil + objToCreate.Spec.EndpointsGvk = nil + objToCreate.Spec.ServiceReplicaSetsGvk = nil + objToCreate.Spec.ServiceJobsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + Services().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"servicesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"Service\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalService{ + client: group.client, + Service: result, + }, nil +} + +// UpdateServiceByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateServiceByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Service) (*GlobalService, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + Services().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueMetadata := + objToUpdate.Spec.Metadata + patchOpMetadata := PatchOp{ + Op: "replace", + Path: "/spec/metadata", + Value: patchValueMetadata, + } + patch = append(patch, patchOpMetadata) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueNamespace := + objToUpdate.Spec.Namespace + patchOpNamespace := PatchOp{ + Op: "replace", + Path: "/spec/namespace", + Value: patchValueNamespace, + } + patch = append(patch, patchOpNamespace) + + patchValueApiLink := + objToUpdate.Spec.ApiLink + patchOpApiLink := PatchOp{ + Op: "replace", + Path: "/spec/apiLink", + Value: patchValueApiLink, + } + patch = append(patch, patchOpApiLink) + + patchValueIpAddress := + objToUpdate.Spec.IpAddress + patchOpIpAddress := PatchOp{ + Op: "replace", + Path: "/spec/ipAddress", + Value: patchValueIpAddress, + } + patch = append(patch, patchOpIpAddress) + + patchValueAnnotations := + objToUpdate.Spec.Annotations + patchOpAnnotations := PatchOp{ + Op: "replace", + Path: "/spec/annotations", + Value: patchValueAnnotations, + } + patch = append(patch, patchOpAnnotations) + + patchValueCreationTimestamp := + objToUpdate.Spec.CreationTimestamp + patchOpCreationTimestamp := PatchOp{ + Op: "replace", + Path: "/spec/creationTimestamp", + Value: patchValueCreationTimestamp, + } + patch = append(patch, patchOpCreationTimestamp) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueUid := + objToUpdate.Spec.Uid + patchOpUid := PatchOp{ + Op: "replace", + Path: "/spec/uid", + Value: patchValueUid, + } + patch = append(patch, patchOpUid) + + patchValuePorts := + objToUpdate.Spec.Ports + patchOpPorts := PatchOp{ + Op: "replace", + Path: "/spec/ports", + Value: patchValuePorts, + } + patch = append(patch, patchOpPorts) + + patchValueSelector := + objToUpdate.Spec.Selector + patchOpSelector := PatchOp{ + Op: "replace", + Path: "/spec/selector", + Value: patchValueSelector, + } + patch = append(patch, patchOpSelector) + + patchValueType := + objToUpdate.Spec.Type + patchOpType := PatchOp{ + Op: "replace", + Path: "/spec/type", + Value: patchValueType, + } + patch = append(patch, patchOpType) + + patchValueStatus := + objToUpdate.Spec.Status + patchOpStatus := PatchOp{ + Op: "replace", + Path: "/spec/status", + Value: patchValueStatus, + } + patch = append(patch, patchOpStatus) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + Services().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalService{ + client: group.client, + Service: result, + }, nil +} + +// ListServices returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListServices(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalService, err error) { + key := "services.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalService, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Service) + result[k] = &GlobalService{ + client: group.client, + Service: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + Services().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalService, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalService{ + client: group.client, + Service: &item, + } + } + } + return +} + +type GlobalService struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.Service +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalService) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteServiceByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.Service = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalService) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateServiceByName(ctx, obj.Service) + if err != nil { + return err + } + obj.Service = result.Service + return nil +} + +func (obj *GlobalService) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +// GetAllAdditionalAttributes returns all children of given type +func (obj *GlobalService) GetAllAdditionalAttributes(ctx context.Context) ( + result []*GlobalAdditionalAttributes, err error) { + result = make([]*GlobalAdditionalAttributes, 0, len(obj.Spec.AdditionalAttributesGvk)) + for _, v := range obj.Spec.AdditionalAttributesGvk { + l, err := obj.client.Global().GetAdditionalAttributesByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetAdditionalAttributes returns child which has given displayName +func (obj *GlobalService) GetAdditionalAttributes(ctx context.Context, + displayName string) (result *GlobalAdditionalAttributes, err error) { + l, ok := obj.Spec.AdditionalAttributesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Service", "AdditionalAttributes", displayName) + } + result, err = obj.client.Global().GetAdditionalAttributesByName(ctx, l.Name) + return +} + +// AddAdditionalAttributes calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalService) AddAdditionalAttributes(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AdditionalAttributes) (result *GlobalAdditionalAttributes, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["services.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["services.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAdditionalAttributesByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetServiceByName(ctx, obj.GetName()) + if getErr == nil { + obj.Service = updatedObj.Service + } + return +} + +// DeleteAdditionalAttributes calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalService) DeleteAdditionalAttributes(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.AdditionalAttributesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Service", "AdditionalAttributes", displayName) + } + err = obj.client.Global().DeleteAdditionalAttributesByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetServiceByName(ctx, obj.GetName()) + if err == nil { + obj.Service = updatedObj.Service + } + return +} + +// GetAllServiceVersions returns all children of given type +func (obj *GlobalService) GetAllServiceVersions(ctx context.Context) ( + result []*GlobalServiceVersion, err error) { + result = make([]*GlobalServiceVersion, 0, len(obj.Spec.ServiceVersionsGvk)) + for _, v := range obj.Spec.ServiceVersionsGvk { + l, err := obj.client.Global().GetServiceVersionByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceVersions returns child which has given displayName +func (obj *GlobalService) GetServiceVersions(ctx context.Context, + displayName string) (result *GlobalServiceVersion, err error) { + l, ok := obj.Spec.ServiceVersionsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Service", "ServiceVersions", displayName) + } + result, err = obj.client.Global().GetServiceVersionByName(ctx, l.Name) + return +} + +// AddServiceVersions calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalService) AddServiceVersions(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceVersion) (result *GlobalServiceVersion, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["services.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["services.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateServiceVersionByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetServiceByName(ctx, obj.GetName()) + if getErr == nil { + obj.Service = updatedObj.Service + } + return +} + +// DeleteServiceVersions calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalService) DeleteServiceVersions(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceVersionsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Service", "ServiceVersions", displayName) + } + err = obj.client.Global().DeleteServiceVersionByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetServiceByName(ctx, obj.GetName()) + if err == nil { + obj.Service = updatedObj.Service + } + return +} + +// GetAllServiceDeployments returns all links of given type +func (obj *GlobalService) GetAllServiceDeployments(ctx context.Context) ( + result []*GlobalServiceDeployment, err error) { + result = make([]*GlobalServiceDeployment, 0, len(obj.Spec.ServiceDeploymentsGvk)) + for _, v := range obj.Spec.ServiceDeploymentsGvk { + l, err := obj.client.Global().GetServiceDeploymentByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceDeployments returns link which has given displayName +func (obj *GlobalService) GetServiceDeployments(ctx context.Context, + displayName string) (result *GlobalServiceDeployment, err error) { + l, ok := obj.Spec.ServiceDeploymentsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.Service", "ServiceDeployments", displayName) + } + result, err = obj.client.Global().GetServiceDeploymentByName(ctx, l.Name) + return +} + +// LinkServiceDeployments links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalService) LinkServiceDeployments(ctx context.Context, + linkToAdd *GlobalServiceDeployment) error { + + payload := "{\"spec\": {\"serviceDeploymentsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceDeployment\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().Services().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.Service = result + return nil +} + +// UnlinkServiceDeployments unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalService) UnlinkServiceDeployments(ctx context.Context, + linkToRemove *GlobalServiceDeployment) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceDeploymentsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Services().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.Service = result + return nil + +} + +// GetAllServiceStatefulSets returns all links of given type +func (obj *GlobalService) GetAllServiceStatefulSets(ctx context.Context) ( + result []*GlobalServiceStatefulSet, err error) { + result = make([]*GlobalServiceStatefulSet, 0, len(obj.Spec.ServiceStatefulSetsGvk)) + for _, v := range obj.Spec.ServiceStatefulSetsGvk { + l, err := obj.client.Global().GetServiceStatefulSetByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceStatefulSets returns link which has given displayName +func (obj *GlobalService) GetServiceStatefulSets(ctx context.Context, + displayName string) (result *GlobalServiceStatefulSet, err error) { + l, ok := obj.Spec.ServiceStatefulSetsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.Service", "ServiceStatefulSets", displayName) + } + result, err = obj.client.Global().GetServiceStatefulSetByName(ctx, l.Name) + return +} + +// LinkServiceStatefulSets links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalService) LinkServiceStatefulSets(ctx context.Context, + linkToAdd *GlobalServiceStatefulSet) error { + + payload := "{\"spec\": {\"serviceStatefulSetsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceStatefulSet\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().Services().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.Service = result + return nil +} + +// UnlinkServiceStatefulSets unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalService) UnlinkServiceStatefulSets(ctx context.Context, + linkToRemove *GlobalServiceStatefulSet) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceStatefulSetsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Services().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.Service = result + return nil + +} + +// GetAllServiceDaemonSets returns all links of given type +func (obj *GlobalService) GetAllServiceDaemonSets(ctx context.Context) ( + result []*GlobalServiceDaemonSet, err error) { + result = make([]*GlobalServiceDaemonSet, 0, len(obj.Spec.ServiceDaemonSetsGvk)) + for _, v := range obj.Spec.ServiceDaemonSetsGvk { + l, err := obj.client.Global().GetServiceDaemonSetByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceDaemonSets returns link which has given displayName +func (obj *GlobalService) GetServiceDaemonSets(ctx context.Context, + displayName string) (result *GlobalServiceDaemonSet, err error) { + l, ok := obj.Spec.ServiceDaemonSetsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.Service", "ServiceDaemonSets", displayName) + } + result, err = obj.client.Global().GetServiceDaemonSetByName(ctx, l.Name) + return +} + +// LinkServiceDaemonSets links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalService) LinkServiceDaemonSets(ctx context.Context, + linkToAdd *GlobalServiceDaemonSet) error { + + payload := "{\"spec\": {\"serviceDaemonSetsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceDaemonSet\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().Services().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.Service = result + return nil +} + +// UnlinkServiceDaemonSets unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalService) UnlinkServiceDaemonSets(ctx context.Context, + linkToRemove *GlobalServiceDaemonSet) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceDaemonSetsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Services().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.Service = result + return nil + +} + +// GetAllEndpoints returns all links of given type +func (obj *GlobalService) GetAllEndpoints(ctx context.Context) ( + result []*GlobalEndpoints, err error) { + result = make([]*GlobalEndpoints, 0, len(obj.Spec.EndpointsGvk)) + for _, v := range obj.Spec.EndpointsGvk { + l, err := obj.client.Global().GetEndpointsByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetEndpoints returns link which has given displayName +func (obj *GlobalService) GetEndpoints(ctx context.Context, + displayName string) (result *GlobalEndpoints, err error) { + l, ok := obj.Spec.EndpointsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.Service", "Endpoints", displayName) + } + result, err = obj.client.Global().GetEndpointsByName(ctx, l.Name) + return +} + +// LinkEndpoints links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalService) LinkEndpoints(ctx context.Context, + linkToAdd *GlobalEndpoints) error { + + payload := "{\"spec\": {\"endpointsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"Endpoints\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().Services().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.Service = result + return nil +} + +// UnlinkEndpoints unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalService) UnlinkEndpoints(ctx context.Context, + linkToRemove *GlobalEndpoints) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/endpointsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Services().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.Service = result + return nil + +} + +// GetAllServiceReplicaSets returns all links of given type +func (obj *GlobalService) GetAllServiceReplicaSets(ctx context.Context) ( + result []*GlobalServiceReplicaSet, err error) { + result = make([]*GlobalServiceReplicaSet, 0, len(obj.Spec.ServiceReplicaSetsGvk)) + for _, v := range obj.Spec.ServiceReplicaSetsGvk { + l, err := obj.client.Global().GetServiceReplicaSetByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceReplicaSets returns link which has given displayName +func (obj *GlobalService) GetServiceReplicaSets(ctx context.Context, + displayName string) (result *GlobalServiceReplicaSet, err error) { + l, ok := obj.Spec.ServiceReplicaSetsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.Service", "ServiceReplicaSets", displayName) + } + result, err = obj.client.Global().GetServiceReplicaSetByName(ctx, l.Name) + return +} + +// LinkServiceReplicaSets links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalService) LinkServiceReplicaSets(ctx context.Context, + linkToAdd *GlobalServiceReplicaSet) error { + + payload := "{\"spec\": {\"serviceReplicaSetsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceReplicaSet\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().Services().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.Service = result + return nil +} + +// UnlinkServiceReplicaSets unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalService) UnlinkServiceReplicaSets(ctx context.Context, + linkToRemove *GlobalServiceReplicaSet) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceReplicaSetsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Services().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.Service = result + return nil + +} + +// GetAllServiceJobs returns all links of given type +func (obj *GlobalService) GetAllServiceJobs(ctx context.Context) ( + result []*GlobalServiceJob, err error) { + result = make([]*GlobalServiceJob, 0, len(obj.Spec.ServiceJobsGvk)) + for _, v := range obj.Spec.ServiceJobsGvk { + l, err := obj.client.Global().GetServiceJobByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServiceJobs returns link which has given displayName +func (obj *GlobalService) GetServiceJobs(ctx context.Context, + displayName string) (result *GlobalServiceJob, err error) { + l, ok := obj.Spec.ServiceJobsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.Service", "ServiceJobs", displayName) + } + result, err = obj.client.Global().GetServiceJobByName(ctx, l.Name) + return +} + +// LinkServiceJobs links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalService) LinkServiceJobs(ctx context.Context, + linkToAdd *GlobalServiceJob) error { + + payload := "{\"spec\": {\"serviceJobsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceJob\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().Services().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.Service = result + return nil +} + +// UnlinkServiceJobs unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalService) UnlinkServiceJobs(ctx context.Context, + linkToRemove *GlobalServiceJob) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/serviceJobsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Services().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.Service = result + return nil + +} + +type serviceGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *serviceGlobalTsmV1Chainer) Subscribe() { + key := "services.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewServiceInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *serviceGlobalTsmV1Chainer) Unsubscribe() { + key := "services.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *serviceGlobalTsmV1Chainer) IsSubscribed() bool { + key := "services.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *serviceGlobalTsmV1Chainer) AdditionalAttributes(name string) *additionalattributesGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["additionalattributeses.global.tsm.tanzu.vmware.com"] = name + return &additionalattributesGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetAdditionalAttributes calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *serviceGlobalTsmV1Chainer) GetAdditionalAttributes(ctx context.Context, displayName string) (result *GlobalAdditionalAttributes, err error) { + hashedName := helper.GetHashedName("additionalattributeses.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAdditionalAttributesByName(ctx, hashedName) +} + +// AddAdditionalAttributes calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *serviceGlobalTsmV1Chainer) AddAdditionalAttributes(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AdditionalAttributes) (result *GlobalAdditionalAttributes, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("additionalattributeses.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAdditionalAttributesByName(ctx, objToCreate) +} + +// DeleteAdditionalAttributes calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *serviceGlobalTsmV1Chainer) DeleteAdditionalAttributes(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("additionalattributeses.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAdditionalAttributesByName(ctx, hashedName) +} + +func (c *serviceGlobalTsmV1Chainer) ServiceVersions(name string) *serviceversionGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["serviceversions.global.tsm.tanzu.vmware.com"] = name + return &serviceversionGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetServiceVersions calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *serviceGlobalTsmV1Chainer) GetServiceVersions(ctx context.Context, displayName string) (result *GlobalServiceVersion, err error) { + hashedName := helper.GetHashedName("serviceversions.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceVersionByName(ctx, hashedName) +} + +// AddServiceVersions calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *serviceGlobalTsmV1Chainer) AddServiceVersions(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceVersion) (result *GlobalServiceVersion, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("serviceversions.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateServiceVersionByName(ctx, objToCreate) +} + +// DeleteServiceVersions calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *serviceGlobalTsmV1Chainer) DeleteServiceVersions(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("serviceversions.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceVersionByName(ctx, hashedName) +} + +// GetSloConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetSloConfigByName(ctx context.Context, hashedName string) (*GlobalSloConfig, error) { + key := "sloconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.SloConfig) + return &GlobalSloConfig{ + client: group.client, + SloConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + SloConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSloConfig{ + client: group.client, + SloConfig: result, + }, nil + } +} + +// DeleteSloConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteSloConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + SloConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.SloServicesGvk { + err := group.client. + Global().DeleteSloServiceConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + SloConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/slosGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateSloConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateSloConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SloConfig) (*GlobalSloConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.SloServicesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + SloConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"slosGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"SloConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSloConfig{ + client: group.client, + SloConfig: result, + }, nil +} + +// UpdateSloConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateSloConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.SloConfig) (*GlobalSloConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + SloConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + SloConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalSloConfig{ + client: group.client, + SloConfig: result, + }, nil +} + +// ListSloConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListSloConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalSloConfig, err error) { + key := "sloconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalSloConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.SloConfig) + result[k] = &GlobalSloConfig{ + client: group.client, + SloConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + SloConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalSloConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalSloConfig{ + client: group.client, + SloConfig: &item, + } + } + } + return +} + +type GlobalSloConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.SloConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalSloConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteSloConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.SloConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalSloConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateSloConfigByName(ctx, obj.SloConfig) + if err != nil { + return err + } + obj.SloConfig = result.SloConfig + return nil +} + +func (obj *GlobalSloConfig) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) +} + +// GetAllSloServices returns all children of given type +func (obj *GlobalSloConfig) GetAllSloServices(ctx context.Context) ( + result []*GlobalSloServiceConfig, err error) { + result = make([]*GlobalSloServiceConfig, 0, len(obj.Spec.SloServicesGvk)) + for _, v := range obj.Spec.SloServicesGvk { + l, err := obj.client.Global().GetSloServiceConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetSloServices returns child which has given displayName +func (obj *GlobalSloConfig) GetSloServices(ctx context.Context, + displayName string) (result *GlobalSloServiceConfig, err error) { + l, ok := obj.Spec.SloServicesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.SloConfig", "SloServices", displayName) + } + result, err = obj.client.Global().GetSloServiceConfigByName(ctx, l.Name) + return +} + +// AddSloServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalSloConfig) AddSloServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SloServiceConfig) (result *GlobalSloServiceConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["sloconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["sloconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateSloServiceConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetSloConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.SloConfig = updatedObj.SloConfig + } + return +} + +// DeleteSloServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalSloConfig) DeleteSloServices(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.SloServicesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.SloConfig", "SloServices", displayName) + } + err = obj.client.Global().DeleteSloServiceConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetSloConfigByName(ctx, obj.GetName()) + if err == nil { + obj.SloConfig = updatedObj.SloConfig + } + return +} + +type sloconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *sloconfigGlobalTsmV1Chainer) Subscribe() { + key := "sloconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSloConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *sloconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "sloconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *sloconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "sloconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *sloconfigGlobalTsmV1Chainer) SloServices(name string) *sloserviceconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["sloserviceconfigs.global.tsm.tanzu.vmware.com"] = name + return &sloserviceconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetSloServices calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *sloconfigGlobalTsmV1Chainer) GetSloServices(ctx context.Context, displayName string) (result *GlobalSloServiceConfig, err error) { + hashedName := helper.GetHashedName("sloserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetSloServiceConfigByName(ctx, hashedName) +} + +// AddSloServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *sloconfigGlobalTsmV1Chainer) AddSloServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SloServiceConfig) (result *GlobalSloServiceConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("sloserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateSloServiceConfigByName(ctx, objToCreate) +} + +// DeleteSloServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *sloconfigGlobalTsmV1Chainer) DeleteSloServices(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("sloserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteSloServiceConfigByName(ctx, hashedName) +} + +// GetSloServiceConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetSloServiceConfigByName(ctx context.Context, hashedName string) (*GlobalSloServiceConfig, error) { + key := "sloserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.SloServiceConfig) + return &GlobalSloServiceConfig{ + client: group.client, + SloServiceConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + SloServiceConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSloServiceConfig{ + client: group.client, + SloServiceConfig: result, + }, nil + } +} + +// DeleteSloServiceConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteSloServiceConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + SloServiceConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + SloServiceConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/sloServicesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["sloconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("sloconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + SloConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateSloServiceConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateSloServiceConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SloServiceConfig) (*GlobalSloServiceConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + SloServiceConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["sloconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("sloconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"sloServicesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"SloServiceConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + SloConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSloServiceConfig{ + client: group.client, + SloServiceConfig: result, + }, nil +} + +// UpdateSloServiceConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateSloServiceConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.SloServiceConfig) (*GlobalSloServiceConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + SloServiceConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueRemainingBudget := + objToUpdate.Spec.RemainingBudget + patchOpRemainingBudget := PatchOp{ + Op: "replace", + Path: "/spec/remainingBudget", + Value: patchValueRemainingBudget, + } + patch = append(patch, patchOpRemainingBudget) + + patchValueLastUpdateTime := + objToUpdate.Spec.LastUpdateTime + patchOpLastUpdateTime := PatchOp{ + Op: "replace", + Path: "/spec/lastUpdateTime", + Value: patchValueLastUpdateTime, + } + patch = append(patch, patchOpLastUpdateTime) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + SloServiceConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalSloServiceConfig{ + client: group.client, + SloServiceConfig: result, + }, nil +} + +// ListSloServiceConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListSloServiceConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalSloServiceConfig, err error) { + key := "sloserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalSloServiceConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.SloServiceConfig) + result[k] = &GlobalSloServiceConfig{ + client: group.client, + SloServiceConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + SloServiceConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalSloServiceConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalSloServiceConfig{ + client: group.client, + SloServiceConfig: &item, + } + } + } + return +} + +type GlobalSloServiceConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.SloServiceConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalSloServiceConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteSloServiceConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.SloServiceConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalSloServiceConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateSloServiceConfigByName(ctx, obj.SloServiceConfig) + if err != nil { + return err + } + obj.SloServiceConfig = result.SloServiceConfig + return nil +} + +func (obj *GlobalSloServiceConfig) GetParent(ctx context.Context) (result *GlobalSloConfig, err error) { + hashedName := helper.GetHashedName("sloconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["sloconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetSloConfigByName(ctx, hashedName) +} + +type sloserviceconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *sloserviceconfigGlobalTsmV1Chainer) Subscribe() { + key := "sloserviceconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSloServiceConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *sloserviceconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "sloserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *sloserviceconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "sloserviceconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetSLOFolderByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetSLOFolderByName(ctx context.Context, hashedName string) (*GlobalSLOFolder, error) { + key := "slofolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.SLOFolder) + return &GlobalSLOFolder{ + client: group.client, + SLOFolder: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + SLOFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSLOFolder{ + client: group.client, + SLOFolder: result, + }, nil + } +} + +// DeleteSLOFolderByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteSLOFolderByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + SLOFolders().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.SlosGvk { + err := group.client. + Global().DeleteFederatedSloConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + SLOFolders().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/sloFolderGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateSLOFolderByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateSLOFolderByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SLOFolder) (*GlobalSLOFolder, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.SlosGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + SLOFolders().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["runtimes.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/sloFolderGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "SLOFolder", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSLOFolder{ + client: group.client, + SLOFolder: result, + }, nil +} + +// UpdateSLOFolderByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateSLOFolderByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.SLOFolder) (*GlobalSLOFolder, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + SLOFolders().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + SLOFolders().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalSLOFolder{ + client: group.client, + SLOFolder: result, + }, nil +} + +// ListSLOFolders returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListSLOFolders(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalSLOFolder, err error) { + key := "slofolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalSLOFolder, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.SLOFolder) + result[k] = &GlobalSLOFolder{ + client: group.client, + SLOFolder: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + SLOFolders().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalSLOFolder, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalSLOFolder{ + client: group.client, + SLOFolder: &item, + } + } + } + return +} + +type GlobalSLOFolder struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.SLOFolder +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalSLOFolder) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteSLOFolderByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.SLOFolder = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalSLOFolder) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateSLOFolderByName(ctx, obj.SLOFolder) + if err != nil { + return err + } + obj.SLOFolder = result.SLOFolder + return nil +} + +func (obj *GlobalSLOFolder) GetParent(ctx context.Context) (result *GlobalRuntime, err error) { + hashedName := helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["runtimes.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetRuntimeByName(ctx, hashedName) +} + +// GetAllSlos returns all children of given type +func (obj *GlobalSLOFolder) GetAllSlos(ctx context.Context) ( + result []*GlobalFederatedSloConfig, err error) { + result = make([]*GlobalFederatedSloConfig, 0, len(obj.Spec.SlosGvk)) + for _, v := range obj.Spec.SlosGvk { + l, err := obj.client.Global().GetFederatedSloConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetSlos returns child which has given displayName +func (obj *GlobalSLOFolder) GetSlos(ctx context.Context, + displayName string) (result *GlobalFederatedSloConfig, err error) { + l, ok := obj.Spec.SlosGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.SLOFolder", "Slos", displayName) + } + result, err = obj.client.Global().GetFederatedSloConfigByName(ctx, l.Name) + return +} + +// AddSlos calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalSLOFolder) AddSlos(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.FederatedSloConfig) (result *GlobalFederatedSloConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["slofolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["slofolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateFederatedSloConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetSLOFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.SLOFolder = updatedObj.SLOFolder + } + return +} + +// DeleteSlos calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalSLOFolder) DeleteSlos(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.SlosGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.SLOFolder", "Slos", displayName) + } + err = obj.client.Global().DeleteFederatedSloConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetSLOFolderByName(ctx, obj.GetName()) + if err == nil { + obj.SLOFolder = updatedObj.SLOFolder + } + return +} + +type slofolderGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *slofolderGlobalTsmV1Chainer) Subscribe() { + key := "slofolders.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSLOFolderInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *slofolderGlobalTsmV1Chainer) Unsubscribe() { + key := "slofolders.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *slofolderGlobalTsmV1Chainer) IsSubscribed() bool { + key := "slofolders.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *slofolderGlobalTsmV1Chainer) Slos(name string) *federatedsloconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["federatedsloconfigs.global.tsm.tanzu.vmware.com"] = name + return &federatedsloconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetSlos calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *slofolderGlobalTsmV1Chainer) GetSlos(ctx context.Context, displayName string) (result *GlobalFederatedSloConfig, err error) { + hashedName := helper.GetHashedName("federatedsloconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetFederatedSloConfigByName(ctx, hashedName) +} + +// AddSlos calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *slofolderGlobalTsmV1Chainer) AddSlos(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.FederatedSloConfig) (result *GlobalFederatedSloConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("federatedsloconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateFederatedSloConfigByName(ctx, objToCreate) +} + +// DeleteSlos calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *slofolderGlobalTsmV1Chainer) DeleteSlos(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("federatedsloconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteFederatedSloConfigByName(ctx, hashedName) +} + +// GetFederatedSloConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetFederatedSloConfigByName(ctx context.Context, hashedName string) (*GlobalFederatedSloConfig, error) { + key := "federatedsloconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.FederatedSloConfig) + return &GlobalFederatedSloConfig{ + client: group.client, + FederatedSloConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + FederatedSloConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalFederatedSloConfig{ + client: group.client, + FederatedSloConfig: result, + }, nil + } +} + +// DeleteFederatedSloConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteFederatedSloConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + FederatedSloConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + for _, v := range result.Spec.SloServicesGvk { + err := group.client. + Global().DeleteFederatedSloServiceConfigByName(ctx, v.Name) + if err != nil { + return err + } + } + + err = group.client.baseClient. + GlobalTsmV1(). + FederatedSloConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/slosGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["slofolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("slofolders.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + SLOFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateFederatedSloConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateFederatedSloConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.FederatedSloConfig) (*GlobalFederatedSloConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.SloServicesGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + FederatedSloConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["slofolders.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("slofolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"slosGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"FederatedSloConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + SLOFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalFederatedSloConfig{ + client: group.client, + FederatedSloConfig: result, + }, nil +} + +// UpdateFederatedSloConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateFederatedSloConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.FederatedSloConfig) (*GlobalFederatedSloConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + FederatedSloConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + FederatedSloConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalFederatedSloConfig{ + client: group.client, + FederatedSloConfig: result, + }, nil +} + +// ListFederatedSloConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListFederatedSloConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalFederatedSloConfig, err error) { + key := "federatedsloconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalFederatedSloConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.FederatedSloConfig) + result[k] = &GlobalFederatedSloConfig{ + client: group.client, + FederatedSloConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + FederatedSloConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalFederatedSloConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalFederatedSloConfig{ + client: group.client, + FederatedSloConfig: &item, + } + } + } + return +} + +type GlobalFederatedSloConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.FederatedSloConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalFederatedSloConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteFederatedSloConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.FederatedSloConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalFederatedSloConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateFederatedSloConfigByName(ctx, obj.FederatedSloConfig) + if err != nil { + return err + } + obj.FederatedSloConfig = result.FederatedSloConfig + return nil +} + +func (obj *GlobalFederatedSloConfig) GetParent(ctx context.Context) (result *GlobalSLOFolder, err error) { + hashedName := helper.GetHashedName("slofolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["slofolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetSLOFolderByName(ctx, hashedName) +} + +// GetAllSloServices returns all children of given type +func (obj *GlobalFederatedSloConfig) GetAllSloServices(ctx context.Context) ( + result []*GlobalFederatedSloServiceConfig, err error) { + result = make([]*GlobalFederatedSloServiceConfig, 0, len(obj.Spec.SloServicesGvk)) + for _, v := range obj.Spec.SloServicesGvk { + l, err := obj.client.Global().GetFederatedSloServiceConfigByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetSloServices returns child which has given displayName +func (obj *GlobalFederatedSloConfig) GetSloServices(ctx context.Context, + displayName string) (result *GlobalFederatedSloServiceConfig, err error) { + l, ok := obj.Spec.SloServicesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.FederatedSloConfig", "SloServices", displayName) + } + result, err = obj.client.Global().GetFederatedSloServiceConfigByName(ctx, l.Name) + return +} + +// AddSloServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalFederatedSloConfig) AddSloServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.FederatedSloServiceConfig) (result *GlobalFederatedSloServiceConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["federatedsloconfigs.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["federatedsloconfigs.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateFederatedSloServiceConfigByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetFederatedSloConfigByName(ctx, obj.GetName()) + if getErr == nil { + obj.FederatedSloConfig = updatedObj.FederatedSloConfig + } + return +} + +// DeleteSloServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalFederatedSloConfig) DeleteSloServices(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.SloServicesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.FederatedSloConfig", "SloServices", displayName) + } + err = obj.client.Global().DeleteFederatedSloServiceConfigByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetFederatedSloConfigByName(ctx, obj.GetName()) + if err == nil { + obj.FederatedSloConfig = updatedObj.FederatedSloConfig + } + return +} + +type federatedsloconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *federatedsloconfigGlobalTsmV1Chainer) Subscribe() { + key := "federatedsloconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewFederatedSloConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *federatedsloconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "federatedsloconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *federatedsloconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "federatedsloconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +func (c *federatedsloconfigGlobalTsmV1Chainer) SloServices(name string) *federatedsloserviceconfigGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["federatedsloserviceconfigs.global.tsm.tanzu.vmware.com"] = name + return &federatedsloserviceconfigGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetSloServices calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *federatedsloconfigGlobalTsmV1Chainer) GetSloServices(ctx context.Context, displayName string) (result *GlobalFederatedSloServiceConfig, err error) { + hashedName := helper.GetHashedName("federatedsloserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetFederatedSloServiceConfigByName(ctx, hashedName) +} + +// AddSloServices calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *federatedsloconfigGlobalTsmV1Chainer) AddSloServices(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.FederatedSloServiceConfig) (result *GlobalFederatedSloServiceConfig, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("federatedsloserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateFederatedSloServiceConfigByName(ctx, objToCreate) +} + +// DeleteSloServices calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *federatedsloconfigGlobalTsmV1Chainer) DeleteSloServices(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("federatedsloserviceconfigs.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteFederatedSloServiceConfigByName(ctx, hashedName) +} + +// GetFederatedSloServiceConfigByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetFederatedSloServiceConfigByName(ctx context.Context, hashedName string) (*GlobalFederatedSloServiceConfig, error) { + key := "federatedsloserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.FederatedSloServiceConfig) + return &GlobalFederatedSloServiceConfig{ + client: group.client, + FederatedSloServiceConfig: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + FederatedSloServiceConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalFederatedSloServiceConfig{ + client: group.client, + FederatedSloServiceConfig: result, + }, nil + } +} + +// DeleteFederatedSloServiceConfigByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteFederatedSloServiceConfigByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + FederatedSloServiceConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + FederatedSloServiceConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/sloServicesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["federatedsloconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("federatedsloconfigs.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + FederatedSloConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateFederatedSloServiceConfigByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateFederatedSloServiceConfigByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.FederatedSloServiceConfig) (*GlobalFederatedSloServiceConfig, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + FederatedSloServiceConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["federatedsloconfigs.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("federatedsloconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"sloServicesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"FederatedSloServiceConfig\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + FederatedSloConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalFederatedSloServiceConfig{ + client: group.client, + FederatedSloServiceConfig: result, + }, nil +} + +// UpdateFederatedSloServiceConfigByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateFederatedSloServiceConfigByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.FederatedSloServiceConfig) (*GlobalFederatedSloServiceConfig, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + FederatedSloServiceConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueRemainingBudget := + objToUpdate.Spec.RemainingBudget + patchOpRemainingBudget := PatchOp{ + Op: "replace", + Path: "/spec/remainingBudget", + Value: patchValueRemainingBudget, + } + patch = append(patch, patchOpRemainingBudget) + + patchValueLastUpdateTime := + objToUpdate.Spec.LastUpdateTime + patchOpLastUpdateTime := PatchOp{ + Op: "replace", + Path: "/spec/lastUpdateTime", + Value: patchValueLastUpdateTime, + } + patch = append(patch, patchOpLastUpdateTime) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + FederatedSloServiceConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalFederatedSloServiceConfig{ + client: group.client, + FederatedSloServiceConfig: result, + }, nil +} + +// ListFederatedSloServiceConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListFederatedSloServiceConfigs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalFederatedSloServiceConfig, err error) { + key := "federatedsloserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalFederatedSloServiceConfig, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.FederatedSloServiceConfig) + result[k] = &GlobalFederatedSloServiceConfig{ + client: group.client, + FederatedSloServiceConfig: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + FederatedSloServiceConfigs().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalFederatedSloServiceConfig, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalFederatedSloServiceConfig{ + client: group.client, + FederatedSloServiceConfig: &item, + } + } + } + return +} + +type GlobalFederatedSloServiceConfig struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.FederatedSloServiceConfig +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalFederatedSloServiceConfig) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteFederatedSloServiceConfigByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.FederatedSloServiceConfig = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalFederatedSloServiceConfig) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateFederatedSloServiceConfigByName(ctx, obj.FederatedSloServiceConfig) + if err != nil { + return err + } + obj.FederatedSloServiceConfig = result.FederatedSloServiceConfig + return nil +} + +func (obj *GlobalFederatedSloServiceConfig) GetParent(ctx context.Context) (result *GlobalFederatedSloConfig, err error) { + hashedName := helper.GetHashedName("federatedsloconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["federatedsloconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetFederatedSloConfigByName(ctx, hashedName) +} + +type federatedsloserviceconfigGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *federatedsloserviceconfigGlobalTsmV1Chainer) Subscribe() { + key := "federatedsloserviceconfigs.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewFederatedSloServiceConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *federatedsloserviceconfigGlobalTsmV1Chainer) Unsubscribe() { + key := "federatedsloserviceconfigs.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *federatedsloserviceconfigGlobalTsmV1Chainer) IsSubscribed() bool { + key := "federatedsloserviceconfigs.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetSLOPolicyByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetSLOPolicyByName(ctx context.Context, hashedName string) (*GlobalSLOPolicy, error) { + key := "slopolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.SLOPolicy) + return &GlobalSLOPolicy{ + client: group.client, + SLOPolicy: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + SLOPolicies().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSLOPolicy{ + client: group.client, + SLOPolicy: result, + }, nil + } +} + +// DeleteSLOPolicyByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteSLOPolicyByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + SLOPolicies().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + SLOPolicies().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/sloPoliciesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateSLOPolicyByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateSLOPolicyByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SLOPolicy) (*GlobalSLOPolicy, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + result, err := group.client.baseClient. + GlobalTsmV1(). + SLOPolicies().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["gnss.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"sloPoliciesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"SLOPolicy\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSLOPolicy{ + client: group.client, + SLOPolicy: result, + }, nil +} + +// UpdateSLOPolicyByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateSLOPolicyByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.SLOPolicy) (*GlobalSLOPolicy, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + SLOPolicies().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, + } + patch = append(patch, patchOpName) + + patchValueDisabled := + objToUpdate.Spec.Disabled + patchOpDisabled := PatchOp{ + Op: "replace", + Path: "/spec/disabled", + Value: patchValueDisabled, + } + patch = append(patch, patchOpDisabled) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueSlis := + objToUpdate.Spec.Slis + patchOpSlis := PatchOp{ + Op: "replace", + Path: "/spec/slis", + Value: patchValueSlis, + } + patch = append(patch, patchOpSlis) + + if objToUpdate.Spec.ServiceNames != nil { + patchValueServiceNames := + objToUpdate.Spec.ServiceNames + patchOpServiceNames := PatchOp{ + Op: "replace", + Path: "/spec/serviceNames", + Value: patchValueServiceNames, + } + patch = append(patch, patchOpServiceNames) + } + + patchValueSloTargetValue := + objToUpdate.Spec.SloTargetValue + patchOpSloTargetValue := PatchOp{ + Op: "replace", + Path: "/spec/sloTargetValue", + Value: patchValueSloTargetValue, + } + patch = append(patch, patchOpSloTargetValue) + + patchValueSloPeriod := + objToUpdate.Spec.SloPeriod + patchOpSloPeriod := PatchOp{ + Op: "replace", + Path: "/spec/sloPeriod", + Value: patchValueSloPeriod, + } + patch = append(patch, patchOpSloPeriod) + + patchValueSloKind := + objToUpdate.Spec.SloKind + patchOpSloKind := PatchOp{ + Op: "replace", + Path: "/spec/sloKind", + Value: patchValueSloKind, + } + patch = append(patch, patchOpSloKind) + + if objToUpdate.Spec.Actions != nil { + patchValueActions := + objToUpdate.Spec.Actions + patchOpActions := PatchOp{ + Op: "replace", + Path: "/spec/actions", + Value: patchValueActions, + } + patch = append(patch, patchOpActions) + } + + patchValueSloCreationTime := + objToUpdate.Spec.SloCreationTime + patchOpSloCreationTime := PatchOp{ + Op: "replace", + Path: "/spec/sloCreationTime", + Value: patchValueSloCreationTime, + } + patch = append(patch, patchOpSloCreationTime) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + SLOPolicies().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalSLOPolicy{ + client: group.client, + SLOPolicy: result, + }, nil +} + +// ListSLOPolicies returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListSLOPolicies(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalSLOPolicy, err error) { + key := "slopolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalSLOPolicy, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.SLOPolicy) + result[k] = &GlobalSLOPolicy{ + client: group.client, + SLOPolicy: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + SLOPolicies().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalSLOPolicy, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalSLOPolicy{ + client: group.client, + SLOPolicy: &item, + } + } + } + return +} + +type GlobalSLOPolicy struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.SLOPolicy +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalSLOPolicy) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteSLOPolicyByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.SLOPolicy = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalSLOPolicy) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateSLOPolicyByName(ctx, obj.SLOPolicy) + if err != nil { + return err + } + obj.SLOPolicy = result.SLOPolicy + return nil +} + +func (obj *GlobalSLOPolicy) GetParent(ctx context.Context) (result *GlobalGNS, err error) { + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnss.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGNSByName(ctx, hashedName) +} + +type slopolicyGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string +} + +func (c *slopolicyGlobalTsmV1Chainer) Subscribe() { + key := "slopolicies.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSLOPolicyInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *slopolicyGlobalTsmV1Chainer) Unsubscribe() { + key := "slopolicies.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } +} + +func (c *slopolicyGlobalTsmV1Chainer) IsSubscribed() bool { + key := "slopolicies.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok +} + +// GetSvcGroupByName returns object stored in the database under the hashedName which is a hash of display +// name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) GetSvcGroupByName(ctx context.Context, hashedName string) (*GlobalSvcGroup, error) { + key := "svcgroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) + if !exists { + return nil, err + } + + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.SvcGroup) + return &GlobalSvcGroup{ + client: group.client, + SvcGroup: result, + }, nil + } else { + result, err := group.client.baseClient. + GlobalTsmV1(). + SvcGroups().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSvcGroup{ + client: group.client, + SvcGroup: result, + }, nil + } +} + +// DeleteSvcGroupByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteSvcGroupByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + SvcGroups().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + SvcGroups().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/svcGroupsGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["resourcegroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + ResourceGroups().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + + return +} + +// CreateSvcGroupByName creates object in the database without hashing the name. +// Use it directly ONLY when objToCreate.Name is hashed name of the object. +func (group *GlobalTsmV1) CreateSvcGroupByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.SvcGroup) (*GlobalSvcGroup, error) { + if objToCreate.GetLabels() == nil { + objToCreate.Labels = make(map[string]string) + } + if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + } + + objToCreate.Spec.ServicesGvk = nil + objToCreate.Spec.DeploymentsGvk = nil + objToCreate.Spec.DaemonsetsGvk = nil + objToCreate.Spec.StatefulsetsGvk = nil + objToCreate.Spec.JobsGvk = nil + + result, err := group.client.baseClient. + GlobalTsmV1(). + SvcGroups().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["resourcegroups.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"svcGroupsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"SvcGroup\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + ResourceGroups().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return nil, err + } + + return &GlobalSvcGroup{ + client: group.client, + SvcGroup: result, + }, nil +} + +// UpdateSvcGroupByName updates object stored in the database under the hashedName which is a hash of +// display name and parents names. +func (group *GlobalTsmV1) UpdateSvcGroupByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.SvcGroup) (*GlobalSvcGroup, error) { + + // ResourceVersion must be set for update + if objToUpdate.ResourceVersion == "" { + current, err := group.client.baseClient. + GlobalTsmV1(). + SvcGroups().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + objToUpdate.ResourceVersion = current.ResourceVersion + } + + var patch Patch + patch = append(patch, PatchOp{ + Op: "replace", + Path: "/metadata", + Value: objToUpdate.ObjectMeta, + }) + + patchValueDisplayName := + objToUpdate.Spec.DisplayName + patchOpDisplayName := PatchOp{ + Op: "replace", + Path: "/spec/displayName", + Value: patchValueDisplayName, + } + patch = append(patch, patchOpDisplayName) + + patchValueInternalPredefinedGroup := + objToUpdate.Spec.InternalPredefinedGroup + patchOpInternalPredefinedGroup := PatchOp{ + Op: "replace", + Path: "/spec/internalPredefinedGroup", + Value: patchValueInternalPredefinedGroup, + } + patch = append(patch, patchOpInternalPredefinedGroup) + + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ + Op: "replace", + Path: "/spec/description", + Value: patchValueDescription, + } + patch = append(patch, patchOpDescription) + + patchValueColor := + objToUpdate.Spec.Color + patchOpColor := PatchOp{ + Op: "replace", + Path: "/spec/color", + Value: patchValueColor, + } + patch = append(patch, patchOpColor) + + patchValueProjectId := + objToUpdate.Spec.ProjectId + patchOpProjectId := PatchOp{ + Op: "replace", + Path: "/spec/projectId", + Value: patchValueProjectId, + } + patch = append(patch, patchOpProjectId) + + patchValueRules := + objToUpdate.Spec.Rules + patchOpRules := PatchOp{ + Op: "replace", + Path: "/spec/rules", + Value: patchValueRules, + } + patch = append(patch, patchOpRules) + + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } + result, err := group.client.baseClient. + GlobalTsmV1(). + SvcGroups().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + if err != nil { + return nil, err + } + + return &GlobalSvcGroup{ + client: group.client, + SvcGroup: result, + }, nil +} + +// ListSvcGroups returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListSvcGroups(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalSvcGroup, err error) { + key := "svcgroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + items := s.(subscription).informer.GetStore().List() + result = make([]*GlobalSvcGroup, len(items)) + for k, v := range items { + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.SvcGroup) + result[k] = &GlobalSvcGroup{ + client: group.client, + SvcGroup: item, + } + } + } else { + list, err := group.client.baseClient.GlobalTsmV1(). + SvcGroups().List(ctx, opts) + if err != nil { + return nil, err + } + result = make([]*GlobalSvcGroup, len(list.Items)) + for k, v := range list.Items { + item := v + result[k] = &GlobalSvcGroup{ + client: group.client, + SvcGroup: &item, + } + } + } + return +} + +type GlobalSvcGroup struct { + client *Clientset + *baseglobaltsmtanzuvmwarecomv1.SvcGroup +} + +// Delete removes obj and all it's children from the database. +func (obj *GlobalSvcGroup) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteSvcGroupByName(ctx, obj.GetName()) + if err != nil { + return err + } + obj.SvcGroup = nil + return nil +} + +// Update updates spec of object in database. Children and Link can not be updated using this function. +func (obj *GlobalSvcGroup) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateSvcGroupByName(ctx, obj.SvcGroup) + if err != nil { + return err + } + obj.SvcGroup = result.SvcGroup + return nil +} + +func (obj *GlobalSvcGroup) GetParent(ctx context.Context) (result *GlobalResourceGroup, err error) { + hashedName := helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["resourcegroups.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetResourceGroupByName(ctx, hashedName) +} + +// GetAllServices returns all links of given type +func (obj *GlobalSvcGroup) GetAllServices(ctx context.Context) ( + result []*GlobalService, err error) { + result = make([]*GlobalService, 0, len(obj.Spec.ServicesGvk)) + for _, v := range obj.Spec.ServicesGvk { + l, err := obj.client.Global().GetServiceByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetServices returns link which has given displayName +func (obj *GlobalSvcGroup) GetServices(ctx context.Context, + displayName string) (result *GlobalService, err error) { + l, ok := obj.Spec.ServicesGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.SvcGroup", "Services", displayName) + } + result, err = obj.client.Global().GetServiceByName(ctx, l.Name) + return +} + +// LinkServices links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalSvcGroup) LinkServices(ctx context.Context, + linkToAdd *GlobalService) error { + + payload := "{\"spec\": {\"servicesGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"Service\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().SvcGroups().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.SvcGroup = result + return nil +} + +// UnlinkServices unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalSvcGroup) UnlinkServices(ctx context.Context, + linkToRemove *GlobalService) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/servicesGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().SvcGroups().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.SvcGroup = result + return nil + +} + +// GetAllDeployments returns all links of given type +func (obj *GlobalSvcGroup) GetAllDeployments(ctx context.Context) ( + result []*GlobalServiceDeployment, err error) { + result = make([]*GlobalServiceDeployment, 0, len(obj.Spec.DeploymentsGvk)) + for _, v := range obj.Spec.DeploymentsGvk { + l, err := obj.client.Global().GetServiceDeploymentByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetDeployments returns link which has given displayName +func (obj *GlobalSvcGroup) GetDeployments(ctx context.Context, + displayName string) (result *GlobalServiceDeployment, err error) { + l, ok := obj.Spec.DeploymentsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.SvcGroup", "Deployments", displayName) + } + result, err = obj.client.Global().GetServiceDeploymentByName(ctx, l.Name) + return +} + +// LinkDeployments links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalSvcGroup) LinkDeployments(ctx context.Context, + linkToAdd *GlobalServiceDeployment) error { + + payload := "{\"spec\": {\"deploymentsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceDeployment\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().SvcGroups().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } + + obj.SvcGroup = result + return nil +} + +// UnlinkDeployments unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalSvcGroup) UnlinkDeployments(ctx context.Context, + linkToRemove *GlobalServiceDeployment) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/deploymentsGvk/" + linkToRemove.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().SvcGroups().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.SvcGroup = result + return nil + +} + +// GetAllDaemonsets returns all links of given type +func (obj *GlobalSvcGroup) GetAllDaemonsets(ctx context.Context) ( + result []*GlobalServiceDaemonSet, err error) { + result = make([]*GlobalServiceDaemonSet, 0, len(obj.Spec.DaemonsetsGvk)) + for _, v := range obj.Spec.DaemonsetsGvk { + l, err := obj.client.Global().GetServiceDaemonSetByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetDaemonsets returns link which has given displayName +func (obj *GlobalSvcGroup) GetDaemonsets(ctx context.Context, + displayName string) (result *GlobalServiceDaemonSet, err error) { + l, ok := obj.Spec.DaemonsetsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.SvcGroup", "Daemonsets", displayName) + } + result, err = obj.client.Global().GetServiceDaemonSetByName(ctx, l.Name) + return +} + +// LinkDaemonsets links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalSvcGroup) LinkDaemonsets(ctx context.Context, + linkToAdd *GlobalServiceDaemonSet) error { + + payload := "{\"spec\": {\"daemonsetsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceDaemonSet\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().SvcGroups().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err } - key = "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com" - if _, ok := subscriptionMap.Load(key); !ok { - informer := informerpolicypkgtsmtanzuvmwarecomv1.NewAccessControlPolicyInformer(c.baseClient, 0, cache.Indexers{}) - subscribe(key, informer) - } + obj.SvcGroup = result + return nil +} - key = "acpconfigs.policypkg.tsm.tanzu.vmware.com" - if _, ok := subscriptionMap.Load(key); !ok { - informer := informerpolicypkgtsmtanzuvmwarecomv1.NewACPConfigInformer(c.baseClient, 0, cache.Indexers{}) - subscribe(key, informer) - } +// UnlinkDaemonsets unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalSvcGroup) UnlinkDaemonsets(ctx context.Context, + linkToRemove *GlobalServiceDaemonSet) (err error) { + var patch Patch - key = "vmpolicies.policypkg.tsm.tanzu.vmware.com" - if _, ok := subscriptionMap.Load(key); !ok { - informer := informerpolicypkgtsmtanzuvmwarecomv1.NewVMpolicyInformer(c.baseClient, 0, cache.Indexers{}) - subscribe(key, informer) + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/daemonsetsGvk/" + linkToRemove.DisplayName(), } - key = "randompolicydatas.policypkg.tsm.tanzu.vmware.com" - if _, ok := subscriptionMap.Load(key); !ok { - informer := informerpolicypkgtsmtanzuvmwarecomv1.NewRandomPolicyDataInformer(c.baseClient, 0, cache.Indexers{}) - subscribe(key, informer) + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err } + result, err := obj.client.baseClient.GlobalTsmV1().SvcGroups().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.SvcGroup = result + return nil } -func (c *Clientset) UnsubscribeAll() { - subscriptionMap.Range(func(key, s interface{}) bool { - close(s.(subscription).stop) - subscriptionMap.Delete(key) - return true - }) +// GetAllStatefulsets returns all links of given type +func (obj *GlobalSvcGroup) GetAllStatefulsets(ctx context.Context) ( + result []*GlobalServiceStatefulSet, err error) { + result = make([]*GlobalServiceStatefulSet, 0, len(obj.Spec.StatefulsetsGvk)) + for _, v := range obj.Spec.StatefulsetsGvk { + l, err := obj.client.Global().GetServiceStatefulSetByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return } -// NewForConfig returns Client which can be which can be used to connect to database -func NewForConfig(config *rest.Config) (*Clientset, error) { - baseClient, err := baseClientset.NewForConfig(config) - if err != nil { - return nil, err +// GetStatefulsets returns link which has given displayName +func (obj *GlobalSvcGroup) GetStatefulsets(ctx context.Context, + displayName string) (result *GlobalServiceStatefulSet, err error) { + l, ok := obj.Spec.StatefulsetsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.SvcGroup", "Statefulsets", displayName) } - client := &Clientset{} - client.baseClient = baseClient - client.rootTsmV1 = newRootTsmV1(client) - client.configTsmV1 = newConfigTsmV1(client) - client.gnsTsmV1 = newGnsTsmV1(client) - client.servicegroupTsmV1 = newServicegroupTsmV1(client) - client.policypkgTsmV1 = newPolicypkgTsmV1(client) - - return client, nil + result, err = obj.client.Global().GetServiceStatefulSetByName(ctx, l.Name) + return } -// NewFakeClient creates simple client which can be used for unit tests -func NewFakeClient() *Clientset { - client := &Clientset{} - client.baseClient = fakeBaseClienset.NewSimpleClientset() - client.rootTsmV1 = newRootTsmV1(client) - client.configTsmV1 = newConfigTsmV1(client) - client.gnsTsmV1 = newGnsTsmV1(client) - client.servicegroupTsmV1 = newServicegroupTsmV1(client) - client.policypkgTsmV1 = newPolicypkgTsmV1(client) +// LinkStatefulsets links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalSvcGroup) LinkStatefulsets(ctx context.Context, + linkToAdd *GlobalServiceStatefulSet) error { - return client -} + payload := "{\"spec\": {\"statefulsetsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceStatefulSet\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().SvcGroups().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err + } -type PatchOp struct { - Op string `json:"op"` - Path string `json:"path"` - Value interface{} `json:"value,omitempty"` + obj.SvcGroup = result + return nil } -type Patch []PatchOp +// UnlinkStatefulsets unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalSvcGroup) UnlinkStatefulsets(ctx context.Context, + linkToRemove *GlobalServiceStatefulSet) (err error) { + var patch Patch -func (p Patch) Marshal() ([]byte, error) { - return json.Marshal(p) -} + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/statefulsetsGvk/" + linkToRemove.DisplayName(), + } -func (c *Clientset) Root() *RootTsmV1 { - return c.rootTsmV1 -} -func (c *Clientset) Config() *ConfigTsmV1 { - return c.configTsmV1 -} -func (c *Clientset) Gns() *GnsTsmV1 { - return c.gnsTsmV1 -} -func (c *Clientset) Servicegroup() *ServicegroupTsmV1 { - return c.servicegroupTsmV1 -} -func (c *Clientset) Policypkg() *PolicypkgTsmV1 { - return c.policypkgTsmV1 -} + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().SvcGroups().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.SvcGroup = result + return nil -type RootTsmV1 struct { - client *Clientset } -func newRootTsmV1(client *Clientset) *RootTsmV1 { - return &RootTsmV1{ - client: client, +// GetAllJobs returns all links of given type +func (obj *GlobalSvcGroup) GetAllJobs(ctx context.Context) ( + result []*GlobalServiceJob, err error) { + result = make([]*GlobalServiceJob, 0, len(obj.Spec.JobsGvk)) + for _, v := range obj.Spec.JobsGvk { + l, err := obj.client.Global().GetServiceJobByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) } + return } -type ConfigTsmV1 struct { - client *Clientset +// GetJobs returns link which has given displayName +func (obj *GlobalSvcGroup) GetJobs(ctx context.Context, + displayName string) (result *GlobalServiceJob, err error) { + l, ok := obj.Spec.JobsGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.SvcGroup", "Jobs", displayName) + } + result, err = obj.client.Global().GetServiceJobByName(ctx, l.Name) + return } -func newConfigTsmV1(client *Clientset) *ConfigTsmV1 { - return &ConfigTsmV1{ - client: client, +// LinkJobs links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalSvcGroup) LinkJobs(ctx context.Context, + linkToAdd *GlobalServiceJob) error { + + payload := "{\"spec\": {\"jobsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"ServiceJob\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().SvcGroups().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + if err != nil { + return err } -} -type GnsTsmV1 struct { - client *Clientset + obj.SvcGroup = result + return nil } -func newGnsTsmV1(client *Clientset) *GnsTsmV1 { - return &GnsTsmV1{ - client: client, +// UnlinkJobs unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalSvcGroup) UnlinkJobs(ctx context.Context, + linkToRemove *GlobalServiceJob) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/jobsGvk/" + linkToRemove.DisplayName(), } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().SvcGroups().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.SvcGroup = result + return nil + } -type ServicegroupTsmV1 struct { - client *Clientset +type svcgroupGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string } -func newServicegroupTsmV1(client *Clientset) *ServicegroupTsmV1 { - return &ServicegroupTsmV1{ - client: client, +func (c *svcgroupGlobalTsmV1Chainer) Subscribe() { + key := "svcgroups.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewSvcGroupInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) } } -type PolicypkgTsmV1 struct { - client *Clientset +func (c *svcgroupGlobalTsmV1Chainer) Unsubscribe() { + key := "svcgroups.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) + } } -func newPolicypkgTsmV1(client *Clientset) *PolicypkgTsmV1 { - return &PolicypkgTsmV1{ - client: client, - } +func (c *svcgroupGlobalTsmV1Chainer) IsSubscribed() bool { + key := "svcgroups.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok } -// GetRootByName returns object stored in the database under the hashedName which is a hash of display +// GetTableByName returns object stored in the database under the hashedName which is a hash of display // name and parents names. Use it when you know hashed name of object. -func (group *RootTsmV1) GetRootByName(ctx context.Context, hashedName string) (*RootRoot, error) { - key := "roots.root.tsm.tanzu.vmware.com" +func (group *GlobalTsmV1) GetTableByName(ctx context.Context, hashedName string) (*GlobalTable, error) { + key := "tables.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) if !exists { return nil, err } - result, _ := item.(*baseroottsmtanzuvmwarecomv1.Root) - return &RootRoot{ + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Table) + return &GlobalTable{ client: group.client, - Root: result, + Table: result, }, nil } else { result, err := group.client.baseClient. - RootTsmV1(). - Roots().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + Tables().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return nil, err } - return &RootRoot{ + return &GlobalTable{ client: group.client, - Root: result, + Table: result, }, nil } } -// DeleteRootByName deletes object stored in the database under the hashedName which is a hash of +// DeleteTableByName deletes object stored in the database under the hashedName which is a hash of // display name and parents names. Use it when you know hashed name of object. -func (group *RootTsmV1) DeleteRootByName(ctx context.Context, hashedName string) (err error) { +func (group *GlobalTsmV1) DeleteTableByName(ctx context.Context, hashedName string) (err error) { result, err := group.client.baseClient. - RootTsmV1(). - Roots().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + Tables().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return err } - if result.Spec.ConfigGvk != nil { - err := group.client. - Config(). - DeleteConfigByName(ctx, result.Spec.ConfigGvk.Name) - if err != nil { - return err - } + err = group.client.baseClient. + GlobalTsmV1(). + Tables().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err } - err = group.client.baseClient. - RootTsmV1(). - Roots().Delete(ctx, hashedName, metav1.DeleteOptions{}) + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/tablesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["databases.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("databases.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Databases().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err } @@ -356,50 +85009,59 @@ func (group *RootTsmV1) DeleteRootByName(ctx context.Context, hashedName string) return } -// CreateRootByName creates object in the database without hashing the name. +// CreateTableByName creates object in the database without hashing the name. // Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *RootTsmV1) CreateRootByName(ctx context.Context, - objToCreate *baseroottsmtanzuvmwarecomv1.Root) (*RootRoot, error) { +func (group *GlobalTsmV1) CreateTableByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Table) (*GlobalTable, error) { if objToCreate.GetLabels() == nil { objToCreate.Labels = make(map[string]string) } if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() } - if objToCreate.Labels[common.DISPLAY_NAME_LABEL] == "" { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = helper.DEFAULT_KEY - } - if objToCreate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { - return nil, NewSingletonNameError(objToCreate.Labels[common.DISPLAY_NAME_LABEL]) - } - objToCreate.Spec.ConfigGvk = nil + objToCreate.Spec.TemplateGvk = nil + objToCreate.Spec.InventoryGvk = nil result, err := group.client.baseClient. - RootTsmV1(). - Roots().Create(ctx, objToCreate, metav1.CreateOptions{}) + GlobalTsmV1(). + Tables().Create(ctx, objToCreate, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + parentName, ok := objToCreate.GetLabels()["databases.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("databases.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + } + + payload := "{\"spec\": {\"tablesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"Table\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Databases().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) if err != nil { return nil, err } - return &RootRoot{ + return &GlobalTable{ client: group.client, - Root: result, + Table: result, }, nil } -// UpdateRootByName updates object stored in the database under the hashedName which is a hash of +// UpdateTableByName updates object stored in the database under the hashedName which is a hash of // display name and parents names. -func (group *RootTsmV1) UpdateRootByName(ctx context.Context, - objToUpdate *baseroottsmtanzuvmwarecomv1.Root) (*RootRoot, error) { - if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { - return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) - } +func (group *GlobalTsmV1) UpdateTableByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Table) (*GlobalTable, error) { + // ResourceVersion must be set for update if objToUpdate.ResourceVersion == "" { current, err := group.client.baseClient. - RootTsmV1(). - Roots().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + GlobalTsmV1(). + Tables().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) if err != nil { return nil, err } @@ -418,348 +85080,314 @@ func (group *RootTsmV1) UpdateRootByName(ctx context.Context, return nil, err } result, err := group.client.baseClient. - RootTsmV1(). - Roots().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + GlobalTsmV1(). + Tables().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") if err != nil { return nil, err } - return &RootRoot{ + return &GlobalTable{ client: group.client, - Root: result, + Table: result, }, nil } -// ListRoots returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *RootTsmV1) ListRoots(ctx context.Context, - opts metav1.ListOptions) (result []*RootRoot, err error) { - key := "roots.root.tsm.tanzu.vmware.com" +// ListTables returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListTables(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalTable, err error) { + key := "tables.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { items := s.(subscription).informer.GetStore().List() - result = make([]*RootRoot, len(items)) + result = make([]*GlobalTable, len(items)) for k, v := range items { - item, _ := v.(*baseroottsmtanzuvmwarecomv1.Root) - result[k] = &RootRoot{ + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Table) + result[k] = &GlobalTable{ client: group.client, - Root: item, + Table: item, } } } else { - list, err := group.client.baseClient.RootTsmV1(). - Roots().List(ctx, opts) + list, err := group.client.baseClient.GlobalTsmV1(). + Tables().List(ctx, opts) if err != nil { return nil, err } - result = make([]*RootRoot, len(list.Items)) + result = make([]*GlobalTable, len(list.Items)) for k, v := range list.Items { item := v - result[k] = &RootRoot{ + result[k] = &GlobalTable{ client: group.client, - Root: &item, + Table: &item, } } } return } -type RootRoot struct { +type GlobalTable struct { client *Clientset - *baseroottsmtanzuvmwarecomv1.Root + *baseglobaltsmtanzuvmwarecomv1.Table } // Delete removes obj and all it's children from the database. -func (obj *RootRoot) Delete(ctx context.Context) error { - err := obj.client.Root().DeleteRootByName(ctx, obj.GetName()) +func (obj *GlobalTable) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteTableByName(ctx, obj.GetName()) if err != nil { return err } - obj.Root = nil + obj.Table = nil return nil } // Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *RootRoot) Update(ctx context.Context) error { - result, err := obj.client.Root().UpdateRootByName(ctx, obj.Root) +func (obj *GlobalTable) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateTableByName(ctx, obj.Table) if err != nil { return err } - obj.Root = result.Root + obj.Table = result.Table return nil } -// GetRootRoot calculates the hashed name based on parents and -// returns given object -func (c *Clientset) GetRootRoot(ctx context.Context) (result *RootRoot, err error) { - hashedName := helper.GetHashedName("roots.root.tsm.tanzu.vmware.com", nil, helper.DEFAULT_KEY) - return c.Root().GetRootByName(ctx, hashedName) +func (obj *GlobalTable) GetParent(ctx context.Context) (result *GlobalDatabase, err error) { + hashedName := helper.GetHashedName("databases.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["databases.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDatabaseByName(ctx, hashedName) } -func (c *Clientset) RootRoot() *rootRootTsmV1Chainer { - parentLabels := make(map[string]string) - parentLabels["roots.root.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY - return &rootRootTsmV1Chainer{ - client: c, - name: helper.DEFAULT_KEY, - parentLabels: parentLabels, +// GetTemplate returns link of given type +func (obj *GlobalTable) GetTemplate(ctx context.Context) ( + result *GlobalTemplate, err error) { + if obj.Spec.TemplateGvk == nil { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.Table", "Template") } + return obj.client.Global().GetTemplateByName(ctx, obj.Spec.TemplateGvk.Name) } -// AddRootRoot calculates hashed name of the object based on -// parents names and creates it. objToCreate.Name is changed to the hashed name. Original name (helper.DEFAULT_KEY) is preserved in -// nexus/display_name label and can be obtained using DisplayName() method. -func (c *Clientset) AddRootRoot(ctx context.Context, - objToCreate *baseroottsmtanzuvmwarecomv1.Root) (result *RootRoot, err error) { - if objToCreate.GetName() == "" { - objToCreate.SetName(helper.DEFAULT_KEY) - } - if objToCreate.GetName() != helper.DEFAULT_KEY { - return nil, NewSingletonNameError(objToCreate.GetName()) +// LinkTemplate links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalTable) LinkTemplate(ctx context.Context, + linkToAdd *GlobalTemplate) error { + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/templateGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "Template", + Name: linkToAdd.Name, + }, } - if objToCreate.Labels == nil { - objToCreate.Labels = map[string]string{} + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err } - if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() - objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName(objToCreate.CRDName(), nil, objToCreate.GetName()) - objToCreate.Name = hashedName + result, err := obj.client.baseClient.GlobalTsmV1().Tables().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err } - return c.Root().CreateRootByName(ctx, objToCreate) -} -// DeleteRootRoot calculates hashedName of object based on -// parents and deletes given object -func (c *Clientset) DeleteRootRoot(ctx context.Context) (err error) { - hashedName := helper.GetHashedName("roots.root.tsm.tanzu.vmware.com", nil, helper.DEFAULT_KEY) - return c.Root().DeleteRootByName(ctx, hashedName) + obj.Table = result + return nil } -// GetConfig returns child of given type -func (obj *RootRoot) GetConfig(ctx context.Context) ( - result *ConfigConfig, err error) { - if obj.Spec.ConfigGvk == nil { - return nil, NewChildNotFound(obj.DisplayName(), "Root.Root", "Config") +// UnlinkTemplate unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalTable) UnlinkTemplate(ctx context.Context) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/templateGvk", + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + result, err := obj.client.baseClient.GlobalTsmV1().Tables().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err } - return obj.client.Config().GetConfigByName(ctx, obj.Spec.ConfigGvk.Name) + obj.Table = result + return nil + } -// AddConfig calculates hashed name of the child to create based on objToCreate.Name -// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in -// nexus/display_name label and can be obtained using DisplayName() method. -func (obj *RootRoot) AddConfig(ctx context.Context, - objToCreate *baseconfigtsmtanzuvmwarecomv1.Config) (result *ConfigConfig, err error) { - if objToCreate.Labels == nil { - objToCreate.Labels = map[string]string{} +// GetInventory returns link of given type +func (obj *GlobalTable) GetInventory(ctx context.Context) ( + result *GlobalInventory, err error) { + if obj.Spec.InventoryGvk == nil { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.Table", "Inventory") } - for _, v := range helper.GetCRDParentsMap()["roots.root.tsm.tanzu.vmware.com"] { - objToCreate.Labels[v] = obj.Labels[v] + return obj.client.Global().GetInventoryByName(ctx, obj.Spec.InventoryGvk.Name) +} + +// LinkInventory links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalTable) LinkInventory(ctx context.Context, + linkToAdd *GlobalInventory) error { + + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/inventoryGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "Inventory", + Name: linkToAdd.Name, + }, } - objToCreate.Labels["roots.root.tsm.tanzu.vmware.com"] = obj.DisplayName() - if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() - objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) - objToCreate.Name = hashedName + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err } - result, err = obj.client.Config().CreateConfigByName(ctx, objToCreate) - updatedObj, getErr := obj.client.Root().GetRootByName(ctx, obj.GetName()) - if getErr == nil { - obj.Root = updatedObj.Root + result, err := obj.client.baseClient.GlobalTsmV1().Tables().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err } - return + + obj.Table = result + return nil } -// DeleteConfig calculates hashed name of the child to delete based on displayName -// and parents names and deletes it. +// UnlinkInventory unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalTable) UnlinkInventory(ctx context.Context) (err error) { + var patch Patch -func (obj *RootRoot) DeleteConfig(ctx context.Context) (err error) { - if obj.Spec.ConfigGvk != nil { - err = obj.client. - Config().DeleteConfigByName(ctx, obj.Spec.ConfigGvk.Name) - if err != nil { - return err - } + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/inventoryGvk", } - updatedObj, err := obj.client. - Root().GetRootByName(ctx, obj.GetName()) - if err == nil { - obj.Root = updatedObj.Root + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err } - return + result, err := obj.client.baseClient.GlobalTsmV1().Tables().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.Table = result + return nil + } -type rootRootTsmV1Chainer struct { +type tableGlobalTsmV1Chainer struct { client *Clientset name string parentLabels map[string]string } -func (c *rootRootTsmV1Chainer) Subscribe() { - key := "roots.root.tsm.tanzu.vmware.com" +func (c *tableGlobalTsmV1Chainer) Subscribe() { + key := "tables.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informerroottsmtanzuvmwarecomv1.NewRootInformer(c.client.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewTableInformer(c.client.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } } -func (c *rootRootTsmV1Chainer) Unsubscribe() { - key := "roots.root.tsm.tanzu.vmware.com" +func (c *tableGlobalTsmV1Chainer) Unsubscribe() { + key := "tables.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { close(s.(subscription).stop) subscriptionMap.Delete(key) } } -func (c *rootRootTsmV1Chainer) IsSubscribed() bool { - key := "roots.root.tsm.tanzu.vmware.com" +func (c *tableGlobalTsmV1Chainer) IsSubscribed() bool { + key := "tables.global.tsm.tanzu.vmware.com" _, ok := subscriptionMap.Load(key) return ok } -func (c *rootRootTsmV1Chainer) Config(name string) *configConfigTsmV1Chainer { - parentLabels := c.parentLabels - parentLabels["configs.config.tsm.tanzu.vmware.com"] = name - return &configConfigTsmV1Chainer{ - client: c.client, - name: name, - parentLabels: parentLabels, - } -} - -// GetConfig calculates hashed name of the object based on displayName and it's parents and returns the object -func (c *rootRootTsmV1Chainer) GetConfig(ctx context.Context, displayName string) (result *ConfigConfig, err error) { - hashedName := helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", c.parentLabels, displayName) - return c.client.Config().GetConfigByName(ctx, hashedName) -} - -// AddConfig calculates hashed name of the child to create based on objToCreate.Name -// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in -// nexus/display_name label and can be obtained using DisplayName() method. -func (c *rootRootTsmV1Chainer) AddConfig(ctx context.Context, - objToCreate *baseconfigtsmtanzuvmwarecomv1.Config) (result *ConfigConfig, err error) { - if objToCreate.Labels == nil { - objToCreate.Labels = map[string]string{} - } - for k, v := range c.parentLabels { - objToCreate.Labels[k] = v - } - if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() - objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) - objToCreate.Name = hashedName - } - return c.client.Config().CreateConfigByName(ctx, objToCreate) -} - -// DeleteConfig calculates hashed name of the child to delete based on displayName -// and parents names and deletes it. -func (c *rootRootTsmV1Chainer) DeleteConfig(ctx context.Context, name string) (err error) { - if c.parentLabels == nil { - c.parentLabels = map[string]string{} - } - c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", c.parentLabels, name) - return c.client.Config().DeleteConfigByName(ctx, hashedName) -} - -// GetConfigByName returns object stored in the database under the hashedName which is a hash of display +// GetTemplateGroupByName returns object stored in the database under the hashedName which is a hash of display // name and parents names. Use it when you know hashed name of object. -func (group *ConfigTsmV1) GetConfigByName(ctx context.Context, hashedName string) (*ConfigConfig, error) { - key := "configs.config.tsm.tanzu.vmware.com" +func (group *GlobalTsmV1) GetTemplateGroupByName(ctx context.Context, hashedName string) (*GlobalTemplateGroup, error) { + key := "templategroups.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) if !exists { return nil, err } - result, _ := item.(*baseconfigtsmtanzuvmwarecomv1.Config) - return &ConfigConfig{ - client: group.client, - Config: result, + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.TemplateGroup) + return &GlobalTemplateGroup{ + client: group.client, + TemplateGroup: result, }, nil } else { result, err := group.client.baseClient. - ConfigTsmV1(). - Configs().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + TemplateGroups().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return nil, err } - return &ConfigConfig{ - client: group.client, - Config: result, + return &GlobalTemplateGroup{ + client: group.client, + TemplateGroup: result, }, nil } } -// DeleteConfigByName deletes object stored in the database under the hashedName which is a hash of +// DeleteTemplateGroupByName deletes object stored in the database under the hashedName which is a hash of // display name and parents names. Use it when you know hashed name of object. -func (group *ConfigTsmV1) DeleteConfigByName(ctx context.Context, hashedName string) (err error) { +func (group *GlobalTsmV1) DeleteTemplateGroupByName(ctx context.Context, hashedName string) (err error) { result, err := group.client.baseClient. - ConfigTsmV1(). - Configs().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + TemplateGroups().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return err } - if result.Spec.GNSGvk != nil { - err := group.client. - Gns(). - DeleteGnsByName(ctx, result.Spec.GNSGvk.Name) - if err != nil { - return err - } - } - - if result.Spec.DNSGvk != nil { + for _, v := range result.Spec.DataTemplatesGvk { err := group.client. - Gns(). - DeleteDnsByName(ctx, result.Spec.DNSGvk.Name) + Global().DeleteDataTemplateByName(ctx, v.Name) if err != nil { return err } } - if result.Spec.VMPPoliciesGvk != nil { + for _, v := range result.Spec.NodeTemplatesGvk { err := group.client. - Policypkg(). - DeleteVMpolicyByName(ctx, result.Spec.VMPPoliciesGvk.Name) + Global().DeleteNodeTemplateByName(ctx, v.Name) if err != nil { return err } } - if result.Spec.DomainGvk != nil { + for _, v := range result.Spec.AppTemplatesGvk { err := group.client. - Config(). - DeleteDomainByName(ctx, result.Spec.DomainGvk.Name) + Global().DeleteAppTemplateByName(ctx, v.Name) if err != nil { return err } } - for _, v := range result.Spec.FooExampleGvk { + for _, v := range result.Spec.ServiceTemplatesGvk { err := group.client. - Config().DeleteFooTypeABCByName(ctx, v.Name) + Global().DeleteServiceTemplateByName(ctx, v.Name) if err != nil { return err } } - if result.Spec.SvcGrpInfoGvk != nil { + for _, v := range result.Spec.PolicyTemplatesGvk { err := group.client. - Servicegroup(). - DeleteSvcGroupLinkInfoByName(ctx, result.Spec.SvcGrpInfoGvk.Name) + Global().DeletePolicyTemplateByName(ctx, v.Name) if err != nil { return err } } err = group.client.baseClient. - ConfigTsmV1(). - Configs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + GlobalTsmV1(). + TemplateGroups().Delete(ctx, hashedName, metav1.DeleteOptions{}) if err != nil { return err } @@ -768,7 +85396,7 @@ func (group *ConfigTsmV1) DeleteConfigByName(ctx context.Context, hashedName str patchOp := PatchOp{ Op: "remove", - Path: "/spec/configGvk", + Path: "/spec/templateGroupsGvk/" + result.DisplayName(), } patch = append(patch, patchOp) @@ -780,16 +85408,16 @@ func (group *ConfigTsmV1) DeleteConfigByName(ctx context.Context, hashedName str if parents == nil { parents = make(map[string]string) } - parentName, ok := parents["roots.root.tsm.tanzu.vmware.com"] + parentName, ok := parents["templates.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if parents[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("roots.root.tsm.tanzu.vmware.com", parents, parentName) + parentName = helper.GetHashedName("templates.global.tsm.tanzu.vmware.com", parents, parentName) } _, err = group.client.baseClient. - RootTsmV1(). - Roots().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + Templates().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err } @@ -797,10 +85425,10 @@ func (group *ConfigTsmV1) DeleteConfigByName(ctx context.Context, hashedName str return } -// CreateConfigByName creates object in the database without hashing the name. +// CreateTemplateGroupByName creates object in the database without hashing the name. // Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *ConfigTsmV1) CreateConfigByName(ctx context.Context, - objToCreate *baseconfigtsmtanzuvmwarecomv1.Config) (*ConfigConfig, error) { +func (group *GlobalTsmV1) CreateTemplateGroupByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.TemplateGroup) (*GlobalTemplateGroup, error) { if objToCreate.GetLabels() == nil { objToCreate.Labels = make(map[string]string) } @@ -808,67 +85436,51 @@ func (group *ConfigTsmV1) CreateConfigByName(ctx context.Context, objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() } - objToCreate.Spec.GNSGvk = nil - objToCreate.Spec.DNSGvk = nil - objToCreate.Spec.VMPPoliciesGvk = nil - objToCreate.Spec.DomainGvk = nil - objToCreate.Spec.FooExampleGvk = nil - objToCreate.Spec.SvcGrpInfoGvk = nil - objToCreate.Spec.ACPPoliciesGvk = nil + objToCreate.Spec.DataTemplatesGvk = nil + objToCreate.Spec.NodeTemplatesGvk = nil + objToCreate.Spec.AppTemplatesGvk = nil + objToCreate.Spec.ServiceTemplatesGvk = nil + objToCreate.Spec.PolicyTemplatesGvk = nil result, err := group.client.baseClient. - ConfigTsmV1(). - Configs().Create(ctx, objToCreate, metav1.CreateOptions{}) + GlobalTsmV1(). + TemplateGroups().Create(ctx, objToCreate, metav1.CreateOptions{}) if err != nil { return nil, err } - parentName, ok := objToCreate.GetLabels()["roots.root.tsm.tanzu.vmware.com"] + parentName, ok := objToCreate.GetLabels()["templates.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("roots.root.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + parentName = helper.GetHashedName("templates.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) } - var patch Patch - patchOp := PatchOp{ - Op: "replace", - Path: "/spec/configGvk", - Value: baseconfigtsmtanzuvmwarecomv1.Child{ - Group: "config.tsm.tanzu.vmware.com", - Kind: "Config", - Name: objToCreate.Name, - }, - } - patch = append(patch, patchOp) - marshaled, err := patch.Marshal() - if err != nil { - return nil, err - } + payload := "{\"spec\": {\"templateGroupsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"TemplateGroup\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" _, err = group.client.baseClient. - RootTsmV1(). - Roots().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + Templates().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) if err != nil { return nil, err } - return &ConfigConfig{ - client: group.client, - Config: result, + return &GlobalTemplateGroup{ + client: group.client, + TemplateGroup: result, }, nil } -// UpdateConfigByName updates object stored in the database under the hashedName which is a hash of +// UpdateTemplateGroupByName updates object stored in the database under the hashedName which is a hash of // display name and parents names. -func (group *ConfigTsmV1) UpdateConfigByName(ctx context.Context, - objToUpdate *baseconfigtsmtanzuvmwarecomv1.Config) (*ConfigConfig, error) { +func (group *GlobalTsmV1) UpdateTemplateGroupByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.TemplateGroup) (*GlobalTemplateGroup, error) { // ResourceVersion must be set for update if objToUpdate.ResourceVersion == "" { current, err := group.client.baseClient. - ConfigTsmV1(). - Configs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + GlobalTsmV1(). + TemplateGroups().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) if err != nil { return nil, err } @@ -882,402 +85494,240 @@ func (group *ConfigTsmV1) UpdateConfigByName(ctx context.Context, Value: objToUpdate.ObjectMeta, }) - patchValueMyStr0 := - objToUpdate.Spec.MyStr0 - patchOpMyStr0 := PatchOp{ - Op: "replace", - Path: "/spec/myStr0", - Value: patchValueMyStr0, - } - patch = append(patch, patchOpMyStr0) - - if objToUpdate.Spec.MyStr1 != nil { - patchValueMyStr1 := - objToUpdate.Spec.MyStr1 - patchOpMyStr1 := PatchOp{ - Op: "replace", - Path: "/spec/myStr1", - Value: patchValueMyStr1, - } - patch = append(patch, patchOpMyStr1) - } - - if objToUpdate.Spec.MyStr2 != nil { - patchValueMyStr2 := - objToUpdate.Spec.MyStr2 - patchOpMyStr2 := PatchOp{ - Op: "replace", - Path: "/spec/myStr2", - Value: patchValueMyStr2, - } - patch = append(patch, patchOpMyStr2) - } - - patchValueXYZPort := - objToUpdate.Spec.XYZPort - patchOpXYZPort := PatchOp{ - Op: "replace", - Path: "/spec/xYZPort", - Value: patchValueXYZPort, - } - patch = append(patch, patchOpXYZPort) - - if objToUpdate.Spec.ABCHost != nil { - patchValueABCHost := - objToUpdate.Spec.ABCHost - patchOpABCHost := PatchOp{ - Op: "replace", - Path: "/spec/aBCHost", - Value: patchValueABCHost, - } - patch = append(patch, patchOpABCHost) - } - - if objToUpdate.Spec.ClusterNamespaces != nil { - patchValueClusterNamespaces := - objToUpdate.Spec.ClusterNamespaces - patchOpClusterNamespaces := PatchOp{ - Op: "replace", - Path: "/spec/clusterNamespaces", - Value: patchValueClusterNamespaces, - } - patch = append(patch, patchOpClusterNamespaces) - } - - patchValueTestValMarkers := - objToUpdate.Spec.TestValMarkers - patchOpTestValMarkers := PatchOp{ - Op: "replace", - Path: "/spec/testValMarkers", - Value: patchValueTestValMarkers, - } - patch = append(patch, patchOpTestValMarkers) - - patchValueInstance := - objToUpdate.Spec.Instance - patchOpInstance := PatchOp{ - Op: "replace", - Path: "/spec/instance", - Value: patchValueInstance, - } - patch = append(patch, patchOpInstance) - - patchValueCuOption := - objToUpdate.Spec.CuOption - patchOpCuOption := PatchOp{ + patchValueProjectId := + objToUpdate.Spec.ProjectId + patchOpProjectId := PatchOp{ Op: "replace", - Path: "/spec/option_cu", - Value: patchValueCuOption, + Path: "/spec/projectId", + Value: patchValueProjectId, } - patch = append(patch, patchOpCuOption) + patch = append(patch, patchOpProjectId) marshaled, err := patch.Marshal() if err != nil { return nil, err } result, err := group.client.baseClient. - ConfigTsmV1(). - Configs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + GlobalTsmV1(). + TemplateGroups().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") if err != nil { return nil, err } - return &ConfigConfig{ - client: group.client, - Config: result, + return &GlobalTemplateGroup{ + client: group.client, + TemplateGroup: result, }, nil } -// ListConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *ConfigTsmV1) ListConfigs(ctx context.Context, - opts metav1.ListOptions) (result []*ConfigConfig, err error) { - key := "configs.config.tsm.tanzu.vmware.com" +// ListTemplateGroups returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListTemplateGroups(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalTemplateGroup, err error) { + key := "templategroups.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { items := s.(subscription).informer.GetStore().List() - result = make([]*ConfigConfig, len(items)) + result = make([]*GlobalTemplateGroup, len(items)) for k, v := range items { - item, _ := v.(*baseconfigtsmtanzuvmwarecomv1.Config) - result[k] = &ConfigConfig{ - client: group.client, - Config: item, + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.TemplateGroup) + result[k] = &GlobalTemplateGroup{ + client: group.client, + TemplateGroup: item, } } } else { - list, err := group.client.baseClient.ConfigTsmV1(). - Configs().List(ctx, opts) + list, err := group.client.baseClient.GlobalTsmV1(). + TemplateGroups().List(ctx, opts) if err != nil { return nil, err } - result = make([]*ConfigConfig, len(list.Items)) + result = make([]*GlobalTemplateGroup, len(list.Items)) for k, v := range list.Items { item := v - result[k] = &ConfigConfig{ - client: group.client, - Config: &item, + result[k] = &GlobalTemplateGroup{ + client: group.client, + TemplateGroup: &item, } } } return } -type ConfigConfig struct { +type GlobalTemplateGroup struct { client *Clientset - *baseconfigtsmtanzuvmwarecomv1.Config + *baseglobaltsmtanzuvmwarecomv1.TemplateGroup } // Delete removes obj and all it's children from the database. -func (obj *ConfigConfig) Delete(ctx context.Context) error { - err := obj.client.Config().DeleteConfigByName(ctx, obj.GetName()) +func (obj *GlobalTemplateGroup) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteTemplateGroupByName(ctx, obj.GetName()) if err != nil { return err } - obj.Config = nil + obj.TemplateGroup = nil return nil } // Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *ConfigConfig) Update(ctx context.Context) error { - result, err := obj.client.Config().UpdateConfigByName(ctx, obj.Config) +func (obj *GlobalTemplateGroup) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateTemplateGroupByName(ctx, obj.TemplateGroup) if err != nil { return err } - obj.Config = result.Config + obj.TemplateGroup = result.TemplateGroup return nil } -func (obj *ConfigConfig) GetParent(ctx context.Context) (result *RootRoot, err error) { - hashedName := helper.GetHashedName("roots.root.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["roots.root.tsm.tanzu.vmware.com"]) - return obj.client.Root().GetRootByName(ctx, hashedName) -} - -// GetGNS returns child of given type -func (obj *ConfigConfig) GetGNS(ctx context.Context) ( - result *GnsGns, err error) { - if obj.Spec.GNSGvk == nil { - return nil, NewChildNotFound(obj.DisplayName(), "Config.Config", "GNS") - } - return obj.client.Gns().GetGnsByName(ctx, obj.Spec.GNSGvk.Name) -} - -// AddGNS calculates hashed name of the child to create based on objToCreate.Name -// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in -// nexus/display_name label and can be obtained using DisplayName() method. -func (obj *ConfigConfig) AddGNS(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.Gns) (result *GnsGns, err error) { - if objToCreate.Labels == nil { - objToCreate.Labels = map[string]string{} - } - for _, v := range helper.GetCRDParentsMap()["configs.config.tsm.tanzu.vmware.com"] { - objToCreate.Labels[v] = obj.Labels[v] - } - objToCreate.Labels["configs.config.tsm.tanzu.vmware.com"] = obj.DisplayName() - if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() - objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) - objToCreate.Name = hashedName - } - result, err = obj.client.Gns().CreateGnsByName(ctx, objToCreate) - updatedObj, getErr := obj.client.Config().GetConfigByName(ctx, obj.GetName()) - if getErr == nil { - obj.Config = updatedObj.Config - } - return -} - -// DeleteGNS calculates hashed name of the child to delete based on displayName -// and parents names and deletes it. - -func (obj *ConfigConfig) DeleteGNS(ctx context.Context) (err error) { - if obj.Spec.GNSGvk != nil { - err = obj.client. - Gns().DeleteGnsByName(ctx, obj.Spec.GNSGvk.Name) - if err != nil { - return err - } - } - updatedObj, err := obj.client. - Config().GetConfigByName(ctx, obj.GetName()) - if err == nil { - obj.Config = updatedObj.Config - } - return -} - -// GetDNS returns child of given type -func (obj *ConfigConfig) GetDNS(ctx context.Context) ( - result *GnsDns, err error) { - if obj.Spec.DNSGvk == nil { - return nil, NewChildNotFound(obj.DisplayName(), "Config.Config", "DNS") - } - return obj.client.Gns().GetDnsByName(ctx, obj.Spec.DNSGvk.Name) -} - -// AddDNS calculates hashed name of the child to create based on objToCreate.Name -// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in -// nexus/display_name label and can be obtained using DisplayName() method. -func (obj *ConfigConfig) AddDNS(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.Dns) (result *GnsDns, err error) { - if objToCreate.Labels == nil { - objToCreate.Labels = map[string]string{} - } - for _, v := range helper.GetCRDParentsMap()["configs.config.tsm.tanzu.vmware.com"] { - objToCreate.Labels[v] = obj.Labels[v] - } - objToCreate.Labels["configs.config.tsm.tanzu.vmware.com"] = obj.DisplayName() - if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { - if objToCreate.GetName() == "" { - objToCreate.SetName(helper.DEFAULT_KEY) - } - if objToCreate.GetName() != helper.DEFAULT_KEY { - return nil, NewSingletonNameError(objToCreate.GetName()) - } - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() - objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) - objToCreate.Name = hashedName - } - result, err = obj.client.Gns().CreateDnsByName(ctx, objToCreate) - updatedObj, getErr := obj.client.Config().GetConfigByName(ctx, obj.GetName()) - if getErr == nil { - obj.Config = updatedObj.Config - } - return +func (obj *GlobalTemplateGroup) GetParent(ctx context.Context) (result *GlobalTemplate, err error) { + hashedName := helper.GetHashedName("templates.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["templates.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetTemplateByName(ctx, hashedName) } -// DeleteDNS calculates hashed name of the child to delete based on displayName -// and parents names and deletes it. - -func (obj *ConfigConfig) DeleteDNS(ctx context.Context) (err error) { - if obj.Spec.DNSGvk != nil { - err = obj.client. - Gns().DeleteDnsByName(ctx, obj.Spec.DNSGvk.Name) +// GetAllDataTemplates returns all children of given type +func (obj *GlobalTemplateGroup) GetAllDataTemplates(ctx context.Context) ( + result []*GlobalDataTemplate, err error) { + result = make([]*GlobalDataTemplate, 0, len(obj.Spec.DataTemplatesGvk)) + for _, v := range obj.Spec.DataTemplatesGvk { + l, err := obj.client.Global().GetDataTemplateByName(ctx, v.Name) if err != nil { - return err + return nil, err } - } - updatedObj, err := obj.client. - Config().GetConfigByName(ctx, obj.GetName()) - if err == nil { - obj.Config = updatedObj.Config + result = append(result, l) } return } -// GetVMPPolicies returns child of given type -func (obj *ConfigConfig) GetVMPPolicies(ctx context.Context) ( - result *PolicypkgVMpolicy, err error) { - if obj.Spec.VMPPoliciesGvk == nil { - return nil, NewChildNotFound(obj.DisplayName(), "Config.Config", "VMPPolicies") +// GetDataTemplates returns child which has given displayName +func (obj *GlobalTemplateGroup) GetDataTemplates(ctx context.Context, + displayName string) (result *GlobalDataTemplate, err error) { + l, ok := obj.Spec.DataTemplatesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.TemplateGroup", "DataTemplates", displayName) } - return obj.client.Policypkg().GetVMpolicyByName(ctx, obj.Spec.VMPPoliciesGvk.Name) + result, err = obj.client.Global().GetDataTemplateByName(ctx, l.Name) + return } -// AddVMPPolicies calculates hashed name of the child to create based on objToCreate.Name +// AddDataTemplates calculates hashed name of the child to create based on objToCreate.Name // and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in // nexus/display_name label and can be obtained using DisplayName() method. -func (obj *ConfigConfig) AddVMPPolicies(ctx context.Context, - objToCreate *basepolicypkgtsmtanzuvmwarecomv1.VMpolicy) (result *PolicypkgVMpolicy, err error) { +func (obj *GlobalTemplateGroup) AddDataTemplates(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataTemplate) (result *GlobalDataTemplate, err error) { if objToCreate.Labels == nil { objToCreate.Labels = map[string]string{} } - for _, v := range helper.GetCRDParentsMap()["configs.config.tsm.tanzu.vmware.com"] { + for _, v := range helper.GetCRDParentsMap()["templategroups.global.tsm.tanzu.vmware.com"] { objToCreate.Labels[v] = obj.Labels[v] } - objToCreate.Labels["configs.config.tsm.tanzu.vmware.com"] = obj.DisplayName() + objToCreate.Labels["templategroups.global.tsm.tanzu.vmware.com"] = obj.DisplayName() if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) objToCreate.Name = hashedName } - result, err = obj.client.Policypkg().CreateVMpolicyByName(ctx, objToCreate) - updatedObj, getErr := obj.client.Config().GetConfigByName(ctx, obj.GetName()) + result, err = obj.client.Global().CreateDataTemplateByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetTemplateGroupByName(ctx, obj.GetName()) if getErr == nil { - obj.Config = updatedObj.Config + obj.TemplateGroup = updatedObj.TemplateGroup } return } -// DeleteVMPPolicies calculates hashed name of the child to delete based on displayName +// DeleteDataTemplates calculates hashed name of the child to delete based on displayName // and parents names and deletes it. -func (obj *ConfigConfig) DeleteVMPPolicies(ctx context.Context) (err error) { - if obj.Spec.VMPPoliciesGvk != nil { - err = obj.client. - Policypkg().DeleteVMpolicyByName(ctx, obj.Spec.VMPPoliciesGvk.Name) - if err != nil { - return err - } +func (obj *GlobalTemplateGroup) DeleteDataTemplates(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.DataTemplatesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.TemplateGroup", "DataTemplates", displayName) } - updatedObj, err := obj.client. - Config().GetConfigByName(ctx, obj.GetName()) + err = obj.client.Global().DeleteDataTemplateByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetTemplateGroupByName(ctx, obj.GetName()) if err == nil { - obj.Config = updatedObj.Config + obj.TemplateGroup = updatedObj.TemplateGroup } return } -// GetDomain returns child of given type -func (obj *ConfigConfig) GetDomain(ctx context.Context) ( - result *ConfigDomain, err error) { - if obj.Spec.DomainGvk == nil { - return nil, NewChildNotFound(obj.DisplayName(), "Config.Config", "Domain") +// GetAllNodeTemplates returns all children of given type +func (obj *GlobalTemplateGroup) GetAllNodeTemplates(ctx context.Context) ( + result []*GlobalNodeTemplate, err error) { + result = make([]*GlobalNodeTemplate, 0, len(obj.Spec.NodeTemplatesGvk)) + for _, v := range obj.Spec.NodeTemplatesGvk { + l, err := obj.client.Global().GetNodeTemplateByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) } - return obj.client.Config().GetDomainByName(ctx, obj.Spec.DomainGvk.Name) + return } -// AddDomain calculates hashed name of the child to create based on objToCreate.Name +// GetNodeTemplates returns child which has given displayName +func (obj *GlobalTemplateGroup) GetNodeTemplates(ctx context.Context, + displayName string) (result *GlobalNodeTemplate, err error) { + l, ok := obj.Spec.NodeTemplatesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.TemplateGroup", "NodeTemplates", displayName) + } + result, err = obj.client.Global().GetNodeTemplateByName(ctx, l.Name) + return +} + +// AddNodeTemplates calculates hashed name of the child to create based on objToCreate.Name // and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in // nexus/display_name label and can be obtained using DisplayName() method. -func (obj *ConfigConfig) AddDomain(ctx context.Context, - objToCreate *baseconfigtsmtanzuvmwarecomv1.Domain) (result *ConfigDomain, err error) { +func (obj *GlobalTemplateGroup) AddNodeTemplates(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeTemplate) (result *GlobalNodeTemplate, err error) { if objToCreate.Labels == nil { objToCreate.Labels = map[string]string{} } - for _, v := range helper.GetCRDParentsMap()["configs.config.tsm.tanzu.vmware.com"] { + for _, v := range helper.GetCRDParentsMap()["templategroups.global.tsm.tanzu.vmware.com"] { objToCreate.Labels[v] = obj.Labels[v] } - objToCreate.Labels["configs.config.tsm.tanzu.vmware.com"] = obj.DisplayName() + objToCreate.Labels["templategroups.global.tsm.tanzu.vmware.com"] = obj.DisplayName() if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) objToCreate.Name = hashedName } - result, err = obj.client.Config().CreateDomainByName(ctx, objToCreate) - updatedObj, getErr := obj.client.Config().GetConfigByName(ctx, obj.GetName()) + result, err = obj.client.Global().CreateNodeTemplateByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetTemplateGroupByName(ctx, obj.GetName()) if getErr == nil { - obj.Config = updatedObj.Config + obj.TemplateGroup = updatedObj.TemplateGroup } return } -// DeleteDomain calculates hashed name of the child to delete based on displayName +// DeleteNodeTemplates calculates hashed name of the child to delete based on displayName // and parents names and deletes it. -func (obj *ConfigConfig) DeleteDomain(ctx context.Context) (err error) { - if obj.Spec.DomainGvk != nil { - err = obj.client. - Config().DeleteDomainByName(ctx, obj.Spec.DomainGvk.Name) - if err != nil { - return err - } +func (obj *GlobalTemplateGroup) DeleteNodeTemplates(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.NodeTemplatesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.TemplateGroup", "NodeTemplates", displayName) } - updatedObj, err := obj.client. - Config().GetConfigByName(ctx, obj.GetName()) + err = obj.client.Global().DeleteNodeTemplateByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetTemplateGroupByName(ctx, obj.GetName()) if err == nil { - obj.Config = updatedObj.Config + obj.TemplateGroup = updatedObj.TemplateGroup } return } -// GetAllFooExample returns all children of given type -func (obj *ConfigConfig) GetAllFooExample(ctx context.Context) ( - result []*ConfigFooTypeABC, err error) { - result = make([]*ConfigFooTypeABC, 0, len(obj.Spec.FooExampleGvk)) - for _, v := range obj.Spec.FooExampleGvk { - l, err := obj.client.Config().GetFooTypeABCByName(ctx, v.Name) +// GetAllAppTemplates returns all children of given type +func (obj *GlobalTemplateGroup) GetAllAppTemplates(ctx context.Context) ( + result []*GlobalAppTemplate, err error) { + result = make([]*GlobalAppTemplate, 0, len(obj.Spec.AppTemplatesGvk)) + for _, v := range obj.Spec.AppTemplatesGvk { + l, err := obj.client.Global().GetAppTemplateByName(ctx, v.Name) if err != nil { return nil, err } @@ -1286,122 +85736,138 @@ func (obj *ConfigConfig) GetAllFooExample(ctx context.Context) ( return } -// GetFooExample returns child which has given displayName -func (obj *ConfigConfig) GetFooExample(ctx context.Context, - displayName string) (result *ConfigFooTypeABC, err error) { - l, ok := obj.Spec.FooExampleGvk[displayName] +// GetAppTemplates returns child which has given displayName +func (obj *GlobalTemplateGroup) GetAppTemplates(ctx context.Context, + displayName string) (result *GlobalAppTemplate, err error) { + l, ok := obj.Spec.AppTemplatesGvk[displayName] if !ok { - return nil, NewChildNotFound(obj.DisplayName(), "Config.Config", "FooExample", displayName) + return nil, NewChildNotFound(obj.DisplayName(), "Global.TemplateGroup", "AppTemplates", displayName) } - result, err = obj.client.Config().GetFooTypeABCByName(ctx, l.Name) + result, err = obj.client.Global().GetAppTemplateByName(ctx, l.Name) return } -// AddFooExample calculates hashed name of the child to create based on objToCreate.Name +// AddAppTemplates calculates hashed name of the child to create based on objToCreate.Name // and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in // nexus/display_name label and can be obtained using DisplayName() method. -func (obj *ConfigConfig) AddFooExample(ctx context.Context, - objToCreate *baseconfigtsmtanzuvmwarecomv1.FooTypeABC) (result *ConfigFooTypeABC, err error) { +func (obj *GlobalTemplateGroup) AddAppTemplates(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppTemplate) (result *GlobalAppTemplate, err error) { if objToCreate.Labels == nil { objToCreate.Labels = map[string]string{} } - for _, v := range helper.GetCRDParentsMap()["configs.config.tsm.tanzu.vmware.com"] { + for _, v := range helper.GetCRDParentsMap()["templategroups.global.tsm.tanzu.vmware.com"] { objToCreate.Labels[v] = obj.Labels[v] } - objToCreate.Labels["configs.config.tsm.tanzu.vmware.com"] = obj.DisplayName() + objToCreate.Labels["templategroups.global.tsm.tanzu.vmware.com"] = obj.DisplayName() if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) objToCreate.Name = hashedName } - result, err = obj.client.Config().CreateFooTypeABCByName(ctx, objToCreate) - updatedObj, getErr := obj.client.Config().GetConfigByName(ctx, obj.GetName()) + result, err = obj.client.Global().CreateAppTemplateByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetTemplateGroupByName(ctx, obj.GetName()) if getErr == nil { - obj.Config = updatedObj.Config + obj.TemplateGroup = updatedObj.TemplateGroup } return } -// DeleteFooExample calculates hashed name of the child to delete based on displayName +// DeleteAppTemplates calculates hashed name of the child to delete based on displayName // and parents names and deletes it. -func (obj *ConfigConfig) DeleteFooExample(ctx context.Context, displayName string) (err error) { - l, ok := obj.Spec.FooExampleGvk[displayName] +func (obj *GlobalTemplateGroup) DeleteAppTemplates(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.AppTemplatesGvk[displayName] if !ok { - return NewChildNotFound(obj.DisplayName(), "Config.Config", "FooExample", displayName) + return NewChildNotFound(obj.DisplayName(), "Global.TemplateGroup", "AppTemplates", displayName) } - err = obj.client.Config().DeleteFooTypeABCByName(ctx, l.Name) + err = obj.client.Global().DeleteAppTemplateByName(ctx, l.Name) if err != nil { return err } - updatedObj, err := obj.client.Config().GetConfigByName(ctx, obj.GetName()) + updatedObj, err := obj.client.Global().GetTemplateGroupByName(ctx, obj.GetName()) if err == nil { - obj.Config = updatedObj.Config + obj.TemplateGroup = updatedObj.TemplateGroup + } + return +} + +// GetAllServiceTemplates returns all children of given type +func (obj *GlobalTemplateGroup) GetAllServiceTemplates(ctx context.Context) ( + result []*GlobalServiceTemplate, err error) { + result = make([]*GlobalServiceTemplate, 0, len(obj.Spec.ServiceTemplatesGvk)) + for _, v := range obj.Spec.ServiceTemplatesGvk { + l, err := obj.client.Global().GetServiceTemplateByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) } return } -// GetSvcGrpInfo returns child of given type -func (obj *ConfigConfig) GetSvcGrpInfo(ctx context.Context) ( - result *ServicegroupSvcGroupLinkInfo, err error) { - if obj.Spec.SvcGrpInfoGvk == nil { - return nil, NewChildNotFound(obj.DisplayName(), "Config.Config", "SvcGrpInfo") +// GetServiceTemplates returns child which has given displayName +func (obj *GlobalTemplateGroup) GetServiceTemplates(ctx context.Context, + displayName string) (result *GlobalServiceTemplate, err error) { + l, ok := obj.Spec.ServiceTemplatesGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.TemplateGroup", "ServiceTemplates", displayName) } - return obj.client.Servicegroup().GetSvcGroupLinkInfoByName(ctx, obj.Spec.SvcGrpInfoGvk.Name) + result, err = obj.client.Global().GetServiceTemplateByName(ctx, l.Name) + return } -// AddSvcGrpInfo calculates hashed name of the child to create based on objToCreate.Name +// AddServiceTemplates calculates hashed name of the child to create based on objToCreate.Name // and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in // nexus/display_name label and can be obtained using DisplayName() method. -func (obj *ConfigConfig) AddSvcGrpInfo(ctx context.Context, - objToCreate *baseservicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo) (result *ServicegroupSvcGroupLinkInfo, err error) { +func (obj *GlobalTemplateGroup) AddServiceTemplates(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceTemplate) (result *GlobalServiceTemplate, err error) { if objToCreate.Labels == nil { objToCreate.Labels = map[string]string{} } - for _, v := range helper.GetCRDParentsMap()["configs.config.tsm.tanzu.vmware.com"] { + for _, v := range helper.GetCRDParentsMap()["templategroups.global.tsm.tanzu.vmware.com"] { objToCreate.Labels[v] = obj.Labels[v] } - objToCreate.Labels["configs.config.tsm.tanzu.vmware.com"] = obj.DisplayName() + objToCreate.Labels["templategroups.global.tsm.tanzu.vmware.com"] = obj.DisplayName() if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) objToCreate.Name = hashedName } - result, err = obj.client.Servicegroup().CreateSvcGroupLinkInfoByName(ctx, objToCreate) - updatedObj, getErr := obj.client.Config().GetConfigByName(ctx, obj.GetName()) + result, err = obj.client.Global().CreateServiceTemplateByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetTemplateGroupByName(ctx, obj.GetName()) if getErr == nil { - obj.Config = updatedObj.Config + obj.TemplateGroup = updatedObj.TemplateGroup } return } -// DeleteSvcGrpInfo calculates hashed name of the child to delete based on displayName +// DeleteServiceTemplates calculates hashed name of the child to delete based on displayName // and parents names and deletes it. -func (obj *ConfigConfig) DeleteSvcGrpInfo(ctx context.Context) (err error) { - if obj.Spec.SvcGrpInfoGvk != nil { - err = obj.client. - Servicegroup().DeleteSvcGroupLinkInfoByName(ctx, obj.Spec.SvcGrpInfoGvk.Name) - if err != nil { - return err - } +func (obj *GlobalTemplateGroup) DeleteServiceTemplates(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ServiceTemplatesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.TemplateGroup", "ServiceTemplates", displayName) } - updatedObj, err := obj.client. - Config().GetConfigByName(ctx, obj.GetName()) + err = obj.client.Global().DeleteServiceTemplateByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetTemplateGroupByName(ctx, obj.GetName()) if err == nil { - obj.Config = updatedObj.Config + obj.TemplateGroup = updatedObj.TemplateGroup } return } -// GetAllACPPolicies returns all links of given type -func (obj *ConfigConfig) GetAllACPPolicies(ctx context.Context) ( - result []*PolicypkgAccessControlPolicy, err error) { - result = make([]*PolicypkgAccessControlPolicy, 0, len(obj.Spec.ACPPoliciesGvk)) - for _, v := range obj.Spec.ACPPoliciesGvk { - l, err := obj.client.Policypkg().GetAccessControlPolicyByName(ctx, v.Name) +// GetAllPolicyTemplates returns all children of given type +func (obj *GlobalTemplateGroup) GetAllPolicyTemplates(ctx context.Context) ( + result []*GlobalPolicyTemplate, err error) { + result = make([]*GlobalPolicyTemplate, 0, len(obj.Spec.PolicyTemplatesGvk)) + for _, v := range obj.Spec.PolicyTemplatesGvk { + l, err := obj.client.Global().GetPolicyTemplateByName(ctx, v.Name) if err != nil { return nil, err } @@ -1410,158 +85876,111 @@ func (obj *ConfigConfig) GetAllACPPolicies(ctx context.Context) ( return } -// GetACPPolicies returns link which has given displayName -func (obj *ConfigConfig) GetACPPolicies(ctx context.Context, - displayName string) (result *PolicypkgAccessControlPolicy, err error) { - l, ok := obj.Spec.ACPPoliciesGvk[displayName] +// GetPolicyTemplates returns child which has given displayName +func (obj *GlobalTemplateGroup) GetPolicyTemplates(ctx context.Context, + displayName string) (result *GlobalPolicyTemplate, err error) { + l, ok := obj.Spec.PolicyTemplatesGvk[displayName] if !ok { - return nil, NewLinkNotFound(obj.DisplayName(), "Config.Config", "ACPPolicies", displayName) + return nil, NewChildNotFound(obj.DisplayName(), "Global.TemplateGroup", "PolicyTemplates", displayName) } - result, err = obj.client.Policypkg().GetAccessControlPolicyByName(ctx, l.Name) + result, err = obj.client.Global().GetPolicyTemplateByName(ctx, l.Name) return } -// LinkACPPolicies links obj with linkToAdd object. This function doesn't create linked object, it must be -// already created. -func (obj *ConfigConfig) LinkACPPolicies(ctx context.Context, - linkToAdd *PolicypkgAccessControlPolicy) error { - - payload := "{\"spec\": {\"aCPPoliciesGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"AccessControlPolicy\", \"group\": \"policypkg.tsm.tanzu.vmware.com\"}}}}" - result, err := obj.client.baseClient.ConfigTsmV1().Configs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) - if err != nil { - return err +// AddPolicyTemplates calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalTemplateGroup) AddPolicyTemplates(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PolicyTemplate) (result *GlobalPolicyTemplate, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} } - - obj.Config = result - return nil + for _, v := range helper.GetCRDParentsMap()["templategroups.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["templategroups.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreatePolicyTemplateByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetTemplateGroupByName(ctx, obj.GetName()) + if getErr == nil { + obj.TemplateGroup = updatedObj.TemplateGroup + } + return } -// UnlinkACPPolicies unlinks linkToRemove object from obj. This function doesn't delete linked object. -func (obj *ConfigConfig) UnlinkACPPolicies(ctx context.Context, - linkToRemove *PolicypkgAccessControlPolicy) (err error) { - var patch Patch +// DeletePolicyTemplates calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. - patchOp := PatchOp{ - Op: "remove", - Path: "/spec/aCPPoliciesGvk/" + linkToRemove.DisplayName(), +func (obj *GlobalTemplateGroup) DeletePolicyTemplates(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.PolicyTemplatesGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.TemplateGroup", "PolicyTemplates", displayName) } - - patch = append(patch, patchOp) - marshaled, err := patch.Marshal() + err = obj.client.Global().DeletePolicyTemplateByName(ctx, l.Name) if err != nil { return err } - result, err := obj.client.baseClient.ConfigTsmV1().Configs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) - if err != nil { - return err + updatedObj, err := obj.client.Global().GetTemplateGroupByName(ctx, obj.GetName()) + if err == nil { + obj.TemplateGroup = updatedObj.TemplateGroup } - obj.Config = result - return nil - + return } -type configConfigTsmV1Chainer struct { +type templategroupGlobalTsmV1Chainer struct { client *Clientset name string parentLabels map[string]string } -func (c *configConfigTsmV1Chainer) Subscribe() { - key := "configs.config.tsm.tanzu.vmware.com" +func (c *templategroupGlobalTsmV1Chainer) Subscribe() { + key := "templategroups.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informerconfigtsmtanzuvmwarecomv1.NewConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewTemplateGroupInformer(c.client.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } } -func (c *configConfigTsmV1Chainer) Unsubscribe() { - key := "configs.config.tsm.tanzu.vmware.com" +func (c *templategroupGlobalTsmV1Chainer) Unsubscribe() { + key := "templategroups.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { close(s.(subscription).stop) subscriptionMap.Delete(key) } } -func (c *configConfigTsmV1Chainer) IsSubscribed() bool { - key := "configs.config.tsm.tanzu.vmware.com" +func (c *templategroupGlobalTsmV1Chainer) IsSubscribed() bool { + key := "templategroups.global.tsm.tanzu.vmware.com" _, ok := subscriptionMap.Load(key) return ok } -func (c *configConfigTsmV1Chainer) GNS(name string) *gnsGnsTsmV1Chainer { +func (c *templategroupGlobalTsmV1Chainer) DataTemplates(name string) *datatemplateGlobalTsmV1Chainer { parentLabels := c.parentLabels - parentLabels["gnses.gns.tsm.tanzu.vmware.com"] = name - return &gnsGnsTsmV1Chainer{ + parentLabels["datatemplates.global.tsm.tanzu.vmware.com"] = name + return &datatemplateGlobalTsmV1Chainer{ client: c.client, name: name, parentLabels: parentLabels, } } -// GetGNS calculates hashed name of the object based on displayName and it's parents and returns the object -func (c *configConfigTsmV1Chainer) GetGNS(ctx context.Context, displayName string) (result *GnsGns, err error) { - hashedName := helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", c.parentLabels, displayName) - return c.client.Gns().GetGnsByName(ctx, hashedName) +// GetDataTemplates calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *templategroupGlobalTsmV1Chainer) GetDataTemplates(ctx context.Context, displayName string) (result *GlobalDataTemplate, err error) { + hashedName := helper.GetHashedName("datatemplates.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetDataTemplateByName(ctx, hashedName) } -// AddGNS calculates hashed name of the child to create based on objToCreate.Name +// AddDataTemplates calculates hashed name of the child to create based on objToCreate.Name // and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in // nexus/display_name label and can be obtained using DisplayName() method. -func (c *configConfigTsmV1Chainer) AddGNS(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.Gns) (result *GnsGns, err error) { - if objToCreate.Labels == nil { - objToCreate.Labels = map[string]string{} - } - for k, v := range c.parentLabels { - objToCreate.Labels[k] = v - } - if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() - objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) - objToCreate.Name = hashedName - } - return c.client.Gns().CreateGnsByName(ctx, objToCreate) -} - -// DeleteGNS calculates hashed name of the child to delete based on displayName -// and parents names and deletes it. -func (c *configConfigTsmV1Chainer) DeleteGNS(ctx context.Context, name string) (err error) { - if c.parentLabels == nil { - c.parentLabels = map[string]string{} - } - c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", c.parentLabels, name) - return c.client.Gns().DeleteGnsByName(ctx, hashedName) -} - -func (c *configConfigTsmV1Chainer) DNS() *dnsGnsTsmV1Chainer { - parentLabels := c.parentLabels - parentLabels["dnses.gns.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY - return &dnsGnsTsmV1Chainer{ - client: c.client, - name: helper.DEFAULT_KEY, - parentLabels: parentLabels, - } -} - -// GetDNS calculates hashed name of the object based on it's parents and returns the object -func (c *configConfigTsmV1Chainer) GetDNS(ctx context.Context) (result *GnsDns, err error) { - hashedName := helper.GetHashedName("dnses.gns.tsm.tanzu.vmware.com", c.parentLabels, helper.DEFAULT_KEY) - return c.client.Gns().GetDnsByName(ctx, hashedName) -} - -// AddDNS calculates hashed name of the child to create based on parents names and creates it. -// objToCreate.Name is changed to the hashed name. Original name ('default') is preserved in -// nexus/display_name label and can be obtained using DisplayName() method. -func (c *configConfigTsmV1Chainer) AddDNS(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.Dns) (result *GnsDns, err error) { - if objToCreate.GetName() == "" { - objToCreate.SetName(helper.DEFAULT_KEY) - } - if objToCreate.GetName() != helper.DEFAULT_KEY { - return nil, NewSingletonNameError(objToCreate.GetName()) - } +func (c *templategroupGlobalTsmV1Chainer) AddDataTemplates(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.DataTemplate) (result *GlobalDataTemplate, err error) { if objToCreate.Labels == nil { objToCreate.Labels = map[string]string{} } @@ -1571,44 +85990,44 @@ func (c *configConfigTsmV1Chainer) AddDNS(ctx context.Context, if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("dnses.gns.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + hashedName := helper.GetHashedName("datatemplates.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) objToCreate.Name = hashedName } - return c.client.Gns().CreateDnsByName(ctx, objToCreate) + return c.client.Global().CreateDataTemplateByName(ctx, objToCreate) } -// DeleteDNS calculates hashed name of the child to delete based on displayName +// DeleteDataTemplates calculates hashed name of the child to delete based on displayName // and parents names and deletes it. -func (c *configConfigTsmV1Chainer) DeleteDNS(ctx context.Context, name string) (err error) { +func (c *templategroupGlobalTsmV1Chainer) DeleteDataTemplates(ctx context.Context, name string) (err error) { if c.parentLabels == nil { c.parentLabels = map[string]string{} } c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("dnses.gns.tsm.tanzu.vmware.com", c.parentLabels, name) - return c.client.Gns().DeleteDnsByName(ctx, hashedName) + hashedName := helper.GetHashedName("datatemplates.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteDataTemplateByName(ctx, hashedName) } -func (c *configConfigTsmV1Chainer) VMPPolicies(name string) *vmpolicyPolicypkgTsmV1Chainer { +func (c *templategroupGlobalTsmV1Chainer) NodeTemplates(name string) *nodetemplateGlobalTsmV1Chainer { parentLabels := c.parentLabels - parentLabels["vmpolicies.policypkg.tsm.tanzu.vmware.com"] = name - return &vmpolicyPolicypkgTsmV1Chainer{ + parentLabels["nodetemplates.global.tsm.tanzu.vmware.com"] = name + return &nodetemplateGlobalTsmV1Chainer{ client: c.client, name: name, parentLabels: parentLabels, } } -// GetVMPPolicies calculates hashed name of the object based on displayName and it's parents and returns the object -func (c *configConfigTsmV1Chainer) GetVMPPolicies(ctx context.Context, displayName string) (result *PolicypkgVMpolicy, err error) { - hashedName := helper.GetHashedName("vmpolicies.policypkg.tsm.tanzu.vmware.com", c.parentLabels, displayName) - return c.client.Policypkg().GetVMpolicyByName(ctx, hashedName) +// GetNodeTemplates calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *templategroupGlobalTsmV1Chainer) GetNodeTemplates(ctx context.Context, displayName string) (result *GlobalNodeTemplate, err error) { + hashedName := helper.GetHashedName("nodetemplates.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetNodeTemplateByName(ctx, hashedName) } -// AddVMPPolicies calculates hashed name of the child to create based on objToCreate.Name +// AddNodeTemplates calculates hashed name of the child to create based on objToCreate.Name // and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in // nexus/display_name label and can be obtained using DisplayName() method. -func (c *configConfigTsmV1Chainer) AddVMPPolicies(ctx context.Context, - objToCreate *basepolicypkgtsmtanzuvmwarecomv1.VMpolicy) (result *PolicypkgVMpolicy, err error) { +func (c *templategroupGlobalTsmV1Chainer) AddNodeTemplates(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.NodeTemplate) (result *GlobalNodeTemplate, err error) { if objToCreate.Labels == nil { objToCreate.Labels = map[string]string{} } @@ -1618,44 +86037,44 @@ func (c *configConfigTsmV1Chainer) AddVMPPolicies(ctx context.Context, if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("vmpolicies.policypkg.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + hashedName := helper.GetHashedName("nodetemplates.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) objToCreate.Name = hashedName } - return c.client.Policypkg().CreateVMpolicyByName(ctx, objToCreate) + return c.client.Global().CreateNodeTemplateByName(ctx, objToCreate) } -// DeleteVMPPolicies calculates hashed name of the child to delete based on displayName +// DeleteNodeTemplates calculates hashed name of the child to delete based on displayName // and parents names and deletes it. -func (c *configConfigTsmV1Chainer) DeleteVMPPolicies(ctx context.Context, name string) (err error) { +func (c *templategroupGlobalTsmV1Chainer) DeleteNodeTemplates(ctx context.Context, name string) (err error) { if c.parentLabels == nil { c.parentLabels = map[string]string{} } c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("vmpolicies.policypkg.tsm.tanzu.vmware.com", c.parentLabels, name) - return c.client.Policypkg().DeleteVMpolicyByName(ctx, hashedName) + hashedName := helper.GetHashedName("nodetemplates.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteNodeTemplateByName(ctx, hashedName) } -func (c *configConfigTsmV1Chainer) Domain(name string) *domainConfigTsmV1Chainer { +func (c *templategroupGlobalTsmV1Chainer) AppTemplates(name string) *apptemplateGlobalTsmV1Chainer { parentLabels := c.parentLabels - parentLabels["domains.config.tsm.tanzu.vmware.com"] = name - return &domainConfigTsmV1Chainer{ + parentLabels["apptemplates.global.tsm.tanzu.vmware.com"] = name + return &apptemplateGlobalTsmV1Chainer{ client: c.client, name: name, parentLabels: parentLabels, } } -// GetDomain calculates hashed name of the object based on displayName and it's parents and returns the object -func (c *configConfigTsmV1Chainer) GetDomain(ctx context.Context, displayName string) (result *ConfigDomain, err error) { - hashedName := helper.GetHashedName("domains.config.tsm.tanzu.vmware.com", c.parentLabels, displayName) - return c.client.Config().GetDomainByName(ctx, hashedName) +// GetAppTemplates calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *templategroupGlobalTsmV1Chainer) GetAppTemplates(ctx context.Context, displayName string) (result *GlobalAppTemplate, err error) { + hashedName := helper.GetHashedName("apptemplates.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAppTemplateByName(ctx, hashedName) } -// AddDomain calculates hashed name of the child to create based on objToCreate.Name +// AddAppTemplates calculates hashed name of the child to create based on objToCreate.Name // and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in // nexus/display_name label and can be obtained using DisplayName() method. -func (c *configConfigTsmV1Chainer) AddDomain(ctx context.Context, - objToCreate *baseconfigtsmtanzuvmwarecomv1.Domain) (result *ConfigDomain, err error) { +func (c *templategroupGlobalTsmV1Chainer) AddAppTemplates(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppTemplate) (result *GlobalAppTemplate, err error) { if objToCreate.Labels == nil { objToCreate.Labels = map[string]string{} } @@ -1665,44 +86084,44 @@ func (c *configConfigTsmV1Chainer) AddDomain(ctx context.Context, if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("domains.config.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + hashedName := helper.GetHashedName("apptemplates.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) objToCreate.Name = hashedName } - return c.client.Config().CreateDomainByName(ctx, objToCreate) + return c.client.Global().CreateAppTemplateByName(ctx, objToCreate) } -// DeleteDomain calculates hashed name of the child to delete based on displayName +// DeleteAppTemplates calculates hashed name of the child to delete based on displayName // and parents names and deletes it. -func (c *configConfigTsmV1Chainer) DeleteDomain(ctx context.Context, name string) (err error) { +func (c *templategroupGlobalTsmV1Chainer) DeleteAppTemplates(ctx context.Context, name string) (err error) { if c.parentLabels == nil { c.parentLabels = map[string]string{} } c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("domains.config.tsm.tanzu.vmware.com", c.parentLabels, name) - return c.client.Config().DeleteDomainByName(ctx, hashedName) + hashedName := helper.GetHashedName("apptemplates.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAppTemplateByName(ctx, hashedName) } -func (c *configConfigTsmV1Chainer) FooExample(name string) *footypeabcConfigTsmV1Chainer { +func (c *templategroupGlobalTsmV1Chainer) ServiceTemplates(name string) *servicetemplateGlobalTsmV1Chainer { parentLabels := c.parentLabels - parentLabels["footypeabcs.config.tsm.tanzu.vmware.com"] = name - return &footypeabcConfigTsmV1Chainer{ + parentLabels["servicetemplates.global.tsm.tanzu.vmware.com"] = name + return &servicetemplateGlobalTsmV1Chainer{ client: c.client, name: name, parentLabels: parentLabels, } } -// GetFooExample calculates hashed name of the object based on displayName and it's parents and returns the object -func (c *configConfigTsmV1Chainer) GetFooExample(ctx context.Context, displayName string) (result *ConfigFooTypeABC, err error) { - hashedName := helper.GetHashedName("footypeabcs.config.tsm.tanzu.vmware.com", c.parentLabels, displayName) - return c.client.Config().GetFooTypeABCByName(ctx, hashedName) +// GetServiceTemplates calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *templategroupGlobalTsmV1Chainer) GetServiceTemplates(ctx context.Context, displayName string) (result *GlobalServiceTemplate, err error) { + hashedName := helper.GetHashedName("servicetemplates.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetServiceTemplateByName(ctx, hashedName) } -// AddFooExample calculates hashed name of the child to create based on objToCreate.Name +// AddServiceTemplates calculates hashed name of the child to create based on objToCreate.Name // and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in // nexus/display_name label and can be obtained using DisplayName() method. -func (c *configConfigTsmV1Chainer) AddFooExample(ctx context.Context, - objToCreate *baseconfigtsmtanzuvmwarecomv1.FooTypeABC) (result *ConfigFooTypeABC, err error) { +func (c *templategroupGlobalTsmV1Chainer) AddServiceTemplates(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.ServiceTemplate) (result *GlobalServiceTemplate, err error) { if objToCreate.Labels == nil { objToCreate.Labels = map[string]string{} } @@ -1712,44 +86131,44 @@ func (c *configConfigTsmV1Chainer) AddFooExample(ctx context.Context, if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("footypeabcs.config.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + hashedName := helper.GetHashedName("servicetemplates.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) objToCreate.Name = hashedName } - return c.client.Config().CreateFooTypeABCByName(ctx, objToCreate) + return c.client.Global().CreateServiceTemplateByName(ctx, objToCreate) } -// DeleteFooExample calculates hashed name of the child to delete based on displayName +// DeleteServiceTemplates calculates hashed name of the child to delete based on displayName // and parents names and deletes it. -func (c *configConfigTsmV1Chainer) DeleteFooExample(ctx context.Context, name string) (err error) { +func (c *templategroupGlobalTsmV1Chainer) DeleteServiceTemplates(ctx context.Context, name string) (err error) { if c.parentLabels == nil { c.parentLabels = map[string]string{} } c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("footypeabcs.config.tsm.tanzu.vmware.com", c.parentLabels, name) - return c.client.Config().DeleteFooTypeABCByName(ctx, hashedName) + hashedName := helper.GetHashedName("servicetemplates.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteServiceTemplateByName(ctx, hashedName) } -func (c *configConfigTsmV1Chainer) SvcGrpInfo(name string) *svcgrouplinkinfoServicegroupTsmV1Chainer { +func (c *templategroupGlobalTsmV1Chainer) PolicyTemplates(name string) *policytemplateGlobalTsmV1Chainer { parentLabels := c.parentLabels - parentLabels["svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com"] = name - return &svcgrouplinkinfoServicegroupTsmV1Chainer{ + parentLabels["policytemplates.global.tsm.tanzu.vmware.com"] = name + return &policytemplateGlobalTsmV1Chainer{ client: c.client, name: name, parentLabels: parentLabels, } } -// GetSvcGrpInfo calculates hashed name of the object based on displayName and it's parents and returns the object -func (c *configConfigTsmV1Chainer) GetSvcGrpInfo(ctx context.Context, displayName string) (result *ServicegroupSvcGroupLinkInfo, err error) { - hashedName := helper.GetHashedName("svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com", c.parentLabels, displayName) - return c.client.Servicegroup().GetSvcGroupLinkInfoByName(ctx, hashedName) +// GetPolicyTemplates calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *templategroupGlobalTsmV1Chainer) GetPolicyTemplates(ctx context.Context, displayName string) (result *GlobalPolicyTemplate, err error) { + hashedName := helper.GetHashedName("policytemplates.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetPolicyTemplateByName(ctx, hashedName) } -// AddSvcGrpInfo calculates hashed name of the child to create based on objToCreate.Name +// AddPolicyTemplates calculates hashed name of the child to create based on objToCreate.Name // and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in // nexus/display_name label and can be obtained using DisplayName() method. -func (c *configConfigTsmV1Chainer) AddSvcGrpInfo(ctx context.Context, - objToCreate *baseservicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo) (result *ServicegroupSvcGroupLinkInfo, err error) { +func (c *templategroupGlobalTsmV1Chainer) AddPolicyTemplates(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.PolicyTemplate) (result *GlobalPolicyTemplate, err error) { if objToCreate.Labels == nil { objToCreate.Labels = map[string]string{} } @@ -1759,67 +86178,83 @@ func (c *configConfigTsmV1Chainer) AddSvcGrpInfo(ctx context.Context, if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + hashedName := helper.GetHashedName("policytemplates.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) objToCreate.Name = hashedName } - return c.client.Servicegroup().CreateSvcGroupLinkInfoByName(ctx, objToCreate) + return c.client.Global().CreatePolicyTemplateByName(ctx, objToCreate) } -// DeleteSvcGrpInfo calculates hashed name of the child to delete based on displayName +// DeletePolicyTemplates calculates hashed name of the child to delete based on displayName // and parents names and deletes it. -func (c *configConfigTsmV1Chainer) DeleteSvcGrpInfo(ctx context.Context, name string) (err error) { +func (c *templategroupGlobalTsmV1Chainer) DeletePolicyTemplates(ctx context.Context, name string) (err error) { if c.parentLabels == nil { c.parentLabels = map[string]string{} } c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com", c.parentLabels, name) - return c.client.Servicegroup().DeleteSvcGroupLinkInfoByName(ctx, hashedName) + hashedName := helper.GetHashedName("policytemplates.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeletePolicyTemplateByName(ctx, hashedName) } -// GetFooTypeABCByName returns object stored in the database under the hashedName which is a hash of display +// GetTemplateByName returns object stored in the database under the hashedName which is a hash of display // name and parents names. Use it when you know hashed name of object. -func (group *ConfigTsmV1) GetFooTypeABCByName(ctx context.Context, hashedName string) (*ConfigFooTypeABC, error) { - key := "footypeabcs.config.tsm.tanzu.vmware.com" +func (group *GlobalTsmV1) GetTemplateByName(ctx context.Context, hashedName string) (*GlobalTemplate, error) { + key := "templates.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) if !exists { return nil, err } - result, _ := item.(*baseconfigtsmtanzuvmwarecomv1.FooTypeABC) - return &ConfigFooTypeABC{ - client: group.client, - FooTypeABC: result, + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Template) + return &GlobalTemplate{ + client: group.client, + Template: result, }, nil } else { result, err := group.client.baseClient. - ConfigTsmV1(). - FooTypeABCs().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + Templates().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return nil, err } - return &ConfigFooTypeABC{ - client: group.client, - FooTypeABC: result, + return &GlobalTemplate{ + client: group.client, + Template: result, }, nil } } -// DeleteFooTypeABCByName deletes object stored in the database under the hashedName which is a hash of +// DeleteTemplateByName deletes object stored in the database under the hashedName which is a hash of // display name and parents names. Use it when you know hashed name of object. -func (group *ConfigTsmV1) DeleteFooTypeABCByName(ctx context.Context, hashedName string) (err error) { +func (group *GlobalTsmV1) DeleteTemplateByName(ctx context.Context, hashedName string) (err error) { result, err := group.client.baseClient. - ConfigTsmV1(). - FooTypeABCs().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + Templates().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return err } + for _, v := range result.Spec.TemplateGroupsGvk { + err := group.client. + Global().DeleteTemplateGroupByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.HealthChecksGvk { + err := group.client. + Global().DeleteHealthCheckConfigNByName(ctx, v.Name) + if err != nil { + return err + } + } + err = group.client.baseClient. - ConfigTsmV1(). - FooTypeABCs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + GlobalTsmV1(). + Templates().Delete(ctx, hashedName, metav1.DeleteOptions{}) if err != nil { return err } @@ -1828,7 +86263,7 @@ func (group *ConfigTsmV1) DeleteFooTypeABCByName(ctx context.Context, hashedName patchOp := PatchOp{ Op: "remove", - Path: "/spec/fooExampleGvk/" + result.DisplayName(), + Path: "/spec/templatesGvk", } patch = append(patch, patchOp) @@ -1840,15 +86275,15 @@ func (group *ConfigTsmV1) DeleteFooTypeABCByName(ctx context.Context, hashedName if parents == nil { parents = make(map[string]string) } - parentName, ok := parents["configs.config.tsm.tanzu.vmware.com"] + parentName, ok := parents["configs.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if parents[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", parents, parentName) + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", parents, parentName) } _, err = group.client.baseClient. - ConfigTsmV1(). + GlobalTsmV1(). Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err @@ -1857,10 +86292,10 @@ func (group *ConfigTsmV1) DeleteFooTypeABCByName(ctx context.Context, hashedName return } -// CreateFooTypeABCByName creates object in the database without hashing the name. +// CreateTemplateByName creates object in the database without hashing the name. // Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *ConfigTsmV1) CreateFooTypeABCByName(ctx context.Context, - objToCreate *baseconfigtsmtanzuvmwarecomv1.FooTypeABC) (*ConfigFooTypeABC, error) { +func (group *GlobalTsmV1) CreateTemplateByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Template) (*GlobalTemplate, error) { if objToCreate.GetLabels() == nil { objToCreate.Labels = make(map[string]string) } @@ -1868,45 +86303,62 @@ func (group *ConfigTsmV1) CreateFooTypeABCByName(ctx context.Context, objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() } + objToCreate.Spec.TemplateGroupsGvk = nil + objToCreate.Spec.HealthChecksGvk = nil + result, err := group.client.baseClient. - ConfigTsmV1(). - FooTypeABCs().Create(ctx, objToCreate, metav1.CreateOptions{}) + GlobalTsmV1(). + Templates().Create(ctx, objToCreate, metav1.CreateOptions{}) if err != nil { return nil, err } - parentName, ok := objToCreate.GetLabels()["configs.config.tsm.tanzu.vmware.com"] + parentName, ok := objToCreate.GetLabels()["configs.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + parentName = helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) } - payload := "{\"spec\": {\"fooExampleGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"FooTypeABC\", \"group\": \"config.tsm.tanzu.vmware.com\"}}}}" + var patch Patch + patchOp := PatchOp{ + Op: "replace", + Path: "/spec/templatesGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "Template", + Name: objToCreate.Name, + }, + } + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return nil, err + } _, err = group.client.baseClient. - ConfigTsmV1(). - Configs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + GlobalTsmV1(). + Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return nil, err } - return &ConfigFooTypeABC{ - client: group.client, - FooTypeABC: result, + return &GlobalTemplate{ + client: group.client, + Template: result, }, nil } -// UpdateFooTypeABCByName updates object stored in the database under the hashedName which is a hash of +// UpdateTemplateByName updates object stored in the database under the hashedName which is a hash of // display name and parents names. -func (group *ConfigTsmV1) UpdateFooTypeABCByName(ctx context.Context, - objToUpdate *baseconfigtsmtanzuvmwarecomv1.FooTypeABC) (*ConfigFooTypeABC, error) { +func (group *GlobalTsmV1) UpdateTemplateByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Template) (*GlobalTemplate, error) { // ResourceVersion must be set for update if objToUpdate.ResourceVersion == "" { current, err := group.client.baseClient. - ConfigTsmV1(). - FooTypeABCs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + GlobalTsmV1(). + Templates().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) if err != nil { return nil, err } @@ -1920,558 +86372,421 @@ func (group *ConfigTsmV1) UpdateFooTypeABCByName(ctx context.Context, Value: objToUpdate.ObjectMeta, }) - patchValueFooA := - objToUpdate.Spec.FooA - patchOpFooA := PatchOp{ - Op: "replace", - Path: "/spec/fooA", - Value: patchValueFooA, - } - patch = append(patch, patchOpFooA) - - patchValueFooB := - objToUpdate.Spec.FooB - patchOpFooB := PatchOp{ - Op: "replace", - Path: "/spec/fooB", - Value: patchValueFooB, - } - patch = append(patch, patchOpFooB) - - patchValueFooC := - objToUpdate.Spec.FooC - patchOpFooC := PatchOp{ - Op: "replace", - Path: "/spec/fooC", - Value: patchValueFooC, - } - patch = append(patch, patchOpFooC) - - patchValueFooD := - objToUpdate.Spec.FooD - patchOpFooD := PatchOp{ - Op: "replace", - Path: "/spec/fooD", - Value: patchValueFooD, - } - patch = append(patch, patchOpFooD) - - patchValueFooE := - objToUpdate.Spec.FooE - patchOpFooE := PatchOp{ - Op: "replace", - Path: "/spec/foo_e", - Value: patchValueFooE, - } - patch = append(patch, patchOpFooE) - - patchValueFooF := - objToUpdate.Spec.FooF - patchOpFooF := PatchOp{ - Op: "replace", - Path: "/spec/foo_f", - Value: patchValueFooF, - } - patch = append(patch, patchOpFooF) - marshaled, err := patch.Marshal() if err != nil { return nil, err } result, err := group.client.baseClient. - ConfigTsmV1(). - FooTypeABCs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + GlobalTsmV1(). + Templates().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") if err != nil { return nil, err } - return &ConfigFooTypeABC{ - client: group.client, - FooTypeABC: result, + return &GlobalTemplate{ + client: group.client, + Template: result, }, nil } -// ListFooTypeABCs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *ConfigTsmV1) ListFooTypeABCs(ctx context.Context, - opts metav1.ListOptions) (result []*ConfigFooTypeABC, err error) { - key := "footypeabcs.config.tsm.tanzu.vmware.com" +// ListTemplates returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListTemplates(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalTemplate, err error) { + key := "templates.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { items := s.(subscription).informer.GetStore().List() - result = make([]*ConfigFooTypeABC, len(items)) + result = make([]*GlobalTemplate, len(items)) for k, v := range items { - item, _ := v.(*baseconfigtsmtanzuvmwarecomv1.FooTypeABC) - result[k] = &ConfigFooTypeABC{ - client: group.client, - FooTypeABC: item, + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Template) + result[k] = &GlobalTemplate{ + client: group.client, + Template: item, } } } else { - list, err := group.client.baseClient.ConfigTsmV1(). - FooTypeABCs().List(ctx, opts) + list, err := group.client.baseClient.GlobalTsmV1(). + Templates().List(ctx, opts) if err != nil { return nil, err } - result = make([]*ConfigFooTypeABC, len(list.Items)) + result = make([]*GlobalTemplate, len(list.Items)) for k, v := range list.Items { item := v - result[k] = &ConfigFooTypeABC{ - client: group.client, - FooTypeABC: &item, + result[k] = &GlobalTemplate{ + client: group.client, + Template: &item, } } } return } -type ConfigFooTypeABC struct { +type GlobalTemplate struct { client *Clientset - *baseconfigtsmtanzuvmwarecomv1.FooTypeABC + *baseglobaltsmtanzuvmwarecomv1.Template } // Delete removes obj and all it's children from the database. -func (obj *ConfigFooTypeABC) Delete(ctx context.Context) error { - err := obj.client.Config().DeleteFooTypeABCByName(ctx, obj.GetName()) +func (obj *GlobalTemplate) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteTemplateByName(ctx, obj.GetName()) if err != nil { return err } - obj.FooTypeABC = nil + obj.Template = nil return nil } // Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *ConfigFooTypeABC) Update(ctx context.Context) error { - result, err := obj.client.Config().UpdateFooTypeABCByName(ctx, obj.FooTypeABC) +func (obj *GlobalTemplate) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateTemplateByName(ctx, obj.Template) if err != nil { return err } - obj.FooTypeABC = result.FooTypeABC + obj.Template = result.Template return nil } -func (obj *ConfigFooTypeABC) GetParent(ctx context.Context) (result *ConfigConfig, err error) { - hashedName := helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.config.tsm.tanzu.vmware.com"]) - return obj.client.Config().GetConfigByName(ctx, hashedName) -} - -type footypeabcConfigTsmV1Chainer struct { - client *Clientset - name string - parentLabels map[string]string -} - -func (c *footypeabcConfigTsmV1Chainer) Subscribe() { - key := "footypeabcs.config.tsm.tanzu.vmware.com" - if _, ok := subscriptionMap.Load(key); !ok { - informer := informerconfigtsmtanzuvmwarecomv1.NewFooTypeABCInformer(c.client.baseClient, 0, cache.Indexers{}) - subscribe(key, informer) - } -} - -func (c *footypeabcConfigTsmV1Chainer) Unsubscribe() { - key := "footypeabcs.config.tsm.tanzu.vmware.com" - if s, ok := subscriptionMap.Load(key); ok { - close(s.(subscription).stop) - subscriptionMap.Delete(key) - } -} - -func (c *footypeabcConfigTsmV1Chainer) IsSubscribed() bool { - key := "footypeabcs.config.tsm.tanzu.vmware.com" - _, ok := subscriptionMap.Load(key) - return ok +func (obj *GlobalTemplate) GetParent(ctx context.Context) (result *GlobalConfig, err error) { + hashedName := helper.GetHashedName("configs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetConfigByName(ctx, hashedName) } -// GetDomainByName returns object stored in the database under the hashedName which is a hash of display -// name and parents names. Use it when you know hashed name of object. -func (group *ConfigTsmV1) GetDomainByName(ctx context.Context, hashedName string) (*ConfigDomain, error) { - key := "domains.config.tsm.tanzu.vmware.com" - if s, ok := subscriptionMap.Load(key); ok { - item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) - if !exists { - return nil, err - } - - result, _ := item.(*baseconfigtsmtanzuvmwarecomv1.Domain) - return &ConfigDomain{ - client: group.client, - Domain: result, - }, nil - } else { - result, err := group.client.baseClient. - ConfigTsmV1(). - Domains().Get(ctx, hashedName, metav1.GetOptions{}) +// GetAllTemplateGroups returns all children of given type +func (obj *GlobalTemplate) GetAllTemplateGroups(ctx context.Context) ( + result []*GlobalTemplateGroup, err error) { + result = make([]*GlobalTemplateGroup, 0, len(obj.Spec.TemplateGroupsGvk)) + for _, v := range obj.Spec.TemplateGroupsGvk { + l, err := obj.client.Global().GetTemplateGroupByName(ctx, v.Name) if err != nil { return nil, err } - - return &ConfigDomain{ - client: group.client, - Domain: result, - }, nil + result = append(result, l) } + return } -// DeleteDomainByName deletes object stored in the database under the hashedName which is a hash of -// display name and parents names. Use it when you know hashed name of object. -func (group *ConfigTsmV1) DeleteDomainByName(ctx context.Context, hashedName string) (err error) { - - result, err := group.client.baseClient. - ConfigTsmV1(). - Domains().Get(ctx, hashedName, metav1.GetOptions{}) - if err != nil { - return err - } - - err = group.client.baseClient. - ConfigTsmV1(). - Domains().Delete(ctx, hashedName, metav1.DeleteOptions{}) - if err != nil { - return err - } - - var patch Patch - - patchOp := PatchOp{ - Op: "remove", - Path: "/spec/domainGvk", - } - - patch = append(patch, patchOp) - marshaled, err := patch.Marshal() - if err != nil { - return err - } - parents := result.GetLabels() - if parents == nil { - parents = make(map[string]string) - } - parentName, ok := parents["configs.config.tsm.tanzu.vmware.com"] +// GetTemplateGroups returns child which has given displayName +func (obj *GlobalTemplate) GetTemplateGroups(ctx context.Context, + displayName string) (result *GlobalTemplateGroup, err error) { + l, ok := obj.Spec.TemplateGroupsGvk[displayName] if !ok { - parentName = helper.DEFAULT_KEY - } - if parents[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", parents, parentName) + return nil, NewChildNotFound(obj.DisplayName(), "Global.Template", "TemplateGroups", displayName) } - _, err = group.client.baseClient. - ConfigTsmV1(). - Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) - if err != nil { - return err - } - + result, err = obj.client.Global().GetTemplateGroupByName(ctx, l.Name) return } -// CreateDomainByName creates object in the database without hashing the name. -// Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *ConfigTsmV1) CreateDomainByName(ctx context.Context, - objToCreate *baseconfigtsmtanzuvmwarecomv1.Domain) (*ConfigDomain, error) { - if objToCreate.GetLabels() == nil { - objToCreate.Labels = make(map[string]string) +// AddTemplateGroups calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalTemplate) AddTemplateGroups(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.TemplateGroup) (result *GlobalTemplateGroup, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} } - if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { + for _, v := range helper.GetCRDParentsMap()["templates.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["templates.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName } - - result, err := group.client.baseClient. - ConfigTsmV1(). - Domains().Create(ctx, objToCreate, metav1.CreateOptions{}) - if err != nil { - return nil, err + result, err = obj.client.Global().CreateTemplateGroupByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetTemplateByName(ctx, obj.GetName()) + if getErr == nil { + obj.Template = updatedObj.Template } + return +} - parentName, ok := objToCreate.GetLabels()["configs.config.tsm.tanzu.vmware.com"] - if !ok { - parentName = helper.DEFAULT_KEY - } - if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) - } +// DeleteTemplateGroups calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. - var patch Patch - patchOp := PatchOp{ - Op: "replace", - Path: "/spec/domainGvk", - Value: baseconfigtsmtanzuvmwarecomv1.Child{ - Group: "config.tsm.tanzu.vmware.com", - Kind: "Domain", - Name: objToCreate.Name, - }, +func (obj *GlobalTemplate) DeleteTemplateGroups(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.TemplateGroupsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Template", "TemplateGroups", displayName) } - patch = append(patch, patchOp) - marshaled, err := patch.Marshal() + err = obj.client.Global().DeleteTemplateGroupByName(ctx, l.Name) if err != nil { - return nil, err + return err } - _, err = group.client.baseClient. - ConfigTsmV1(). - Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) - if err != nil { - return nil, err + updatedObj, err := obj.client.Global().GetTemplateByName(ctx, obj.GetName()) + if err == nil { + obj.Template = updatedObj.Template } - - return &ConfigDomain{ - client: group.client, - Domain: result, - }, nil + return } -// UpdateDomainByName updates object stored in the database under the hashedName which is a hash of -// display name and parents names. -func (group *ConfigTsmV1) UpdateDomainByName(ctx context.Context, - objToUpdate *baseconfigtsmtanzuvmwarecomv1.Domain) (*ConfigDomain, error) { - - // ResourceVersion must be set for update - if objToUpdate.ResourceVersion == "" { - current, err := group.client.baseClient. - ConfigTsmV1(). - Domains().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) +// GetAllHealthChecks returns all children of given type +func (obj *GlobalTemplate) GetAllHealthChecks(ctx context.Context) ( + result []*GlobalHealthCheckConfigN, err error) { + result = make([]*GlobalHealthCheckConfigN, 0, len(obj.Spec.HealthChecksGvk)) + for _, v := range obj.Spec.HealthChecksGvk { + l, err := obj.client.Global().GetHealthCheckConfigNByName(ctx, v.Name) if err != nil { return nil, err } - objToUpdate.ResourceVersion = current.ResourceVersion - } - - var patch Patch - patch = append(patch, PatchOp{ - Op: "replace", - Path: "/metadata", - Value: objToUpdate.ObjectMeta, - }) - - patchValuePointPort := - objToUpdate.Spec.PointPort - patchOpPointPort := PatchOp{ - Op: "replace", - Path: "/spec/pointPort", - Value: patchValuePointPort, - } - patch = append(patch, patchOpPointPort) - - patchValuePointString := - objToUpdate.Spec.PointString - patchOpPointString := PatchOp{ - Op: "replace", - Path: "/spec/pointString", - Value: patchValuePointString, + result = append(result, l) } - patch = append(patch, patchOpPointString) + return +} - patchValuePointInt := - objToUpdate.Spec.PointInt - patchOpPointInt := PatchOp{ - Op: "replace", - Path: "/spec/pointInt", - Value: patchValuePointInt, +// GetHealthChecks returns child which has given displayName +func (obj *GlobalTemplate) GetHealthChecks(ctx context.Context, + displayName string) (result *GlobalHealthCheckConfigN, err error) { + l, ok := obj.Spec.HealthChecksGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Template", "HealthChecks", displayName) } - patch = append(patch, patchOpPointInt) + result, err = obj.client.Global().GetHealthCheckConfigNByName(ctx, l.Name) + return +} - if objToUpdate.Spec.PointMap != nil { - patchValuePointMap := - objToUpdate.Spec.PointMap - patchOpPointMap := PatchOp{ - Op: "replace", - Path: "/spec/pointMap", - Value: patchValuePointMap, - } - patch = append(patch, patchOpPointMap) +// AddHealthChecks calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalTemplate) AddHealthChecks(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.HealthCheckConfigN) (result *GlobalHealthCheckConfigN, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} } - - patchValuePointSlice := - objToUpdate.Spec.PointSlice - patchOpPointSlice := PatchOp{ - Op: "replace", - Path: "/spec/pointSlice", - Value: patchValuePointSlice, + for _, v := range helper.GetCRDParentsMap()["templates.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] } - patch = append(patch, patchOpPointSlice) - - if objToUpdate.Spec.SliceOfPoints != nil { - patchValueSliceOfPoints := - objToUpdate.Spec.SliceOfPoints - patchOpSliceOfPoints := PatchOp{ - Op: "replace", - Path: "/spec/sliceOfPoints", - Value: patchValueSliceOfPoints, - } - patch = append(patch, patchOpSliceOfPoints) + objToCreate.Labels["templates.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName } - - if objToUpdate.Spec.SliceOfArrPoints != nil { - patchValueSliceOfArrPoints := - objToUpdate.Spec.SliceOfArrPoints - patchOpSliceOfArrPoints := PatchOp{ - Op: "replace", - Path: "/spec/sliceOfArrPoints", - Value: patchValueSliceOfArrPoints, - } - patch = append(patch, patchOpSliceOfArrPoints) + result, err = obj.client.Global().CreateHealthCheckConfigNByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetTemplateByName(ctx, obj.GetName()) + if getErr == nil { + obj.Template = updatedObj.Template } + return +} - if objToUpdate.Spec.MapOfArrsPoints != nil { - patchValueMapOfArrsPoints := - objToUpdate.Spec.MapOfArrsPoints - patchOpMapOfArrsPoints := PatchOp{ - Op: "replace", - Path: "/spec/mapOfArrsPoints", - Value: patchValueMapOfArrsPoints, - } - patch = append(patch, patchOpMapOfArrsPoints) - } +// DeleteHealthChecks calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. - patchValuePointStruct := - objToUpdate.Spec.PointStruct - patchOpPointStruct := PatchOp{ - Op: "replace", - Path: "/spec/pointStruct", - Value: patchValuePointStruct, +func (obj *GlobalTemplate) DeleteHealthChecks(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.HealthChecksGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Template", "HealthChecks", displayName) } - patch = append(patch, patchOpPointStruct) - - marshaled, err := patch.Marshal() + err = obj.client.Global().DeleteHealthCheckConfigNByName(ctx, l.Name) if err != nil { - return nil, err + return err } - result, err := group.client.baseClient. - ConfigTsmV1(). - Domains().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") - if err != nil { - return nil, err + updatedObj, err := obj.client.Global().GetTemplateByName(ctx, obj.GetName()) + if err == nil { + obj.Template = updatedObj.Template } + return +} - return &ConfigDomain{ - client: group.client, - Domain: result, - }, nil +type templateGlobalTsmV1Chainer struct { + client *Clientset + name string + parentLabels map[string]string } -// ListDomains returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *ConfigTsmV1) ListDomains(ctx context.Context, - opts metav1.ListOptions) (result []*ConfigDomain, err error) { - key := "domains.config.tsm.tanzu.vmware.com" +func (c *templateGlobalTsmV1Chainer) Subscribe() { + key := "templates.global.tsm.tanzu.vmware.com" + if _, ok := subscriptionMap.Load(key); !ok { + informer := informerglobaltsmtanzuvmwarecomv1.NewTemplateInformer(c.client.baseClient, 0, cache.Indexers{}) + subscribe(key, informer) + } +} + +func (c *templateGlobalTsmV1Chainer) Unsubscribe() { + key := "templates.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { - items := s.(subscription).informer.GetStore().List() - result = make([]*ConfigDomain, len(items)) - for k, v := range items { - item, _ := v.(*baseconfigtsmtanzuvmwarecomv1.Domain) - result[k] = &ConfigDomain{ - client: group.client, - Domain: item, - } - } - } else { - list, err := group.client.baseClient.ConfigTsmV1(). - Domains().List(ctx, opts) - if err != nil { - return nil, err - } - result = make([]*ConfigDomain, len(list.Items)) - for k, v := range list.Items { - item := v - result[k] = &ConfigDomain{ - client: group.client, - Domain: &item, - } - } + close(s.(subscription).stop) + subscriptionMap.Delete(key) } - return } -type ConfigDomain struct { - client *Clientset - *baseconfigtsmtanzuvmwarecomv1.Domain +func (c *templateGlobalTsmV1Chainer) IsSubscribed() bool { + key := "templates.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok } -// Delete removes obj and all it's children from the database. -func (obj *ConfigDomain) Delete(ctx context.Context) error { - err := obj.client.Config().DeleteDomainByName(ctx, obj.GetName()) - if err != nil { - return err +func (c *templateGlobalTsmV1Chainer) TemplateGroups(name string) *templategroupGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["templategroups.global.tsm.tanzu.vmware.com"] = name + return &templategroupGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, } - obj.Domain = nil - return nil } -// Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *ConfigDomain) Update(ctx context.Context) error { - result, err := obj.client.Config().UpdateDomainByName(ctx, obj.Domain) - if err != nil { - return err - } - obj.Domain = result.Domain - return nil +// GetTemplateGroups calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *templateGlobalTsmV1Chainer) GetTemplateGroups(ctx context.Context, displayName string) (result *GlobalTemplateGroup, err error) { + hashedName := helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetTemplateGroupByName(ctx, hashedName) } -func (obj *ConfigDomain) GetParent(ctx context.Context) (result *ConfigConfig, err error) { - hashedName := helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.config.tsm.tanzu.vmware.com"]) - return obj.client.Config().GetConfigByName(ctx, hashedName) +// AddTemplateGroups calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *templateGlobalTsmV1Chainer) AddTemplateGroups(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.TemplateGroup) (result *GlobalTemplateGroup, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateTemplateGroupByName(ctx, objToCreate) } -type domainConfigTsmV1Chainer struct { - client *Clientset - name string - parentLabels map[string]string +// DeleteTemplateGroups calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *templateGlobalTsmV1Chainer) DeleteTemplateGroups(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("templategroups.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteTemplateGroupByName(ctx, hashedName) } -func (c *domainConfigTsmV1Chainer) Subscribe() { - key := "domains.config.tsm.tanzu.vmware.com" - if _, ok := subscriptionMap.Load(key); !ok { - informer := informerconfigtsmtanzuvmwarecomv1.NewDomainInformer(c.client.baseClient, 0, cache.Indexers{}) - subscribe(key, informer) +func (c *templateGlobalTsmV1Chainer) HealthChecks(name string) *healthcheckconfignGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["healthcheckconfigns.global.tsm.tanzu.vmware.com"] = name + return &healthcheckconfignGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, } } -func (c *domainConfigTsmV1Chainer) Unsubscribe() { - key := "domains.config.tsm.tanzu.vmware.com" - if s, ok := subscriptionMap.Load(key); ok { - close(s.(subscription).stop) - subscriptionMap.Delete(key) +// GetHealthChecks calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *templateGlobalTsmV1Chainer) GetHealthChecks(ctx context.Context, displayName string) (result *GlobalHealthCheckConfigN, err error) { + hashedName := helper.GetHashedName("healthcheckconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetHealthCheckConfigNByName(ctx, hashedName) +} + +// AddHealthChecks calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *templateGlobalTsmV1Chainer) AddHealthChecks(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.HealthCheckConfigN) (result *GlobalHealthCheckConfigN, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("healthcheckconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName } + return c.client.Global().CreateHealthCheckConfigNByName(ctx, objToCreate) } -func (c *domainConfigTsmV1Chainer) IsSubscribed() bool { - key := "domains.config.tsm.tanzu.vmware.com" - _, ok := subscriptionMap.Load(key) - return ok +// DeleteHealthChecks calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *templateGlobalTsmV1Chainer) DeleteHealthChecks(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("healthcheckconfigns.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteHealthCheckConfigNByName(ctx, hashedName) } -// GetRandomGnsDataByName returns object stored in the database under the hashedName which is a hash of display +// GetTenantResourceByName returns object stored in the database under the hashedName which is a hash of display // name and parents names. Use it when you know hashed name of object. -func (group *GnsTsmV1) GetRandomGnsDataByName(ctx context.Context, hashedName string) (*GnsRandomGnsData, error) { - key := "randomgnsdatas.gns.tsm.tanzu.vmware.com" +func (group *GlobalTsmV1) GetTenantResourceByName(ctx context.Context, hashedName string) (*GlobalTenantResource, error) { + key := "tenantresources.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) if !exists { return nil, err } - result, _ := item.(*basegnstsmtanzuvmwarecomv1.RandomGnsData) - return &GnsRandomGnsData{ - client: group.client, - RandomGnsData: result, + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.TenantResource) + return &GlobalTenantResource{ + client: group.client, + TenantResource: result, }, nil } else { result, err := group.client.baseClient. - GnsTsmV1(). - RandomGnsDatas().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + TenantResources().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return nil, err } - return &GnsRandomGnsData{ - client: group.client, - RandomGnsData: result, + return &GlobalTenantResource{ + client: group.client, + TenantResource: result, }, nil } -} +} + +// DeleteTenantResourceByName deletes object stored in the database under the hashedName which is a hash of +// display name and parents names. Use it when you know hashed name of object. +func (group *GlobalTsmV1) DeleteTenantResourceByName(ctx context.Context, hashedName string) (err error) { + + result, err := group.client.baseClient. + GlobalTsmV1(). + TenantResources().Get(ctx, hashedName, metav1.GetOptions{}) + if err != nil { + return err + } + + err = group.client.baseClient. + GlobalTsmV1(). + TenantResources().Delete(ctx, hashedName, metav1.DeleteOptions{}) + if err != nil { + return err + } -// DeleteRandomGnsDataByName deletes object stored in the database under the hashedName which is a hash of -// display name and parents names. Use it when you know hashed name of object. -func (group *GnsTsmV1) DeleteRandomGnsDataByName(ctx context.Context, hashedName string) (err error) { + var patch Patch - err = group.client.baseClient. - GnsTsmV1(). - RandomGnsDatas().Delete(ctx, hashedName, metav1.DeleteOptions{}) + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/resourcesGvk/" + result.DisplayName(), + } + + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() + if err != nil { + return err + } + parents := result.GetLabels() + if parents == nil { + parents = make(map[string]string) + } + parentName, ok := parents["tenants.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY + } + if parents[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("tenants.global.tsm.tanzu.vmware.com", parents, parentName) + } + _, err = group.client.baseClient. + GlobalTsmV1(). + Tenants().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err } @@ -2479,10 +86794,10 @@ func (group *GnsTsmV1) DeleteRandomGnsDataByName(ctx context.Context, hashedName return } -// CreateRandomGnsDataByName creates object in the database without hashing the name. +// CreateTenantResourceByName creates object in the database without hashing the name. // Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *GnsTsmV1) CreateRandomGnsDataByName(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.RandomGnsData) (*GnsRandomGnsData, error) { +func (group *GlobalTsmV1) CreateTenantResourceByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.TenantResource) (*GlobalTenantResource, error) { if objToCreate.GetLabels() == nil { objToCreate.Labels = make(map[string]string) } @@ -2491,64 +86806,44 @@ func (group *GnsTsmV1) CreateRandomGnsDataByName(ctx context.Context, } result, err := group.client.baseClient. - GnsTsmV1(). - RandomGnsDatas().Create(ctx, objToCreate, metav1.CreateOptions{}) - if err != nil { - return nil, err - } - - return &GnsRandomGnsData{ - client: group.client, - RandomGnsData: result, - }, nil -} - -// SetRandomGnsDataStatusByName sets user defined status -func (group *GnsTsmV1) SetRandomGnsDataStatusByName(ctx context.Context, - objToUpdate *basegnstsmtanzuvmwarecomv1.RandomGnsData, status *basegnstsmtanzuvmwarecomv1.RandomStatus) (*GnsRandomGnsData, error) { - - // Make sure status field is present first - m := []byte("{\"status\":{}}") - result, err := group.client.baseClient. - GnsTsmV1(). - RandomGnsDatas().Patch(ctx, objToUpdate.GetName(), types.MergePatchType, m, metav1.PatchOptions{}, "status") + GlobalTsmV1(). + TenantResources().Create(ctx, objToCreate, metav1.CreateOptions{}) if err != nil { return nil, err } - patch := Patch{ - PatchOp{ - Op: "replace", - Path: "/status/status", - Value: status, - }, + parentName, ok := objToCreate.GetLabels()["tenants.global.tsm.tanzu.vmware.com"] + if !ok { + parentName = helper.DEFAULT_KEY } - marshaled, err := patch.Marshal() - if err != nil { - return nil, err + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { + parentName = helper.GetHashedName("tenants.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) } - result, err = group.client.baseClient. - GnsTsmV1(). - RandomGnsDatas().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "status") + + payload := "{\"spec\": {\"resourcesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"TenantResource\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + _, err = group.client.baseClient. + GlobalTsmV1(). + Tenants().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) if err != nil { return nil, err } - return &GnsRandomGnsData{ - client: group.client, - RandomGnsData: result, + + return &GlobalTenantResource{ + client: group.client, + TenantResource: result, }, nil } -// UpdateRandomGnsDataByName updates object stored in the database under the hashedName which is a hash of +// UpdateTenantResourceByName updates object stored in the database under the hashedName which is a hash of // display name and parents names. -func (group *GnsTsmV1) UpdateRandomGnsDataByName(ctx context.Context, - objToUpdate *basegnstsmtanzuvmwarecomv1.RandomGnsData) (*GnsRandomGnsData, error) { +func (group *GlobalTsmV1) UpdateTenantResourceByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.TenantResource) (*GlobalTenantResource, error) { // ResourceVersion must be set for update if objToUpdate.ResourceVersion == "" { current, err := group.client.baseClient. - GnsTsmV1(). - RandomGnsDatas().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + GlobalTsmV1(). + TenantResources().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) if err != nil { return nil, err } @@ -2562,263 +86857,175 @@ func (group *GnsTsmV1) UpdateRandomGnsDataByName(ctx context.Context, Value: objToUpdate.ObjectMeta, }) - patchValueDescription := - objToUpdate.Spec.Description - patchOpDescription := PatchOp{ + patchValueType := + objToUpdate.Spec.Type + patchOpType := PatchOp{ Op: "replace", - Path: "/spec/description", - Value: patchValueDescription, + Path: "/spec/type", + Value: patchValueType, } - patch = append(patch, patchOpDescription) + patch = append(patch, patchOpType) + + patchValueLocation := + objToUpdate.Spec.Location + patchOpLocation := PatchOp{ + Op: "replace", + Path: "/spec/location", + Value: patchValueLocation, + } + patch = append(patch, patchOpLocation) marshaled, err := patch.Marshal() if err != nil { return nil, err } result, err := group.client.baseClient. - GnsTsmV1(). - RandomGnsDatas().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + GlobalTsmV1(). + TenantResources().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") if err != nil { return nil, err } - return &GnsRandomGnsData{ - client: group.client, - RandomGnsData: result, + return &GlobalTenantResource{ + client: group.client, + TenantResource: result, }, nil } -// ListRandomGnsDatas returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *GnsTsmV1) ListRandomGnsDatas(ctx context.Context, - opts metav1.ListOptions) (result []*GnsRandomGnsData, err error) { - key := "randomgnsdatas.gns.tsm.tanzu.vmware.com" +// ListTenantResources returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListTenantResources(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalTenantResource, err error) { + key := "tenantresources.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { items := s.(subscription).informer.GetStore().List() - result = make([]*GnsRandomGnsData, len(items)) + result = make([]*GlobalTenantResource, len(items)) for k, v := range items { - item, _ := v.(*basegnstsmtanzuvmwarecomv1.RandomGnsData) - result[k] = &GnsRandomGnsData{ - client: group.client, - RandomGnsData: item, + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.TenantResource) + result[k] = &GlobalTenantResource{ + client: group.client, + TenantResource: item, } } } else { - list, err := group.client.baseClient.GnsTsmV1(). - RandomGnsDatas().List(ctx, opts) + list, err := group.client.baseClient.GlobalTsmV1(). + TenantResources().List(ctx, opts) if err != nil { return nil, err } - result = make([]*GnsRandomGnsData, len(list.Items)) + result = make([]*GlobalTenantResource, len(list.Items)) for k, v := range list.Items { item := v - result[k] = &GnsRandomGnsData{ - client: group.client, - RandomGnsData: &item, + result[k] = &GlobalTenantResource{ + client: group.client, + TenantResource: &item, } } } return } -type GnsRandomGnsData struct { +type GlobalTenantResource struct { client *Clientset - *basegnstsmtanzuvmwarecomv1.RandomGnsData + *baseglobaltsmtanzuvmwarecomv1.TenantResource } // Delete removes obj and all it's children from the database. -func (obj *GnsRandomGnsData) Delete(ctx context.Context) error { - err := obj.client.Gns().DeleteRandomGnsDataByName(ctx, obj.GetName()) +func (obj *GlobalTenantResource) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteTenantResourceByName(ctx, obj.GetName()) if err != nil { return err } - obj.RandomGnsData = nil + obj.TenantResource = nil return nil } // Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *GnsRandomGnsData) Update(ctx context.Context) error { - result, err := obj.client.Gns().UpdateRandomGnsDataByName(ctx, obj.RandomGnsData) - if err != nil { - return err - } - obj.RandomGnsData = result.RandomGnsData - return nil -} - -// SetStatus sets user defined status -func (obj *GnsRandomGnsData) SetStatus(ctx context.Context, status *basegnstsmtanzuvmwarecomv1.RandomStatus) error { - result, err := obj.client.Gns().SetRandomGnsDataStatusByName(ctx, obj.RandomGnsData, status) - if err != nil { - return err - } - obj.RandomGnsData = result.RandomGnsData - return nil -} - -// GetStatus to get user defined status -func (obj *GnsRandomGnsData) GetStatus(ctx context.Context) (*basegnstsmtanzuvmwarecomv1.RandomStatus, error) { - getObj, err := obj.client.Gns().GetRandomGnsDataByName(ctx, obj.GetName()) - if err != nil { - return nil, err - } - return &getObj.Status.Status, nil -} - -// ClearStatus to clear user defined status -func (obj *GnsRandomGnsData) ClearStatus(ctx context.Context) error { - result, err := obj.client.Gns().SetRandomGnsDataStatusByName(ctx, obj.RandomGnsData, &basegnstsmtanzuvmwarecomv1.RandomStatus{}) +func (obj *GlobalTenantResource) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateTenantResourceByName(ctx, obj.TenantResource) if err != nil { return err } - obj.RandomGnsData = result.RandomGnsData + obj.TenantResource = result.TenantResource return nil } -// GetGnsRandomGnsData calculates the hashed name based on parents and displayName and -// returns given object -func (c *Clientset) GetGnsRandomGnsData(ctx context.Context, displayName string) (result *GnsRandomGnsData, err error) { - hashedName := helper.GetHashedName("randomgnsdatas.gns.tsm.tanzu.vmware.com", nil, displayName) - return c.Gns().GetRandomGnsDataByName(ctx, hashedName) -} - -func (c *Clientset) GnsRandomGnsData(displayName string) *randomgnsdataGnsTsmV1Chainer { - parentLabels := make(map[string]string) - parentLabels["randomgnsdatas.gns.tsm.tanzu.vmware.com"] = displayName - return &randomgnsdataGnsTsmV1Chainer{ - client: c, - name: displayName, - parentLabels: parentLabels, - } -} - -// AddGnsRandomGnsData calculates hashed name of the object based on objToCreate.Name -// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in -// nexus/display_name label and can be obtained using DisplayName() method. -func (c *Clientset) AddGnsRandomGnsData(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.RandomGnsData) (result *GnsRandomGnsData, err error) { - if objToCreate.Labels == nil { - objToCreate.Labels = map[string]string{} - } - if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() - objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName(objToCreate.CRDName(), nil, objToCreate.GetName()) - objToCreate.Name = hashedName - } - return c.Gns().CreateRandomGnsDataByName(ctx, objToCreate) -} - -// DeleteGnsRandomGnsData calculates hashedName of object based on displayName and -// parents and deletes given object -func (c *Clientset) DeleteGnsRandomGnsData(ctx context.Context, displayName string) (err error) { - hashedName := helper.GetHashedName("randomgnsdatas.gns.tsm.tanzu.vmware.com", nil, displayName) - return c.Gns().DeleteRandomGnsDataByName(ctx, hashedName) +func (obj *GlobalTenantResource) GetParent(ctx context.Context) (result *GlobalTenant, err error) { + hashedName := helper.GetHashedName("tenants.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["tenants.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetTenantByName(ctx, hashedName) } -type randomgnsdataGnsTsmV1Chainer struct { +type tenantresourceGlobalTsmV1Chainer struct { client *Clientset name string parentLabels map[string]string } -func (c *randomgnsdataGnsTsmV1Chainer) Subscribe() { - key := "randomgnsdatas.gns.tsm.tanzu.vmware.com" +func (c *tenantresourceGlobalTsmV1Chainer) Subscribe() { + key := "tenantresources.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informergnstsmtanzuvmwarecomv1.NewRandomGnsDataInformer(c.client.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewTenantResourceInformer(c.client.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } } -func (c *randomgnsdataGnsTsmV1Chainer) Unsubscribe() { - key := "randomgnsdatas.gns.tsm.tanzu.vmware.com" +func (c *tenantresourceGlobalTsmV1Chainer) Unsubscribe() { + key := "tenantresources.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { close(s.(subscription).stop) subscriptionMap.Delete(key) } } -func (c *randomgnsdataGnsTsmV1Chainer) IsSubscribed() bool { - key := "randomgnsdatas.gns.tsm.tanzu.vmware.com" +func (c *tenantresourceGlobalTsmV1Chainer) IsSubscribed() bool { + key := "tenantresources.global.tsm.tanzu.vmware.com" _, ok := subscriptionMap.Load(key) return ok } -// ClearStatus to clear user defined status -func (c *randomgnsdataGnsTsmV1Chainer) ClearStatus(ctx context.Context) (err error) { - hashedName := helper.GetHashedName("randomgnsdatas.gns.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Gns().GetRandomGnsDataByName(ctx, hashedName) - if err != nil { - return err - } - _, err = c.client.Gns().SetRandomGnsDataStatusByName(ctx, obj.RandomGnsData, nil) - return err -} - -// GetStatus to get user defined status -func (c *randomgnsdataGnsTsmV1Chainer) GetStatus(ctx context.Context) (result *basegnstsmtanzuvmwarecomv1.RandomStatus, err error) { - hashedName := helper.GetHashedName("randomgnsdatas.gns.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Gns().GetRandomGnsDataByName(ctx, hashedName) - if err != nil { - return nil, err - } - return &obj.Status.Status, nil -} - -// SetStatus sets user defined status -func (c *randomgnsdataGnsTsmV1Chainer) SetStatus(ctx context.Context, status *basegnstsmtanzuvmwarecomv1.RandomStatus) (err error) { - hashedName := helper.GetHashedName("randomgnsdatas.gns.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Gns().GetRandomGnsDataByName(ctx, hashedName) - if err != nil { - return err - } - _, err = c.client.Gns().SetRandomGnsDataStatusByName(ctx, obj.RandomGnsData, status) - return err -} - -// GetFooByName returns object stored in the database under the hashedName which is a hash of display +// GetTenantTokenByName returns object stored in the database under the hashedName which is a hash of display // name and parents names. Use it when you know hashed name of object. -func (group *GnsTsmV1) GetFooByName(ctx context.Context, hashedName string) (*GnsFoo, error) { - key := "foos.gns.tsm.tanzu.vmware.com" +func (group *GlobalTsmV1) GetTenantTokenByName(ctx context.Context, hashedName string) (*GlobalTenantToken, error) { + key := "tenanttokens.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) if !exists { return nil, err } - result, _ := item.(*basegnstsmtanzuvmwarecomv1.Foo) - return &GnsFoo{ - client: group.client, - Foo: result, + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.TenantToken) + return &GlobalTenantToken{ + client: group.client, + TenantToken: result, }, nil } else { result, err := group.client.baseClient. - GnsTsmV1(). - Foos().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + TenantTokens().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return nil, err } - return &GnsFoo{ - client: group.client, - Foo: result, + return &GlobalTenantToken{ + client: group.client, + TenantToken: result, }, nil } } -// DeleteFooByName deletes object stored in the database under the hashedName which is a hash of +// DeleteTenantTokenByName deletes object stored in the database under the hashedName which is a hash of // display name and parents names. Use it when you know hashed name of object. -func (group *GnsTsmV1) DeleteFooByName(ctx context.Context, hashedName string) (err error) { +func (group *GlobalTsmV1) DeleteTenantTokenByName(ctx context.Context, hashedName string) (err error) { result, err := group.client.baseClient. - GnsTsmV1(). - Foos().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + TenantTokens().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return err } err = group.client.baseClient. - GnsTsmV1(). - Foos().Delete(ctx, hashedName, metav1.DeleteOptions{}) + GlobalTsmV1(). + TenantTokens().Delete(ctx, hashedName, metav1.DeleteOptions{}) if err != nil { return err } @@ -2827,7 +87034,7 @@ func (group *GnsTsmV1) DeleteFooByName(ctx context.Context, hashedName string) ( patchOp := PatchOp{ Op: "remove", - Path: "/spec/fooGvk", + Path: "/spec/tenantTokenGvk/" + result.DisplayName(), } patch = append(patch, patchOp) @@ -2839,16 +87046,16 @@ func (group *GnsTsmV1) DeleteFooByName(ctx context.Context, hashedName string) ( if parents == nil { parents = make(map[string]string) } - parentName, ok := parents["gnses.gns.tsm.tanzu.vmware.com"] + parentName, ok := parents["globalregistrationservices.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if parents[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", parents, parentName) + parentName = helper.GetHashedName("globalregistrationservices.global.tsm.tanzu.vmware.com", parents, parentName) } _, err = group.client.baseClient. - GnsTsmV1(). - Gnses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + GlobalRegistrationServices().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err } @@ -2856,10 +87063,10 @@ func (group *GnsTsmV1) DeleteFooByName(ctx context.Context, hashedName string) ( return } -// CreateFooByName creates object in the database without hashing the name. +// CreateTenantTokenByName creates object in the database without hashing the name. // Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *GnsTsmV1) CreateFooByName(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.Foo) (*GnsFoo, error) { +func (group *GlobalTsmV1) CreateTenantTokenByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.TenantToken) (*GlobalTenantToken, error) { if objToCreate.GetLabels() == nil { objToCreate.Labels = make(map[string]string) } @@ -2868,58 +87075,44 @@ func (group *GnsTsmV1) CreateFooByName(ctx context.Context, } result, err := group.client.baseClient. - GnsTsmV1(). - Foos().Create(ctx, objToCreate, metav1.CreateOptions{}) + GlobalTsmV1(). + TenantTokens().Create(ctx, objToCreate, metav1.CreateOptions{}) if err != nil { return nil, err } - parentName, ok := objToCreate.GetLabels()["gnses.gns.tsm.tanzu.vmware.com"] + parentName, ok := objToCreate.GetLabels()["globalregistrationservices.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + parentName = helper.GetHashedName("globalregistrationservices.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) } - var patch Patch - patchOp := PatchOp{ - Op: "replace", - Path: "/spec/fooGvk", - Value: basegnstsmtanzuvmwarecomv1.Child{ - Group: "gns.tsm.tanzu.vmware.com", - Kind: "Foo", - Name: objToCreate.Name, - }, - } - patch = append(patch, patchOp) - marshaled, err := patch.Marshal() - if err != nil { - return nil, err - } + payload := "{\"spec\": {\"tenantTokenGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"TenantToken\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" _, err = group.client.baseClient. - GnsTsmV1(). - Gnses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + GlobalRegistrationServices().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) if err != nil { return nil, err } - return &GnsFoo{ - client: group.client, - Foo: result, + return &GlobalTenantToken{ + client: group.client, + TenantToken: result, }, nil } -// UpdateFooByName updates object stored in the database under the hashedName which is a hash of +// UpdateTenantTokenByName updates object stored in the database under the hashedName which is a hash of // display name and parents names. -func (group *GnsTsmV1) UpdateFooByName(ctx context.Context, - objToUpdate *basegnstsmtanzuvmwarecomv1.Foo) (*GnsFoo, error) { +func (group *GlobalTsmV1) UpdateTenantTokenByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.TenantToken) (*GlobalTenantToken, error) { // ResourceVersion must be set for update if objToUpdate.ResourceVersion == "" { current, err := group.client.baseClient. - GnsTsmV1(). - Foos().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + GlobalTsmV1(). + TenantTokens().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) if err != nil { return nil, err } @@ -2933,210 +87126,200 @@ func (group *GnsTsmV1) UpdateFooByName(ctx context.Context, Value: objToUpdate.ObjectMeta, }) - patchValuePassword := - objToUpdate.Spec.Password - patchOpPassword := PatchOp{ + patchValueTtl := + objToUpdate.Spec.Ttl + patchOpTtl := PatchOp{ Op: "replace", - Path: "/spec/password", - Value: patchValuePassword, + Path: "/spec/ttl", + Value: patchValueTtl, } - patch = append(patch, patchOpPassword) + patch = append(patch, patchOpTtl) + + patchValueCreated := + objToUpdate.Spec.Created + patchOpCreated := PatchOp{ + Op: "replace", + Path: "/spec/created", + Value: patchValueCreated, + } + patch = append(patch, patchOpCreated) + + patchValueTenantId := + objToUpdate.Spec.TenantId + patchOpTenantId := PatchOp{ + Op: "replace", + Path: "/spec/tenantId", + Value: patchValueTenantId, + } + patch = append(patch, patchOpTenantId) marshaled, err := patch.Marshal() if err != nil { return nil, err } result, err := group.client.baseClient. - GnsTsmV1(). - Foos().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + GlobalTsmV1(). + TenantTokens().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") if err != nil { return nil, err } - return &GnsFoo{ - client: group.client, - Foo: result, + return &GlobalTenantToken{ + client: group.client, + TenantToken: result, }, nil } -// ListFoos returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *GnsTsmV1) ListFoos(ctx context.Context, - opts metav1.ListOptions) (result []*GnsFoo, err error) { - key := "foos.gns.tsm.tanzu.vmware.com" +// ListTenantTokens returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListTenantTokens(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalTenantToken, err error) { + key := "tenanttokens.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { items := s.(subscription).informer.GetStore().List() - result = make([]*GnsFoo, len(items)) + result = make([]*GlobalTenantToken, len(items)) for k, v := range items { - item, _ := v.(*basegnstsmtanzuvmwarecomv1.Foo) - result[k] = &GnsFoo{ - client: group.client, - Foo: item, + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.TenantToken) + result[k] = &GlobalTenantToken{ + client: group.client, + TenantToken: item, } } } else { - list, err := group.client.baseClient.GnsTsmV1(). - Foos().List(ctx, opts) + list, err := group.client.baseClient.GlobalTsmV1(). + TenantTokens().List(ctx, opts) if err != nil { return nil, err } - result = make([]*GnsFoo, len(list.Items)) + result = make([]*GlobalTenantToken, len(list.Items)) for k, v := range list.Items { item := v - result[k] = &GnsFoo{ - client: group.client, - Foo: &item, + result[k] = &GlobalTenantToken{ + client: group.client, + TenantToken: &item, } } } return } -type GnsFoo struct { +type GlobalTenantToken struct { client *Clientset - *basegnstsmtanzuvmwarecomv1.Foo + *baseglobaltsmtanzuvmwarecomv1.TenantToken } // Delete removes obj and all it's children from the database. -func (obj *GnsFoo) Delete(ctx context.Context) error { - err := obj.client.Gns().DeleteFooByName(ctx, obj.GetName()) +func (obj *GlobalTenantToken) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteTenantTokenByName(ctx, obj.GetName()) if err != nil { return err } - obj.Foo = nil + obj.TenantToken = nil return nil } // Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *GnsFoo) Update(ctx context.Context) error { - result, err := obj.client.Gns().UpdateFooByName(ctx, obj.Foo) +func (obj *GlobalTenantToken) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateTenantTokenByName(ctx, obj.TenantToken) if err != nil { return err } - obj.Foo = result.Foo + obj.TenantToken = result.TenantToken return nil } -func (obj *GnsFoo) GetParent(ctx context.Context) (result *GnsGns, err error) { - hashedName := helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnses.gns.tsm.tanzu.vmware.com"]) - return obj.client.Gns().GetGnsByName(ctx, hashedName) +func (obj *GlobalTenantToken) GetParent(ctx context.Context) (result *GlobalGlobalRegistrationService, err error) { + hashedName := helper.GetHashedName("globalregistrationservices.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["globalregistrationservices.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGlobalRegistrationServiceByName(ctx, hashedName) } -type fooGnsTsmV1Chainer struct { +type tenanttokenGlobalTsmV1Chainer struct { client *Clientset name string parentLabels map[string]string } -func (c *fooGnsTsmV1Chainer) Subscribe() { - key := "foos.gns.tsm.tanzu.vmware.com" +func (c *tenanttokenGlobalTsmV1Chainer) Subscribe() { + key := "tenanttokens.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informergnstsmtanzuvmwarecomv1.NewFooInformer(c.client.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewTenantTokenInformer(c.client.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } } -func (c *fooGnsTsmV1Chainer) Unsubscribe() { - key := "foos.gns.tsm.tanzu.vmware.com" +func (c *tenanttokenGlobalTsmV1Chainer) Unsubscribe() { + key := "tenanttokens.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { close(s.(subscription).stop) subscriptionMap.Delete(key) } } -func (c *fooGnsTsmV1Chainer) IsSubscribed() bool { - key := "foos.gns.tsm.tanzu.vmware.com" +func (c *tenanttokenGlobalTsmV1Chainer) IsSubscribed() bool { + key := "tenanttokens.global.tsm.tanzu.vmware.com" _, ok := subscriptionMap.Load(key) return ok } -// GetGnsByName returns object stored in the database under the hashedName which is a hash of display +// GetTenantByName returns object stored in the database under the hashedName which is a hash of display // name and parents names. Use it when you know hashed name of object. -func (group *GnsTsmV1) GetGnsByName(ctx context.Context, hashedName string) (*GnsGns, error) { - key := "gnses.gns.tsm.tanzu.vmware.com" +func (group *GlobalTsmV1) GetTenantByName(ctx context.Context, hashedName string) (*GlobalTenant, error) { + key := "tenants.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) if !exists { return nil, err } - result, _ := item.(*basegnstsmtanzuvmwarecomv1.Gns) - return &GnsGns{ + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.Tenant) + return &GlobalTenant{ client: group.client, - Gns: result, + Tenant: result, }, nil } else { result, err := group.client.baseClient. - GnsTsmV1(). - Gnses().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + Tenants().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return nil, err } - return &GnsGns{ + return &GlobalTenant{ client: group.client, - Gns: result, + Tenant: result, }, nil } } -// DeleteGnsByName deletes object stored in the database under the hashedName which is a hash of +// DeleteTenantByName deletes object stored in the database under the hashedName which is a hash of // display name and parents names. Use it when you know hashed name of object. -func (group *GnsTsmV1) DeleteGnsByName(ctx context.Context, hashedName string) (err error) { +func (group *GlobalTsmV1) DeleteTenantByName(ctx context.Context, hashedName string) (err error) { result, err := group.client.baseClient. - GnsTsmV1(). - Gnses().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + Tenants().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return err } - for _, v := range result.Spec.GnsServiceGroupsGvk { - err := group.client. - Servicegroup().DeleteSvcGroupByName(ctx, v.Name) - if err != nil { - return err - } - } - - if result.Spec.GnsAccessControlPolicyGvk != nil { - err := group.client. - Policypkg(). - DeleteAccessControlPolicyByName(ctx, result.Spec.GnsAccessControlPolicyGvk.Name) - if err != nil { - return err - } - } - - if result.Spec.FooChildGvk != nil { + for _, v := range result.Spec.ResourcesGvk { err := group.client. - Gns(). - DeleteBarChildByName(ctx, result.Spec.FooChildGvk.Name) + Global().DeleteTenantResourceByName(ctx, v.Name) if err != nil { return err } } - if result.Spec.IgnoreChildGvk != nil { + for _, v := range result.Spec.AnnotationsGvk { err := group.client. - Gns(). - DeleteIgnoreChildByName(ctx, result.Spec.IgnoreChildGvk.Name) - if err != nil { - return err - } - } - - if result.Spec.FooGvk != nil { - err := group.client. - Gns(). - DeleteFooByName(ctx, result.Spec.FooGvk.Name) + Global().DeleteAnnotationByName(ctx, v.Name) if err != nil { return err } } err = group.client.baseClient. - GnsTsmV1(). - Gnses().Delete(ctx, hashedName, metav1.DeleteOptions{}) + GlobalTsmV1(). + Tenants().Delete(ctx, hashedName, metav1.DeleteOptions{}) if err != nil { return err } @@ -3145,7 +87328,7 @@ func (group *GnsTsmV1) DeleteGnsByName(ctx context.Context, hashedName string) ( patchOp := PatchOp{ Op: "remove", - Path: "/spec/gNSGvk", + Path: "/spec/tenantsGvk/" + result.DisplayName(), } patch = append(patch, patchOp) @@ -3157,16 +87340,16 @@ func (group *GnsTsmV1) DeleteGnsByName(ctx context.Context, hashedName string) ( if parents == nil { parents = make(map[string]string) } - parentName, ok := parents["configs.config.tsm.tanzu.vmware.com"] + parentName, ok := parents["globalregistrationservices.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if parents[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", parents, parentName) + parentName = helper.GetHashedName("globalregistrationservices.global.tsm.tanzu.vmware.com", parents, parentName) } _, err = group.client.baseClient. - ConfigTsmV1(). - Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + GlobalRegistrationServices().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err } @@ -3174,10 +87357,10 @@ func (group *GnsTsmV1) DeleteGnsByName(ctx context.Context, hashedName string) ( return } -// CreateGnsByName creates object in the database without hashing the name. +// CreateTenantByName creates object in the database without hashing the name. // Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *GnsTsmV1) CreateGnsByName(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.Gns) (*GnsGns, error) { +func (group *GlobalTsmV1) CreateTenantByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Tenant) (*GlobalTenant, error) { if objToCreate.GetLabels() == nil { objToCreate.Labels = make(map[string]string) } @@ -3185,102 +87368,49 @@ func (group *GnsTsmV1) CreateGnsByName(ctx context.Context, objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() } - objToCreate.Spec.GnsServiceGroupsGvk = nil - objToCreate.Spec.GnsAccessControlPolicyGvk = nil - objToCreate.Spec.FooChildGvk = nil - objToCreate.Spec.IgnoreChildGvk = nil - objToCreate.Spec.FooGvk = nil - objToCreate.Spec.DnsGvk = nil + objToCreate.Spec.ResourcesGvk = nil + objToCreate.Spec.AnnotationsGvk = nil + objToCreate.Spec.TemplateGvk = nil result, err := group.client.baseClient. - GnsTsmV1(). - Gnses().Create(ctx, objToCreate, metav1.CreateOptions{}) + GlobalTsmV1(). + Tenants().Create(ctx, objToCreate, metav1.CreateOptions{}) if err != nil { return nil, err } - parentName, ok := objToCreate.GetLabels()["configs.config.tsm.tanzu.vmware.com"] + parentName, ok := objToCreate.GetLabels()["globalregistrationservices.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + parentName = helper.GetHashedName("globalregistrationservices.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) } - var patch Patch - patchOp := PatchOp{ - Op: "replace", - Path: "/spec/gNSGvk", - Value: basegnstsmtanzuvmwarecomv1.Child{ - Group: "gns.tsm.tanzu.vmware.com", - Kind: "Gns", - Name: objToCreate.Name, - }, - } - patch = append(patch, patchOp) - marshaled, err := patch.Marshal() - if err != nil { - return nil, err - } + payload := "{\"spec\": {\"tenantsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"Tenant\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" _, err = group.client.baseClient. - ConfigTsmV1(). - Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) - if err != nil { - return nil, err - } - - return &GnsGns{ - client: group.client, - Gns: result, - }, nil -} - -// SetGnsStateByName sets user defined status -func (group *GnsTsmV1) SetGnsStateByName(ctx context.Context, - objToUpdate *basegnstsmtanzuvmwarecomv1.Gns, status *basegnstsmtanzuvmwarecomv1.GnsState) (*GnsGns, error) { - - // Make sure status field is present first - m := []byte("{\"status\":{}}") - result, err := group.client.baseClient. - GnsTsmV1(). - Gnses().Patch(ctx, objToUpdate.GetName(), types.MergePatchType, m, metav1.PatchOptions{}, "status") + GlobalTsmV1(). + GlobalRegistrationServices().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) if err != nil { return nil, err } - patch := Patch{ - PatchOp{ - Op: "replace", - Path: "/status/state", - Value: status, - }, - } - marshaled, err := patch.Marshal() - if err != nil { - return nil, err - } - result, err = group.client.baseClient. - GnsTsmV1(). - Gnses().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "status") - if err != nil { - return nil, err - } - return &GnsGns{ + return &GlobalTenant{ client: group.client, - Gns: result, + Tenant: result, }, nil } -// UpdateGnsByName updates object stored in the database under the hashedName which is a hash of +// UpdateTenantByName updates object stored in the database under the hashedName which is a hash of // display name and parents names. -func (group *GnsTsmV1) UpdateGnsByName(ctx context.Context, - objToUpdate *basegnstsmtanzuvmwarecomv1.Gns) (*GnsGns, error) { +func (group *GlobalTsmV1) UpdateTenantByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.Tenant) (*GlobalTenant, error) { // ResourceVersion must be set for update if objToUpdate.ResourceVersion == "" { current, err := group.client.baseClient. - GnsTsmV1(). - Gnses().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + GlobalTsmV1(). + Tenants().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) if err != nil { return nil, err } @@ -3294,252 +87424,154 @@ func (group *GnsTsmV1) UpdateGnsByName(ctx context.Context, Value: objToUpdate.ObjectMeta, }) - patchValueDomain := - objToUpdate.Spec.Domain - patchOpDomain := PatchOp{ - Op: "replace", - Path: "/spec/domain", - Value: patchValueDomain, - } - patch = append(patch, patchOpDomain) - - patchValueUseSharedGateway := - objToUpdate.Spec.UseSharedGateway - patchOpUseSharedGateway := PatchOp{ - Op: "replace", - Path: "/spec/useSharedGateway", - Value: patchValueUseSharedGateway, - } - patch = append(patch, patchOpUseSharedGateway) - - patchValueDescription := - objToUpdate.Spec.Description - patchOpDescription := PatchOp{ - Op: "replace", - Path: "/spec/description", - Value: patchValueDescription, - } - patch = append(patch, patchOpDescription) - - patchValueMeta := - objToUpdate.Spec.Meta - patchOpMeta := PatchOp{ - Op: "replace", - Path: "/spec/meta", - Value: patchValueMeta, - } - patch = append(patch, patchOpMeta) - - patchValuePort := - objToUpdate.Spec.Port - patchOpPort := PatchOp{ + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ Op: "replace", - Path: "/spec/port", - Value: patchValuePort, + Path: "/spec/name", + Value: patchValueName, } - patch = append(patch, patchOpPort) + patch = append(patch, patchOpName) - patchValueOtherDescription := - objToUpdate.Spec.OtherDescription - patchOpOtherDescription := PatchOp{ + patchValueTenantName := + objToUpdate.Spec.TenantName + patchOpTenantName := PatchOp{ Op: "replace", - Path: "/spec/otherDescription", - Value: patchValueOtherDescription, - } - patch = append(patch, patchOpOtherDescription) - - if objToUpdate.Spec.MapPointer != nil { - patchValueMapPointer := - objToUpdate.Spec.MapPointer - patchOpMapPointer := PatchOp{ - Op: "replace", - Path: "/spec/mapPointer", - Value: patchValueMapPointer, - } - patch = append(patch, patchOpMapPointer) + Path: "/spec/tenantName", + Value: patchValueTenantName, } + patch = append(patch, patchOpTenantName) - patchValueSlicePointer := - objToUpdate.Spec.SlicePointer - patchOpSlicePointer := PatchOp{ + patchValueContactEmail := + objToUpdate.Spec.ContactEmail + patchOpContactEmail := PatchOp{ Op: "replace", - Path: "/spec/slicePointer", - Value: patchValueSlicePointer, + Path: "/spec/contactEmail", + Value: patchValueContactEmail, } - patch = append(patch, patchOpSlicePointer) + patch = append(patch, patchOpContactEmail) - patchValueWorkloadSpec := - objToUpdate.Spec.WorkloadSpec - patchOpWorkloadSpec := PatchOp{ + patchValueYaml := + objToUpdate.Spec.Yaml + patchOpYaml := PatchOp{ Op: "replace", - Path: "/spec/workloadSpec", - Value: patchValueWorkloadSpec, + Path: "/spec/yaml", + Value: patchValueYaml, } - patch = append(patch, patchOpWorkloadSpec) + patch = append(patch, patchOpYaml) - patchValueDifferentSpec := - objToUpdate.Spec.DifferentSpec - patchOpDifferentSpec := PatchOp{ + patchValueLb := + objToUpdate.Spec.Lb + patchOpLb := PatchOp{ Op: "replace", - Path: "/spec/differentSpec", - Value: patchValueDifferentSpec, + Path: "/spec/lb", + Value: patchValueLb, } - patch = append(patch, patchOpDifferentSpec) + patch = append(patch, patchOpLb) - patchValueServiceSegmentRef := - objToUpdate.Spec.ServiceSegmentRef - patchOpServiceSegmentRef := PatchOp{ + patchValueCompanySize := + objToUpdate.Spec.CompanySize + patchOpCompanySize := PatchOp{ Op: "replace", - Path: "/spec/serviceSegmentRef", - Value: patchValueServiceSegmentRef, + Path: "/spec/companySize", + Value: patchValueCompanySize, } - patch = append(patch, patchOpServiceSegmentRef) + patch = append(patch, patchOpCompanySize) - patchValueServiceSegmentRefPointer := - objToUpdate.Spec.ServiceSegmentRefPointer - patchOpServiceSegmentRefPointer := PatchOp{ + patchValueAddress := + objToUpdate.Spec.Address + patchOpAddress := PatchOp{ Op: "replace", - Path: "/spec/serviceSegmentRefPointer", - Value: patchValueServiceSegmentRefPointer, - } - patch = append(patch, patchOpServiceSegmentRefPointer) - - if objToUpdate.Spec.ServiceSegmentRefs != nil { - patchValueServiceSegmentRefs := - objToUpdate.Spec.ServiceSegmentRefs - patchOpServiceSegmentRefs := PatchOp{ - Op: "replace", - Path: "/spec/serviceSegmentRefs", - Value: patchValueServiceSegmentRefs, - } - patch = append(patch, patchOpServiceSegmentRefs) - } - - if objToUpdate.Spec.ServiceSegmentRefMap != nil { - patchValueServiceSegmentRefMap := - objToUpdate.Spec.ServiceSegmentRefMap - patchOpServiceSegmentRefMap := PatchOp{ - Op: "replace", - Path: "/spec/serviceSegmentRefMap", - Value: patchValueServiceSegmentRefMap, - } - patch = append(patch, patchOpServiceSegmentRefMap) + Path: "/spec/address", + Value: patchValueAddress, } + patch = append(patch, patchOpAddress) marshaled, err := patch.Marshal() if err != nil { return nil, err } result, err := group.client.baseClient. - GnsTsmV1(). - Gnses().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + GlobalTsmV1(). + Tenants().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") if err != nil { return nil, err } - return &GnsGns{ + return &GlobalTenant{ client: group.client, - Gns: result, + Tenant: result, }, nil } -// ListGnses returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *GnsTsmV1) ListGnses(ctx context.Context, - opts metav1.ListOptions) (result []*GnsGns, err error) { - key := "gnses.gns.tsm.tanzu.vmware.com" +// ListTenants returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListTenants(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalTenant, err error) { + key := "tenants.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { items := s.(subscription).informer.GetStore().List() - result = make([]*GnsGns, len(items)) + result = make([]*GlobalTenant, len(items)) for k, v := range items { - item, _ := v.(*basegnstsmtanzuvmwarecomv1.Gns) - result[k] = &GnsGns{ + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.Tenant) + result[k] = &GlobalTenant{ client: group.client, - Gns: item, + Tenant: item, } } } else { - list, err := group.client.baseClient.GnsTsmV1(). - Gnses().List(ctx, opts) + list, err := group.client.baseClient.GlobalTsmV1(). + Tenants().List(ctx, opts) if err != nil { return nil, err } - result = make([]*GnsGns, len(list.Items)) + result = make([]*GlobalTenant, len(list.Items)) for k, v := range list.Items { item := v - result[k] = &GnsGns{ + result[k] = &GlobalTenant{ client: group.client, - Gns: &item, + Tenant: &item, } } } return } -type GnsGns struct { +type GlobalTenant struct { client *Clientset - *basegnstsmtanzuvmwarecomv1.Gns + *baseglobaltsmtanzuvmwarecomv1.Tenant } // Delete removes obj and all it's children from the database. -func (obj *GnsGns) Delete(ctx context.Context) error { - err := obj.client.Gns().DeleteGnsByName(ctx, obj.GetName()) +func (obj *GlobalTenant) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteTenantByName(ctx, obj.GetName()) if err != nil { return err } - obj.Gns = nil + obj.Tenant = nil return nil } // Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *GnsGns) Update(ctx context.Context) error { - result, err := obj.client.Gns().UpdateGnsByName(ctx, obj.Gns) - if err != nil { - return err - } - obj.Gns = result.Gns - return nil -} - -// SetState sets user defined status -func (obj *GnsGns) SetState(ctx context.Context, status *basegnstsmtanzuvmwarecomv1.GnsState) error { - result, err := obj.client.Gns().SetGnsStateByName(ctx, obj.Gns, status) - if err != nil { - return err - } - obj.Gns = result.Gns - return nil -} - -// GetState to get user defined status -func (obj *GnsGns) GetState(ctx context.Context) (*basegnstsmtanzuvmwarecomv1.GnsState, error) { - getObj, err := obj.client.Gns().GetGnsByName(ctx, obj.GetName()) - if err != nil { - return nil, err - } - return &getObj.Status.State, nil -} - -// ClearState to clear user defined status -func (obj *GnsGns) ClearState(ctx context.Context) error { - result, err := obj.client.Gns().SetGnsStateByName(ctx, obj.Gns, &basegnstsmtanzuvmwarecomv1.GnsState{}) +func (obj *GlobalTenant) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateTenantByName(ctx, obj.Tenant) if err != nil { return err } - obj.Gns = result.Gns + obj.Tenant = result.Tenant return nil } -func (obj *GnsGns) GetParent(ctx context.Context) (result *ConfigConfig, err error) { - hashedName := helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.config.tsm.tanzu.vmware.com"]) - return obj.client.Config().GetConfigByName(ctx, hashedName) +func (obj *GlobalTenant) GetParent(ctx context.Context) (result *GlobalGlobalRegistrationService, err error) { + hashedName := helper.GetHashedName("globalregistrationservices.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["globalregistrationservices.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGlobalRegistrationServiceByName(ctx, hashedName) } -// GetAllGnsServiceGroups returns all children of given type -func (obj *GnsGns) GetAllGnsServiceGroups(ctx context.Context) ( - result []*ServicegroupSvcGroup, err error) { - result = make([]*ServicegroupSvcGroup, 0, len(obj.Spec.GnsServiceGroupsGvk)) - for _, v := range obj.Spec.GnsServiceGroupsGvk { - l, err := obj.client.Servicegroup().GetSvcGroupByName(ctx, v.Name) +// GetAllResources returns all children of given type +func (obj *GlobalTenant) GetAllResources(ctx context.Context) ( + result []*GlobalTenantResource, err error) { + result = make([]*GlobalTenantResource, 0, len(obj.Spec.ResourcesGvk)) + for _, v := range obj.Spec.ResourcesGvk { + l, err := obj.client.Global().GetTenantResourceByName(ctx, v.Name) if err != nil { return nil, err } @@ -3548,305 +87580,153 @@ func (obj *GnsGns) GetAllGnsServiceGroups(ctx context.Context) ( return } -// GetGnsServiceGroups returns child which has given displayName -func (obj *GnsGns) GetGnsServiceGroups(ctx context.Context, - displayName string) (result *ServicegroupSvcGroup, err error) { - l, ok := obj.Spec.GnsServiceGroupsGvk[displayName] +// GetResources returns child which has given displayName +func (obj *GlobalTenant) GetResources(ctx context.Context, + displayName string) (result *GlobalTenantResource, err error) { + l, ok := obj.Spec.ResourcesGvk[displayName] if !ok { - return nil, NewChildNotFound(obj.DisplayName(), "Gns.Gns", "GnsServiceGroups", displayName) + return nil, NewChildNotFound(obj.DisplayName(), "Global.Tenant", "Resources", displayName) } - result, err = obj.client.Servicegroup().GetSvcGroupByName(ctx, l.Name) + result, err = obj.client.Global().GetTenantResourceByName(ctx, l.Name) return } -// AddGnsServiceGroups calculates hashed name of the child to create based on objToCreate.Name +// AddResources calculates hashed name of the child to create based on objToCreate.Name // and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in // nexus/display_name label and can be obtained using DisplayName() method. -func (obj *GnsGns) AddGnsServiceGroups(ctx context.Context, - objToCreate *baseservicegrouptsmtanzuvmwarecomv1.SvcGroup) (result *ServicegroupSvcGroup, err error) { +func (obj *GlobalTenant) AddResources(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.TenantResource) (result *GlobalTenantResource, err error) { if objToCreate.Labels == nil { objToCreate.Labels = map[string]string{} } - for _, v := range helper.GetCRDParentsMap()["gnses.gns.tsm.tanzu.vmware.com"] { + for _, v := range helper.GetCRDParentsMap()["tenants.global.tsm.tanzu.vmware.com"] { objToCreate.Labels[v] = obj.Labels[v] } - objToCreate.Labels["gnses.gns.tsm.tanzu.vmware.com"] = obj.DisplayName() + objToCreate.Labels["tenants.global.tsm.tanzu.vmware.com"] = obj.DisplayName() if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) objToCreate.Name = hashedName } - result, err = obj.client.Servicegroup().CreateSvcGroupByName(ctx, objToCreate) - updatedObj, getErr := obj.client.Gns().GetGnsByName(ctx, obj.GetName()) + result, err = obj.client.Global().CreateTenantResourceByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetTenantByName(ctx, obj.GetName()) if getErr == nil { - obj.Gns = updatedObj.Gns + obj.Tenant = updatedObj.Tenant } return } -// DeleteGnsServiceGroups calculates hashed name of the child to delete based on displayName +// DeleteResources calculates hashed name of the child to delete based on displayName // and parents names and deletes it. -func (obj *GnsGns) DeleteGnsServiceGroups(ctx context.Context, displayName string) (err error) { - l, ok := obj.Spec.GnsServiceGroupsGvk[displayName] +func (obj *GlobalTenant) DeleteResources(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.ResourcesGvk[displayName] if !ok { - return NewChildNotFound(obj.DisplayName(), "Gns.Gns", "GnsServiceGroups", displayName) + return NewChildNotFound(obj.DisplayName(), "Global.Tenant", "Resources", displayName) } - err = obj.client.Servicegroup().DeleteSvcGroupByName(ctx, l.Name) + err = obj.client.Global().DeleteTenantResourceByName(ctx, l.Name) if err != nil { return err } - updatedObj, err := obj.client.Gns().GetGnsByName(ctx, obj.GetName()) + updatedObj, err := obj.client.Global().GetTenantByName(ctx, obj.GetName()) if err == nil { - obj.Gns = updatedObj.Gns - } - return -} - -// GetGnsAccessControlPolicy returns child of given type -func (obj *GnsGns) GetGnsAccessControlPolicy(ctx context.Context) ( - result *PolicypkgAccessControlPolicy, err error) { - if obj.Spec.GnsAccessControlPolicyGvk == nil { - return nil, NewChildNotFound(obj.DisplayName(), "Gns.Gns", "GnsAccessControlPolicy") - } - return obj.client.Policypkg().GetAccessControlPolicyByName(ctx, obj.Spec.GnsAccessControlPolicyGvk.Name) -} - -// AddGnsAccessControlPolicy calculates hashed name of the child to create based on objToCreate.Name -// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in -// nexus/display_name label and can be obtained using DisplayName() method. -func (obj *GnsGns) AddGnsAccessControlPolicy(ctx context.Context, - objToCreate *basepolicypkgtsmtanzuvmwarecomv1.AccessControlPolicy) (result *PolicypkgAccessControlPolicy, err error) { - if objToCreate.Labels == nil { - objToCreate.Labels = map[string]string{} - } - for _, v := range helper.GetCRDParentsMap()["gnses.gns.tsm.tanzu.vmware.com"] { - objToCreate.Labels[v] = obj.Labels[v] - } - objToCreate.Labels["gnses.gns.tsm.tanzu.vmware.com"] = obj.DisplayName() - if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() - objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) - objToCreate.Name = hashedName - } - result, err = obj.client.Policypkg().CreateAccessControlPolicyByName(ctx, objToCreate) - updatedObj, getErr := obj.client.Gns().GetGnsByName(ctx, obj.GetName()) - if getErr == nil { - obj.Gns = updatedObj.Gns + obj.Tenant = updatedObj.Tenant } return } -// DeleteGnsAccessControlPolicy calculates hashed name of the child to delete based on displayName -// and parents names and deletes it. - -func (obj *GnsGns) DeleteGnsAccessControlPolicy(ctx context.Context) (err error) { - if obj.Spec.GnsAccessControlPolicyGvk != nil { - err = obj.client. - Policypkg().DeleteAccessControlPolicyByName(ctx, obj.Spec.GnsAccessControlPolicyGvk.Name) +// GetAllAnnotations returns all children of given type +func (obj *GlobalTenant) GetAllAnnotations(ctx context.Context) ( + result []*GlobalAnnotation, err error) { + result = make([]*GlobalAnnotation, 0, len(obj.Spec.AnnotationsGvk)) + for _, v := range obj.Spec.AnnotationsGvk { + l, err := obj.client.Global().GetAnnotationByName(ctx, v.Name) if err != nil { - return err - } - } - updatedObj, err := obj.client. - Gns().GetGnsByName(ctx, obj.GetName()) - if err == nil { - obj.Gns = updatedObj.Gns - } - return -} - -// GetFooChild returns child of given type -func (obj *GnsGns) GetFooChild(ctx context.Context) ( - result *GnsBarChild, err error) { - if obj.Spec.FooChildGvk == nil { - return nil, NewChildNotFound(obj.DisplayName(), "Gns.Gns", "FooChild") - } - return obj.client.Gns().GetBarChildByName(ctx, obj.Spec.FooChildGvk.Name) -} - -// AddFooChild calculates hashed name of the child to create based on objToCreate.Name -// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in -// nexus/display_name label and can be obtained using DisplayName() method. -func (obj *GnsGns) AddFooChild(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.BarChild) (result *GnsBarChild, err error) { - if objToCreate.Labels == nil { - objToCreate.Labels = map[string]string{} - } - for _, v := range helper.GetCRDParentsMap()["gnses.gns.tsm.tanzu.vmware.com"] { - objToCreate.Labels[v] = obj.Labels[v] - } - objToCreate.Labels["gnses.gns.tsm.tanzu.vmware.com"] = obj.DisplayName() - if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { - if objToCreate.GetName() == "" { - objToCreate.SetName(helper.DEFAULT_KEY) - } - if objToCreate.GetName() != helper.DEFAULT_KEY { - return nil, NewSingletonNameError(objToCreate.GetName()) + return nil, err } - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() - objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) - objToCreate.Name = hashedName - } - result, err = obj.client.Gns().CreateBarChildByName(ctx, objToCreate) - updatedObj, getErr := obj.client.Gns().GetGnsByName(ctx, obj.GetName()) - if getErr == nil { - obj.Gns = updatedObj.Gns + result = append(result, l) } return } -// DeleteFooChild calculates hashed name of the child to delete based on displayName -// and parents names and deletes it. - -func (obj *GnsGns) DeleteFooChild(ctx context.Context) (err error) { - if obj.Spec.FooChildGvk != nil { - err = obj.client. - Gns().DeleteBarChildByName(ctx, obj.Spec.FooChildGvk.Name) - if err != nil { - return err - } - } - updatedObj, err := obj.client. - Gns().GetGnsByName(ctx, obj.GetName()) - if err == nil { - obj.Gns = updatedObj.Gns +// GetAnnotations returns child which has given displayName +func (obj *GlobalTenant) GetAnnotations(ctx context.Context, + displayName string) (result *GlobalAnnotation, err error) { + l, ok := obj.Spec.AnnotationsGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.Tenant", "Annotations", displayName) } + result, err = obj.client.Global().GetAnnotationByName(ctx, l.Name) return } -// GetIgnoreChild returns child of given type -func (obj *GnsGns) GetIgnoreChild(ctx context.Context) ( - result *GnsIgnoreChild, err error) { - if obj.Spec.IgnoreChildGvk == nil { - return nil, NewChildNotFound(obj.DisplayName(), "Gns.Gns", "IgnoreChild") - } - return obj.client.Gns().GetIgnoreChildByName(ctx, obj.Spec.IgnoreChildGvk.Name) -} - -// AddIgnoreChild calculates hashed name of the child to create based on objToCreate.Name +// AddAnnotations calculates hashed name of the child to create based on objToCreate.Name // and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in // nexus/display_name label and can be obtained using DisplayName() method. -func (obj *GnsGns) AddIgnoreChild(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.IgnoreChild) (result *GnsIgnoreChild, err error) { +func (obj *GlobalTenant) AddAnnotations(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Annotation) (result *GlobalAnnotation, err error) { if objToCreate.Labels == nil { objToCreate.Labels = map[string]string{} } - for _, v := range helper.GetCRDParentsMap()["gnses.gns.tsm.tanzu.vmware.com"] { + for _, v := range helper.GetCRDParentsMap()["tenants.global.tsm.tanzu.vmware.com"] { objToCreate.Labels[v] = obj.Labels[v] } - objToCreate.Labels["gnses.gns.tsm.tanzu.vmware.com"] = obj.DisplayName() + objToCreate.Labels["tenants.global.tsm.tanzu.vmware.com"] = obj.DisplayName() if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) objToCreate.Name = hashedName } - result, err = obj.client.Gns().CreateIgnoreChildByName(ctx, objToCreate) - updatedObj, getErr := obj.client.Gns().GetGnsByName(ctx, obj.GetName()) + result, err = obj.client.Global().CreateAnnotationByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetTenantByName(ctx, obj.GetName()) if getErr == nil { - obj.Gns = updatedObj.Gns + obj.Tenant = updatedObj.Tenant } return } -// DeleteIgnoreChild calculates hashed name of the child to delete based on displayName +// DeleteAnnotations calculates hashed name of the child to delete based on displayName // and parents names and deletes it. -func (obj *GnsGns) DeleteIgnoreChild(ctx context.Context) (err error) { - if obj.Spec.IgnoreChildGvk != nil { - err = obj.client. - Gns().DeleteIgnoreChildByName(ctx, obj.Spec.IgnoreChildGvk.Name) - if err != nil { - return err - } - } - updatedObj, err := obj.client. - Gns().GetGnsByName(ctx, obj.GetName()) - if err == nil { - obj.Gns = updatedObj.Gns - } - return -} - -// GetFoo returns child of given type -func (obj *GnsGns) GetFoo(ctx context.Context) ( - result *GnsFoo, err error) { - if obj.Spec.FooGvk == nil { - return nil, NewChildNotFound(obj.DisplayName(), "Gns.Gns", "Foo") - } - return obj.client.Gns().GetFooByName(ctx, obj.Spec.FooGvk.Name) -} - -// AddFoo calculates hashed name of the child to create based on objToCreate.Name -// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in -// nexus/display_name label and can be obtained using DisplayName() method. -func (obj *GnsGns) AddFoo(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.Foo) (result *GnsFoo, err error) { - if objToCreate.Labels == nil { - objToCreate.Labels = map[string]string{} - } - for _, v := range helper.GetCRDParentsMap()["gnses.gns.tsm.tanzu.vmware.com"] { - objToCreate.Labels[v] = obj.Labels[v] - } - objToCreate.Labels["gnses.gns.tsm.tanzu.vmware.com"] = obj.DisplayName() - if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() - objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) - objToCreate.Name = hashedName - } - result, err = obj.client.Gns().CreateFooByName(ctx, objToCreate) - updatedObj, getErr := obj.client.Gns().GetGnsByName(ctx, obj.GetName()) - if getErr == nil { - obj.Gns = updatedObj.Gns +func (obj *GlobalTenant) DeleteAnnotations(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.AnnotationsGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.Tenant", "Annotations", displayName) } - return -} - -// DeleteFoo calculates hashed name of the child to delete based on displayName -// and parents names and deletes it. - -func (obj *GnsGns) DeleteFoo(ctx context.Context) (err error) { - if obj.Spec.FooGvk != nil { - err = obj.client. - Gns().DeleteFooByName(ctx, obj.Spec.FooGvk.Name) - if err != nil { - return err - } + err = obj.client.Global().DeleteAnnotationByName(ctx, l.Name) + if err != nil { + return err } - updatedObj, err := obj.client. - Gns().GetGnsByName(ctx, obj.GetName()) + updatedObj, err := obj.client.Global().GetTenantByName(ctx, obj.GetName()) if err == nil { - obj.Gns = updatedObj.Gns + obj.Tenant = updatedObj.Tenant } return } -// GetDns returns link of given type -func (obj *GnsGns) GetDns(ctx context.Context) ( - result *GnsDns, err error) { - if obj.Spec.DnsGvk == nil { - return nil, NewLinkNotFound(obj.DisplayName(), "Gns.Gns", "Dns") +// GetTemplate returns link of given type +func (obj *GlobalTenant) GetTemplate(ctx context.Context) ( + result *GlobalServiceTemplate, err error) { + if obj.Spec.TemplateGvk == nil { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.Tenant", "Template") } - return obj.client.Gns().GetDnsByName(ctx, obj.Spec.DnsGvk.Name) + return obj.client.Global().GetServiceTemplateByName(ctx, obj.Spec.TemplateGvk.Name) } -// LinkDns links obj with linkToAdd object. This function doesn't create linked object, it must be +// LinkTemplate links obj with linkToAdd object. This function doesn't create linked object, it must be // already created. -func (obj *GnsGns) LinkDns(ctx context.Context, - linkToAdd *GnsDns) error { +func (obj *GlobalTenant) LinkTemplate(ctx context.Context, + linkToAdd *GlobalServiceTemplate) error { var patch Patch patchOp := PatchOp{ Op: "replace", - Path: "/spec/dnsGvk", - Value: basegnstsmtanzuvmwarecomv1.Child{ - Group: "gns.tsm.tanzu.vmware.com", - Kind: "Dns", + Path: "/spec/templateGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "ServiceTemplate", Name: linkToAdd.Name, }, } @@ -3855,22 +87735,22 @@ func (obj *GnsGns) LinkDns(ctx context.Context, if err != nil { return err } - result, err := obj.client.baseClient.GnsTsmV1().Gnses().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + result, err := obj.client.baseClient.GlobalTsmV1().Tenants().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err } - obj.Gns = result + obj.Tenant = result return nil } -// UnlinkDns unlinks linkToRemove object from obj. This function doesn't delete linked object. -func (obj *GnsGns) UnlinkDns(ctx context.Context) (err error) { +// UnlinkTemplate unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalTenant) UnlinkTemplate(ctx context.Context) (err error) { var patch Patch patchOp := PatchOp{ Op: "remove", - Path: "/spec/dnsGvk", + Path: "/spec/templateGvk", } patch = append(patch, patchOp) @@ -3878,243 +87758,64 @@ func (obj *GnsGns) UnlinkDns(ctx context.Context) (err error) { if err != nil { return err } - result, err := obj.client.baseClient.GnsTsmV1().Gnses().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + result, err := obj.client.baseClient.GlobalTsmV1().Tenants().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err } - obj.Gns = result + obj.Tenant = result return nil } -type gnsGnsTsmV1Chainer struct { +type tenantGlobalTsmV1Chainer struct { client *Clientset name string parentLabels map[string]string } -func (c *gnsGnsTsmV1Chainer) Subscribe() { - key := "gnses.gns.tsm.tanzu.vmware.com" +func (c *tenantGlobalTsmV1Chainer) Subscribe() { + key := "tenants.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informergnstsmtanzuvmwarecomv1.NewGnsInformer(c.client.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewTenantInformer(c.client.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } } -func (c *gnsGnsTsmV1Chainer) Unsubscribe() { - key := "gnses.gns.tsm.tanzu.vmware.com" +func (c *tenantGlobalTsmV1Chainer) Unsubscribe() { + key := "tenants.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { close(s.(subscription).stop) subscriptionMap.Delete(key) } } -func (c *gnsGnsTsmV1Chainer) IsSubscribed() bool { - key := "gnses.gns.tsm.tanzu.vmware.com" +func (c *tenantGlobalTsmV1Chainer) IsSubscribed() bool { + key := "tenants.global.tsm.tanzu.vmware.com" _, ok := subscriptionMap.Load(key) return ok } -// ClearState to clear user defined status -func (c *gnsGnsTsmV1Chainer) ClearState(ctx context.Context) (err error) { - hashedName := helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Gns().GetGnsByName(ctx, hashedName) - if err != nil { - return err - } - _, err = c.client.Gns().SetGnsStateByName(ctx, obj.Gns, nil) - return err -} - -// GetState to get user defined status -func (c *gnsGnsTsmV1Chainer) GetState(ctx context.Context) (result *basegnstsmtanzuvmwarecomv1.GnsState, err error) { - hashedName := helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Gns().GetGnsByName(ctx, hashedName) - if err != nil { - return nil, err - } - return &obj.Status.State, nil -} - -// SetState sets user defined status -func (c *gnsGnsTsmV1Chainer) SetState(ctx context.Context, status *basegnstsmtanzuvmwarecomv1.GnsState) (err error) { - hashedName := helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Gns().GetGnsByName(ctx, hashedName) - if err != nil { - return err - } - _, err = c.client.Gns().SetGnsStateByName(ctx, obj.Gns, status) - return err -} - -func (c *gnsGnsTsmV1Chainer) GnsServiceGroups(name string) *svcgroupServicegroupTsmV1Chainer { - parentLabels := c.parentLabels - parentLabels["svcgroups.servicegroup.tsm.tanzu.vmware.com"] = name - return &svcgroupServicegroupTsmV1Chainer{ - client: c.client, - name: name, - parentLabels: parentLabels, - } -} - -// GetGnsServiceGroups calculates hashed name of the object based on displayName and it's parents and returns the object -func (c *gnsGnsTsmV1Chainer) GetGnsServiceGroups(ctx context.Context, displayName string) (result *ServicegroupSvcGroup, err error) { - hashedName := helper.GetHashedName("svcgroups.servicegroup.tsm.tanzu.vmware.com", c.parentLabels, displayName) - return c.client.Servicegroup().GetSvcGroupByName(ctx, hashedName) -} - -// AddGnsServiceGroups calculates hashed name of the child to create based on objToCreate.Name -// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in -// nexus/display_name label and can be obtained using DisplayName() method. -func (c *gnsGnsTsmV1Chainer) AddGnsServiceGroups(ctx context.Context, - objToCreate *baseservicegrouptsmtanzuvmwarecomv1.SvcGroup) (result *ServicegroupSvcGroup, err error) { - if objToCreate.Labels == nil { - objToCreate.Labels = map[string]string{} - } - for k, v := range c.parentLabels { - objToCreate.Labels[k] = v - } - if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() - objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("svcgroups.servicegroup.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) - objToCreate.Name = hashedName - } - return c.client.Servicegroup().CreateSvcGroupByName(ctx, objToCreate) -} - -// DeleteGnsServiceGroups calculates hashed name of the child to delete based on displayName -// and parents names and deletes it. -func (c *gnsGnsTsmV1Chainer) DeleteGnsServiceGroups(ctx context.Context, name string) (err error) { - if c.parentLabels == nil { - c.parentLabels = map[string]string{} - } - c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("svcgroups.servicegroup.tsm.tanzu.vmware.com", c.parentLabels, name) - return c.client.Servicegroup().DeleteSvcGroupByName(ctx, hashedName) -} - -func (c *gnsGnsTsmV1Chainer) GnsAccessControlPolicy(name string) *accesscontrolpolicyPolicypkgTsmV1Chainer { - parentLabels := c.parentLabels - parentLabels["accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com"] = name - return &accesscontrolpolicyPolicypkgTsmV1Chainer{ - client: c.client, - name: name, - parentLabels: parentLabels, - } -} - -// GetGnsAccessControlPolicy calculates hashed name of the object based on displayName and it's parents and returns the object -func (c *gnsGnsTsmV1Chainer) GetGnsAccessControlPolicy(ctx context.Context, displayName string) (result *PolicypkgAccessControlPolicy, err error) { - hashedName := helper.GetHashedName("accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com", c.parentLabels, displayName) - return c.client.Policypkg().GetAccessControlPolicyByName(ctx, hashedName) -} - -// AddGnsAccessControlPolicy calculates hashed name of the child to create based on objToCreate.Name -// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in -// nexus/display_name label and can be obtained using DisplayName() method. -func (c *gnsGnsTsmV1Chainer) AddGnsAccessControlPolicy(ctx context.Context, - objToCreate *basepolicypkgtsmtanzuvmwarecomv1.AccessControlPolicy) (result *PolicypkgAccessControlPolicy, err error) { - if objToCreate.Labels == nil { - objToCreate.Labels = map[string]string{} - } - for k, v := range c.parentLabels { - objToCreate.Labels[k] = v - } - if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() - objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) - objToCreate.Name = hashedName - } - return c.client.Policypkg().CreateAccessControlPolicyByName(ctx, objToCreate) -} - -// DeleteGnsAccessControlPolicy calculates hashed name of the child to delete based on displayName -// and parents names and deletes it. -func (c *gnsGnsTsmV1Chainer) DeleteGnsAccessControlPolicy(ctx context.Context, name string) (err error) { - if c.parentLabels == nil { - c.parentLabels = map[string]string{} - } - c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com", c.parentLabels, name) - return c.client.Policypkg().DeleteAccessControlPolicyByName(ctx, hashedName) -} - -func (c *gnsGnsTsmV1Chainer) FooChild() *barchildGnsTsmV1Chainer { - parentLabels := c.parentLabels - parentLabels["barchilds.gns.tsm.tanzu.vmware.com"] = helper.DEFAULT_KEY - return &barchildGnsTsmV1Chainer{ - client: c.client, - name: helper.DEFAULT_KEY, - parentLabels: parentLabels, - } -} - -// GetFooChild calculates hashed name of the object based on it's parents and returns the object -func (c *gnsGnsTsmV1Chainer) GetFooChild(ctx context.Context) (result *GnsBarChild, err error) { - hashedName := helper.GetHashedName("barchilds.gns.tsm.tanzu.vmware.com", c.parentLabels, helper.DEFAULT_KEY) - return c.client.Gns().GetBarChildByName(ctx, hashedName) -} - -// AddFooChild calculates hashed name of the child to create based on parents names and creates it. -// objToCreate.Name is changed to the hashed name. Original name ('default') is preserved in -// nexus/display_name label and can be obtained using DisplayName() method. -func (c *gnsGnsTsmV1Chainer) AddFooChild(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.BarChild) (result *GnsBarChild, err error) { - if objToCreate.GetName() == "" { - objToCreate.SetName(helper.DEFAULT_KEY) - } - if objToCreate.GetName() != helper.DEFAULT_KEY { - return nil, NewSingletonNameError(objToCreate.GetName()) - } - if objToCreate.Labels == nil { - objToCreate.Labels = map[string]string{} - } - for k, v := range c.parentLabels { - objToCreate.Labels[k] = v - } - if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() - objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("barchilds.gns.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) - objToCreate.Name = hashedName - } - return c.client.Gns().CreateBarChildByName(ctx, objToCreate) -} - -// DeleteFooChild calculates hashed name of the child to delete based on displayName -// and parents names and deletes it. -func (c *gnsGnsTsmV1Chainer) DeleteFooChild(ctx context.Context, name string) (err error) { - if c.parentLabels == nil { - c.parentLabels = map[string]string{} - } - c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("barchilds.gns.tsm.tanzu.vmware.com", c.parentLabels, name) - return c.client.Gns().DeleteBarChildByName(ctx, hashedName) -} - -func (c *gnsGnsTsmV1Chainer) IgnoreChild(name string) *ignorechildGnsTsmV1Chainer { +func (c *tenantGlobalTsmV1Chainer) Resources(name string) *tenantresourceGlobalTsmV1Chainer { parentLabels := c.parentLabels - parentLabels["ignorechilds.gns.tsm.tanzu.vmware.com"] = name - return &ignorechildGnsTsmV1Chainer{ + parentLabels["tenantresources.global.tsm.tanzu.vmware.com"] = name + return &tenantresourceGlobalTsmV1Chainer{ client: c.client, name: name, parentLabels: parentLabels, } } -// GetIgnoreChild calculates hashed name of the object based on displayName and it's parents and returns the object -func (c *gnsGnsTsmV1Chainer) GetIgnoreChild(ctx context.Context, displayName string) (result *GnsIgnoreChild, err error) { - hashedName := helper.GetHashedName("ignorechilds.gns.tsm.tanzu.vmware.com", c.parentLabels, displayName) - return c.client.Gns().GetIgnoreChildByName(ctx, hashedName) +// GetResources calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *tenantGlobalTsmV1Chainer) GetResources(ctx context.Context, displayName string) (result *GlobalTenantResource, err error) { + hashedName := helper.GetHashedName("tenantresources.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetTenantResourceByName(ctx, hashedName) } -// AddIgnoreChild calculates hashed name of the child to create based on objToCreate.Name +// AddResources calculates hashed name of the child to create based on objToCreate.Name // and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in // nexus/display_name label and can be obtained using DisplayName() method. -func (c *gnsGnsTsmV1Chainer) AddIgnoreChild(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.IgnoreChild) (result *GnsIgnoreChild, err error) { +func (c *tenantGlobalTsmV1Chainer) AddResources(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.TenantResource) (result *GlobalTenantResource, err error) { if objToCreate.Labels == nil { objToCreate.Labels = map[string]string{} } @@ -4124,44 +87825,44 @@ func (c *gnsGnsTsmV1Chainer) AddIgnoreChild(ctx context.Context, if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("ignorechilds.gns.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + hashedName := helper.GetHashedName("tenantresources.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) objToCreate.Name = hashedName } - return c.client.Gns().CreateIgnoreChildByName(ctx, objToCreate) + return c.client.Global().CreateTenantResourceByName(ctx, objToCreate) } -// DeleteIgnoreChild calculates hashed name of the child to delete based on displayName +// DeleteResources calculates hashed name of the child to delete based on displayName // and parents names and deletes it. -func (c *gnsGnsTsmV1Chainer) DeleteIgnoreChild(ctx context.Context, name string) (err error) { +func (c *tenantGlobalTsmV1Chainer) DeleteResources(ctx context.Context, name string) (err error) { if c.parentLabels == nil { c.parentLabels = map[string]string{} } c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("ignorechilds.gns.tsm.tanzu.vmware.com", c.parentLabels, name) - return c.client.Gns().DeleteIgnoreChildByName(ctx, hashedName) + hashedName := helper.GetHashedName("tenantresources.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteTenantResourceByName(ctx, hashedName) } -func (c *gnsGnsTsmV1Chainer) Foo(name string) *fooGnsTsmV1Chainer { +func (c *tenantGlobalTsmV1Chainer) Annotations(name string) *annotationGlobalTsmV1Chainer { parentLabels := c.parentLabels - parentLabels["foos.gns.tsm.tanzu.vmware.com"] = name - return &fooGnsTsmV1Chainer{ + parentLabels["annotations.global.tsm.tanzu.vmware.com"] = name + return &annotationGlobalTsmV1Chainer{ client: c.client, name: name, parentLabels: parentLabels, } } -// GetFoo calculates hashed name of the object based on displayName and it's parents and returns the object -func (c *gnsGnsTsmV1Chainer) GetFoo(ctx context.Context, displayName string) (result *GnsFoo, err error) { - hashedName := helper.GetHashedName("foos.gns.tsm.tanzu.vmware.com", c.parentLabels, displayName) - return c.client.Gns().GetFooByName(ctx, hashedName) +// GetAnnotations calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *tenantGlobalTsmV1Chainer) GetAnnotations(ctx context.Context, displayName string) (result *GlobalAnnotation, err error) { + hashedName := helper.GetHashedName("annotations.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAnnotationByName(ctx, hashedName) } -// AddFoo calculates hashed name of the child to create based on objToCreate.Name +// AddAnnotations calculates hashed name of the child to create based on objToCreate.Name // and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in // nexus/display_name label and can be obtained using DisplayName() method. -func (c *gnsGnsTsmV1Chainer) AddFoo(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.Foo) (result *GnsFoo, err error) { +func (c *tenantGlobalTsmV1Chainer) AddAnnotations(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.Annotation) (result *GlobalAnnotation, err error) { if objToCreate.Labels == nil { objToCreate.Labels = map[string]string{} } @@ -4171,67 +87872,67 @@ func (c *gnsGnsTsmV1Chainer) AddFoo(ctx context.Context, if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("foos.gns.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + hashedName := helper.GetHashedName("annotations.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) objToCreate.Name = hashedName } - return c.client.Gns().CreateFooByName(ctx, objToCreate) + return c.client.Global().CreateAnnotationByName(ctx, objToCreate) } -// DeleteFoo calculates hashed name of the child to delete based on displayName +// DeleteAnnotations calculates hashed name of the child to delete based on displayName // and parents names and deletes it. -func (c *gnsGnsTsmV1Chainer) DeleteFoo(ctx context.Context, name string) (err error) { +func (c *tenantGlobalTsmV1Chainer) DeleteAnnotations(ctx context.Context, name string) (err error) { if c.parentLabels == nil { c.parentLabels = map[string]string{} } c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("foos.gns.tsm.tanzu.vmware.com", c.parentLabels, name) - return c.client.Gns().DeleteFooByName(ctx, hashedName) + hashedName := helper.GetHashedName("annotations.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAnnotationByName(ctx, hashedName) } -// GetBarChildByName returns object stored in the database under the hashedName which is a hash of display +// GetUserDiscoveryRTByName returns object stored in the database under the hashedName which is a hash of display // name and parents names. Use it when you know hashed name of object. -func (group *GnsTsmV1) GetBarChildByName(ctx context.Context, hashedName string) (*GnsBarChild, error) { - key := "barchilds.gns.tsm.tanzu.vmware.com" +func (group *GlobalTsmV1) GetUserDiscoveryRTByName(ctx context.Context, hashedName string) (*GlobalUserDiscoveryRT, error) { + key := "userdiscoveryrts.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) if !exists { return nil, err } - result, _ := item.(*basegnstsmtanzuvmwarecomv1.BarChild) - return &GnsBarChild{ - client: group.client, - BarChild: result, + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.UserDiscoveryRT) + return &GlobalUserDiscoveryRT{ + client: group.client, + UserDiscoveryRT: result, }, nil } else { result, err := group.client.baseClient. - GnsTsmV1(). - BarChilds().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + UserDiscoveryRTs().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return nil, err } - return &GnsBarChild{ - client: group.client, - BarChild: result, + return &GlobalUserDiscoveryRT{ + client: group.client, + UserDiscoveryRT: result, }, nil } } -// DeleteBarChildByName deletes object stored in the database under the hashedName which is a hash of +// DeleteUserDiscoveryRTByName deletes object stored in the database under the hashedName which is a hash of // display name and parents names. Use it when you know hashed name of object. -func (group *GnsTsmV1) DeleteBarChildByName(ctx context.Context, hashedName string) (err error) { +func (group *GlobalTsmV1) DeleteUserDiscoveryRTByName(ctx context.Context, hashedName string) (err error) { result, err := group.client.baseClient. - GnsTsmV1(). - BarChilds().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + UserDiscoveryRTs().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return err } err = group.client.baseClient. - GnsTsmV1(). - BarChilds().Delete(ctx, hashedName, metav1.DeleteOptions{}) + GlobalTsmV1(). + UserDiscoveryRTs().Delete(ctx, hashedName, metav1.DeleteOptions{}) if err != nil { return err } @@ -4240,7 +87941,7 @@ func (group *GnsTsmV1) DeleteBarChildByName(ctx context.Context, hashedName stri patchOp := PatchOp{ Op: "remove", - Path: "/spec/fooChildGvk", + Path: "/spec/userDiscoveryGvk/" + result.DisplayName(), } patch = append(patch, patchOp) @@ -4252,16 +87953,16 @@ func (group *GnsTsmV1) DeleteBarChildByName(ctx context.Context, hashedName stri if parents == nil { parents = make(map[string]string) } - parentName, ok := parents["gnses.gns.tsm.tanzu.vmware.com"] + parentName, ok := parents["domainconfigs.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if parents[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", parents, parentName) + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", parents, parentName) } _, err = group.client.baseClient. - GnsTsmV1(). - Gnses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err } @@ -4269,78 +87970,56 @@ func (group *GnsTsmV1) DeleteBarChildByName(ctx context.Context, hashedName stri return } -// CreateBarChildByName creates object in the database without hashing the name. +// CreateUserDiscoveryRTByName creates object in the database without hashing the name. // Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *GnsTsmV1) CreateBarChildByName(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.BarChild) (*GnsBarChild, error) { +func (group *GlobalTsmV1) CreateUserDiscoveryRTByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.UserDiscoveryRT) (*GlobalUserDiscoveryRT, error) { if objToCreate.GetLabels() == nil { objToCreate.Labels = make(map[string]string) } if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() } - if objToCreate.Labels[common.DISPLAY_NAME_LABEL] == "" { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = helper.DEFAULT_KEY - } - if objToCreate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { - return nil, NewSingletonNameError(objToCreate.Labels[common.DISPLAY_NAME_LABEL]) - } result, err := group.client.baseClient. - GnsTsmV1(). - BarChilds().Create(ctx, objToCreate, metav1.CreateOptions{}) + GlobalTsmV1(). + UserDiscoveryRTs().Create(ctx, objToCreate, metav1.CreateOptions{}) if err != nil { return nil, err } - parentName, ok := objToCreate.GetLabels()["gnses.gns.tsm.tanzu.vmware.com"] + parentName, ok := objToCreate.GetLabels()["domainconfigs.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + parentName = helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) } - var patch Patch - patchOp := PatchOp{ - Op: "replace", - Path: "/spec/fooChildGvk", - Value: basegnstsmtanzuvmwarecomv1.Child{ - Group: "gns.tsm.tanzu.vmware.com", - Kind: "BarChild", - Name: objToCreate.Name, - }, - } - patch = append(patch, patchOp) - marshaled, err := patch.Marshal() - if err != nil { - return nil, err - } + payload := "{\"spec\": {\"userDiscoveryGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"UserDiscoveryRT\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" _, err = group.client.baseClient. - GnsTsmV1(). - Gnses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + DomainConfigs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) if err != nil { return nil, err } - return &GnsBarChild{ - client: group.client, - BarChild: result, + return &GlobalUserDiscoveryRT{ + client: group.client, + UserDiscoveryRT: result, }, nil } -// UpdateBarChildByName updates object stored in the database under the hashedName which is a hash of +// UpdateUserDiscoveryRTByName updates object stored in the database under the hashedName which is a hash of // display name and parents names. -func (group *GnsTsmV1) UpdateBarChildByName(ctx context.Context, - objToUpdate *basegnstsmtanzuvmwarecomv1.BarChild) (*GnsBarChild, error) { - if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { - return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) - } +func (group *GlobalTsmV1) UpdateUserDiscoveryRTByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.UserDiscoveryRT) (*GlobalUserDiscoveryRT, error) { + // ResourceVersion must be set for update if objToUpdate.ResourceVersion == "" { current, err := group.client.baseClient. - GnsTsmV1(). - BarChilds().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + GlobalTsmV1(). + UserDiscoveryRTs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) if err != nil { return nil, err } @@ -4354,166 +88033,184 @@ func (group *GnsTsmV1) UpdateBarChildByName(ctx context.Context, Value: objToUpdate.ObjectMeta, }) - patchValueName := - objToUpdate.Spec.Name - patchOpName := PatchOp{ + patchValueGnsid := + objToUpdate.Spec.Gnsid + patchOpGnsid := PatchOp{ Op: "replace", - Path: "/spec/name", - Value: patchValueName, + Path: "/spec/gnsid", + Value: patchValueGnsid, } - patch = append(patch, patchOpName) + patch = append(patch, patchOpGnsid) + + patchValueSelectors := + objToUpdate.Spec.Selectors + patchOpSelectors := PatchOp{ + Op: "replace", + Path: "/spec/selectors", + Value: patchValueSelectors, + } + patch = append(patch, patchOpSelectors) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) marshaled, err := patch.Marshal() if err != nil { return nil, err } result, err := group.client.baseClient. - GnsTsmV1(). - BarChilds().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + GlobalTsmV1(). + UserDiscoveryRTs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") if err != nil { return nil, err } - return &GnsBarChild{ - client: group.client, - BarChild: result, + return &GlobalUserDiscoveryRT{ + client: group.client, + UserDiscoveryRT: result, }, nil } -// ListBarChilds returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *GnsTsmV1) ListBarChilds(ctx context.Context, - opts metav1.ListOptions) (result []*GnsBarChild, err error) { - key := "barchilds.gns.tsm.tanzu.vmware.com" +// ListUserDiscoveryRTs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListUserDiscoveryRTs(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalUserDiscoveryRT, err error) { + key := "userdiscoveryrts.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { items := s.(subscription).informer.GetStore().List() - result = make([]*GnsBarChild, len(items)) + result = make([]*GlobalUserDiscoveryRT, len(items)) for k, v := range items { - item, _ := v.(*basegnstsmtanzuvmwarecomv1.BarChild) - result[k] = &GnsBarChild{ - client: group.client, - BarChild: item, + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.UserDiscoveryRT) + result[k] = &GlobalUserDiscoveryRT{ + client: group.client, + UserDiscoveryRT: item, } } } else { - list, err := group.client.baseClient.GnsTsmV1(). - BarChilds().List(ctx, opts) + list, err := group.client.baseClient.GlobalTsmV1(). + UserDiscoveryRTs().List(ctx, opts) if err != nil { return nil, err } - result = make([]*GnsBarChild, len(list.Items)) + result = make([]*GlobalUserDiscoveryRT, len(list.Items)) for k, v := range list.Items { item := v - result[k] = &GnsBarChild{ - client: group.client, - BarChild: &item, + result[k] = &GlobalUserDiscoveryRT{ + client: group.client, + UserDiscoveryRT: &item, } } } return } -type GnsBarChild struct { +type GlobalUserDiscoveryRT struct { client *Clientset - *basegnstsmtanzuvmwarecomv1.BarChild + *baseglobaltsmtanzuvmwarecomv1.UserDiscoveryRT } // Delete removes obj and all it's children from the database. -func (obj *GnsBarChild) Delete(ctx context.Context) error { - err := obj.client.Gns().DeleteBarChildByName(ctx, obj.GetName()) +func (obj *GlobalUserDiscoveryRT) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteUserDiscoveryRTByName(ctx, obj.GetName()) if err != nil { return err } - obj.BarChild = nil + obj.UserDiscoveryRT = nil return nil } // Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *GnsBarChild) Update(ctx context.Context) error { - result, err := obj.client.Gns().UpdateBarChildByName(ctx, obj.BarChild) +func (obj *GlobalUserDiscoveryRT) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateUserDiscoveryRTByName(ctx, obj.UserDiscoveryRT) if err != nil { return err } - obj.BarChild = result.BarChild + obj.UserDiscoveryRT = result.UserDiscoveryRT return nil } -func (obj *GnsBarChild) GetParent(ctx context.Context) (result *GnsGns, err error) { - hashedName := helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnses.gns.tsm.tanzu.vmware.com"]) - return obj.client.Gns().GetGnsByName(ctx, hashedName) +func (obj *GlobalUserDiscoveryRT) GetParent(ctx context.Context) (result *GlobalDomainConfig, err error) { + hashedName := helper.GetHashedName("domainconfigs.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domainconfigs.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainConfigByName(ctx, hashedName) } -type barchildGnsTsmV1Chainer struct { +type userdiscoveryrtGlobalTsmV1Chainer struct { client *Clientset name string parentLabels map[string]string } -func (c *barchildGnsTsmV1Chainer) Subscribe() { - key := "barchilds.gns.tsm.tanzu.vmware.com" +func (c *userdiscoveryrtGlobalTsmV1Chainer) Subscribe() { + key := "userdiscoveryrts.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informergnstsmtanzuvmwarecomv1.NewBarChildInformer(c.client.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewUserDiscoveryRTInformer(c.client.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } } -func (c *barchildGnsTsmV1Chainer) Unsubscribe() { - key := "barchilds.gns.tsm.tanzu.vmware.com" +func (c *userdiscoveryrtGlobalTsmV1Chainer) Unsubscribe() { + key := "userdiscoveryrts.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { close(s.(subscription).stop) subscriptionMap.Delete(key) } } -func (c *barchildGnsTsmV1Chainer) IsSubscribed() bool { - key := "barchilds.gns.tsm.tanzu.vmware.com" +func (c *userdiscoveryrtGlobalTsmV1Chainer) IsSubscribed() bool { + key := "userdiscoveryrts.global.tsm.tanzu.vmware.com" _, ok := subscriptionMap.Load(key) return ok } -// GetIgnoreChildByName returns object stored in the database under the hashedName which is a hash of display +// GetUserDiscoveryByName returns object stored in the database under the hashedName which is a hash of display // name and parents names. Use it when you know hashed name of object. -func (group *GnsTsmV1) GetIgnoreChildByName(ctx context.Context, hashedName string) (*GnsIgnoreChild, error) { - key := "ignorechilds.gns.tsm.tanzu.vmware.com" +func (group *GlobalTsmV1) GetUserDiscoveryByName(ctx context.Context, hashedName string) (*GlobalUserDiscovery, error) { + key := "userdiscoveries.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) if !exists { return nil, err } - result, _ := item.(*basegnstsmtanzuvmwarecomv1.IgnoreChild) - return &GnsIgnoreChild{ - client: group.client, - IgnoreChild: result, + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.UserDiscovery) + return &GlobalUserDiscovery{ + client: group.client, + UserDiscovery: result, }, nil } else { result, err := group.client.baseClient. - GnsTsmV1(). - IgnoreChilds().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + UserDiscoveries().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return nil, err } - return &GnsIgnoreChild{ - client: group.client, - IgnoreChild: result, + return &GlobalUserDiscovery{ + client: group.client, + UserDiscovery: result, }, nil } } -// DeleteIgnoreChildByName deletes object stored in the database under the hashedName which is a hash of +// DeleteUserDiscoveryByName deletes object stored in the database under the hashedName which is a hash of // display name and parents names. Use it when you know hashed name of object. -func (group *GnsTsmV1) DeleteIgnoreChildByName(ctx context.Context, hashedName string) (err error) { +func (group *GlobalTsmV1) DeleteUserDiscoveryByName(ctx context.Context, hashedName string) (err error) { result, err := group.client.baseClient. - GnsTsmV1(). - IgnoreChilds().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + UserDiscoveries().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return err } err = group.client.baseClient. - GnsTsmV1(). - IgnoreChilds().Delete(ctx, hashedName, metav1.DeleteOptions{}) + GlobalTsmV1(). + UserDiscoveries().Delete(ctx, hashedName, metav1.DeleteOptions{}) if err != nil { return err } @@ -4522,7 +88219,7 @@ func (group *GnsTsmV1) DeleteIgnoreChildByName(ctx context.Context, hashedName s patchOp := PatchOp{ Op: "remove", - Path: "/spec/ignoreChildGvk", + Path: "/spec/userDiscoveryGvk/" + result.DisplayName(), } patch = append(patch, patchOp) @@ -4534,16 +88231,16 @@ func (group *GnsTsmV1) DeleteIgnoreChildByName(ctx context.Context, hashedName s if parents == nil { parents = make(map[string]string) } - parentName, ok := parents["gnses.gns.tsm.tanzu.vmware.com"] + parentName, ok := parents["gnss.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if parents[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", parents, parentName) + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", parents, parentName) } _, err = group.client.baseClient. - GnsTsmV1(). - Gnses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err } @@ -4551,10 +88248,10 @@ func (group *GnsTsmV1) DeleteIgnoreChildByName(ctx context.Context, hashedName s return } -// CreateIgnoreChildByName creates object in the database without hashing the name. +// CreateUserDiscoveryByName creates object in the database without hashing the name. // Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *GnsTsmV1) CreateIgnoreChildByName(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.IgnoreChild) (*GnsIgnoreChild, error) { +func (group *GlobalTsmV1) CreateUserDiscoveryByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.UserDiscovery) (*GlobalUserDiscovery, error) { if objToCreate.GetLabels() == nil { objToCreate.Labels = make(map[string]string) } @@ -4563,58 +88260,44 @@ func (group *GnsTsmV1) CreateIgnoreChildByName(ctx context.Context, } result, err := group.client.baseClient. - GnsTsmV1(). - IgnoreChilds().Create(ctx, objToCreate, metav1.CreateOptions{}) + GlobalTsmV1(). + UserDiscoveries().Create(ctx, objToCreate, metav1.CreateOptions{}) if err != nil { return nil, err } - parentName, ok := objToCreate.GetLabels()["gnses.gns.tsm.tanzu.vmware.com"] + parentName, ok := objToCreate.GetLabels()["gnss.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + parentName = helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) } - var patch Patch - patchOp := PatchOp{ - Op: "replace", - Path: "/spec/ignoreChildGvk", - Value: basegnstsmtanzuvmwarecomv1.Child{ - Group: "gns.tsm.tanzu.vmware.com", - Kind: "IgnoreChild", - Name: objToCreate.Name, - }, - } - patch = append(patch, patchOp) - marshaled, err := patch.Marshal() - if err != nil { - return nil, err - } + payload := "{\"spec\": {\"userDiscoveryGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"UserDiscovery\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" _, err = group.client.baseClient. - GnsTsmV1(). - Gnses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + GNSs().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) if err != nil { return nil, err } - return &GnsIgnoreChild{ - client: group.client, - IgnoreChild: result, + return &GlobalUserDiscovery{ + client: group.client, + UserDiscovery: result, }, nil } -// UpdateIgnoreChildByName updates object stored in the database under the hashedName which is a hash of +// UpdateUserDiscoveryByName updates object stored in the database under the hashedName which is a hash of // display name and parents names. -func (group *GnsTsmV1) UpdateIgnoreChildByName(ctx context.Context, - objToUpdate *basegnstsmtanzuvmwarecomv1.IgnoreChild) (*GnsIgnoreChild, error) { +func (group *GlobalTsmV1) UpdateUserDiscoveryByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.UserDiscovery) (*GlobalUserDiscovery, error) { // ResourceVersion must be set for update if objToUpdate.ResourceVersion == "" { current, err := group.client.baseClient. - GnsTsmV1(). - IgnoreChilds().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + GlobalTsmV1(). + UserDiscoveries().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) if err != nil { return nil, err } @@ -4628,166 +88311,208 @@ func (group *GnsTsmV1) UpdateIgnoreChildByName(ctx context.Context, Value: objToUpdate.ObjectMeta, }) - patchValueName := - objToUpdate.Spec.Name - patchOpName := PatchOp{ + patchValueDescription := + objToUpdate.Spec.Description + patchOpDescription := PatchOp{ Op: "replace", - Path: "/spec/name", - Value: patchValueName, + Path: "/spec/description", + Value: patchValueDescription, } - patch = append(patch, patchOpName) + patch = append(patch, patchOpDescription) + + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueSpec := + objToUpdate.Spec.Spec + patchOpSpec := PatchOp{ + Op: "replace", + Path: "/spec/spec", + Value: patchValueSpec, + } + patch = append(patch, patchOpSpec) marshaled, err := patch.Marshal() if err != nil { return nil, err } result, err := group.client.baseClient. - GnsTsmV1(). - IgnoreChilds().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + GlobalTsmV1(). + UserDiscoveries().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") if err != nil { return nil, err } - return &GnsIgnoreChild{ - client: group.client, - IgnoreChild: result, + return &GlobalUserDiscovery{ + client: group.client, + UserDiscovery: result, }, nil } -// ListIgnoreChilds returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *GnsTsmV1) ListIgnoreChilds(ctx context.Context, - opts metav1.ListOptions) (result []*GnsIgnoreChild, err error) { - key := "ignorechilds.gns.tsm.tanzu.vmware.com" +// ListUserDiscoveries returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListUserDiscoveries(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalUserDiscovery, err error) { + key := "userdiscoveries.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { items := s.(subscription).informer.GetStore().List() - result = make([]*GnsIgnoreChild, len(items)) + result = make([]*GlobalUserDiscovery, len(items)) for k, v := range items { - item, _ := v.(*basegnstsmtanzuvmwarecomv1.IgnoreChild) - result[k] = &GnsIgnoreChild{ - client: group.client, - IgnoreChild: item, + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.UserDiscovery) + result[k] = &GlobalUserDiscovery{ + client: group.client, + UserDiscovery: item, } } } else { - list, err := group.client.baseClient.GnsTsmV1(). - IgnoreChilds().List(ctx, opts) + list, err := group.client.baseClient.GlobalTsmV1(). + UserDiscoveries().List(ctx, opts) if err != nil { return nil, err } - result = make([]*GnsIgnoreChild, len(list.Items)) + result = make([]*GlobalUserDiscovery, len(list.Items)) for k, v := range list.Items { item := v - result[k] = &GnsIgnoreChild{ - client: group.client, - IgnoreChild: &item, + result[k] = &GlobalUserDiscovery{ + client: group.client, + UserDiscovery: &item, } } } return } -type GnsIgnoreChild struct { +type GlobalUserDiscovery struct { client *Clientset - *basegnstsmtanzuvmwarecomv1.IgnoreChild + *baseglobaltsmtanzuvmwarecomv1.UserDiscovery } // Delete removes obj and all it's children from the database. -func (obj *GnsIgnoreChild) Delete(ctx context.Context) error { - err := obj.client.Gns().DeleteIgnoreChildByName(ctx, obj.GetName()) +func (obj *GlobalUserDiscovery) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteUserDiscoveryByName(ctx, obj.GetName()) if err != nil { return err } - obj.IgnoreChild = nil + obj.UserDiscovery = nil return nil } // Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *GnsIgnoreChild) Update(ctx context.Context) error { - result, err := obj.client.Gns().UpdateIgnoreChildByName(ctx, obj.IgnoreChild) +func (obj *GlobalUserDiscovery) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateUserDiscoveryByName(ctx, obj.UserDiscovery) if err != nil { return err } - obj.IgnoreChild = result.IgnoreChild + obj.UserDiscovery = result.UserDiscovery return nil } -func (obj *GnsIgnoreChild) GetParent(ctx context.Context) (result *GnsGns, err error) { - hashedName := helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnses.gns.tsm.tanzu.vmware.com"]) - return obj.client.Gns().GetGnsByName(ctx, hashedName) +func (obj *GlobalUserDiscovery) GetParent(ctx context.Context) (result *GlobalGNS, err error) { + hashedName := helper.GetHashedName("gnss.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnss.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetGNSByName(ctx, hashedName) } -type ignorechildGnsTsmV1Chainer struct { +type userdiscoveryGlobalTsmV1Chainer struct { client *Clientset name string parentLabels map[string]string } -func (c *ignorechildGnsTsmV1Chainer) Subscribe() { - key := "ignorechilds.gns.tsm.tanzu.vmware.com" +func (c *userdiscoveryGlobalTsmV1Chainer) Subscribe() { + key := "userdiscoveries.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informergnstsmtanzuvmwarecomv1.NewIgnoreChildInformer(c.client.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewUserDiscoveryInformer(c.client.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } } -func (c *ignorechildGnsTsmV1Chainer) Unsubscribe() { - key := "ignorechilds.gns.tsm.tanzu.vmware.com" +func (c *userdiscoveryGlobalTsmV1Chainer) Unsubscribe() { + key := "userdiscoveries.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { close(s.(subscription).stop) subscriptionMap.Delete(key) } } -func (c *ignorechildGnsTsmV1Chainer) IsSubscribed() bool { - key := "ignorechilds.gns.tsm.tanzu.vmware.com" +func (c *userdiscoveryGlobalTsmV1Chainer) IsSubscribed() bool { + key := "userdiscoveries.global.tsm.tanzu.vmware.com" _, ok := subscriptionMap.Load(key) return ok } -// GetDnsByName returns object stored in the database under the hashedName which is a hash of display +// GetUserFolderByName returns object stored in the database under the hashedName which is a hash of display // name and parents names. Use it when you know hashed name of object. -func (group *GnsTsmV1) GetDnsByName(ctx context.Context, hashedName string) (*GnsDns, error) { - key := "dnses.gns.tsm.tanzu.vmware.com" +func (group *GlobalTsmV1) GetUserFolderByName(ctx context.Context, hashedName string) (*GlobalUserFolder, error) { + key := "userfolders.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) if !exists { return nil, err } - result, _ := item.(*basegnstsmtanzuvmwarecomv1.Dns) - return &GnsDns{ - client: group.client, - Dns: result, + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.UserFolder) + return &GlobalUserFolder{ + client: group.client, + UserFolder: result, }, nil } else { result, err := group.client.baseClient. - GnsTsmV1(). - Dnses().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + UserFolders().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return nil, err } - return &GnsDns{ - client: group.client, - Dns: result, + return &GlobalUserFolder{ + client: group.client, + UserFolder: result, }, nil } } -// DeleteDnsByName deletes object stored in the database under the hashedName which is a hash of +// DeleteUserFolderByName deletes object stored in the database under the hashedName which is a hash of // display name and parents names. Use it when you know hashed name of object. -func (group *GnsTsmV1) DeleteDnsByName(ctx context.Context, hashedName string) (err error) { +func (group *GlobalTsmV1) DeleteUserFolderByName(ctx context.Context, hashedName string) (err error) { result, err := group.client.baseClient. - GnsTsmV1(). - Dnses().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + UserFolders().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return err } + for _, v := range result.Spec.UsersGvk { + err := group.client. + Global().DeleteUserByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.AppUsersGvk { + err := group.client. + Global().DeleteAppUserByName(ctx, v.Name) + if err != nil { + return err + } + } + + for _, v := range result.Spec.AccessTokenGvk { + err := group.client. + Global().DeleteAccessTokenByName(ctx, v.Name) + if err != nil { + return err + } + } + err = group.client.baseClient. - GnsTsmV1(). - Dnses().Delete(ctx, hashedName, metav1.DeleteOptions{}) + GlobalTsmV1(). + UserFolders().Delete(ctx, hashedName, metav1.DeleteOptions{}) if err != nil { return err } @@ -4796,7 +88521,7 @@ func (group *GnsTsmV1) DeleteDnsByName(ctx context.Context, hashedName string) ( patchOp := PatchOp{ Op: "remove", - Path: "/spec/dNSGvk", + Path: "/spec/userFolderGvk", } patch = append(patch, patchOp) @@ -4808,16 +88533,16 @@ func (group *GnsTsmV1) DeleteDnsByName(ctx context.Context, hashedName string) ( if parents == nil { parents = make(map[string]string) } - parentName, ok := parents["configs.config.tsm.tanzu.vmware.com"] + parentName, ok := parents["runtimes.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if parents[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", parents, parentName) + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", parents, parentName) } _, err = group.client.baseClient. - ConfigTsmV1(). - Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err } @@ -4825,10 +88550,10 @@ func (group *GnsTsmV1) DeleteDnsByName(ctx context.Context, hashedName string) ( return } -// CreateDnsByName creates object in the database without hashing the name. +// CreateUserFolderByName creates object in the database without hashing the name. // Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *GnsTsmV1) CreateDnsByName(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.Dns) (*GnsDns, error) { +func (group *GlobalTsmV1) CreateUserFolderByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.UserFolder) (*GlobalUserFolder, error) { if objToCreate.GetLabels() == nil { objToCreate.Labels = make(map[string]string) } @@ -4842,28 +88567,32 @@ func (group *GnsTsmV1) CreateDnsByName(ctx context.Context, return nil, NewSingletonNameError(objToCreate.Labels[common.DISPLAY_NAME_LABEL]) } + objToCreate.Spec.UsersGvk = nil + objToCreate.Spec.AppUsersGvk = nil + objToCreate.Spec.AccessTokenGvk = nil + result, err := group.client.baseClient. - GnsTsmV1(). - Dnses().Create(ctx, objToCreate, metav1.CreateOptions{}) + GlobalTsmV1(). + UserFolders().Create(ctx, objToCreate, metav1.CreateOptions{}) if err != nil { return nil, err } - parentName, ok := objToCreate.GetLabels()["configs.config.tsm.tanzu.vmware.com"] + parentName, ok := objToCreate.GetLabels()["runtimes.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + parentName = helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) } var patch Patch patchOp := PatchOp{ Op: "replace", - Path: "/spec/dNSGvk", - Value: basegnstsmtanzuvmwarecomv1.Child{ - Group: "gns.tsm.tanzu.vmware.com", - Kind: "Dns", + Path: "/spec/userFolderGvk", + Value: baseglobaltsmtanzuvmwarecomv1.Child{ + Group: "global.tsm.tanzu.vmware.com", + Kind: "UserFolder", Name: objToCreate.Name, }, } @@ -4873,264 +88602,30 @@ func (group *GnsTsmV1) CreateDnsByName(ctx context.Context, return nil, err } _, err = group.client.baseClient. - ConfigTsmV1(). - Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) - if err != nil { - return nil, err - } - - return &GnsDns{ - client: group.client, - Dns: result, - }, nil -} - -// UpdateDnsByName updates object stored in the database under the hashedName which is a hash of -// display name and parents names. -func (group *GnsTsmV1) UpdateDnsByName(ctx context.Context, - objToUpdate *basegnstsmtanzuvmwarecomv1.Dns) (*GnsDns, error) { - if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { - return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) - } - // ResourceVersion must be set for update - if objToUpdate.ResourceVersion == "" { - current, err := group.client.baseClient. - GnsTsmV1(). - Dnses().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) - if err != nil { - return nil, err - } - objToUpdate.ResourceVersion = current.ResourceVersion - } - - var patch Patch - patch = append(patch, PatchOp{ - Op: "replace", - Path: "/metadata", - Value: objToUpdate.ObjectMeta, - }) - - marshaled, err := patch.Marshal() - if err != nil { - return nil, err - } - result, err := group.client.baseClient. - GnsTsmV1(). - Dnses().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") - if err != nil { - return nil, err - } - - return &GnsDns{ - client: group.client, - Dns: result, - }, nil -} - -// ListDnses returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *GnsTsmV1) ListDnses(ctx context.Context, - opts metav1.ListOptions) (result []*GnsDns, err error) { - key := "dnses.gns.tsm.tanzu.vmware.com" - if s, ok := subscriptionMap.Load(key); ok { - items := s.(subscription).informer.GetStore().List() - result = make([]*GnsDns, len(items)) - for k, v := range items { - item, _ := v.(*basegnstsmtanzuvmwarecomv1.Dns) - result[k] = &GnsDns{ - client: group.client, - Dns: item, - } - } - } else { - list, err := group.client.baseClient.GnsTsmV1(). - Dnses().List(ctx, opts) - if err != nil { - return nil, err - } - result = make([]*GnsDns, len(list.Items)) - for k, v := range list.Items { - item := v - result[k] = &GnsDns{ - client: group.client, - Dns: &item, - } - } - } - return -} - -type GnsDns struct { - client *Clientset - *basegnstsmtanzuvmwarecomv1.Dns -} - -// Delete removes obj and all it's children from the database. -func (obj *GnsDns) Delete(ctx context.Context) error { - err := obj.client.Gns().DeleteDnsByName(ctx, obj.GetName()) - if err != nil { - return err - } - obj.Dns = nil - return nil -} - -// Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *GnsDns) Update(ctx context.Context) error { - result, err := obj.client.Gns().UpdateDnsByName(ctx, obj.Dns) - if err != nil { - return err - } - obj.Dns = result.Dns - return nil -} - -func (obj *GnsDns) GetParent(ctx context.Context) (result *ConfigConfig, err error) { - hashedName := helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.config.tsm.tanzu.vmware.com"]) - return obj.client.Config().GetConfigByName(ctx, hashedName) -} - -type dnsGnsTsmV1Chainer struct { - client *Clientset - name string - parentLabels map[string]string -} - -func (c *dnsGnsTsmV1Chainer) Subscribe() { - key := "dnses.gns.tsm.tanzu.vmware.com" - if _, ok := subscriptionMap.Load(key); !ok { - informer := informergnstsmtanzuvmwarecomv1.NewDnsInformer(c.client.baseClient, 0, cache.Indexers{}) - subscribe(key, informer) - } -} - -func (c *dnsGnsTsmV1Chainer) Unsubscribe() { - key := "dnses.gns.tsm.tanzu.vmware.com" - if s, ok := subscriptionMap.Load(key); ok { - close(s.(subscription).stop) - subscriptionMap.Delete(key) - } -} - -func (c *dnsGnsTsmV1Chainer) IsSubscribed() bool { - key := "dnses.gns.tsm.tanzu.vmware.com" - _, ok := subscriptionMap.Load(key) - return ok -} - -// GetAdditionalGnsDataByName returns object stored in the database under the hashedName which is a hash of display -// name and parents names. Use it when you know hashed name of object. -func (group *GnsTsmV1) GetAdditionalGnsDataByName(ctx context.Context, hashedName string) (*GnsAdditionalGnsData, error) { - key := "additionalgnsdatas.gns.tsm.tanzu.vmware.com" - if s, ok := subscriptionMap.Load(key); ok { - item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) - if !exists { - return nil, err - } - - result, _ := item.(*basegnstsmtanzuvmwarecomv1.AdditionalGnsData) - return &GnsAdditionalGnsData{ - client: group.client, - AdditionalGnsData: result, - }, nil - } else { - result, err := group.client.baseClient. - GnsTsmV1(). - AdditionalGnsDatas().Get(ctx, hashedName, metav1.GetOptions{}) - if err != nil { - return nil, err - } - - return &GnsAdditionalGnsData{ - client: group.client, - AdditionalGnsData: result, - }, nil - } -} - -// DeleteAdditionalGnsDataByName deletes object stored in the database under the hashedName which is a hash of -// display name and parents names. Use it when you know hashed name of object. -func (group *GnsTsmV1) DeleteAdditionalGnsDataByName(ctx context.Context, hashedName string) (err error) { - - err = group.client.baseClient. - GnsTsmV1(). - AdditionalGnsDatas().Delete(ctx, hashedName, metav1.DeleteOptions{}) - if err != nil { - return err - } - - return -} - -// CreateAdditionalGnsDataByName creates object in the database without hashing the name. -// Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *GnsTsmV1) CreateAdditionalGnsDataByName(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.AdditionalGnsData) (*GnsAdditionalGnsData, error) { - if objToCreate.GetLabels() == nil { - objToCreate.Labels = make(map[string]string) - } - if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() - } - - result, err := group.client.baseClient. - GnsTsmV1(). - AdditionalGnsDatas().Create(ctx, objToCreate, metav1.CreateOptions{}) + GlobalTsmV1(). + Runtimes().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return nil, err } - return &GnsAdditionalGnsData{ - client: group.client, - AdditionalGnsData: result, - }, nil -} - -// SetAdditionalGnsDataStatusByName sets user defined status -func (group *GnsTsmV1) SetAdditionalGnsDataStatusByName(ctx context.Context, - objToUpdate *basegnstsmtanzuvmwarecomv1.AdditionalGnsData, status *basegnstsmtanzuvmwarecomv1.AdditionalStatus) (*GnsAdditionalGnsData, error) { - - // Make sure status field is present first - m := []byte("{\"status\":{}}") - result, err := group.client.baseClient. - GnsTsmV1(). - AdditionalGnsDatas().Patch(ctx, objToUpdate.GetName(), types.MergePatchType, m, metav1.PatchOptions{}, "status") - if err != nil { - return nil, err - } - - patch := Patch{ - PatchOp{ - Op: "replace", - Path: "/status/status", - Value: status, - }, - } - marshaled, err := patch.Marshal() - if err != nil { - return nil, err - } - result, err = group.client.baseClient. - GnsTsmV1(). - AdditionalGnsDatas().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "status") - if err != nil { - return nil, err - } - return &GnsAdditionalGnsData{ - client: group.client, - AdditionalGnsData: result, + return &GlobalUserFolder{ + client: group.client, + UserFolder: result, }, nil } -// UpdateAdditionalGnsDataByName updates object stored in the database under the hashedName which is a hash of +// UpdateUserFolderByName updates object stored in the database under the hashedName which is a hash of // display name and parents names. -func (group *GnsTsmV1) UpdateAdditionalGnsDataByName(ctx context.Context, - objToUpdate *basegnstsmtanzuvmwarecomv1.AdditionalGnsData) (*GnsAdditionalGnsData, error) { - +func (group *GlobalTsmV1) UpdateUserFolderByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.UserFolder) (*GlobalUserFolder, error) { + if objToUpdate.Labels[common.DISPLAY_NAME_LABEL] != helper.DEFAULT_KEY { + return nil, NewSingletonNameError(objToUpdate.Labels[common.DISPLAY_NAME_LABEL]) + } // ResourceVersion must be set for update if objToUpdate.ResourceVersion == "" { current, err := group.client.baseClient. - GnsTsmV1(). - AdditionalGnsDatas().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + GlobalTsmV1(). + UserFolders().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) if err != nil { return nil, err } @@ -5144,263 +88639,508 @@ func (group *GnsTsmV1) UpdateAdditionalGnsDataByName(ctx context.Context, Value: objToUpdate.ObjectMeta, }) - patchValueDescription := - objToUpdate.Spec.Description - patchOpDescription := PatchOp{ - Op: "replace", - Path: "/spec/description", - Value: patchValueDescription, - } - patch = append(patch, patchOpDescription) - marshaled, err := patch.Marshal() if err != nil { return nil, err } result, err := group.client.baseClient. - GnsTsmV1(). - AdditionalGnsDatas().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + GlobalTsmV1(). + UserFolders().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") if err != nil { return nil, err } - return &GnsAdditionalGnsData{ - client: group.client, - AdditionalGnsData: result, + return &GlobalUserFolder{ + client: group.client, + UserFolder: result, }, nil } -// ListAdditionalGnsDatas returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *GnsTsmV1) ListAdditionalGnsDatas(ctx context.Context, - opts metav1.ListOptions) (result []*GnsAdditionalGnsData, err error) { - key := "additionalgnsdatas.gns.tsm.tanzu.vmware.com" +// ListUserFolders returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListUserFolders(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalUserFolder, err error) { + key := "userfolders.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { items := s.(subscription).informer.GetStore().List() - result = make([]*GnsAdditionalGnsData, len(items)) + result = make([]*GlobalUserFolder, len(items)) for k, v := range items { - item, _ := v.(*basegnstsmtanzuvmwarecomv1.AdditionalGnsData) - result[k] = &GnsAdditionalGnsData{ - client: group.client, - AdditionalGnsData: item, + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.UserFolder) + result[k] = &GlobalUserFolder{ + client: group.client, + UserFolder: item, } } } else { - list, err := group.client.baseClient.GnsTsmV1(). - AdditionalGnsDatas().List(ctx, opts) + list, err := group.client.baseClient.GlobalTsmV1(). + UserFolders().List(ctx, opts) if err != nil { return nil, err } - result = make([]*GnsAdditionalGnsData, len(list.Items)) + result = make([]*GlobalUserFolder, len(list.Items)) for k, v := range list.Items { item := v - result[k] = &GnsAdditionalGnsData{ - client: group.client, - AdditionalGnsData: &item, + result[k] = &GlobalUserFolder{ + client: group.client, + UserFolder: &item, } } } return } -type GnsAdditionalGnsData struct { +type GlobalUserFolder struct { client *Clientset - *basegnstsmtanzuvmwarecomv1.AdditionalGnsData + *baseglobaltsmtanzuvmwarecomv1.UserFolder } // Delete removes obj and all it's children from the database. -func (obj *GnsAdditionalGnsData) Delete(ctx context.Context) error { - err := obj.client.Gns().DeleteAdditionalGnsDataByName(ctx, obj.GetName()) +func (obj *GlobalUserFolder) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteUserFolderByName(ctx, obj.GetName()) if err != nil { return err } - obj.AdditionalGnsData = nil + obj.UserFolder = nil return nil } // Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *GnsAdditionalGnsData) Update(ctx context.Context) error { - result, err := obj.client.Gns().UpdateAdditionalGnsDataByName(ctx, obj.AdditionalGnsData) +func (obj *GlobalUserFolder) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateUserFolderByName(ctx, obj.UserFolder) if err != nil { return err } - obj.AdditionalGnsData = result.AdditionalGnsData + obj.UserFolder = result.UserFolder return nil } -// SetStatus sets user defined status -func (obj *GnsAdditionalGnsData) SetStatus(ctx context.Context, status *basegnstsmtanzuvmwarecomv1.AdditionalStatus) error { - result, err := obj.client.Gns().SetAdditionalGnsDataStatusByName(ctx, obj.AdditionalGnsData, status) +func (obj *GlobalUserFolder) GetParent(ctx context.Context) (result *GlobalRuntime, err error) { + hashedName := helper.GetHashedName("runtimes.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["runtimes.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetRuntimeByName(ctx, hashedName) +} + +// GetAllUsers returns all children of given type +func (obj *GlobalUserFolder) GetAllUsers(ctx context.Context) ( + result []*GlobalUser, err error) { + result = make([]*GlobalUser, 0, len(obj.Spec.UsersGvk)) + for _, v := range obj.Spec.UsersGvk { + l, err := obj.client.Global().GetUserByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetUsers returns child which has given displayName +func (obj *GlobalUserFolder) GetUsers(ctx context.Context, + displayName string) (result *GlobalUser, err error) { + l, ok := obj.Spec.UsersGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.UserFolder", "Users", displayName) + } + result, err = obj.client.Global().GetUserByName(ctx, l.Name) + return +} + +// AddUsers calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalUserFolder) AddUsers(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.User) (result *GlobalUser, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for _, v := range helper.GetCRDParentsMap()["userfolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["userfolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateUserByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetUserFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.UserFolder = updatedObj.UserFolder + } + return +} + +// DeleteUsers calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalUserFolder) DeleteUsers(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.UsersGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.UserFolder", "Users", displayName) + } + err = obj.client.Global().DeleteUserByName(ctx, l.Name) if err != nil { return err } - obj.AdditionalGnsData = result.AdditionalGnsData - return nil + updatedObj, err := obj.client.Global().GetUserFolderByName(ctx, obj.GetName()) + if err == nil { + obj.UserFolder = updatedObj.UserFolder + } + return } -// GetStatus to get user defined status -func (obj *GnsAdditionalGnsData) GetStatus(ctx context.Context) (*basegnstsmtanzuvmwarecomv1.AdditionalStatus, error) { - getObj, err := obj.client.Gns().GetAdditionalGnsDataByName(ctx, obj.GetName()) - if err != nil { - return nil, err +// GetAllAppUsers returns all children of given type +func (obj *GlobalUserFolder) GetAllAppUsers(ctx context.Context) ( + result []*GlobalAppUser, err error) { + result = make([]*GlobalAppUser, 0, len(obj.Spec.AppUsersGvk)) + for _, v := range obj.Spec.AppUsersGvk { + l, err := obj.client.Global().GetAppUserByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetAppUsers returns child which has given displayName +func (obj *GlobalUserFolder) GetAppUsers(ctx context.Context, + displayName string) (result *GlobalAppUser, err error) { + l, ok := obj.Spec.AppUsersGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.UserFolder", "AppUsers", displayName) + } + result, err = obj.client.Global().GetAppUserByName(ctx, l.Name) + return +} + +// AddAppUsers calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (obj *GlobalUserFolder) AddAppUsers(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppUser) (result *GlobalAppUser, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} } - return &getObj.Status.Status, nil + for _, v := range helper.GetCRDParentsMap()["userfolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["userfolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + result, err = obj.client.Global().CreateAppUserByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetUserFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.UserFolder = updatedObj.UserFolder + } + return } -// ClearStatus to clear user defined status -func (obj *GnsAdditionalGnsData) ClearStatus(ctx context.Context) error { - result, err := obj.client.Gns().SetAdditionalGnsDataStatusByName(ctx, obj.AdditionalGnsData, &basegnstsmtanzuvmwarecomv1.AdditionalStatus{}) +// DeleteAppUsers calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalUserFolder) DeleteAppUsers(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.AppUsersGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.UserFolder", "AppUsers", displayName) + } + err = obj.client.Global().DeleteAppUserByName(ctx, l.Name) if err != nil { return err } - obj.AdditionalGnsData = result.AdditionalGnsData - return nil + updatedObj, err := obj.client.Global().GetUserFolderByName(ctx, obj.GetName()) + if err == nil { + obj.UserFolder = updatedObj.UserFolder + } + return } -// GetGnsAdditionalGnsData calculates the hashed name based on parents and displayName and -// returns given object -func (c *Clientset) GetGnsAdditionalGnsData(ctx context.Context, displayName string) (result *GnsAdditionalGnsData, err error) { - hashedName := helper.GetHashedName("additionalgnsdatas.gns.tsm.tanzu.vmware.com", nil, displayName) - return c.Gns().GetAdditionalGnsDataByName(ctx, hashedName) +// GetAllAccessToken returns all children of given type +func (obj *GlobalUserFolder) GetAllAccessToken(ctx context.Context) ( + result []*GlobalAccessToken, err error) { + result = make([]*GlobalAccessToken, 0, len(obj.Spec.AccessTokenGvk)) + for _, v := range obj.Spec.AccessTokenGvk { + l, err := obj.client.Global().GetAccessTokenByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return } -func (c *Clientset) GnsAdditionalGnsData(displayName string) *additionalgnsdataGnsTsmV1Chainer { - parentLabels := make(map[string]string) - parentLabels["additionalgnsdatas.gns.tsm.tanzu.vmware.com"] = displayName - return &additionalgnsdataGnsTsmV1Chainer{ - client: c, - name: displayName, - parentLabels: parentLabels, +// GetAccessToken returns child which has given displayName +func (obj *GlobalUserFolder) GetAccessToken(ctx context.Context, + displayName string) (result *GlobalAccessToken, err error) { + l, ok := obj.Spec.AccessTokenGvk[displayName] + if !ok { + return nil, NewChildNotFound(obj.DisplayName(), "Global.UserFolder", "AccessToken", displayName) } + result, err = obj.client.Global().GetAccessTokenByName(ctx, l.Name) + return } -// AddGnsAdditionalGnsData calculates hashed name of the object based on objToCreate.Name +// AddAccessToken calculates hashed name of the child to create based on objToCreate.Name // and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in // nexus/display_name label and can be obtained using DisplayName() method. -func (c *Clientset) AddGnsAdditionalGnsData(ctx context.Context, - objToCreate *basegnstsmtanzuvmwarecomv1.AdditionalGnsData) (result *GnsAdditionalGnsData, err error) { +func (obj *GlobalUserFolder) AddAccessToken(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AccessToken) (result *GlobalAccessToken, err error) { if objToCreate.Labels == nil { objToCreate.Labels = map[string]string{} } + for _, v := range helper.GetCRDParentsMap()["userfolders.global.tsm.tanzu.vmware.com"] { + objToCreate.Labels[v] = obj.Labels[v] + } + objToCreate.Labels["userfolders.global.tsm.tanzu.vmware.com"] = obj.DisplayName() if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName(objToCreate.CRDName(), nil, objToCreate.GetName()) + hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) objToCreate.Name = hashedName } - return c.Gns().CreateAdditionalGnsDataByName(ctx, objToCreate) + result, err = obj.client.Global().CreateAccessTokenByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetUserFolderByName(ctx, obj.GetName()) + if getErr == nil { + obj.UserFolder = updatedObj.UserFolder + } + return } -// DeleteGnsAdditionalGnsData calculates hashedName of object based on displayName and -// parents and deletes given object -func (c *Clientset) DeleteGnsAdditionalGnsData(ctx context.Context, displayName string) (err error) { - hashedName := helper.GetHashedName("additionalgnsdatas.gns.tsm.tanzu.vmware.com", nil, displayName) - return c.Gns().DeleteAdditionalGnsDataByName(ctx, hashedName) +// DeleteAccessToken calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. + +func (obj *GlobalUserFolder) DeleteAccessToken(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.AccessTokenGvk[displayName] + if !ok { + return NewChildNotFound(obj.DisplayName(), "Global.UserFolder", "AccessToken", displayName) + } + err = obj.client.Global().DeleteAccessTokenByName(ctx, l.Name) + if err != nil { + return err + } + updatedObj, err := obj.client.Global().GetUserFolderByName(ctx, obj.GetName()) + if err == nil { + obj.UserFolder = updatedObj.UserFolder + } + return } -type additionalgnsdataGnsTsmV1Chainer struct { +type userfolderGlobalTsmV1Chainer struct { client *Clientset name string parentLabels map[string]string } -func (c *additionalgnsdataGnsTsmV1Chainer) Subscribe() { - key := "additionalgnsdatas.gns.tsm.tanzu.vmware.com" +func (c *userfolderGlobalTsmV1Chainer) Subscribe() { + key := "userfolders.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informergnstsmtanzuvmwarecomv1.NewAdditionalGnsDataInformer(c.client.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewUserFolderInformer(c.client.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } } -func (c *additionalgnsdataGnsTsmV1Chainer) Unsubscribe() { - key := "additionalgnsdatas.gns.tsm.tanzu.vmware.com" +func (c *userfolderGlobalTsmV1Chainer) Unsubscribe() { + key := "userfolders.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { close(s.(subscription).stop) subscriptionMap.Delete(key) } } -func (c *additionalgnsdataGnsTsmV1Chainer) IsSubscribed() bool { - key := "additionalgnsdatas.gns.tsm.tanzu.vmware.com" +func (c *userfolderGlobalTsmV1Chainer) IsSubscribed() bool { + key := "userfolders.global.tsm.tanzu.vmware.com" _, ok := subscriptionMap.Load(key) return ok } -// ClearStatus to clear user defined status -func (c *additionalgnsdataGnsTsmV1Chainer) ClearStatus(ctx context.Context) (err error) { - hashedName := helper.GetHashedName("additionalgnsdatas.gns.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Gns().GetAdditionalGnsDataByName(ctx, hashedName) - if err != nil { - return err +func (c *userfolderGlobalTsmV1Chainer) Users(name string) *userGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["users.global.tsm.tanzu.vmware.com"] = name + return &userGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, } - _, err = c.client.Gns().SetAdditionalGnsDataStatusByName(ctx, obj.AdditionalGnsData, nil) - return err } -// GetStatus to get user defined status -func (c *additionalgnsdataGnsTsmV1Chainer) GetStatus(ctx context.Context) (result *basegnstsmtanzuvmwarecomv1.AdditionalStatus, err error) { - hashedName := helper.GetHashedName("additionalgnsdatas.gns.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Gns().GetAdditionalGnsDataByName(ctx, hashedName) - if err != nil { - return nil, err +// GetUsers calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *userfolderGlobalTsmV1Chainer) GetUsers(ctx context.Context, displayName string) (result *GlobalUser, err error) { + hashedName := helper.GetHashedName("users.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetUserByName(ctx, hashedName) +} + +// AddUsers calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *userfolderGlobalTsmV1Chainer) AddUsers(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.User) (result *GlobalUser, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("users.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName } - return &obj.Status.Status, nil + return c.client.Global().CreateUserByName(ctx, objToCreate) } -// SetStatus sets user defined status -func (c *additionalgnsdataGnsTsmV1Chainer) SetStatus(ctx context.Context, status *basegnstsmtanzuvmwarecomv1.AdditionalStatus) (err error) { - hashedName := helper.GetHashedName("additionalgnsdatas.gns.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Gns().GetAdditionalGnsDataByName(ctx, hashedName) - if err != nil { - return err +// DeleteUsers calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *userfolderGlobalTsmV1Chainer) DeleteUsers(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} } - _, err = c.client.Gns().SetAdditionalGnsDataStatusByName(ctx, obj.AdditionalGnsData, status) - return err + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("users.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteUserByName(ctx, hashedName) } -// GetSvcGroupByName returns object stored in the database under the hashedName which is a hash of display +func (c *userfolderGlobalTsmV1Chainer) AppUsers(name string) *appuserGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["appusers.global.tsm.tanzu.vmware.com"] = name + return &appuserGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetAppUsers calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *userfolderGlobalTsmV1Chainer) GetAppUsers(ctx context.Context, displayName string) (result *GlobalAppUser, err error) { + hashedName := helper.GetHashedName("appusers.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAppUserByName(ctx, hashedName) +} + +// AddAppUsers calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *userfolderGlobalTsmV1Chainer) AddAppUsers(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AppUser) (result *GlobalAppUser, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("appusers.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAppUserByName(ctx, objToCreate) +} + +// DeleteAppUsers calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *userfolderGlobalTsmV1Chainer) DeleteAppUsers(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("appusers.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAppUserByName(ctx, hashedName) +} + +func (c *userfolderGlobalTsmV1Chainer) AccessToken(name string) *accesstokenGlobalTsmV1Chainer { + parentLabels := c.parentLabels + parentLabels["accesstokens.global.tsm.tanzu.vmware.com"] = name + return &accesstokenGlobalTsmV1Chainer{ + client: c.client, + name: name, + parentLabels: parentLabels, + } +} + +// GetAccessToken calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *userfolderGlobalTsmV1Chainer) GetAccessToken(ctx context.Context, displayName string) (result *GlobalAccessToken, err error) { + hashedName := helper.GetHashedName("accesstokens.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetAccessTokenByName(ctx, hashedName) +} + +// AddAccessToken calculates hashed name of the child to create based on objToCreate.Name +// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in +// nexus/display_name label and can be obtained using DisplayName() method. +func (c *userfolderGlobalTsmV1Chainer) AddAccessToken(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.AccessToken) (result *GlobalAccessToken, err error) { + if objToCreate.Labels == nil { + objToCreate.Labels = map[string]string{} + } + for k, v := range c.parentLabels { + objToCreate.Labels[k] = v + } + if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { + objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("accesstokens.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + objToCreate.Name = hashedName + } + return c.client.Global().CreateAccessTokenByName(ctx, objToCreate) +} + +// DeleteAccessToken calculates hashed name of the child to delete based on displayName +// and parents names and deletes it. +func (c *userfolderGlobalTsmV1Chainer) DeleteAccessToken(ctx context.Context, name string) (err error) { + if c.parentLabels == nil { + c.parentLabels = map[string]string{} + } + c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" + hashedName := helper.GetHashedName("accesstokens.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteAccessTokenByName(ctx, hashedName) +} + +// GetUserGroupByName returns object stored in the database under the hashedName which is a hash of display // name and parents names. Use it when you know hashed name of object. -func (group *ServicegroupTsmV1) GetSvcGroupByName(ctx context.Context, hashedName string) (*ServicegroupSvcGroup, error) { - key := "svcgroups.servicegroup.tsm.tanzu.vmware.com" +func (group *GlobalTsmV1) GetUserGroupByName(ctx context.Context, hashedName string) (*GlobalUserGroup, error) { + key := "usergroups.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) if !exists { return nil, err } - result, _ := item.(*baseservicegrouptsmtanzuvmwarecomv1.SvcGroup) - return &ServicegroupSvcGroup{ - client: group.client, - SvcGroup: result, + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.UserGroup) + return &GlobalUserGroup{ + client: group.client, + UserGroup: result, }, nil } else { result, err := group.client.baseClient. - ServicegroupTsmV1(). - SvcGroups().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + UserGroups().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return nil, err } - return &ServicegroupSvcGroup{ - client: group.client, - SvcGroup: result, + return &GlobalUserGroup{ + client: group.client, + UserGroup: result, }, nil } } -// DeleteSvcGroupByName deletes object stored in the database under the hashedName which is a hash of +// DeleteUserGroupByName deletes object stored in the database under the hashedName which is a hash of // display name and parents names. Use it when you know hashed name of object. -func (group *ServicegroupTsmV1) DeleteSvcGroupByName(ctx context.Context, hashedName string) (err error) { +func (group *GlobalTsmV1) DeleteUserGroupByName(ctx context.Context, hashedName string) (err error) { result, err := group.client.baseClient. - ServicegroupTsmV1(). - SvcGroups().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + UserGroups().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return err } err = group.client.baseClient. - ServicegroupTsmV1(). - SvcGroups().Delete(ctx, hashedName, metav1.DeleteOptions{}) + GlobalTsmV1(). + UserGroups().Delete(ctx, hashedName, metav1.DeleteOptions{}) if err != nil { return err } @@ -5409,7 +89149,7 @@ func (group *ServicegroupTsmV1) DeleteSvcGroupByName(ctx context.Context, hashed patchOp := PatchOp{ Op: "remove", - Path: "/spec/gnsServiceGroupsGvk/" + result.DisplayName(), + Path: "/spec/userGroupsGvk/" + result.DisplayName(), } patch = append(patch, patchOp) @@ -5421,16 +89161,16 @@ func (group *ServicegroupTsmV1) DeleteSvcGroupByName(ctx context.Context, hashed if parents == nil { parents = make(map[string]string) } - parentName, ok := parents["gnses.gns.tsm.tanzu.vmware.com"] + parentName, ok := parents["resourcegroups.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if parents[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", parents, parentName) + parentName = helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", parents, parentName) } _, err = group.client.baseClient. - GnsTsmV1(). - Gnses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + ResourceGroups().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err } @@ -5438,10 +89178,10 @@ func (group *ServicegroupTsmV1) DeleteSvcGroupByName(ctx context.Context, hashed return } -// CreateSvcGroupByName creates object in the database without hashing the name. +// CreateUserGroupByName creates object in the database without hashing the name. // Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *ServicegroupTsmV1) CreateSvcGroupByName(ctx context.Context, - objToCreate *baseservicegrouptsmtanzuvmwarecomv1.SvcGroup) (*ServicegroupSvcGroup, error) { +func (group *GlobalTsmV1) CreateUserGroupByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.UserGroup) (*GlobalUserGroup, error) { if objToCreate.GetLabels() == nil { objToCreate.Labels = make(map[string]string) } @@ -5450,44 +89190,44 @@ func (group *ServicegroupTsmV1) CreateSvcGroupByName(ctx context.Context, } result, err := group.client.baseClient. - ServicegroupTsmV1(). - SvcGroups().Create(ctx, objToCreate, metav1.CreateOptions{}) + GlobalTsmV1(). + UserGroups().Create(ctx, objToCreate, metav1.CreateOptions{}) if err != nil { return nil, err } - parentName, ok := objToCreate.GetLabels()["gnses.gns.tsm.tanzu.vmware.com"] + parentName, ok := objToCreate.GetLabels()["resourcegroups.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + parentName = helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) } - payload := "{\"spec\": {\"gnsServiceGroupsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"SvcGroup\", \"group\": \"servicegroup.tsm.tanzu.vmware.com\"}}}}" + payload := "{\"spec\": {\"userGroupsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"UserGroup\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" _, err = group.client.baseClient. - GnsTsmV1(). - Gnses().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + GlobalTsmV1(). + ResourceGroups().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) if err != nil { return nil, err } - return &ServicegroupSvcGroup{ - client: group.client, - SvcGroup: result, + return &GlobalUserGroup{ + client: group.client, + UserGroup: result, }, nil } -// UpdateSvcGroupByName updates object stored in the database under the hashedName which is a hash of +// UpdateUserGroupByName updates object stored in the database under the hashedName which is a hash of // display name and parents names. -func (group *ServicegroupTsmV1) UpdateSvcGroupByName(ctx context.Context, - objToUpdate *baseservicegrouptsmtanzuvmwarecomv1.SvcGroup) (*ServicegroupSvcGroup, error) { +func (group *GlobalTsmV1) UpdateUserGroupByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.UserGroup) (*GlobalUserGroup, error) { // ResourceVersion must be set for update if objToUpdate.ResourceVersion == "" { current, err := group.client.baseClient. - ServicegroupTsmV1(). - SvcGroups().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + GlobalTsmV1(). + UserGroups().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) if err != nil { return nil, err } @@ -5519,6 +89259,15 @@ func (group *ServicegroupTsmV1) UpdateSvcGroupByName(ctx context.Context, } patch = append(patch, patchOpDescription) + patchValueScope := + objToUpdate.Spec.Scope + patchOpScope := PatchOp{ + Op: "replace", + Path: "/spec/scope", + Value: patchValueScope, + } + patch = append(patch, patchOpScope) + patchValueColor := objToUpdate.Spec.Color patchOpColor := PatchOp{ @@ -5528,157 +89277,166 @@ func (group *ServicegroupTsmV1) UpdateSvcGroupByName(ctx context.Context, } patch = append(patch, patchOpColor) + patchValueRules := + objToUpdate.Spec.Rules + patchOpRules := PatchOp{ + Op: "replace", + Path: "/spec/rules", + Value: patchValueRules, + } + patch = append(patch, patchOpRules) + marshaled, err := patch.Marshal() if err != nil { return nil, err } result, err := group.client.baseClient. - ServicegroupTsmV1(). - SvcGroups().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + GlobalTsmV1(). + UserGroups().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") if err != nil { return nil, err } - return &ServicegroupSvcGroup{ - client: group.client, - SvcGroup: result, + return &GlobalUserGroup{ + client: group.client, + UserGroup: result, }, nil } -// ListSvcGroups returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *ServicegroupTsmV1) ListSvcGroups(ctx context.Context, - opts metav1.ListOptions) (result []*ServicegroupSvcGroup, err error) { - key := "svcgroups.servicegroup.tsm.tanzu.vmware.com" +// ListUserGroups returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListUserGroups(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalUserGroup, err error) { + key := "usergroups.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { items := s.(subscription).informer.GetStore().List() - result = make([]*ServicegroupSvcGroup, len(items)) + result = make([]*GlobalUserGroup, len(items)) for k, v := range items { - item, _ := v.(*baseservicegrouptsmtanzuvmwarecomv1.SvcGroup) - result[k] = &ServicegroupSvcGroup{ - client: group.client, - SvcGroup: item, + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.UserGroup) + result[k] = &GlobalUserGroup{ + client: group.client, + UserGroup: item, } } } else { - list, err := group.client.baseClient.ServicegroupTsmV1(). - SvcGroups().List(ctx, opts) + list, err := group.client.baseClient.GlobalTsmV1(). + UserGroups().List(ctx, opts) if err != nil { return nil, err } - result = make([]*ServicegroupSvcGroup, len(list.Items)) + result = make([]*GlobalUserGroup, len(list.Items)) for k, v := range list.Items { item := v - result[k] = &ServicegroupSvcGroup{ - client: group.client, - SvcGroup: &item, + result[k] = &GlobalUserGroup{ + client: group.client, + UserGroup: &item, } } } return } -type ServicegroupSvcGroup struct { +type GlobalUserGroup struct { client *Clientset - *baseservicegrouptsmtanzuvmwarecomv1.SvcGroup + *baseglobaltsmtanzuvmwarecomv1.UserGroup } // Delete removes obj and all it's children from the database. -func (obj *ServicegroupSvcGroup) Delete(ctx context.Context) error { - err := obj.client.Servicegroup().DeleteSvcGroupByName(ctx, obj.GetName()) +func (obj *GlobalUserGroup) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteUserGroupByName(ctx, obj.GetName()) if err != nil { return err } - obj.SvcGroup = nil + obj.UserGroup = nil return nil } // Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *ServicegroupSvcGroup) Update(ctx context.Context) error { - result, err := obj.client.Servicegroup().UpdateSvcGroupByName(ctx, obj.SvcGroup) +func (obj *GlobalUserGroup) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateUserGroupByName(ctx, obj.UserGroup) if err != nil { return err } - obj.SvcGroup = result.SvcGroup + obj.UserGroup = result.UserGroup return nil } -func (obj *ServicegroupSvcGroup) GetParent(ctx context.Context) (result *GnsGns, err error) { - hashedName := helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnses.gns.tsm.tanzu.vmware.com"]) - return obj.client.Gns().GetGnsByName(ctx, hashedName) +func (obj *GlobalUserGroup) GetParent(ctx context.Context) (result *GlobalResourceGroup, err error) { + hashedName := helper.GetHashedName("resourcegroups.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["resourcegroups.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetResourceGroupByName(ctx, hashedName) } -type svcgroupServicegroupTsmV1Chainer struct { +type usergroupGlobalTsmV1Chainer struct { client *Clientset name string parentLabels map[string]string } -func (c *svcgroupServicegroupTsmV1Chainer) Subscribe() { - key := "svcgroups.servicegroup.tsm.tanzu.vmware.com" +func (c *usergroupGlobalTsmV1Chainer) Subscribe() { + key := "usergroups.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informerservicegrouptsmtanzuvmwarecomv1.NewSvcGroupInformer(c.client.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewUserGroupInformer(c.client.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } } -func (c *svcgroupServicegroupTsmV1Chainer) Unsubscribe() { - key := "svcgroups.servicegroup.tsm.tanzu.vmware.com" +func (c *usergroupGlobalTsmV1Chainer) Unsubscribe() { + key := "usergroups.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { close(s.(subscription).stop) subscriptionMap.Delete(key) } } -func (c *svcgroupServicegroupTsmV1Chainer) IsSubscribed() bool { - key := "svcgroups.servicegroup.tsm.tanzu.vmware.com" +func (c *usergroupGlobalTsmV1Chainer) IsSubscribed() bool { + key := "usergroups.global.tsm.tanzu.vmware.com" _, ok := subscriptionMap.Load(key) return ok } -// GetSvcGroupLinkInfoByName returns object stored in the database under the hashedName which is a hash of display +// GetUserPreferenceByName returns object stored in the database under the hashedName which is a hash of display // name and parents names. Use it when you know hashed name of object. -func (group *ServicegroupTsmV1) GetSvcGroupLinkInfoByName(ctx context.Context, hashedName string) (*ServicegroupSvcGroupLinkInfo, error) { - key := "svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com" +func (group *GlobalTsmV1) GetUserPreferenceByName(ctx context.Context, hashedName string) (*GlobalUserPreference, error) { + key := "userpreferences.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) if !exists { return nil, err } - result, _ := item.(*baseservicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo) - return &ServicegroupSvcGroupLinkInfo{ - client: group.client, - SvcGroupLinkInfo: result, + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.UserPreference) + return &GlobalUserPreference{ + client: group.client, + UserPreference: result, }, nil } else { result, err := group.client.baseClient. - ServicegroupTsmV1(). - SvcGroupLinkInfos().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + UserPreferences().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return nil, err } - return &ServicegroupSvcGroupLinkInfo{ - client: group.client, - SvcGroupLinkInfo: result, + return &GlobalUserPreference{ + client: group.client, + UserPreference: result, }, nil } } -// DeleteSvcGroupLinkInfoByName deletes object stored in the database under the hashedName which is a hash of +// DeleteUserPreferenceByName deletes object stored in the database under the hashedName which is a hash of // display name and parents names. Use it when you know hashed name of object. -func (group *ServicegroupTsmV1) DeleteSvcGroupLinkInfoByName(ctx context.Context, hashedName string) (err error) { +func (group *GlobalTsmV1) DeleteUserPreferenceByName(ctx context.Context, hashedName string) (err error) { result, err := group.client.baseClient. - ServicegroupTsmV1(). - SvcGroupLinkInfos().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + UserPreferences().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return err } err = group.client.baseClient. - ServicegroupTsmV1(). - SvcGroupLinkInfos().Delete(ctx, hashedName, metav1.DeleteOptions{}) + GlobalTsmV1(). + UserPreferences().Delete(ctx, hashedName, metav1.DeleteOptions{}) if err != nil { return err } @@ -5687,7 +89445,7 @@ func (group *ServicegroupTsmV1) DeleteSvcGroupLinkInfoByName(ctx context.Context patchOp := PatchOp{ Op: "remove", - Path: "/spec/svcGrpInfoGvk", + Path: "/spec/preferencesGvk/" + result.DisplayName(), } patch = append(patch, patchOp) @@ -5699,16 +89457,16 @@ func (group *ServicegroupTsmV1) DeleteSvcGroupLinkInfoByName(ctx context.Context if parents == nil { parents = make(map[string]string) } - parentName, ok := parents["configs.config.tsm.tanzu.vmware.com"] + parentName, ok := parents["users.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if parents[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", parents, parentName) + parentName = helper.GetHashedName("users.global.tsm.tanzu.vmware.com", parents, parentName) } _, err = group.client.baseClient. - ConfigTsmV1(). - Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + Users().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err } @@ -5716,10 +89474,10 @@ func (group *ServicegroupTsmV1) DeleteSvcGroupLinkInfoByName(ctx context.Context return } -// CreateSvcGroupLinkInfoByName creates object in the database without hashing the name. +// CreateUserPreferenceByName creates object in the database without hashing the name. // Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *ServicegroupTsmV1) CreateSvcGroupLinkInfoByName(ctx context.Context, - objToCreate *baseservicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo) (*ServicegroupSvcGroupLinkInfo, error) { +func (group *GlobalTsmV1) CreateUserPreferenceByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.UserPreference) (*GlobalUserPreference, error) { if objToCreate.GetLabels() == nil { objToCreate.Labels = make(map[string]string) } @@ -5728,58 +89486,44 @@ func (group *ServicegroupTsmV1) CreateSvcGroupLinkInfoByName(ctx context.Context } result, err := group.client.baseClient. - ServicegroupTsmV1(). - SvcGroupLinkInfos().Create(ctx, objToCreate, metav1.CreateOptions{}) + GlobalTsmV1(). + UserPreferences().Create(ctx, objToCreate, metav1.CreateOptions{}) if err != nil { return nil, err } - parentName, ok := objToCreate.GetLabels()["configs.config.tsm.tanzu.vmware.com"] + parentName, ok := objToCreate.GetLabels()["users.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + parentName = helper.GetHashedName("users.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) } - var patch Patch - patchOp := PatchOp{ - Op: "replace", - Path: "/spec/svcGrpInfoGvk", - Value: baseservicegrouptsmtanzuvmwarecomv1.Child{ - Group: "servicegroup.tsm.tanzu.vmware.com", - Kind: "SvcGroupLinkInfo", - Name: objToCreate.Name, - }, - } - patch = append(patch, patchOp) - marshaled, err := patch.Marshal() - if err != nil { - return nil, err - } + payload := "{\"spec\": {\"preferencesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"UserPreference\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" _, err = group.client.baseClient. - ConfigTsmV1(). - Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + Users().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) if err != nil { return nil, err } - return &ServicegroupSvcGroupLinkInfo{ - client: group.client, - SvcGroupLinkInfo: result, + return &GlobalUserPreference{ + client: group.client, + UserPreference: result, }, nil } -// UpdateSvcGroupLinkInfoByName updates object stored in the database under the hashedName which is a hash of +// UpdateUserPreferenceByName updates object stored in the database under the hashedName which is a hash of // display name and parents names. -func (group *ServicegroupTsmV1) UpdateSvcGroupLinkInfoByName(ctx context.Context, - objToUpdate *baseservicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo) (*ServicegroupSvcGroupLinkInfo, error) { +func (group *GlobalTsmV1) UpdateUserPreferenceByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.UserPreference) (*GlobalUserPreference, error) { // ResourceVersion must be set for update if objToUpdate.ResourceVersion == "" { current, err := group.client.baseClient. - ServicegroupTsmV1(). - SvcGroupLinkInfos().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + GlobalTsmV1(). + UserPreferences().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) if err != nil { return nil, err } @@ -5793,541 +89537,192 @@ func (group *ServicegroupTsmV1) UpdateSvcGroupLinkInfoByName(ctx context.Context Value: objToUpdate.ObjectMeta, }) - patchValueClusterName := - objToUpdate.Spec.ClusterName - patchOpClusterName := PatchOp{ - Op: "replace", - Path: "/spec/clusterName", - Value: patchValueClusterName, - } - patch = append(patch, patchOpClusterName) - - patchValueDomainName := - objToUpdate.Spec.DomainName - patchOpDomainName := PatchOp{ - Op: "replace", - Path: "/spec/domainName", - Value: patchValueDomainName, - } - patch = append(patch, patchOpDomainName) - - patchValueServiceName := - objToUpdate.Spec.ServiceName - patchOpServiceName := PatchOp{ + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ Op: "replace", - Path: "/spec/serviceName", - Value: patchValueServiceName, + Path: "/spec/name", + Value: patchValueName, } - patch = append(patch, patchOpServiceName) + patch = append(patch, patchOpName) - patchValueServiceType := - objToUpdate.Spec.ServiceType - patchOpServiceType := PatchOp{ + patchValueData := + objToUpdate.Spec.Data + patchOpData := PatchOp{ Op: "replace", - Path: "/spec/serviceType", - Value: patchValueServiceType, - } - patch = append(patch, patchOpServiceType) - - marshaled, err := patch.Marshal() - if err != nil { - return nil, err - } - result, err := group.client.baseClient. - ServicegroupTsmV1(). - SvcGroupLinkInfos().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") - if err != nil { - return nil, err - } - - return &ServicegroupSvcGroupLinkInfo{ - client: group.client, - SvcGroupLinkInfo: result, - }, nil -} - -// ListSvcGroupLinkInfos returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *ServicegroupTsmV1) ListSvcGroupLinkInfos(ctx context.Context, - opts metav1.ListOptions) (result []*ServicegroupSvcGroupLinkInfo, err error) { - key := "svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com" - if s, ok := subscriptionMap.Load(key); ok { - items := s.(subscription).informer.GetStore().List() - result = make([]*ServicegroupSvcGroupLinkInfo, len(items)) - for k, v := range items { - item, _ := v.(*baseservicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo) - result[k] = &ServicegroupSvcGroupLinkInfo{ - client: group.client, - SvcGroupLinkInfo: item, - } - } - } else { - list, err := group.client.baseClient.ServicegroupTsmV1(). - SvcGroupLinkInfos().List(ctx, opts) - if err != nil { - return nil, err - } - result = make([]*ServicegroupSvcGroupLinkInfo, len(list.Items)) - for k, v := range list.Items { - item := v - result[k] = &ServicegroupSvcGroupLinkInfo{ - client: group.client, - SvcGroupLinkInfo: &item, - } - } - } - return -} - -type ServicegroupSvcGroupLinkInfo struct { - client *Clientset - *baseservicegrouptsmtanzuvmwarecomv1.SvcGroupLinkInfo -} - -// Delete removes obj and all it's children from the database. -func (obj *ServicegroupSvcGroupLinkInfo) Delete(ctx context.Context) error { - err := obj.client.Servicegroup().DeleteSvcGroupLinkInfoByName(ctx, obj.GetName()) - if err != nil { - return err - } - obj.SvcGroupLinkInfo = nil - return nil -} - -// Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *ServicegroupSvcGroupLinkInfo) Update(ctx context.Context) error { - result, err := obj.client.Servicegroup().UpdateSvcGroupLinkInfoByName(ctx, obj.SvcGroupLinkInfo) - if err != nil { - return err - } - obj.SvcGroupLinkInfo = result.SvcGroupLinkInfo - return nil -} - -func (obj *ServicegroupSvcGroupLinkInfo) GetParent(ctx context.Context) (result *ConfigConfig, err error) { - hashedName := helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.config.tsm.tanzu.vmware.com"]) - return obj.client.Config().GetConfigByName(ctx, hashedName) -} - -type svcgrouplinkinfoServicegroupTsmV1Chainer struct { - client *Clientset - name string - parentLabels map[string]string -} - -func (c *svcgrouplinkinfoServicegroupTsmV1Chainer) Subscribe() { - key := "svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com" - if _, ok := subscriptionMap.Load(key); !ok { - informer := informerservicegrouptsmtanzuvmwarecomv1.NewSvcGroupLinkInfoInformer(c.client.baseClient, 0, cache.Indexers{}) - subscribe(key, informer) - } -} - -func (c *svcgrouplinkinfoServicegroupTsmV1Chainer) Unsubscribe() { - key := "svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com" - if s, ok := subscriptionMap.Load(key); ok { - close(s.(subscription).stop) - subscriptionMap.Delete(key) - } -} - -func (c *svcgrouplinkinfoServicegroupTsmV1Chainer) IsSubscribed() bool { - key := "svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com" - _, ok := subscriptionMap.Load(key) - return ok -} - -// GetAdditionalPolicyDataByName returns object stored in the database under the hashedName which is a hash of display -// name and parents names. Use it when you know hashed name of object. -func (group *PolicypkgTsmV1) GetAdditionalPolicyDataByName(ctx context.Context, hashedName string) (*PolicypkgAdditionalPolicyData, error) { - key := "additionalpolicydatas.policypkg.tsm.tanzu.vmware.com" - if s, ok := subscriptionMap.Load(key); ok { - item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) - if !exists { - return nil, err - } - - result, _ := item.(*basepolicypkgtsmtanzuvmwarecomv1.AdditionalPolicyData) - return &PolicypkgAdditionalPolicyData{ - client: group.client, - AdditionalPolicyData: result, - }, nil - } else { - result, err := group.client.baseClient. - PolicypkgTsmV1(). - AdditionalPolicyDatas().Get(ctx, hashedName, metav1.GetOptions{}) - if err != nil { - return nil, err - } - - return &PolicypkgAdditionalPolicyData{ - client: group.client, - AdditionalPolicyData: result, - }, nil - } -} - -// DeleteAdditionalPolicyDataByName deletes object stored in the database under the hashedName which is a hash of -// display name and parents names. Use it when you know hashed name of object. -func (group *PolicypkgTsmV1) DeleteAdditionalPolicyDataByName(ctx context.Context, hashedName string) (err error) { - - err = group.client.baseClient. - PolicypkgTsmV1(). - AdditionalPolicyDatas().Delete(ctx, hashedName, metav1.DeleteOptions{}) - if err != nil { - return err - } - - return -} - -// CreateAdditionalPolicyDataByName creates object in the database without hashing the name. -// Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *PolicypkgTsmV1) CreateAdditionalPolicyDataByName(ctx context.Context, - objToCreate *basepolicypkgtsmtanzuvmwarecomv1.AdditionalPolicyData) (*PolicypkgAdditionalPolicyData, error) { - if objToCreate.GetLabels() == nil { - objToCreate.Labels = make(map[string]string) - } - if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() - } - - result, err := group.client.baseClient. - PolicypkgTsmV1(). - AdditionalPolicyDatas().Create(ctx, objToCreate, metav1.CreateOptions{}) - if err != nil { - return nil, err - } - - return &PolicypkgAdditionalPolicyData{ - client: group.client, - AdditionalPolicyData: result, - }, nil -} - -// SetAdditionalPolicyDataStatusByName sets user defined status -func (group *PolicypkgTsmV1) SetAdditionalPolicyDataStatusByName(ctx context.Context, - objToUpdate *basepolicypkgtsmtanzuvmwarecomv1.AdditionalPolicyData, status *basepolicypkgtsmtanzuvmwarecomv1.AdditionalStatus) (*PolicypkgAdditionalPolicyData, error) { - - // Make sure status field is present first - m := []byte("{\"status\":{}}") - result, err := group.client.baseClient. - PolicypkgTsmV1(). - AdditionalPolicyDatas().Patch(ctx, objToUpdate.GetName(), types.MergePatchType, m, metav1.PatchOptions{}, "status") - if err != nil { - return nil, err + Path: "/spec/data", + Value: patchValueData, } + patch = append(patch, patchOpData) - patch := Patch{ - PatchOp{ - Op: "replace", - Path: "/status/status", - Value: status, - }, - } - marshaled, err := patch.Marshal() - if err != nil { - return nil, err - } - result, err = group.client.baseClient. - PolicypkgTsmV1(). - AdditionalPolicyDatas().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "status") - if err != nil { - return nil, err - } - return &PolicypkgAdditionalPolicyData{ - client: group.client, - AdditionalPolicyData: result, - }, nil -} - -// UpdateAdditionalPolicyDataByName updates object stored in the database under the hashedName which is a hash of -// display name and parents names. -func (group *PolicypkgTsmV1) UpdateAdditionalPolicyDataByName(ctx context.Context, - objToUpdate *basepolicypkgtsmtanzuvmwarecomv1.AdditionalPolicyData) (*PolicypkgAdditionalPolicyData, error) { - - // ResourceVersion must be set for update - if objToUpdate.ResourceVersion == "" { - current, err := group.client.baseClient. - PolicypkgTsmV1(). - AdditionalPolicyDatas().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) - if err != nil { - return nil, err - } - objToUpdate.ResourceVersion = current.ResourceVersion - } - - var patch Patch - patch = append(patch, PatchOp{ - Op: "replace", - Path: "/metadata", - Value: objToUpdate.ObjectMeta, - }) - - patchValueDescription := - objToUpdate.Spec.Description - patchOpDescription := PatchOp{ + patchValueUserId := + objToUpdate.Spec.UserId + patchOpUserId := PatchOp{ Op: "replace", - Path: "/spec/description", - Value: patchValueDescription, + Path: "/spec/userId", + Value: patchValueUserId, } - patch = append(patch, patchOpDescription) + patch = append(patch, patchOpUserId) marshaled, err := patch.Marshal() if err != nil { return nil, err } result, err := group.client.baseClient. - PolicypkgTsmV1(). - AdditionalPolicyDatas().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + GlobalTsmV1(). + UserPreferences().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") if err != nil { return nil, err } - return &PolicypkgAdditionalPolicyData{ - client: group.client, - AdditionalPolicyData: result, + return &GlobalUserPreference{ + client: group.client, + UserPreference: result, }, nil } -// ListAdditionalPolicyDatas returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *PolicypkgTsmV1) ListAdditionalPolicyDatas(ctx context.Context, - opts metav1.ListOptions) (result []*PolicypkgAdditionalPolicyData, err error) { - key := "additionalpolicydatas.policypkg.tsm.tanzu.vmware.com" +// ListUserPreferences returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListUserPreferences(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalUserPreference, err error) { + key := "userpreferences.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { items := s.(subscription).informer.GetStore().List() - result = make([]*PolicypkgAdditionalPolicyData, len(items)) + result = make([]*GlobalUserPreference, len(items)) for k, v := range items { - item, _ := v.(*basepolicypkgtsmtanzuvmwarecomv1.AdditionalPolicyData) - result[k] = &PolicypkgAdditionalPolicyData{ - client: group.client, - AdditionalPolicyData: item, + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.UserPreference) + result[k] = &GlobalUserPreference{ + client: group.client, + UserPreference: item, } } } else { - list, err := group.client.baseClient.PolicypkgTsmV1(). - AdditionalPolicyDatas().List(ctx, opts) + list, err := group.client.baseClient.GlobalTsmV1(). + UserPreferences().List(ctx, opts) if err != nil { return nil, err } - result = make([]*PolicypkgAdditionalPolicyData, len(list.Items)) + result = make([]*GlobalUserPreference, len(list.Items)) for k, v := range list.Items { item := v - result[k] = &PolicypkgAdditionalPolicyData{ - client: group.client, - AdditionalPolicyData: &item, + result[k] = &GlobalUserPreference{ + client: group.client, + UserPreference: &item, } } } return } -type PolicypkgAdditionalPolicyData struct { +type GlobalUserPreference struct { client *Clientset - *basepolicypkgtsmtanzuvmwarecomv1.AdditionalPolicyData + *baseglobaltsmtanzuvmwarecomv1.UserPreference } // Delete removes obj and all it's children from the database. -func (obj *PolicypkgAdditionalPolicyData) Delete(ctx context.Context) error { - err := obj.client.Policypkg().DeleteAdditionalPolicyDataByName(ctx, obj.GetName()) +func (obj *GlobalUserPreference) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteUserPreferenceByName(ctx, obj.GetName()) if err != nil { return err } - obj.AdditionalPolicyData = nil + obj.UserPreference = nil return nil } // Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *PolicypkgAdditionalPolicyData) Update(ctx context.Context) error { - result, err := obj.client.Policypkg().UpdateAdditionalPolicyDataByName(ctx, obj.AdditionalPolicyData) - if err != nil { - return err - } - obj.AdditionalPolicyData = result.AdditionalPolicyData - return nil -} - -// SetStatus sets user defined status -func (obj *PolicypkgAdditionalPolicyData) SetStatus(ctx context.Context, status *basepolicypkgtsmtanzuvmwarecomv1.AdditionalStatus) error { - result, err := obj.client.Policypkg().SetAdditionalPolicyDataStatusByName(ctx, obj.AdditionalPolicyData, status) - if err != nil { - return err - } - obj.AdditionalPolicyData = result.AdditionalPolicyData - return nil -} - -// GetStatus to get user defined status -func (obj *PolicypkgAdditionalPolicyData) GetStatus(ctx context.Context) (*basepolicypkgtsmtanzuvmwarecomv1.AdditionalStatus, error) { - getObj, err := obj.client.Policypkg().GetAdditionalPolicyDataByName(ctx, obj.GetName()) - if err != nil { - return nil, err - } - return &getObj.Status.Status, nil -} - -// ClearStatus to clear user defined status -func (obj *PolicypkgAdditionalPolicyData) ClearStatus(ctx context.Context) error { - result, err := obj.client.Policypkg().SetAdditionalPolicyDataStatusByName(ctx, obj.AdditionalPolicyData, &basepolicypkgtsmtanzuvmwarecomv1.AdditionalStatus{}) +func (obj *GlobalUserPreference) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateUserPreferenceByName(ctx, obj.UserPreference) if err != nil { return err } - obj.AdditionalPolicyData = result.AdditionalPolicyData + obj.UserPreference = result.UserPreference return nil } -// GetPolicypkgAdditionalPolicyData calculates the hashed name based on parents and displayName and -// returns given object -func (c *Clientset) GetPolicypkgAdditionalPolicyData(ctx context.Context, displayName string) (result *PolicypkgAdditionalPolicyData, err error) { - hashedName := helper.GetHashedName("additionalpolicydatas.policypkg.tsm.tanzu.vmware.com", nil, displayName) - return c.Policypkg().GetAdditionalPolicyDataByName(ctx, hashedName) -} - -func (c *Clientset) PolicypkgAdditionalPolicyData(displayName string) *additionalpolicydataPolicypkgTsmV1Chainer { - parentLabels := make(map[string]string) - parentLabels["additionalpolicydatas.policypkg.tsm.tanzu.vmware.com"] = displayName - return &additionalpolicydataPolicypkgTsmV1Chainer{ - client: c, - name: displayName, - parentLabels: parentLabels, - } -} - -// AddPolicypkgAdditionalPolicyData calculates hashed name of the object based on objToCreate.Name -// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in -// nexus/display_name label and can be obtained using DisplayName() method. -func (c *Clientset) AddPolicypkgAdditionalPolicyData(ctx context.Context, - objToCreate *basepolicypkgtsmtanzuvmwarecomv1.AdditionalPolicyData) (result *PolicypkgAdditionalPolicyData, err error) { - if objToCreate.Labels == nil { - objToCreate.Labels = map[string]string{} - } - if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() - objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName(objToCreate.CRDName(), nil, objToCreate.GetName()) - objToCreate.Name = hashedName - } - return c.Policypkg().CreateAdditionalPolicyDataByName(ctx, objToCreate) -} - -// DeletePolicypkgAdditionalPolicyData calculates hashedName of object based on displayName and -// parents and deletes given object -func (c *Clientset) DeletePolicypkgAdditionalPolicyData(ctx context.Context, displayName string) (err error) { - hashedName := helper.GetHashedName("additionalpolicydatas.policypkg.tsm.tanzu.vmware.com", nil, displayName) - return c.Policypkg().DeleteAdditionalPolicyDataByName(ctx, hashedName) +func (obj *GlobalUserPreference) GetParent(ctx context.Context) (result *GlobalUser, err error) { + hashedName := helper.GetHashedName("users.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["users.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetUserByName(ctx, hashedName) } -type additionalpolicydataPolicypkgTsmV1Chainer struct { +type userpreferenceGlobalTsmV1Chainer struct { client *Clientset name string parentLabels map[string]string } -func (c *additionalpolicydataPolicypkgTsmV1Chainer) Subscribe() { - key := "additionalpolicydatas.policypkg.tsm.tanzu.vmware.com" +func (c *userpreferenceGlobalTsmV1Chainer) Subscribe() { + key := "userpreferences.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informerpolicypkgtsmtanzuvmwarecomv1.NewAdditionalPolicyDataInformer(c.client.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewUserPreferenceInformer(c.client.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } } -func (c *additionalpolicydataPolicypkgTsmV1Chainer) Unsubscribe() { - key := "additionalpolicydatas.policypkg.tsm.tanzu.vmware.com" - if s, ok := subscriptionMap.Load(key); ok { - close(s.(subscription).stop) - subscriptionMap.Delete(key) - } -} - -func (c *additionalpolicydataPolicypkgTsmV1Chainer) IsSubscribed() bool { - key := "additionalpolicydatas.policypkg.tsm.tanzu.vmware.com" - _, ok := subscriptionMap.Load(key) - return ok -} - -// ClearStatus to clear user defined status -func (c *additionalpolicydataPolicypkgTsmV1Chainer) ClearStatus(ctx context.Context) (err error) { - hashedName := helper.GetHashedName("additionalpolicydatas.policypkg.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Policypkg().GetAdditionalPolicyDataByName(ctx, hashedName) - if err != nil { - return err - } - _, err = c.client.Policypkg().SetAdditionalPolicyDataStatusByName(ctx, obj.AdditionalPolicyData, nil) - return err -} - -// GetStatus to get user defined status -func (c *additionalpolicydataPolicypkgTsmV1Chainer) GetStatus(ctx context.Context) (result *basepolicypkgtsmtanzuvmwarecomv1.AdditionalStatus, err error) { - hashedName := helper.GetHashedName("additionalpolicydatas.policypkg.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Policypkg().GetAdditionalPolicyDataByName(ctx, hashedName) - if err != nil { - return nil, err +func (c *userpreferenceGlobalTsmV1Chainer) Unsubscribe() { + key := "userpreferences.global.tsm.tanzu.vmware.com" + if s, ok := subscriptionMap.Load(key); ok { + close(s.(subscription).stop) + subscriptionMap.Delete(key) } - return &obj.Status.Status, nil } -// SetStatus sets user defined status -func (c *additionalpolicydataPolicypkgTsmV1Chainer) SetStatus(ctx context.Context, status *basepolicypkgtsmtanzuvmwarecomv1.AdditionalStatus) (err error) { - hashedName := helper.GetHashedName("additionalpolicydatas.policypkg.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Policypkg().GetAdditionalPolicyDataByName(ctx, hashedName) - if err != nil { - return err - } - _, err = c.client.Policypkg().SetAdditionalPolicyDataStatusByName(ctx, obj.AdditionalPolicyData, status) - return err +func (c *userpreferenceGlobalTsmV1Chainer) IsSubscribed() bool { + key := "userpreferences.global.tsm.tanzu.vmware.com" + _, ok := subscriptionMap.Load(key) + return ok } -// GetAccessControlPolicyByName returns object stored in the database under the hashedName which is a hash of display +// GetUserByName returns object stored in the database under the hashedName which is a hash of display // name and parents names. Use it when you know hashed name of object. -func (group *PolicypkgTsmV1) GetAccessControlPolicyByName(ctx context.Context, hashedName string) (*PolicypkgAccessControlPolicy, error) { - key := "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com" +func (group *GlobalTsmV1) GetUserByName(ctx context.Context, hashedName string) (*GlobalUser, error) { + key := "users.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) if !exists { return nil, err } - result, _ := item.(*basepolicypkgtsmtanzuvmwarecomv1.AccessControlPolicy) - return &PolicypkgAccessControlPolicy{ - client: group.client, - AccessControlPolicy: result, + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.User) + return &GlobalUser{ + client: group.client, + User: result, }, nil } else { result, err := group.client.baseClient. - PolicypkgTsmV1(). - AccessControlPolicies().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + Users().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return nil, err } - return &PolicypkgAccessControlPolicy{ - client: group.client, - AccessControlPolicy: result, + return &GlobalUser{ + client: group.client, + User: result, }, nil } } -// DeleteAccessControlPolicyByName deletes object stored in the database under the hashedName which is a hash of +// DeleteUserByName deletes object stored in the database under the hashedName which is a hash of // display name and parents names. Use it when you know hashed name of object. -func (group *PolicypkgTsmV1) DeleteAccessControlPolicyByName(ctx context.Context, hashedName string) (err error) { +func (group *GlobalTsmV1) DeleteUserByName(ctx context.Context, hashedName string) (err error) { result, err := group.client.baseClient. - PolicypkgTsmV1(). - AccessControlPolicies().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + Users().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return err } - for _, v := range result.Spec.PolicyConfigsGvk { + for _, v := range result.Spec.PreferencesGvk { err := group.client. - Policypkg().DeleteACPConfigByName(ctx, v.Name) + Global().DeleteUserPreferenceByName(ctx, v.Name) if err != nil { return err } } err = group.client.baseClient. - PolicypkgTsmV1(). - AccessControlPolicies().Delete(ctx, hashedName, metav1.DeleteOptions{}) + GlobalTsmV1(). + Users().Delete(ctx, hashedName, metav1.DeleteOptions{}) if err != nil { return err } @@ -6336,7 +89731,7 @@ func (group *PolicypkgTsmV1) DeleteAccessControlPolicyByName(ctx context.Context patchOp := PatchOp{ Op: "remove", - Path: "/spec/gnsAccessControlPolicyGvk", + Path: "/spec/usersGvk/" + result.DisplayName(), } patch = append(patch, patchOp) @@ -6348,16 +89743,16 @@ func (group *PolicypkgTsmV1) DeleteAccessControlPolicyByName(ctx context.Context if parents == nil { parents = make(map[string]string) } - parentName, ok := parents["gnses.gns.tsm.tanzu.vmware.com"] + parentName, ok := parents["userfolders.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if parents[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", parents, parentName) + parentName = helper.GetHashedName("userfolders.global.tsm.tanzu.vmware.com", parents, parentName) } _, err = group.client.baseClient. - GnsTsmV1(). - Gnses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + UserFolders().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err } @@ -6365,10 +89760,10 @@ func (group *PolicypkgTsmV1) DeleteAccessControlPolicyByName(ctx context.Context return } -// CreateAccessControlPolicyByName creates object in the database without hashing the name. +// CreateUserByName creates object in the database without hashing the name. // Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *PolicypkgTsmV1) CreateAccessControlPolicyByName(ctx context.Context, - objToCreate *basepolicypkgtsmtanzuvmwarecomv1.AccessControlPolicy) (*PolicypkgAccessControlPolicy, error) { +func (group *GlobalTsmV1) CreateUserByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.User) (*GlobalUser, error) { if objToCreate.GetLabels() == nil { objToCreate.Labels = make(map[string]string) } @@ -6376,61 +89771,47 @@ func (group *PolicypkgTsmV1) CreateAccessControlPolicyByName(ctx context.Context objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() } - objToCreate.Spec.PolicyConfigsGvk = nil + objToCreate.Spec.PreferencesGvk = nil result, err := group.client.baseClient. - PolicypkgTsmV1(). - AccessControlPolicies().Create(ctx, objToCreate, metav1.CreateOptions{}) + GlobalTsmV1(). + Users().Create(ctx, objToCreate, metav1.CreateOptions{}) if err != nil { return nil, err } - parentName, ok := objToCreate.GetLabels()["gnses.gns.tsm.tanzu.vmware.com"] + parentName, ok := objToCreate.GetLabels()["userfolders.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + parentName = helper.GetHashedName("userfolders.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) } - var patch Patch - patchOp := PatchOp{ - Op: "replace", - Path: "/spec/gnsAccessControlPolicyGvk", - Value: basepolicypkgtsmtanzuvmwarecomv1.Child{ - Group: "policypkg.tsm.tanzu.vmware.com", - Kind: "AccessControlPolicy", - Name: objToCreate.Name, - }, - } - patch = append(patch, patchOp) - marshaled, err := patch.Marshal() - if err != nil { - return nil, err - } + payload := "{\"spec\": {\"usersGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"User\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" _, err = group.client.baseClient. - GnsTsmV1(). - Gnses().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + UserFolders().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) if err != nil { return nil, err } - return &PolicypkgAccessControlPolicy{ - client: group.client, - AccessControlPolicy: result, + return &GlobalUser{ + client: group.client, + User: result, }, nil } -// UpdateAccessControlPolicyByName updates object stored in the database under the hashedName which is a hash of +// UpdateUserByName updates object stored in the database under the hashedName which is a hash of // display name and parents names. -func (group *PolicypkgTsmV1) UpdateAccessControlPolicyByName(ctx context.Context, - objToUpdate *basepolicypkgtsmtanzuvmwarecomv1.AccessControlPolicy) (*PolicypkgAccessControlPolicy, error) { +func (group *GlobalTsmV1) UpdateUserByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.User) (*GlobalUser, error) { // ResourceVersion must be set for update if objToUpdate.ResourceVersion == "" { current, err := group.client.baseClient. - PolicypkgTsmV1(). - AccessControlPolicies().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + GlobalTsmV1(). + Users().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) if err != nil { return nil, err } @@ -6444,91 +89825,138 @@ func (group *PolicypkgTsmV1) UpdateAccessControlPolicyByName(ctx context.Context Value: objToUpdate.ObjectMeta, }) + patchValueUsername := + objToUpdate.Spec.Username + patchOpUsername := PatchOp{ + Op: "replace", + Path: "/spec/username", + Value: patchValueUsername, + } + patch = append(patch, patchOpUsername) + + patchValuePassword := + objToUpdate.Spec.Password + patchOpPassword := PatchOp{ + Op: "replace", + Path: "/spec/password", + Value: patchValuePassword, + } + patch = append(patch, patchOpPassword) + + patchValueEmail := + objToUpdate.Spec.Email + patchOpEmail := PatchOp{ + Op: "replace", + Path: "/spec/email", + Value: patchValueEmail, + } + patch = append(patch, patchOpEmail) + + if objToUpdate.Spec.AccessTokens != nil { + patchValueAccessTokens := + objToUpdate.Spec.AccessTokens + patchOpAccessTokens := PatchOp{ + Op: "replace", + Path: "/spec/accessTokens", + Value: patchValueAccessTokens, + } + patch = append(patch, patchOpAccessTokens) + } + + patchValueLastActionDate := + objToUpdate.Spec.LastActionDate + patchOpLastActionDate := PatchOp{ + Op: "replace", + Path: "/spec/lastActionDate", + Value: patchValueLastActionDate, + } + patch = append(patch, patchOpLastActionDate) + marshaled, err := patch.Marshal() if err != nil { return nil, err } result, err := group.client.baseClient. - PolicypkgTsmV1(). - AccessControlPolicies().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + GlobalTsmV1(). + Users().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") if err != nil { return nil, err } - return &PolicypkgAccessControlPolicy{ - client: group.client, - AccessControlPolicy: result, + return &GlobalUser{ + client: group.client, + User: result, }, nil } -// ListAccessControlPolicies returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *PolicypkgTsmV1) ListAccessControlPolicies(ctx context.Context, - opts metav1.ListOptions) (result []*PolicypkgAccessControlPolicy, err error) { - key := "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com" +// ListUsers returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListUsers(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalUser, err error) { + key := "users.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { items := s.(subscription).informer.GetStore().List() - result = make([]*PolicypkgAccessControlPolicy, len(items)) + result = make([]*GlobalUser, len(items)) for k, v := range items { - item, _ := v.(*basepolicypkgtsmtanzuvmwarecomv1.AccessControlPolicy) - result[k] = &PolicypkgAccessControlPolicy{ - client: group.client, - AccessControlPolicy: item, + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.User) + result[k] = &GlobalUser{ + client: group.client, + User: item, } } } else { - list, err := group.client.baseClient.PolicypkgTsmV1(). - AccessControlPolicies().List(ctx, opts) + list, err := group.client.baseClient.GlobalTsmV1(). + Users().List(ctx, opts) if err != nil { return nil, err } - result = make([]*PolicypkgAccessControlPolicy, len(list.Items)) + result = make([]*GlobalUser, len(list.Items)) for k, v := range list.Items { item := v - result[k] = &PolicypkgAccessControlPolicy{ - client: group.client, - AccessControlPolicy: &item, + result[k] = &GlobalUser{ + client: group.client, + User: &item, } } } return } -type PolicypkgAccessControlPolicy struct { +type GlobalUser struct { client *Clientset - *basepolicypkgtsmtanzuvmwarecomv1.AccessControlPolicy + *baseglobaltsmtanzuvmwarecomv1.User } // Delete removes obj and all it's children from the database. -func (obj *PolicypkgAccessControlPolicy) Delete(ctx context.Context) error { - err := obj.client.Policypkg().DeleteAccessControlPolicyByName(ctx, obj.GetName()) +func (obj *GlobalUser) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteUserByName(ctx, obj.GetName()) if err != nil { return err } - obj.AccessControlPolicy = nil + obj.User = nil return nil } // Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *PolicypkgAccessControlPolicy) Update(ctx context.Context) error { - result, err := obj.client.Policypkg().UpdateAccessControlPolicyByName(ctx, obj.AccessControlPolicy) +func (obj *GlobalUser) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateUserByName(ctx, obj.User) if err != nil { return err } - obj.AccessControlPolicy = result.AccessControlPolicy + obj.User = result.User return nil } -func (obj *PolicypkgAccessControlPolicy) GetParent(ctx context.Context) (result *GnsGns, err error) { - hashedName := helper.GetHashedName("gnses.gns.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["gnses.gns.tsm.tanzu.vmware.com"]) - return obj.client.Gns().GetGnsByName(ctx, hashedName) +func (obj *GlobalUser) GetParent(ctx context.Context) (result *GlobalUserFolder, err error) { + hashedName := helper.GetHashedName("userfolders.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["userfolders.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetUserFolderByName(ctx, hashedName) } -// GetAllPolicyConfigs returns all children of given type -func (obj *PolicypkgAccessControlPolicy) GetAllPolicyConfigs(ctx context.Context) ( - result []*PolicypkgACPConfig, err error) { - result = make([]*PolicypkgACPConfig, 0, len(obj.Spec.PolicyConfigsGvk)) - for _, v := range obj.Spec.PolicyConfigsGvk { - l, err := obj.client.Policypkg().GetACPConfigByName(ctx, v.Name) +// GetAllPreferences returns all children of given type +func (obj *GlobalUser) GetAllPreferences(ctx context.Context) ( + result []*GlobalUserPreference, err error) { + result = make([]*GlobalUserPreference, 0, len(obj.Spec.PreferencesGvk)) + for _, v := range obj.Spec.PreferencesGvk { + l, err := obj.client.Global().GetUserPreferenceByName(ctx, v.Name) if err != nil { return nil, err } @@ -6537,111 +89965,111 @@ func (obj *PolicypkgAccessControlPolicy) GetAllPolicyConfigs(ctx context.Context return } -// GetPolicyConfigs returns child which has given displayName -func (obj *PolicypkgAccessControlPolicy) GetPolicyConfigs(ctx context.Context, - displayName string) (result *PolicypkgACPConfig, err error) { - l, ok := obj.Spec.PolicyConfigsGvk[displayName] +// GetPreferences returns child which has given displayName +func (obj *GlobalUser) GetPreferences(ctx context.Context, + displayName string) (result *GlobalUserPreference, err error) { + l, ok := obj.Spec.PreferencesGvk[displayName] if !ok { - return nil, NewChildNotFound(obj.DisplayName(), "Policypkg.AccessControlPolicy", "PolicyConfigs", displayName) + return nil, NewChildNotFound(obj.DisplayName(), "Global.User", "Preferences", displayName) } - result, err = obj.client.Policypkg().GetACPConfigByName(ctx, l.Name) + result, err = obj.client.Global().GetUserPreferenceByName(ctx, l.Name) return } -// AddPolicyConfigs calculates hashed name of the child to create based on objToCreate.Name +// AddPreferences calculates hashed name of the child to create based on objToCreate.Name // and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in // nexus/display_name label and can be obtained using DisplayName() method. -func (obj *PolicypkgAccessControlPolicy) AddPolicyConfigs(ctx context.Context, - objToCreate *basepolicypkgtsmtanzuvmwarecomv1.ACPConfig) (result *PolicypkgACPConfig, err error) { +func (obj *GlobalUser) AddPreferences(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.UserPreference) (result *GlobalUserPreference, err error) { if objToCreate.Labels == nil { objToCreate.Labels = map[string]string{} } - for _, v := range helper.GetCRDParentsMap()["accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com"] { + for _, v := range helper.GetCRDParentsMap()["users.global.tsm.tanzu.vmware.com"] { objToCreate.Labels[v] = obj.Labels[v] } - objToCreate.Labels["accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com"] = obj.DisplayName() + objToCreate.Labels["users.global.tsm.tanzu.vmware.com"] = obj.DisplayName() if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" hashedName := helper.GetHashedName(objToCreate.CRDName(), objToCreate.Labels, objToCreate.GetName()) objToCreate.Name = hashedName } - result, err = obj.client.Policypkg().CreateACPConfigByName(ctx, objToCreate) - updatedObj, getErr := obj.client.Policypkg().GetAccessControlPolicyByName(ctx, obj.GetName()) + result, err = obj.client.Global().CreateUserPreferenceByName(ctx, objToCreate) + updatedObj, getErr := obj.client.Global().GetUserByName(ctx, obj.GetName()) if getErr == nil { - obj.AccessControlPolicy = updatedObj.AccessControlPolicy + obj.User = updatedObj.User } return } -// DeletePolicyConfigs calculates hashed name of the child to delete based on displayName +// DeletePreferences calculates hashed name of the child to delete based on displayName // and parents names and deletes it. -func (obj *PolicypkgAccessControlPolicy) DeletePolicyConfigs(ctx context.Context, displayName string) (err error) { - l, ok := obj.Spec.PolicyConfigsGvk[displayName] +func (obj *GlobalUser) DeletePreferences(ctx context.Context, displayName string) (err error) { + l, ok := obj.Spec.PreferencesGvk[displayName] if !ok { - return NewChildNotFound(obj.DisplayName(), "Policypkg.AccessControlPolicy", "PolicyConfigs", displayName) + return NewChildNotFound(obj.DisplayName(), "Global.User", "Preferences", displayName) } - err = obj.client.Policypkg().DeleteACPConfigByName(ctx, l.Name) + err = obj.client.Global().DeleteUserPreferenceByName(ctx, l.Name) if err != nil { return err } - updatedObj, err := obj.client.Policypkg().GetAccessControlPolicyByName(ctx, obj.GetName()) + updatedObj, err := obj.client.Global().GetUserByName(ctx, obj.GetName()) if err == nil { - obj.AccessControlPolicy = updatedObj.AccessControlPolicy + obj.User = updatedObj.User } return } -type accesscontrolpolicyPolicypkgTsmV1Chainer struct { +type userGlobalTsmV1Chainer struct { client *Clientset name string parentLabels map[string]string } -func (c *accesscontrolpolicyPolicypkgTsmV1Chainer) Subscribe() { - key := "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com" +func (c *userGlobalTsmV1Chainer) Subscribe() { + key := "users.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informerpolicypkgtsmtanzuvmwarecomv1.NewAccessControlPolicyInformer(c.client.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewUserInformer(c.client.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } } -func (c *accesscontrolpolicyPolicypkgTsmV1Chainer) Unsubscribe() { - key := "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com" +func (c *userGlobalTsmV1Chainer) Unsubscribe() { + key := "users.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { close(s.(subscription).stop) subscriptionMap.Delete(key) } } -func (c *accesscontrolpolicyPolicypkgTsmV1Chainer) IsSubscribed() bool { - key := "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com" +func (c *userGlobalTsmV1Chainer) IsSubscribed() bool { + key := "users.global.tsm.tanzu.vmware.com" _, ok := subscriptionMap.Load(key) return ok } -func (c *accesscontrolpolicyPolicypkgTsmV1Chainer) PolicyConfigs(name string) *acpconfigPolicypkgTsmV1Chainer { +func (c *userGlobalTsmV1Chainer) Preferences(name string) *userpreferenceGlobalTsmV1Chainer { parentLabels := c.parentLabels - parentLabels["acpconfigs.policypkg.tsm.tanzu.vmware.com"] = name - return &acpconfigPolicypkgTsmV1Chainer{ + parentLabels["userpreferences.global.tsm.tanzu.vmware.com"] = name + return &userpreferenceGlobalTsmV1Chainer{ client: c.client, name: name, parentLabels: parentLabels, } } -// GetPolicyConfigs calculates hashed name of the object based on displayName and it's parents and returns the object -func (c *accesscontrolpolicyPolicypkgTsmV1Chainer) GetPolicyConfigs(ctx context.Context, displayName string) (result *PolicypkgACPConfig, err error) { - hashedName := helper.GetHashedName("acpconfigs.policypkg.tsm.tanzu.vmware.com", c.parentLabels, displayName) - return c.client.Policypkg().GetACPConfigByName(ctx, hashedName) +// GetPreferences calculates hashed name of the object based on displayName and it's parents and returns the object +func (c *userGlobalTsmV1Chainer) GetPreferences(ctx context.Context, displayName string) (result *GlobalUserPreference, err error) { + hashedName := helper.GetHashedName("userpreferences.global.tsm.tanzu.vmware.com", c.parentLabels, displayName) + return c.client.Global().GetUserPreferenceByName(ctx, hashedName) } -// AddPolicyConfigs calculates hashed name of the child to create based on objToCreate.Name +// AddPreferences calculates hashed name of the child to create based on objToCreate.Name // and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in // nexus/display_name label and can be obtained using DisplayName() method. -func (c *accesscontrolpolicyPolicypkgTsmV1Chainer) AddPolicyConfigs(ctx context.Context, - objToCreate *basepolicypkgtsmtanzuvmwarecomv1.ACPConfig) (result *PolicypkgACPConfig, err error) { +func (c *userGlobalTsmV1Chainer) AddPreferences(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.UserPreference) (result *GlobalUserPreference, err error) { if objToCreate.Labels == nil { objToCreate.Labels = map[string]string{} } @@ -6651,67 +90079,67 @@ func (c *accesscontrolpolicyPolicypkgTsmV1Chainer) AddPolicyConfigs(ctx context. if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("acpconfigs.policypkg.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) + hashedName := helper.GetHashedName("userpreferences.global.tsm.tanzu.vmware.com", c.parentLabels, objToCreate.GetName()) objToCreate.Name = hashedName } - return c.client.Policypkg().CreateACPConfigByName(ctx, objToCreate) + return c.client.Global().CreateUserPreferenceByName(ctx, objToCreate) } -// DeletePolicyConfigs calculates hashed name of the child to delete based on displayName +// DeletePreferences calculates hashed name of the child to delete based on displayName // and parents names and deletes it. -func (c *accesscontrolpolicyPolicypkgTsmV1Chainer) DeletePolicyConfigs(ctx context.Context, name string) (err error) { +func (c *userGlobalTsmV1Chainer) DeletePreferences(ctx context.Context, name string) (err error) { if c.parentLabels == nil { c.parentLabels = map[string]string{} } c.parentLabels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName("acpconfigs.policypkg.tsm.tanzu.vmware.com", c.parentLabels, name) - return c.client.Policypkg().DeleteACPConfigByName(ctx, hashedName) + hashedName := helper.GetHashedName("userpreferences.global.tsm.tanzu.vmware.com", c.parentLabels, name) + return c.client.Global().DeleteUserPreferenceByName(ctx, hashedName) } -// GetACPConfigByName returns object stored in the database under the hashedName which is a hash of display +// GetVirtualServiceByName returns object stored in the database under the hashedName which is a hash of display // name and parents names. Use it when you know hashed name of object. -func (group *PolicypkgTsmV1) GetACPConfigByName(ctx context.Context, hashedName string) (*PolicypkgACPConfig, error) { - key := "acpconfigs.policypkg.tsm.tanzu.vmware.com" +func (group *GlobalTsmV1) GetVirtualServiceByName(ctx context.Context, hashedName string) (*GlobalVirtualService, error) { + key := "virtualservices.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) if !exists { return nil, err } - result, _ := item.(*basepolicypkgtsmtanzuvmwarecomv1.ACPConfig) - return &PolicypkgACPConfig{ - client: group.client, - ACPConfig: result, + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.VirtualService) + return &GlobalVirtualService{ + client: group.client, + VirtualService: result, }, nil } else { result, err := group.client.baseClient. - PolicypkgTsmV1(). - ACPConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + VirtualServices().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return nil, err } - return &PolicypkgACPConfig{ - client: group.client, - ACPConfig: result, + return &GlobalVirtualService{ + client: group.client, + VirtualService: result, }, nil } } -// DeleteACPConfigByName deletes object stored in the database under the hashedName which is a hash of +// DeleteVirtualServiceByName deletes object stored in the database under the hashedName which is a hash of // display name and parents names. Use it when you know hashed name of object. -func (group *PolicypkgTsmV1) DeleteACPConfigByName(ctx context.Context, hashedName string) (err error) { +func (group *GlobalTsmV1) DeleteVirtualServiceByName(ctx context.Context, hashedName string) (err error) { result, err := group.client.baseClient. - PolicypkgTsmV1(). - ACPConfigs().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + VirtualServices().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return err } err = group.client.baseClient. - PolicypkgTsmV1(). - ACPConfigs().Delete(ctx, hashedName, metav1.DeleteOptions{}) + GlobalTsmV1(). + VirtualServices().Delete(ctx, hashedName, metav1.DeleteOptions{}) if err != nil { return err } @@ -6720,7 +90148,7 @@ func (group *PolicypkgTsmV1) DeleteACPConfigByName(ctx context.Context, hashedNa patchOp := PatchOp{ Op: "remove", - Path: "/spec/policyConfigsGvk/" + result.DisplayName(), + Path: "/spec/virtualServicesGvk/" + result.DisplayName(), } patch = append(patch, patchOp) @@ -6732,16 +90160,16 @@ func (group *PolicypkgTsmV1) DeleteACPConfigByName(ctx context.Context, hashedNa if parents == nil { parents = make(map[string]string) } - parentName, ok := parents["accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com"] + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if parents[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com", parents, parentName) + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) } _, err = group.client.baseClient. - PolicypkgTsmV1(). - AccessControlPolicies().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err } @@ -6749,10 +90177,10 @@ func (group *PolicypkgTsmV1) DeleteACPConfigByName(ctx context.Context, hashedNa return } -// CreateACPConfigByName creates object in the database without hashing the name. +// CreateVirtualServiceByName creates object in the database without hashing the name. // Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *PolicypkgTsmV1) CreateACPConfigByName(ctx context.Context, - objToCreate *basepolicypkgtsmtanzuvmwarecomv1.ACPConfig) (*PolicypkgACPConfig, error) { +func (group *GlobalTsmV1) CreateVirtualServiceByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.VirtualService) (*GlobalVirtualService, error) { if objToCreate.GetLabels() == nil { objToCreate.Labels = make(map[string]string) } @@ -6760,84 +90188,49 @@ func (group *PolicypkgTsmV1) CreateACPConfigByName(ctx context.Context, objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() } - objToCreate.Spec.DestSvcGroupsGvk = nil - objToCreate.Spec.SourceSvcGroupsGvk = nil + objToCreate.Spec.DestinationRulesGvk = nil + objToCreate.Spec.ServicesGvk = nil + objToCreate.Spec.GatewaysGvk = nil result, err := group.client.baseClient. - PolicypkgTsmV1(). - ACPConfigs().Create(ctx, objToCreate, metav1.CreateOptions{}) + GlobalTsmV1(). + VirtualServices().Create(ctx, objToCreate, metav1.CreateOptions{}) if err != nil { return nil, err } - parentName, ok := objToCreate.GetLabels()["accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com"] + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) } - payload := "{\"spec\": {\"policyConfigsGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"ACPConfig\", \"group\": \"policypkg.tsm.tanzu.vmware.com\"}}}}" + payload := "{\"spec\": {\"virtualServicesGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"VirtualService\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" _, err = group.client.baseClient. - PolicypkgTsmV1(). - AccessControlPolicies().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) - if err != nil { - return nil, err - } - - return &PolicypkgACPConfig{ - client: group.client, - ACPConfig: result, - }, nil -} - -// SetACPConfigStatusByName sets user defined status -func (group *PolicypkgTsmV1) SetACPConfigStatusByName(ctx context.Context, - objToUpdate *basepolicypkgtsmtanzuvmwarecomv1.ACPConfig, status *basepolicypkgtsmtanzuvmwarecomv1.ACPStatus) (*PolicypkgACPConfig, error) { - - // Make sure status field is present first - m := []byte("{\"status\":{}}") - result, err := group.client.baseClient. - PolicypkgTsmV1(). - ACPConfigs().Patch(ctx, objToUpdate.GetName(), types.MergePatchType, m, metav1.PatchOptions{}, "status") + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) if err != nil { return nil, err } - patch := Patch{ - PatchOp{ - Op: "replace", - Path: "/status/status", - Value: status, - }, - } - marshaled, err := patch.Marshal() - if err != nil { - return nil, err - } - result, err = group.client.baseClient. - PolicypkgTsmV1(). - ACPConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "status") - if err != nil { - return nil, err - } - return &PolicypkgACPConfig{ - client: group.client, - ACPConfig: result, + return &GlobalVirtualService{ + client: group.client, + VirtualService: result, }, nil } -// UpdateACPConfigByName updates object stored in the database under the hashedName which is a hash of +// UpdateVirtualServiceByName updates object stored in the database under the hashedName which is a hash of // display name and parents names. -func (group *PolicypkgTsmV1) UpdateACPConfigByName(ctx context.Context, - objToUpdate *basepolicypkgtsmtanzuvmwarecomv1.ACPConfig) (*PolicypkgACPConfig, error) { +func (group *GlobalTsmV1) UpdateVirtualServiceByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.VirtualService) (*GlobalVirtualService, error) { // ResourceVersion must be set for update if objToUpdate.ResourceVersion == "" { current, err := group.client.baseClient. - PolicypkgTsmV1(). - ACPConfigs().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + GlobalTsmV1(). + VirtualServices().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) if err != nil { return nil, err } @@ -6851,62 +90244,114 @@ func (group *PolicypkgTsmV1) UpdateACPConfigByName(ctx context.Context, Value: objToUpdate.ObjectMeta, }) - patchValueDisplayName := - objToUpdate.Spec.DisplayName - patchOpDisplayName := PatchOp{ + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ Op: "replace", - Path: "/spec/displayName", - Value: patchValueDisplayName, + Path: "/spec/name", + Value: patchValueName, } - patch = append(patch, patchOpDisplayName) + patch = append(patch, patchOpName) - patchValueGns := - objToUpdate.Spec.Gns - patchOpGns := PatchOp{ + patchValueCreationTimestamp := + objToUpdate.Spec.CreationTimestamp + patchOpCreationTimestamp := PatchOp{ Op: "replace", - Path: "/spec/gns", - Value: patchValueGns, + Path: "/spec/creationTimestamp", + Value: patchValueCreationTimestamp, } - patch = append(patch, patchOpGns) + patch = append(patch, patchOpCreationTimestamp) - patchValueDescription := - objToUpdate.Spec.Description - patchOpDescription := PatchOp{ + patchValueApiLink := + objToUpdate.Spec.ApiLink + patchOpApiLink := PatchOp{ Op: "replace", - Path: "/spec/description", - Value: patchValueDescription, + Path: "/spec/apiLink", + Value: patchValueApiLink, } - patch = append(patch, patchOpDescription) + patch = append(patch, patchOpApiLink) - if objToUpdate.Spec.Tags != nil { - patchValueTags := - objToUpdate.Spec.Tags - patchOpTags := PatchOp{ - Op: "replace", - Path: "/spec/tags", - Value: patchValueTags, - } - patch = append(patch, patchOpTags) + patchValueUid := + objToUpdate.Spec.Uid + patchOpUid := PatchOp{ + Op: "replace", + Path: "/spec/uid", + Value: patchValueUid, } + patch = append(patch, patchOpUid) - patchValueProjectId := - objToUpdate.Spec.ProjectId - patchOpProjectId := PatchOp{ + patchValueAnnotations := + objToUpdate.Spec.Annotations + patchOpAnnotations := PatchOp{ Op: "replace", - Path: "/spec/projectId", - Value: patchValueProjectId, + Path: "/spec/annotations", + Value: patchValueAnnotations, } - patch = append(patch, patchOpProjectId) + patch = append(patch, patchOpAnnotations) - if objToUpdate.Spec.Conditions != nil { - patchValueConditions := - objToUpdate.Spec.Conditions - patchOpConditions := PatchOp{ + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, + } + patch = append(patch, patchOpLabels) + + patchValueHosts := + objToUpdate.Spec.Hosts + patchOpHosts := PatchOp{ + Op: "replace", + Path: "/spec/hosts", + Value: patchValueHosts, + } + patch = append(patch, patchOpHosts) + + patchValueHttp := + objToUpdate.Spec.Http + patchOpHttp := PatchOp{ + Op: "replace", + Path: "/spec/http", + Value: patchValueHttp, + } + patch = append(patch, patchOpHttp) + + patchValueTls := + objToUpdate.Spec.Tls + patchOpTls := PatchOp{ + Op: "replace", + Path: "/spec/tls", + Value: patchValueTls, + } + patch = append(patch, patchOpTls) + + patchValueTcp := + objToUpdate.Spec.Tcp + patchOpTcp := PatchOp{ + Op: "replace", + Path: "/spec/tcp", + Value: patchValueTcp, + } + patch = append(patch, patchOpTcp) + + patchValueGatewayNames := + objToUpdate.Spec.GatewayNames + patchOpGatewayNames := PatchOp{ + Op: "replace", + Path: "/spec/gatewayNames", + Value: patchValueGatewayNames, + } + patch = append(patch, patchOpGatewayNames) + + if objToUpdate.Spec.ExportTo != nil { + patchValueExportTo := + objToUpdate.Spec.ExportTo + patchOpExportTo := PatchOp{ Op: "replace", - Path: "/spec/conditions", - Value: patchValueConditions, + Path: "/spec/exportTo", + Value: patchValueExportTo, } - patch = append(patch, patchOpConditions) + patch = append(patch, patchOpExportTo) } marshaled, err := patch.Marshal() @@ -6914,115 +90359,150 @@ func (group *PolicypkgTsmV1) UpdateACPConfigByName(ctx context.Context, return nil, err } result, err := group.client.baseClient. - PolicypkgTsmV1(). - ACPConfigs().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + GlobalTsmV1(). + VirtualServices().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") if err != nil { return nil, err } - return &PolicypkgACPConfig{ - client: group.client, - ACPConfig: result, + return &GlobalVirtualService{ + client: group.client, + VirtualService: result, }, nil } -// ListACPConfigs returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *PolicypkgTsmV1) ListACPConfigs(ctx context.Context, - opts metav1.ListOptions) (result []*PolicypkgACPConfig, err error) { - key := "acpconfigs.policypkg.tsm.tanzu.vmware.com" +// ListVirtualServices returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListVirtualServices(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalVirtualService, err error) { + key := "virtualservices.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { items := s.(subscription).informer.GetStore().List() - result = make([]*PolicypkgACPConfig, len(items)) + result = make([]*GlobalVirtualService, len(items)) for k, v := range items { - item, _ := v.(*basepolicypkgtsmtanzuvmwarecomv1.ACPConfig) - result[k] = &PolicypkgACPConfig{ - client: group.client, - ACPConfig: item, + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.VirtualService) + result[k] = &GlobalVirtualService{ + client: group.client, + VirtualService: item, } } } else { - list, err := group.client.baseClient.PolicypkgTsmV1(). - ACPConfigs().List(ctx, opts) + list, err := group.client.baseClient.GlobalTsmV1(). + VirtualServices().List(ctx, opts) if err != nil { return nil, err } - result = make([]*PolicypkgACPConfig, len(list.Items)) + result = make([]*GlobalVirtualService, len(list.Items)) for k, v := range list.Items { item := v - result[k] = &PolicypkgACPConfig{ - client: group.client, - ACPConfig: &item, + result[k] = &GlobalVirtualService{ + client: group.client, + VirtualService: &item, } } } return } -type PolicypkgACPConfig struct { +type GlobalVirtualService struct { client *Clientset - *basepolicypkgtsmtanzuvmwarecomv1.ACPConfig + *baseglobaltsmtanzuvmwarecomv1.VirtualService } // Delete removes obj and all it's children from the database. -func (obj *PolicypkgACPConfig) Delete(ctx context.Context) error { - err := obj.client.Policypkg().DeleteACPConfigByName(ctx, obj.GetName()) +func (obj *GlobalVirtualService) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteVirtualServiceByName(ctx, obj.GetName()) if err != nil { return err } - obj.ACPConfig = nil + obj.VirtualService = nil return nil } // Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *PolicypkgACPConfig) Update(ctx context.Context) error { - result, err := obj.client.Policypkg().UpdateACPConfigByName(ctx, obj.ACPConfig) +func (obj *GlobalVirtualService) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateVirtualServiceByName(ctx, obj.VirtualService) if err != nil { return err } - obj.ACPConfig = result.ACPConfig + obj.VirtualService = result.VirtualService return nil } -// SetStatus sets user defined status -func (obj *PolicypkgACPConfig) SetStatus(ctx context.Context, status *basepolicypkgtsmtanzuvmwarecomv1.ACPStatus) error { - result, err := obj.client.Policypkg().SetACPConfigStatusByName(ctx, obj.ACPConfig, status) +func (obj *GlobalVirtualService) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) +} + +// GetAllDestinationRules returns all links of given type +func (obj *GlobalVirtualService) GetAllDestinationRules(ctx context.Context) ( + result []*GlobalDestinationRule, err error) { + result = make([]*GlobalDestinationRule, 0, len(obj.Spec.DestinationRulesGvk)) + for _, v := range obj.Spec.DestinationRulesGvk { + l, err := obj.client.Global().GetDestinationRuleByName(ctx, v.Name) + if err != nil { + return nil, err + } + result = append(result, l) + } + return +} + +// GetDestinationRules returns link which has given displayName +func (obj *GlobalVirtualService) GetDestinationRules(ctx context.Context, + displayName string) (result *GlobalDestinationRule, err error) { + l, ok := obj.Spec.DestinationRulesGvk[displayName] + if !ok { + return nil, NewLinkNotFound(obj.DisplayName(), "Global.VirtualService", "DestinationRules", displayName) + } + result, err = obj.client.Global().GetDestinationRuleByName(ctx, l.Name) + return +} + +// LinkDestinationRules links obj with linkToAdd object. This function doesn't create linked object, it must be +// already created. +func (obj *GlobalVirtualService) LinkDestinationRules(ctx context.Context, + linkToAdd *GlobalDestinationRule) error { + + payload := "{\"spec\": {\"destinationRulesGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"DestinationRule\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().VirtualServices().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) if err != nil { return err } - obj.ACPConfig = result.ACPConfig + + obj.VirtualService = result return nil } -// GetStatus to get user defined status -func (obj *PolicypkgACPConfig) GetStatus(ctx context.Context) (*basepolicypkgtsmtanzuvmwarecomv1.ACPStatus, error) { - getObj, err := obj.client.Policypkg().GetACPConfigByName(ctx, obj.GetName()) - if err != nil { - return nil, err +// UnlinkDestinationRules unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalVirtualService) UnlinkDestinationRules(ctx context.Context, + linkToRemove *GlobalDestinationRule) (err error) { + var patch Patch + + patchOp := PatchOp{ + Op: "remove", + Path: "/spec/destinationRulesGvk/" + linkToRemove.DisplayName(), } - return &getObj.Status.Status, nil -} -// ClearStatus to clear user defined status -func (obj *PolicypkgACPConfig) ClearStatus(ctx context.Context) error { - result, err := obj.client.Policypkg().SetACPConfigStatusByName(ctx, obj.ACPConfig, &basepolicypkgtsmtanzuvmwarecomv1.ACPStatus{}) + patch = append(patch, patchOp) + marshaled, err := patch.Marshal() if err != nil { return err } - obj.ACPConfig = result.ACPConfig + result, err := obj.client.baseClient.GlobalTsmV1().VirtualServices().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + if err != nil { + return err + } + obj.VirtualService = result return nil -} -func (obj *PolicypkgACPConfig) GetParent(ctx context.Context) (result *PolicypkgAccessControlPolicy, err error) { - hashedName := helper.GetHashedName("accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com"]) - return obj.client.Policypkg().GetAccessControlPolicyByName(ctx, hashedName) } -// GetAllDestSvcGroups returns all links of given type -func (obj *PolicypkgACPConfig) GetAllDestSvcGroups(ctx context.Context) ( - result []*ServicegroupSvcGroup, err error) { - result = make([]*ServicegroupSvcGroup, 0, len(obj.Spec.DestSvcGroupsGvk)) - for _, v := range obj.Spec.DestSvcGroupsGvk { - l, err := obj.client.Servicegroup().GetSvcGroupByName(ctx, v.Name) +// GetAllServices returns all links of given type +func (obj *GlobalVirtualService) GetAllServices(ctx context.Context) ( + result []*GlobalService, err error) { + result = make([]*GlobalService, 0, len(obj.Spec.ServicesGvk)) + for _, v := range obj.Spec.ServicesGvk { + l, err := obj.client.Global().GetServiceByName(ctx, v.Name) if err != nil { return nil, err } @@ -7031,40 +90511,40 @@ func (obj *PolicypkgACPConfig) GetAllDestSvcGroups(ctx context.Context) ( return } -// GetDestSvcGroups returns link which has given displayName -func (obj *PolicypkgACPConfig) GetDestSvcGroups(ctx context.Context, - displayName string) (result *ServicegroupSvcGroup, err error) { - l, ok := obj.Spec.DestSvcGroupsGvk[displayName] +// GetServices returns link which has given displayName +func (obj *GlobalVirtualService) GetServices(ctx context.Context, + displayName string) (result *GlobalService, err error) { + l, ok := obj.Spec.ServicesGvk[displayName] if !ok { - return nil, NewLinkNotFound(obj.DisplayName(), "Policypkg.ACPConfig", "DestSvcGroups", displayName) + return nil, NewLinkNotFound(obj.DisplayName(), "Global.VirtualService", "Services", displayName) } - result, err = obj.client.Servicegroup().GetSvcGroupByName(ctx, l.Name) + result, err = obj.client.Global().GetServiceByName(ctx, l.Name) return } -// LinkDestSvcGroups links obj with linkToAdd object. This function doesn't create linked object, it must be +// LinkServices links obj with linkToAdd object. This function doesn't create linked object, it must be // already created. -func (obj *PolicypkgACPConfig) LinkDestSvcGroups(ctx context.Context, - linkToAdd *ServicegroupSvcGroup) error { +func (obj *GlobalVirtualService) LinkServices(ctx context.Context, + linkToAdd *GlobalService) error { - payload := "{\"spec\": {\"destSvcGroupsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"SvcGroup\", \"group\": \"servicegroup.tsm.tanzu.vmware.com\"}}}}" - result, err := obj.client.baseClient.PolicypkgTsmV1().ACPConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + payload := "{\"spec\": {\"servicesGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"Service\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().VirtualServices().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) if err != nil { return err } - obj.ACPConfig = result + obj.VirtualService = result return nil } -// UnlinkDestSvcGroups unlinks linkToRemove object from obj. This function doesn't delete linked object. -func (obj *PolicypkgACPConfig) UnlinkDestSvcGroups(ctx context.Context, - linkToRemove *ServicegroupSvcGroup) (err error) { +// UnlinkServices unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalVirtualService) UnlinkServices(ctx context.Context, + linkToRemove *GlobalService) (err error) { var patch Patch patchOp := PatchOp{ Op: "remove", - Path: "/spec/destSvcGroupsGvk/" + linkToRemove.DisplayName(), + Path: "/spec/servicesGvk/" + linkToRemove.DisplayName(), } patch = append(patch, patchOp) @@ -7072,21 +90552,21 @@ func (obj *PolicypkgACPConfig) UnlinkDestSvcGroups(ctx context.Context, if err != nil { return err } - result, err := obj.client.baseClient.PolicypkgTsmV1().ACPConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + result, err := obj.client.baseClient.GlobalTsmV1().VirtualServices().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err } - obj.ACPConfig = result + obj.VirtualService = result return nil } -// GetAllSourceSvcGroups returns all links of given type -func (obj *PolicypkgACPConfig) GetAllSourceSvcGroups(ctx context.Context) ( - result []*ServicegroupSvcGroup, err error) { - result = make([]*ServicegroupSvcGroup, 0, len(obj.Spec.SourceSvcGroupsGvk)) - for _, v := range obj.Spec.SourceSvcGroupsGvk { - l, err := obj.client.Servicegroup().GetSvcGroupByName(ctx, v.Name) +// GetAllGateways returns all links of given type +func (obj *GlobalVirtualService) GetAllGateways(ctx context.Context) ( + result []*GlobalGateway, err error) { + result = make([]*GlobalGateway, 0, len(obj.Spec.GatewaysGvk)) + for _, v := range obj.Spec.GatewaysGvk { + l, err := obj.client.Global().GetGatewayByName(ctx, v.Name) if err != nil { return nil, err } @@ -7095,40 +90575,40 @@ func (obj *PolicypkgACPConfig) GetAllSourceSvcGroups(ctx context.Context) ( return } -// GetSourceSvcGroups returns link which has given displayName -func (obj *PolicypkgACPConfig) GetSourceSvcGroups(ctx context.Context, - displayName string) (result *ServicegroupSvcGroup, err error) { - l, ok := obj.Spec.SourceSvcGroupsGvk[displayName] +// GetGateways returns link which has given displayName +func (obj *GlobalVirtualService) GetGateways(ctx context.Context, + displayName string) (result *GlobalGateway, err error) { + l, ok := obj.Spec.GatewaysGvk[displayName] if !ok { - return nil, NewLinkNotFound(obj.DisplayName(), "Policypkg.ACPConfig", "SourceSvcGroups", displayName) + return nil, NewLinkNotFound(obj.DisplayName(), "Global.VirtualService", "Gateways", displayName) } - result, err = obj.client.Servicegroup().GetSvcGroupByName(ctx, l.Name) + result, err = obj.client.Global().GetGatewayByName(ctx, l.Name) return } -// LinkSourceSvcGroups links obj with linkToAdd object. This function doesn't create linked object, it must be +// LinkGateways links obj with linkToAdd object. This function doesn't create linked object, it must be // already created. -func (obj *PolicypkgACPConfig) LinkSourceSvcGroups(ctx context.Context, - linkToAdd *ServicegroupSvcGroup) error { +func (obj *GlobalVirtualService) LinkGateways(ctx context.Context, + linkToAdd *GlobalGateway) error { - payload := "{\"spec\": {\"sourceSvcGroupsGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"SvcGroup\", \"group\": \"servicegroup.tsm.tanzu.vmware.com\"}}}}" - result, err := obj.client.baseClient.PolicypkgTsmV1().ACPConfigs().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) + payload := "{\"spec\": {\"gatewaysGvk\": {\"" + linkToAdd.DisplayName() + "\": {\"name\": \"" + linkToAdd.Name + "\",\"kind\": \"Gateway\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" + result, err := obj.client.baseClient.GlobalTsmV1().VirtualServices().Patch(ctx, obj.Name, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) if err != nil { return err } - obj.ACPConfig = result + obj.VirtualService = result return nil } -// UnlinkSourceSvcGroups unlinks linkToRemove object from obj. This function doesn't delete linked object. -func (obj *PolicypkgACPConfig) UnlinkSourceSvcGroups(ctx context.Context, - linkToRemove *ServicegroupSvcGroup) (err error) { +// UnlinkGateways unlinks linkToRemove object from obj. This function doesn't delete linked object. +func (obj *GlobalVirtualService) UnlinkGateways(ctx context.Context, + linkToRemove *GlobalGateway) (err error) { var patch Patch patchOp := PatchOp{ Op: "remove", - Path: "/spec/sourceSvcGroupsGvk/" + linkToRemove.DisplayName(), + Path: "/spec/gatewaysGvk/" + linkToRemove.DisplayName(), } patch = append(patch, patchOp) @@ -7136,119 +90616,87 @@ func (obj *PolicypkgACPConfig) UnlinkSourceSvcGroups(ctx context.Context, if err != nil { return err } - result, err := obj.client.baseClient.PolicypkgTsmV1().ACPConfigs().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + result, err := obj.client.baseClient.GlobalTsmV1().VirtualServices().Patch(ctx, obj.Name, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err } - obj.ACPConfig = result + obj.VirtualService = result return nil } -type acpconfigPolicypkgTsmV1Chainer struct { +type virtualserviceGlobalTsmV1Chainer struct { client *Clientset name string parentLabels map[string]string } -func (c *acpconfigPolicypkgTsmV1Chainer) Subscribe() { - key := "acpconfigs.policypkg.tsm.tanzu.vmware.com" +func (c *virtualserviceGlobalTsmV1Chainer) Subscribe() { + key := "virtualservices.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informerpolicypkgtsmtanzuvmwarecomv1.NewACPConfigInformer(c.client.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewVirtualServiceInformer(c.client.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } } -func (c *acpconfigPolicypkgTsmV1Chainer) Unsubscribe() { - key := "acpconfigs.policypkg.tsm.tanzu.vmware.com" +func (c *virtualserviceGlobalTsmV1Chainer) Unsubscribe() { + key := "virtualservices.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { close(s.(subscription).stop) subscriptionMap.Delete(key) } } -func (c *acpconfigPolicypkgTsmV1Chainer) IsSubscribed() bool { - key := "acpconfigs.policypkg.tsm.tanzu.vmware.com" +func (c *virtualserviceGlobalTsmV1Chainer) IsSubscribed() bool { + key := "virtualservices.global.tsm.tanzu.vmware.com" _, ok := subscriptionMap.Load(key) return ok } -// ClearStatus to clear user defined status -func (c *acpconfigPolicypkgTsmV1Chainer) ClearStatus(ctx context.Context) (err error) { - hashedName := helper.GetHashedName("acpconfigs.policypkg.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Policypkg().GetACPConfigByName(ctx, hashedName) - if err != nil { - return err - } - _, err = c.client.Policypkg().SetACPConfigStatusByName(ctx, obj.ACPConfig, nil) - return err -} - -// GetStatus to get user defined status -func (c *acpconfigPolicypkgTsmV1Chainer) GetStatus(ctx context.Context) (result *basepolicypkgtsmtanzuvmwarecomv1.ACPStatus, err error) { - hashedName := helper.GetHashedName("acpconfigs.policypkg.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Policypkg().GetACPConfigByName(ctx, hashedName) - if err != nil { - return nil, err - } - return &obj.Status.Status, nil -} - -// SetStatus sets user defined status -func (c *acpconfigPolicypkgTsmV1Chainer) SetStatus(ctx context.Context, status *basepolicypkgtsmtanzuvmwarecomv1.ACPStatus) (err error) { - hashedName := helper.GetHashedName("acpconfigs.policypkg.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Policypkg().GetACPConfigByName(ctx, hashedName) - if err != nil { - return err - } - _, err = c.client.Policypkg().SetACPConfigStatusByName(ctx, obj.ACPConfig, status) - return err -} - -// GetVMpolicyByName returns object stored in the database under the hashedName which is a hash of display +// GetWorkloadEntryByName returns object stored in the database under the hashedName which is a hash of display // name and parents names. Use it when you know hashed name of object. -func (group *PolicypkgTsmV1) GetVMpolicyByName(ctx context.Context, hashedName string) (*PolicypkgVMpolicy, error) { - key := "vmpolicies.policypkg.tsm.tanzu.vmware.com" +func (group *GlobalTsmV1) GetWorkloadEntryByName(ctx context.Context, hashedName string) (*GlobalWorkloadEntry, error) { + key := "workloadentries.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) if !exists { return nil, err } - result, _ := item.(*basepolicypkgtsmtanzuvmwarecomv1.VMpolicy) - return &PolicypkgVMpolicy{ - client: group.client, - VMpolicy: result, + result, _ := item.(*baseglobaltsmtanzuvmwarecomv1.WorkloadEntry) + return &GlobalWorkloadEntry{ + client: group.client, + WorkloadEntry: result, }, nil } else { result, err := group.client.baseClient. - PolicypkgTsmV1(). - VMpolicies().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + WorkloadEntries().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return nil, err } - return &PolicypkgVMpolicy{ - client: group.client, - VMpolicy: result, + return &GlobalWorkloadEntry{ + client: group.client, + WorkloadEntry: result, }, nil } } -// DeleteVMpolicyByName deletes object stored in the database under the hashedName which is a hash of +// DeleteWorkloadEntryByName deletes object stored in the database under the hashedName which is a hash of // display name and parents names. Use it when you know hashed name of object. -func (group *PolicypkgTsmV1) DeleteVMpolicyByName(ctx context.Context, hashedName string) (err error) { +func (group *GlobalTsmV1) DeleteWorkloadEntryByName(ctx context.Context, hashedName string) (err error) { result, err := group.client.baseClient. - PolicypkgTsmV1(). - VMpolicies().Get(ctx, hashedName, metav1.GetOptions{}) + GlobalTsmV1(). + WorkloadEntries().Get(ctx, hashedName, metav1.GetOptions{}) if err != nil { return err } err = group.client.baseClient. - PolicypkgTsmV1(). - VMpolicies().Delete(ctx, hashedName, metav1.DeleteOptions{}) + GlobalTsmV1(). + WorkloadEntries().Delete(ctx, hashedName, metav1.DeleteOptions{}) if err != nil { return err } @@ -7257,7 +90705,7 @@ func (group *PolicypkgTsmV1) DeleteVMpolicyByName(ctx context.Context, hashedNam patchOp := PatchOp{ Op: "remove", - Path: "/spec/vMPPoliciesGvk", + Path: "/spec/workloadEntryGvk/" + result.DisplayName(), } patch = append(patch, patchOp) @@ -7269,16 +90717,16 @@ func (group *PolicypkgTsmV1) DeleteVMpolicyByName(ctx context.Context, hashedNam if parents == nil { parents = make(map[string]string) } - parentName, ok := parents["configs.config.tsm.tanzu.vmware.com"] + parentName, ok := parents["domains.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if parents[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", parents, parentName) + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", parents, parentName) } _, err = group.client.baseClient. - ConfigTsmV1(). - Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) if err != nil { return err } @@ -7286,10 +90734,10 @@ func (group *PolicypkgTsmV1) DeleteVMpolicyByName(ctx context.Context, hashedNam return } -// CreateVMpolicyByName creates object in the database without hashing the name. +// CreateWorkloadEntryByName creates object in the database without hashing the name. // Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *PolicypkgTsmV1) CreateVMpolicyByName(ctx context.Context, - objToCreate *basepolicypkgtsmtanzuvmwarecomv1.VMpolicy) (*PolicypkgVMpolicy, error) { +func (group *GlobalTsmV1) CreateWorkloadEntryByName(ctx context.Context, + objToCreate *baseglobaltsmtanzuvmwarecomv1.WorkloadEntry) (*GlobalWorkloadEntry, error) { if objToCreate.GetLabels() == nil { objToCreate.Labels = make(map[string]string) } @@ -7298,58 +90746,44 @@ func (group *PolicypkgTsmV1) CreateVMpolicyByName(ctx context.Context, } result, err := group.client.baseClient. - PolicypkgTsmV1(). - VMpolicies().Create(ctx, objToCreate, metav1.CreateOptions{}) + GlobalTsmV1(). + WorkloadEntries().Create(ctx, objToCreate, metav1.CreateOptions{}) if err != nil { return nil, err } - parentName, ok := objToCreate.GetLabels()["configs.config.tsm.tanzu.vmware.com"] + parentName, ok := objToCreate.GetLabels()["domains.global.tsm.tanzu.vmware.com"] if !ok { parentName = helper.DEFAULT_KEY } if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] == "true" { - parentName = helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) + parentName = helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", objToCreate.GetLabels(), parentName) } - var patch Patch - patchOp := PatchOp{ - Op: "replace", - Path: "/spec/vMPPoliciesGvk", - Value: basepolicypkgtsmtanzuvmwarecomv1.Child{ - Group: "policypkg.tsm.tanzu.vmware.com", - Kind: "VMpolicy", - Name: objToCreate.Name, - }, - } - patch = append(patch, patchOp) - marshaled, err := patch.Marshal() - if err != nil { - return nil, err - } + payload := "{\"spec\": {\"workloadEntryGvk\": {\"" + objToCreate.DisplayName() + "\": {\"name\": \"" + objToCreate.Name + "\",\"kind\": \"WorkloadEntry\", \"group\": \"global.tsm.tanzu.vmware.com\"}}}}" _, err = group.client.baseClient. - ConfigTsmV1(). - Configs().Patch(ctx, parentName, types.JSONPatchType, marshaled, metav1.PatchOptions{}) + GlobalTsmV1(). + Domains().Patch(ctx, parentName, types.MergePatchType, []byte(payload), metav1.PatchOptions{}) if err != nil { return nil, err } - return &PolicypkgVMpolicy{ - client: group.client, - VMpolicy: result, + return &GlobalWorkloadEntry{ + client: group.client, + WorkloadEntry: result, }, nil } -// UpdateVMpolicyByName updates object stored in the database under the hashedName which is a hash of +// UpdateWorkloadEntryByName updates object stored in the database under the hashedName which is a hash of // display name and parents names. -func (group *PolicypkgTsmV1) UpdateVMpolicyByName(ctx context.Context, - objToUpdate *basepolicypkgtsmtanzuvmwarecomv1.VMpolicy) (*PolicypkgVMpolicy, error) { +func (group *GlobalTsmV1) UpdateWorkloadEntryByName(ctx context.Context, + objToUpdate *baseglobaltsmtanzuvmwarecomv1.WorkloadEntry) (*GlobalWorkloadEntry, error) { // ResourceVersion must be set for update if objToUpdate.ResourceVersion == "" { current, err := group.client.baseClient. - PolicypkgTsmV1(). - VMpolicies().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) + GlobalTsmV1(). + WorkloadEntries().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) if err != nil { return nil, err } @@ -7363,449 +90797,199 @@ func (group *PolicypkgTsmV1) UpdateVMpolicyByName(ctx context.Context, Value: objToUpdate.ObjectMeta, }) - marshaled, err := patch.Marshal() - if err != nil { - return nil, err - } - result, err := group.client.baseClient. - PolicypkgTsmV1(). - VMpolicies().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") - if err != nil { - return nil, err - } - - return &PolicypkgVMpolicy{ - client: group.client, - VMpolicy: result, - }, nil -} - -// ListVMpolicies returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *PolicypkgTsmV1) ListVMpolicies(ctx context.Context, - opts metav1.ListOptions) (result []*PolicypkgVMpolicy, err error) { - key := "vmpolicies.policypkg.tsm.tanzu.vmware.com" - if s, ok := subscriptionMap.Load(key); ok { - items := s.(subscription).informer.GetStore().List() - result = make([]*PolicypkgVMpolicy, len(items)) - for k, v := range items { - item, _ := v.(*basepolicypkgtsmtanzuvmwarecomv1.VMpolicy) - result[k] = &PolicypkgVMpolicy{ - client: group.client, - VMpolicy: item, - } - } - } else { - list, err := group.client.baseClient.PolicypkgTsmV1(). - VMpolicies().List(ctx, opts) - if err != nil { - return nil, err - } - result = make([]*PolicypkgVMpolicy, len(list.Items)) - for k, v := range list.Items { - item := v - result[k] = &PolicypkgVMpolicy{ - client: group.client, - VMpolicy: &item, - } - } - } - return -} - -type PolicypkgVMpolicy struct { - client *Clientset - *basepolicypkgtsmtanzuvmwarecomv1.VMpolicy -} - -// Delete removes obj and all it's children from the database. -func (obj *PolicypkgVMpolicy) Delete(ctx context.Context) error { - err := obj.client.Policypkg().DeleteVMpolicyByName(ctx, obj.GetName()) - if err != nil { - return err - } - obj.VMpolicy = nil - return nil -} - -// Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *PolicypkgVMpolicy) Update(ctx context.Context) error { - result, err := obj.client.Policypkg().UpdateVMpolicyByName(ctx, obj.VMpolicy) - if err != nil { - return err - } - obj.VMpolicy = result.VMpolicy - return nil -} - -func (obj *PolicypkgVMpolicy) GetParent(ctx context.Context) (result *ConfigConfig, err error) { - hashedName := helper.GetHashedName("configs.config.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["configs.config.tsm.tanzu.vmware.com"]) - return obj.client.Config().GetConfigByName(ctx, hashedName) -} - -type vmpolicyPolicypkgTsmV1Chainer struct { - client *Clientset - name string - parentLabels map[string]string -} - -func (c *vmpolicyPolicypkgTsmV1Chainer) Subscribe() { - key := "vmpolicies.policypkg.tsm.tanzu.vmware.com" - if _, ok := subscriptionMap.Load(key); !ok { - informer := informerpolicypkgtsmtanzuvmwarecomv1.NewVMpolicyInformer(c.client.baseClient, 0, cache.Indexers{}) - subscribe(key, informer) - } -} - -func (c *vmpolicyPolicypkgTsmV1Chainer) Unsubscribe() { - key := "vmpolicies.policypkg.tsm.tanzu.vmware.com" - if s, ok := subscriptionMap.Load(key); ok { - close(s.(subscription).stop) - subscriptionMap.Delete(key) + patchValueName := + objToUpdate.Spec.Name + patchOpName := PatchOp{ + Op: "replace", + Path: "/spec/name", + Value: patchValueName, } -} - -func (c *vmpolicyPolicypkgTsmV1Chainer) IsSubscribed() bool { - key := "vmpolicies.policypkg.tsm.tanzu.vmware.com" - _, ok := subscriptionMap.Load(key) - return ok -} - -// GetRandomPolicyDataByName returns object stored in the database under the hashedName which is a hash of display -// name and parents names. Use it when you know hashed name of object. -func (group *PolicypkgTsmV1) GetRandomPolicyDataByName(ctx context.Context, hashedName string) (*PolicypkgRandomPolicyData, error) { - key := "randompolicydatas.policypkg.tsm.tanzu.vmware.com" - if s, ok := subscriptionMap.Load(key); ok { - item, exists, err := s.(subscription).informer.GetStore().GetByKey(hashedName) - if !exists { - return nil, err - } - - result, _ := item.(*basepolicypkgtsmtanzuvmwarecomv1.RandomPolicyData) - return &PolicypkgRandomPolicyData{ - client: group.client, - RandomPolicyData: result, - }, nil - } else { - result, err := group.client.baseClient. - PolicypkgTsmV1(). - RandomPolicyDatas().Get(ctx, hashedName, metav1.GetOptions{}) - if err != nil { - return nil, err - } + patch = append(patch, patchOpName) - return &PolicypkgRandomPolicyData{ - client: group.client, - RandomPolicyData: result, - }, nil + patchValueAnnotations := + objToUpdate.Spec.Annotations + patchOpAnnotations := PatchOp{ + Op: "replace", + Path: "/spec/annotations", + Value: patchValueAnnotations, } -} - -// DeleteRandomPolicyDataByName deletes object stored in the database under the hashedName which is a hash of -// display name and parents names. Use it when you know hashed name of object. -func (group *PolicypkgTsmV1) DeleteRandomPolicyDataByName(ctx context.Context, hashedName string) (err error) { + patch = append(patch, patchOpAnnotations) - err = group.client.baseClient. - PolicypkgTsmV1(). - RandomPolicyDatas().Delete(ctx, hashedName, metav1.DeleteOptions{}) - if err != nil { - return err + patchValueLabels := + objToUpdate.Spec.Labels + patchOpLabels := PatchOp{ + Op: "replace", + Path: "/spec/labels", + Value: patchValueLabels, } + patch = append(patch, patchOpLabels) - return -} - -// CreateRandomPolicyDataByName creates object in the database without hashing the name. -// Use it directly ONLY when objToCreate.Name is hashed name of the object. -func (group *PolicypkgTsmV1) CreateRandomPolicyDataByName(ctx context.Context, - objToCreate *basepolicypkgtsmtanzuvmwarecomv1.RandomPolicyData) (*PolicypkgRandomPolicyData, error) { - if objToCreate.GetLabels() == nil { - objToCreate.Labels = make(map[string]string) - } - if _, ok := objToCreate.Labels[common.DISPLAY_NAME_LABEL]; !ok { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() + patchValueCreationTimestamp := + objToUpdate.Spec.CreationTimestamp + patchOpCreationTimestamp := PatchOp{ + Op: "replace", + Path: "/spec/creationTimestamp", + Value: patchValueCreationTimestamp, } + patch = append(patch, patchOpCreationTimestamp) - result, err := group.client.baseClient. - PolicypkgTsmV1(). - RandomPolicyDatas().Create(ctx, objToCreate, metav1.CreateOptions{}) - if err != nil { - return nil, err + patchValueApiLink := + objToUpdate.Spec.ApiLink + patchOpApiLink := PatchOp{ + Op: "replace", + Path: "/spec/apiLink", + Value: patchValueApiLink, } + patch = append(patch, patchOpApiLink) - return &PolicypkgRandomPolicyData{ - client: group.client, - RandomPolicyData: result, - }, nil -} - -// SetRandomPolicyDataStatusByName sets user defined status -func (group *PolicypkgTsmV1) SetRandomPolicyDataStatusByName(ctx context.Context, - objToUpdate *basepolicypkgtsmtanzuvmwarecomv1.RandomPolicyData, status *basepolicypkgtsmtanzuvmwarecomv1.RandomStatus) (*PolicypkgRandomPolicyData, error) { - - // Make sure status field is present first - m := []byte("{\"status\":{}}") - result, err := group.client.baseClient. - PolicypkgTsmV1(). - RandomPolicyDatas().Patch(ctx, objToUpdate.GetName(), types.MergePatchType, m, metav1.PatchOptions{}, "status") - if err != nil { - return nil, err + patchValueUid := + objToUpdate.Spec.Uid + patchOpUid := PatchOp{ + Op: "replace", + Path: "/spec/uid", + Value: patchValueUid, } + patch = append(patch, patchOpUid) - patch := Patch{ - PatchOp{ - Op: "replace", - Path: "/status/status", - Value: status, - }, - } - marshaled, err := patch.Marshal() - if err != nil { - return nil, err - } - result, err = group.client.baseClient. - PolicypkgTsmV1(). - RandomPolicyDatas().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "status") - if err != nil { - return nil, err + patchValueAddress := + objToUpdate.Spec.Address + patchOpAddress := PatchOp{ + Op: "replace", + Path: "/spec/address", + Value: patchValueAddress, } - return &PolicypkgRandomPolicyData{ - client: group.client, - RandomPolicyData: result, - }, nil -} - -// UpdateRandomPolicyDataByName updates object stored in the database under the hashedName which is a hash of -// display name and parents names. -func (group *PolicypkgTsmV1) UpdateRandomPolicyDataByName(ctx context.Context, - objToUpdate *basepolicypkgtsmtanzuvmwarecomv1.RandomPolicyData) (*PolicypkgRandomPolicyData, error) { + patch = append(patch, patchOpAddress) - // ResourceVersion must be set for update - if objToUpdate.ResourceVersion == "" { - current, err := group.client.baseClient. - PolicypkgTsmV1(). - RandomPolicyDatas().Get(ctx, objToUpdate.GetName(), metav1.GetOptions{}) - if err != nil { - return nil, err - } - objToUpdate.ResourceVersion = current.ResourceVersion + patchValueWorkloadLabels := + objToUpdate.Spec.WorkloadLabels + patchOpWorkloadLabels := PatchOp{ + Op: "replace", + Path: "/spec/workloadLabels", + Value: patchValueWorkloadLabels, } + patch = append(patch, patchOpWorkloadLabels) - var patch Patch - patch = append(patch, PatchOp{ + patchValuePorts := + objToUpdate.Spec.Ports + patchOpPorts := PatchOp{ Op: "replace", - Path: "/metadata", - Value: objToUpdate.ObjectMeta, - }) + Path: "/spec/ports", + Value: patchValuePorts, + } + patch = append(patch, patchOpPorts) - patchValueDescription := - objToUpdate.Spec.Description - patchOpDescription := PatchOp{ + patchValueLocality := + objToUpdate.Spec.Locality + patchOpLocality := PatchOp{ Op: "replace", - Path: "/spec/description", - Value: patchValueDescription, + Path: "/spec/locality", + Value: patchValueLocality, } - patch = append(patch, patchOpDescription) + patch = append(patch, patchOpLocality) marshaled, err := patch.Marshal() if err != nil { return nil, err } result, err := group.client.baseClient. - PolicypkgTsmV1(). - RandomPolicyDatas().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") + GlobalTsmV1(). + WorkloadEntries().Patch(ctx, objToUpdate.GetName(), types.JSONPatchType, marshaled, metav1.PatchOptions{}, "") if err != nil { return nil, err } - return &PolicypkgRandomPolicyData{ - client: group.client, - RandomPolicyData: result, + return &GlobalWorkloadEntry{ + client: group.client, + WorkloadEntry: result, }, nil } -// ListRandomPolicyDatas returns slice of all existing objects of this type. Selectors can be provided in opts parameter. -func (group *PolicypkgTsmV1) ListRandomPolicyDatas(ctx context.Context, - opts metav1.ListOptions) (result []*PolicypkgRandomPolicyData, err error) { - key := "randompolicydatas.policypkg.tsm.tanzu.vmware.com" +// ListWorkloadEntries returns slice of all existing objects of this type. Selectors can be provided in opts parameter. +func (group *GlobalTsmV1) ListWorkloadEntries(ctx context.Context, + opts metav1.ListOptions) (result []*GlobalWorkloadEntry, err error) { + key := "workloadentries.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { items := s.(subscription).informer.GetStore().List() - result = make([]*PolicypkgRandomPolicyData, len(items)) + result = make([]*GlobalWorkloadEntry, len(items)) for k, v := range items { - item, _ := v.(*basepolicypkgtsmtanzuvmwarecomv1.RandomPolicyData) - result[k] = &PolicypkgRandomPolicyData{ - client: group.client, - RandomPolicyData: item, + item, _ := v.(*baseglobaltsmtanzuvmwarecomv1.WorkloadEntry) + result[k] = &GlobalWorkloadEntry{ + client: group.client, + WorkloadEntry: item, } } } else { - list, err := group.client.baseClient.PolicypkgTsmV1(). - RandomPolicyDatas().List(ctx, opts) + list, err := group.client.baseClient.GlobalTsmV1(). + WorkloadEntries().List(ctx, opts) if err != nil { return nil, err } - result = make([]*PolicypkgRandomPolicyData, len(list.Items)) + result = make([]*GlobalWorkloadEntry, len(list.Items)) for k, v := range list.Items { item := v - result[k] = &PolicypkgRandomPolicyData{ - client: group.client, - RandomPolicyData: &item, + result[k] = &GlobalWorkloadEntry{ + client: group.client, + WorkloadEntry: &item, } } } return } -type PolicypkgRandomPolicyData struct { +type GlobalWorkloadEntry struct { client *Clientset - *basepolicypkgtsmtanzuvmwarecomv1.RandomPolicyData + *baseglobaltsmtanzuvmwarecomv1.WorkloadEntry } // Delete removes obj and all it's children from the database. -func (obj *PolicypkgRandomPolicyData) Delete(ctx context.Context) error { - err := obj.client.Policypkg().DeleteRandomPolicyDataByName(ctx, obj.GetName()) +func (obj *GlobalWorkloadEntry) Delete(ctx context.Context) error { + err := obj.client.Global().DeleteWorkloadEntryByName(ctx, obj.GetName()) if err != nil { return err } - obj.RandomPolicyData = nil + obj.WorkloadEntry = nil return nil } // Update updates spec of object in database. Children and Link can not be updated using this function. -func (obj *PolicypkgRandomPolicyData) Update(ctx context.Context) error { - result, err := obj.client.Policypkg().UpdateRandomPolicyDataByName(ctx, obj.RandomPolicyData) - if err != nil { - return err - } - obj.RandomPolicyData = result.RandomPolicyData - return nil -} - -// SetStatus sets user defined status -func (obj *PolicypkgRandomPolicyData) SetStatus(ctx context.Context, status *basepolicypkgtsmtanzuvmwarecomv1.RandomStatus) error { - result, err := obj.client.Policypkg().SetRandomPolicyDataStatusByName(ctx, obj.RandomPolicyData, status) - if err != nil { - return err - } - obj.RandomPolicyData = result.RandomPolicyData - return nil -} - -// GetStatus to get user defined status -func (obj *PolicypkgRandomPolicyData) GetStatus(ctx context.Context) (*basepolicypkgtsmtanzuvmwarecomv1.RandomStatus, error) { - getObj, err := obj.client.Policypkg().GetRandomPolicyDataByName(ctx, obj.GetName()) - if err != nil { - return nil, err - } - return &getObj.Status.Status, nil -} - -// ClearStatus to clear user defined status -func (obj *PolicypkgRandomPolicyData) ClearStatus(ctx context.Context) error { - result, err := obj.client.Policypkg().SetRandomPolicyDataStatusByName(ctx, obj.RandomPolicyData, &basepolicypkgtsmtanzuvmwarecomv1.RandomStatus{}) +func (obj *GlobalWorkloadEntry) Update(ctx context.Context) error { + result, err := obj.client.Global().UpdateWorkloadEntryByName(ctx, obj.WorkloadEntry) if err != nil { return err } - obj.RandomPolicyData = result.RandomPolicyData + obj.WorkloadEntry = result.WorkloadEntry return nil } -// GetPolicypkgRandomPolicyData calculates the hashed name based on parents and displayName and -// returns given object -func (c *Clientset) GetPolicypkgRandomPolicyData(ctx context.Context, displayName string) (result *PolicypkgRandomPolicyData, err error) { - hashedName := helper.GetHashedName("randompolicydatas.policypkg.tsm.tanzu.vmware.com", nil, displayName) - return c.Policypkg().GetRandomPolicyDataByName(ctx, hashedName) -} - -func (c *Clientset) PolicypkgRandomPolicyData(displayName string) *randompolicydataPolicypkgTsmV1Chainer { - parentLabels := make(map[string]string) - parentLabels["randompolicydatas.policypkg.tsm.tanzu.vmware.com"] = displayName - return &randompolicydataPolicypkgTsmV1Chainer{ - client: c, - name: displayName, - parentLabels: parentLabels, - } -} - -// AddPolicypkgRandomPolicyData calculates hashed name of the object based on objToCreate.Name -// and parents names and creates it. objToCreate.Name is changed to the hashed name. Original name is preserved in -// nexus/display_name label and can be obtained using DisplayName() method. -func (c *Clientset) AddPolicypkgRandomPolicyData(ctx context.Context, - objToCreate *basepolicypkgtsmtanzuvmwarecomv1.RandomPolicyData) (result *PolicypkgRandomPolicyData, err error) { - if objToCreate.Labels == nil { - objToCreate.Labels = map[string]string{} - } - if objToCreate.Labels[common.IS_NAME_HASHED_LABEL] != "true" { - objToCreate.Labels[common.DISPLAY_NAME_LABEL] = objToCreate.GetName() - objToCreate.Labels[common.IS_NAME_HASHED_LABEL] = "true" - hashedName := helper.GetHashedName(objToCreate.CRDName(), nil, objToCreate.GetName()) - objToCreate.Name = hashedName - } - return c.Policypkg().CreateRandomPolicyDataByName(ctx, objToCreate) -} - -// DeletePolicypkgRandomPolicyData calculates hashedName of object based on displayName and -// parents and deletes given object -func (c *Clientset) DeletePolicypkgRandomPolicyData(ctx context.Context, displayName string) (err error) { - hashedName := helper.GetHashedName("randompolicydatas.policypkg.tsm.tanzu.vmware.com", nil, displayName) - return c.Policypkg().DeleteRandomPolicyDataByName(ctx, hashedName) +func (obj *GlobalWorkloadEntry) GetParent(ctx context.Context) (result *GlobalDomain, err error) { + hashedName := helper.GetHashedName("domains.global.tsm.tanzu.vmware.com", obj.Labels, obj.Labels["domains.global.tsm.tanzu.vmware.com"]) + return obj.client.Global().GetDomainByName(ctx, hashedName) } -type randompolicydataPolicypkgTsmV1Chainer struct { +type workloadentryGlobalTsmV1Chainer struct { client *Clientset name string parentLabels map[string]string } -func (c *randompolicydataPolicypkgTsmV1Chainer) Subscribe() { - key := "randompolicydatas.policypkg.tsm.tanzu.vmware.com" +func (c *workloadentryGlobalTsmV1Chainer) Subscribe() { + key := "workloadentries.global.tsm.tanzu.vmware.com" if _, ok := subscriptionMap.Load(key); !ok { - informer := informerpolicypkgtsmtanzuvmwarecomv1.NewRandomPolicyDataInformer(c.client.baseClient, 0, cache.Indexers{}) + informer := informerglobaltsmtanzuvmwarecomv1.NewWorkloadEntryInformer(c.client.baseClient, 0, cache.Indexers{}) subscribe(key, informer) } } -func (c *randompolicydataPolicypkgTsmV1Chainer) Unsubscribe() { - key := "randompolicydatas.policypkg.tsm.tanzu.vmware.com" +func (c *workloadentryGlobalTsmV1Chainer) Unsubscribe() { + key := "workloadentries.global.tsm.tanzu.vmware.com" if s, ok := subscriptionMap.Load(key); ok { close(s.(subscription).stop) subscriptionMap.Delete(key) } } -func (c *randompolicydataPolicypkgTsmV1Chainer) IsSubscribed() bool { - key := "randompolicydatas.policypkg.tsm.tanzu.vmware.com" +func (c *workloadentryGlobalTsmV1Chainer) IsSubscribed() bool { + key := "workloadentries.global.tsm.tanzu.vmware.com" _, ok := subscriptionMap.Load(key) return ok } - -// ClearStatus to clear user defined status -func (c *randompolicydataPolicypkgTsmV1Chainer) ClearStatus(ctx context.Context) (err error) { - hashedName := helper.GetHashedName("randompolicydatas.policypkg.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Policypkg().GetRandomPolicyDataByName(ctx, hashedName) - if err != nil { - return err - } - _, err = c.client.Policypkg().SetRandomPolicyDataStatusByName(ctx, obj.RandomPolicyData, nil) - return err -} - -// GetStatus to get user defined status -func (c *randompolicydataPolicypkgTsmV1Chainer) GetStatus(ctx context.Context) (result *basepolicypkgtsmtanzuvmwarecomv1.RandomStatus, err error) { - hashedName := helper.GetHashedName("randompolicydatas.policypkg.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Policypkg().GetRandomPolicyDataByName(ctx, hashedName) - if err != nil { - return nil, err - } - return &obj.Status.Status, nil -} - -// SetStatus sets user defined status -func (c *randompolicydataPolicypkgTsmV1Chainer) SetStatus(ctx context.Context, status *basepolicypkgtsmtanzuvmwarecomv1.RandomStatus) (err error) { - hashedName := helper.GetHashedName("randompolicydatas.policypkg.tsm.tanzu.vmware.com", c.parentLabels, c.name) - obj, err := c.client.Policypkg().GetRandomPolicyDataByName(ctx, hashedName) - if err != nil { - return err - } - _, err = c.client.Policypkg().SetRandomPolicyDataStatusByName(ctx, obj.RandomPolicyData, status) - return err -} diff --git a/compiler/example/output/generated/nexus-gql/gqlgen.yml b/compiler/example/output/generated/nexus-gql/gqlgen.yml index d37aa546e..a5f94b255 100644 --- a/compiler/example/output/generated/nexus-gql/gqlgen.yml +++ b/compiler/example/output/generated/nexus-gql/gqlgen.yml @@ -30,49 +30,1037 @@ models: - github.com/vmware-tanzu/graph-framework-for-microservices/gqlgen/graphql.Int - github.com/vmware-tanzu/graph-framework-for-microservices/gqlgen/graphql.Int64 - github.com/vmware-tanzu/graph-framework-for-microservices/gqlgen/graphql.Int32 - root_Root: + global_ACPConfig: fields: - Config: + DestSvcGroups: + resolver: true + SourceSvcGroups: + resolver: true + global_AllSparkServices: + fields: + GlobalRegistrationService: + resolver: true + LocalRegistrationService: + resolver: true + AwsConnector: + resolver: true + global_AppFolder: + fields: + App: + resolver: true + global_AppGroup: + fields: + Services: + resolver: true + global_AppTemplate: + fields: + ServiceDefinitions: + resolver: true + global_AppVersion: + fields: + Template: + resolver: true + Inventory: + resolver: true + global_App: + fields: + Version: + resolver: true + global_AutoscalerFolder: + fields: + Autoscalers: + resolver: true + global_Autoscaler: + fields: + Autoscaler: + resolver: true + global_AwsConnector: + fields: + Gns: + resolver: true + global_Bucket: + fields: + Template: + resolver: true + Inventory: + resolver: true + global_ClusterConfigFolder: + fields: + Clusters: resolver: true - config_Config: + global_ClusterConfig: fields: - QueryExample: + Domains: + resolver: true + HostConfig: + resolver: true + GnsBinding: + resolver: true + SecurityContextConstraints: + resolver: true + DnsConfigFolder: resolver: true - ACPPolicies: + DnsProbesConfigFolder: + resolver: true + LogFolder: + resolver: true + ResourceGroup: + resolver: true + global_ClusterFolder: + fields: + Clusters: + resolver: true + RemoteGatewayServiceConfigs: + resolver: true + global_Cluster: + fields: + queryNodeTS: + resolver: true + queryServiceTS: + resolver: true + queryServiceTable: + resolver: true + queryServiceVersionTable: + resolver: true + queryServiceInstanceTable: + resolver: true + queryServiceTopology: + resolver: true + queryClusterTable: + resolver: true + queryNodeTable: + resolver: true + queryServiceNodeMapGroupedByNode: + resolver: true + queryServiceNodeMapGroupedByService: + resolver: true + queryServiceNodeMapGroupedByServiceVersion: + resolver: true + queryStats: + resolver: true + queryLogs: + resolver: true + queryList: + resolver: true + queryLinechart: + resolver: true + queryTopN: + resolver: true + queryDetail: + resolver: true + Apps: + resolver: true + DnsProbeStatus: + resolver: true + SecurityContextConstraints: + resolver: true + Domains: + resolver: true + Nodes: + resolver: true + ConnectionStatus: + resolver: true + global_Config: + fields: + Certificates: resolver: true - FooExample: + ExternalAccounts: resolver: true - GNS: + ExternalDNS: resolver: true - DNS: + ExternalLB: resolver: true - VMPPolicies: + FeatureFlags: resolver: true + Projects: + resolver: true + ServiceDirectory: + resolver: true + ResourceGroups: + resolver: true + GlobalNamespace: + resolver: true + Policy: + resolver: true + Templates: + resolver: true + ProgressiveUpgrade: + resolver: true + ExternalPlugins: + resolver: true + ExternalAuditStorage: + resolver: true + AutoscalerFolder: + resolver: true + Clusters: + resolver: true + ServiceLevelObjective: + resolver: true + global_DataFolderDomainService: + fields: + Versions: + resolver: true + global_DataFolderDomain: + fields: + Service: + resolver: true + Cluster: + resolver: true + Database: + resolver: true + global_DataFolder: + fields: Domain: resolver: true - SvcGrpInfo: + global_Database: + fields: + Tables: + resolver: true + Directories: + resolver: true + Buckets: + resolver: true + global_DCRegion: + fields: + Zones: + resolver: true + global_DCZone: + fields: + Clusters: + resolver: true + global_DestinationRule: + fields: + Service: + resolver: true + ServiceDeployments: + resolver: true + ServiceReplicaSets: + resolver: true + ServiceStatefulSets: resolver: true - gns_Gns: + ServiceDaemonSets: + resolver: true + ServiceJobs: + resolver: true + global_Directory: + fields: + Template: + resolver: true + Inventory: + resolver: true + global_DNSConfigFolder: + fields: + DnsConfig: + resolver: true + global_DNSProbesConfigFolder: + fields: + DnsProbeConfigs: + resolver: true + global_DomainConfig: fields: - queryGns1: + Policy: + resolver: true + NetworkAttachmentDefinition: + resolver: true + Services: + resolver: true + ServiceEntries: + resolver: true + GatewayConfig: + resolver: true + Autoscalers: + resolver: true + HostConfigV2: + resolver: true + InboundAuthenticationConfig: resolver: true - queryGnsQM1: + Slos: resolver: true - queryGnsQM: + Secrets: + resolver: true + ExternalServices: + resolver: true + ApiDiscovery: + resolver: true + GeoDiscovery: + resolver: true + PiiDiscovery: + resolver: true + AttackDiscovery: + resolver: true + UserDiscovery: + resolver: true + PublicService: resolver: true GnsAccessControlPolicy: resolver: true - FooChild: + GnsSchemaViolationDiscovery: + resolver: true + GnsSegmentationPolicy: + resolver: true + CertificateAuthority: + resolver: true + GnsEndpointsConfig: + resolver: true + LabelConfig: + resolver: true + global_Domain: + fields: + queryServiceTS: + resolver: true + queryServiceTable: + resolver: true + queryServiceVersionTable: resolver: true - policypkg_AccessControlPolicy: + queryServiceInstanceTable: + resolver: true + queryServiceNodeMapGroupedByNode: + resolver: true + queryServiceNodeMapGroupedByService: + resolver: true + queryServiceNodeMapGroupedByServiceVersion: + resolver: true + queryStats: + resolver: true + queryLogs: + resolver: true + queryList: + resolver: true + queryLinechart: + resolver: true + queryTopN: + resolver: true + queryDetail: + resolver: true + SecretHashes: + resolver: true + ServiceInstances: + resolver: true + ServiceDeployments: + resolver: true + ServiceStatefulSets: + resolver: true + ServiceDaemonSets: + resolver: true + ServiceReplicaSets: + resolver: true + ServiceCronJobs: + resolver: true + ServiceJobs: + resolver: true + VirtualServices: + resolver: true + ServiceEntry: + resolver: true + WorkloadEntry: + resolver: true + DestinationRules: + resolver: true + Services: + resolver: true + Endpoints: + resolver: true + Gateways: + resolver: true + AuthenticationPolicies: + resolver: true + Configmap: + resolver: true + Envoyfilter: + resolver: true + Autoscalers: + resolver: true + PeerAuthentication: + resolver: true + KnativeIngresses: + resolver: true + NetworkAttachmentDefinition: + resolver: true + Issuers: + resolver: true + Certificates: + resolver: true + CertificateRequests: + resolver: true + global_ExternalDNSConfigN: + fields: + Account: + resolver: true + global_ExternalDNSInventoryPrimaryDomain: + fields: + DnsRecords: + resolver: true + global_ExternalDNSInventoryRecord: + fields: + HealthCheck: + resolver: true + global_ExternalDNSInventoryZone: + fields: + PrimaryDomains: + resolver: true + global_ExternalDNSInventory: + fields: + Zones: + resolver: true + PrimaryDomains: + resolver: true + HealthChecks: + resolver: true + global_ExternalDNSRuntimePrimaryDomain: + fields: + Subdomains: + resolver: true + global_ExternalDNSRuntime: + fields: + PrimaryDomains: + resolver: true + global_ExternalDNSRuntimeSubdomain: + fields: + Endpoints: + resolver: true + global_ExternalPluginConfigFolder: + fields: + Plugins: + resolver: true + global_ExternalPluginConfig: + fields: + PluginInstances: + resolver: true + global_ExternalPluginInstanceConfig: + fields: + Clusters: + resolver: true + Monitors: + resolver: true + Capabilitiy: + resolver: true + global_GatewayConfigAdditionalListeners: + fields: + ListenerRoutes: + resolver: true + Certificate: + resolver: true + global_GatewayConfig: + fields: + AdditionalListeners: + resolver: true + global_Gateway: + fields: + Services: + resolver: true + global_GlobalNs: + fields: + RoutingPolicies: + resolver: true + global_GlobalRegistrationService: + fields: + Tenants: + resolver: true + TenantToken: + resolver: true + global_GlobalNamespace: + fields: + Gns: + resolver: true + global_GnsBindingRT: + fields: + GnsSvcGroupRT: + resolver: true + GnsRoutingRules: + resolver: true + GnsServiceEntryConfig: + resolver: true + global_ExternalServiceConfig: + fields: + queryServiceTS: + resolver: true + global_PublicServiceConfig: + fields: + RoutingConfigs: + resolver: true + ExternalDNS: + resolver: true + Certificates: + resolver: true + HealthChecks: + resolver: true + global_GNSSvcGroup: + fields: + queryServiceTS: + resolver: true + queryServiceInstanceTable: + resolver: true + queryServiceTable: + resolver: true + queryServiceVersionTable: + resolver: true + queryServiceNodeMapGroupedByNode: + resolver: true + queryServiceNodeMapGroupedByService: + resolver: true + queryClusterTable: + resolver: true + Services: + resolver: true + global_GNS: + fields: + queryServiceTS: + resolver: true + queryServiceInstanceTable: + resolver: true + queryServiceTable: + resolver: true + queryServiceVersionTable: + resolver: true + queryServiceTopology: + resolver: true + queryClusterTable: + resolver: true + queryNodeTable: + resolver: true + queryServiceNodeMapGroupedByNode: + resolver: true + queryServiceNodeMapGroupedByService: + resolver: true + queryAccessControlPolicyStats: + resolver: true + queryGNSServiceAPI: + resolver: true + queryStats: + resolver: true + queryLogs: + resolver: true + queryList: + resolver: true + queryLinechart: + resolver: true + queryTopN: + resolver: true + queryDetail: + resolver: true + queryIncomingAPIs: + resolver: true + queryOutgoingAPIs: + resolver: true + queryIncomingTCP: + resolver: true + queryOutgoingTCP: + resolver: true + MemberGroups: + resolver: true + GnsServiceGroups: + resolver: true + Members: + resolver: true + PublicServices: + resolver: true + SharedServices: + resolver: true + SloPolicies: + resolver: true + ExternalServices: + resolver: true + AutoscalingPolicies: + resolver: true + RoutingPolicies: + resolver: true + ApiDiscovery: + resolver: true + GeoDiscovery: + resolver: true + PiiDiscovery: + resolver: true + AttackDiscovery: + resolver: true + UserDiscovery: + resolver: true + GnsAccessControlPolicy: + resolver: true + GnsSchemaViolationDiscovery: + resolver: true + GnsSegmentationPolicy: + resolver: true + RoutingConfig: + resolver: true + global_HostConfigV2: + fields: + HaConfigV2: + resolver: true + OutboundAuthenticationMode: + resolver: true + global_HostConfig: + fields: + HaConfig: + resolver: true + global_Inventory: + fields: + queryClusterTable: + resolver: true + queryNodeTS: + resolver: true + queryNodeTable: + resolver: true + queryServiceTS: + resolver: true + querySloCounts: + resolver: true + querySloTable: + resolver: true + queryClusterInventoryCount: + resolver: true + queryServiceInstanceTable: + resolver: true + queryServiceTable: + resolver: true + queryServiceVersionTable: + resolver: true + queryServiceAPIs: + resolver: true + queryStats: + resolver: true + queryLogs: + resolver: true + queryList: + resolver: true + queryLinechart: + resolver: true + queryTopN: + resolver: true + queryDetail: + resolver: true + queryRiskTracker: + resolver: true + queryRiskTrackerDetail: + resolver: true + Regions: + resolver: true + Clusters: + resolver: true + ExternalDNS: + resolver: true + JobFolder: + resolver: true + global_JobConfigFolder: + fields: + JobConfig: + resolver: true + global_JobFolder: + fields: + Jobs: + resolver: true + global_LocalRegistrationServiceCluster: + fields: + Resources: + resolver: true + global_LocalRegistrationService: + fields: + Clusters: + resolver: true + Template: + resolver: true + global_LogFolder: + fields: + Log: + resolver: true + global_NodeFolder: + fields: + Clusters: + resolver: true + global_NodeTemplate: + fields: + DefinitionVersions: + resolver: true + global_Node: + fields: + queryNodeTS: + resolver: true + queryNodeTable: + resolver: true + Status: + resolver: true + global_AccessControlPolicy: fields: PolicyConfigs: resolver: true - policypkg_VMpolicy: + global_ProgressiveUpgrade: + fields: + Upgrade: + resolver: true + global_ProgressiveUpgradeFolder: + fields: + Upgrades: + resolver: true + global_ProjectConfig: + fields: + SvcGroups: + resolver: true + Gns: + resolver: true + PolicyConfigs: + resolver: true + TemplateGroups: + resolver: true + Certificates: + resolver: true + ExternalAccounts: + resolver: true + ExternalDNS: + resolver: true + Autoscalers: + resolver: true + Clusters: + resolver: true + ServiceLevelObjectives: + resolver: true + CertificateAuthorities: + resolver: true + global_ProjectInventory: + fields: + Clusters: + resolver: true + ExternalDNS: + resolver: true + Jobs: + resolver: true + global_ProjectQuery: + fields: + queryClusterTable: + resolver: true + queryNodeTS: + resolver: true + queryNodeTable: + resolver: true + queryServiceTS: + resolver: true + queryClusterInventoryCount: + resolver: true + queryServiceTable: + resolver: true + queryServiceVersionTable: + resolver: true + queryStats: + resolver: true + queryLogs: + resolver: true + queryList: + resolver: true + queryLinechart: + resolver: true + queryTopN: + resolver: true + queryDetail: + resolver: true + queryRiskTracker: + resolver: true + queryRiskTrackerDetail: + resolver: true + global_Project: + fields: + Config: + resolver: true + Inventory: + resolver: true + Query: + resolver: true + global_ResourceGroupRT: + fields: + SvcGroupRT: + resolver: true + global_ResourceGroup: + fields: + AppGroups: + resolver: true + SvcGroups: + resolver: true + NodeGroups: + resolver: true + DataGroups: + resolver: true + UserGroups: + resolver: true + global_Root: + fields: + Config: + resolver: true + Inventory: + resolver: true + Runtime: + resolver: true + global_Runtime: + fields: + AllsparkServices: + resolver: true + UserFolder: + resolver: true + DataFolder: + resolver: true + AppFolder: + resolver: true + NodeFolder: + resolver: true + ClusterFolder: + resolver: true + ProgressiveUpgrade: + resolver: true + JobConfigFolder: + resolver: true + ExternalDNS: + resolver: true + SloFolder: + resolver: true + ServiceDirectoryRT: + resolver: true + global_ServiceConfig: + fields: + ServiceVersion: + resolver: true + global_ServiceCronJob: + fields: + ServiceInstances: + resolver: true + ServiceJobs: + resolver: true + global_ServiceDaemonSet: + fields: + queryWorkloadVersionAPI: + resolver: true + ServiceInstances: + resolver: true + global_ServiceDeployment: + fields: + queryServiceTS: + resolver: true + queryServiceInstanceTable: + resolver: true + queryWorkloadVersionAPI: + resolver: true + Containers: + resolver: true + ServiceInstances: + resolver: true + ServiceReplicaSet: + resolver: true + global_ServiceDirectoryRTFolder: + fields: + ServiceDirectoryRTFolderEntry: + resolver: true + global_ServiceDirectoryRT: + fields: + ServiceDirectoryRTFolder: + resolver: true + global_ServiceDirectoryN: + fields: + Entries: + resolver: true + global_ServiceInstance: + fields: + queryServiceTS: + resolver: true + queryServiceInstanceTable: + resolver: true + Containers: + resolver: true + Node: + resolver: true + global_ServiceJob: + fields: + ServiceInstances: + resolver: true + global_ServiceLevelObjectiveFolder: + fields: + ServiceLevelObjectives: + resolver: true + global_ServiceReplicaSet: + fields: + ServiceInstances: + resolver: true + global_ServiceStatefulSet: + fields: + queryWorkloadVersionAPI: + resolver: true + ServiceInstances: + resolver: true + global_ServiceTemplate: + fields: + ServiceDefinitions: + resolver: true + global_ServiceVersionConfig: + fields: + MetricMonitors: + resolver: true + global_ServiceVersion: + fields: + queryStats: + resolver: true + queryLogs: + resolver: true + queryList: + resolver: true + queryLinechart: + resolver: true + queryTopN: + resolver: true + queryDetail: + resolver: true + queryIncomingAPIs: + resolver: true + queryOutgoingAPIs: + resolver: true + queryIncomingTCP: + resolver: true + queryOutgoingTCP: + resolver: true + ServiceDeployments: + resolver: true + ServiceDaemonSets: + resolver: true + ServiceStatefulSets: + resolver: true + global_Service: + fields: + queryServiceAPIs: + resolver: true + queryServiceTS: + resolver: true + querySloDetails: + resolver: true + querySloCounts: + resolver: true + querySloTable: + resolver: true + queryServiceInstanceTable: + resolver: true + queryServiceTopology: + resolver: true + queryServiceNodeMapGroupedByService: + resolver: true + queryServiceTable: + resolver: true + queryServiceVersionTable: + resolver: true + queryStats: + resolver: true + queryLogs: + resolver: true + queryList: + resolver: true + queryLinechart: + resolver: true + queryTopN: + resolver: true + queryDetail: + resolver: true + queryIncomingAPIs: + resolver: true + queryOutgoingAPIs: + resolver: true + queryIncomingTCP: + resolver: true + queryOutgoingTCP: + resolver: true + AdditionalAttributes: + resolver: true + ServiceDeployments: + resolver: true + ServiceStatefulSets: + resolver: true + ServiceDaemonSets: + resolver: true + Endpoints: + resolver: true + ServiceVersions: + resolver: true + ServiceReplicaSets: + resolver: true + ServiceJobs: + resolver: true + global_SloConfig: + fields: + SloServices: + resolver: true + global_SLOFolder: + fields: + Slos: + resolver: true + global_FederatedSloConfig: + fields: + SloServices: + resolver: true + global_SvcGroup: + fields: + queryServiceTS: + resolver: true + queryServiceInstanceTable: + resolver: true + queryServiceTable: + resolver: true + queryServiceVersionTable: + resolver: true + queryServiceNodeMapGroupedByNode: + resolver: true + queryServiceNodeMapGroupedByService: + resolver: true + queryClusterTable: + resolver: true + Services: + resolver: true + Deployments: + resolver: true + Daemonsets: + resolver: true + Statefulsets: + resolver: true + Jobs: + resolver: true + global_Table: + fields: + Template: + resolver: true + Inventory: + resolver: true + global_TemplateGroup: + fields: + DataTemplates: + resolver: true + NodeTemplates: + resolver: true + AppTemplates: + resolver: true + ServiceTemplates: + resolver: true + PolicyTemplates: + resolver: true + global_Template: + fields: + TemplateGroups: + resolver: true + HealthChecks: + resolver: true + global_Tenant: + fields: + Resources: + resolver: true + Template: + resolver: true + Annotations: + resolver: true + global_UserFolder: + fields: + Users: + resolver: true + AppUsers: + resolver: true + AccessToken: + resolver: true + global_User: + fields: + Preferences: + resolver: true + global_VirtualService: fields: - queryGns1: + DestinationRules: resolver: true - queryGnsQM1: + Services: resolver: true - queryGnsQM: + Gateways: resolver: true diff --git a/compiler/example/output/generated/nexus-gql/graph/generated/generated.go b/compiler/example/output/generated/nexus-gql/graph/generated/generated.go deleted file mode 100644 index 292fc356f..000000000 --- a/compiler/example/output/generated/nexus-gql/graph/generated/generated.go +++ /dev/null @@ -1,10470 +0,0 @@ -// Code generated by github.com/vmware-tanzu/graph-framework-for-microservices/gqlgen, DO NOT EDIT. - -package generated - -import ( - "bytes" - "context" - "errors" - "fmt" - "strconv" - "sync" - "sync/atomic" - - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/nexus-gql/graph/model" - - gqlparser "github.com/vektah/gqlparser/v2" - "github.com/vektah/gqlparser/v2/ast" - "github.com/vmware-tanzu/graph-framework-for-microservices/gqlgen/graphql" - "github.com/vmware-tanzu/graph-framework-for-microservices/gqlgen/graphql/introspection" -) - -// region ************************** generated!.gotpl ************************** - -// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. -func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { - return &executableSchema{ - resolvers: cfg.Resolvers, - directives: cfg.Directives, - complexity: cfg.Complexity, - } -} - -type Config struct { - Resolvers ResolverRoot - Directives DirectiveRoot - Complexity ComplexityRoot -} - -type ResolverRoot interface { - Query() QueryResolver - Config_Config() Config_ConfigResolver - Gns_Gns() Gns_GnsResolver - Policypkg_AccessControlPolicy() Policypkg_AccessControlPolicyResolver - Policypkg_VMpolicy() Policypkg_VMpolicyResolver - Root_Root() Root_RootResolver -} - -type DirectiveRoot struct { -} - -type ComplexityRoot struct { - NexusGraphqlResponse struct { - Code func(childComplexity int) int - Data func(childComplexity int) int - Last func(childComplexity int) int - Message func(childComplexity int) int - TotalRecords func(childComplexity int) int - } - - Query struct { - Root func(childComplexity int) int - } - - TimeSeriesData struct { - Code func(childComplexity int) int - Data func(childComplexity int) int - Last func(childComplexity int) int - Message func(childComplexity int) int - TotalRecords func(childComplexity int) int - } - - Config_Config struct { - ABCHost func(childComplexity int) int - ACPPolicies func(childComplexity int, id *string) int - ClusterNamespaces func(childComplexity int) int - CuOption func(childComplexity int) int - DNS func(childComplexity int) int - Domain func(childComplexity int, id *string) int - FooExample func(childComplexity int, id *string) int - GNS func(childComplexity int, id *string) int - Id func(childComplexity int) int - Instance func(childComplexity int) int - MyStr0 func(childComplexity int) int - MyStr1 func(childComplexity int) int - MyStr2 func(childComplexity int) int - ParentLabels func(childComplexity int) int - QueryExample func(childComplexity int, startTime *string, endTime *string, interval *string, isServiceDeployment *bool, startVal *int) int - SvcGrpInfo func(childComplexity int, id *string) int - TestValMarkers func(childComplexity int) int - VMPPolicies func(childComplexity int, id *string) int - XYZPort func(childComplexity int) int - } - - Config_Domain struct { - Id func(childComplexity int) int - MapOfArrsPoints func(childComplexity int) int - ParentLabels func(childComplexity int) int - PointInt func(childComplexity int) int - PointMap func(childComplexity int) int - PointPort func(childComplexity int) int - PointSlice func(childComplexity int) int - PointString func(childComplexity int) int - PointStruct func(childComplexity int) int - SliceOfArrPoints func(childComplexity int) int - SliceOfPoints func(childComplexity int) int - } - - Config_FooTypeABC struct { - FooA func(childComplexity int) int - FooB func(childComplexity int) int - FooD func(childComplexity int) int - FooF func(childComplexity int) int - Id func(childComplexity int) int - ParentLabels func(childComplexity int) int - } - - Gns_BarChild struct { - Id func(childComplexity int) int - Name func(childComplexity int) int - ParentLabels func(childComplexity int) int - } - - Gns_Dns struct { - Id func(childComplexity int) int - ParentLabels func(childComplexity int) int - } - - Gns_Gns struct { - Description func(childComplexity int) int - DifferentSpec func(childComplexity int) int - Domain func(childComplexity int) int - FooChild func(childComplexity int) int - GnsAccessControlPolicy func(childComplexity int, id *string) int - Id func(childComplexity int) int - MapPointer func(childComplexity int) int - Meta func(childComplexity int) int - OtherDescription func(childComplexity int) int - ParentLabels func(childComplexity int) int - Port func(childComplexity int) int - QueryGns1 func(childComplexity int, startTime *string, endTime *string, interval *string, isServiceDeployment *bool, startVal *int) int - QueryGnsQM func(childComplexity int, startTime *string, endTime *string, timeInterval *string, someUserArg1 *string, someUserArg2 *int, someUserArg3 *bool) int - QueryGnsQM1 func(childComplexity int) int - ServiceSegmentRef func(childComplexity int) int - ServiceSegmentRefMap func(childComplexity int) int - ServiceSegmentRefPointer func(childComplexity int) int - ServiceSegmentRefs func(childComplexity int) int - SlicePointer func(childComplexity int) int - UseSharedGateway func(childComplexity int) int - WorkloadSpec func(childComplexity int) int - } - - Gns_IgnoreChild struct { - Id func(childComplexity int) int - Name func(childComplexity int) int - ParentLabels func(childComplexity int) int - } - - Policypkg_ACPConfig struct { - Conditions func(childComplexity int) int - Description func(childComplexity int) int - DisplayName func(childComplexity int) int - Gns func(childComplexity int) int - Id func(childComplexity int) int - ParentLabels func(childComplexity int) int - ProjectId func(childComplexity int) int - Tags func(childComplexity int) int - } - - Policypkg_AccessControlPolicy struct { - Id func(childComplexity int) int - ParentLabels func(childComplexity int) int - PolicyConfigs func(childComplexity int, id *string) int - } - - Policypkg_VMpolicy struct { - Id func(childComplexity int) int - ParentLabels func(childComplexity int) int - QueryGns1 func(childComplexity int, startTime *string, endTime *string, interval *string, isServiceDeployment *bool, startVal *int) int - QueryGnsQM func(childComplexity int, startTime *string, endTime *string, timeInterval *string, someUserArg1 *string, someUserArg2 *int, someUserArg3 *bool) int - QueryGnsQM1 func(childComplexity int) int - } - - Root_Root struct { - Config func(childComplexity int, id *string) int - Id func(childComplexity int) int - ParentLabels func(childComplexity int) int - } - - Servicegroup_SvcGroupLinkInfo struct { - ClusterName func(childComplexity int) int - DomainName func(childComplexity int) int - Id func(childComplexity int) int - ParentLabels func(childComplexity int) int - ServiceName func(childComplexity int) int - ServiceType func(childComplexity int) int - } -} - -type QueryResolver interface { - Root(ctx context.Context) (*model.RootRoot, error) -} -type Config_ConfigResolver interface { - QueryExample(ctx context.Context, obj *model.ConfigConfig, startTime *string, endTime *string, interval *string, isServiceDeployment *bool, startVal *int) (*model.NexusGraphqlResponse, error) - ACPPolicies(ctx context.Context, obj *model.ConfigConfig, id *string) ([]*model.PolicypkgAccessControlPolicy, error) - FooExample(ctx context.Context, obj *model.ConfigConfig, id *string) ([]*model.ConfigFooTypeABC, error) - - GNS(ctx context.Context, obj *model.ConfigConfig, id *string) (*model.GnsGns, error) - DNS(ctx context.Context, obj *model.ConfigConfig) (*model.GnsDns, error) - VMPPolicies(ctx context.Context, obj *model.ConfigConfig, id *string) (*model.PolicypkgVMpolicy, error) - Domain(ctx context.Context, obj *model.ConfigConfig, id *string) (*model.ConfigDomain, error) - SvcGrpInfo(ctx context.Context, obj *model.ConfigConfig, id *string) (*model.ServicegroupSvcGroupLinkInfo, error) -} -type Gns_GnsResolver interface { - QueryGns1(ctx context.Context, obj *model.GnsGns, startTime *string, endTime *string, interval *string, isServiceDeployment *bool, startVal *int) (*model.NexusGraphqlResponse, error) - QueryGnsQM1(ctx context.Context, obj *model.GnsGns) (*model.TimeSeriesData, error) - QueryGnsQM(ctx context.Context, obj *model.GnsGns, startTime *string, endTime *string, timeInterval *string, someUserArg1 *string, someUserArg2 *int, someUserArg3 *bool) (*model.TimeSeriesData, error) - - GnsAccessControlPolicy(ctx context.Context, obj *model.GnsGns, id *string) (*model.PolicypkgAccessControlPolicy, error) - FooChild(ctx context.Context, obj *model.GnsGns) (*model.GnsBarChild, error) -} -type Policypkg_AccessControlPolicyResolver interface { - PolicyConfigs(ctx context.Context, obj *model.PolicypkgAccessControlPolicy, id *string) ([]*model.PolicypkgACPConfig, error) -} -type Policypkg_VMpolicyResolver interface { - QueryGns1(ctx context.Context, obj *model.PolicypkgVMpolicy, startTime *string, endTime *string, interval *string, isServiceDeployment *bool, startVal *int) (*model.NexusGraphqlResponse, error) - QueryGnsQM1(ctx context.Context, obj *model.PolicypkgVMpolicy) (*model.TimeSeriesData, error) - QueryGnsQM(ctx context.Context, obj *model.PolicypkgVMpolicy, startTime *string, endTime *string, timeInterval *string, someUserArg1 *string, someUserArg2 *int, someUserArg3 *bool) (*model.TimeSeriesData, error) -} -type Root_RootResolver interface { - Config(ctx context.Context, obj *model.RootRoot, id *string) (*model.ConfigConfig, error) -} - -type executableSchema struct { - resolvers ResolverRoot - directives DirectiveRoot - complexity ComplexityRoot -} - -func (e *executableSchema) Schema() *ast.Schema { - return parsedSchema -} - -func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { - ec := executionContext{nil, e} - _ = ec - switch typeName + "." + field { - - case "NexusGraphqlResponse.Code": - if e.complexity.NexusGraphqlResponse.Code == nil { - break - } - - return e.complexity.NexusGraphqlResponse.Code(childComplexity), true - - case "NexusGraphqlResponse.Data": - if e.complexity.NexusGraphqlResponse.Data == nil { - break - } - - return e.complexity.NexusGraphqlResponse.Data(childComplexity), true - - case "NexusGraphqlResponse.Last": - if e.complexity.NexusGraphqlResponse.Last == nil { - break - } - - return e.complexity.NexusGraphqlResponse.Last(childComplexity), true - - case "NexusGraphqlResponse.Message": - if e.complexity.NexusGraphqlResponse.Message == nil { - break - } - - return e.complexity.NexusGraphqlResponse.Message(childComplexity), true - - case "NexusGraphqlResponse.TotalRecords": - if e.complexity.NexusGraphqlResponse.TotalRecords == nil { - break - } - - return e.complexity.NexusGraphqlResponse.TotalRecords(childComplexity), true - - case "Query.root": - if e.complexity.Query.Root == nil { - break - } - - return e.complexity.Query.Root(childComplexity), true - - case "TimeSeriesData.Code": - if e.complexity.TimeSeriesData.Code == nil { - break - } - - return e.complexity.TimeSeriesData.Code(childComplexity), true - - case "TimeSeriesData.Data": - if e.complexity.TimeSeriesData.Data == nil { - break - } - - return e.complexity.TimeSeriesData.Data(childComplexity), true - - case "TimeSeriesData.Last": - if e.complexity.TimeSeriesData.Last == nil { - break - } - - return e.complexity.TimeSeriesData.Last(childComplexity), true - - case "TimeSeriesData.Message": - if e.complexity.TimeSeriesData.Message == nil { - break - } - - return e.complexity.TimeSeriesData.Message(childComplexity), true - - case "TimeSeriesData.TotalRecords": - if e.complexity.TimeSeriesData.TotalRecords == nil { - break - } - - return e.complexity.TimeSeriesData.TotalRecords(childComplexity), true - - case "config_Config.ABCHost": - if e.complexity.Config_Config.ABCHost == nil { - break - } - - return e.complexity.Config_Config.ABCHost(childComplexity), true - - case "config_Config.ACPPolicies": - if e.complexity.Config_Config.ACPPolicies == nil { - break - } - - args, err := ec.field_config_Config_ACPPolicies_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Config_Config.ACPPolicies(childComplexity, args["Id"].(*string)), true - - case "config_Config.ClusterNamespaces": - if e.complexity.Config_Config.ClusterNamespaces == nil { - break - } - - return e.complexity.Config_Config.ClusterNamespaces(childComplexity), true - - case "config_Config.CuOption": - if e.complexity.Config_Config.CuOption == nil { - break - } - - return e.complexity.Config_Config.CuOption(childComplexity), true - - case "config_Config.DNS": - if e.complexity.Config_Config.DNS == nil { - break - } - - return e.complexity.Config_Config.DNS(childComplexity), true - - case "config_Config.Domain": - if e.complexity.Config_Config.Domain == nil { - break - } - - args, err := ec.field_config_Config_Domain_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Config_Config.Domain(childComplexity, args["Id"].(*string)), true - - case "config_Config.FooExample": - if e.complexity.Config_Config.FooExample == nil { - break - } - - args, err := ec.field_config_Config_FooExample_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Config_Config.FooExample(childComplexity, args["Id"].(*string)), true - - case "config_Config.GNS": - if e.complexity.Config_Config.GNS == nil { - break - } - - args, err := ec.field_config_Config_GNS_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Config_Config.GNS(childComplexity, args["Id"].(*string)), true - - case "config_Config.Id": - if e.complexity.Config_Config.Id == nil { - break - } - - return e.complexity.Config_Config.Id(childComplexity), true - - case "config_Config.Instance": - if e.complexity.Config_Config.Instance == nil { - break - } - - return e.complexity.Config_Config.Instance(childComplexity), true - - case "config_Config.MyStr0": - if e.complexity.Config_Config.MyStr0 == nil { - break - } - - return e.complexity.Config_Config.MyStr0(childComplexity), true - - case "config_Config.MyStr1": - if e.complexity.Config_Config.MyStr1 == nil { - break - } - - return e.complexity.Config_Config.MyStr1(childComplexity), true - - case "config_Config.MyStr2": - if e.complexity.Config_Config.MyStr2 == nil { - break - } - - return e.complexity.Config_Config.MyStr2(childComplexity), true - - case "config_Config.ParentLabels": - if e.complexity.Config_Config.ParentLabels == nil { - break - } - - return e.complexity.Config_Config.ParentLabels(childComplexity), true - - case "config_Config.QueryExample": - if e.complexity.Config_Config.QueryExample == nil { - break - } - - args, err := ec.field_config_Config_QueryExample_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Config_Config.QueryExample(childComplexity, args["StartTime"].(*string), args["EndTime"].(*string), args["Interval"].(*string), args["IsServiceDeployment"].(*bool), args["StartVal"].(*int)), true - - case "config_Config.SvcGrpInfo": - if e.complexity.Config_Config.SvcGrpInfo == nil { - break - } - - args, err := ec.field_config_Config_SvcGrpInfo_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Config_Config.SvcGrpInfo(childComplexity, args["Id"].(*string)), true - - case "config_Config.TestValMarkers": - if e.complexity.Config_Config.TestValMarkers == nil { - break - } - - return e.complexity.Config_Config.TestValMarkers(childComplexity), true - - case "config_Config.VMPPolicies": - if e.complexity.Config_Config.VMPPolicies == nil { - break - } - - args, err := ec.field_config_Config_VMPPolicies_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Config_Config.VMPPolicies(childComplexity, args["Id"].(*string)), true - - case "config_Config.XYZPort": - if e.complexity.Config_Config.XYZPort == nil { - break - } - - return e.complexity.Config_Config.XYZPort(childComplexity), true - - case "config_Domain.Id": - if e.complexity.Config_Domain.Id == nil { - break - } - - return e.complexity.Config_Domain.Id(childComplexity), true - - case "config_Domain.MapOfArrsPoints": - if e.complexity.Config_Domain.MapOfArrsPoints == nil { - break - } - - return e.complexity.Config_Domain.MapOfArrsPoints(childComplexity), true - - case "config_Domain.ParentLabels": - if e.complexity.Config_Domain.ParentLabels == nil { - break - } - - return e.complexity.Config_Domain.ParentLabels(childComplexity), true - - case "config_Domain.PointInt": - if e.complexity.Config_Domain.PointInt == nil { - break - } - - return e.complexity.Config_Domain.PointInt(childComplexity), true - - case "config_Domain.PointMap": - if e.complexity.Config_Domain.PointMap == nil { - break - } - - return e.complexity.Config_Domain.PointMap(childComplexity), true - - case "config_Domain.PointPort": - if e.complexity.Config_Domain.PointPort == nil { - break - } - - return e.complexity.Config_Domain.PointPort(childComplexity), true - - case "config_Domain.PointSlice": - if e.complexity.Config_Domain.PointSlice == nil { - break - } - - return e.complexity.Config_Domain.PointSlice(childComplexity), true - - case "config_Domain.PointString": - if e.complexity.Config_Domain.PointString == nil { - break - } - - return e.complexity.Config_Domain.PointString(childComplexity), true - - case "config_Domain.PointStruct": - if e.complexity.Config_Domain.PointStruct == nil { - break - } - - return e.complexity.Config_Domain.PointStruct(childComplexity), true - - case "config_Domain.SliceOfArrPoints": - if e.complexity.Config_Domain.SliceOfArrPoints == nil { - break - } - - return e.complexity.Config_Domain.SliceOfArrPoints(childComplexity), true - - case "config_Domain.SliceOfPoints": - if e.complexity.Config_Domain.SliceOfPoints == nil { - break - } - - return e.complexity.Config_Domain.SliceOfPoints(childComplexity), true - - case "config_FooTypeABC.FooA": - if e.complexity.Config_FooTypeABC.FooA == nil { - break - } - - return e.complexity.Config_FooTypeABC.FooA(childComplexity), true - - case "config_FooTypeABC.FooB": - if e.complexity.Config_FooTypeABC.FooB == nil { - break - } - - return e.complexity.Config_FooTypeABC.FooB(childComplexity), true - - case "config_FooTypeABC.FooD": - if e.complexity.Config_FooTypeABC.FooD == nil { - break - } - - return e.complexity.Config_FooTypeABC.FooD(childComplexity), true - - case "config_FooTypeABC.FooF": - if e.complexity.Config_FooTypeABC.FooF == nil { - break - } - - return e.complexity.Config_FooTypeABC.FooF(childComplexity), true - - case "config_FooTypeABC.Id": - if e.complexity.Config_FooTypeABC.Id == nil { - break - } - - return e.complexity.Config_FooTypeABC.Id(childComplexity), true - - case "config_FooTypeABC.ParentLabels": - if e.complexity.Config_FooTypeABC.ParentLabels == nil { - break - } - - return e.complexity.Config_FooTypeABC.ParentLabels(childComplexity), true - - case "gns_BarChild.Id": - if e.complexity.Gns_BarChild.Id == nil { - break - } - - return e.complexity.Gns_BarChild.Id(childComplexity), true - - case "gns_BarChild.Name": - if e.complexity.Gns_BarChild.Name == nil { - break - } - - return e.complexity.Gns_BarChild.Name(childComplexity), true - - case "gns_BarChild.ParentLabels": - if e.complexity.Gns_BarChild.ParentLabels == nil { - break - } - - return e.complexity.Gns_BarChild.ParentLabels(childComplexity), true - - case "gns_Dns.Id": - if e.complexity.Gns_Dns.Id == nil { - break - } - - return e.complexity.Gns_Dns.Id(childComplexity), true - - case "gns_Dns.ParentLabels": - if e.complexity.Gns_Dns.ParentLabels == nil { - break - } - - return e.complexity.Gns_Dns.ParentLabels(childComplexity), true - - case "gns_Gns.Description": - if e.complexity.Gns_Gns.Description == nil { - break - } - - return e.complexity.Gns_Gns.Description(childComplexity), true - - case "gns_Gns.DifferentSpec": - if e.complexity.Gns_Gns.DifferentSpec == nil { - break - } - - return e.complexity.Gns_Gns.DifferentSpec(childComplexity), true - - case "gns_Gns.Domain": - if e.complexity.Gns_Gns.Domain == nil { - break - } - - return e.complexity.Gns_Gns.Domain(childComplexity), true - - case "gns_Gns.FooChild": - if e.complexity.Gns_Gns.FooChild == nil { - break - } - - return e.complexity.Gns_Gns.FooChild(childComplexity), true - - case "gns_Gns.GnsAccessControlPolicy": - if e.complexity.Gns_Gns.GnsAccessControlPolicy == nil { - break - } - - args, err := ec.field_gns_Gns_GnsAccessControlPolicy_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Gns_Gns.GnsAccessControlPolicy(childComplexity, args["Id"].(*string)), true - - case "gns_Gns.Id": - if e.complexity.Gns_Gns.Id == nil { - break - } - - return e.complexity.Gns_Gns.Id(childComplexity), true - - case "gns_Gns.MapPointer": - if e.complexity.Gns_Gns.MapPointer == nil { - break - } - - return e.complexity.Gns_Gns.MapPointer(childComplexity), true - - case "gns_Gns.Meta": - if e.complexity.Gns_Gns.Meta == nil { - break - } - - return e.complexity.Gns_Gns.Meta(childComplexity), true - - case "gns_Gns.OtherDescription": - if e.complexity.Gns_Gns.OtherDescription == nil { - break - } - - return e.complexity.Gns_Gns.OtherDescription(childComplexity), true - - case "gns_Gns.ParentLabels": - if e.complexity.Gns_Gns.ParentLabels == nil { - break - } - - return e.complexity.Gns_Gns.ParentLabels(childComplexity), true - - case "gns_Gns.Port": - if e.complexity.Gns_Gns.Port == nil { - break - } - - return e.complexity.Gns_Gns.Port(childComplexity), true - - case "gns_Gns.queryGns1": - if e.complexity.Gns_Gns.QueryGns1 == nil { - break - } - - args, err := ec.field_gns_Gns_queryGns1_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Gns_Gns.QueryGns1(childComplexity, args["StartTime"].(*string), args["EndTime"].(*string), args["Interval"].(*string), args["IsServiceDeployment"].(*bool), args["StartVal"].(*int)), true - - case "gns_Gns.queryGnsQM": - if e.complexity.Gns_Gns.QueryGnsQM == nil { - break - } - - args, err := ec.field_gns_Gns_queryGnsQM_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Gns_Gns.QueryGnsQM(childComplexity, args["StartTime"].(*string), args["EndTime"].(*string), args["TimeInterval"].(*string), args["SomeUserArg1"].(*string), args["SomeUserArg2"].(*int), args["SomeUserArg3"].(*bool)), true - - case "gns_Gns.queryGnsQM1": - if e.complexity.Gns_Gns.QueryGnsQM1 == nil { - break - } - - return e.complexity.Gns_Gns.QueryGnsQM1(childComplexity), true - - case "gns_Gns.ServiceSegmentRef": - if e.complexity.Gns_Gns.ServiceSegmentRef == nil { - break - } - - return e.complexity.Gns_Gns.ServiceSegmentRef(childComplexity), true - - case "gns_Gns.ServiceSegmentRefMap": - if e.complexity.Gns_Gns.ServiceSegmentRefMap == nil { - break - } - - return e.complexity.Gns_Gns.ServiceSegmentRefMap(childComplexity), true - - case "gns_Gns.ServiceSegmentRefPointer": - if e.complexity.Gns_Gns.ServiceSegmentRefPointer == nil { - break - } - - return e.complexity.Gns_Gns.ServiceSegmentRefPointer(childComplexity), true - - case "gns_Gns.ServiceSegmentRefs": - if e.complexity.Gns_Gns.ServiceSegmentRefs == nil { - break - } - - return e.complexity.Gns_Gns.ServiceSegmentRefs(childComplexity), true - - case "gns_Gns.SlicePointer": - if e.complexity.Gns_Gns.SlicePointer == nil { - break - } - - return e.complexity.Gns_Gns.SlicePointer(childComplexity), true - - case "gns_Gns.UseSharedGateway": - if e.complexity.Gns_Gns.UseSharedGateway == nil { - break - } - - return e.complexity.Gns_Gns.UseSharedGateway(childComplexity), true - - case "gns_Gns.WorkloadSpec": - if e.complexity.Gns_Gns.WorkloadSpec == nil { - break - } - - return e.complexity.Gns_Gns.WorkloadSpec(childComplexity), true - - case "gns_IgnoreChild.Id": - if e.complexity.Gns_IgnoreChild.Id == nil { - break - } - - return e.complexity.Gns_IgnoreChild.Id(childComplexity), true - - case "gns_IgnoreChild.Name": - if e.complexity.Gns_IgnoreChild.Name == nil { - break - } - - return e.complexity.Gns_IgnoreChild.Name(childComplexity), true - - case "gns_IgnoreChild.ParentLabels": - if e.complexity.Gns_IgnoreChild.ParentLabels == nil { - break - } - - return e.complexity.Gns_IgnoreChild.ParentLabels(childComplexity), true - - case "policypkg_ACPConfig.Conditions": - if e.complexity.Policypkg_ACPConfig.Conditions == nil { - break - } - - return e.complexity.Policypkg_ACPConfig.Conditions(childComplexity), true - - case "policypkg_ACPConfig.Description": - if e.complexity.Policypkg_ACPConfig.Description == nil { - break - } - - return e.complexity.Policypkg_ACPConfig.Description(childComplexity), true - - case "policypkg_ACPConfig.DisplayName": - if e.complexity.Policypkg_ACPConfig.DisplayName == nil { - break - } - - return e.complexity.Policypkg_ACPConfig.DisplayName(childComplexity), true - - case "policypkg_ACPConfig.Gns": - if e.complexity.Policypkg_ACPConfig.Gns == nil { - break - } - - return e.complexity.Policypkg_ACPConfig.Gns(childComplexity), true - - case "policypkg_ACPConfig.Id": - if e.complexity.Policypkg_ACPConfig.Id == nil { - break - } - - return e.complexity.Policypkg_ACPConfig.Id(childComplexity), true - - case "policypkg_ACPConfig.ParentLabels": - if e.complexity.Policypkg_ACPConfig.ParentLabels == nil { - break - } - - return e.complexity.Policypkg_ACPConfig.ParentLabels(childComplexity), true - - case "policypkg_ACPConfig.ProjectId": - if e.complexity.Policypkg_ACPConfig.ProjectId == nil { - break - } - - return e.complexity.Policypkg_ACPConfig.ProjectId(childComplexity), true - - case "policypkg_ACPConfig.Tags": - if e.complexity.Policypkg_ACPConfig.Tags == nil { - break - } - - return e.complexity.Policypkg_ACPConfig.Tags(childComplexity), true - - case "policypkg_AccessControlPolicy.Id": - if e.complexity.Policypkg_AccessControlPolicy.Id == nil { - break - } - - return e.complexity.Policypkg_AccessControlPolicy.Id(childComplexity), true - - case "policypkg_AccessControlPolicy.ParentLabels": - if e.complexity.Policypkg_AccessControlPolicy.ParentLabels == nil { - break - } - - return e.complexity.Policypkg_AccessControlPolicy.ParentLabels(childComplexity), true - - case "policypkg_AccessControlPolicy.PolicyConfigs": - if e.complexity.Policypkg_AccessControlPolicy.PolicyConfigs == nil { - break - } - - args, err := ec.field_policypkg_AccessControlPolicy_PolicyConfigs_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Policypkg_AccessControlPolicy.PolicyConfigs(childComplexity, args["Id"].(*string)), true - - case "policypkg_VMpolicy.Id": - if e.complexity.Policypkg_VMpolicy.Id == nil { - break - } - - return e.complexity.Policypkg_VMpolicy.Id(childComplexity), true - - case "policypkg_VMpolicy.ParentLabels": - if e.complexity.Policypkg_VMpolicy.ParentLabels == nil { - break - } - - return e.complexity.Policypkg_VMpolicy.ParentLabels(childComplexity), true - - case "policypkg_VMpolicy.queryGns1": - if e.complexity.Policypkg_VMpolicy.QueryGns1 == nil { - break - } - - args, err := ec.field_policypkg_VMpolicy_queryGns1_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Policypkg_VMpolicy.QueryGns1(childComplexity, args["StartTime"].(*string), args["EndTime"].(*string), args["Interval"].(*string), args["IsServiceDeployment"].(*bool), args["StartVal"].(*int)), true - - case "policypkg_VMpolicy.queryGnsQM": - if e.complexity.Policypkg_VMpolicy.QueryGnsQM == nil { - break - } - - args, err := ec.field_policypkg_VMpolicy_queryGnsQM_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Policypkg_VMpolicy.QueryGnsQM(childComplexity, args["StartTime"].(*string), args["EndTime"].(*string), args["TimeInterval"].(*string), args["SomeUserArg1"].(*string), args["SomeUserArg2"].(*int), args["SomeUserArg3"].(*bool)), true - - case "policypkg_VMpolicy.queryGnsQM1": - if e.complexity.Policypkg_VMpolicy.QueryGnsQM1 == nil { - break - } - - return e.complexity.Policypkg_VMpolicy.QueryGnsQM1(childComplexity), true - - case "root_Root.Config": - if e.complexity.Root_Root.Config == nil { - break - } - - args, err := ec.field_root_Root_Config_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Root_Root.Config(childComplexity, args["Id"].(*string)), true - - case "root_Root.Id": - if e.complexity.Root_Root.Id == nil { - break - } - - return e.complexity.Root_Root.Id(childComplexity), true - - case "root_Root.ParentLabels": - if e.complexity.Root_Root.ParentLabels == nil { - break - } - - return e.complexity.Root_Root.ParentLabels(childComplexity), true - - case "servicegroup_SvcGroupLinkInfo.ClusterName": - if e.complexity.Servicegroup_SvcGroupLinkInfo.ClusterName == nil { - break - } - - return e.complexity.Servicegroup_SvcGroupLinkInfo.ClusterName(childComplexity), true - - case "servicegroup_SvcGroupLinkInfo.DomainName": - if e.complexity.Servicegroup_SvcGroupLinkInfo.DomainName == nil { - break - } - - return e.complexity.Servicegroup_SvcGroupLinkInfo.DomainName(childComplexity), true - - case "servicegroup_SvcGroupLinkInfo.Id": - if e.complexity.Servicegroup_SvcGroupLinkInfo.Id == nil { - break - } - - return e.complexity.Servicegroup_SvcGroupLinkInfo.Id(childComplexity), true - - case "servicegroup_SvcGroupLinkInfo.ParentLabels": - if e.complexity.Servicegroup_SvcGroupLinkInfo.ParentLabels == nil { - break - } - - return e.complexity.Servicegroup_SvcGroupLinkInfo.ParentLabels(childComplexity), true - - case "servicegroup_SvcGroupLinkInfo.ServiceName": - if e.complexity.Servicegroup_SvcGroupLinkInfo.ServiceName == nil { - break - } - - return e.complexity.Servicegroup_SvcGroupLinkInfo.ServiceName(childComplexity), true - - case "servicegroup_SvcGroupLinkInfo.ServiceType": - if e.complexity.Servicegroup_SvcGroupLinkInfo.ServiceType == nil { - break - } - - return e.complexity.Servicegroup_SvcGroupLinkInfo.ServiceType(childComplexity), true - - } - return 0, false -} - -func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { - rc := graphql.GetOperationContext(ctx) - ec := executionContext{rc, e} - inputUnmarshalMap := graphql.BuildUnmarshalerMap() - first := true - - switch rc.Operation.Operation { - case ast.Query: - return func(ctx context.Context) *graphql.Response { - if !first { - return nil - } - first = false - ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) - data := ec._Query(ctx, rc.Operation.SelectionSet) - var buf bytes.Buffer - data.MarshalGQL(&buf) - - return &graphql.Response{ - Data: buf.Bytes(), - } - } - - default: - return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) - } -} - -type executionContext struct { - *graphql.OperationContext - *executableSchema -} - -func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapSchema(parsedSchema), nil -} - -func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil -} - -var sources = []*ast.Source{ - {Name: "../schema.graphqls", Input: `scalar Map -type Query { - root: root_Root -} - -type root_Root { - Id: ID - ParentLabels: Map - - Config(Id: ID): config_Config! -} - -type config_Config { - Id: ID - ParentLabels: Map - QueryExample( - StartTime: String - EndTime: String - Interval: String - IsServiceDeployment: Boolean - StartVal: Int - ): NexusGraphqlResponse - - ACPPolicies(Id: ID): [policypkg_AccessControlPolicy!] - FooExample(Id: ID): [config_FooTypeABC!] - MyStr0: String - MyStr1: String - MyStr2: String - XYZPort: String - ABCHost: String - ClusterNamespaces: String - TestValMarkers: String - Instance: Float - CuOption: String - GNS(Id: ID): gns_Gns! - DNS: gns_Dns! - VMPPolicies(Id: ID): policypkg_VMpolicy! - Domain(Id: ID): config_Domain! - SvcGrpInfo(Id: ID): servicegroup_SvcGroupLinkInfo! -} - -type config_FooTypeABC { - Id: ID - ParentLabels: Map - - FooA: String - FooB: String - FooD: String - FooF: String -} - -type config_Domain { - Id: ID - ParentLabels: Map - - PointPort: String - PointString: String - PointInt: Int - PointMap: String - PointSlice: String - SliceOfPoints: String - SliceOfArrPoints: String - MapOfArrsPoints: String - PointStruct: String -} - -type gns_Gns { - Id: ID - ParentLabels: Map - queryGns1( - StartTime: String - EndTime: String - Interval: String - IsServiceDeployment: Boolean - StartVal: Int - ): NexusGraphqlResponse - queryGnsQM1: TimeSeriesData - queryGnsQM( - StartTime: String - EndTime: String - TimeInterval: String - SomeUserArg1: String - SomeUserArg2: Int - SomeUserArg3: Boolean - ): TimeSeriesData - - Domain: String - UseSharedGateway: Boolean - Description: String - Meta: String - Port: Int - OtherDescription: String - MapPointer: String - SlicePointer: String - WorkloadSpec: String - DifferentSpec: String - ServiceSegmentRef: String - ServiceSegmentRefPointer: String - ServiceSegmentRefs: String - ServiceSegmentRefMap: String - GnsAccessControlPolicy(Id: ID): policypkg_AccessControlPolicy! - FooChild: gns_BarChild! -} - -type gns_BarChild { - Id: ID - ParentLabels: Map - - Name: String -} - -type gns_IgnoreChild { - Id: ID - ParentLabels: Map - - Name: String -} - -type gns_Dns { - Id: ID - ParentLabels: Map - -} - -type servicegroup_SvcGroupLinkInfo { - Id: ID - ParentLabels: Map - - ClusterName: String - DomainName: String - ServiceName: String - ServiceType: String -} - -type policypkg_AccessControlPolicy { - Id: ID - ParentLabels: Map - - PolicyConfigs(Id: ID): [policypkg_ACPConfig!] -} - -type policypkg_ACPConfig { - Id: ID - ParentLabels: Map - - DisplayName: String - Gns: String - Description: String - Tags: String - ProjectId: String - Conditions: String -} - -type policypkg_VMpolicy { - Id: ID - ParentLabels: Map - queryGns1( - StartTime: String - EndTime: String - Interval: String - IsServiceDeployment: Boolean - StartVal: Int - ): NexusGraphqlResponse - queryGnsQM1: TimeSeriesData - queryGnsQM( - StartTime: String - EndTime: String - TimeInterval: String - SomeUserArg1: String - SomeUserArg2: Int - SomeUserArg3: Boolean - ): TimeSeriesData - -} - -type NexusGraphqlResponse { - Code: Int - Message: String - Data: String - Last: String - TotalRecords: Int -} - -type TimeSeriesData { - Code: Int - Message: String - Data: String - Last: String - TotalRecords: Int -} -`, BuiltIn: false}, -} -var parsedSchema = gqlparser.MustLoadSchema(sources...) - -// endregion ************************** generated!.gotpl ************************** - -// region ***************************** args.gotpl ***************************** - -func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["name"] = arg0 - return args, nil -} - -func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) - arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) - if err != nil { - return nil, err - } - } - args["includeDeprecated"] = arg0 - return args, nil -} - -func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) - arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) - if err != nil { - return nil, err - } - } - args["includeDeprecated"] = arg0 - return args, nil -} - -func (ec *executionContext) field_config_Config_ACPPolicies_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["Id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Id")) - arg0, err = ec.unmarshalOID2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["Id"] = arg0 - return args, nil -} - -func (ec *executionContext) field_config_Config_Domain_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["Id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Id")) - arg0, err = ec.unmarshalOID2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["Id"] = arg0 - return args, nil -} - -func (ec *executionContext) field_config_Config_FooExample_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["Id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Id")) - arg0, err = ec.unmarshalOID2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["Id"] = arg0 - return args, nil -} - -func (ec *executionContext) field_config_Config_GNS_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["Id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Id")) - arg0, err = ec.unmarshalOID2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["Id"] = arg0 - return args, nil -} - -func (ec *executionContext) field_config_Config_QueryExample_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["StartTime"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("StartTime")) - arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["StartTime"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["EndTime"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("EndTime")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["EndTime"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["Interval"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Interval")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["Interval"] = arg2 - var arg3 *bool - if tmp, ok := rawArgs["IsServiceDeployment"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("IsServiceDeployment")) - arg3, err = ec.unmarshalOBoolean2ᚖbool(ctx, tmp) - if err != nil { - return nil, err - } - } - args["IsServiceDeployment"] = arg3 - var arg4 *int - if tmp, ok := rawArgs["StartVal"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("StartVal")) - arg4, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } - } - args["StartVal"] = arg4 - return args, nil -} - -func (ec *executionContext) field_config_Config_SvcGrpInfo_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["Id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Id")) - arg0, err = ec.unmarshalOID2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["Id"] = arg0 - return args, nil -} - -func (ec *executionContext) field_config_Config_VMPPolicies_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["Id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Id")) - arg0, err = ec.unmarshalOID2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["Id"] = arg0 - return args, nil -} - -func (ec *executionContext) field_gns_Gns_GnsAccessControlPolicy_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["Id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Id")) - arg0, err = ec.unmarshalOID2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["Id"] = arg0 - return args, nil -} - -func (ec *executionContext) field_gns_Gns_queryGns1_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["StartTime"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("StartTime")) - arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["StartTime"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["EndTime"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("EndTime")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["EndTime"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["Interval"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Interval")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["Interval"] = arg2 - var arg3 *bool - if tmp, ok := rawArgs["IsServiceDeployment"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("IsServiceDeployment")) - arg3, err = ec.unmarshalOBoolean2ᚖbool(ctx, tmp) - if err != nil { - return nil, err - } - } - args["IsServiceDeployment"] = arg3 - var arg4 *int - if tmp, ok := rawArgs["StartVal"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("StartVal")) - arg4, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } - } - args["StartVal"] = arg4 - return args, nil -} - -func (ec *executionContext) field_gns_Gns_queryGnsQM_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["StartTime"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("StartTime")) - arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["StartTime"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["EndTime"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("EndTime")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["EndTime"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["TimeInterval"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("TimeInterval")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["TimeInterval"] = arg2 - var arg3 *string - if tmp, ok := rawArgs["SomeUserArg1"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("SomeUserArg1")) - arg3, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["SomeUserArg1"] = arg3 - var arg4 *int - if tmp, ok := rawArgs["SomeUserArg2"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("SomeUserArg2")) - arg4, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } - } - args["SomeUserArg2"] = arg4 - var arg5 *bool - if tmp, ok := rawArgs["SomeUserArg3"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("SomeUserArg3")) - arg5, err = ec.unmarshalOBoolean2ᚖbool(ctx, tmp) - if err != nil { - return nil, err - } - } - args["SomeUserArg3"] = arg5 - return args, nil -} - -func (ec *executionContext) field_policypkg_AccessControlPolicy_PolicyConfigs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["Id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Id")) - arg0, err = ec.unmarshalOID2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["Id"] = arg0 - return args, nil -} - -func (ec *executionContext) field_policypkg_VMpolicy_queryGns1_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["StartTime"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("StartTime")) - arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["StartTime"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["EndTime"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("EndTime")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["EndTime"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["Interval"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Interval")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["Interval"] = arg2 - var arg3 *bool - if tmp, ok := rawArgs["IsServiceDeployment"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("IsServiceDeployment")) - arg3, err = ec.unmarshalOBoolean2ᚖbool(ctx, tmp) - if err != nil { - return nil, err - } - } - args["IsServiceDeployment"] = arg3 - var arg4 *int - if tmp, ok := rawArgs["StartVal"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("StartVal")) - arg4, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } - } - args["StartVal"] = arg4 - return args, nil -} - -func (ec *executionContext) field_policypkg_VMpolicy_queryGnsQM_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["StartTime"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("StartTime")) - arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["StartTime"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["EndTime"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("EndTime")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["EndTime"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["TimeInterval"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("TimeInterval")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["TimeInterval"] = arg2 - var arg3 *string - if tmp, ok := rawArgs["SomeUserArg1"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("SomeUserArg1")) - arg3, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["SomeUserArg1"] = arg3 - var arg4 *int - if tmp, ok := rawArgs["SomeUserArg2"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("SomeUserArg2")) - arg4, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } - } - args["SomeUserArg2"] = arg4 - var arg5 *bool - if tmp, ok := rawArgs["SomeUserArg3"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("SomeUserArg3")) - arg5, err = ec.unmarshalOBoolean2ᚖbool(ctx, tmp) - if err != nil { - return nil, err - } - } - args["SomeUserArg3"] = arg5 - return args, nil -} - -func (ec *executionContext) field_root_Root_Config_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["Id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Id")) - arg0, err = ec.unmarshalOID2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["Id"] = arg0 - return args, nil -} - -// endregion ***************************** args.gotpl ***************************** - -// region ************************** directives.gotpl ************************** - -// endregion ************************** directives.gotpl ************************** - -// region **************************** field.gotpl ***************************** - -func (ec *executionContext) _NexusGraphqlResponse_Code(ctx context.Context, field graphql.CollectedField, obj *model.NexusGraphqlResponse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NexusGraphqlResponse_Code(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Code, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*int) - fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_NexusGraphqlResponse_Code(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NexusGraphqlResponse", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _NexusGraphqlResponse_Message(ctx context.Context, field graphql.CollectedField, obj *model.NexusGraphqlResponse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NexusGraphqlResponse_Message(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Message, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_NexusGraphqlResponse_Message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NexusGraphqlResponse", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _NexusGraphqlResponse_Data(ctx context.Context, field graphql.CollectedField, obj *model.NexusGraphqlResponse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NexusGraphqlResponse_Data(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Data, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_NexusGraphqlResponse_Data(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NexusGraphqlResponse", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _NexusGraphqlResponse_Last(ctx context.Context, field graphql.CollectedField, obj *model.NexusGraphqlResponse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NexusGraphqlResponse_Last(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Last, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_NexusGraphqlResponse_Last(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NexusGraphqlResponse", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _NexusGraphqlResponse_TotalRecords(ctx context.Context, field graphql.CollectedField, obj *model.NexusGraphqlResponse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NexusGraphqlResponse_TotalRecords(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TotalRecords, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*int) - fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_NexusGraphqlResponse_TotalRecords(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NexusGraphqlResponse", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_root(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_root(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Root(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.RootRoot) - fc.Result = res - return ec.marshalOroot_Root2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐRootRoot(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_root(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Id": - return ec.fieldContext_root_Root_Id(ctx, field) - case "ParentLabels": - return ec.fieldContext_root_Root_ParentLabels(ctx, field) - case "Config": - return ec.fieldContext_root_Root_Config(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type root_Root", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___type(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.introspectType(fc.Args["name"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___schema(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.introspectSchema() - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Schema) - fc.Result = res - return ec.marshalO__Schema2ᚖgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query___schema(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "description": - return ec.fieldContext___Schema_description(ctx, field) - case "types": - return ec.fieldContext___Schema_types(ctx, field) - case "queryType": - return ec.fieldContext___Schema_queryType(ctx, field) - case "mutationType": - return ec.fieldContext___Schema_mutationType(ctx, field) - case "subscriptionType": - return ec.fieldContext___Schema_subscriptionType(ctx, field) - case "directives": - return ec.fieldContext___Schema_directives(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _TimeSeriesData_Code(ctx context.Context, field graphql.CollectedField, obj *model.TimeSeriesData) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TimeSeriesData_Code(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Code, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*int) - fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TimeSeriesData_Code(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TimeSeriesData", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TimeSeriesData_Message(ctx context.Context, field graphql.CollectedField, obj *model.TimeSeriesData) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TimeSeriesData_Message(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Message, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TimeSeriesData_Message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TimeSeriesData", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TimeSeriesData_Data(ctx context.Context, field graphql.CollectedField, obj *model.TimeSeriesData) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TimeSeriesData_Data(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Data, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TimeSeriesData_Data(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TimeSeriesData", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TimeSeriesData_Last(ctx context.Context, field graphql.CollectedField, obj *model.TimeSeriesData) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TimeSeriesData_Last(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Last, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TimeSeriesData_Last(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TimeSeriesData", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TimeSeriesData_TotalRecords(ctx context.Context, field graphql.CollectedField, obj *model.TimeSeriesData) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TimeSeriesData_TotalRecords(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TotalRecords, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*int) - fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TimeSeriesData_TotalRecords(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TimeSeriesData", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Directive_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Directive", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Directive_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Directive", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_locations(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Locations, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]string) - fc.Result = res - return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Directive_locations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Directive", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __DirectiveLocation does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_args(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Args, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]introspection.InputValue) - fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Directive", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsRepeatable, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Directive", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___EnumValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___EnumValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_args(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Args, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]introspection.InputValue) - fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_type(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Type, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___InputValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_type(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Type, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___InputValue_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DefaultValue, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_types(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Types(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚕgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_queryType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.QueryType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_mutationType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MutationType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SubscriptionType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_directives(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Directives(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]introspection.Directive) - fc.Result = res - return ec.marshalN__Directive2ᚕgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Directive_name(ctx, field) - case "description": - return ec.fieldContext___Directive_description(ctx, field) - case "locations": - return ec.fieldContext___Directive_locations(ctx, field) - case "args": - return ec.fieldContext___Directive_args(ctx, field) - case "isRepeatable": - return ec.fieldContext___Directive_isRepeatable(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_kind(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalN__TypeKind2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __TypeKind does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_fields(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.Field) - fc.Result = res - return ec.marshalO__Field2ᚕgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Field_name(ctx, field) - case "description": - return ec.fieldContext___Field_description(ctx, field) - case "args": - return ec.fieldContext___Field_args(ctx, field) - case "type": - return ec.fieldContext___Field_type(ctx, field) - case "isDeprecated": - return ec.fieldContext___Field_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___Field_deprecationReason(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_interfaces(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Interfaces(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PossibleTypes(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_enumValues(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.EnumValue) - fc.Result = res - return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___EnumValue_name(ctx, field) - case "description": - return ec.fieldContext___EnumValue_description(ctx, field) - case "isDeprecated": - return ec.fieldContext___EnumValue_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___EnumValue_deprecationReason(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_inputFields(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.InputFields(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.InputValue) - fc.Result = res - return ec.marshalO__InputValue2ᚕgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_ofType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.OfType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SpecifiedByURL(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Config_Id(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_Id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Id, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOID2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_Id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Config_ParentLabels(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_ParentLabels(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ParentLabels, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_ParentLabels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Config_QueryExample(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_QueryExample(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Config_Config().QueryExample(rctx, obj, fc.Args["StartTime"].(*string), fc.Args["EndTime"].(*string), fc.Args["Interval"].(*string), fc.Args["IsServiceDeployment"].(*bool), fc.Args["StartVal"].(*int)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.NexusGraphqlResponse) - fc.Result = res - return ec.marshalONexusGraphqlResponse2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐNexusGraphqlResponse(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_QueryExample(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Code": - return ec.fieldContext_NexusGraphqlResponse_Code(ctx, field) - case "Message": - return ec.fieldContext_NexusGraphqlResponse_Message(ctx, field) - case "Data": - return ec.fieldContext_NexusGraphqlResponse_Data(ctx, field) - case "Last": - return ec.fieldContext_NexusGraphqlResponse_Last(ctx, field) - case "TotalRecords": - return ec.fieldContext_NexusGraphqlResponse_TotalRecords(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type NexusGraphqlResponse", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_config_Config_QueryExample_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _config_Config_ACPPolicies(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_ACPPolicies(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Config_Config().ACPPolicies(rctx, obj, fc.Args["Id"].(*string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*model.PolicypkgAccessControlPolicy) - fc.Result = res - return ec.marshalOpolicypkg_AccessControlPolicy2ᚕᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐPolicypkgAccessControlPolicyᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_ACPPolicies(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Id": - return ec.fieldContext_policypkg_AccessControlPolicy_Id(ctx, field) - case "ParentLabels": - return ec.fieldContext_policypkg_AccessControlPolicy_ParentLabels(ctx, field) - case "PolicyConfigs": - return ec.fieldContext_policypkg_AccessControlPolicy_PolicyConfigs(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type policypkg_AccessControlPolicy", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_config_Config_ACPPolicies_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _config_Config_FooExample(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_FooExample(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Config_Config().FooExample(rctx, obj, fc.Args["Id"].(*string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*model.ConfigFooTypeABC) - fc.Result = res - return ec.marshalOconfig_FooTypeABC2ᚕᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐConfigFooTypeABCᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_FooExample(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Id": - return ec.fieldContext_config_FooTypeABC_Id(ctx, field) - case "ParentLabels": - return ec.fieldContext_config_FooTypeABC_ParentLabels(ctx, field) - case "FooA": - return ec.fieldContext_config_FooTypeABC_FooA(ctx, field) - case "FooB": - return ec.fieldContext_config_FooTypeABC_FooB(ctx, field) - case "FooD": - return ec.fieldContext_config_FooTypeABC_FooD(ctx, field) - case "FooF": - return ec.fieldContext_config_FooTypeABC_FooF(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type config_FooTypeABC", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_config_Config_FooExample_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _config_Config_MyStr0(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_MyStr0(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MyStr0, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_MyStr0(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Config_MyStr1(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_MyStr1(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MyStr1, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_MyStr1(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Config_MyStr2(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_MyStr2(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MyStr2, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_MyStr2(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Config_XYZPort(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_XYZPort(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.XYZPort, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_XYZPort(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Config_ABCHost(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_ABCHost(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ABCHost, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_ABCHost(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Config_ClusterNamespaces(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_ClusterNamespaces(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterNamespaces, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_ClusterNamespaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Config_TestValMarkers(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_TestValMarkers(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TestValMarkers, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_TestValMarkers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Config_Instance(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_Instance(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Instance, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*float64) - fc.Result = res - return ec.marshalOFloat2ᚖfloat64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_Instance(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Float does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Config_CuOption(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_CuOption(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CuOption, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_CuOption(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Config_GNS(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_GNS(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Config_Config().GNS(rctx, obj, fc.Args["Id"].(*string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.GnsGns) - fc.Result = res - return ec.marshalNgns_Gns2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐGnsGns(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_GNS(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Id": - return ec.fieldContext_gns_Gns_Id(ctx, field) - case "ParentLabels": - return ec.fieldContext_gns_Gns_ParentLabels(ctx, field) - case "queryGns1": - return ec.fieldContext_gns_Gns_queryGns1(ctx, field) - case "queryGnsQM1": - return ec.fieldContext_gns_Gns_queryGnsQM1(ctx, field) - case "queryGnsQM": - return ec.fieldContext_gns_Gns_queryGnsQM(ctx, field) - case "Domain": - return ec.fieldContext_gns_Gns_Domain(ctx, field) - case "UseSharedGateway": - return ec.fieldContext_gns_Gns_UseSharedGateway(ctx, field) - case "Description": - return ec.fieldContext_gns_Gns_Description(ctx, field) - case "Meta": - return ec.fieldContext_gns_Gns_Meta(ctx, field) - case "Port": - return ec.fieldContext_gns_Gns_Port(ctx, field) - case "OtherDescription": - return ec.fieldContext_gns_Gns_OtherDescription(ctx, field) - case "MapPointer": - return ec.fieldContext_gns_Gns_MapPointer(ctx, field) - case "SlicePointer": - return ec.fieldContext_gns_Gns_SlicePointer(ctx, field) - case "WorkloadSpec": - return ec.fieldContext_gns_Gns_WorkloadSpec(ctx, field) - case "DifferentSpec": - return ec.fieldContext_gns_Gns_DifferentSpec(ctx, field) - case "ServiceSegmentRef": - return ec.fieldContext_gns_Gns_ServiceSegmentRef(ctx, field) - case "ServiceSegmentRefPointer": - return ec.fieldContext_gns_Gns_ServiceSegmentRefPointer(ctx, field) - case "ServiceSegmentRefs": - return ec.fieldContext_gns_Gns_ServiceSegmentRefs(ctx, field) - case "ServiceSegmentRefMap": - return ec.fieldContext_gns_Gns_ServiceSegmentRefMap(ctx, field) - case "GnsAccessControlPolicy": - return ec.fieldContext_gns_Gns_GnsAccessControlPolicy(ctx, field) - case "FooChild": - return ec.fieldContext_gns_Gns_FooChild(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type gns_Gns", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_config_Config_GNS_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _config_Config_DNS(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_DNS(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Config_Config().DNS(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.GnsDns) - fc.Result = res - return ec.marshalNgns_Dns2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐGnsDns(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_DNS(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Id": - return ec.fieldContext_gns_Dns_Id(ctx, field) - case "ParentLabels": - return ec.fieldContext_gns_Dns_ParentLabels(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type gns_Dns", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Config_VMPPolicies(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_VMPPolicies(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Config_Config().VMPPolicies(rctx, obj, fc.Args["Id"].(*string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.PolicypkgVMpolicy) - fc.Result = res - return ec.marshalNpolicypkg_VMpolicy2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐPolicypkgVMpolicy(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_VMPPolicies(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Id": - return ec.fieldContext_policypkg_VMpolicy_Id(ctx, field) - case "ParentLabels": - return ec.fieldContext_policypkg_VMpolicy_ParentLabels(ctx, field) - case "queryGns1": - return ec.fieldContext_policypkg_VMpolicy_queryGns1(ctx, field) - case "queryGnsQM1": - return ec.fieldContext_policypkg_VMpolicy_queryGnsQM1(ctx, field) - case "queryGnsQM": - return ec.fieldContext_policypkg_VMpolicy_queryGnsQM(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type policypkg_VMpolicy", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_config_Config_VMPPolicies_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _config_Config_Domain(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_Domain(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Config_Config().Domain(rctx, obj, fc.Args["Id"].(*string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.ConfigDomain) - fc.Result = res - return ec.marshalNconfig_Domain2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐConfigDomain(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_Domain(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Id": - return ec.fieldContext_config_Domain_Id(ctx, field) - case "ParentLabels": - return ec.fieldContext_config_Domain_ParentLabels(ctx, field) - case "PointPort": - return ec.fieldContext_config_Domain_PointPort(ctx, field) - case "PointString": - return ec.fieldContext_config_Domain_PointString(ctx, field) - case "PointInt": - return ec.fieldContext_config_Domain_PointInt(ctx, field) - case "PointMap": - return ec.fieldContext_config_Domain_PointMap(ctx, field) - case "PointSlice": - return ec.fieldContext_config_Domain_PointSlice(ctx, field) - case "SliceOfPoints": - return ec.fieldContext_config_Domain_SliceOfPoints(ctx, field) - case "SliceOfArrPoints": - return ec.fieldContext_config_Domain_SliceOfArrPoints(ctx, field) - case "MapOfArrsPoints": - return ec.fieldContext_config_Domain_MapOfArrsPoints(ctx, field) - case "PointStruct": - return ec.fieldContext_config_Domain_PointStruct(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type config_Domain", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_config_Config_Domain_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _config_Config_SvcGrpInfo(ctx context.Context, field graphql.CollectedField, obj *model.ConfigConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Config_SvcGrpInfo(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Config_Config().SvcGrpInfo(rctx, obj, fc.Args["Id"].(*string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.ServicegroupSvcGroupLinkInfo) - fc.Result = res - return ec.marshalNservicegroup_SvcGroupLinkInfo2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐServicegroupSvcGroupLinkInfo(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Config_SvcGrpInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Config", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Id": - return ec.fieldContext_servicegroup_SvcGroupLinkInfo_Id(ctx, field) - case "ParentLabels": - return ec.fieldContext_servicegroup_SvcGroupLinkInfo_ParentLabels(ctx, field) - case "ClusterName": - return ec.fieldContext_servicegroup_SvcGroupLinkInfo_ClusterName(ctx, field) - case "DomainName": - return ec.fieldContext_servicegroup_SvcGroupLinkInfo_DomainName(ctx, field) - case "ServiceName": - return ec.fieldContext_servicegroup_SvcGroupLinkInfo_ServiceName(ctx, field) - case "ServiceType": - return ec.fieldContext_servicegroup_SvcGroupLinkInfo_ServiceType(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type servicegroup_SvcGroupLinkInfo", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_config_Config_SvcGrpInfo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _config_Domain_Id(ctx context.Context, field graphql.CollectedField, obj *model.ConfigDomain) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Domain_Id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Id, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOID2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Domain_Id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Domain", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Domain_ParentLabels(ctx context.Context, field graphql.CollectedField, obj *model.ConfigDomain) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Domain_ParentLabels(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ParentLabels, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Domain_ParentLabels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Domain", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Domain_PointPort(ctx context.Context, field graphql.CollectedField, obj *model.ConfigDomain) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Domain_PointPort(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PointPort, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Domain_PointPort(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Domain", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Domain_PointString(ctx context.Context, field graphql.CollectedField, obj *model.ConfigDomain) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Domain_PointString(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PointString, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Domain_PointString(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Domain", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Domain_PointInt(ctx context.Context, field graphql.CollectedField, obj *model.ConfigDomain) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Domain_PointInt(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PointInt, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*int) - fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Domain_PointInt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Domain", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Domain_PointMap(ctx context.Context, field graphql.CollectedField, obj *model.ConfigDomain) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Domain_PointMap(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PointMap, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Domain_PointMap(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Domain", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Domain_PointSlice(ctx context.Context, field graphql.CollectedField, obj *model.ConfigDomain) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Domain_PointSlice(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PointSlice, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Domain_PointSlice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Domain", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Domain_SliceOfPoints(ctx context.Context, field graphql.CollectedField, obj *model.ConfigDomain) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Domain_SliceOfPoints(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SliceOfPoints, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Domain_SliceOfPoints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Domain", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Domain_SliceOfArrPoints(ctx context.Context, field graphql.CollectedField, obj *model.ConfigDomain) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Domain_SliceOfArrPoints(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SliceOfArrPoints, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Domain_SliceOfArrPoints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Domain", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Domain_MapOfArrsPoints(ctx context.Context, field graphql.CollectedField, obj *model.ConfigDomain) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Domain_MapOfArrsPoints(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MapOfArrsPoints, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Domain_MapOfArrsPoints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Domain", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_Domain_PointStruct(ctx context.Context, field graphql.CollectedField, obj *model.ConfigDomain) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_Domain_PointStruct(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PointStruct, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_Domain_PointStruct(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_Domain", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_FooTypeABC_Id(ctx context.Context, field graphql.CollectedField, obj *model.ConfigFooTypeABC) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_FooTypeABC_Id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Id, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOID2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_FooTypeABC_Id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_FooTypeABC", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_FooTypeABC_ParentLabels(ctx context.Context, field graphql.CollectedField, obj *model.ConfigFooTypeABC) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_FooTypeABC_ParentLabels(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ParentLabels, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_FooTypeABC_ParentLabels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_FooTypeABC", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_FooTypeABC_FooA(ctx context.Context, field graphql.CollectedField, obj *model.ConfigFooTypeABC) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_FooTypeABC_FooA(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.FooA, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_FooTypeABC_FooA(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_FooTypeABC", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_FooTypeABC_FooB(ctx context.Context, field graphql.CollectedField, obj *model.ConfigFooTypeABC) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_FooTypeABC_FooB(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.FooB, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_FooTypeABC_FooB(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_FooTypeABC", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_FooTypeABC_FooD(ctx context.Context, field graphql.CollectedField, obj *model.ConfigFooTypeABC) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_FooTypeABC_FooD(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.FooD, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_FooTypeABC_FooD(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_FooTypeABC", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _config_FooTypeABC_FooF(ctx context.Context, field graphql.CollectedField, obj *model.ConfigFooTypeABC) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_config_FooTypeABC_FooF(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.FooF, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_config_FooTypeABC_FooF(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "config_FooTypeABC", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_BarChild_Id(ctx context.Context, field graphql.CollectedField, obj *model.GnsBarChild) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_BarChild_Id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Id, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOID2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_BarChild_Id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_BarChild", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_BarChild_ParentLabels(ctx context.Context, field graphql.CollectedField, obj *model.GnsBarChild) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_BarChild_ParentLabels(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ParentLabels, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_BarChild_ParentLabels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_BarChild", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_BarChild_Name(ctx context.Context, field graphql.CollectedField, obj *model.GnsBarChild) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_BarChild_Name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_BarChild_Name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_BarChild", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Dns_Id(ctx context.Context, field graphql.CollectedField, obj *model.GnsDns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Dns_Id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Id, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOID2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Dns_Id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Dns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Dns_ParentLabels(ctx context.Context, field graphql.CollectedField, obj *model.GnsDns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Dns_ParentLabels(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ParentLabels, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Dns_ParentLabels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Dns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_Id(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_Id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Id, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOID2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_Id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_ParentLabels(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_ParentLabels(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ParentLabels, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_ParentLabels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_queryGns1(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_queryGns1(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Gns_Gns().QueryGns1(rctx, obj, fc.Args["StartTime"].(*string), fc.Args["EndTime"].(*string), fc.Args["Interval"].(*string), fc.Args["IsServiceDeployment"].(*bool), fc.Args["StartVal"].(*int)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.NexusGraphqlResponse) - fc.Result = res - return ec.marshalONexusGraphqlResponse2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐNexusGraphqlResponse(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_queryGns1(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Code": - return ec.fieldContext_NexusGraphqlResponse_Code(ctx, field) - case "Message": - return ec.fieldContext_NexusGraphqlResponse_Message(ctx, field) - case "Data": - return ec.fieldContext_NexusGraphqlResponse_Data(ctx, field) - case "Last": - return ec.fieldContext_NexusGraphqlResponse_Last(ctx, field) - case "TotalRecords": - return ec.fieldContext_NexusGraphqlResponse_TotalRecords(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type NexusGraphqlResponse", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_gns_Gns_queryGns1_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_queryGnsQM1(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_queryGnsQM1(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Gns_Gns().QueryGnsQM1(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.TimeSeriesData) - fc.Result = res - return ec.marshalOTimeSeriesData2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐTimeSeriesData(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_queryGnsQM1(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Code": - return ec.fieldContext_TimeSeriesData_Code(ctx, field) - case "Message": - return ec.fieldContext_TimeSeriesData_Message(ctx, field) - case "Data": - return ec.fieldContext_TimeSeriesData_Data(ctx, field) - case "Last": - return ec.fieldContext_TimeSeriesData_Last(ctx, field) - case "TotalRecords": - return ec.fieldContext_TimeSeriesData_TotalRecords(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TimeSeriesData", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_queryGnsQM(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_queryGnsQM(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Gns_Gns().QueryGnsQM(rctx, obj, fc.Args["StartTime"].(*string), fc.Args["EndTime"].(*string), fc.Args["TimeInterval"].(*string), fc.Args["SomeUserArg1"].(*string), fc.Args["SomeUserArg2"].(*int), fc.Args["SomeUserArg3"].(*bool)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.TimeSeriesData) - fc.Result = res - return ec.marshalOTimeSeriesData2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐTimeSeriesData(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_queryGnsQM(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Code": - return ec.fieldContext_TimeSeriesData_Code(ctx, field) - case "Message": - return ec.fieldContext_TimeSeriesData_Message(ctx, field) - case "Data": - return ec.fieldContext_TimeSeriesData_Data(ctx, field) - case "Last": - return ec.fieldContext_TimeSeriesData_Last(ctx, field) - case "TotalRecords": - return ec.fieldContext_TimeSeriesData_TotalRecords(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TimeSeriesData", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_gns_Gns_queryGnsQM_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_Domain(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_Domain(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Domain, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_Domain(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_UseSharedGateway(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_UseSharedGateway(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.UseSharedGateway, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*bool) - fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_UseSharedGateway(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_Description(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_Description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_Description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_Meta(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_Meta(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Meta, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_Meta(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_Port(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_Port(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Port, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*int) - fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_Port(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_OtherDescription(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_OtherDescription(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.OtherDescription, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_OtherDescription(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_MapPointer(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_MapPointer(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MapPointer, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_MapPointer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_SlicePointer(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_SlicePointer(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SlicePointer, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_SlicePointer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_WorkloadSpec(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_WorkloadSpec(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.WorkloadSpec, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_WorkloadSpec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_DifferentSpec(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_DifferentSpec(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DifferentSpec, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_DifferentSpec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_ServiceSegmentRef(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_ServiceSegmentRef(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ServiceSegmentRef, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_ServiceSegmentRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_ServiceSegmentRefPointer(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_ServiceSegmentRefPointer(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ServiceSegmentRefPointer, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_ServiceSegmentRefPointer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_ServiceSegmentRefs(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_ServiceSegmentRefs(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ServiceSegmentRefs, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_ServiceSegmentRefs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_ServiceSegmentRefMap(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_ServiceSegmentRefMap(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ServiceSegmentRefMap, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_ServiceSegmentRefMap(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_GnsAccessControlPolicy(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_GnsAccessControlPolicy(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Gns_Gns().GnsAccessControlPolicy(rctx, obj, fc.Args["Id"].(*string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.PolicypkgAccessControlPolicy) - fc.Result = res - return ec.marshalNpolicypkg_AccessControlPolicy2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐPolicypkgAccessControlPolicy(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_GnsAccessControlPolicy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Id": - return ec.fieldContext_policypkg_AccessControlPolicy_Id(ctx, field) - case "ParentLabels": - return ec.fieldContext_policypkg_AccessControlPolicy_ParentLabels(ctx, field) - case "PolicyConfigs": - return ec.fieldContext_policypkg_AccessControlPolicy_PolicyConfigs(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type policypkg_AccessControlPolicy", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_gns_Gns_GnsAccessControlPolicy_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _gns_Gns_FooChild(ctx context.Context, field graphql.CollectedField, obj *model.GnsGns) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_Gns_FooChild(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Gns_Gns().FooChild(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.GnsBarChild) - fc.Result = res - return ec.marshalNgns_BarChild2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐGnsBarChild(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_Gns_FooChild(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_Gns", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Id": - return ec.fieldContext_gns_BarChild_Id(ctx, field) - case "ParentLabels": - return ec.fieldContext_gns_BarChild_ParentLabels(ctx, field) - case "Name": - return ec.fieldContext_gns_BarChild_Name(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type gns_BarChild", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_IgnoreChild_Id(ctx context.Context, field graphql.CollectedField, obj *model.GnsIgnoreChild) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_IgnoreChild_Id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Id, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOID2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_IgnoreChild_Id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_IgnoreChild", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_IgnoreChild_ParentLabels(ctx context.Context, field graphql.CollectedField, obj *model.GnsIgnoreChild) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_IgnoreChild_ParentLabels(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ParentLabels, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_IgnoreChild_ParentLabels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_IgnoreChild", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _gns_IgnoreChild_Name(ctx context.Context, field graphql.CollectedField, obj *model.GnsIgnoreChild) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_gns_IgnoreChild_Name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_gns_IgnoreChild_Name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "gns_IgnoreChild", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _policypkg_ACPConfig_Id(ctx context.Context, field graphql.CollectedField, obj *model.PolicypkgACPConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_policypkg_ACPConfig_Id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Id, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOID2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_policypkg_ACPConfig_Id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "policypkg_ACPConfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _policypkg_ACPConfig_ParentLabels(ctx context.Context, field graphql.CollectedField, obj *model.PolicypkgACPConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_policypkg_ACPConfig_ParentLabels(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ParentLabels, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_policypkg_ACPConfig_ParentLabels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "policypkg_ACPConfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _policypkg_ACPConfig_DisplayName(ctx context.Context, field graphql.CollectedField, obj *model.PolicypkgACPConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_policypkg_ACPConfig_DisplayName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DisplayName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_policypkg_ACPConfig_DisplayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "policypkg_ACPConfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _policypkg_ACPConfig_Gns(ctx context.Context, field graphql.CollectedField, obj *model.PolicypkgACPConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_policypkg_ACPConfig_Gns(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Gns, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_policypkg_ACPConfig_Gns(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "policypkg_ACPConfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _policypkg_ACPConfig_Description(ctx context.Context, field graphql.CollectedField, obj *model.PolicypkgACPConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_policypkg_ACPConfig_Description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_policypkg_ACPConfig_Description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "policypkg_ACPConfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _policypkg_ACPConfig_Tags(ctx context.Context, field graphql.CollectedField, obj *model.PolicypkgACPConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_policypkg_ACPConfig_Tags(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Tags, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_policypkg_ACPConfig_Tags(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "policypkg_ACPConfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _policypkg_ACPConfig_ProjectId(ctx context.Context, field graphql.CollectedField, obj *model.PolicypkgACPConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_policypkg_ACPConfig_ProjectId(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ProjectId, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_policypkg_ACPConfig_ProjectId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "policypkg_ACPConfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _policypkg_ACPConfig_Conditions(ctx context.Context, field graphql.CollectedField, obj *model.PolicypkgACPConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_policypkg_ACPConfig_Conditions(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Conditions, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_policypkg_ACPConfig_Conditions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "policypkg_ACPConfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _policypkg_AccessControlPolicy_Id(ctx context.Context, field graphql.CollectedField, obj *model.PolicypkgAccessControlPolicy) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_policypkg_AccessControlPolicy_Id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Id, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOID2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_policypkg_AccessControlPolicy_Id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "policypkg_AccessControlPolicy", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _policypkg_AccessControlPolicy_ParentLabels(ctx context.Context, field graphql.CollectedField, obj *model.PolicypkgAccessControlPolicy) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_policypkg_AccessControlPolicy_ParentLabels(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ParentLabels, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_policypkg_AccessControlPolicy_ParentLabels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "policypkg_AccessControlPolicy", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _policypkg_AccessControlPolicy_PolicyConfigs(ctx context.Context, field graphql.CollectedField, obj *model.PolicypkgAccessControlPolicy) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_policypkg_AccessControlPolicy_PolicyConfigs(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Policypkg_AccessControlPolicy().PolicyConfigs(rctx, obj, fc.Args["Id"].(*string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*model.PolicypkgACPConfig) - fc.Result = res - return ec.marshalOpolicypkg_ACPConfig2ᚕᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐPolicypkgACPConfigᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_policypkg_AccessControlPolicy_PolicyConfigs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "policypkg_AccessControlPolicy", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Id": - return ec.fieldContext_policypkg_ACPConfig_Id(ctx, field) - case "ParentLabels": - return ec.fieldContext_policypkg_ACPConfig_ParentLabels(ctx, field) - case "DisplayName": - return ec.fieldContext_policypkg_ACPConfig_DisplayName(ctx, field) - case "Gns": - return ec.fieldContext_policypkg_ACPConfig_Gns(ctx, field) - case "Description": - return ec.fieldContext_policypkg_ACPConfig_Description(ctx, field) - case "Tags": - return ec.fieldContext_policypkg_ACPConfig_Tags(ctx, field) - case "ProjectId": - return ec.fieldContext_policypkg_ACPConfig_ProjectId(ctx, field) - case "Conditions": - return ec.fieldContext_policypkg_ACPConfig_Conditions(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type policypkg_ACPConfig", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_policypkg_AccessControlPolicy_PolicyConfigs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _policypkg_VMpolicy_Id(ctx context.Context, field graphql.CollectedField, obj *model.PolicypkgVMpolicy) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_policypkg_VMpolicy_Id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Id, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOID2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_policypkg_VMpolicy_Id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "policypkg_VMpolicy", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _policypkg_VMpolicy_ParentLabels(ctx context.Context, field graphql.CollectedField, obj *model.PolicypkgVMpolicy) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_policypkg_VMpolicy_ParentLabels(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ParentLabels, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_policypkg_VMpolicy_ParentLabels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "policypkg_VMpolicy", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _policypkg_VMpolicy_queryGns1(ctx context.Context, field graphql.CollectedField, obj *model.PolicypkgVMpolicy) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_policypkg_VMpolicy_queryGns1(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Policypkg_VMpolicy().QueryGns1(rctx, obj, fc.Args["StartTime"].(*string), fc.Args["EndTime"].(*string), fc.Args["Interval"].(*string), fc.Args["IsServiceDeployment"].(*bool), fc.Args["StartVal"].(*int)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.NexusGraphqlResponse) - fc.Result = res - return ec.marshalONexusGraphqlResponse2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐNexusGraphqlResponse(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_policypkg_VMpolicy_queryGns1(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "policypkg_VMpolicy", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Code": - return ec.fieldContext_NexusGraphqlResponse_Code(ctx, field) - case "Message": - return ec.fieldContext_NexusGraphqlResponse_Message(ctx, field) - case "Data": - return ec.fieldContext_NexusGraphqlResponse_Data(ctx, field) - case "Last": - return ec.fieldContext_NexusGraphqlResponse_Last(ctx, field) - case "TotalRecords": - return ec.fieldContext_NexusGraphqlResponse_TotalRecords(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type NexusGraphqlResponse", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_policypkg_VMpolicy_queryGns1_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _policypkg_VMpolicy_queryGnsQM1(ctx context.Context, field graphql.CollectedField, obj *model.PolicypkgVMpolicy) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_policypkg_VMpolicy_queryGnsQM1(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Policypkg_VMpolicy().QueryGnsQM1(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.TimeSeriesData) - fc.Result = res - return ec.marshalOTimeSeriesData2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐTimeSeriesData(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_policypkg_VMpolicy_queryGnsQM1(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "policypkg_VMpolicy", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Code": - return ec.fieldContext_TimeSeriesData_Code(ctx, field) - case "Message": - return ec.fieldContext_TimeSeriesData_Message(ctx, field) - case "Data": - return ec.fieldContext_TimeSeriesData_Data(ctx, field) - case "Last": - return ec.fieldContext_TimeSeriesData_Last(ctx, field) - case "TotalRecords": - return ec.fieldContext_TimeSeriesData_TotalRecords(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TimeSeriesData", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _policypkg_VMpolicy_queryGnsQM(ctx context.Context, field graphql.CollectedField, obj *model.PolicypkgVMpolicy) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_policypkg_VMpolicy_queryGnsQM(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Policypkg_VMpolicy().QueryGnsQM(rctx, obj, fc.Args["StartTime"].(*string), fc.Args["EndTime"].(*string), fc.Args["TimeInterval"].(*string), fc.Args["SomeUserArg1"].(*string), fc.Args["SomeUserArg2"].(*int), fc.Args["SomeUserArg3"].(*bool)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.TimeSeriesData) - fc.Result = res - return ec.marshalOTimeSeriesData2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐTimeSeriesData(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_policypkg_VMpolicy_queryGnsQM(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "policypkg_VMpolicy", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Code": - return ec.fieldContext_TimeSeriesData_Code(ctx, field) - case "Message": - return ec.fieldContext_TimeSeriesData_Message(ctx, field) - case "Data": - return ec.fieldContext_TimeSeriesData_Data(ctx, field) - case "Last": - return ec.fieldContext_TimeSeriesData_Last(ctx, field) - case "TotalRecords": - return ec.fieldContext_TimeSeriesData_TotalRecords(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TimeSeriesData", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_policypkg_VMpolicy_queryGnsQM_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _root_Root_Id(ctx context.Context, field graphql.CollectedField, obj *model.RootRoot) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_root_Root_Id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Id, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOID2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_root_Root_Id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "root_Root", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _root_Root_ParentLabels(ctx context.Context, field graphql.CollectedField, obj *model.RootRoot) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_root_Root_ParentLabels(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ParentLabels, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_root_Root_ParentLabels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "root_Root", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _root_Root_Config(ctx context.Context, field graphql.CollectedField, obj *model.RootRoot) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_root_Root_Config(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Root_Root().Config(rctx, obj, fc.Args["Id"].(*string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.ConfigConfig) - fc.Result = res - return ec.marshalNconfig_Config2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐConfigConfig(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_root_Root_Config(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "root_Root", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "Id": - return ec.fieldContext_config_Config_Id(ctx, field) - case "ParentLabels": - return ec.fieldContext_config_Config_ParentLabels(ctx, field) - case "QueryExample": - return ec.fieldContext_config_Config_QueryExample(ctx, field) - case "ACPPolicies": - return ec.fieldContext_config_Config_ACPPolicies(ctx, field) - case "FooExample": - return ec.fieldContext_config_Config_FooExample(ctx, field) - case "MyStr0": - return ec.fieldContext_config_Config_MyStr0(ctx, field) - case "MyStr1": - return ec.fieldContext_config_Config_MyStr1(ctx, field) - case "MyStr2": - return ec.fieldContext_config_Config_MyStr2(ctx, field) - case "XYZPort": - return ec.fieldContext_config_Config_XYZPort(ctx, field) - case "ABCHost": - return ec.fieldContext_config_Config_ABCHost(ctx, field) - case "ClusterNamespaces": - return ec.fieldContext_config_Config_ClusterNamespaces(ctx, field) - case "TestValMarkers": - return ec.fieldContext_config_Config_TestValMarkers(ctx, field) - case "Instance": - return ec.fieldContext_config_Config_Instance(ctx, field) - case "CuOption": - return ec.fieldContext_config_Config_CuOption(ctx, field) - case "GNS": - return ec.fieldContext_config_Config_GNS(ctx, field) - case "DNS": - return ec.fieldContext_config_Config_DNS(ctx, field) - case "VMPPolicies": - return ec.fieldContext_config_Config_VMPPolicies(ctx, field) - case "Domain": - return ec.fieldContext_config_Config_Domain(ctx, field) - case "SvcGrpInfo": - return ec.fieldContext_config_Config_SvcGrpInfo(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type config_Config", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_root_Root_Config_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _servicegroup_SvcGroupLinkInfo_Id(ctx context.Context, field graphql.CollectedField, obj *model.ServicegroupSvcGroupLinkInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_servicegroup_SvcGroupLinkInfo_Id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Id, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOID2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_servicegroup_SvcGroupLinkInfo_Id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "servicegroup_SvcGroupLinkInfo", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _servicegroup_SvcGroupLinkInfo_ParentLabels(ctx context.Context, field graphql.CollectedField, obj *model.ServicegroupSvcGroupLinkInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_servicegroup_SvcGroupLinkInfo_ParentLabels(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ParentLabels, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_servicegroup_SvcGroupLinkInfo_ParentLabels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "servicegroup_SvcGroupLinkInfo", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _servicegroup_SvcGroupLinkInfo_ClusterName(ctx context.Context, field graphql.CollectedField, obj *model.ServicegroupSvcGroupLinkInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_servicegroup_SvcGroupLinkInfo_ClusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_servicegroup_SvcGroupLinkInfo_ClusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "servicegroup_SvcGroupLinkInfo", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _servicegroup_SvcGroupLinkInfo_DomainName(ctx context.Context, field graphql.CollectedField, obj *model.ServicegroupSvcGroupLinkInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_servicegroup_SvcGroupLinkInfo_DomainName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DomainName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_servicegroup_SvcGroupLinkInfo_DomainName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "servicegroup_SvcGroupLinkInfo", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _servicegroup_SvcGroupLinkInfo_ServiceName(ctx context.Context, field graphql.CollectedField, obj *model.ServicegroupSvcGroupLinkInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_servicegroup_SvcGroupLinkInfo_ServiceName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ServiceName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_servicegroup_SvcGroupLinkInfo_ServiceName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "servicegroup_SvcGroupLinkInfo", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _servicegroup_SvcGroupLinkInfo_ServiceType(ctx context.Context, field graphql.CollectedField, obj *model.ServicegroupSvcGroupLinkInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_servicegroup_SvcGroupLinkInfo_ServiceType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ServiceType, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_servicegroup_SvcGroupLinkInfo_ServiceType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "servicegroup_SvcGroupLinkInfo", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -// endregion **************************** field.gotpl ***************************** - -// region **************************** input.gotpl ***************************** - -// endregion **************************** input.gotpl ***************************** - -// region ************************** interface.gotpl *************************** - -// endregion ************************** interface.gotpl *************************** - -// region **************************** object.gotpl **************************** - -var nexusGraphqlResponseImplementors = []string{"NexusGraphqlResponse"} - -func (ec *executionContext) _NexusGraphqlResponse(ctx context.Context, sel ast.SelectionSet, obj *model.NexusGraphqlResponse) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, nexusGraphqlResponseImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("NexusGraphqlResponse") - case "Code": - - out.Values[i] = ec._NexusGraphqlResponse_Code(ctx, field, obj) - - case "Message": - - out.Values[i] = ec._NexusGraphqlResponse_Message(ctx, field, obj) - - case "Data": - - out.Values[i] = ec._NexusGraphqlResponse_Data(ctx, field, obj) - - case "Last": - - out.Values[i] = ec._NexusGraphqlResponse_Last(ctx, field, obj) - - case "TotalRecords": - - out.Values[i] = ec._NexusGraphqlResponse_TotalRecords(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var queryImplementors = []string{"Query"} - -func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) - ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ - Object: "Query", - }) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ - Object: field.Name, - Field: field, - }) - - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Query") - case "root": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_root(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "__type": - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - }) - - case "__schema": - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - }) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var timeSeriesDataImplementors = []string{"TimeSeriesData"} - -func (ec *executionContext) _TimeSeriesData(ctx context.Context, sel ast.SelectionSet, obj *model.TimeSeriesData) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, timeSeriesDataImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TimeSeriesData") - case "Code": - - out.Values[i] = ec._TimeSeriesData_Code(ctx, field, obj) - - case "Message": - - out.Values[i] = ec._TimeSeriesData_Message(ctx, field, obj) - - case "Data": - - out.Values[i] = ec._TimeSeriesData_Data(ctx, field, obj) - - case "Last": - - out.Values[i] = ec._TimeSeriesData_Last(ctx, field, obj) - - case "TotalRecords": - - out.Values[i] = ec._TimeSeriesData_TotalRecords(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var __DirectiveImplementors = []string{"__Directive"} - -func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Directive") - case "name": - - out.Values[i] = ec.___Directive_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - - out.Values[i] = ec.___Directive_description(ctx, field, obj) - - case "locations": - - out.Values[i] = ec.___Directive_locations(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "args": - - out.Values[i] = ec.___Directive_args(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "isRepeatable": - - out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var __EnumValueImplementors = []string{"__EnumValue"} - -func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__EnumValue") - case "name": - - out.Values[i] = ec.___EnumValue_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - - out.Values[i] = ec.___EnumValue_description(ctx, field, obj) - - case "isDeprecated": - - out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "deprecationReason": - - out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var __FieldImplementors = []string{"__Field"} - -func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Field") - case "name": - - out.Values[i] = ec.___Field_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - - out.Values[i] = ec.___Field_description(ctx, field, obj) - - case "args": - - out.Values[i] = ec.___Field_args(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "type": - - out.Values[i] = ec.___Field_type(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "isDeprecated": - - out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "deprecationReason": - - out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var __InputValueImplementors = []string{"__InputValue"} - -func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__InputValue") - case "name": - - out.Values[i] = ec.___InputValue_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - - out.Values[i] = ec.___InputValue_description(ctx, field, obj) - - case "type": - - out.Values[i] = ec.___InputValue_type(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "defaultValue": - - out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var __SchemaImplementors = []string{"__Schema"} - -func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Schema") - case "description": - - out.Values[i] = ec.___Schema_description(ctx, field, obj) - - case "types": - - out.Values[i] = ec.___Schema_types(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "queryType": - - out.Values[i] = ec.___Schema_queryType(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "mutationType": - - out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) - - case "subscriptionType": - - out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) - - case "directives": - - out.Values[i] = ec.___Schema_directives(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var __TypeImplementors = []string{"__Type"} - -func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Type") - case "kind": - - out.Values[i] = ec.___Type_kind(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "name": - - out.Values[i] = ec.___Type_name(ctx, field, obj) - - case "description": - - out.Values[i] = ec.___Type_description(ctx, field, obj) - - case "fields": - - out.Values[i] = ec.___Type_fields(ctx, field, obj) - - case "interfaces": - - out.Values[i] = ec.___Type_interfaces(ctx, field, obj) - - case "possibleTypes": - - out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) - - case "enumValues": - - out.Values[i] = ec.___Type_enumValues(ctx, field, obj) - - case "inputFields": - - out.Values[i] = ec.___Type_inputFields(ctx, field, obj) - - case "ofType": - - out.Values[i] = ec.___Type_ofType(ctx, field, obj) - - case "specifiedByURL": - - out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var config_ConfigImplementors = []string{"config_Config"} - -func (ec *executionContext) _config_Config(ctx context.Context, sel ast.SelectionSet, obj *model.ConfigConfig) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, config_ConfigImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("config_Config") - case "Id": - - out.Values[i] = ec._config_Config_Id(ctx, field, obj) - - case "ParentLabels": - - out.Values[i] = ec._config_Config_ParentLabels(ctx, field, obj) - - case "QueryExample": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._config_Config_QueryExample(ctx, field, obj) - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "ACPPolicies": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._config_Config_ACPPolicies(ctx, field, obj) - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "FooExample": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._config_Config_FooExample(ctx, field, obj) - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "MyStr0": - - out.Values[i] = ec._config_Config_MyStr0(ctx, field, obj) - - case "MyStr1": - - out.Values[i] = ec._config_Config_MyStr1(ctx, field, obj) - - case "MyStr2": - - out.Values[i] = ec._config_Config_MyStr2(ctx, field, obj) - - case "XYZPort": - - out.Values[i] = ec._config_Config_XYZPort(ctx, field, obj) - - case "ABCHost": - - out.Values[i] = ec._config_Config_ABCHost(ctx, field, obj) - - case "ClusterNamespaces": - - out.Values[i] = ec._config_Config_ClusterNamespaces(ctx, field, obj) - - case "TestValMarkers": - - out.Values[i] = ec._config_Config_TestValMarkers(ctx, field, obj) - - case "Instance": - - out.Values[i] = ec._config_Config_Instance(ctx, field, obj) - - case "CuOption": - - out.Values[i] = ec._config_Config_CuOption(ctx, field, obj) - - case "GNS": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._config_Config_GNS(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "DNS": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._config_Config_DNS(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "VMPPolicies": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._config_Config_VMPPolicies(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "Domain": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._config_Config_Domain(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "SvcGrpInfo": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._config_Config_SvcGrpInfo(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var config_DomainImplementors = []string{"config_Domain"} - -func (ec *executionContext) _config_Domain(ctx context.Context, sel ast.SelectionSet, obj *model.ConfigDomain) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, config_DomainImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("config_Domain") - case "Id": - - out.Values[i] = ec._config_Domain_Id(ctx, field, obj) - - case "ParentLabels": - - out.Values[i] = ec._config_Domain_ParentLabels(ctx, field, obj) - - case "PointPort": - - out.Values[i] = ec._config_Domain_PointPort(ctx, field, obj) - - case "PointString": - - out.Values[i] = ec._config_Domain_PointString(ctx, field, obj) - - case "PointInt": - - out.Values[i] = ec._config_Domain_PointInt(ctx, field, obj) - - case "PointMap": - - out.Values[i] = ec._config_Domain_PointMap(ctx, field, obj) - - case "PointSlice": - - out.Values[i] = ec._config_Domain_PointSlice(ctx, field, obj) - - case "SliceOfPoints": - - out.Values[i] = ec._config_Domain_SliceOfPoints(ctx, field, obj) - - case "SliceOfArrPoints": - - out.Values[i] = ec._config_Domain_SliceOfArrPoints(ctx, field, obj) - - case "MapOfArrsPoints": - - out.Values[i] = ec._config_Domain_MapOfArrsPoints(ctx, field, obj) - - case "PointStruct": - - out.Values[i] = ec._config_Domain_PointStruct(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var config_FooTypeABCImplementors = []string{"config_FooTypeABC"} - -func (ec *executionContext) _config_FooTypeABC(ctx context.Context, sel ast.SelectionSet, obj *model.ConfigFooTypeABC) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, config_FooTypeABCImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("config_FooTypeABC") - case "Id": - - out.Values[i] = ec._config_FooTypeABC_Id(ctx, field, obj) - - case "ParentLabels": - - out.Values[i] = ec._config_FooTypeABC_ParentLabels(ctx, field, obj) - - case "FooA": - - out.Values[i] = ec._config_FooTypeABC_FooA(ctx, field, obj) - - case "FooB": - - out.Values[i] = ec._config_FooTypeABC_FooB(ctx, field, obj) - - case "FooD": - - out.Values[i] = ec._config_FooTypeABC_FooD(ctx, field, obj) - - case "FooF": - - out.Values[i] = ec._config_FooTypeABC_FooF(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var gns_BarChildImplementors = []string{"gns_BarChild"} - -func (ec *executionContext) _gns_BarChild(ctx context.Context, sel ast.SelectionSet, obj *model.GnsBarChild) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, gns_BarChildImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("gns_BarChild") - case "Id": - - out.Values[i] = ec._gns_BarChild_Id(ctx, field, obj) - - case "ParentLabels": - - out.Values[i] = ec._gns_BarChild_ParentLabels(ctx, field, obj) - - case "Name": - - out.Values[i] = ec._gns_BarChild_Name(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var gns_DnsImplementors = []string{"gns_Dns"} - -func (ec *executionContext) _gns_Dns(ctx context.Context, sel ast.SelectionSet, obj *model.GnsDns) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, gns_DnsImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("gns_Dns") - case "Id": - - out.Values[i] = ec._gns_Dns_Id(ctx, field, obj) - - case "ParentLabels": - - out.Values[i] = ec._gns_Dns_ParentLabels(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var gns_GnsImplementors = []string{"gns_Gns"} - -func (ec *executionContext) _gns_Gns(ctx context.Context, sel ast.SelectionSet, obj *model.GnsGns) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, gns_GnsImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("gns_Gns") - case "Id": - - out.Values[i] = ec._gns_Gns_Id(ctx, field, obj) - - case "ParentLabels": - - out.Values[i] = ec._gns_Gns_ParentLabels(ctx, field, obj) - - case "queryGns1": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._gns_Gns_queryGns1(ctx, field, obj) - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "queryGnsQM1": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._gns_Gns_queryGnsQM1(ctx, field, obj) - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "queryGnsQM": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._gns_Gns_queryGnsQM(ctx, field, obj) - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "Domain": - - out.Values[i] = ec._gns_Gns_Domain(ctx, field, obj) - - case "UseSharedGateway": - - out.Values[i] = ec._gns_Gns_UseSharedGateway(ctx, field, obj) - - case "Description": - - out.Values[i] = ec._gns_Gns_Description(ctx, field, obj) - - case "Meta": - - out.Values[i] = ec._gns_Gns_Meta(ctx, field, obj) - - case "Port": - - out.Values[i] = ec._gns_Gns_Port(ctx, field, obj) - - case "OtherDescription": - - out.Values[i] = ec._gns_Gns_OtherDescription(ctx, field, obj) - - case "MapPointer": - - out.Values[i] = ec._gns_Gns_MapPointer(ctx, field, obj) - - case "SlicePointer": - - out.Values[i] = ec._gns_Gns_SlicePointer(ctx, field, obj) - - case "WorkloadSpec": - - out.Values[i] = ec._gns_Gns_WorkloadSpec(ctx, field, obj) - - case "DifferentSpec": - - out.Values[i] = ec._gns_Gns_DifferentSpec(ctx, field, obj) - - case "ServiceSegmentRef": - - out.Values[i] = ec._gns_Gns_ServiceSegmentRef(ctx, field, obj) - - case "ServiceSegmentRefPointer": - - out.Values[i] = ec._gns_Gns_ServiceSegmentRefPointer(ctx, field, obj) - - case "ServiceSegmentRefs": - - out.Values[i] = ec._gns_Gns_ServiceSegmentRefs(ctx, field, obj) - - case "ServiceSegmentRefMap": - - out.Values[i] = ec._gns_Gns_ServiceSegmentRefMap(ctx, field, obj) - - case "GnsAccessControlPolicy": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._gns_Gns_GnsAccessControlPolicy(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "FooChild": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._gns_Gns_FooChild(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var gns_IgnoreChildImplementors = []string{"gns_IgnoreChild"} - -func (ec *executionContext) _gns_IgnoreChild(ctx context.Context, sel ast.SelectionSet, obj *model.GnsIgnoreChild) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, gns_IgnoreChildImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("gns_IgnoreChild") - case "Id": - - out.Values[i] = ec._gns_IgnoreChild_Id(ctx, field, obj) - - case "ParentLabels": - - out.Values[i] = ec._gns_IgnoreChild_ParentLabels(ctx, field, obj) - - case "Name": - - out.Values[i] = ec._gns_IgnoreChild_Name(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var policypkg_ACPConfigImplementors = []string{"policypkg_ACPConfig"} - -func (ec *executionContext) _policypkg_ACPConfig(ctx context.Context, sel ast.SelectionSet, obj *model.PolicypkgACPConfig) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, policypkg_ACPConfigImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("policypkg_ACPConfig") - case "Id": - - out.Values[i] = ec._policypkg_ACPConfig_Id(ctx, field, obj) - - case "ParentLabels": - - out.Values[i] = ec._policypkg_ACPConfig_ParentLabels(ctx, field, obj) - - case "DisplayName": - - out.Values[i] = ec._policypkg_ACPConfig_DisplayName(ctx, field, obj) - - case "Gns": - - out.Values[i] = ec._policypkg_ACPConfig_Gns(ctx, field, obj) - - case "Description": - - out.Values[i] = ec._policypkg_ACPConfig_Description(ctx, field, obj) - - case "Tags": - - out.Values[i] = ec._policypkg_ACPConfig_Tags(ctx, field, obj) - - case "ProjectId": - - out.Values[i] = ec._policypkg_ACPConfig_ProjectId(ctx, field, obj) - - case "Conditions": - - out.Values[i] = ec._policypkg_ACPConfig_Conditions(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var policypkg_AccessControlPolicyImplementors = []string{"policypkg_AccessControlPolicy"} - -func (ec *executionContext) _policypkg_AccessControlPolicy(ctx context.Context, sel ast.SelectionSet, obj *model.PolicypkgAccessControlPolicy) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, policypkg_AccessControlPolicyImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("policypkg_AccessControlPolicy") - case "Id": - - out.Values[i] = ec._policypkg_AccessControlPolicy_Id(ctx, field, obj) - - case "ParentLabels": - - out.Values[i] = ec._policypkg_AccessControlPolicy_ParentLabels(ctx, field, obj) - - case "PolicyConfigs": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._policypkg_AccessControlPolicy_PolicyConfigs(ctx, field, obj) - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var policypkg_VMpolicyImplementors = []string{"policypkg_VMpolicy"} - -func (ec *executionContext) _policypkg_VMpolicy(ctx context.Context, sel ast.SelectionSet, obj *model.PolicypkgVMpolicy) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, policypkg_VMpolicyImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("policypkg_VMpolicy") - case "Id": - - out.Values[i] = ec._policypkg_VMpolicy_Id(ctx, field, obj) - - case "ParentLabels": - - out.Values[i] = ec._policypkg_VMpolicy_ParentLabels(ctx, field, obj) - - case "queryGns1": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._policypkg_VMpolicy_queryGns1(ctx, field, obj) - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "queryGnsQM1": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._policypkg_VMpolicy_queryGnsQM1(ctx, field, obj) - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "queryGnsQM": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._policypkg_VMpolicy_queryGnsQM(ctx, field, obj) - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var root_RootImplementors = []string{"root_Root"} - -func (ec *executionContext) _root_Root(ctx context.Context, sel ast.SelectionSet, obj *model.RootRoot) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, root_RootImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("root_Root") - case "Id": - - out.Values[i] = ec._root_Root_Id(ctx, field, obj) - - case "ParentLabels": - - out.Values[i] = ec._root_Root_ParentLabels(ctx, field, obj) - - case "Config": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._root_Root_Config(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var servicegroup_SvcGroupLinkInfoImplementors = []string{"servicegroup_SvcGroupLinkInfo"} - -func (ec *executionContext) _servicegroup_SvcGroupLinkInfo(ctx context.Context, sel ast.SelectionSet, obj *model.ServicegroupSvcGroupLinkInfo) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, servicegroup_SvcGroupLinkInfoImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("servicegroup_SvcGroupLinkInfo") - case "Id": - - out.Values[i] = ec._servicegroup_SvcGroupLinkInfo_Id(ctx, field, obj) - - case "ParentLabels": - - out.Values[i] = ec._servicegroup_SvcGroupLinkInfo_ParentLabels(ctx, field, obj) - - case "ClusterName": - - out.Values[i] = ec._servicegroup_SvcGroupLinkInfo_ClusterName(ctx, field, obj) - - case "DomainName": - - out.Values[i] = ec._servicegroup_SvcGroupLinkInfo_DomainName(ctx, field, obj) - - case "ServiceName": - - out.Values[i] = ec._servicegroup_SvcGroupLinkInfo_ServiceName(ctx, field, obj) - - case "ServiceType": - - out.Values[i] = ec._servicegroup_SvcGroupLinkInfo_ServiceType(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -// endregion **************************** object.gotpl **************************** - -// region ***************************** type.gotpl ***************************** - -func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { - res := graphql.MarshalBoolean(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) marshalN__Directive2githubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { - return ec.___Directive(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__Directive2githubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]string, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) - if err != nil { - return nil, err - } - } - return res, nil -} - -func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { - return ec.___EnumValue(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__Field2githubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { - return ec.___Field(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { - return ec.___InputValue(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__InputValue2githubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalN__Type2githubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { - return ec.___Type(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__Type2githubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec.___Type(ctx, sel, v) -} - -func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) marshalNconfig_Config2nexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐConfigConfig(ctx context.Context, sel ast.SelectionSet, v model.ConfigConfig) graphql.Marshaler { - return ec._config_Config(ctx, sel, &v) -} - -func (ec *executionContext) marshalNconfig_Config2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐConfigConfig(ctx context.Context, sel ast.SelectionSet, v *model.ConfigConfig) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._config_Config(ctx, sel, v) -} - -func (ec *executionContext) marshalNconfig_Domain2nexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐConfigDomain(ctx context.Context, sel ast.SelectionSet, v model.ConfigDomain) graphql.Marshaler { - return ec._config_Domain(ctx, sel, &v) -} - -func (ec *executionContext) marshalNconfig_Domain2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐConfigDomain(ctx context.Context, sel ast.SelectionSet, v *model.ConfigDomain) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._config_Domain(ctx, sel, v) -} - -func (ec *executionContext) marshalNconfig_FooTypeABC2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐConfigFooTypeABC(ctx context.Context, sel ast.SelectionSet, v *model.ConfigFooTypeABC) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._config_FooTypeABC(ctx, sel, v) -} - -func (ec *executionContext) marshalNgns_BarChild2nexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐGnsBarChild(ctx context.Context, sel ast.SelectionSet, v model.GnsBarChild) graphql.Marshaler { - return ec._gns_BarChild(ctx, sel, &v) -} - -func (ec *executionContext) marshalNgns_BarChild2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐGnsBarChild(ctx context.Context, sel ast.SelectionSet, v *model.GnsBarChild) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._gns_BarChild(ctx, sel, v) -} - -func (ec *executionContext) marshalNgns_Dns2nexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐGnsDns(ctx context.Context, sel ast.SelectionSet, v model.GnsDns) graphql.Marshaler { - return ec._gns_Dns(ctx, sel, &v) -} - -func (ec *executionContext) marshalNgns_Dns2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐGnsDns(ctx context.Context, sel ast.SelectionSet, v *model.GnsDns) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._gns_Dns(ctx, sel, v) -} - -func (ec *executionContext) marshalNgns_Gns2nexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐGnsGns(ctx context.Context, sel ast.SelectionSet, v model.GnsGns) graphql.Marshaler { - return ec._gns_Gns(ctx, sel, &v) -} - -func (ec *executionContext) marshalNgns_Gns2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐGnsGns(ctx context.Context, sel ast.SelectionSet, v *model.GnsGns) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._gns_Gns(ctx, sel, v) -} - -func (ec *executionContext) marshalNpolicypkg_ACPConfig2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐPolicypkgACPConfig(ctx context.Context, sel ast.SelectionSet, v *model.PolicypkgACPConfig) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._policypkg_ACPConfig(ctx, sel, v) -} - -func (ec *executionContext) marshalNpolicypkg_AccessControlPolicy2nexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐPolicypkgAccessControlPolicy(ctx context.Context, sel ast.SelectionSet, v model.PolicypkgAccessControlPolicy) graphql.Marshaler { - return ec._policypkg_AccessControlPolicy(ctx, sel, &v) -} - -func (ec *executionContext) marshalNpolicypkg_AccessControlPolicy2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐPolicypkgAccessControlPolicy(ctx context.Context, sel ast.SelectionSet, v *model.PolicypkgAccessControlPolicy) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._policypkg_AccessControlPolicy(ctx, sel, v) -} - -func (ec *executionContext) marshalNpolicypkg_VMpolicy2nexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐPolicypkgVMpolicy(ctx context.Context, sel ast.SelectionSet, v model.PolicypkgVMpolicy) graphql.Marshaler { - return ec._policypkg_VMpolicy(ctx, sel, &v) -} - -func (ec *executionContext) marshalNpolicypkg_VMpolicy2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐPolicypkgVMpolicy(ctx context.Context, sel ast.SelectionSet, v *model.PolicypkgVMpolicy) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._policypkg_VMpolicy(ctx, sel, v) -} - -func (ec *executionContext) marshalNservicegroup_SvcGroupLinkInfo2nexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐServicegroupSvcGroupLinkInfo(ctx context.Context, sel ast.SelectionSet, v model.ServicegroupSvcGroupLinkInfo) graphql.Marshaler { - return ec._servicegroup_SvcGroupLinkInfo(ctx, sel, &v) -} - -func (ec *executionContext) marshalNservicegroup_SvcGroupLinkInfo2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐServicegroupSvcGroupLinkInfo(ctx context.Context, sel ast.SelectionSet, v *model.ServicegroupSvcGroupLinkInfo) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._servicegroup_SvcGroupLinkInfo(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { - res := graphql.MarshalBoolean(v) - return res -} - -func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalBoolean(*v) - return res -} - -func (ec *executionContext) unmarshalOFloat2ᚖfloat64(ctx context.Context, v interface{}) (*float64, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalFloatContext(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOFloat2ᚖfloat64(ctx context.Context, sel ast.SelectionSet, v *float64) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalFloatContext(*v) - return graphql.WrapContextMarshaler(ctx, res) -} - -func (ec *executionContext) unmarshalOID2ᚖstring(ctx context.Context, v interface{}) (*string, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalID(v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOID2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalID(*v) - return res -} - -func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interface{}) (*int, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalInt(v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalInt(*v) - return res -} - -func (ec *executionContext) unmarshalOMap2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalMap(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOMap2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalMap(v) - return res -} - -func (ec *executionContext) marshalONexusGraphqlResponse2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐNexusGraphqlResponse(ctx context.Context, sel ast.SelectionSet, v *model.NexusGraphqlResponse) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._NexusGraphqlResponse(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalString(v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalString(*v) - return res -} - -func (ec *executionContext) marshalOTimeSeriesData2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐTimeSeriesData(ctx context.Context, sel ast.SelectionSet, v *model.TimeSeriesData) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._TimeSeriesData(ctx, sel, v) -} - -func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__Field2githubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__InputValue2githubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec.___Schema(ctx, sel, v) -} - -func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__Type2githubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋvmwareᚑtanzuᚋgraphᚑframeworkᚑforᚑmicroservicesᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec.___Type(ctx, sel, v) -} - -func (ec *executionContext) marshalOconfig_FooTypeABC2ᚕᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐConfigFooTypeABCᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ConfigFooTypeABC) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNconfig_FooTypeABC2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐConfigFooTypeABC(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalOpolicypkg_ACPConfig2ᚕᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐPolicypkgACPConfigᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.PolicypkgACPConfig) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNpolicypkg_ACPConfig2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐPolicypkgACPConfig(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalOpolicypkg_AccessControlPolicy2ᚕᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐPolicypkgAccessControlPolicyᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.PolicypkgAccessControlPolicy) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNpolicypkg_AccessControlPolicy2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐPolicypkgAccessControlPolicy(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalOroot_Root2ᚖnexustempmoduleᚋnexusᚑgqlᚋgraphᚋmodelᚐRootRoot(ctx context.Context, sel ast.SelectionSet, v *model.RootRoot) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._root_Root(ctx, sel, v) -} - -// endregion ***************************** type.gotpl ***************************** diff --git a/compiler/example/output/generated/nexus-gql/graph/graphqlResolver.go b/compiler/example/output/generated/nexus-gql/graph/graphqlResolver.go index 9306d0ba5..f173d41d2 100644 --- a/compiler/example/output/generated/nexus-gql/graph/graphqlResolver.go +++ b/compiler/example/output/generated/nexus-gql/graph/graphqlResolver.go @@ -4,40 +4,44 @@ import ( "context" "encoding/json" "fmt" - "os" - "sync" log "github.com/sirupsen/logrus" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - "k8s.io/client-go/util/flowcontrol" - nexus_client "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/nexus-client" - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/nexus-gql/graph/model" - - "github.com/vmware-tanzu/graph-framework-for-microservices/nexus/generated/graphql" qm "github.com/vmware-tanzu/graph-framework-for-microservices/nexus/generated/query-manager" - "github.com/vmware-tanzu/graph-framework-for-microservices/nexus/nexus" + nexus_client "nexustempmodule/nexus-client" + "nexustempmodule/nexus-gql/graph/model" ) var c = GrpcClients{ - mtx: sync.Mutex{}, - Clients: map[string]GrpcClient{}, + mtx: sync.Mutex{}, + Clients: map[string]GrpcClient{}, } var nc *nexus_client.Clientset func getParentName(parentLabels map[string]interface{}, key string) string { - if v, ok := parentLabels[key]; ok && v != nil { - return v.(string) + if v, ok := parentLabels[key]; ok && v != nil { + return v.(string) } return "" } +type NodeMetricTypeEnum string +type ServiceMetricTypeEnum string +type ServiceGroupByEnum string +type HTTPMethodEnum string +type EventSeverityEnum string +type AnalyticsMetricEnum string +type AnalyticsSubMetricEnum string +type TrafficDirectionEnum string +type SloDetailsEnum string + ////////////////////////////////////// // Nexus K8sAPIEndpointConfig ////////////////////////////////////// func getK8sAPIEndpointConfig() *rest.Config { - var ( + var ( config *rest.Config err error ) @@ -48,49 +52,43 @@ func getK8sAPIEndpointConfig() *rest.Config { return nil } } else { - config, err = rest.InClusterConfig() - if err != nil { - return nil - } + config, err = rest.InClusterConfig() + if err != nil { + return nil + } } config.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(200, 300) return config } - -////////////////////////////////////// -// Singleton Resolver for Parent Node -// PKG: Root, NODE: Root -////////////////////////////////////// -func getRootResolver() (*model.RootRoot, error) { - if nc == nil { - k8sApiConfig := getK8sAPIEndpointConfig() - nexusClient, err := nexus_client.NewForConfig(k8sApiConfig) - if err != nil { - return nil, fmt.Errorf("failed to get k8s client config: %s", err) +// Custom query +func getGlobalClusterqueryNodeTSResolver(obj *model.GlobalCluster, nodeMetric *model.NodeMetricTypeEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } } - nc = nexusClient - nc.SubscribeAll() - log.Debugf("Subscribed to all nodes in datamodel") } - - vRoot, err := nc.GetRootRoot(context.TODO()) - if err != nil { - log.Errorf("[getRootResolver]Error getting Root node %s", err) - return nil, nil + metricArgs := &qm.MetricArg{ + QueryType: "/queryNodeTS", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "nodeMetric": pointerToString(nodeMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, } - dn := vRoot.DisplayName() - parentLabels := map[string]interface{}{"roots.root.tsm.tanzu.vmware.com": dn} - - ret := &model.RootRoot{ - Id: &dn, - ParentLabels: parentLabels, + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err } - log.Debugf("[getRootResolver]Output Root object %+v", ret) - return ret, nil + return resp.(*model.TimeSeriesData), nil } - // Custom query -func getConfigConfigQueryExampleResolver(obj *model.ConfigConfig, StartTime *string, EndTime *string, Interval *string, IsServiceDeployment *bool, StartVal *int) (*model.NexusGraphqlResponse, error) { +func getGlobalClusterqueryServiceTSResolver(obj *model.GlobalCluster, svcMetric *model.ServiceMetricTypeEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { parentLabels := make(map[string]string) if obj != nil { for k, v := range obj.ParentLabels { @@ -100,27 +98,24 @@ func getConfigConfigQueryExampleResolver(obj *model.ConfigConfig, StartTime *str } } } - query := &graphql.GraphQLQuery{ - Query: "QueryExample", + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTS", + Hierarchy: parentLabels, UserProvidedArgs: map[string]string{ - "StartTime": pointerToString(StartTime), - "EndTime": pointerToString(EndTime), - "Interval": pointerToString(Interval), - "IsServiceDeployment": pointerToString(IsServiceDeployment), - "StartVal": pointerToString(StartVal), + "svcMetric": pointerToString(svcMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), }, - Hierarchy: parentLabels, } - - resp, err := c.Request("query-manager:6000", nexus.GraphQLQueryApi, query) + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) if err != nil { return nil, err } - return resp.(*model.NexusGraphqlResponse), nil + return resp.(*model.TimeSeriesData), nil } - // Custom query -func getGnsGnsqueryGns1Resolver(obj *model.GnsGns, StartTime *string, EndTime *string, Interval *string, IsServiceDeployment *bool, StartVal *int) (*model.NexusGraphqlResponse, error) { +func getGlobalClusterqueryServiceTableResolver(obj *model.GlobalCluster, startTime *string, endTime *string, SystemServices *bool, ShowGateways *bool, Groupby *model.ServiceGroupByEnum, noMetrics *bool, limit *int, last *string,) (*model.TimeSeriesData, error) { parentLabels := make(map[string]string) if obj != nil { for k, v := range obj.ParentLabels { @@ -130,27 +125,28 @@ func getGnsGnsqueryGns1Resolver(obj *model.GnsGns, StartTime *string, EndTime *s } } } - query := &graphql.GraphQLQuery{ - Query: "queryGns1", + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTable", + Hierarchy: parentLabels, UserProvidedArgs: map[string]string{ - "StartTime": pointerToString(StartTime), - "EndTime": pointerToString(EndTime), - "Interval": pointerToString(Interval), - "IsServiceDeployment": pointerToString(IsServiceDeployment), - "StartVal": pointerToString(StartVal), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "SystemServices": pointerToString(SystemServices), + "ShowGateways": pointerToString(ShowGateways), + "Groupby": pointerToString(Groupby), + "noMetrics": pointerToString(noMetrics), + "limit": pointerToString(limit), + "last": pointerToString(last), }, - Hierarchy: parentLabels, } - - resp, err := c.Request("nexus-query-responder:15000", nexus.GraphQLQueryApi, query) + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) if err != nil { return nil, err } - return resp.(*model.NexusGraphqlResponse), nil + return resp.(*model.TimeSeriesData), nil } - // Custom query -func getGnsGnsqueryGnsQM1Resolver(obj *model.GnsGns) (*model.TimeSeriesData, error) { +func getGlobalClusterqueryServiceVersionTableResolver(obj *model.GlobalCluster, startTime *string, endTime *string, SystemServices *bool, ShowGateways *bool, noMetrics *bool,) (*model.TimeSeriesData, error) { parentLabels := make(map[string]string) if obj != nil { for k, v := range obj.ParentLabels { @@ -161,19 +157,24 @@ func getGnsGnsqueryGnsQM1Resolver(obj *model.GnsGns) (*model.TimeSeriesData, err } } metricArgs := &qm.MetricArg{ - QueryType: "/queryGnsQM1", - Hierarchy: parentLabels, - UserProvidedArgs: map[string]string{}, + QueryType: "/queryServiceVersionTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "SystemServices": pointerToString(SystemServices), + "ShowGateways": pointerToString(ShowGateways), + "noMetrics": pointerToString(noMetrics), + }, } - resp, err := c.Request("query-manager:15002", nexus.GetMetricsApi, metricArgs) + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) if err != nil { return nil, err } return resp.(*model.TimeSeriesData), nil } - // Custom query -func getGnsGnsqueryGnsQMResolver(obj *model.GnsGns, StartTime *string, EndTime *string, TimeInterval *string, SomeUserArg1 *string, SomeUserArg2 *int, SomeUserArg3 *bool) (*model.TimeSeriesData, error) { +func getGlobalClusterqueryServiceInstanceTableResolver(obj *model.GlobalCluster, startTime *string, endTime *string, limit *int, last *string,) (*model.TimeSeriesData, error) { parentLabels := make(map[string]string) if obj != nil { for k, v := range obj.ParentLabels { @@ -184,26 +185,23 @@ func getGnsGnsqueryGnsQMResolver(obj *model.GnsGns, StartTime *string, EndTime * } } metricArgs := &qm.MetricArg{ - QueryType: "/queryGnsQM", - StartTime: *StartTime, - EndTime: *EndTime, - TimeInterval: *TimeInterval, - Hierarchy: parentLabels, + QueryType: "/queryServiceInstanceTable", + Hierarchy: parentLabels, UserProvidedArgs: map[string]string{ - "SomeUserArg1": pointerToString(SomeUserArg1), - "SomeUserArg2": pointerToString(SomeUserArg2), - "SomeUserArg3": pointerToString(SomeUserArg3), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "limit": pointerToString(limit), + "last": pointerToString(last), }, } - resp, err := c.Request("query-manager:15003", nexus.GetMetricsApi, metricArgs) + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) if err != nil { return nil, err } return resp.(*model.TimeSeriesData), nil } - // Custom query -func getPolicypkgVMpolicyqueryGns1Resolver(obj *model.PolicypkgVMpolicy, StartTime *string, EndTime *string, Interval *string, IsServiceDeployment *bool, StartVal *int) (*model.NexusGraphqlResponse, error) { +func getGlobalClusterqueryServiceTopologyResolver(obj *model.GlobalCluster, metricStringArray *string, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { parentLabels := make(map[string]string) if obj != nil { for k, v := range obj.ParentLabels { @@ -213,27 +211,23 @@ func getPolicypkgVMpolicyqueryGns1Resolver(obj *model.PolicypkgVMpolicy, StartTi } } } - query := &graphql.GraphQLQuery{ - Query: "queryGns1", + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTopology", + Hierarchy: parentLabels, UserProvidedArgs: map[string]string{ - "StartTime": pointerToString(StartTime), - "EndTime": pointerToString(EndTime), - "Interval": pointerToString(Interval), - "IsServiceDeployment": pointerToString(IsServiceDeployment), - "StartVal": pointerToString(StartVal), + "metricStringArray": pointerToString(metricStringArray), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), }, - Hierarchy: parentLabels, } - - resp, err := c.Request("nexus-query-responder:15000", nexus.GraphQLQueryApi, query) + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) if err != nil { return nil, err } - return resp.(*model.NexusGraphqlResponse), nil + return resp.(*model.TimeSeriesData), nil } - // Custom query -func getPolicypkgVMpolicyqueryGnsQM1Resolver(obj *model.PolicypkgVMpolicy) (*model.TimeSeriesData, error) { +func getGlobalClusterqueryClusterTableResolver(obj *model.GlobalCluster, startTime *string, endTime *string, timeInterval *string, noMetrics *bool,) (*model.TimeSeriesData, error) { parentLabels := make(map[string]string) if obj != nil { for k, v := range obj.ParentLabels { @@ -244,19 +238,23 @@ func getPolicypkgVMpolicyqueryGnsQM1Resolver(obj *model.PolicypkgVMpolicy) (*mod } } metricArgs := &qm.MetricArg{ - QueryType: "/queryGnsQM1", - Hierarchy: parentLabels, - UserProvidedArgs: map[string]string{}, + QueryType: "/queryClusterTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + "noMetrics": pointerToString(noMetrics), + }, } - resp, err := c.Request("query-manager:15002", nexus.GetMetricsApi, metricArgs) + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) if err != nil { return nil, err } return resp.(*model.TimeSeriesData), nil } - // Custom query -func getPolicypkgVMpolicyqueryGnsQMResolver(obj *model.PolicypkgVMpolicy, StartTime *string, EndTime *string, TimeInterval *string, SomeUserArg1 *string, SomeUserArg2 *int, SomeUserArg3 *bool) (*model.TimeSeriesData, error) { +func getGlobalClusterqueryNodeTableResolver(obj *model.GlobalCluster, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { parentLabels := make(map[string]string) if obj != nil { for k, v := range obj.ParentLabels { @@ -267,839 +265,26419 @@ func getPolicypkgVMpolicyqueryGnsQMResolver(obj *model.PolicypkgVMpolicy, StartT } } metricArgs := &qm.MetricArg{ - QueryType: "/queryGnsQM", - StartTime: *StartTime, - EndTime: *EndTime, - TimeInterval: *TimeInterval, - Hierarchy: parentLabels, + QueryType: "/queryNodeTable", + Hierarchy: parentLabels, UserProvidedArgs: map[string]string{ - "SomeUserArg1": pointerToString(SomeUserArg1), - "SomeUserArg2": pointerToString(SomeUserArg2), - "SomeUserArg3": pointerToString(SomeUserArg3), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), }, } - resp, err := c.Request("query-manager:15003", nexus.GetMetricsApi, metricArgs) + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) if err != nil { return nil, err } return resp.(*model.TimeSeriesData), nil } - -////////////////////////////////////// -// CHILD RESOLVER (Non Singleton) -// FieldName: Config Node: Root PKG: Root -////////////////////////////////////// -func getRootRootConfigResolver(obj *model.RootRoot, id *string) (*model.ConfigConfig, error) { - log.Debugf("[getRootRootConfigResolver]Parent Object %+v", obj) - if id != nil && *id != "" { - log.Debugf("[getRootRootConfigResolver]Id %q", *id) - vConfig, err := nc.RootRoot().GetConfig(context.TODO(), *id) - if err != nil { - log.Errorf("[getRootRootConfigResolver]Error getting Config node %q : %s", *id, err) - return &model.ConfigConfig{}, nil - } - dn := vConfig.DisplayName() - parentLabels := map[string]interface{}{"configs.config.tsm.tanzu.vmware.com": dn} - MyStr0, _ := json.Marshal(vConfig.Spec.MyStr0) - MyStr0Data := string(MyStr0) - MyStr1, _ := json.Marshal(vConfig.Spec.MyStr1) - MyStr1Data := string(MyStr1) - MyStr2, _ := json.Marshal(vConfig.Spec.MyStr2) - MyStr2Data := string(MyStr2) - XYZPort, _ := json.Marshal(vConfig.Spec.XYZPort) - XYZPortData := string(XYZPort) - ABCHost, _ := json.Marshal(vConfig.Spec.ABCHost) - ABCHostData := string(ABCHost) - ClusterNamespaces, _ := json.Marshal(vConfig.Spec.ClusterNamespaces) - ClusterNamespacesData := string(ClusterNamespaces) - TestValMarkers, _ := json.Marshal(vConfig.Spec.TestValMarkers) - TestValMarkersData := string(TestValMarkers) - vInstance := float64(vConfig.Spec.Instance) - vCuOption := string(vConfig.Spec.CuOption) - +// Custom query +func getGlobalClusterqueryServiceNodeMapGroupedByNodeResolver(obj *model.GlobalCluster, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { for k, v := range obj.ParentLabels { - parentLabels[k] = v + val, ok := v.(string) + if ok { + parentLabels[k] = val + } } - ret := &model.ConfigConfig{ - Id: &dn, - ParentLabels: parentLabels, - MyStr0: &MyStr0Data, - MyStr1: &MyStr1Data, - MyStr2: &MyStr2Data, - XYZPort: &XYZPortData, - ABCHost: &ABCHostData, - ClusterNamespaces: &ClusterNamespacesData, - TestValMarkers: &TestValMarkersData, - Instance: &vInstance, - CuOption: &vCuOption, - } - - log.Debugf("[getRootRootConfigResolver]Output object %v", ret) - return ret, nil } - log.Debug("[getRootRootConfigResolver]Id is empty, process all Configs") - vConfigParent, err := nc.GetRootRoot(context.TODO()) - if err != nil { - log.Errorf("[getRootRootConfigResolver]Failed to get parent node %s", err) - return &model.ConfigConfig{}, nil + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceNodeMapGroupedByNode", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, } - vConfig, err := vConfigParent.GetConfig(context.TODO()) + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) if err != nil { - log.Errorf("[getRootRootConfigResolver]Error getting Config node %s", err) - return &model.ConfigConfig{}, nil + return nil, err } - dn := vConfig.DisplayName() - parentLabels := map[string]interface{}{"configs.config.tsm.tanzu.vmware.com": dn} - MyStr0, _ := json.Marshal(vConfig.Spec.MyStr0) - MyStr0Data := string(MyStr0) - MyStr1, _ := json.Marshal(vConfig.Spec.MyStr1) - MyStr1Data := string(MyStr1) - MyStr2, _ := json.Marshal(vConfig.Spec.MyStr2) - MyStr2Data := string(MyStr2) - XYZPort, _ := json.Marshal(vConfig.Spec.XYZPort) - XYZPortData := string(XYZPort) - ABCHost, _ := json.Marshal(vConfig.Spec.ABCHost) - ABCHostData := string(ABCHost) - ClusterNamespaces, _ := json.Marshal(vConfig.Spec.ClusterNamespaces) - ClusterNamespacesData := string(ClusterNamespaces) - TestValMarkers, _ := json.Marshal(vConfig.Spec.TestValMarkers) - TestValMarkersData := string(TestValMarkers) - vInstance := float64(vConfig.Spec.Instance) - vCuOption := string(vConfig.Spec.CuOption) - - for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.ConfigConfig{ - Id: &dn, - ParentLabels: parentLabels, - MyStr0: &MyStr0Data, - MyStr1: &MyStr1Data, - MyStr2: &MyStr2Data, - XYZPort: &XYZPortData, - ABCHost: &ABCHostData, - ClusterNamespaces: &ClusterNamespacesData, - TestValMarkers: &TestValMarkersData, - Instance: &vInstance, - CuOption: &vCuOption, - } - - log.Debugf("[getRootRootConfigResolver]Output object %v", ret) - - return ret, nil + return resp.(*model.TimeSeriesData), nil } - -////////////////////////////////////// -// CHILD RESOLVER (Non Singleton) -// FieldName: GNS Node: Config PKG: Config -////////////////////////////////////// -func getConfigConfigGNSResolver(obj *model.ConfigConfig, id *string) (*model.GnsGns, error) { - log.Debugf("[getConfigConfigGNSResolver]Parent Object %+v", obj) - if id != nil && *id != "" { - log.Debugf("[getConfigConfigGNSResolver]Id %q", *id) - vGns, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GetGNS(context.TODO(), *id) - if err != nil { - log.Errorf("[getConfigConfigGNSResolver]Error getting GNS node %q : %s", *id, err) - return &model.GnsGns{}, nil - } - dn := vGns.DisplayName() - parentLabels := map[string]interface{}{"gnses.gns.tsm.tanzu.vmware.com": dn} - vDomain := string(vGns.Spec.Domain) - vUseSharedGateway := bool(vGns.Spec.UseSharedGateway) - Description, _ := json.Marshal(vGns.Spec.Description) - DescriptionData := string(Description) - vMeta := string(vGns.Spec.Meta) - OtherDescription, _ := json.Marshal(vGns.Spec.OtherDescription) - OtherDescriptionData := string(OtherDescription) - MapPointer, _ := json.Marshal(vGns.Spec.MapPointer) - MapPointerData := string(MapPointer) - SlicePointer, _ := json.Marshal(vGns.Spec.SlicePointer) - SlicePointerData := string(SlicePointer) - WorkloadSpec, _ := json.Marshal(vGns.Spec.WorkloadSpec) - WorkloadSpecData := string(WorkloadSpec) - DifferentSpec, _ := json.Marshal(vGns.Spec.DifferentSpec) - DifferentSpecData := string(DifferentSpec) - ServiceSegmentRef, _ := json.Marshal(vGns.Spec.ServiceSegmentRef) - ServiceSegmentRefData := string(ServiceSegmentRef) - ServiceSegmentRefPointer, _ := json.Marshal(vGns.Spec.ServiceSegmentRefPointer) - ServiceSegmentRefPointerData := string(ServiceSegmentRefPointer) - ServiceSegmentRefs, _ := json.Marshal(vGns.Spec.ServiceSegmentRefs) - ServiceSegmentRefsData := string(ServiceSegmentRefs) - ServiceSegmentRefMap, _ := json.Marshal(vGns.Spec.ServiceSegmentRefMap) - ServiceSegmentRefMapData := string(ServiceSegmentRefMap) - +// Custom query +func getGlobalClusterqueryServiceNodeMapGroupedByServiceResolver(obj *model.GlobalCluster, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { for k, v := range obj.ParentLabels { - parentLabels[k] = v + val, ok := v.(string) + if ok { + parentLabels[k] = val + } } - ret := &model.GnsGns{ - Id: &dn, - ParentLabels: parentLabels, - Domain: &vDomain, - UseSharedGateway: &vUseSharedGateway, - Description: &DescriptionData, - Meta: &vMeta, - OtherDescription: &OtherDescriptionData, - MapPointer: &MapPointerData, - SlicePointer: &SlicePointerData, - WorkloadSpec: &WorkloadSpecData, - DifferentSpec: &DifferentSpecData, - ServiceSegmentRef: &ServiceSegmentRefData, - ServiceSegmentRefPointer: &ServiceSegmentRefPointerData, - ServiceSegmentRefs: &ServiceSegmentRefsData, - ServiceSegmentRefMap: &ServiceSegmentRefMapData, - } - - log.Debugf("[getConfigConfigGNSResolver]Output object %v", ret) - return ret, nil - } - log.Debug("[getConfigConfigGNSResolver]Id is empty, process all GNSs") - vGnsParent, err := nc.RootRoot().GetConfig(context.TODO(), getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")) - if err != nil { - log.Errorf("[getConfigConfigGNSResolver]Failed to get parent node %s", err) - return &model.GnsGns{}, nil - } - vGns, err := vGnsParent.GetGNS(context.TODO()) - if err != nil { - log.Errorf("[getConfigConfigGNSResolver]Error getting GNS node %s", err) - return &model.GnsGns{}, nil - } - dn := vGns.DisplayName() - parentLabels := map[string]interface{}{"gnses.gns.tsm.tanzu.vmware.com": dn} - vDomain := string(vGns.Spec.Domain) - vUseSharedGateway := bool(vGns.Spec.UseSharedGateway) - Description, _ := json.Marshal(vGns.Spec.Description) - DescriptionData := string(Description) - vMeta := string(vGns.Spec.Meta) - OtherDescription, _ := json.Marshal(vGns.Spec.OtherDescription) - OtherDescriptionData := string(OtherDescription) - MapPointer, _ := json.Marshal(vGns.Spec.MapPointer) - MapPointerData := string(MapPointer) - SlicePointer, _ := json.Marshal(vGns.Spec.SlicePointer) - SlicePointerData := string(SlicePointer) - WorkloadSpec, _ := json.Marshal(vGns.Spec.WorkloadSpec) - WorkloadSpecData := string(WorkloadSpec) - DifferentSpec, _ := json.Marshal(vGns.Spec.DifferentSpec) - DifferentSpecData := string(DifferentSpec) - ServiceSegmentRef, _ := json.Marshal(vGns.Spec.ServiceSegmentRef) - ServiceSegmentRefData := string(ServiceSegmentRef) - ServiceSegmentRefPointer, _ := json.Marshal(vGns.Spec.ServiceSegmentRefPointer) - ServiceSegmentRefPointerData := string(ServiceSegmentRefPointer) - ServiceSegmentRefs, _ := json.Marshal(vGns.Spec.ServiceSegmentRefs) - ServiceSegmentRefsData := string(ServiceSegmentRefs) - ServiceSegmentRefMap, _ := json.Marshal(vGns.Spec.ServiceSegmentRefMap) - ServiceSegmentRefMapData := string(ServiceSegmentRefMap) - - for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.GnsGns{ - Id: &dn, - ParentLabels: parentLabels, - Domain: &vDomain, - UseSharedGateway: &vUseSharedGateway, - Description: &DescriptionData, - Meta: &vMeta, - OtherDescription: &OtherDescriptionData, - MapPointer: &MapPointerData, - SlicePointer: &SlicePointerData, - WorkloadSpec: &WorkloadSpecData, - DifferentSpec: &DifferentSpecData, - ServiceSegmentRef: &ServiceSegmentRefData, - ServiceSegmentRefPointer: &ServiceSegmentRefPointerData, - ServiceSegmentRefs: &ServiceSegmentRefsData, - ServiceSegmentRefMap: &ServiceSegmentRefMapData, - } - - log.Debugf("[getConfigConfigGNSResolver]Output object %v", ret) - - return ret, nil -} - -////////////////////////////////////// -// CHILD RESOLVER (Singleton) -// FieldName: DNS Node: Config PKG: Config -////////////////////////////////////// -func getConfigConfigDNSResolver(obj *model.ConfigConfig) (*model.GnsDns, error) { - log.Debugf("[getConfigConfigDNSResolver]Parent Object %+v", obj) - vDns, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GetDNS(context.TODO()) - if err != nil { - log.Errorf("[getConfigConfigDNSResolver]Error getting Config node %s", err) - return &model.GnsDns{}, nil } - dn := vDns.DisplayName() - parentLabels := map[string]interface{}{"dnses.gns.tsm.tanzu.vmware.com": dn} - - for k, v := range obj.ParentLabels { - parentLabels[k] = v + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceNodeMapGroupedByService", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, } - ret := &model.GnsDns{ - Id: &dn, - ParentLabels: parentLabels, + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err } - - log.Debugf("[getConfigConfigDNSResolver]Output object %+v", ret) - return ret, nil + return resp.(*model.TimeSeriesData), nil } - -////////////////////////////////////// -// CHILD RESOLVER (Non Singleton) -// FieldName: VMPPolicies Node: Config PKG: Config -////////////////////////////////////// -func getConfigConfigVMPPoliciesResolver(obj *model.ConfigConfig, id *string) (*model.PolicypkgVMpolicy, error) { - log.Debugf("[getConfigConfigVMPPoliciesResolver]Parent Object %+v", obj) - if id != nil && *id != "" { - log.Debugf("[getConfigConfigVMPPoliciesResolver]Id %q", *id) - vVMpolicy, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GetVMPPolicies(context.TODO(), *id) - if err != nil { - log.Errorf("[getConfigConfigVMPPoliciesResolver]Error getting VMPPolicies node %q : %s", *id, err) - return &model.PolicypkgVMpolicy{}, nil - } - dn := vVMpolicy.DisplayName() - parentLabels := map[string]interface{}{"vmpolicies.policypkg.tsm.tanzu.vmware.com": dn} - +// Custom query +func getGlobalClusterqueryServiceNodeMapGroupedByServiceVersionResolver(obj *model.GlobalCluster, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.PolicypkgVMpolicy{ - Id: &dn, - ParentLabels: parentLabels, + val, ok := v.(string) + if ok { + parentLabels[k] = val + } } - - log.Debugf("[getConfigConfigVMPPoliciesResolver]Output object %v", ret) - return ret, nil } - log.Debug("[getConfigConfigVMPPoliciesResolver]Id is empty, process all VMPPoliciess") - vVMpolicyParent, err := nc.RootRoot().GetConfig(context.TODO(), getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")) - if err != nil { - log.Errorf("[getConfigConfigVMPPoliciesResolver]Failed to get parent node %s", err) - return &model.PolicypkgVMpolicy{}, nil + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceNodeMapGroupedByServiceVersion", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, } - vVMpolicy, err := vVMpolicyParent.GetVMPPolicies(context.TODO()) + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) if err != nil { - log.Errorf("[getConfigConfigVMPPoliciesResolver]Error getting VMPPolicies node %s", err) - return &model.PolicypkgVMpolicy{}, nil - } - dn := vVMpolicy.DisplayName() - parentLabels := map[string]interface{}{"vmpolicies.policypkg.tsm.tanzu.vmware.com": dn} - - for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.PolicypkgVMpolicy{ - Id: &dn, - ParentLabels: parentLabels, + return nil, err } - - log.Debugf("[getConfigConfigVMPPoliciesResolver]Output object %v", ret) - - return ret, nil + return resp.(*model.TimeSeriesData), nil } - -////////////////////////////////////// -// CHILD RESOLVER (Non Singleton) -// FieldName: Domain Node: Config PKG: Config -////////////////////////////////////// -func getConfigConfigDomainResolver(obj *model.ConfigConfig, id *string) (*model.ConfigDomain, error) { - log.Debugf("[getConfigConfigDomainResolver]Parent Object %+v", obj) - if id != nil && *id != "" { - log.Debugf("[getConfigConfigDomainResolver]Id %q", *id) - vDomain, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GetDomain(context.TODO(), *id) - if err != nil { - log.Errorf("[getConfigConfigDomainResolver]Error getting Domain node %q : %s", *id, err) - return &model.ConfigDomain{}, nil - } - dn := vDomain.DisplayName() - parentLabels := map[string]interface{}{"domains.config.tsm.tanzu.vmware.com": dn} - PointPort, _ := json.Marshal(vDomain.Spec.PointPort) - PointPortData := string(PointPort) - PointMap, _ := json.Marshal(vDomain.Spec.PointMap) - PointMapData := string(PointMap) - PointSlice, _ := json.Marshal(vDomain.Spec.PointSlice) - PointSliceData := string(PointSlice) - SliceOfPoints, _ := json.Marshal(vDomain.Spec.SliceOfPoints) - SliceOfPointsData := string(SliceOfPoints) - SliceOfArrPoints, _ := json.Marshal(vDomain.Spec.SliceOfArrPoints) - SliceOfArrPointsData := string(SliceOfArrPoints) - MapOfArrsPoints, _ := json.Marshal(vDomain.Spec.MapOfArrsPoints) - MapOfArrsPointsData := string(MapOfArrsPoints) - PointStruct, _ := json.Marshal(vDomain.Spec.PointStruct) - PointStructData := string(PointStruct) - +// Custom query +func getGlobalClusterqueryStatsResolver(obj *model.GlobalCluster, metricStringArray *string, api *string, method *model.HTTPMethodEnum, sourceWorkloadDN *string, severity *model.EventSeverityEnum, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.ConfigDomain{ - Id: &dn, - ParentLabels: parentLabels, - PointPort: &PointPortData, - PointMap: &PointMapData, - PointSlice: &PointSliceData, - SliceOfPoints: &SliceOfPointsData, - SliceOfArrPoints: &SliceOfArrPointsData, - MapOfArrsPoints: &MapOfArrsPointsData, - PointStruct: &PointStructData, + val, ok := v.(string) + if ok { + parentLabels[k] = val + } } - - log.Debugf("[getConfigConfigDomainResolver]Output object %v", ret) - return ret, nil } - log.Debug("[getConfigConfigDomainResolver]Id is empty, process all Domains") - vDomainParent, err := nc.RootRoot().GetConfig(context.TODO(), getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")) - if err != nil { - log.Errorf("[getConfigConfigDomainResolver]Failed to get parent node %s", err) - return &model.ConfigDomain{}, nil + metricArgs := &qm.MetricArg{ + QueryType: "/queryStats", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metricStringArray": pointerToString(metricStringArray), + "api": pointerToString(api), + "method": pointerToString(method), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, } - vDomain, err := vDomainParent.GetDomain(context.TODO()) + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) if err != nil { - log.Errorf("[getConfigConfigDomainResolver]Error getting Domain node %s", err) - return &model.ConfigDomain{}, nil - } - dn := vDomain.DisplayName() - parentLabels := map[string]interface{}{"domains.config.tsm.tanzu.vmware.com": dn} - PointPort, _ := json.Marshal(vDomain.Spec.PointPort) - PointPortData := string(PointPort) - PointMap, _ := json.Marshal(vDomain.Spec.PointMap) - PointMapData := string(PointMap) - PointSlice, _ := json.Marshal(vDomain.Spec.PointSlice) - PointSliceData := string(PointSlice) - SliceOfPoints, _ := json.Marshal(vDomain.Spec.SliceOfPoints) - SliceOfPointsData := string(SliceOfPoints) - SliceOfArrPoints, _ := json.Marshal(vDomain.Spec.SliceOfArrPoints) - SliceOfArrPointsData := string(SliceOfArrPoints) - MapOfArrsPoints, _ := json.Marshal(vDomain.Spec.MapOfArrsPoints) - MapOfArrsPointsData := string(MapOfArrsPoints) - PointStruct, _ := json.Marshal(vDomain.Spec.PointStruct) - PointStructData := string(PointStruct) - - for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.ConfigDomain{ - Id: &dn, - ParentLabels: parentLabels, - PointPort: &PointPortData, - PointMap: &PointMapData, - PointSlice: &PointSliceData, - SliceOfPoints: &SliceOfPointsData, - SliceOfArrPoints: &SliceOfArrPointsData, - MapOfArrsPoints: &MapOfArrsPointsData, - PointStruct: &PointStructData, + return nil, err } - - log.Debugf("[getConfigConfigDomainResolver]Output object %v", ret) - - return ret, nil + return resp.(*model.TimeSeriesData), nil } - -////////////////////////////////////// -// CHILD RESOLVER (Non Singleton) -// FieldName: SvcGrpInfo Node: Config PKG: Config -////////////////////////////////////// -func getConfigConfigSvcGrpInfoResolver(obj *model.ConfigConfig, id *string) (*model.ServicegroupSvcGroupLinkInfo, error) { - log.Debugf("[getConfigConfigSvcGrpInfoResolver]Parent Object %+v", obj) - if id != nil && *id != "" { - log.Debugf("[getConfigConfigSvcGrpInfoResolver]Id %q", *id) - vSvcGroupLinkInfo, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GetSvcGrpInfo(context.TODO(), *id) - if err != nil { - log.Errorf("[getConfigConfigSvcGrpInfoResolver]Error getting SvcGrpInfo node %q : %s", *id, err) - return &model.ServicegroupSvcGroupLinkInfo{}, nil - } - dn := vSvcGroupLinkInfo.DisplayName() - parentLabels := map[string]interface{}{"svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com": dn} - vClusterName := string(vSvcGroupLinkInfo.Spec.ClusterName) - vDomainName := string(vSvcGroupLinkInfo.Spec.DomainName) - vServiceName := string(vSvcGroupLinkInfo.Spec.ServiceName) - vServiceType := string(vSvcGroupLinkInfo.Spec.ServiceType) - +// Custom query +func getGlobalClusterqueryLogsResolver(obj *model.GlobalCluster, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, sourceWorkloadDN *string, severity *model.EventSeverityEnum, api *string, method *model.HTTPMethodEnum, from *int, size *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.ServicegroupSvcGroupLinkInfo{ - Id: &dn, - ParentLabels: parentLabels, - ClusterName: &vClusterName, - DomainName: &vDomainName, - ServiceName: &vServiceName, - ServiceType: &vServiceType, + val, ok := v.(string) + if ok { + parentLabels[k] = val + } } - - log.Debugf("[getConfigConfigSvcGrpInfoResolver]Output object %v", ret) - return ret, nil } - log.Debug("[getConfigConfigSvcGrpInfoResolver]Id is empty, process all SvcGrpInfos") - vSvcGroupLinkInfoParent, err := nc.RootRoot().GetConfig(context.TODO(), getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")) - if err != nil { - log.Errorf("[getConfigConfigSvcGrpInfoResolver]Failed to get parent node %s", err) - return &model.ServicegroupSvcGroupLinkInfo{}, nil + metricArgs := &qm.MetricArg{ + QueryType: "/queryLogs", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "api": pointerToString(api), + "method": pointerToString(method), + "from": pointerToString(from), + "size": pointerToString(size), + }, } - vSvcGroupLinkInfo, err := vSvcGroupLinkInfoParent.GetSvcGrpInfo(context.TODO()) + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) if err != nil { - log.Errorf("[getConfigConfigSvcGrpInfoResolver]Error getting SvcGrpInfo node %s", err) - return &model.ServicegroupSvcGroupLinkInfo{}, nil - } - dn := vSvcGroupLinkInfo.DisplayName() - parentLabels := map[string]interface{}{"svcgrouplinkinfos.servicegroup.tsm.tanzu.vmware.com": dn} - vClusterName := string(vSvcGroupLinkInfo.Spec.ClusterName) - vDomainName := string(vSvcGroupLinkInfo.Spec.DomainName) - vServiceName := string(vSvcGroupLinkInfo.Spec.ServiceName) - vServiceType := string(vSvcGroupLinkInfo.Spec.ServiceType) - - for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.ServicegroupSvcGroupLinkInfo{ - Id: &dn, - ParentLabels: parentLabels, - ClusterName: &vClusterName, - DomainName: &vDomainName, - ServiceName: &vServiceName, - ServiceType: &vServiceType, + return nil, err } - - log.Debugf("[getConfigConfigSvcGrpInfoResolver]Output object %v", ret) - - return ret, nil + return resp.(*model.TimeSeriesData), nil } - -////////////////////////////////////// -// CHILDREN RESOLVER -// FieldName: FooExample Node: Config PKG: Config -////////////////////////////////////// -func getConfigConfigFooExampleResolver(obj *model.ConfigConfig, id *string) ([]*model.ConfigFooTypeABC, error) { - log.Debugf("[getConfigConfigFooExampleResolver]Parent Object %+v", obj) - var vConfigFooTypeABCList []*model.ConfigFooTypeABC - if id != nil && *id != "" { - log.Debugf("[getConfigConfigFooExampleResolver]Id %q", *id) - vFooTypeABC, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GetFooExample(context.TODO(), *id) - if err != nil { - log.Errorf("[getConfigConfigFooExampleResolver]Error getting FooExample node %q : %s", *id, err) - return vConfigFooTypeABCList, nil - } - dn := vFooTypeABC.DisplayName() - parentLabels := map[string]interface{}{"footypeabcs.config.tsm.tanzu.vmware.com": dn} - FooA, _ := json.Marshal(vFooTypeABC.Spec.FooA) - FooAData := string(FooA) - FooB, _ := json.Marshal(vFooTypeABC.Spec.FooB) - FooBData := string(FooB) - FooD, _ := json.Marshal(vFooTypeABC.Spec.FooD) - FooDData := string(FooD) - FooF, _ := json.Marshal(vFooTypeABC.Spec.FooF) - FooFData := string(FooF) - +// Custom query +func getGlobalClusterqueryListResolver(obj *model.GlobalCluster, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, limit *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.ConfigFooTypeABC{ - Id: &dn, - ParentLabels: parentLabels, - FooA: &FooAData, - FooB: &FooBData, - FooD: &FooDData, - FooF: &FooFData, + val, ok := v.(string) + if ok { + parentLabels[k] = val + } } - vConfigFooTypeABCList = append(vConfigFooTypeABCList, ret) - - log.Debugf("[getConfigConfigFooExampleResolver]Output FooExample objects %v", vConfigFooTypeABCList) - - return vConfigFooTypeABCList, nil } - - log.Debug("[getConfigConfigFooExampleResolver]Id is empty, process all FooExamples") - - vFooTypeABCParent, err := nc.RootRoot().GetConfig(context.TODO(), getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")) - if err != nil { - log.Errorf("[getConfigConfigFooExampleResolver]Error getting parent node %s", err) - return vConfigFooTypeABCList, nil + metricArgs := &qm.MetricArg{ + QueryType: "/queryList", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "limit": pointerToString(limit), + }, } - vFooTypeABCAllObj, err := vFooTypeABCParent.GetAllFooExample(context.TODO()) + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) if err != nil { - log.Errorf("[getConfigConfigFooExampleResolver]Error getting FooExample objects %s", err) - return vConfigFooTypeABCList, nil + return nil, err } - for _, i := range vFooTypeABCAllObj { - vFooTypeABC, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GetFooExample(context.TODO(), i.DisplayName()) - if err != nil { - log.Errorf("[getConfigConfigFooExampleResolver]Error getting FooExample node %q : %s", i.DisplayName(), err) - continue - } - dn := vFooTypeABC.DisplayName() - parentLabels := map[string]interface{}{"footypeabcs.config.tsm.tanzu.vmware.com": dn} - FooA, _ := json.Marshal(vFooTypeABC.Spec.FooA) - FooAData := string(FooA) - FooB, _ := json.Marshal(vFooTypeABC.Spec.FooB) - FooBData := string(FooB) - FooD, _ := json.Marshal(vFooTypeABC.Spec.FooD) - FooDData := string(FooD) - FooF, _ := json.Marshal(vFooTypeABC.Spec.FooF) - FooFData := string(FooF) - - for k, v := range obj.ParentLabels { + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalClusterqueryLinechartResolver(obj *model.GlobalCluster, metric *model.AnalyticsMetricEnum, subMetric *model.AnalyticsSubMetricEnum, startTime *string, endTime *string, sourceWorkloadDN *string, severity *model.EventSeverityEnum, api *string, method *model.HTTPMethodEnum, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryLinechart", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "subMetric": pointerToString(subMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "api": pointerToString(api), + "method": pointerToString(method), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalClusterqueryTopNResolver(obj *model.GlobalCluster, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, direction *model.TrafficDirectionEnum, limit *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryTopN", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "direction": pointerToString(direction), + "limit": pointerToString(limit), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalClusterqueryDetailResolver(obj *model.GlobalCluster, metric *model.AnalyticsMetricEnum, subMetric *model.AnalyticsSubMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, direction *model.TrafficDirectionEnum, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryDetail", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "subMetric": pointerToString(subMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "direction": pointerToString(direction), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalDomainqueryServiceTSResolver(obj *model.GlobalDomain, svcMetric *model.ServiceMetricTypeEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTS", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "svcMetric": pointerToString(svcMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalDomainqueryServiceTableResolver(obj *model.GlobalDomain, startTime *string, endTime *string, SystemServices *bool, ShowGateways *bool, Groupby *model.ServiceGroupByEnum, noMetrics *bool, limit *int, last *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "SystemServices": pointerToString(SystemServices), + "ShowGateways": pointerToString(ShowGateways), + "Groupby": pointerToString(Groupby), + "noMetrics": pointerToString(noMetrics), + "limit": pointerToString(limit), + "last": pointerToString(last), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalDomainqueryServiceVersionTableResolver(obj *model.GlobalDomain, startTime *string, endTime *string, SystemServices *bool, ShowGateways *bool, noMetrics *bool,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceVersionTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "SystemServices": pointerToString(SystemServices), + "ShowGateways": pointerToString(ShowGateways), + "noMetrics": pointerToString(noMetrics), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalDomainqueryServiceInstanceTableResolver(obj *model.GlobalDomain, startTime *string, endTime *string, limit *int, last *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceInstanceTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "limit": pointerToString(limit), + "last": pointerToString(last), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalDomainqueryServiceNodeMapGroupedByNodeResolver(obj *model.GlobalDomain, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceNodeMapGroupedByNode", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalDomainqueryServiceNodeMapGroupedByServiceResolver(obj *model.GlobalDomain, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceNodeMapGroupedByService", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalDomainqueryServiceNodeMapGroupedByServiceVersionResolver(obj *model.GlobalDomain, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceNodeMapGroupedByServiceVersion", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalDomainqueryStatsResolver(obj *model.GlobalDomain, metricStringArray *string, api *string, method *model.HTTPMethodEnum, sourceWorkloadDN *string, severity *model.EventSeverityEnum, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryStats", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metricStringArray": pointerToString(metricStringArray), + "api": pointerToString(api), + "method": pointerToString(method), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalDomainqueryLogsResolver(obj *model.GlobalDomain, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, sourceWorkloadDN *string, severity *model.EventSeverityEnum, api *string, method *model.HTTPMethodEnum, from *int, size *int, gns *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryLogs", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "api": pointerToString(api), + "method": pointerToString(method), + "from": pointerToString(from), + "size": pointerToString(size), + "gns": pointerToString(gns), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalDomainqueryListResolver(obj *model.GlobalDomain, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, limit *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryList", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "limit": pointerToString(limit), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalDomainqueryLinechartResolver(obj *model.GlobalDomain, metric *model.AnalyticsMetricEnum, subMetric *model.AnalyticsSubMetricEnum, startTime *string, endTime *string, sourceWorkloadDN *string, severity *model.EventSeverityEnum, api *string, method *model.HTTPMethodEnum, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryLinechart", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "subMetric": pointerToString(subMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "api": pointerToString(api), + "method": pointerToString(method), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalDomainqueryTopNResolver(obj *model.GlobalDomain, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, direction *model.TrafficDirectionEnum, limit *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryTopN", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "direction": pointerToString(direction), + "limit": pointerToString(limit), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalDomainqueryDetailResolver(obj *model.GlobalDomain, metric *model.AnalyticsMetricEnum, subMetric *model.AnalyticsSubMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, direction *model.TrafficDirectionEnum, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryDetail", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "subMetric": pointerToString(subMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "direction": pointerToString(direction), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalExternalServiceConfigqueryServiceTSResolver(obj *model.GlobalExternalServiceConfig, svcMetric *model.ServiceMetricTypeEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTS", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "svcMetric": pointerToString(svcMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSSvcGroupqueryServiceTSResolver(obj *model.GlobalGNSSvcGroup, svcMetric *model.ServiceMetricTypeEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTS", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "svcMetric": pointerToString(svcMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSSvcGroupqueryServiceInstanceTableResolver(obj *model.GlobalGNSSvcGroup, startTime *string, endTime *string, limit *int, last *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceInstanceTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "limit": pointerToString(limit), + "last": pointerToString(last), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSSvcGroupqueryServiceTableResolver(obj *model.GlobalGNSSvcGroup, startTime *string, endTime *string, SystemServices *bool, ExternalServices *bool, ShowGateways *bool, Groupby *model.ServiceGroupByEnum, noMetrics *bool, limit *int, last *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "SystemServices": pointerToString(SystemServices), + "ExternalServices": pointerToString(ExternalServices), + "ShowGateways": pointerToString(ShowGateways), + "Groupby": pointerToString(Groupby), + "noMetrics": pointerToString(noMetrics), + "limit": pointerToString(limit), + "last": pointerToString(last), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSSvcGroupqueryServiceVersionTableResolver(obj *model.GlobalGNSSvcGroup, startTime *string, endTime *string, SystemServices *bool, ExternalServices *bool, ShowGateways *bool, noMetrics *bool,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceVersionTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "SystemServices": pointerToString(SystemServices), + "ExternalServices": pointerToString(ExternalServices), + "ShowGateways": pointerToString(ShowGateways), + "noMetrics": pointerToString(noMetrics), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSSvcGroupqueryServiceNodeMapGroupedByNodeResolver(obj *model.GlobalGNSSvcGroup, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceNodeMapGroupedByNode", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSSvcGroupqueryServiceNodeMapGroupedByServiceResolver(obj *model.GlobalGNSSvcGroup, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceNodeMapGroupedByService", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSSvcGroupqueryClusterTableResolver(obj *model.GlobalGNSSvcGroup, startTime *string, endTime *string, timeInterval *string, noMetrics *bool,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryClusterTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + "noMetrics": pointerToString(noMetrics), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryServiceTSResolver(obj *model.GlobalGNS, svcMetric *model.ServiceMetricTypeEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTS", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "svcMetric": pointerToString(svcMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryServiceInstanceTableResolver(obj *model.GlobalGNS, startTime *string, endTime *string, limit *int, last *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceInstanceTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "limit": pointerToString(limit), + "last": pointerToString(last), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryServiceTableResolver(obj *model.GlobalGNS, startTime *string, endTime *string, SystemServices *bool, ExternalServices *bool, ShowGateways *bool, Groupby *model.ServiceGroupByEnum, noMetrics *bool, limit *int, last *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "SystemServices": pointerToString(SystemServices), + "ExternalServices": pointerToString(ExternalServices), + "ShowGateways": pointerToString(ShowGateways), + "Groupby": pointerToString(Groupby), + "noMetrics": pointerToString(noMetrics), + "limit": pointerToString(limit), + "last": pointerToString(last), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryServiceVersionTableResolver(obj *model.GlobalGNS, startTime *string, endTime *string, SystemServices *bool, ExternalServices *bool, ShowGateways *bool, noMetrics *bool,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceVersionTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "SystemServices": pointerToString(SystemServices), + "ExternalServices": pointerToString(ExternalServices), + "ShowGateways": pointerToString(ShowGateways), + "noMetrics": pointerToString(noMetrics), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryServiceTopologyResolver(obj *model.GlobalGNS, metricStringArray *string, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTopology", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metricStringArray": pointerToString(metricStringArray), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryClusterTableResolver(obj *model.GlobalGNS, startTime *string, endTime *string, timeInterval *string, noMetrics *bool,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryClusterTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + "noMetrics": pointerToString(noMetrics), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryNodeTableResolver(obj *model.GlobalGNS, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryNodeTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryServiceNodeMapGroupedByNodeResolver(obj *model.GlobalGNS, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceNodeMapGroupedByNode", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryServiceNodeMapGroupedByServiceResolver(obj *model.GlobalGNS, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceNodeMapGroupedByService", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryAccessControlPolicyStatsResolver(obj *model.GlobalGNS, sourceServiceDN *string, destinationServiceDN *string, policy *string, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryAccessControlPolicyStats", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "sourceServiceDN": pointerToString(sourceServiceDN), + "destinationServiceDN": pointerToString(destinationServiceDN), + "policy": pointerToString(policy), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryGNSServiceAPIResolver(obj *model.GlobalGNS, service *string, version *string, showLabels *bool, openapiFormatting *bool,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryGNSServiceAPI", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "service": pointerToString(service), + "version": pointerToString(version), + "showLabels": pointerToString(showLabels), + "openapiFormatting": pointerToString(openapiFormatting), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryStatsResolver(obj *model.GlobalGNS, metricStringArray *string, destinationService *string, destinationServiceVersion *string, api *string, method *model.HTTPMethodEnum, sourceWorkloadDN *string, severity *model.EventSeverityEnum, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryStats", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metricStringArray": pointerToString(metricStringArray), + "destinationService": pointerToString(destinationService), + "destinationServiceVersion": pointerToString(destinationServiceVersion), + "api": pointerToString(api), + "method": pointerToString(method), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryLogsResolver(obj *model.GlobalGNS, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, sourceWorkloadDN *string, severity *model.EventSeverityEnum, destinationService *string, destinationServiceVersion *string, api *string, method *model.HTTPMethodEnum, from *int, size *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryLogs", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "destinationService": pointerToString(destinationService), + "destinationServiceVersion": pointerToString(destinationServiceVersion), + "api": pointerToString(api), + "method": pointerToString(method), + "from": pointerToString(from), + "size": pointerToString(size), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryListResolver(obj *model.GlobalGNS, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, destinationService *string, destinationServiceVersion *string, api *string, method *model.HTTPMethodEnum, limit *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryList", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "destinationService": pointerToString(destinationService), + "destinationServiceVersion": pointerToString(destinationServiceVersion), + "api": pointerToString(api), + "method": pointerToString(method), + "limit": pointerToString(limit), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryLinechartResolver(obj *model.GlobalGNS, metric *model.AnalyticsMetricEnum, subMetric *model.AnalyticsSubMetricEnum, startTime *string, endTime *string, sourceWorkloadDN *string, severity *model.EventSeverityEnum, destinationService *string, destinationServiceVersion *string, api *string, method *model.HTTPMethodEnum, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryLinechart", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "subMetric": pointerToString(subMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "destinationService": pointerToString(destinationService), + "destinationServiceVersion": pointerToString(destinationServiceVersion), + "api": pointerToString(api), + "method": pointerToString(method), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryTopNResolver(obj *model.GlobalGNS, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, destinationService *string, destinationServiceVersion *string, api *string, method *model.HTTPMethodEnum, direction *model.TrafficDirectionEnum, limit *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryTopN", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "destinationService": pointerToString(destinationService), + "destinationServiceVersion": pointerToString(destinationServiceVersion), + "api": pointerToString(api), + "method": pointerToString(method), + "direction": pointerToString(direction), + "limit": pointerToString(limit), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryDetailResolver(obj *model.GlobalGNS, metric *model.AnalyticsMetricEnum, subMetric *model.AnalyticsSubMetricEnum, startTime *string, endTime *string, destinationService *string, destinationServiceVersion *string, api *string, method *model.HTTPMethodEnum, direction *model.TrafficDirectionEnum, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryDetail", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "subMetric": pointerToString(subMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "destinationService": pointerToString(destinationService), + "destinationServiceVersion": pointerToString(destinationServiceVersion), + "api": pointerToString(api), + "method": pointerToString(method), + "direction": pointerToString(direction), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryIncomingAPIsResolver(obj *model.GlobalGNS, startTime *string, endTime *string, destinationService *string, destinationServiceVersion *string, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryIncomingAPIs", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "destinationService": pointerToString(destinationService), + "destinationServiceVersion": pointerToString(destinationServiceVersion), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryOutgoingAPIsResolver(obj *model.GlobalGNS, startTime *string, endTime *string, destinationService *string, destinationServiceVersion *string, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryOutgoingAPIs", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "destinationService": pointerToString(destinationService), + "destinationServiceVersion": pointerToString(destinationServiceVersion), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryIncomingTCPResolver(obj *model.GlobalGNS, startTime *string, endTime *string, destinationService *string, destinationServiceVersion *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryIncomingTCP", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "destinationService": pointerToString(destinationService), + "destinationServiceVersion": pointerToString(destinationServiceVersion), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalGNSqueryOutgoingTCPResolver(obj *model.GlobalGNS, startTime *string, endTime *string, destinationService *string, destinationServiceVersion *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryOutgoingTCP", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "destinationService": pointerToString(destinationService), + "destinationServiceVersion": pointerToString(destinationServiceVersion), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryqueryClusterTableResolver(obj *model.GlobalInventory, startTime *string, endTime *string, timeInterval *string, noMetrics *bool,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryClusterTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + "noMetrics": pointerToString(noMetrics), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryqueryNodeTSResolver(obj *model.GlobalInventory, nodeMetric *model.NodeMetricTypeEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryNodeTS", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "nodeMetric": pointerToString(nodeMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryqueryNodeTableResolver(obj *model.GlobalInventory, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryNodeTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryqueryServiceTSResolver(obj *model.GlobalInventory, svcMetric *model.ServiceMetricTypeEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTS", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "svcMetric": pointerToString(svcMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryquerySloCountsResolver(obj *model.GlobalInventory, svcMetric *model.SloDetailsEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/querySloCounts", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "svcMetric": pointerToString(svcMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryquerySloTableResolver(obj *model.GlobalInventory, svcMetric *model.SloDetailsEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/querySloTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "svcMetric": pointerToString(svcMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryqueryClusterInventoryCountResolver(obj *model.GlobalInventory, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryClusterInventoryCount", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryqueryServiceInstanceTableResolver(obj *model.GlobalInventory, startTime *string, endTime *string, limit *int, last *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceInstanceTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "limit": pointerToString(limit), + "last": pointerToString(last), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryqueryServiceTableResolver(obj *model.GlobalInventory, startTime *string, endTime *string, SystemServices *bool, ShowGateways *bool, Groupby *model.ServiceGroupByEnum, noMetrics *bool, limit *int, last *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "SystemServices": pointerToString(SystemServices), + "ShowGateways": pointerToString(ShowGateways), + "Groupby": pointerToString(Groupby), + "noMetrics": pointerToString(noMetrics), + "limit": pointerToString(limit), + "last": pointerToString(last), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryqueryServiceVersionTableResolver(obj *model.GlobalInventory, startTime *string, endTime *string, SystemServices *bool, ShowGateways *bool, noMetrics *bool,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceVersionTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "SystemServices": pointerToString(SystemServices), + "ShowGateways": pointerToString(ShowGateways), + "noMetrics": pointerToString(noMetrics), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryqueryServiceAPIsResolver(obj *model.GlobalInventory, startTime *string, endTime *string, Continue *string, limit *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceAPIs", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "Continue": pointerToString(Continue), + "limit": pointerToString(limit), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryqueryStatsResolver(obj *model.GlobalInventory, metricStringArray *string, api *string, method *model.HTTPMethodEnum, sourceWorkloadDN *string, severity *model.EventSeverityEnum, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryStats", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metricStringArray": pointerToString(metricStringArray), + "api": pointerToString(api), + "method": pointerToString(method), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryqueryLogsResolver(obj *model.GlobalInventory, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, sourceWorkloadDN *string, severity *model.EventSeverityEnum, api *string, method *model.HTTPMethodEnum, from *int, size *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryLogs", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "api": pointerToString(api), + "method": pointerToString(method), + "from": pointerToString(from), + "size": pointerToString(size), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryqueryListResolver(obj *model.GlobalInventory, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, limit *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryList", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "limit": pointerToString(limit), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryqueryLinechartResolver(obj *model.GlobalInventory, metric *model.AnalyticsMetricEnum, subMetric *model.AnalyticsSubMetricEnum, startTime *string, endTime *string, sourceWorkloadDN *string, severity *model.EventSeverityEnum, api *string, method *model.HTTPMethodEnum, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryLinechart", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "subMetric": pointerToString(subMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "api": pointerToString(api), + "method": pointerToString(method), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryqueryTopNResolver(obj *model.GlobalInventory, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, direction *model.TrafficDirectionEnum, limit *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryTopN", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "direction": pointerToString(direction), + "limit": pointerToString(limit), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryqueryDetailResolver(obj *model.GlobalInventory, metric *model.AnalyticsMetricEnum, subMetric *model.AnalyticsSubMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, direction *model.TrafficDirectionEnum, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryDetail", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "subMetric": pointerToString(subMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "direction": pointerToString(direction), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryqueryRiskTrackerResolver(obj *model.GlobalInventory, startTime *string, endTime *string, metric *model.AnalyticsMetricEnum, direction *model.TrafficDirectionEnum,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryRiskTracker", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "metric": pointerToString(metric), + "direction": pointerToString(direction), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalInventoryqueryRiskTrackerDetailResolver(obj *model.GlobalInventory, startTime *string, endTime *string, metric *model.AnalyticsMetricEnum, subCategory *string, direction *model.TrafficDirectionEnum, from *int, size *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryRiskTrackerDetail", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "metric": pointerToString(metric), + "subCategory": pointerToString(subCategory), + "direction": pointerToString(direction), + "from": pointerToString(from), + "size": pointerToString(size), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalNodequeryNodeTSResolver(obj *model.GlobalNode, nodeMetric *model.NodeMetricTypeEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryNodeTS", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "nodeMetric": pointerToString(nodeMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:15002", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalNodequeryNodeTableResolver(obj *model.GlobalNode, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryNodeTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:15002", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalProjectQueryqueryClusterTableResolver(obj *model.GlobalProjectQuery, startTime *string, endTime *string, timeInterval *string, noMetrics *bool,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryClusterTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + "noMetrics": pointerToString(noMetrics), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalProjectQueryqueryNodeTSResolver(obj *model.GlobalProjectQuery, nodeMetric *model.NodeMetricTypeEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryNodeTS", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "nodeMetric": pointerToString(nodeMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalProjectQueryqueryNodeTableResolver(obj *model.GlobalProjectQuery, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryNodeTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalProjectQueryqueryServiceTSResolver(obj *model.GlobalProjectQuery, svcMetric *model.ServiceMetricTypeEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTS", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "svcMetric": pointerToString(svcMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalProjectQueryqueryClusterInventoryCountResolver(obj *model.GlobalProjectQuery, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryClusterInventoryCount", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalProjectQueryqueryServiceTableResolver(obj *model.GlobalProjectQuery, startTime *string, endTime *string, SystemServices *bool, ShowGateways *bool, Groupby *model.ServiceGroupByEnum, noMetrics *bool, limit *int, last *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "SystemServices": pointerToString(SystemServices), + "ShowGateways": pointerToString(ShowGateways), + "Groupby": pointerToString(Groupby), + "noMetrics": pointerToString(noMetrics), + "limit": pointerToString(limit), + "last": pointerToString(last), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalProjectQueryqueryServiceVersionTableResolver(obj *model.GlobalProjectQuery, startTime *string, endTime *string, SystemServices *bool, ShowGateways *bool, noMetrics *bool,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceVersionTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "SystemServices": pointerToString(SystemServices), + "ShowGateways": pointerToString(ShowGateways), + "noMetrics": pointerToString(noMetrics), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalProjectQueryqueryStatsResolver(obj *model.GlobalProjectQuery, metricStringArray *string, api *string, method *model.HTTPMethodEnum, sourceWorkloadDN *string, severity *model.EventSeverityEnum, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryStats", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metricStringArray": pointerToString(metricStringArray), + "api": pointerToString(api), + "method": pointerToString(method), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalProjectQueryqueryLogsResolver(obj *model.GlobalProjectQuery, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, sourceWorkloadDN *string, severity *model.EventSeverityEnum, api *string, method *model.HTTPMethodEnum, from *int, size *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryLogs", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "api": pointerToString(api), + "method": pointerToString(method), + "from": pointerToString(from), + "size": pointerToString(size), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalProjectQueryqueryListResolver(obj *model.GlobalProjectQuery, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, limit *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryList", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "limit": pointerToString(limit), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalProjectQueryqueryLinechartResolver(obj *model.GlobalProjectQuery, metric *model.AnalyticsMetricEnum, subMetric *model.AnalyticsSubMetricEnum, startTime *string, endTime *string, sourceWorkloadDN *string, severity *model.EventSeverityEnum, api *string, method *model.HTTPMethodEnum, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryLinechart", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "subMetric": pointerToString(subMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "api": pointerToString(api), + "method": pointerToString(method), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalProjectQueryqueryTopNResolver(obj *model.GlobalProjectQuery, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, direction *model.TrafficDirectionEnum, limit *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryTopN", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "direction": pointerToString(direction), + "limit": pointerToString(limit), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalProjectQueryqueryDetailResolver(obj *model.GlobalProjectQuery, metric *model.AnalyticsMetricEnum, subMetric *model.AnalyticsSubMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, direction *model.TrafficDirectionEnum, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryDetail", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "subMetric": pointerToString(subMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "direction": pointerToString(direction), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalProjectQueryqueryRiskTrackerResolver(obj *model.GlobalProjectQuery, startTime *string, endTime *string, metric *model.AnalyticsMetricEnum, direction *model.TrafficDirectionEnum,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryRiskTracker", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "metric": pointerToString(metric), + "direction": pointerToString(direction), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalProjectQueryqueryRiskTrackerDetailResolver(obj *model.GlobalProjectQuery, startTime *string, endTime *string, metric *model.AnalyticsMetricEnum, subCategory *string, direction *model.TrafficDirectionEnum, from *int, size *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryRiskTrackerDetail", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "metric": pointerToString(metric), + "subCategory": pointerToString(subCategory), + "direction": pointerToString(direction), + "from": pointerToString(from), + "size": pointerToString(size), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +////////////////////////////////////// +// Singleton Resolver for Parent Node +// PKG: Global, NODE: Global +////////////////////////////////////// +func getRootResolver() (*model.GlobalRoot, error) { + if nc == nil { + k8sApiConfig := getK8sAPIEndpointConfig() + nexusClient, err := nexus_client.NewForConfig(k8sApiConfig) + if err != nil { + return nil, fmt.Errorf("failed to get k8s client config: %s", err) + } + nc = nexusClient + nc.SubscribeAll() + log.Debugf("Subscribed to all nodes in datamodel") + } + + vRoot, err := nc.GetGlobalRoot(context.TODO()) + if err != nil { + log.Errorf("[getRootResolver]Error getting Root node %s", err) + return nil, nil + } + dn := vRoot.DisplayName() +parentLabels := map[string]interface{}{"roots.global.tsm.tanzu.vmware.com":dn} +vName := string(vRoot.Spec.Name) + + ret := &model.GlobalRoot { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + log.Debugf("[getRootResolver]Output Root object %+v", ret) + return ret, nil +} +// Custom query +func getGlobalServiceDaemonSetqueryWorkloadVersionAPIResolver(obj *model.GlobalServiceDaemonSet, version *string, showLabels *bool, openapiFormatting *bool,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryWorkloadVersionAPI", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "version": pointerToString(version), + "showLabels": pointerToString(showLabels), + "openapiFormatting": pointerToString(openapiFormatting), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServiceDeploymentqueryServiceTSResolver(obj *model.GlobalServiceDeployment, svcMetric *model.ServiceMetricTypeEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTS", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "svcMetric": pointerToString(svcMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServiceDeploymentqueryServiceInstanceTableResolver(obj *model.GlobalServiceDeployment, startTime *string, endTime *string, limit *int, last *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceInstanceTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "limit": pointerToString(limit), + "last": pointerToString(last), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServiceDeploymentqueryWorkloadVersionAPIResolver(obj *model.GlobalServiceDeployment, version *string, showLabels *bool, openapiFormatting *bool,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryWorkloadVersionAPI", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "version": pointerToString(version), + "showLabels": pointerToString(showLabels), + "openapiFormatting": pointerToString(openapiFormatting), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServiceInstancequeryServiceTSResolver(obj *model.GlobalServiceInstance, svcMetric *model.ServiceMetricTypeEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTS", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "svcMetric": pointerToString(svcMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServiceInstancequeryServiceInstanceTableResolver(obj *model.GlobalServiceInstance, startTime *string, endTime *string, limit *int, last *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceInstanceTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "limit": pointerToString(limit), + "last": pointerToString(last), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServiceStatefulSetqueryWorkloadVersionAPIResolver(obj *model.GlobalServiceStatefulSet, version *string, showLabels *bool, openapiFormatting *bool,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryWorkloadVersionAPI", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "version": pointerToString(version), + "showLabels": pointerToString(showLabels), + "openapiFormatting": pointerToString(openapiFormatting), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServiceVersionqueryStatsResolver(obj *model.GlobalServiceVersion, metricStringArray *string, api *string, method *model.HTTPMethodEnum, sourceWorkloadDN *string, severity *model.EventSeverityEnum, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryStats", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metricStringArray": pointerToString(metricStringArray), + "api": pointerToString(api), + "method": pointerToString(method), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServiceVersionqueryLogsResolver(obj *model.GlobalServiceVersion, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, sourceWorkloadDN *string, severity *model.EventSeverityEnum, api *string, method *model.HTTPMethodEnum, from *int, size *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryLogs", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "api": pointerToString(api), + "method": pointerToString(method), + "from": pointerToString(from), + "size": pointerToString(size), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServiceVersionqueryListResolver(obj *model.GlobalServiceVersion, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, limit *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryList", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "limit": pointerToString(limit), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServiceVersionqueryLinechartResolver(obj *model.GlobalServiceVersion, metric *model.AnalyticsMetricEnum, subMetric *model.AnalyticsSubMetricEnum, startTime *string, endTime *string, sourceWorkloadDN *string, severity *model.EventSeverityEnum, api *string, method *model.HTTPMethodEnum, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryLinechart", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "subMetric": pointerToString(subMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "api": pointerToString(api), + "method": pointerToString(method), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServiceVersionqueryTopNResolver(obj *model.GlobalServiceVersion, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, limit *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryTopN", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "limit": pointerToString(limit), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServiceVersionqueryDetailResolver(obj *model.GlobalServiceVersion, metric *model.AnalyticsMetricEnum, subMetric *model.AnalyticsSubMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryDetail", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "subMetric": pointerToString(subMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServiceVersionqueryIncomingAPIsResolver(obj *model.GlobalServiceVersion, startTime *string, endTime *string, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryIncomingAPIs", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServiceVersionqueryOutgoingAPIsResolver(obj *model.GlobalServiceVersion, startTime *string, endTime *string, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryOutgoingAPIs", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServiceVersionqueryIncomingTCPResolver(obj *model.GlobalServiceVersion, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryIncomingTCP", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServiceVersionqueryOutgoingTCPResolver(obj *model.GlobalServiceVersion, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryOutgoingTCP", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequeryServiceAPIsResolver(obj *model.GlobalService, startTime *string, endTime *string, version *string, showLabels *bool, openapiFormatting *bool,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceAPIs", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "version": pointerToString(version), + "showLabels": pointerToString(showLabels), + "openapiFormatting": pointerToString(openapiFormatting), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequeryServiceTSResolver(obj *model.GlobalService, svcMetric *model.ServiceMetricTypeEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTS", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "svcMetric": pointerToString(svcMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequerySloDetailsResolver(obj *model.GlobalService, svcMetric *model.SloDetailsEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/querySloDetails", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "svcMetric": pointerToString(svcMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequerySloCountsResolver(obj *model.GlobalService, svcMetric *model.SloDetailsEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/querySloCounts", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "svcMetric": pointerToString(svcMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequerySloTableResolver(obj *model.GlobalService, svcMetric *model.SloDetailsEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/querySloTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "svcMetric": pointerToString(svcMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequeryServiceInstanceTableResolver(obj *model.GlobalService, startTime *string, endTime *string, limit *int, last *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceInstanceTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "limit": pointerToString(limit), + "last": pointerToString(last), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequeryServiceTopologyResolver(obj *model.GlobalService, metricStringArray *string, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTopology", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metricStringArray": pointerToString(metricStringArray), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequeryServiceNodeMapGroupedByServiceResolver(obj *model.GlobalService, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceNodeMapGroupedByService", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequeryServiceTableResolver(obj *model.GlobalService, startTime *string, endTime *string, SystemServices *bool, ShowGateways *bool, Groupby *model.ServiceGroupByEnum, noMetrics *bool, limit *int, last *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "SystemServices": pointerToString(SystemServices), + "ShowGateways": pointerToString(ShowGateways), + "Groupby": pointerToString(Groupby), + "noMetrics": pointerToString(noMetrics), + "limit": pointerToString(limit), + "last": pointerToString(last), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequeryServiceVersionTableResolver(obj *model.GlobalService, startTime *string, endTime *string, ShowGateways *bool, noMetrics *bool,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceVersionTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "ShowGateways": pointerToString(ShowGateways), + "noMetrics": pointerToString(noMetrics), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequeryStatsResolver(obj *model.GlobalService, metricStringArray *string, api *string, method *model.HTTPMethodEnum, sourceWorkloadDN *string, severity *model.EventSeverityEnum, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryStats", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metricStringArray": pointerToString(metricStringArray), + "api": pointerToString(api), + "method": pointerToString(method), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequeryLogsResolver(obj *model.GlobalService, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, sourceWorkloadDN *string, severity *model.EventSeverityEnum, api *string, method *model.HTTPMethodEnum, from *int, size *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryLogs", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "api": pointerToString(api), + "method": pointerToString(method), + "from": pointerToString(from), + "size": pointerToString(size), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequeryListResolver(obj *model.GlobalService, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, limit *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryList", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "limit": pointerToString(limit), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequeryLinechartResolver(obj *model.GlobalService, metric *model.AnalyticsMetricEnum, subMetric *model.AnalyticsSubMetricEnum, startTime *string, endTime *string, sourceWorkloadDN *string, severity *model.EventSeverityEnum, api *string, method *model.HTTPMethodEnum, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryLinechart", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "subMetric": pointerToString(subMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "sourceWorkloadDN": pointerToString(sourceWorkloadDN), + "severity": pointerToString(severity), + "api": pointerToString(api), + "method": pointerToString(method), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequeryTopNResolver(obj *model.GlobalService, metric *model.AnalyticsMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, limit *int,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryTopN", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "limit": pointerToString(limit), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequeryDetailResolver(obj *model.GlobalService, metric *model.AnalyticsMetricEnum, subMetric *model.AnalyticsSubMetricEnum, startTime *string, endTime *string, api *string, method *model.HTTPMethodEnum, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryDetail", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "metric": pointerToString(metric), + "subMetric": pointerToString(subMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "api": pointerToString(api), + "method": pointerToString(method), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequeryIncomingAPIsResolver(obj *model.GlobalService, startTime *string, endTime *string, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryIncomingAPIs", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequeryOutgoingAPIsResolver(obj *model.GlobalService, startTime *string, endTime *string, timeInterval *string, timeZone *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryOutgoingAPIs", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + "timeZone": pointerToString(timeZone), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequeryIncomingTCPResolver(obj *model.GlobalService, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryIncomingTCP", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalServicequeryOutgoingTCPResolver(obj *model.GlobalService, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryOutgoingTCP", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalSvcGroupqueryServiceTSResolver(obj *model.GlobalSvcGroup, svcMetric *model.ServiceMetricTypeEnum, startTime *string, endTime *string, timeInterval *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTS", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "svcMetric": pointerToString(svcMetric), + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalSvcGroupqueryServiceInstanceTableResolver(obj *model.GlobalSvcGroup, startTime *string, endTime *string, limit *int, last *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceInstanceTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "limit": pointerToString(limit), + "last": pointerToString(last), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalSvcGroupqueryServiceTableResolver(obj *model.GlobalSvcGroup, startTime *string, endTime *string, SystemServices *bool, ExternalServices *bool, ShowGateways *bool, Groupby *model.ServiceGroupByEnum, noMetrics *bool, limit *int, last *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "SystemServices": pointerToString(SystemServices), + "ExternalServices": pointerToString(ExternalServices), + "ShowGateways": pointerToString(ShowGateways), + "Groupby": pointerToString(Groupby), + "noMetrics": pointerToString(noMetrics), + "limit": pointerToString(limit), + "last": pointerToString(last), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalSvcGroupqueryServiceVersionTableResolver(obj *model.GlobalSvcGroup, startTime *string, endTime *string, SystemServices *bool, ExternalServices *bool, ShowGateways *bool, noMetrics *bool,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceVersionTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "SystemServices": pointerToString(SystemServices), + "ExternalServices": pointerToString(ExternalServices), + "ShowGateways": pointerToString(ShowGateways), + "noMetrics": pointerToString(noMetrics), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalSvcGroupqueryServiceNodeMapGroupedByNodeResolver(obj *model.GlobalSvcGroup, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceNodeMapGroupedByNode", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalSvcGroupqueryServiceNodeMapGroupedByServiceResolver(obj *model.GlobalSvcGroup, startTime *string, endTime *string,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryServiceNodeMapGroupedByService", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +// Custom query +func getGlobalSvcGroupqueryClusterTableResolver(obj *model.GlobalSvcGroup, startTime *string, endTime *string, timeInterval *string, noMetrics *bool,) (*model.TimeSeriesData, error) { + parentLabels := make(map[string]string) + if obj != nil { + for k, v := range obj.ParentLabels { + val, ok := v.(string) + if ok { + parentLabels[k] = val + } + } + } + metricArgs := &qm.MetricArg{ + QueryType: "/queryClusterTable", + Hierarchy: parentLabels, + UserProvidedArgs: map[string]string{ + "startTime": pointerToString(startTime), + "endTime": pointerToString(endTime), + "timeInterval": pointerToString(timeInterval), + "noMetrics": pointerToString(noMetrics), + }, + } + resp, err := c.Request("query-manager:45781", nexus.GetMetricsApi, metricArgs) + if err != nil { + return nil, err + } + return resp.(*model.TimeSeriesData), nil +} +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: DestSvcGroups Node: ACPConfig PKG: Global +////////////////////////////////////// +func getGlobalACPConfigDestSvcGroupsResolver(obj *model.GlobalACPConfig, id *string) ([]*model.GlobalSvcGroup, error) { + log.Debugf("[getGlobalACPConfigDestSvcGroupsResolver]Parent Object %+v", obj) + var vGlobalSvcGroupList []*model.GlobalSvcGroup + if id != nil && *id != "" { + log.Debugf("[getGlobalACPConfigDestSvcGroupsResolver]Id %q", *id) + vSvcGroupParent, err := nc.GlobalRoot().Config().Policy(getParentName(obj.ParentLabels, "accesscontrolpolicies.global.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), getParentName(obj.ParentLabels, "acpconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalACPConfigDestSvcGroupsResolver]Error getting DestSvcGroups %q : %s", *id, err) + return vGlobalSvcGroupList, nil + } + vSvcGroup, err := vSvcGroupParent.GetDestSvcGroups(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalACPConfigDestSvcGroupsResolver]Error getting DestSvcGroups %q : %s", *id, err) + return vGlobalSvcGroupList, nil + } + dn := vSvcGroup.DisplayName() +parentLabels := map[string]interface{}{"svcgroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vSvcGroup.Spec.DisplayName) +vInternalPredefinedGroup := bool(vSvcGroup.Spec.InternalPredefinedGroup) +vDescription := string(vSvcGroup.Spec.Description) +vColor := string(vSvcGroup.Spec.Color) +vProjectId := string(vSvcGroup.Spec.ProjectId) +vRules := string(vSvcGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSvcGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + InternalPredefinedGroup: &vInternalPredefinedGroup, + Description: &vDescription, + Color: &vColor, + ProjectId: &vProjectId, + Rules: &vRules, + } + vGlobalSvcGroupList = append(vGlobalSvcGroupList, ret) + + log.Debugf("[getGlobalACPConfigDestSvcGroupsResolver]Output DestSvcGroups objects %v", vGlobalSvcGroupList) + + return vGlobalSvcGroupList, nil + } + + log.Debug("[getGlobalACPConfigDestSvcGroupsResolver]Id is empty, process all DestSvcGroupss") + + vSvcGroupParent, err := nc.GlobalRoot().Config().Policy(getParentName(obj.ParentLabels, "accesscontrolpolicies.global.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), getParentName(obj.ParentLabels, "acpconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalACPConfigDestSvcGroupsResolver]Error getting parent node %s", err) + return vGlobalSvcGroupList, nil + } + vSvcGroupAllObj, err := vSvcGroupParent.GetAllDestSvcGroups(context.TODO()) + if err != nil { + log.Errorf("[getGlobalACPConfigDestSvcGroupsResolver]Error getting DestSvcGroups %s", err) + return vGlobalSvcGroupList, nil + } + for _, i := range vSvcGroupAllObj { + vSvcGroupParent, err := nc.GlobalRoot().Config().Policy(getParentName(obj.ParentLabels, "accesscontrolpolicies.global.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), getParentName(obj.ParentLabels, "acpconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalACPConfigDestSvcGroupsResolver]Error getting parent node %s, skipping...", err) + continue + } + vSvcGroup, err := vSvcGroupParent.GetDestSvcGroups(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalACPConfigDestSvcGroupsResolver]Error getting DestSvcGroups node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vSvcGroup.DisplayName() +parentLabels := map[string]interface{}{"svcgroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vSvcGroup.Spec.DisplayName) +vInternalPredefinedGroup := bool(vSvcGroup.Spec.InternalPredefinedGroup) +vDescription := string(vSvcGroup.Spec.Description) +vColor := string(vSvcGroup.Spec.Color) +vProjectId := string(vSvcGroup.Spec.ProjectId) +vRules := string(vSvcGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSvcGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + InternalPredefinedGroup: &vInternalPredefinedGroup, + Description: &vDescription, + Color: &vColor, + ProjectId: &vProjectId, + Rules: &vRules, + } + vGlobalSvcGroupList = append(vGlobalSvcGroupList, ret) + } + log.Debugf("[getGlobalACPConfigDestSvcGroupsResolver]List of DestSvcGroups object %v", vGlobalSvcGroupList) + return vGlobalSvcGroupList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: SourceSvcGroups Node: ACPConfig PKG: Global +////////////////////////////////////// +func getGlobalACPConfigSourceSvcGroupsResolver(obj *model.GlobalACPConfig, id *string) ([]*model.GlobalSvcGroup, error) { + log.Debugf("[getGlobalACPConfigSourceSvcGroupsResolver]Parent Object %+v", obj) + var vGlobalSvcGroupList []*model.GlobalSvcGroup + if id != nil && *id != "" { + log.Debugf("[getGlobalACPConfigSourceSvcGroupsResolver]Id %q", *id) + vSvcGroupParent, err := nc.GlobalRoot().Config().Policy(getParentName(obj.ParentLabels, "accesscontrolpolicies.global.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), getParentName(obj.ParentLabels, "acpconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalACPConfigSourceSvcGroupsResolver]Error getting SourceSvcGroups %q : %s", *id, err) + return vGlobalSvcGroupList, nil + } + vSvcGroup, err := vSvcGroupParent.GetSourceSvcGroups(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalACPConfigSourceSvcGroupsResolver]Error getting SourceSvcGroups %q : %s", *id, err) + return vGlobalSvcGroupList, nil + } + dn := vSvcGroup.DisplayName() +parentLabels := map[string]interface{}{"svcgroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vSvcGroup.Spec.DisplayName) +vInternalPredefinedGroup := bool(vSvcGroup.Spec.InternalPredefinedGroup) +vDescription := string(vSvcGroup.Spec.Description) +vColor := string(vSvcGroup.Spec.Color) +vProjectId := string(vSvcGroup.Spec.ProjectId) +vRules := string(vSvcGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSvcGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + InternalPredefinedGroup: &vInternalPredefinedGroup, + Description: &vDescription, + Color: &vColor, + ProjectId: &vProjectId, + Rules: &vRules, + } + vGlobalSvcGroupList = append(vGlobalSvcGroupList, ret) + + log.Debugf("[getGlobalACPConfigSourceSvcGroupsResolver]Output SourceSvcGroups objects %v", vGlobalSvcGroupList) + + return vGlobalSvcGroupList, nil + } + + log.Debug("[getGlobalACPConfigSourceSvcGroupsResolver]Id is empty, process all SourceSvcGroupss") + + vSvcGroupParent, err := nc.GlobalRoot().Config().Policy(getParentName(obj.ParentLabels, "accesscontrolpolicies.global.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), getParentName(obj.ParentLabels, "acpconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalACPConfigSourceSvcGroupsResolver]Error getting parent node %s", err) + return vGlobalSvcGroupList, nil + } + vSvcGroupAllObj, err := vSvcGroupParent.GetAllSourceSvcGroups(context.TODO()) + if err != nil { + log.Errorf("[getGlobalACPConfigSourceSvcGroupsResolver]Error getting SourceSvcGroups %s", err) + return vGlobalSvcGroupList, nil + } + for _, i := range vSvcGroupAllObj { + vSvcGroupParent, err := nc.GlobalRoot().Config().Policy(getParentName(obj.ParentLabels, "accesscontrolpolicies.global.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), getParentName(obj.ParentLabels, "acpconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalACPConfigSourceSvcGroupsResolver]Error getting parent node %s, skipping...", err) + continue + } + vSvcGroup, err := vSvcGroupParent.GetSourceSvcGroups(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalACPConfigSourceSvcGroupsResolver]Error getting SourceSvcGroups node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vSvcGroup.DisplayName() +parentLabels := map[string]interface{}{"svcgroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vSvcGroup.Spec.DisplayName) +vInternalPredefinedGroup := bool(vSvcGroup.Spec.InternalPredefinedGroup) +vDescription := string(vSvcGroup.Spec.Description) +vColor := string(vSvcGroup.Spec.Color) +vProjectId := string(vSvcGroup.Spec.ProjectId) +vRules := string(vSvcGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSvcGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + InternalPredefinedGroup: &vInternalPredefinedGroup, + Description: &vDescription, + Color: &vColor, + ProjectId: &vProjectId, + Rules: &vRules, + } + vGlobalSvcGroupList = append(vGlobalSvcGroupList, ret) + } + log.Debugf("[getGlobalACPConfigSourceSvcGroupsResolver]List of SourceSvcGroups object %v", vGlobalSvcGroupList) + return vGlobalSvcGroupList, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: GlobalRegistrationService Node: AllSparkServices PKG: Global +////////////////////////////////////// +func getGlobalAllSparkServicesGlobalRegistrationServiceResolver(obj *model.GlobalAllSparkServices, id *string) (*model.GlobalGlobalRegistrationService, error) { + log.Debugf("[getGlobalAllSparkServicesGlobalRegistrationServiceResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalAllSparkServicesGlobalRegistrationServiceResolver]Id %q", *id) + vGlobalRegistrationService, err := nc.GlobalRoot().Runtime().AllsparkServices().GetGlobalRegistrationService(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalAllSparkServicesGlobalRegistrationServiceResolver]Error getting GlobalRegistrationService node %q : %s", *id, err) + return &model.GlobalGlobalRegistrationService{}, nil + } + dn := vGlobalRegistrationService.DisplayName() +parentLabels := map[string]interface{}{"globalregistrationservices.global.tsm.tanzu.vmware.com":dn} +vBuildID := string(vGlobalRegistrationService.Spec.BuildID) +vVersion := string(vGlobalRegistrationService.Spec.Version) +vErrorCount := int(vGlobalRegistrationService.Spec.ErrorCount) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGlobalRegistrationService { + Id: &dn, + ParentLabels: parentLabels, + BuildID: &vBuildID, + Version: &vVersion, + ErrorCount: &vErrorCount, + } + + log.Debugf("[getGlobalAllSparkServicesGlobalRegistrationServiceResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalAllSparkServicesGlobalRegistrationServiceResolver]Id is empty, process all GlobalRegistrationServices") + vGlobalRegistrationServiceParent, err := nc.GlobalRoot().Runtime().GetAllsparkServices(context.TODO()) + if err != nil { + log.Errorf("[getGlobalAllSparkServicesGlobalRegistrationServiceResolver]Failed to get parent node %s", err) + return &model.GlobalGlobalRegistrationService{}, nil + } + vGlobalRegistrationService, err := vGlobalRegistrationServiceParent.GetGlobalRegistrationService(context.TODO()) + if err != nil { + log.Errorf("[getGlobalAllSparkServicesGlobalRegistrationServiceResolver]Error getting GlobalRegistrationService node %s", err) + return &model.GlobalGlobalRegistrationService{}, nil + } + dn := vGlobalRegistrationService.DisplayName() +parentLabels := map[string]interface{}{"globalregistrationservices.global.tsm.tanzu.vmware.com":dn} +vBuildID := string(vGlobalRegistrationService.Spec.BuildID) +vVersion := string(vGlobalRegistrationService.Spec.Version) +vErrorCount := int(vGlobalRegistrationService.Spec.ErrorCount) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGlobalRegistrationService { + Id: &dn, + ParentLabels: parentLabels, + BuildID: &vBuildID, + Version: &vVersion, + ErrorCount: &vErrorCount, + } + + log.Debugf("[getGlobalAllSparkServicesGlobalRegistrationServiceResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: LocalRegistrationService Node: AllSparkServices PKG: Global +////////////////////////////////////// +func getGlobalAllSparkServicesLocalRegistrationServiceResolver(obj *model.GlobalAllSparkServices, id *string) (*model.GlobalLocalRegistrationService, error) { + log.Debugf("[getGlobalAllSparkServicesLocalRegistrationServiceResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalAllSparkServicesLocalRegistrationServiceResolver]Id %q", *id) + vLocalRegistrationService, err := nc.GlobalRoot().Runtime().AllsparkServices().GetLocalRegistrationService(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalAllSparkServicesLocalRegistrationServiceResolver]Error getting LocalRegistrationService node %q : %s", *id, err) + return &model.GlobalLocalRegistrationService{}, nil + } + dn := vLocalRegistrationService.DisplayName() +parentLabels := map[string]interface{}{"localregistrationservices.global.tsm.tanzu.vmware.com":dn} +vBuildID := string(vLocalRegistrationService.Spec.BuildID) +vVersion := string(vLocalRegistrationService.Spec.Version) +vErrorCount := int(vLocalRegistrationService.Spec.ErrorCount) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalLocalRegistrationService { + Id: &dn, + ParentLabels: parentLabels, + BuildID: &vBuildID, + Version: &vVersion, + ErrorCount: &vErrorCount, + } + + log.Debugf("[getGlobalAllSparkServicesLocalRegistrationServiceResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalAllSparkServicesLocalRegistrationServiceResolver]Id is empty, process all LocalRegistrationServices") + vLocalRegistrationServiceParent, err := nc.GlobalRoot().Runtime().GetAllsparkServices(context.TODO()) + if err != nil { + log.Errorf("[getGlobalAllSparkServicesLocalRegistrationServiceResolver]Failed to get parent node %s", err) + return &model.GlobalLocalRegistrationService{}, nil + } + vLocalRegistrationService, err := vLocalRegistrationServiceParent.GetLocalRegistrationService(context.TODO()) + if err != nil { + log.Errorf("[getGlobalAllSparkServicesLocalRegistrationServiceResolver]Error getting LocalRegistrationService node %s", err) + return &model.GlobalLocalRegistrationService{}, nil + } + dn := vLocalRegistrationService.DisplayName() +parentLabels := map[string]interface{}{"localregistrationservices.global.tsm.tanzu.vmware.com":dn} +vBuildID := string(vLocalRegistrationService.Spec.BuildID) +vVersion := string(vLocalRegistrationService.Spec.Version) +vErrorCount := int(vLocalRegistrationService.Spec.ErrorCount) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalLocalRegistrationService { + Id: &dn, + ParentLabels: parentLabels, + BuildID: &vBuildID, + Version: &vVersion, + ErrorCount: &vErrorCount, + } + + log.Debugf("[getGlobalAllSparkServicesLocalRegistrationServiceResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Singleton) +// FieldName: AwsConnector Node: AllSparkServices PKG: Global +////////////////////////////////////// +func getGlobalAllSparkServicesAwsConnectorResolver(obj *model.GlobalAllSparkServices) (*model.GlobalAwsConnector, error) { + log.Debugf("[getGlobalAllSparkServicesAwsConnectorResolver]Parent Object %+v", obj) + vAwsConnector, err := nc.GlobalRoot().Runtime().AllsparkServices().GetAwsConnector(context.TODO()) + if err != nil { + log.Errorf("[getGlobalAllSparkServicesAwsConnectorResolver]Error getting AllSparkServices node %s", err) + return &model.GlobalAwsConnector{}, nil + } + dn := vAwsConnector.DisplayName() +parentLabels := map[string]interface{}{"awsconnectors.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAwsConnector { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalAllSparkServicesAwsConnectorResolver]Output object %+v", ret) + return ret, nil +} +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: App Node: AppFolder PKG: Global +////////////////////////////////////// +func getGlobalAppFolderAppResolver(obj *model.GlobalAppFolder, id *string) ([]*model.GlobalApp, error) { + log.Debugf("[getGlobalAppFolderAppResolver]Parent Object %+v", obj) + var vGlobalAppList []*model.GlobalApp + if id != nil && *id != "" { + log.Debugf("[getGlobalAppFolderAppResolver]Id %q", *id) + vApp, err := nc.GlobalRoot().Runtime().AppFolder(getParentName(obj.ParentLabels, "appfolders.global.tsm.tanzu.vmware.com")).GetApp(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalAppFolderAppResolver]Error getting App node %q : %s", *id, err) + return vGlobalAppList, nil + } + dn := vApp.DisplayName() +parentLabels := map[string]interface{}{"apps.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalApp { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalAppList = append(vGlobalAppList, ret) + + log.Debugf("[getGlobalAppFolderAppResolver]Output App objects %v", vGlobalAppList) + + return vGlobalAppList, nil + } + + log.Debug("[getGlobalAppFolderAppResolver]Id is empty, process all Apps") + + vAppParent, err := nc.GlobalRoot().Runtime().GetAppFolder(context.TODO(), getParentName(obj.ParentLabels, "appfolders.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalAppFolderAppResolver]Error getting parent node %s", err) + return vGlobalAppList, nil + } + vAppAllObj, err := vAppParent.GetAllApp(context.TODO()) + if err != nil { + log.Errorf("[getGlobalAppFolderAppResolver]Error getting App objects %s", err) + return vGlobalAppList, nil + } + for _, i := range vAppAllObj { + vApp, err := nc.GlobalRoot().Runtime().AppFolder(getParentName(obj.ParentLabels, "appfolders.global.tsm.tanzu.vmware.com")).GetApp(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalAppFolderAppResolver]Error getting App node %q : %s", i.DisplayName(), err) + continue + } + dn := vApp.DisplayName() +parentLabels := map[string]interface{}{"apps.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalApp { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalAppList = append(vGlobalAppList, ret) + } + + log.Debugf("[getGlobalAppFolderAppResolver]Output App objects %v", vGlobalAppList) + + return vGlobalAppList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Services Node: AppGroup PKG: Global +////////////////////////////////////// +func getGlobalAppGroupServicesResolver(obj *model.GlobalAppGroup, id *string) ([]*model.GlobalService, error) { + log.Debugf("[getGlobalAppGroupServicesResolver]Parent Object %+v", obj) + var vGlobalServiceList []*model.GlobalService + if id != nil && *id != "" { + log.Debugf("[getGlobalAppGroupServicesResolver]Id %q", *id) + vServiceParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetAppGroups(context.TODO(), getParentName(obj.ParentLabels, "appgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalAppGroupServicesResolver]Error getting Services %q : %s", *id, err) + return vGlobalServiceList, nil + } + vService, err := vServiceParent.GetServices(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalAppGroupServicesResolver]Error getting Services %q : %s", *id, err) + return vGlobalServiceList, nil + } + dn := vService.DisplayName() +parentLabels := map[string]interface{}{"services.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vService.Spec.Metadata) +vSpec := string(vService.Spec.Spec) +vName := string(vService.Spec.Name) +vNamespace := string(vService.Spec.Namespace) +vApiLink := string(vService.Spec.ApiLink) +vIpAddress := string(vService.Spec.IpAddress) +vAnnotations := string(vService.Spec.Annotations) +vCreationTimestamp := string(vService.Spec.CreationTimestamp) +vLabels := string(vService.Spec.Labels) +vUid := string(vService.Spec.Uid) +vPorts := string(vService.Spec.Ports) +vSelector := string(vService.Spec.Selector) +vType := string(vService.Spec.Type) +vStatus := string(vService.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalService { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Name: &vName, + Namespace: &vNamespace, + ApiLink: &vApiLink, + IpAddress: &vIpAddress, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Uid: &vUid, + Ports: &vPorts, + Selector: &vSelector, + Type: &vType, + Status: &vStatus, + } + vGlobalServiceList = append(vGlobalServiceList, ret) + + log.Debugf("[getGlobalAppGroupServicesResolver]Output Services objects %v", vGlobalServiceList) + + return vGlobalServiceList, nil + } + + log.Debug("[getGlobalAppGroupServicesResolver]Id is empty, process all Servicess") + + vServiceParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetAppGroups(context.TODO(), getParentName(obj.ParentLabels, "appgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalAppGroupServicesResolver]Error getting parent node %s", err) + return vGlobalServiceList, nil + } + vServiceAllObj, err := vServiceParent.GetAllServices(context.TODO()) + if err != nil { + log.Errorf("[getGlobalAppGroupServicesResolver]Error getting Services %s", err) + return vGlobalServiceList, nil + } + for _, i := range vServiceAllObj { + vServiceParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetAppGroups(context.TODO(), getParentName(obj.ParentLabels, "appgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalAppGroupServicesResolver]Error getting parent node %s, skipping...", err) + continue + } + vService, err := vServiceParent.GetServices(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalAppGroupServicesResolver]Error getting Services node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vService.DisplayName() +parentLabels := map[string]interface{}{"services.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vService.Spec.Metadata) +vSpec := string(vService.Spec.Spec) +vName := string(vService.Spec.Name) +vNamespace := string(vService.Spec.Namespace) +vApiLink := string(vService.Spec.ApiLink) +vIpAddress := string(vService.Spec.IpAddress) +vAnnotations := string(vService.Spec.Annotations) +vCreationTimestamp := string(vService.Spec.CreationTimestamp) +vLabels := string(vService.Spec.Labels) +vUid := string(vService.Spec.Uid) +vPorts := string(vService.Spec.Ports) +vSelector := string(vService.Spec.Selector) +vType := string(vService.Spec.Type) +vStatus := string(vService.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalService { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Name: &vName, + Namespace: &vNamespace, + ApiLink: &vApiLink, + IpAddress: &vIpAddress, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Uid: &vUid, + Ports: &vPorts, + Selector: &vSelector, + Type: &vType, + Status: &vStatus, + } + vGlobalServiceList = append(vGlobalServiceList, ret) + } + log.Debugf("[getGlobalAppGroupServicesResolver]List of Services object %v", vGlobalServiceList) + return vGlobalServiceList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceDefinitions Node: AppTemplate PKG: Global +////////////////////////////////////// +func getGlobalAppTemplateServiceDefinitionsResolver(obj *model.GlobalAppTemplate, id *string) ([]*model.GlobalAppTemplateServiceDefinition, error) { + log.Debugf("[getGlobalAppTemplateServiceDefinitionsResolver]Parent Object %+v", obj) + var vGlobalAppTemplateServiceDefinitionList []*model.GlobalAppTemplateServiceDefinition + if id != nil && *id != "" { + log.Debugf("[getGlobalAppTemplateServiceDefinitionsResolver]Id %q", *id) + vAppTemplateServiceDefinition, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).AppTemplates(getParentName(obj.ParentLabels, "apptemplates.global.tsm.tanzu.vmware.com")).GetServiceDefinitions(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalAppTemplateServiceDefinitionsResolver]Error getting ServiceDefinitions node %q : %s", *id, err) + return vGlobalAppTemplateServiceDefinitionList, nil + } + dn := vAppTemplateServiceDefinition.DisplayName() +parentLabels := map[string]interface{}{"apptemplateservicedefinitions.global.tsm.tanzu.vmware.com":dn} +vType := string(vAppTemplateServiceDefinition.Spec.Type) +vVersion := string(vAppTemplateServiceDefinition.Spec.Version) +vTemplate := string(vAppTemplateServiceDefinition.Spec.Template) +TemplateArgs, _ := json.Marshal(vAppTemplateServiceDefinition.Spec.TemplateArgs) +TemplateArgsData := string(TemplateArgs) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAppTemplateServiceDefinition { + Id: &dn, + ParentLabels: parentLabels, + Type: &vType, + Version: &vVersion, + Template: &vTemplate, + TemplateArgs: &TemplateArgsData, + } + vGlobalAppTemplateServiceDefinitionList = append(vGlobalAppTemplateServiceDefinitionList, ret) + + log.Debugf("[getGlobalAppTemplateServiceDefinitionsResolver]Output ServiceDefinitions objects %v", vGlobalAppTemplateServiceDefinitionList) + + return vGlobalAppTemplateServiceDefinitionList, nil + } + + log.Debug("[getGlobalAppTemplateServiceDefinitionsResolver]Id is empty, process all ServiceDefinitionss") + + vAppTemplateServiceDefinitionParent, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).GetAppTemplates(context.TODO(), getParentName(obj.ParentLabels, "apptemplates.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalAppTemplateServiceDefinitionsResolver]Error getting parent node %s", err) + return vGlobalAppTemplateServiceDefinitionList, nil + } + vAppTemplateServiceDefinitionAllObj, err := vAppTemplateServiceDefinitionParent.GetAllServiceDefinitions(context.TODO()) + if err != nil { + log.Errorf("[getGlobalAppTemplateServiceDefinitionsResolver]Error getting ServiceDefinitions objects %s", err) + return vGlobalAppTemplateServiceDefinitionList, nil + } + for _, i := range vAppTemplateServiceDefinitionAllObj { + vAppTemplateServiceDefinition, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).AppTemplates(getParentName(obj.ParentLabels, "apptemplates.global.tsm.tanzu.vmware.com")).GetServiceDefinitions(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalAppTemplateServiceDefinitionsResolver]Error getting ServiceDefinitions node %q : %s", i.DisplayName(), err) + continue + } + dn := vAppTemplateServiceDefinition.DisplayName() +parentLabels := map[string]interface{}{"apptemplateservicedefinitions.global.tsm.tanzu.vmware.com":dn} +vType := string(vAppTemplateServiceDefinition.Spec.Type) +vVersion := string(vAppTemplateServiceDefinition.Spec.Version) +vTemplate := string(vAppTemplateServiceDefinition.Spec.Template) +TemplateArgs, _ := json.Marshal(vAppTemplateServiceDefinition.Spec.TemplateArgs) +TemplateArgsData := string(TemplateArgs) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAppTemplateServiceDefinition { + Id: &dn, + ParentLabels: parentLabels, + Type: &vType, + Version: &vVersion, + Template: &vTemplate, + TemplateArgs: &TemplateArgsData, + } + vGlobalAppTemplateServiceDefinitionList = append(vGlobalAppTemplateServiceDefinitionList, ret) + } + + log.Debugf("[getGlobalAppTemplateServiceDefinitionsResolver]Output ServiceDefinitions objects %v", vGlobalAppTemplateServiceDefinitionList) + + return vGlobalAppTemplateServiceDefinitionList, nil +} + +////////////////////////////////////// +// LINK RESOLVER +// FieldName: Template Node: AppVersion PKG: Global +////////////////////////////////////// +func getGlobalAppVersionTemplateResolver(obj *model.GlobalAppVersion) (*model.GlobalTemplate, error) { + log.Debugf("[getGlobalAppVersionTemplateResolver]Parent Object %+v", obj) + vTemplateParent, err := nc.GlobalRoot().Runtime().AppFolder(getParentName(obj.ParentLabels, "appfolders.global.tsm.tanzu.vmware.com")).App(getParentName(obj.ParentLabels, "apps.global.tsm.tanzu.vmware.com")).GetVersion(context.TODO(), getParentName(obj.ParentLabels, "appversions.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalAppVersionTemplateResolver]Error getting parent node %s", err) + return &model.GlobalTemplate{}, nil + } + vTemplate, err := vTemplateParent.GetTemplate(context.TODO()) + if err != nil { + log.Errorf("[getGlobalAppVersionTemplateResolver]Error getting Template object %s", err) + return &model.GlobalTemplate{}, nil + } + dn := vTemplate.DisplayName() +parentLabels := map[string]interface{}{"templates.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalTemplate { + Id: &dn, + ParentLabels: parentLabels, + } + log.Debugf("[getGlobalAppVersionTemplateResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// LINK RESOLVER +// FieldName: Inventory Node: AppVersion PKG: Global +////////////////////////////////////// +func getGlobalAppVersionInventoryResolver(obj *model.GlobalAppVersion) (*model.GlobalInventory, error) { + log.Debugf("[getGlobalAppVersionInventoryResolver]Parent Object %+v", obj) + vInventoryParent, err := nc.GlobalRoot().Runtime().AppFolder(getParentName(obj.ParentLabels, "appfolders.global.tsm.tanzu.vmware.com")).App(getParentName(obj.ParentLabels, "apps.global.tsm.tanzu.vmware.com")).GetVersion(context.TODO(), getParentName(obj.ParentLabels, "appversions.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalAppVersionInventoryResolver]Error getting parent node %s", err) + return &model.GlobalInventory{}, nil + } + vInventory, err := vInventoryParent.GetInventory(context.TODO()) + if err != nil { + log.Errorf("[getGlobalAppVersionInventoryResolver]Error getting Inventory object %s", err) + return &model.GlobalInventory{}, nil + } + dn := vInventory.DisplayName() +parentLabels := map[string]interface{}{"inventories.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalInventory { + Id: &dn, + ParentLabels: parentLabels, + } + log.Debugf("[getGlobalAppVersionInventoryResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: Version Node: App PKG: Global +////////////////////////////////////// +func getGlobalAppVersionResolver(obj *model.GlobalApp, id *string) (*model.GlobalAppVersion, error) { + log.Debugf("[getGlobalAppVersionResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalAppVersionResolver]Id %q", *id) + vAppVersion, err := nc.GlobalRoot().Runtime().AppFolder(getParentName(obj.ParentLabels, "appfolders.global.tsm.tanzu.vmware.com")).App(getParentName(obj.ParentLabels, "apps.global.tsm.tanzu.vmware.com")).GetVersion(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalAppVersionResolver]Error getting Version node %q : %s", *id, err) + return &model.GlobalAppVersion{}, nil + } + dn := vAppVersion.DisplayName() +parentLabels := map[string]interface{}{"appversions.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAppVersion { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalAppVersionResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalAppVersionResolver]Id is empty, process all Versions") + vAppVersionParent, err := nc.GlobalRoot().Runtime().AppFolder(getParentName(obj.ParentLabels, "appfolders.global.tsm.tanzu.vmware.com")).GetApp(context.TODO(), getParentName(obj.ParentLabels, "apps.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalAppVersionResolver]Failed to get parent node %s", err) + return &model.GlobalAppVersion{}, nil + } + vAppVersion, err := vAppVersionParent.GetVersion(context.TODO()) + if err != nil { + log.Errorf("[getGlobalAppVersionResolver]Error getting Version node %s", err) + return &model.GlobalAppVersion{}, nil + } + dn := vAppVersion.DisplayName() +parentLabels := map[string]interface{}{"appversions.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAppVersion { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalAppVersionResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Autoscalers Node: AutoscalerFolder PKG: Global +////////////////////////////////////// +func getGlobalAutoscalerFolderAutoscalersResolver(obj *model.GlobalAutoscalerFolder, id *string) ([]*model.GlobalAutoscaler, error) { + log.Debugf("[getGlobalAutoscalerFolderAutoscalersResolver]Parent Object %+v", obj) + var vGlobalAutoscalerList []*model.GlobalAutoscaler + if id != nil && *id != "" { + log.Debugf("[getGlobalAutoscalerFolderAutoscalersResolver]Id %q", *id) + vAutoscaler, err := nc.GlobalRoot().Config().AutoscalerFolder(getParentName(obj.ParentLabels, "autoscalerfolders.global.tsm.tanzu.vmware.com")).GetAutoscalers(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalAutoscalerFolderAutoscalersResolver]Error getting Autoscalers node %q : %s", *id, err) + return vGlobalAutoscalerList, nil + } + dn := vAutoscaler.DisplayName() +parentLabels := map[string]interface{}{"autoscalers.global.tsm.tanzu.vmware.com":dn} +vName := string(vAutoscaler.Spec.Name) +vProjectId := string(vAutoscaler.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAutoscaler { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + ProjectId: &vProjectId, + } + vGlobalAutoscalerList = append(vGlobalAutoscalerList, ret) + + log.Debugf("[getGlobalAutoscalerFolderAutoscalersResolver]Output Autoscalers objects %v", vGlobalAutoscalerList) + + return vGlobalAutoscalerList, nil + } + + log.Debug("[getGlobalAutoscalerFolderAutoscalersResolver]Id is empty, process all Autoscalerss") + + vAutoscalerParent, err := nc.GlobalRoot().Config().GetAutoscalerFolder(context.TODO(), getParentName(obj.ParentLabels, "autoscalerfolders.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalAutoscalerFolderAutoscalersResolver]Error getting parent node %s", err) + return vGlobalAutoscalerList, nil + } + vAutoscalerAllObj, err := vAutoscalerParent.GetAllAutoscalers(context.TODO()) + if err != nil { + log.Errorf("[getGlobalAutoscalerFolderAutoscalersResolver]Error getting Autoscalers objects %s", err) + return vGlobalAutoscalerList, nil + } + for _, i := range vAutoscalerAllObj { + vAutoscaler, err := nc.GlobalRoot().Config().AutoscalerFolder(getParentName(obj.ParentLabels, "autoscalerfolders.global.tsm.tanzu.vmware.com")).GetAutoscalers(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalAutoscalerFolderAutoscalersResolver]Error getting Autoscalers node %q : %s", i.DisplayName(), err) + continue + } + dn := vAutoscaler.DisplayName() +parentLabels := map[string]interface{}{"autoscalers.global.tsm.tanzu.vmware.com":dn} +vName := string(vAutoscaler.Spec.Name) +vProjectId := string(vAutoscaler.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAutoscaler { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + ProjectId: &vProjectId, + } + vGlobalAutoscalerList = append(vGlobalAutoscalerList, ret) + } + + log.Debugf("[getGlobalAutoscalerFolderAutoscalersResolver]Output Autoscalers objects %v", vGlobalAutoscalerList) + + return vGlobalAutoscalerList, nil +} + +////////////////////////////////////// +// LINK RESOLVER +// FieldName: Autoscaler Node: Autoscaler PKG: Global +////////////////////////////////////// +func getGlobalAutoscalerAutoscalerResolver(obj *model.GlobalAutoscaler) (*model.GlobalAutoscalerCR, error) { + log.Debugf("[getGlobalAutoscalerAutoscalerResolver]Parent Object %+v", obj) + vAutoscalerCRParent, err := nc.GlobalRoot().Config().AutoscalerFolder(getParentName(obj.ParentLabels, "autoscalerfolders.global.tsm.tanzu.vmware.com")).GetAutoscalers(context.TODO(), getParentName(obj.ParentLabels, "autoscalers.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalAutoscalerAutoscalerResolver]Error getting parent node %s", err) + return &model.GlobalAutoscalerCR{}, nil + } + vAutoscalerCR, err := vAutoscalerCRParent.GetAutoscaler(context.TODO()) + if err != nil { + log.Errorf("[getGlobalAutoscalerAutoscalerResolver]Error getting Autoscaler object %s", err) + return &model.GlobalAutoscalerCR{}, nil + } + dn := vAutoscalerCR.DisplayName() +parentLabels := map[string]interface{}{"autoscalercrs.global.tsm.tanzu.vmware.com":dn} +vName := string(vAutoscalerCR.Spec.Name) +vAutoscalingDefinition := string(vAutoscalerCR.Spec.AutoscalingDefinition) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAutoscalerCR { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + AutoscalingDefinition: &vAutoscalingDefinition, + } + log.Debugf("[getGlobalAutoscalerAutoscalerResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Gns Node: AwsConnector PKG: Global +////////////////////////////////////// +func getGlobalAwsConnectorGnsResolver(obj *model.GlobalAwsConnector, id *string) ([]*model.GlobalGlobalNs, error) { + log.Debugf("[getGlobalAwsConnectorGnsResolver]Parent Object %+v", obj) + var vGlobalGlobalNsList []*model.GlobalGlobalNs + if id != nil && *id != "" { + log.Debugf("[getGlobalAwsConnectorGnsResolver]Id %q", *id) + vGlobalNs, err := nc.GlobalRoot().Runtime().AllsparkServices().AwsConnector().GetGns(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalAwsConnectorGnsResolver]Error getting Gns node %q : %s", *id, err) + return vGlobalGlobalNsList, nil + } + dn := vGlobalNs.DisplayName() +parentLabels := map[string]interface{}{"globalnses.global.tsm.tanzu.vmware.com":dn} +vGnsName := string(vGlobalNs.Spec.GnsName) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGlobalNs { + Id: &dn, + ParentLabels: parentLabels, + GnsName: &vGnsName, + } + vGlobalGlobalNsList = append(vGlobalGlobalNsList, ret) + + log.Debugf("[getGlobalAwsConnectorGnsResolver]Output Gns objects %v", vGlobalGlobalNsList) + + return vGlobalGlobalNsList, nil + } + + log.Debug("[getGlobalAwsConnectorGnsResolver]Id is empty, process all Gnss") + + vGlobalNsParent, err := nc.GlobalRoot().Runtime().AllsparkServices().GetAwsConnector(context.TODO()) + if err != nil { + log.Errorf("[getGlobalAwsConnectorGnsResolver]Error getting parent node %s", err) + return vGlobalGlobalNsList, nil + } + vGlobalNsAllObj, err := vGlobalNsParent.GetAllGns(context.TODO()) + if err != nil { + log.Errorf("[getGlobalAwsConnectorGnsResolver]Error getting Gns objects %s", err) + return vGlobalGlobalNsList, nil + } + for _, i := range vGlobalNsAllObj { + vGlobalNs, err := nc.GlobalRoot().Runtime().AllsparkServices().AwsConnector().GetGns(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalAwsConnectorGnsResolver]Error getting Gns node %q : %s", i.DisplayName(), err) + continue + } + dn := vGlobalNs.DisplayName() +parentLabels := map[string]interface{}{"globalnses.global.tsm.tanzu.vmware.com":dn} +vGnsName := string(vGlobalNs.Spec.GnsName) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGlobalNs { + Id: &dn, + ParentLabels: parentLabels, + GnsName: &vGnsName, + } + vGlobalGlobalNsList = append(vGlobalGlobalNsList, ret) + } + + log.Debugf("[getGlobalAwsConnectorGnsResolver]Output Gns objects %v", vGlobalGlobalNsList) + + return vGlobalGlobalNsList, nil +} + +////////////////////////////////////// +// LINK RESOLVER +// FieldName: Template Node: Bucket PKG: Global +////////////////////////////////////// +func getGlobalBucketTemplateResolver(obj *model.GlobalBucket) (*model.GlobalTemplate, error) { + log.Debugf("[getGlobalBucketTemplateResolver]Parent Object %+v", obj) + vTemplateParent, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).Database().GetBuckets(context.TODO(), getParentName(obj.ParentLabels, "buckets.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalBucketTemplateResolver]Error getting parent node %s", err) + return &model.GlobalTemplate{}, nil + } + vTemplate, err := vTemplateParent.GetTemplate(context.TODO()) + if err != nil { + log.Errorf("[getGlobalBucketTemplateResolver]Error getting Template object %s", err) + return &model.GlobalTemplate{}, nil + } + dn := vTemplate.DisplayName() +parentLabels := map[string]interface{}{"templates.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalTemplate { + Id: &dn, + ParentLabels: parentLabels, + } + log.Debugf("[getGlobalBucketTemplateResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// LINK RESOLVER +// FieldName: Inventory Node: Bucket PKG: Global +////////////////////////////////////// +func getGlobalBucketInventoryResolver(obj *model.GlobalBucket) (*model.GlobalInventory, error) { + log.Debugf("[getGlobalBucketInventoryResolver]Parent Object %+v", obj) + vInventoryParent, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).Database().GetBuckets(context.TODO(), getParentName(obj.ParentLabels, "buckets.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalBucketInventoryResolver]Error getting parent node %s", err) + return &model.GlobalInventory{}, nil + } + vInventory, err := vInventoryParent.GetInventory(context.TODO()) + if err != nil { + log.Errorf("[getGlobalBucketInventoryResolver]Error getting Inventory object %s", err) + return &model.GlobalInventory{}, nil + } + dn := vInventory.DisplayName() +parentLabels := map[string]interface{}{"inventories.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalInventory { + Id: &dn, + ParentLabels: parentLabels, + } + log.Debugf("[getGlobalBucketInventoryResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Clusters Node: ClusterConfigFolder PKG: Global +////////////////////////////////////// +func getGlobalClusterConfigFolderClustersResolver(obj *model.GlobalClusterConfigFolder, id *string) ([]*model.GlobalClusterSettings, error) { + log.Debugf("[getGlobalClusterConfigFolderClustersResolver]Parent Object %+v", obj) + var vGlobalClusterSettingsList []*model.GlobalClusterSettings + if id != nil && *id != "" { + log.Debugf("[getGlobalClusterConfigFolderClustersResolver]Id %q", *id) + vClusterSettings, err := nc.GlobalRoot().Config().Clusters(getParentName(obj.ParentLabels, "clusterconfigfolders.global.tsm.tanzu.vmware.com")).GetClusters(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalClusterConfigFolderClustersResolver]Error getting Clusters node %q : %s", *id, err) + return vGlobalClusterSettingsList, nil + } + dn := vClusterSettings.DisplayName() +parentLabels := map[string]interface{}{"clustersettingses.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vClusterSettings.Spec.ProjectId) +vDisplayName := string(vClusterSettings.Spec.DisplayName) +vDescription := string(vClusterSettings.Spec.Description) +vTags := string(vClusterSettings.Spec.Tags) +vLabels := string(vClusterSettings.Spec.Labels) +vAutoInstallServiceMesh := bool(vClusterSettings.Spec.AutoInstallServiceMesh) +vEnableNamespaceExclusions := bool(vClusterSettings.Spec.EnableNamespaceExclusions) +vNamespaceExclusions := string(vClusterSettings.Spec.NamespaceExclusions) +vSystemNamespaceExclusions := string(vClusterSettings.Spec.SystemNamespaceExclusions) +vAgentDomain := string(vClusterSettings.Spec.AgentDomain) +vProxyConfig := string(vClusterSettings.Spec.ProxyConfig) +vAutoInstallServiceMeshConfig := string(vClusterSettings.Spec.AutoInstallServiceMeshConfig) +vRegistryAccount := string(vClusterSettings.Spec.RegistryAccount) +vCaLabels := string(vClusterSettings.Spec.CaLabels) +vEnableInternalGateway := bool(vClusterSettings.Spec.EnableInternalGateway) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalClusterSettings { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + DisplayName: &vDisplayName, + Description: &vDescription, + Tags: &vTags, + Labels: &vLabels, + AutoInstallServiceMesh: &vAutoInstallServiceMesh, + EnableNamespaceExclusions: &vEnableNamespaceExclusions, + NamespaceExclusions: &vNamespaceExclusions, + SystemNamespaceExclusions: &vSystemNamespaceExclusions, + AgentDomain: &vAgentDomain, + ProxyConfig: &vProxyConfig, + AutoInstallServiceMeshConfig: &vAutoInstallServiceMeshConfig, + RegistryAccount: &vRegistryAccount, + CaLabels: &vCaLabels, + EnableInternalGateway: &vEnableInternalGateway, + } + vGlobalClusterSettingsList = append(vGlobalClusterSettingsList, ret) + + log.Debugf("[getGlobalClusterConfigFolderClustersResolver]Output Clusters objects %v", vGlobalClusterSettingsList) + + return vGlobalClusterSettingsList, nil + } + + log.Debug("[getGlobalClusterConfigFolderClustersResolver]Id is empty, process all Clusterss") + + vClusterSettingsParent, err := nc.GlobalRoot().Config().GetClusters(context.TODO(), getParentName(obj.ParentLabels, "clusterconfigfolders.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalClusterConfigFolderClustersResolver]Error getting parent node %s", err) + return vGlobalClusterSettingsList, nil + } + vClusterSettingsAllObj, err := vClusterSettingsParent.GetAllClusters(context.TODO()) + if err != nil { + log.Errorf("[getGlobalClusterConfigFolderClustersResolver]Error getting Clusters objects %s", err) + return vGlobalClusterSettingsList, nil + } + for _, i := range vClusterSettingsAllObj { + vClusterSettings, err := nc.GlobalRoot().Config().Clusters(getParentName(obj.ParentLabels, "clusterconfigfolders.global.tsm.tanzu.vmware.com")).GetClusters(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalClusterConfigFolderClustersResolver]Error getting Clusters node %q : %s", i.DisplayName(), err) + continue + } + dn := vClusterSettings.DisplayName() +parentLabels := map[string]interface{}{"clustersettingses.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vClusterSettings.Spec.ProjectId) +vDisplayName := string(vClusterSettings.Spec.DisplayName) +vDescription := string(vClusterSettings.Spec.Description) +vTags := string(vClusterSettings.Spec.Tags) +vLabels := string(vClusterSettings.Spec.Labels) +vAutoInstallServiceMesh := bool(vClusterSettings.Spec.AutoInstallServiceMesh) +vEnableNamespaceExclusions := bool(vClusterSettings.Spec.EnableNamespaceExclusions) +vNamespaceExclusions := string(vClusterSettings.Spec.NamespaceExclusions) +vSystemNamespaceExclusions := string(vClusterSettings.Spec.SystemNamespaceExclusions) +vAgentDomain := string(vClusterSettings.Spec.AgentDomain) +vProxyConfig := string(vClusterSettings.Spec.ProxyConfig) +vAutoInstallServiceMeshConfig := string(vClusterSettings.Spec.AutoInstallServiceMeshConfig) +vRegistryAccount := string(vClusterSettings.Spec.RegistryAccount) +vCaLabels := string(vClusterSettings.Spec.CaLabels) +vEnableInternalGateway := bool(vClusterSettings.Spec.EnableInternalGateway) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalClusterSettings { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + DisplayName: &vDisplayName, + Description: &vDescription, + Tags: &vTags, + Labels: &vLabels, + AutoInstallServiceMesh: &vAutoInstallServiceMesh, + EnableNamespaceExclusions: &vEnableNamespaceExclusions, + NamespaceExclusions: &vNamespaceExclusions, + SystemNamespaceExclusions: &vSystemNamespaceExclusions, + AgentDomain: &vAgentDomain, + ProxyConfig: &vProxyConfig, + AutoInstallServiceMeshConfig: &vAutoInstallServiceMeshConfig, + RegistryAccount: &vRegistryAccount, + CaLabels: &vCaLabels, + EnableInternalGateway: &vEnableInternalGateway, + } + vGlobalClusterSettingsList = append(vGlobalClusterSettingsList, ret) + } + + log.Debugf("[getGlobalClusterConfigFolderClustersResolver]Output Clusters objects %v", vGlobalClusterSettingsList) + + return vGlobalClusterSettingsList, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: DnsConfigFolder Node: ClusterConfig PKG: Global +////////////////////////////////////// +func getGlobalClusterConfigDnsConfigFolderResolver(obj *model.GlobalClusterConfig, id *string) (*model.GlobalDNSConfigFolder, error) { + log.Debugf("[getGlobalClusterConfigDnsConfigFolderResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalClusterConfigDnsConfigFolderResolver]Id %q", *id) + vDNSConfigFolder, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDnsConfigFolder(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalClusterConfigDnsConfigFolderResolver]Error getting DnsConfigFolder node %q : %s", *id, err) + return &model.GlobalDNSConfigFolder{}, nil + } + dn := vDNSConfigFolder.DisplayName() +parentLabels := map[string]interface{}{"dnsconfigfolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDNSConfigFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalClusterConfigDnsConfigFolderResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalClusterConfigDnsConfigFolderResolver]Id is empty, process all DnsConfigFolders") + vDNSConfigFolderParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).GetClusters(context.TODO(), getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalClusterConfigDnsConfigFolderResolver]Failed to get parent node %s", err) + return &model.GlobalDNSConfigFolder{}, nil + } + vDNSConfigFolder, err := vDNSConfigFolderParent.GetDnsConfigFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalClusterConfigDnsConfigFolderResolver]Error getting DnsConfigFolder node %s", err) + return &model.GlobalDNSConfigFolder{}, nil + } + dn := vDNSConfigFolder.DisplayName() +parentLabels := map[string]interface{}{"dnsconfigfolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDNSConfigFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalClusterConfigDnsConfigFolderResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Singleton) +// FieldName: DnsProbesConfigFolder Node: ClusterConfig PKG: Global +////////////////////////////////////// +func getGlobalClusterConfigDnsProbesConfigFolderResolver(obj *model.GlobalClusterConfig) (*model.GlobalDNSProbesConfigFolder, error) { + log.Debugf("[getGlobalClusterConfigDnsProbesConfigFolderResolver]Parent Object %+v", obj) + vDNSProbesConfigFolder, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDnsProbesConfigFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalClusterConfigDnsProbesConfigFolderResolver]Error getting ClusterConfig node %s", err) + return &model.GlobalDNSProbesConfigFolder{}, nil + } + dn := vDNSProbesConfigFolder.DisplayName() +parentLabels := map[string]interface{}{"dnsprobesconfigfolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDNSProbesConfigFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalClusterConfigDnsProbesConfigFolderResolver]Output object %+v", ret) + return ret, nil +} +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: LogFolder Node: ClusterConfig PKG: Global +////////////////////////////////////// +func getGlobalClusterConfigLogFolderResolver(obj *model.GlobalClusterConfig, id *string) (*model.GlobalLogFolder, error) { + log.Debugf("[getGlobalClusterConfigLogFolderResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalClusterConfigLogFolderResolver]Id %q", *id) + vLogFolder, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetLogFolder(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalClusterConfigLogFolderResolver]Error getting LogFolder node %q : %s", *id, err) + return &model.GlobalLogFolder{}, nil + } + dn := vLogFolder.DisplayName() +parentLabels := map[string]interface{}{"logfolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalLogFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalClusterConfigLogFolderResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalClusterConfigLogFolderResolver]Id is empty, process all LogFolders") + vLogFolderParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).GetClusters(context.TODO(), getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalClusterConfigLogFolderResolver]Failed to get parent node %s", err) + return &model.GlobalLogFolder{}, nil + } + vLogFolder, err := vLogFolderParent.GetLogFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalClusterConfigLogFolderResolver]Error getting LogFolder node %s", err) + return &model.GlobalLogFolder{}, nil + } + dn := vLogFolder.DisplayName() +parentLabels := map[string]interface{}{"logfolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalLogFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalClusterConfigLogFolderResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: ResourceGroup Node: ClusterConfig PKG: Global +////////////////////////////////////// +func getGlobalClusterConfigResourceGroupResolver(obj *model.GlobalClusterConfig, id *string) (*model.GlobalResourceGroupRT, error) { + log.Debugf("[getGlobalClusterConfigResourceGroupResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalClusterConfigResourceGroupResolver]Id %q", *id) + vResourceGroupRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetResourceGroup(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalClusterConfigResourceGroupResolver]Error getting ResourceGroup node %q : %s", *id, err) + return &model.GlobalResourceGroupRT{}, nil + } + dn := vResourceGroupRT.DisplayName() +parentLabels := map[string]interface{}{"resourcegrouprts.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalResourceGroupRT { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalClusterConfigResourceGroupResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalClusterConfigResourceGroupResolver]Id is empty, process all ResourceGroups") + vResourceGroupRTParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).GetClusters(context.TODO(), getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalClusterConfigResourceGroupResolver]Failed to get parent node %s", err) + return &model.GlobalResourceGroupRT{}, nil + } + vResourceGroupRT, err := vResourceGroupRTParent.GetResourceGroup(context.TODO()) + if err != nil { + log.Errorf("[getGlobalClusterConfigResourceGroupResolver]Error getting ResourceGroup node %s", err) + return &model.GlobalResourceGroupRT{}, nil + } + dn := vResourceGroupRT.DisplayName() +parentLabels := map[string]interface{}{"resourcegrouprts.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalResourceGroupRT { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalClusterConfigResourceGroupResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Domains Node: ClusterConfig PKG: Global +////////////////////////////////////// +func getGlobalClusterConfigDomainsResolver(obj *model.GlobalClusterConfig, id *string) ([]*model.GlobalDomainConfig, error) { + log.Debugf("[getGlobalClusterConfigDomainsResolver]Parent Object %+v", obj) + var vGlobalDomainConfigList []*model.GlobalDomainConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalClusterConfigDomainsResolver]Id %q", *id) + vDomainConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalClusterConfigDomainsResolver]Error getting Domains node %q : %s", *id, err) + return vGlobalDomainConfigList, nil + } + dn := vDomainConfig.DisplayName() +parentLabels := map[string]interface{}{"domainconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vDomainConfig.Spec.Name) +vOwnedBy := string(vDomainConfig.Spec.OwnedBy) +vLabels := string(vDomainConfig.Spec.Labels) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDomainConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + OwnedBy: &vOwnedBy, + Labels: &vLabels, + } + vGlobalDomainConfigList = append(vGlobalDomainConfigList, ret) + + log.Debugf("[getGlobalClusterConfigDomainsResolver]Output Domains objects %v", vGlobalDomainConfigList) + + return vGlobalDomainConfigList, nil + } + + log.Debug("[getGlobalClusterConfigDomainsResolver]Id is empty, process all Domainss") + + vDomainConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).GetClusters(context.TODO(), getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalClusterConfigDomainsResolver]Error getting parent node %s", err) + return vGlobalDomainConfigList, nil + } + vDomainConfigAllObj, err := vDomainConfigParent.GetAllDomains(context.TODO()) + if err != nil { + log.Errorf("[getGlobalClusterConfigDomainsResolver]Error getting Domains objects %s", err) + return vGlobalDomainConfigList, nil + } + for _, i := range vDomainConfigAllObj { + vDomainConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalClusterConfigDomainsResolver]Error getting Domains node %q : %s", i.DisplayName(), err) + continue + } + dn := vDomainConfig.DisplayName() +parentLabels := map[string]interface{}{"domainconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vDomainConfig.Spec.Name) +vOwnedBy := string(vDomainConfig.Spec.OwnedBy) +vLabels := string(vDomainConfig.Spec.Labels) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDomainConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + OwnedBy: &vOwnedBy, + Labels: &vLabels, + } + vGlobalDomainConfigList = append(vGlobalDomainConfigList, ret) + } + + log.Debugf("[getGlobalClusterConfigDomainsResolver]Output Domains objects %v", vGlobalDomainConfigList) + + return vGlobalDomainConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: HostConfig Node: ClusterConfig PKG: Global +////////////////////////////////////// +func getGlobalClusterConfigHostConfigResolver(obj *model.GlobalClusterConfig, id *string) ([]*model.GlobalHostConfig, error) { + log.Debugf("[getGlobalClusterConfigHostConfigResolver]Parent Object %+v", obj) + var vGlobalHostConfigList []*model.GlobalHostConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalClusterConfigHostConfigResolver]Id %q", *id) + vHostConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetHostConfig(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalClusterConfigHostConfigResolver]Error getting HostConfig node %q : %s", *id, err) + return vGlobalHostConfigList, nil + } + dn := vHostConfig.DisplayName() +parentLabels := map[string]interface{}{"hostconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vHostConfig.Spec.Name) +vHost := string(vHostConfig.Spec.Host) +vOwnedBy := string(vHostConfig.Spec.OwnedBy) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalHostConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Host: &vHost, + OwnedBy: &vOwnedBy, + } + vGlobalHostConfigList = append(vGlobalHostConfigList, ret) + + log.Debugf("[getGlobalClusterConfigHostConfigResolver]Output HostConfig objects %v", vGlobalHostConfigList) + + return vGlobalHostConfigList, nil + } + + log.Debug("[getGlobalClusterConfigHostConfigResolver]Id is empty, process all HostConfigs") + + vHostConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).GetClusters(context.TODO(), getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalClusterConfigHostConfigResolver]Error getting parent node %s", err) + return vGlobalHostConfigList, nil + } + vHostConfigAllObj, err := vHostConfigParent.GetAllHostConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalClusterConfigHostConfigResolver]Error getting HostConfig objects %s", err) + return vGlobalHostConfigList, nil + } + for _, i := range vHostConfigAllObj { + vHostConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetHostConfig(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalClusterConfigHostConfigResolver]Error getting HostConfig node %q : %s", i.DisplayName(), err) + continue + } + dn := vHostConfig.DisplayName() +parentLabels := map[string]interface{}{"hostconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vHostConfig.Spec.Name) +vHost := string(vHostConfig.Spec.Host) +vOwnedBy := string(vHostConfig.Spec.OwnedBy) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalHostConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Host: &vHost, + OwnedBy: &vOwnedBy, + } + vGlobalHostConfigList = append(vGlobalHostConfigList, ret) + } + + log.Debugf("[getGlobalClusterConfigHostConfigResolver]Output HostConfig objects %v", vGlobalHostConfigList) + + return vGlobalHostConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: GnsBinding Node: ClusterConfig PKG: Global +////////////////////////////////////// +func getGlobalClusterConfigGnsBindingResolver(obj *model.GlobalClusterConfig, id *string) ([]*model.GlobalGnsBindingRT, error) { + log.Debugf("[getGlobalClusterConfigGnsBindingResolver]Parent Object %+v", obj) + var vGlobalGnsBindingRTList []*model.GlobalGnsBindingRT + if id != nil && *id != "" { + log.Debugf("[getGlobalClusterConfigGnsBindingResolver]Id %q", *id) + vGnsBindingRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetGnsBinding(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalClusterConfigGnsBindingResolver]Error getting GnsBinding node %q : %s", *id, err) + return vGlobalGnsBindingRTList, nil + } + dn := vGnsBindingRT.DisplayName() +parentLabels := map[string]interface{}{"gnsbindingrts.global.tsm.tanzu.vmware.com":dn} +vName := string(vGnsBindingRT.Spec.Name) +vDomain := string(vGnsBindingRT.Spec.Domain) +Namespaces, _ := json.Marshal(vGnsBindingRT.Spec.Namespaces) +NamespacesData := string(Namespaces) +vApiDiscoveryEnabled := bool(vGnsBindingRT.Spec.ApiDiscoveryEnabled) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsBindingRT { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Domain: &vDomain, + Namespaces: &NamespacesData, + ApiDiscoveryEnabled: &vApiDiscoveryEnabled, + } + vGlobalGnsBindingRTList = append(vGlobalGnsBindingRTList, ret) + + log.Debugf("[getGlobalClusterConfigGnsBindingResolver]Output GnsBinding objects %v", vGlobalGnsBindingRTList) + + return vGlobalGnsBindingRTList, nil + } + + log.Debug("[getGlobalClusterConfigGnsBindingResolver]Id is empty, process all GnsBindings") + + vGnsBindingRTParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).GetClusters(context.TODO(), getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalClusterConfigGnsBindingResolver]Error getting parent node %s", err) + return vGlobalGnsBindingRTList, nil + } + vGnsBindingRTAllObj, err := vGnsBindingRTParent.GetAllGnsBinding(context.TODO()) + if err != nil { + log.Errorf("[getGlobalClusterConfigGnsBindingResolver]Error getting GnsBinding objects %s", err) + return vGlobalGnsBindingRTList, nil + } + for _, i := range vGnsBindingRTAllObj { + vGnsBindingRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetGnsBinding(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalClusterConfigGnsBindingResolver]Error getting GnsBinding node %q : %s", i.DisplayName(), err) + continue + } + dn := vGnsBindingRT.DisplayName() +parentLabels := map[string]interface{}{"gnsbindingrts.global.tsm.tanzu.vmware.com":dn} +vName := string(vGnsBindingRT.Spec.Name) +vDomain := string(vGnsBindingRT.Spec.Domain) +Namespaces, _ := json.Marshal(vGnsBindingRT.Spec.Namespaces) +NamespacesData := string(Namespaces) +vApiDiscoveryEnabled := bool(vGnsBindingRT.Spec.ApiDiscoveryEnabled) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsBindingRT { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Domain: &vDomain, + Namespaces: &NamespacesData, + ApiDiscoveryEnabled: &vApiDiscoveryEnabled, + } + vGlobalGnsBindingRTList = append(vGlobalGnsBindingRTList, ret) + } + + log.Debugf("[getGlobalClusterConfigGnsBindingResolver]Output GnsBinding objects %v", vGlobalGnsBindingRTList) + + return vGlobalGnsBindingRTList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: SecurityContextConstraints Node: ClusterConfig PKG: Global +////////////////////////////////////// +func getGlobalClusterConfigSecurityContextConstraintsResolver(obj *model.GlobalClusterConfig, id *string) ([]*model.GlobalSecurityContextConstraintsConfig, error) { + log.Debugf("[getGlobalClusterConfigSecurityContextConstraintsResolver]Parent Object %+v", obj) + var vGlobalSecurityContextConstraintsConfigList []*model.GlobalSecurityContextConstraintsConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalClusterConfigSecurityContextConstraintsResolver]Id %q", *id) + vSecurityContextConstraintsConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetSecurityContextConstraints(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalClusterConfigSecurityContextConstraintsResolver]Error getting SecurityContextConstraints node %q : %s", *id, err) + return vGlobalSecurityContextConstraintsConfigList, nil + } + dn := vSecurityContextConstraintsConfig.DisplayName() +parentLabels := map[string]interface{}{"securitycontextconstraintsconfigs.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vSecurityContextConstraintsConfig.Spec.Metadata) +vName := string(vSecurityContextConstraintsConfig.Spec.Name) +Groups, _ := json.Marshal(vSecurityContextConstraintsConfig.Spec.Groups) +GroupsData := string(Groups) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSecurityContextConstraintsConfig { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Name: &vName, + Groups: &GroupsData, + } + vGlobalSecurityContextConstraintsConfigList = append(vGlobalSecurityContextConstraintsConfigList, ret) + + log.Debugf("[getGlobalClusterConfigSecurityContextConstraintsResolver]Output SecurityContextConstraints objects %v", vGlobalSecurityContextConstraintsConfigList) + + return vGlobalSecurityContextConstraintsConfigList, nil + } + + log.Debug("[getGlobalClusterConfigSecurityContextConstraintsResolver]Id is empty, process all SecurityContextConstraintss") + + vSecurityContextConstraintsConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).GetClusters(context.TODO(), getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalClusterConfigSecurityContextConstraintsResolver]Error getting parent node %s", err) + return vGlobalSecurityContextConstraintsConfigList, nil + } + vSecurityContextConstraintsConfigAllObj, err := vSecurityContextConstraintsConfigParent.GetAllSecurityContextConstraints(context.TODO()) + if err != nil { + log.Errorf("[getGlobalClusterConfigSecurityContextConstraintsResolver]Error getting SecurityContextConstraints objects %s", err) + return vGlobalSecurityContextConstraintsConfigList, nil + } + for _, i := range vSecurityContextConstraintsConfigAllObj { + vSecurityContextConstraintsConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetSecurityContextConstraints(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalClusterConfigSecurityContextConstraintsResolver]Error getting SecurityContextConstraints node %q : %s", i.DisplayName(), err) + continue + } + dn := vSecurityContextConstraintsConfig.DisplayName() +parentLabels := map[string]interface{}{"securitycontextconstraintsconfigs.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vSecurityContextConstraintsConfig.Spec.Metadata) +vName := string(vSecurityContextConstraintsConfig.Spec.Name) +Groups, _ := json.Marshal(vSecurityContextConstraintsConfig.Spec.Groups) +GroupsData := string(Groups) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSecurityContextConstraintsConfig { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Name: &vName, + Groups: &GroupsData, + } + vGlobalSecurityContextConstraintsConfigList = append(vGlobalSecurityContextConstraintsConfigList, ret) + } + + log.Debugf("[getGlobalClusterConfigSecurityContextConstraintsResolver]Output SecurityContextConstraints objects %v", vGlobalSecurityContextConstraintsConfigList) + + return vGlobalSecurityContextConstraintsConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Clusters Node: ClusterFolder PKG: Global +////////////////////////////////////// +func getGlobalClusterFolderClustersResolver(obj *model.GlobalClusterFolder, id *string) ([]*model.GlobalClusterConfig, error) { + log.Debugf("[getGlobalClusterFolderClustersResolver]Parent Object %+v", obj) + var vGlobalClusterConfigList []*model.GlobalClusterConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalClusterFolderClustersResolver]Id %q", *id) + vClusterConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).GetClusters(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalClusterFolderClustersResolver]Error getting Clusters node %q : %s", *id, err) + return vGlobalClusterConfigList, nil + } + dn := vClusterConfig.DisplayName() +parentLabels := map[string]interface{}{"clusterconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vClusterConfig.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalClusterConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + vGlobalClusterConfigList = append(vGlobalClusterConfigList, ret) + + log.Debugf("[getGlobalClusterFolderClustersResolver]Output Clusters objects %v", vGlobalClusterConfigList) + + return vGlobalClusterConfigList, nil + } + + log.Debug("[getGlobalClusterFolderClustersResolver]Id is empty, process all Clusterss") + + vClusterConfigParent, err := nc.GlobalRoot().Runtime().GetClusterFolder(context.TODO(), getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalClusterFolderClustersResolver]Error getting parent node %s", err) + return vGlobalClusterConfigList, nil + } + vClusterConfigAllObj, err := vClusterConfigParent.GetAllClusters(context.TODO()) + if err != nil { + log.Errorf("[getGlobalClusterFolderClustersResolver]Error getting Clusters objects %s", err) + return vGlobalClusterConfigList, nil + } + for _, i := range vClusterConfigAllObj { + vClusterConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).GetClusters(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalClusterFolderClustersResolver]Error getting Clusters node %q : %s", i.DisplayName(), err) + continue + } + dn := vClusterConfig.DisplayName() +parentLabels := map[string]interface{}{"clusterconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vClusterConfig.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalClusterConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + vGlobalClusterConfigList = append(vGlobalClusterConfigList, ret) + } + + log.Debugf("[getGlobalClusterFolderClustersResolver]Output Clusters objects %v", vGlobalClusterConfigList) + + return vGlobalClusterConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: RemoteGatewayServiceConfigs Node: ClusterFolder PKG: Global +////////////////////////////////////// +func getGlobalClusterFolderRemoteGatewayServiceConfigsResolver(obj *model.GlobalClusterFolder, id *string) ([]*model.GlobalRemoteGatewayServiceConfig, error) { + log.Debugf("[getGlobalClusterFolderRemoteGatewayServiceConfigsResolver]Parent Object %+v", obj) + var vGlobalRemoteGatewayServiceConfigList []*model.GlobalRemoteGatewayServiceConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalClusterFolderRemoteGatewayServiceConfigsResolver]Id %q", *id) + vRemoteGatewayServiceConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).GetRemoteGatewayServiceConfigs(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalClusterFolderRemoteGatewayServiceConfigsResolver]Error getting RemoteGatewayServiceConfigs node %q : %s", *id, err) + return vGlobalRemoteGatewayServiceConfigList, nil + } + dn := vRemoteGatewayServiceConfig.DisplayName() +parentLabels := map[string]interface{}{"remotegatewayserviceconfigs.global.tsm.tanzu.vmware.com":dn} +vOwnedBy := string(vRemoteGatewayServiceConfig.Spec.OwnedBy) +vLabels := string(vRemoteGatewayServiceConfig.Spec.Labels) +vNodeIPs := string(vRemoteGatewayServiceConfig.Spec.NodeIPs) +vPorts := string(vRemoteGatewayServiceConfig.Spec.Ports) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalRemoteGatewayServiceConfig { + Id: &dn, + ParentLabels: parentLabels, + OwnedBy: &vOwnedBy, + Labels: &vLabels, + NodeIPs: &vNodeIPs, + Ports: &vPorts, + } + vGlobalRemoteGatewayServiceConfigList = append(vGlobalRemoteGatewayServiceConfigList, ret) + + log.Debugf("[getGlobalClusterFolderRemoteGatewayServiceConfigsResolver]Output RemoteGatewayServiceConfigs objects %v", vGlobalRemoteGatewayServiceConfigList) + + return vGlobalRemoteGatewayServiceConfigList, nil + } + + log.Debug("[getGlobalClusterFolderRemoteGatewayServiceConfigsResolver]Id is empty, process all RemoteGatewayServiceConfigss") + + vRemoteGatewayServiceConfigParent, err := nc.GlobalRoot().Runtime().GetClusterFolder(context.TODO(), getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalClusterFolderRemoteGatewayServiceConfigsResolver]Error getting parent node %s", err) + return vGlobalRemoteGatewayServiceConfigList, nil + } + vRemoteGatewayServiceConfigAllObj, err := vRemoteGatewayServiceConfigParent.GetAllRemoteGatewayServiceConfigs(context.TODO()) + if err != nil { + log.Errorf("[getGlobalClusterFolderRemoteGatewayServiceConfigsResolver]Error getting RemoteGatewayServiceConfigs objects %s", err) + return vGlobalRemoteGatewayServiceConfigList, nil + } + for _, i := range vRemoteGatewayServiceConfigAllObj { + vRemoteGatewayServiceConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).GetRemoteGatewayServiceConfigs(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalClusterFolderRemoteGatewayServiceConfigsResolver]Error getting RemoteGatewayServiceConfigs node %q : %s", i.DisplayName(), err) + continue + } + dn := vRemoteGatewayServiceConfig.DisplayName() +parentLabels := map[string]interface{}{"remotegatewayserviceconfigs.global.tsm.tanzu.vmware.com":dn} +vOwnedBy := string(vRemoteGatewayServiceConfig.Spec.OwnedBy) +vLabels := string(vRemoteGatewayServiceConfig.Spec.Labels) +vNodeIPs := string(vRemoteGatewayServiceConfig.Spec.NodeIPs) +vPorts := string(vRemoteGatewayServiceConfig.Spec.Ports) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalRemoteGatewayServiceConfig { + Id: &dn, + ParentLabels: parentLabels, + OwnedBy: &vOwnedBy, + Labels: &vLabels, + NodeIPs: &vNodeIPs, + Ports: &vPorts, + } + vGlobalRemoteGatewayServiceConfigList = append(vGlobalRemoteGatewayServiceConfigList, ret) + } + + log.Debugf("[getGlobalClusterFolderRemoteGatewayServiceConfigsResolver]Output RemoteGatewayServiceConfigs objects %v", vGlobalRemoteGatewayServiceConfigList) + + return vGlobalRemoteGatewayServiceConfigList, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: ConnectionStatus Node: Cluster PKG: Global +////////////////////////////////////// +func getGlobalClusterConnectionStatusResolver(obj *model.GlobalCluster, id *string) (*model.GlobalConnectionStatus, error) { + log.Debugf("[getGlobalClusterConnectionStatusResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalClusterConnectionStatusResolver]Id %q", *id) + vConnectionStatus, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetConnectionStatus(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalClusterConnectionStatusResolver]Error getting ConnectionStatus node %q : %s", *id, err) + return &model.GlobalConnectionStatus{}, nil + } + dn := vConnectionStatus.DisplayName() +parentLabels := map[string]interface{}{"connectionstatuses.global.tsm.tanzu.vmware.com":dn} +vConnected := bool(vConnectionStatus.Spec.Connected) +vMessage := string(vConnectionStatus.Spec.Message) +vCode := int(vConnectionStatus.Spec.Code) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalConnectionStatus { + Id: &dn, + ParentLabels: parentLabels, + Connected: &vConnected, + Message: &vMessage, + Code: &vCode, + } + + log.Debugf("[getGlobalClusterConnectionStatusResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalClusterConnectionStatusResolver]Id is empty, process all ConnectionStatuss") + vConnectionStatusParent, err := nc.GlobalRoot().Inventory().GetClusters(context.TODO(), getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalClusterConnectionStatusResolver]Failed to get parent node %s", err) + return &model.GlobalConnectionStatus{}, nil + } + vConnectionStatus, err := vConnectionStatusParent.GetConnectionStatus(context.TODO()) + if err != nil { + log.Errorf("[getGlobalClusterConnectionStatusResolver]Error getting ConnectionStatus node %s", err) + return &model.GlobalConnectionStatus{}, nil + } + dn := vConnectionStatus.DisplayName() +parentLabels := map[string]interface{}{"connectionstatuses.global.tsm.tanzu.vmware.com":dn} +vConnected := bool(vConnectionStatus.Spec.Connected) +vMessage := string(vConnectionStatus.Spec.Message) +vCode := int(vConnectionStatus.Spec.Code) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalConnectionStatus { + Id: &dn, + ParentLabels: parentLabels, + Connected: &vConnected, + Message: &vMessage, + Code: &vCode, + } + + log.Debugf("[getGlobalClusterConnectionStatusResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Apps Node: Cluster PKG: Global +////////////////////////////////////// +func getGlobalClusterAppsResolver(obj *model.GlobalCluster, id *string) ([]*model.GlobalApplicationInfo, error) { + log.Debugf("[getGlobalClusterAppsResolver]Parent Object %+v", obj) + var vGlobalApplicationInfoList []*model.GlobalApplicationInfo + if id != nil && *id != "" { + log.Debugf("[getGlobalClusterAppsResolver]Id %q", *id) + vApplicationInfo, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetApps(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalClusterAppsResolver]Error getting Apps node %q : %s", *id, err) + return vGlobalApplicationInfoList, nil + } + dn := vApplicationInfo.DisplayName() +parentLabels := map[string]interface{}{"applicationinfos.global.tsm.tanzu.vmware.com":dn} +vApp := string(vApplicationInfo.Spec.App) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalApplicationInfo { + Id: &dn, + ParentLabels: parentLabels, + App: &vApp, + } + vGlobalApplicationInfoList = append(vGlobalApplicationInfoList, ret) + + log.Debugf("[getGlobalClusterAppsResolver]Output Apps objects %v", vGlobalApplicationInfoList) + + return vGlobalApplicationInfoList, nil + } + + log.Debug("[getGlobalClusterAppsResolver]Id is empty, process all Appss") + + vApplicationInfoParent, err := nc.GlobalRoot().Inventory().GetClusters(context.TODO(), getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalClusterAppsResolver]Error getting parent node %s", err) + return vGlobalApplicationInfoList, nil + } + vApplicationInfoAllObj, err := vApplicationInfoParent.GetAllApps(context.TODO()) + if err != nil { + log.Errorf("[getGlobalClusterAppsResolver]Error getting Apps objects %s", err) + return vGlobalApplicationInfoList, nil + } + for _, i := range vApplicationInfoAllObj { + vApplicationInfo, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetApps(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalClusterAppsResolver]Error getting Apps node %q : %s", i.DisplayName(), err) + continue + } + dn := vApplicationInfo.DisplayName() +parentLabels := map[string]interface{}{"applicationinfos.global.tsm.tanzu.vmware.com":dn} +vApp := string(vApplicationInfo.Spec.App) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalApplicationInfo { + Id: &dn, + ParentLabels: parentLabels, + App: &vApp, + } + vGlobalApplicationInfoList = append(vGlobalApplicationInfoList, ret) + } + + log.Debugf("[getGlobalClusterAppsResolver]Output Apps objects %v", vGlobalApplicationInfoList) + + return vGlobalApplicationInfoList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: DnsProbeStatus Node: Cluster PKG: Global +////////////////////////////////////// +func getGlobalClusterDnsProbeStatusResolver(obj *model.GlobalCluster, id *string) ([]*model.GlobalDNSProbeStatus, error) { + log.Debugf("[getGlobalClusterDnsProbeStatusResolver]Parent Object %+v", obj) + var vGlobalDNSProbeStatusList []*model.GlobalDNSProbeStatus + if id != nil && *id != "" { + log.Debugf("[getGlobalClusterDnsProbeStatusResolver]Id %q", *id) + vDNSProbeStatus, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDnsProbeStatus(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalClusterDnsProbeStatusResolver]Error getting DnsProbeStatus node %q : %s", *id, err) + return vGlobalDNSProbeStatusList, nil + } + dn := vDNSProbeStatus.DisplayName() +parentLabels := map[string]interface{}{"dnsprobestatuses.global.tsm.tanzu.vmware.com":dn} +vName := string(vDNSProbeStatus.Spec.Name) +vDomain := string(vDNSProbeStatus.Spec.Domain) +vSuccess := bool(vDNSProbeStatus.Spec.Success) +vUpdateTimestamp := string(vDNSProbeStatus.Spec.UpdateTimestamp) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDNSProbeStatus { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Domain: &vDomain, + Success: &vSuccess, + UpdateTimestamp: &vUpdateTimestamp, + } + vGlobalDNSProbeStatusList = append(vGlobalDNSProbeStatusList, ret) + + log.Debugf("[getGlobalClusterDnsProbeStatusResolver]Output DnsProbeStatus objects %v", vGlobalDNSProbeStatusList) + + return vGlobalDNSProbeStatusList, nil + } + + log.Debug("[getGlobalClusterDnsProbeStatusResolver]Id is empty, process all DnsProbeStatuss") + + vDNSProbeStatusParent, err := nc.GlobalRoot().Inventory().GetClusters(context.TODO(), getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalClusterDnsProbeStatusResolver]Error getting parent node %s", err) + return vGlobalDNSProbeStatusList, nil + } + vDNSProbeStatusAllObj, err := vDNSProbeStatusParent.GetAllDnsProbeStatus(context.TODO()) + if err != nil { + log.Errorf("[getGlobalClusterDnsProbeStatusResolver]Error getting DnsProbeStatus objects %s", err) + return vGlobalDNSProbeStatusList, nil + } + for _, i := range vDNSProbeStatusAllObj { + vDNSProbeStatus, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDnsProbeStatus(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalClusterDnsProbeStatusResolver]Error getting DnsProbeStatus node %q : %s", i.DisplayName(), err) + continue + } + dn := vDNSProbeStatus.DisplayName() +parentLabels := map[string]interface{}{"dnsprobestatuses.global.tsm.tanzu.vmware.com":dn} +vName := string(vDNSProbeStatus.Spec.Name) +vDomain := string(vDNSProbeStatus.Spec.Domain) +vSuccess := bool(vDNSProbeStatus.Spec.Success) +vUpdateTimestamp := string(vDNSProbeStatus.Spec.UpdateTimestamp) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDNSProbeStatus { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Domain: &vDomain, + Success: &vSuccess, + UpdateTimestamp: &vUpdateTimestamp, + } + vGlobalDNSProbeStatusList = append(vGlobalDNSProbeStatusList, ret) + } + + log.Debugf("[getGlobalClusterDnsProbeStatusResolver]Output DnsProbeStatus objects %v", vGlobalDNSProbeStatusList) + + return vGlobalDNSProbeStatusList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: SecurityContextConstraints Node: Cluster PKG: Global +////////////////////////////////////// +func getGlobalClusterSecurityContextConstraintsResolver(obj *model.GlobalCluster, id *string) ([]*model.GlobalSecurityContextConstraints, error) { + log.Debugf("[getGlobalClusterSecurityContextConstraintsResolver]Parent Object %+v", obj) + var vGlobalSecurityContextConstraintsList []*model.GlobalSecurityContextConstraints + if id != nil && *id != "" { + log.Debugf("[getGlobalClusterSecurityContextConstraintsResolver]Id %q", *id) + vSecurityContextConstraints, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetSecurityContextConstraints(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalClusterSecurityContextConstraintsResolver]Error getting SecurityContextConstraints node %q : %s", *id, err) + return vGlobalSecurityContextConstraintsList, nil + } + dn := vSecurityContextConstraints.DisplayName() +parentLabels := map[string]interface{}{"securitycontextconstraintses.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vSecurityContextConstraints.Spec.Metadata) +vName := string(vSecurityContextConstraints.Spec.Name) +Groups, _ := json.Marshal(vSecurityContextConstraints.Spec.Groups) +GroupsData := string(Groups) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSecurityContextConstraints { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Name: &vName, + Groups: &GroupsData, + } + vGlobalSecurityContextConstraintsList = append(vGlobalSecurityContextConstraintsList, ret) + + log.Debugf("[getGlobalClusterSecurityContextConstraintsResolver]Output SecurityContextConstraints objects %v", vGlobalSecurityContextConstraintsList) + + return vGlobalSecurityContextConstraintsList, nil + } + + log.Debug("[getGlobalClusterSecurityContextConstraintsResolver]Id is empty, process all SecurityContextConstraintss") + + vSecurityContextConstraintsParent, err := nc.GlobalRoot().Inventory().GetClusters(context.TODO(), getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalClusterSecurityContextConstraintsResolver]Error getting parent node %s", err) + return vGlobalSecurityContextConstraintsList, nil + } + vSecurityContextConstraintsAllObj, err := vSecurityContextConstraintsParent.GetAllSecurityContextConstraints(context.TODO()) + if err != nil { + log.Errorf("[getGlobalClusterSecurityContextConstraintsResolver]Error getting SecurityContextConstraints objects %s", err) + return vGlobalSecurityContextConstraintsList, nil + } + for _, i := range vSecurityContextConstraintsAllObj { + vSecurityContextConstraints, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetSecurityContextConstraints(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalClusterSecurityContextConstraintsResolver]Error getting SecurityContextConstraints node %q : %s", i.DisplayName(), err) + continue + } + dn := vSecurityContextConstraints.DisplayName() +parentLabels := map[string]interface{}{"securitycontextconstraintses.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vSecurityContextConstraints.Spec.Metadata) +vName := string(vSecurityContextConstraints.Spec.Name) +Groups, _ := json.Marshal(vSecurityContextConstraints.Spec.Groups) +GroupsData := string(Groups) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSecurityContextConstraints { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Name: &vName, + Groups: &GroupsData, + } + vGlobalSecurityContextConstraintsList = append(vGlobalSecurityContextConstraintsList, ret) + } + + log.Debugf("[getGlobalClusterSecurityContextConstraintsResolver]Output SecurityContextConstraints objects %v", vGlobalSecurityContextConstraintsList) + + return vGlobalSecurityContextConstraintsList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Domains Node: Cluster PKG: Global +////////////////////////////////////// +func getGlobalClusterDomainsResolver(obj *model.GlobalCluster, id *string) ([]*model.GlobalDomain, error) { + log.Debugf("[getGlobalClusterDomainsResolver]Parent Object %+v", obj) + var vGlobalDomainList []*model.GlobalDomain + if id != nil && *id != "" { + log.Debugf("[getGlobalClusterDomainsResolver]Id %q", *id) + vDomain, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalClusterDomainsResolver]Error getting Domains node %q : %s", *id, err) + return vGlobalDomainList, nil + } + dn := vDomain.DisplayName() +parentLabels := map[string]interface{}{"domains.global.tsm.tanzu.vmware.com":dn} +vName := string(vDomain.Spec.Name) +vEnviornmentType := string(vDomain.Spec.EnviornmentType) +vApiLink := string(vDomain.Spec.ApiLink) +vAnnotations := string(vDomain.Spec.Annotations) +vLabels := string(vDomain.Spec.Labels) +vMetadata := string(vDomain.Spec.Metadata) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDomain { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + EnviornmentType: &vEnviornmentType, + ApiLink: &vApiLink, + Annotations: &vAnnotations, + Labels: &vLabels, + Metadata: &vMetadata, + } + vGlobalDomainList = append(vGlobalDomainList, ret) + + log.Debugf("[getGlobalClusterDomainsResolver]Output Domains objects %v", vGlobalDomainList) + + return vGlobalDomainList, nil + } + + log.Debug("[getGlobalClusterDomainsResolver]Id is empty, process all Domainss") + + vDomainParent, err := nc.GlobalRoot().Inventory().GetClusters(context.TODO(), getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalClusterDomainsResolver]Error getting parent node %s", err) + return vGlobalDomainList, nil + } + vDomainAllObj, err := vDomainParent.GetAllDomains(context.TODO()) + if err != nil { + log.Errorf("[getGlobalClusterDomainsResolver]Error getting Domains objects %s", err) + return vGlobalDomainList, nil + } + for _, i := range vDomainAllObj { + vDomain, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalClusterDomainsResolver]Error getting Domains node %q : %s", i.DisplayName(), err) + continue + } + dn := vDomain.DisplayName() +parentLabels := map[string]interface{}{"domains.global.tsm.tanzu.vmware.com":dn} +vName := string(vDomain.Spec.Name) +vEnviornmentType := string(vDomain.Spec.EnviornmentType) +vApiLink := string(vDomain.Spec.ApiLink) +vAnnotations := string(vDomain.Spec.Annotations) +vLabels := string(vDomain.Spec.Labels) +vMetadata := string(vDomain.Spec.Metadata) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDomain { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + EnviornmentType: &vEnviornmentType, + ApiLink: &vApiLink, + Annotations: &vAnnotations, + Labels: &vLabels, + Metadata: &vMetadata, + } + vGlobalDomainList = append(vGlobalDomainList, ret) + } + + log.Debugf("[getGlobalClusterDomainsResolver]Output Domains objects %v", vGlobalDomainList) + + return vGlobalDomainList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Nodes Node: Cluster PKG: Global +////////////////////////////////////// +func getGlobalClusterNodesResolver(obj *model.GlobalCluster, id *string) ([]*model.GlobalNode, error) { + log.Debugf("[getGlobalClusterNodesResolver]Parent Object %+v", obj) + var vGlobalNodeList []*model.GlobalNode + if id != nil && *id != "" { + log.Debugf("[getGlobalClusterNodesResolver]Id %q", *id) + vNode, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetNodes(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalClusterNodesResolver]Error getting Nodes node %q : %s", *id, err) + return vGlobalNodeList, nil + } + dn := vNode.DisplayName() +parentLabels := map[string]interface{}{"nodes.global.tsm.tanzu.vmware.com":dn} +vName := string(vNode.Spec.Name) +vExternalID := string(vNode.Spec.ExternalID) +vProviderID := string(vNode.Spec.ProviderID) +vArchitecture := string(vNode.Spec.Architecture) +vContainerRuntimeVersion := string(vNode.Spec.ContainerRuntimeVersion) +vKernelVersion := string(vNode.Spec.KernelVersion) +vOperatingSystem := string(vNode.Spec.OperatingSystem) +vOsImage := string(vNode.Spec.OsImage) +vSystemUUID := string(vNode.Spec.SystemUUID) +vHostName := string(vNode.Spec.HostName) +vApiLink := string(vNode.Spec.ApiLink) +vBootID := string(vNode.Spec.BootID) +vKubeletVersion := string(vNode.Spec.KubeletVersion) +vMachineID := string(vNode.Spec.MachineID) +vCreationTimestamp := string(vNode.Spec.CreationTimestamp) +vAnnotations := string(vNode.Spec.Annotations) +vLabels := string(vNode.Spec.Labels) +vUid := string(vNode.Spec.Uid) +vSpec := string(vNode.Spec.Spec) +vKStatus := string(vNode.Spec.KStatus) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNode { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + ExternalID: &vExternalID, + ProviderID: &vProviderID, + Architecture: &vArchitecture, + ContainerRuntimeVersion: &vContainerRuntimeVersion, + KernelVersion: &vKernelVersion, + OperatingSystem: &vOperatingSystem, + OsImage: &vOsImage, + SystemUUID: &vSystemUUID, + HostName: &vHostName, + ApiLink: &vApiLink, + BootID: &vBootID, + KubeletVersion: &vKubeletVersion, + MachineID: &vMachineID, + CreationTimestamp: &vCreationTimestamp, + Annotations: &vAnnotations, + Labels: &vLabels, + Uid: &vUid, + Spec: &vSpec, + KStatus: &vKStatus, + } + vGlobalNodeList = append(vGlobalNodeList, ret) + + log.Debugf("[getGlobalClusterNodesResolver]Output Nodes objects %v", vGlobalNodeList) + + return vGlobalNodeList, nil + } + + log.Debug("[getGlobalClusterNodesResolver]Id is empty, process all Nodess") + + vNodeParent, err := nc.GlobalRoot().Inventory().GetClusters(context.TODO(), getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalClusterNodesResolver]Error getting parent node %s", err) + return vGlobalNodeList, nil + } + vNodeAllObj, err := vNodeParent.GetAllNodes(context.TODO()) + if err != nil { + log.Errorf("[getGlobalClusterNodesResolver]Error getting Nodes objects %s", err) + return vGlobalNodeList, nil + } + for _, i := range vNodeAllObj { + vNode, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetNodes(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalClusterNodesResolver]Error getting Nodes node %q : %s", i.DisplayName(), err) + continue + } + dn := vNode.DisplayName() +parentLabels := map[string]interface{}{"nodes.global.tsm.tanzu.vmware.com":dn} +vName := string(vNode.Spec.Name) +vExternalID := string(vNode.Spec.ExternalID) +vProviderID := string(vNode.Spec.ProviderID) +vArchitecture := string(vNode.Spec.Architecture) +vContainerRuntimeVersion := string(vNode.Spec.ContainerRuntimeVersion) +vKernelVersion := string(vNode.Spec.KernelVersion) +vOperatingSystem := string(vNode.Spec.OperatingSystem) +vOsImage := string(vNode.Spec.OsImage) +vSystemUUID := string(vNode.Spec.SystemUUID) +vHostName := string(vNode.Spec.HostName) +vApiLink := string(vNode.Spec.ApiLink) +vBootID := string(vNode.Spec.BootID) +vKubeletVersion := string(vNode.Spec.KubeletVersion) +vMachineID := string(vNode.Spec.MachineID) +vCreationTimestamp := string(vNode.Spec.CreationTimestamp) +vAnnotations := string(vNode.Spec.Annotations) +vLabels := string(vNode.Spec.Labels) +vUid := string(vNode.Spec.Uid) +vSpec := string(vNode.Spec.Spec) +vKStatus := string(vNode.Spec.KStatus) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNode { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + ExternalID: &vExternalID, + ProviderID: &vProviderID, + Architecture: &vArchitecture, + ContainerRuntimeVersion: &vContainerRuntimeVersion, + KernelVersion: &vKernelVersion, + OperatingSystem: &vOperatingSystem, + OsImage: &vOsImage, + SystemUUID: &vSystemUUID, + HostName: &vHostName, + ApiLink: &vApiLink, + BootID: &vBootID, + KubeletVersion: &vKubeletVersion, + MachineID: &vMachineID, + CreationTimestamp: &vCreationTimestamp, + Annotations: &vAnnotations, + Labels: &vLabels, + Uid: &vUid, + Spec: &vSpec, + KStatus: &vKStatus, + } + vGlobalNodeList = append(vGlobalNodeList, ret) + } + + log.Debugf("[getGlobalClusterNodesResolver]Output Nodes objects %v", vGlobalNodeList) + + return vGlobalNodeList, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: ResourceGroups Node: Config PKG: Global +////////////////////////////////////// +func getGlobalConfigResourceGroupsResolver(obj *model.GlobalConfig, id *string) (*model.GlobalResourceGroup, error) { + log.Debugf("[getGlobalConfigResourceGroupsResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalConfigResourceGroupsResolver]Id %q", *id) + vResourceGroup, err := nc.GlobalRoot().Config().GetResourceGroups(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalConfigResourceGroupsResolver]Error getting ResourceGroups node %q : %s", *id, err) + return &model.GlobalResourceGroup{}, nil + } + dn := vResourceGroup.DisplayName() +parentLabels := map[string]interface{}{"resourcegroups.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalResourceGroup { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigResourceGroupsResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalConfigResourceGroupsResolver]Id is empty, process all ResourceGroupss") + vResourceGroupParent, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigResourceGroupsResolver]Failed to get parent node %s", err) + return &model.GlobalResourceGroup{}, nil + } + vResourceGroup, err := vResourceGroupParent.GetResourceGroups(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigResourceGroupsResolver]Error getting ResourceGroups node %s", err) + return &model.GlobalResourceGroup{}, nil + } + dn := vResourceGroup.DisplayName() +parentLabels := map[string]interface{}{"resourcegroups.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalResourceGroup { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigResourceGroupsResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: GlobalNamespace Node: Config PKG: Global +////////////////////////////////////// +func getGlobalConfigGlobalNamespaceResolver(obj *model.GlobalConfig, id *string) (*model.GlobalGlobalNamespace, error) { + log.Debugf("[getGlobalConfigGlobalNamespaceResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalConfigGlobalNamespaceResolver]Id %q", *id) + vGlobalNamespace, err := nc.GlobalRoot().Config().GetGlobalNamespace(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalConfigGlobalNamespaceResolver]Error getting GlobalNamespace node %q : %s", *id, err) + return &model.GlobalGlobalNamespace{}, nil + } + dn := vGlobalNamespace.DisplayName() +parentLabels := map[string]interface{}{"globalnamespaces.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGlobalNamespace { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigGlobalNamespaceResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalConfigGlobalNamespaceResolver]Id is empty, process all GlobalNamespaces") + vGlobalNamespaceParent, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigGlobalNamespaceResolver]Failed to get parent node %s", err) + return &model.GlobalGlobalNamespace{}, nil + } + vGlobalNamespace, err := vGlobalNamespaceParent.GetGlobalNamespace(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigGlobalNamespaceResolver]Error getting GlobalNamespace node %s", err) + return &model.GlobalGlobalNamespace{}, nil + } + dn := vGlobalNamespace.DisplayName() +parentLabels := map[string]interface{}{"globalnamespaces.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGlobalNamespace { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigGlobalNamespaceResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: Policy Node: Config PKG: Global +////////////////////////////////////// +func getGlobalConfigPolicyResolver(obj *model.GlobalConfig, id *string) (*model.GlobalAccessControlPolicy, error) { + log.Debugf("[getGlobalConfigPolicyResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalConfigPolicyResolver]Id %q", *id) + vAccessControlPolicy, err := nc.GlobalRoot().Config().GetPolicy(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalConfigPolicyResolver]Error getting Policy node %q : %s", *id, err) + return &model.GlobalAccessControlPolicy{}, nil + } + dn := vAccessControlPolicy.DisplayName() +parentLabels := map[string]interface{}{"accesscontrolpolicies.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAccessControlPolicy { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigPolicyResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalConfigPolicyResolver]Id is empty, process all Policys") + vAccessControlPolicyParent, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigPolicyResolver]Failed to get parent node %s", err) + return &model.GlobalAccessControlPolicy{}, nil + } + vAccessControlPolicy, err := vAccessControlPolicyParent.GetPolicy(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigPolicyResolver]Error getting Policy node %s", err) + return &model.GlobalAccessControlPolicy{}, nil + } + dn := vAccessControlPolicy.DisplayName() +parentLabels := map[string]interface{}{"accesscontrolpolicies.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAccessControlPolicy { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigPolicyResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: Templates Node: Config PKG: Global +////////////////////////////////////// +func getGlobalConfigTemplatesResolver(obj *model.GlobalConfig, id *string) (*model.GlobalTemplate, error) { + log.Debugf("[getGlobalConfigTemplatesResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalConfigTemplatesResolver]Id %q", *id) + vTemplate, err := nc.GlobalRoot().Config().GetTemplates(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalConfigTemplatesResolver]Error getting Templates node %q : %s", *id, err) + return &model.GlobalTemplate{}, nil + } + dn := vTemplate.DisplayName() +parentLabels := map[string]interface{}{"templates.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalTemplate { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigTemplatesResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalConfigTemplatesResolver]Id is empty, process all Templatess") + vTemplateParent, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigTemplatesResolver]Failed to get parent node %s", err) + return &model.GlobalTemplate{}, nil + } + vTemplate, err := vTemplateParent.GetTemplates(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigTemplatesResolver]Error getting Templates node %s", err) + return &model.GlobalTemplate{}, nil + } + dn := vTemplate.DisplayName() +parentLabels := map[string]interface{}{"templates.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalTemplate { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigTemplatesResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: ProgressiveUpgrade Node: Config PKG: Global +////////////////////////////////////// +func getGlobalConfigProgressiveUpgradeResolver(obj *model.GlobalConfig, id *string) (*model.GlobalProgressiveUpgrade, error) { + log.Debugf("[getGlobalConfigProgressiveUpgradeResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalConfigProgressiveUpgradeResolver]Id %q", *id) + vProgressiveUpgrade, err := nc.GlobalRoot().Config().GetProgressiveUpgrade(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalConfigProgressiveUpgradeResolver]Error getting ProgressiveUpgrade node %q : %s", *id, err) + return &model.GlobalProgressiveUpgrade{}, nil + } + dn := vProgressiveUpgrade.DisplayName() +parentLabels := map[string]interface{}{"progressiveupgrades.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalProgressiveUpgrade { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigProgressiveUpgradeResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalConfigProgressiveUpgradeResolver]Id is empty, process all ProgressiveUpgrades") + vProgressiveUpgradeParent, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigProgressiveUpgradeResolver]Failed to get parent node %s", err) + return &model.GlobalProgressiveUpgrade{}, nil + } + vProgressiveUpgrade, err := vProgressiveUpgradeParent.GetProgressiveUpgrade(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigProgressiveUpgradeResolver]Error getting ProgressiveUpgrade node %s", err) + return &model.GlobalProgressiveUpgrade{}, nil + } + dn := vProgressiveUpgrade.DisplayName() +parentLabels := map[string]interface{}{"progressiveupgrades.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalProgressiveUpgrade { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigProgressiveUpgradeResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: ExternalPlugins Node: Config PKG: Global +////////////////////////////////////// +func getGlobalConfigExternalPluginsResolver(obj *model.GlobalConfig, id *string) (*model.GlobalExternalPluginConfigFolder, error) { + log.Debugf("[getGlobalConfigExternalPluginsResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalConfigExternalPluginsResolver]Id %q", *id) + vExternalPluginConfigFolder, err := nc.GlobalRoot().Config().GetExternalPlugins(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalConfigExternalPluginsResolver]Error getting ExternalPlugins node %q : %s", *id, err) + return &model.GlobalExternalPluginConfigFolder{}, nil + } + dn := vExternalPluginConfigFolder.DisplayName() +parentLabels := map[string]interface{}{"externalpluginconfigfolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalPluginConfigFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigExternalPluginsResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalConfigExternalPluginsResolver]Id is empty, process all ExternalPluginss") + vExternalPluginConfigFolderParent, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigExternalPluginsResolver]Failed to get parent node %s", err) + return &model.GlobalExternalPluginConfigFolder{}, nil + } + vExternalPluginConfigFolder, err := vExternalPluginConfigFolderParent.GetExternalPlugins(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigExternalPluginsResolver]Error getting ExternalPlugins node %s", err) + return &model.GlobalExternalPluginConfigFolder{}, nil + } + dn := vExternalPluginConfigFolder.DisplayName() +parentLabels := map[string]interface{}{"externalpluginconfigfolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalPluginConfigFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigExternalPluginsResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: ExternalAuditStorage Node: Config PKG: Global +////////////////////////////////////// +func getGlobalConfigExternalAuditStorageResolver(obj *model.GlobalConfig, id *string) (*model.GlobalExternalAuditStorage, error) { + log.Debugf("[getGlobalConfigExternalAuditStorageResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalConfigExternalAuditStorageResolver]Id %q", *id) + vExternalAuditStorage, err := nc.GlobalRoot().Config().GetExternalAuditStorage(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalConfigExternalAuditStorageResolver]Error getting ExternalAuditStorage node %q : %s", *id, err) + return &model.GlobalExternalAuditStorage{}, nil + } + dn := vExternalAuditStorage.DisplayName() +parentLabels := map[string]interface{}{"externalauditstorages.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vExternalAuditStorage.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalAuditStorage { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + } + + log.Debugf("[getGlobalConfigExternalAuditStorageResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalConfigExternalAuditStorageResolver]Id is empty, process all ExternalAuditStorages") + vExternalAuditStorageParent, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigExternalAuditStorageResolver]Failed to get parent node %s", err) + return &model.GlobalExternalAuditStorage{}, nil + } + vExternalAuditStorage, err := vExternalAuditStorageParent.GetExternalAuditStorage(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigExternalAuditStorageResolver]Error getting ExternalAuditStorage node %s", err) + return &model.GlobalExternalAuditStorage{}, nil + } + dn := vExternalAuditStorage.DisplayName() +parentLabels := map[string]interface{}{"externalauditstorages.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vExternalAuditStorage.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalAuditStorage { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + } + + log.Debugf("[getGlobalConfigExternalAuditStorageResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: AutoscalerFolder Node: Config PKG: Global +////////////////////////////////////// +func getGlobalConfigAutoscalerFolderResolver(obj *model.GlobalConfig, id *string) (*model.GlobalAutoscalerFolder, error) { + log.Debugf("[getGlobalConfigAutoscalerFolderResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalConfigAutoscalerFolderResolver]Id %q", *id) + vAutoscalerFolder, err := nc.GlobalRoot().Config().GetAutoscalerFolder(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalConfigAutoscalerFolderResolver]Error getting AutoscalerFolder node %q : %s", *id, err) + return &model.GlobalAutoscalerFolder{}, nil + } + dn := vAutoscalerFolder.DisplayName() +parentLabels := map[string]interface{}{"autoscalerfolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAutoscalerFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigAutoscalerFolderResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalConfigAutoscalerFolderResolver]Id is empty, process all AutoscalerFolders") + vAutoscalerFolderParent, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigAutoscalerFolderResolver]Failed to get parent node %s", err) + return &model.GlobalAutoscalerFolder{}, nil + } + vAutoscalerFolder, err := vAutoscalerFolderParent.GetAutoscalerFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigAutoscalerFolderResolver]Error getting AutoscalerFolder node %s", err) + return &model.GlobalAutoscalerFolder{}, nil + } + dn := vAutoscalerFolder.DisplayName() +parentLabels := map[string]interface{}{"autoscalerfolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAutoscalerFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigAutoscalerFolderResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: Clusters Node: Config PKG: Global +////////////////////////////////////// +func getGlobalConfigClustersResolver(obj *model.GlobalConfig, id *string) (*model.GlobalClusterConfigFolder, error) { + log.Debugf("[getGlobalConfigClustersResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalConfigClustersResolver]Id %q", *id) + vClusterConfigFolder, err := nc.GlobalRoot().Config().GetClusters(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalConfigClustersResolver]Error getting Clusters node %q : %s", *id, err) + return &model.GlobalClusterConfigFolder{}, nil + } + dn := vClusterConfigFolder.DisplayName() +parentLabels := map[string]interface{}{"clusterconfigfolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalClusterConfigFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigClustersResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalConfigClustersResolver]Id is empty, process all Clusterss") + vClusterConfigFolderParent, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigClustersResolver]Failed to get parent node %s", err) + return &model.GlobalClusterConfigFolder{}, nil + } + vClusterConfigFolder, err := vClusterConfigFolderParent.GetClusters(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigClustersResolver]Error getting Clusters node %s", err) + return &model.GlobalClusterConfigFolder{}, nil + } + dn := vClusterConfigFolder.DisplayName() +parentLabels := map[string]interface{}{"clusterconfigfolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalClusterConfigFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigClustersResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: ServiceLevelObjective Node: Config PKG: Global +////////////////////////////////////// +func getGlobalConfigServiceLevelObjectiveResolver(obj *model.GlobalConfig, id *string) (*model.GlobalServiceLevelObjectiveFolder, error) { + log.Debugf("[getGlobalConfigServiceLevelObjectiveResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalConfigServiceLevelObjectiveResolver]Id %q", *id) + vServiceLevelObjectiveFolder, err := nc.GlobalRoot().Config().GetServiceLevelObjective(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalConfigServiceLevelObjectiveResolver]Error getting ServiceLevelObjective node %q : %s", *id, err) + return &model.GlobalServiceLevelObjectiveFolder{}, nil + } + dn := vServiceLevelObjectiveFolder.DisplayName() +parentLabels := map[string]interface{}{"servicelevelobjectivefolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceLevelObjectiveFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigServiceLevelObjectiveResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalConfigServiceLevelObjectiveResolver]Id is empty, process all ServiceLevelObjectives") + vServiceLevelObjectiveFolderParent, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigServiceLevelObjectiveResolver]Failed to get parent node %s", err) + return &model.GlobalServiceLevelObjectiveFolder{}, nil + } + vServiceLevelObjectiveFolder, err := vServiceLevelObjectiveFolderParent.GetServiceLevelObjective(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigServiceLevelObjectiveResolver]Error getting ServiceLevelObjective node %s", err) + return &model.GlobalServiceLevelObjectiveFolder{}, nil + } + dn := vServiceLevelObjectiveFolder.DisplayName() +parentLabels := map[string]interface{}{"servicelevelobjectivefolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceLevelObjectiveFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalConfigServiceLevelObjectiveResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Certificates Node: Config PKG: Global +////////////////////////////////////// +func getGlobalConfigCertificatesResolver(obj *model.GlobalConfig, id *string) ([]*model.GlobalCertificateConfigN, error) { + log.Debugf("[getGlobalConfigCertificatesResolver]Parent Object %+v", obj) + var vGlobalCertificateConfigNList []*model.GlobalCertificateConfigN + if id != nil && *id != "" { + log.Debugf("[getGlobalConfigCertificatesResolver]Id %q", *id) + vCertificateConfigN, err := nc.GlobalRoot().Config().GetCertificates(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalConfigCertificatesResolver]Error getting Certificates node %q : %s", *id, err) + return vGlobalCertificateConfigNList, nil + } + dn := vCertificateConfigN.DisplayName() +parentLabels := map[string]interface{}{"certificateconfigns.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vCertificateConfigN.Spec.ProjectId) +vBeginsOn := string(vCertificateConfigN.Spec.BeginsOn) +vExpiresOn := string(vCertificateConfigN.Spec.ExpiresOn) +vIssuedToCN := string(vCertificateConfigN.Spec.IssuedToCN) +vConfig := string(vCertificateConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCertificateConfigN { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + BeginsOn: &vBeginsOn, + ExpiresOn: &vExpiresOn, + IssuedToCN: &vIssuedToCN, + Config: &vConfig, + } + vGlobalCertificateConfigNList = append(vGlobalCertificateConfigNList, ret) + + log.Debugf("[getGlobalConfigCertificatesResolver]Output Certificates objects %v", vGlobalCertificateConfigNList) + + return vGlobalCertificateConfigNList, nil + } + + log.Debug("[getGlobalConfigCertificatesResolver]Id is empty, process all Certificatess") + + vCertificateConfigNParent, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigCertificatesResolver]Error getting parent node %s", err) + return vGlobalCertificateConfigNList, nil + } + vCertificateConfigNAllObj, err := vCertificateConfigNParent.GetAllCertificates(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigCertificatesResolver]Error getting Certificates objects %s", err) + return vGlobalCertificateConfigNList, nil + } + for _, i := range vCertificateConfigNAllObj { + vCertificateConfigN, err := nc.GlobalRoot().Config().GetCertificates(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalConfigCertificatesResolver]Error getting Certificates node %q : %s", i.DisplayName(), err) + continue + } + dn := vCertificateConfigN.DisplayName() +parentLabels := map[string]interface{}{"certificateconfigns.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vCertificateConfigN.Spec.ProjectId) +vBeginsOn := string(vCertificateConfigN.Spec.BeginsOn) +vExpiresOn := string(vCertificateConfigN.Spec.ExpiresOn) +vIssuedToCN := string(vCertificateConfigN.Spec.IssuedToCN) +vConfig := string(vCertificateConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCertificateConfigN { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + BeginsOn: &vBeginsOn, + ExpiresOn: &vExpiresOn, + IssuedToCN: &vIssuedToCN, + Config: &vConfig, + } + vGlobalCertificateConfigNList = append(vGlobalCertificateConfigNList, ret) + } + + log.Debugf("[getGlobalConfigCertificatesResolver]Output Certificates objects %v", vGlobalCertificateConfigNList) + + return vGlobalCertificateConfigNList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ExternalAccounts Node: Config PKG: Global +////////////////////////////////////// +func getGlobalConfigExternalAccountsResolver(obj *model.GlobalConfig, id *string) ([]*model.GlobalExternalAccountConfigN, error) { + log.Debugf("[getGlobalConfigExternalAccountsResolver]Parent Object %+v", obj) + var vGlobalExternalAccountConfigNList []*model.GlobalExternalAccountConfigN + if id != nil && *id != "" { + log.Debugf("[getGlobalConfigExternalAccountsResolver]Id %q", *id) + vExternalAccountConfigN, err := nc.GlobalRoot().Config().GetExternalAccounts(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalConfigExternalAccountsResolver]Error getting ExternalAccounts node %q : %s", *id, err) + return vGlobalExternalAccountConfigNList, nil + } + dn := vExternalAccountConfigN.DisplayName() +parentLabels := map[string]interface{}{"externalaccountconfigns.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vExternalAccountConfigN.Spec.Config) +vProxyConfig := string(vExternalAccountConfigN.Spec.ProxyConfig) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalAccountConfigN { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + ProxyConfig: &vProxyConfig, + } + vGlobalExternalAccountConfigNList = append(vGlobalExternalAccountConfigNList, ret) + + log.Debugf("[getGlobalConfigExternalAccountsResolver]Output ExternalAccounts objects %v", vGlobalExternalAccountConfigNList) + + return vGlobalExternalAccountConfigNList, nil + } + + log.Debug("[getGlobalConfigExternalAccountsResolver]Id is empty, process all ExternalAccountss") + + vExternalAccountConfigNParent, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigExternalAccountsResolver]Error getting parent node %s", err) + return vGlobalExternalAccountConfigNList, nil + } + vExternalAccountConfigNAllObj, err := vExternalAccountConfigNParent.GetAllExternalAccounts(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigExternalAccountsResolver]Error getting ExternalAccounts objects %s", err) + return vGlobalExternalAccountConfigNList, nil + } + for _, i := range vExternalAccountConfigNAllObj { + vExternalAccountConfigN, err := nc.GlobalRoot().Config().GetExternalAccounts(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalConfigExternalAccountsResolver]Error getting ExternalAccounts node %q : %s", i.DisplayName(), err) + continue + } + dn := vExternalAccountConfigN.DisplayName() +parentLabels := map[string]interface{}{"externalaccountconfigns.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vExternalAccountConfigN.Spec.Config) +vProxyConfig := string(vExternalAccountConfigN.Spec.ProxyConfig) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalAccountConfigN { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + ProxyConfig: &vProxyConfig, + } + vGlobalExternalAccountConfigNList = append(vGlobalExternalAccountConfigNList, ret) + } + + log.Debugf("[getGlobalConfigExternalAccountsResolver]Output ExternalAccounts objects %v", vGlobalExternalAccountConfigNList) + + return vGlobalExternalAccountConfigNList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ExternalDNS Node: Config PKG: Global +////////////////////////////////////// +func getGlobalConfigExternalDNSResolver(obj *model.GlobalConfig, id *string) ([]*model.GlobalExternalDNSConfigN, error) { + log.Debugf("[getGlobalConfigExternalDNSResolver]Parent Object %+v", obj) + var vGlobalExternalDNSConfigNList []*model.GlobalExternalDNSConfigN + if id != nil && *id != "" { + log.Debugf("[getGlobalConfigExternalDNSResolver]Id %q", *id) + vExternalDNSConfigN, err := nc.GlobalRoot().Config().GetExternalDNS(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalConfigExternalDNSResolver]Error getting ExternalDNS node %q : %s", *id, err) + return vGlobalExternalDNSConfigNList, nil + } + dn := vExternalDNSConfigN.DisplayName() +parentLabels := map[string]interface{}{"externaldnsconfigns.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vExternalDNSConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSConfigN { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + } + vGlobalExternalDNSConfigNList = append(vGlobalExternalDNSConfigNList, ret) + + log.Debugf("[getGlobalConfigExternalDNSResolver]Output ExternalDNS objects %v", vGlobalExternalDNSConfigNList) + + return vGlobalExternalDNSConfigNList, nil + } + + log.Debug("[getGlobalConfigExternalDNSResolver]Id is empty, process all ExternalDNSs") + + vExternalDNSConfigNParent, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigExternalDNSResolver]Error getting parent node %s", err) + return vGlobalExternalDNSConfigNList, nil + } + vExternalDNSConfigNAllObj, err := vExternalDNSConfigNParent.GetAllExternalDNS(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigExternalDNSResolver]Error getting ExternalDNS objects %s", err) + return vGlobalExternalDNSConfigNList, nil + } + for _, i := range vExternalDNSConfigNAllObj { + vExternalDNSConfigN, err := nc.GlobalRoot().Config().GetExternalDNS(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalConfigExternalDNSResolver]Error getting ExternalDNS node %q : %s", i.DisplayName(), err) + continue + } + dn := vExternalDNSConfigN.DisplayName() +parentLabels := map[string]interface{}{"externaldnsconfigns.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vExternalDNSConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSConfigN { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + } + vGlobalExternalDNSConfigNList = append(vGlobalExternalDNSConfigNList, ret) + } + + log.Debugf("[getGlobalConfigExternalDNSResolver]Output ExternalDNS objects %v", vGlobalExternalDNSConfigNList) + + return vGlobalExternalDNSConfigNList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ExternalLB Node: Config PKG: Global +////////////////////////////////////// +func getGlobalConfigExternalLBResolver(obj *model.GlobalConfig, id *string) ([]*model.GlobalExternalLBConfigN, error) { + log.Debugf("[getGlobalConfigExternalLBResolver]Parent Object %+v", obj) + var vGlobalExternalLBConfigNList []*model.GlobalExternalLBConfigN + if id != nil && *id != "" { + log.Debugf("[getGlobalConfigExternalLBResolver]Id %q", *id) + vExternalLBConfigN, err := nc.GlobalRoot().Config().GetExternalLB(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalConfigExternalLBResolver]Error getting ExternalLB node %q : %s", *id, err) + return vGlobalExternalLBConfigNList, nil + } + dn := vExternalLBConfigN.DisplayName() +parentLabels := map[string]interface{}{"externallbconfigns.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vExternalLBConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalLBConfigN { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + } + vGlobalExternalLBConfigNList = append(vGlobalExternalLBConfigNList, ret) + + log.Debugf("[getGlobalConfigExternalLBResolver]Output ExternalLB objects %v", vGlobalExternalLBConfigNList) + + return vGlobalExternalLBConfigNList, nil + } + + log.Debug("[getGlobalConfigExternalLBResolver]Id is empty, process all ExternalLBs") + + vExternalLBConfigNParent, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigExternalLBResolver]Error getting parent node %s", err) + return vGlobalExternalLBConfigNList, nil + } + vExternalLBConfigNAllObj, err := vExternalLBConfigNParent.GetAllExternalLB(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigExternalLBResolver]Error getting ExternalLB objects %s", err) + return vGlobalExternalLBConfigNList, nil + } + for _, i := range vExternalLBConfigNAllObj { + vExternalLBConfigN, err := nc.GlobalRoot().Config().GetExternalLB(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalConfigExternalLBResolver]Error getting ExternalLB node %q : %s", i.DisplayName(), err) + continue + } + dn := vExternalLBConfigN.DisplayName() +parentLabels := map[string]interface{}{"externallbconfigns.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vExternalLBConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalLBConfigN { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + } + vGlobalExternalLBConfigNList = append(vGlobalExternalLBConfigNList, ret) + } + + log.Debugf("[getGlobalConfigExternalLBResolver]Output ExternalLB objects %v", vGlobalExternalLBConfigNList) + + return vGlobalExternalLBConfigNList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: FeatureFlags Node: Config PKG: Global +////////////////////////////////////// +func getGlobalConfigFeatureFlagsResolver(obj *model.GlobalConfig, id *string) ([]*model.GlobalFeatureFlag, error) { + log.Debugf("[getGlobalConfigFeatureFlagsResolver]Parent Object %+v", obj) + var vGlobalFeatureFlagList []*model.GlobalFeatureFlag + if id != nil && *id != "" { + log.Debugf("[getGlobalConfigFeatureFlagsResolver]Id %q", *id) + vFeatureFlag, err := nc.GlobalRoot().Config().GetFeatureFlags(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalConfigFeatureFlagsResolver]Error getting FeatureFlags node %q : %s", *id, err) + return vGlobalFeatureFlagList, nil + } + dn := vFeatureFlag.DisplayName() +parentLabels := map[string]interface{}{"featureflags.global.tsm.tanzu.vmware.com":dn} +vName := string(vFeatureFlag.Spec.Name) +vDescription := string(vFeatureFlag.Spec.Description) +vEnable := bool(vFeatureFlag.Spec.Enable) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalFeatureFlag { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Description: &vDescription, + Enable: &vEnable, + } + vGlobalFeatureFlagList = append(vGlobalFeatureFlagList, ret) + + log.Debugf("[getGlobalConfigFeatureFlagsResolver]Output FeatureFlags objects %v", vGlobalFeatureFlagList) + + return vGlobalFeatureFlagList, nil + } + + log.Debug("[getGlobalConfigFeatureFlagsResolver]Id is empty, process all FeatureFlagss") + + vFeatureFlagParent, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigFeatureFlagsResolver]Error getting parent node %s", err) + return vGlobalFeatureFlagList, nil + } + vFeatureFlagAllObj, err := vFeatureFlagParent.GetAllFeatureFlags(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigFeatureFlagsResolver]Error getting FeatureFlags objects %s", err) + return vGlobalFeatureFlagList, nil + } + for _, i := range vFeatureFlagAllObj { + vFeatureFlag, err := nc.GlobalRoot().Config().GetFeatureFlags(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalConfigFeatureFlagsResolver]Error getting FeatureFlags node %q : %s", i.DisplayName(), err) + continue + } + dn := vFeatureFlag.DisplayName() +parentLabels := map[string]interface{}{"featureflags.global.tsm.tanzu.vmware.com":dn} +vName := string(vFeatureFlag.Spec.Name) +vDescription := string(vFeatureFlag.Spec.Description) +vEnable := bool(vFeatureFlag.Spec.Enable) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalFeatureFlag { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Description: &vDescription, + Enable: &vEnable, + } + vGlobalFeatureFlagList = append(vGlobalFeatureFlagList, ret) + } + + log.Debugf("[getGlobalConfigFeatureFlagsResolver]Output FeatureFlags objects %v", vGlobalFeatureFlagList) + + return vGlobalFeatureFlagList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Projects Node: Config PKG: Global +////////////////////////////////////// +func getGlobalConfigProjectsResolver(obj *model.GlobalConfig, id *string) ([]*model.GlobalProject, error) { + log.Debugf("[getGlobalConfigProjectsResolver]Parent Object %+v", obj) + var vGlobalProjectList []*model.GlobalProject + if id != nil && *id != "" { + log.Debugf("[getGlobalConfigProjectsResolver]Id %q", *id) + vProject, err := nc.GlobalRoot().Config().GetProjects(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalConfigProjectsResolver]Error getting Projects node %q : %s", *id, err) + return vGlobalProjectList, nil + } + dn := vProject.DisplayName() +parentLabels := map[string]interface{}{"projects.global.tsm.tanzu.vmware.com":dn} +vSpec := string(vProject.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalProject { + Id: &dn, + ParentLabels: parentLabels, + Spec: &vSpec, + } + vGlobalProjectList = append(vGlobalProjectList, ret) + + log.Debugf("[getGlobalConfigProjectsResolver]Output Projects objects %v", vGlobalProjectList) + + return vGlobalProjectList, nil + } + + log.Debug("[getGlobalConfigProjectsResolver]Id is empty, process all Projectss") + + vProjectParent, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigProjectsResolver]Error getting parent node %s", err) + return vGlobalProjectList, nil + } + vProjectAllObj, err := vProjectParent.GetAllProjects(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigProjectsResolver]Error getting Projects objects %s", err) + return vGlobalProjectList, nil + } + for _, i := range vProjectAllObj { + vProject, err := nc.GlobalRoot().Config().GetProjects(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalConfigProjectsResolver]Error getting Projects node %q : %s", i.DisplayName(), err) + continue + } + dn := vProject.DisplayName() +parentLabels := map[string]interface{}{"projects.global.tsm.tanzu.vmware.com":dn} +vSpec := string(vProject.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalProject { + Id: &dn, + ParentLabels: parentLabels, + Spec: &vSpec, + } + vGlobalProjectList = append(vGlobalProjectList, ret) + } + + log.Debugf("[getGlobalConfigProjectsResolver]Output Projects objects %v", vGlobalProjectList) + + return vGlobalProjectList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceDirectory Node: Config PKG: Global +////////////////////////////////////// +func getGlobalConfigServiceDirectoryResolver(obj *model.GlobalConfig, id *string) ([]*model.GlobalServiceDirectoryN, error) { + log.Debugf("[getGlobalConfigServiceDirectoryResolver]Parent Object %+v", obj) + var vGlobalServiceDirectoryNList []*model.GlobalServiceDirectoryN + if id != nil && *id != "" { + log.Debugf("[getGlobalConfigServiceDirectoryResolver]Id %q", *id) + vServiceDirectoryN, err := nc.GlobalRoot().Config().GetServiceDirectory(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalConfigServiceDirectoryResolver]Error getting ServiceDirectory node %q : %s", *id, err) + return vGlobalServiceDirectoryNList, nil + } + dn := vServiceDirectoryN.DisplayName() +parentLabels := map[string]interface{}{"servicedirectoryns.global.tsm.tanzu.vmware.com":dn} +vSpec := string(vServiceDirectoryN.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDirectoryN { + Id: &dn, + ParentLabels: parentLabels, + Spec: &vSpec, + } + vGlobalServiceDirectoryNList = append(vGlobalServiceDirectoryNList, ret) + + log.Debugf("[getGlobalConfigServiceDirectoryResolver]Output ServiceDirectory objects %v", vGlobalServiceDirectoryNList) + + return vGlobalServiceDirectoryNList, nil + } + + log.Debug("[getGlobalConfigServiceDirectoryResolver]Id is empty, process all ServiceDirectorys") + + vServiceDirectoryNParent, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigServiceDirectoryResolver]Error getting parent node %s", err) + return vGlobalServiceDirectoryNList, nil + } + vServiceDirectoryNAllObj, err := vServiceDirectoryNParent.GetAllServiceDirectory(context.TODO()) + if err != nil { + log.Errorf("[getGlobalConfigServiceDirectoryResolver]Error getting ServiceDirectory objects %s", err) + return vGlobalServiceDirectoryNList, nil + } + for _, i := range vServiceDirectoryNAllObj { + vServiceDirectoryN, err := nc.GlobalRoot().Config().GetServiceDirectory(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalConfigServiceDirectoryResolver]Error getting ServiceDirectory node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceDirectoryN.DisplayName() +parentLabels := map[string]interface{}{"servicedirectoryns.global.tsm.tanzu.vmware.com":dn} +vSpec := string(vServiceDirectoryN.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDirectoryN { + Id: &dn, + ParentLabels: parentLabels, + Spec: &vSpec, + } + vGlobalServiceDirectoryNList = append(vGlobalServiceDirectoryNList, ret) + } + + log.Debugf("[getGlobalConfigServiceDirectoryResolver]Output ServiceDirectory objects %v", vGlobalServiceDirectoryNList) + + return vGlobalServiceDirectoryNList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Versions Node: DataFolderDomainService PKG: Global +////////////////////////////////////// +func getGlobalDataFolderDomainServiceVersionsResolver(obj *model.GlobalDataFolderDomainService, id *string) ([]*model.GlobalDataFolderDomainServiceVersion, error) { + log.Debugf("[getGlobalDataFolderDomainServiceVersionsResolver]Parent Object %+v", obj) + var vGlobalDataFolderDomainServiceVersionList []*model.GlobalDataFolderDomainServiceVersion + if id != nil && *id != "" { + log.Debugf("[getGlobalDataFolderDomainServiceVersionsResolver]Id %q", *id) + vDataFolderDomainServiceVersion, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).Service(getParentName(obj.ParentLabels, "datafolderdomainservices.global.tsm.tanzu.vmware.com")).GetVersions(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDataFolderDomainServiceVersionsResolver]Error getting Versions node %q : %s", *id, err) + return vGlobalDataFolderDomainServiceVersionList, nil + } + dn := vDataFolderDomainServiceVersion.DisplayName() +parentLabels := map[string]interface{}{"datafolderdomainserviceversions.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDataFolderDomainServiceVersion { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalDataFolderDomainServiceVersionList = append(vGlobalDataFolderDomainServiceVersionList, ret) + + log.Debugf("[getGlobalDataFolderDomainServiceVersionsResolver]Output Versions objects %v", vGlobalDataFolderDomainServiceVersionList) + + return vGlobalDataFolderDomainServiceVersionList, nil + } + + log.Debug("[getGlobalDataFolderDomainServiceVersionsResolver]Id is empty, process all Versionss") + + vDataFolderDomainServiceVersionParent, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).GetService(context.TODO(), getParentName(obj.ParentLabels, "datafolderdomainservices.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDataFolderDomainServiceVersionsResolver]Error getting parent node %s", err) + return vGlobalDataFolderDomainServiceVersionList, nil + } + vDataFolderDomainServiceVersionAllObj, err := vDataFolderDomainServiceVersionParent.GetAllVersions(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDataFolderDomainServiceVersionsResolver]Error getting Versions objects %s", err) + return vGlobalDataFolderDomainServiceVersionList, nil + } + for _, i := range vDataFolderDomainServiceVersionAllObj { + vDataFolderDomainServiceVersion, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).Service(getParentName(obj.ParentLabels, "datafolderdomainservices.global.tsm.tanzu.vmware.com")).GetVersions(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDataFolderDomainServiceVersionsResolver]Error getting Versions node %q : %s", i.DisplayName(), err) + continue + } + dn := vDataFolderDomainServiceVersion.DisplayName() +parentLabels := map[string]interface{}{"datafolderdomainserviceversions.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDataFolderDomainServiceVersion { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalDataFolderDomainServiceVersionList = append(vGlobalDataFolderDomainServiceVersionList, ret) + } + + log.Debugf("[getGlobalDataFolderDomainServiceVersionsResolver]Output Versions objects %v", vGlobalDataFolderDomainServiceVersionList) + + return vGlobalDataFolderDomainServiceVersionList, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: Cluster Node: DataFolderDomain PKG: Global +////////////////////////////////////// +func getGlobalDataFolderDomainClusterResolver(obj *model.GlobalDataFolderDomain, id *string) (*model.GlobalDataFolderDomainCluster, error) { + log.Debugf("[getGlobalDataFolderDomainClusterResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalDataFolderDomainClusterResolver]Id %q", *id) + vDataFolderDomainCluster, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).GetCluster(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDataFolderDomainClusterResolver]Error getting Cluster node %q : %s", *id, err) + return &model.GlobalDataFolderDomainCluster{}, nil + } + dn := vDataFolderDomainCluster.DisplayName() +parentLabels := map[string]interface{}{"datafolderdomainclusters.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDataFolderDomainCluster { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalDataFolderDomainClusterResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalDataFolderDomainClusterResolver]Id is empty, process all Clusters") + vDataFolderDomainClusterParent, err := nc.GlobalRoot().Runtime().DataFolder().GetDomain(context.TODO(), getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDataFolderDomainClusterResolver]Failed to get parent node %s", err) + return &model.GlobalDataFolderDomainCluster{}, nil + } + vDataFolderDomainCluster, err := vDataFolderDomainClusterParent.GetCluster(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDataFolderDomainClusterResolver]Error getting Cluster node %s", err) + return &model.GlobalDataFolderDomainCluster{}, nil + } + dn := vDataFolderDomainCluster.DisplayName() +parentLabels := map[string]interface{}{"datafolderdomainclusters.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDataFolderDomainCluster { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalDataFolderDomainClusterResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Singleton) +// FieldName: Database Node: DataFolderDomain PKG: Global +////////////////////////////////////// +func getGlobalDataFolderDomainDatabaseResolver(obj *model.GlobalDataFolderDomain) (*model.GlobalDatabase, error) { + log.Debugf("[getGlobalDataFolderDomainDatabaseResolver]Parent Object %+v", obj) + vDatabase, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).GetDatabase(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDataFolderDomainDatabaseResolver]Error getting DataFolderDomain node %s", err) + return &model.GlobalDatabase{}, nil + } + dn := vDatabase.DisplayName() +parentLabels := map[string]interface{}{"databases.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDatabase { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalDataFolderDomainDatabaseResolver]Output object %+v", ret) + return ret, nil +} +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Service Node: DataFolderDomain PKG: Global +////////////////////////////////////// +func getGlobalDataFolderDomainServiceResolver(obj *model.GlobalDataFolderDomain, id *string) ([]*model.GlobalDataFolderDomainService, error) { + log.Debugf("[getGlobalDataFolderDomainServiceResolver]Parent Object %+v", obj) + var vGlobalDataFolderDomainServiceList []*model.GlobalDataFolderDomainService + if id != nil && *id != "" { + log.Debugf("[getGlobalDataFolderDomainServiceResolver]Id %q", *id) + vDataFolderDomainService, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).GetService(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDataFolderDomainServiceResolver]Error getting Service node %q : %s", *id, err) + return vGlobalDataFolderDomainServiceList, nil + } + dn := vDataFolderDomainService.DisplayName() +parentLabels := map[string]interface{}{"datafolderdomainservices.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDataFolderDomainService { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalDataFolderDomainServiceList = append(vGlobalDataFolderDomainServiceList, ret) + + log.Debugf("[getGlobalDataFolderDomainServiceResolver]Output Service objects %v", vGlobalDataFolderDomainServiceList) + + return vGlobalDataFolderDomainServiceList, nil + } + + log.Debug("[getGlobalDataFolderDomainServiceResolver]Id is empty, process all Services") + + vDataFolderDomainServiceParent, err := nc.GlobalRoot().Runtime().DataFolder().GetDomain(context.TODO(), getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDataFolderDomainServiceResolver]Error getting parent node %s", err) + return vGlobalDataFolderDomainServiceList, nil + } + vDataFolderDomainServiceAllObj, err := vDataFolderDomainServiceParent.GetAllService(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDataFolderDomainServiceResolver]Error getting Service objects %s", err) + return vGlobalDataFolderDomainServiceList, nil + } + for _, i := range vDataFolderDomainServiceAllObj { + vDataFolderDomainService, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).GetService(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDataFolderDomainServiceResolver]Error getting Service node %q : %s", i.DisplayName(), err) + continue + } + dn := vDataFolderDomainService.DisplayName() +parentLabels := map[string]interface{}{"datafolderdomainservices.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDataFolderDomainService { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalDataFolderDomainServiceList = append(vGlobalDataFolderDomainServiceList, ret) + } + + log.Debugf("[getGlobalDataFolderDomainServiceResolver]Output Service objects %v", vGlobalDataFolderDomainServiceList) + + return vGlobalDataFolderDomainServiceList, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: Domain Node: DataFolder PKG: Global +////////////////////////////////////// +func getGlobalDataFolderDomainResolver(obj *model.GlobalDataFolder, id *string) (*model.GlobalDataFolderDomain, error) { + log.Debugf("[getGlobalDataFolderDomainResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalDataFolderDomainResolver]Id %q", *id) + vDataFolderDomain, err := nc.GlobalRoot().Runtime().DataFolder().GetDomain(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDataFolderDomainResolver]Error getting Domain node %q : %s", *id, err) + return &model.GlobalDataFolderDomain{}, nil + } + dn := vDataFolderDomain.DisplayName() +parentLabels := map[string]interface{}{"datafolderdomains.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDataFolderDomain { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalDataFolderDomainResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalDataFolderDomainResolver]Id is empty, process all Domains") + vDataFolderDomainParent, err := nc.GlobalRoot().Runtime().GetDataFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDataFolderDomainResolver]Failed to get parent node %s", err) + return &model.GlobalDataFolderDomain{}, nil + } + vDataFolderDomain, err := vDataFolderDomainParent.GetDomain(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDataFolderDomainResolver]Error getting Domain node %s", err) + return &model.GlobalDataFolderDomain{}, nil + } + dn := vDataFolderDomain.DisplayName() +parentLabels := map[string]interface{}{"datafolderdomains.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDataFolderDomain { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalDataFolderDomainResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Tables Node: Database PKG: Global +////////////////////////////////////// +func getGlobalDatabaseTablesResolver(obj *model.GlobalDatabase, id *string) ([]*model.GlobalTable, error) { + log.Debugf("[getGlobalDatabaseTablesResolver]Parent Object %+v", obj) + var vGlobalTableList []*model.GlobalTable + if id != nil && *id != "" { + log.Debugf("[getGlobalDatabaseTablesResolver]Id %q", *id) + vTable, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).Database().GetTables(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDatabaseTablesResolver]Error getting Tables node %q : %s", *id, err) + return vGlobalTableList, nil + } + dn := vTable.DisplayName() +parentLabels := map[string]interface{}{"tables.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalTable { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalTableList = append(vGlobalTableList, ret) + + log.Debugf("[getGlobalDatabaseTablesResolver]Output Tables objects %v", vGlobalTableList) + + return vGlobalTableList, nil + } + + log.Debug("[getGlobalDatabaseTablesResolver]Id is empty, process all Tabless") + + vTableParent, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).GetDatabase(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDatabaseTablesResolver]Error getting parent node %s", err) + return vGlobalTableList, nil + } + vTableAllObj, err := vTableParent.GetAllTables(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDatabaseTablesResolver]Error getting Tables objects %s", err) + return vGlobalTableList, nil + } + for _, i := range vTableAllObj { + vTable, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).Database().GetTables(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDatabaseTablesResolver]Error getting Tables node %q : %s", i.DisplayName(), err) + continue + } + dn := vTable.DisplayName() +parentLabels := map[string]interface{}{"tables.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalTable { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalTableList = append(vGlobalTableList, ret) + } + + log.Debugf("[getGlobalDatabaseTablesResolver]Output Tables objects %v", vGlobalTableList) + + return vGlobalTableList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Directories Node: Database PKG: Global +////////////////////////////////////// +func getGlobalDatabaseDirectoriesResolver(obj *model.GlobalDatabase, id *string) ([]*model.GlobalDirectory, error) { + log.Debugf("[getGlobalDatabaseDirectoriesResolver]Parent Object %+v", obj) + var vGlobalDirectoryList []*model.GlobalDirectory + if id != nil && *id != "" { + log.Debugf("[getGlobalDatabaseDirectoriesResolver]Id %q", *id) + vDirectory, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).Database().GetDirectories(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDatabaseDirectoriesResolver]Error getting Directories node %q : %s", *id, err) + return vGlobalDirectoryList, nil + } + dn := vDirectory.DisplayName() +parentLabels := map[string]interface{}{"directories.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDirectory { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalDirectoryList = append(vGlobalDirectoryList, ret) + + log.Debugf("[getGlobalDatabaseDirectoriesResolver]Output Directories objects %v", vGlobalDirectoryList) + + return vGlobalDirectoryList, nil + } + + log.Debug("[getGlobalDatabaseDirectoriesResolver]Id is empty, process all Directoriess") + + vDirectoryParent, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).GetDatabase(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDatabaseDirectoriesResolver]Error getting parent node %s", err) + return vGlobalDirectoryList, nil + } + vDirectoryAllObj, err := vDirectoryParent.GetAllDirectories(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDatabaseDirectoriesResolver]Error getting Directories objects %s", err) + return vGlobalDirectoryList, nil + } + for _, i := range vDirectoryAllObj { + vDirectory, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).Database().GetDirectories(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDatabaseDirectoriesResolver]Error getting Directories node %q : %s", i.DisplayName(), err) + continue + } + dn := vDirectory.DisplayName() +parentLabels := map[string]interface{}{"directories.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDirectory { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalDirectoryList = append(vGlobalDirectoryList, ret) + } + + log.Debugf("[getGlobalDatabaseDirectoriesResolver]Output Directories objects %v", vGlobalDirectoryList) + + return vGlobalDirectoryList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Buckets Node: Database PKG: Global +////////////////////////////////////// +func getGlobalDatabaseBucketsResolver(obj *model.GlobalDatabase, id *string) ([]*model.GlobalBucket, error) { + log.Debugf("[getGlobalDatabaseBucketsResolver]Parent Object %+v", obj) + var vGlobalBucketList []*model.GlobalBucket + if id != nil && *id != "" { + log.Debugf("[getGlobalDatabaseBucketsResolver]Id %q", *id) + vBucket, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).Database().GetBuckets(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDatabaseBucketsResolver]Error getting Buckets node %q : %s", *id, err) + return vGlobalBucketList, nil + } + dn := vBucket.DisplayName() +parentLabels := map[string]interface{}{"buckets.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalBucket { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalBucketList = append(vGlobalBucketList, ret) + + log.Debugf("[getGlobalDatabaseBucketsResolver]Output Buckets objects %v", vGlobalBucketList) + + return vGlobalBucketList, nil + } + + log.Debug("[getGlobalDatabaseBucketsResolver]Id is empty, process all Bucketss") + + vBucketParent, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).GetDatabase(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDatabaseBucketsResolver]Error getting parent node %s", err) + return vGlobalBucketList, nil + } + vBucketAllObj, err := vBucketParent.GetAllBuckets(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDatabaseBucketsResolver]Error getting Buckets objects %s", err) + return vGlobalBucketList, nil + } + for _, i := range vBucketAllObj { + vBucket, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).Database().GetBuckets(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDatabaseBucketsResolver]Error getting Buckets node %q : %s", i.DisplayName(), err) + continue + } + dn := vBucket.DisplayName() +parentLabels := map[string]interface{}{"buckets.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalBucket { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalBucketList = append(vGlobalBucketList, ret) + } + + log.Debugf("[getGlobalDatabaseBucketsResolver]Output Buckets objects %v", vGlobalBucketList) + + return vGlobalBucketList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Zones Node: DCRegion PKG: Global +////////////////////////////////////// +func getGlobalDCRegionZonesResolver(obj *model.GlobalDCRegion, id *string) ([]*model.GlobalDCZone, error) { + log.Debugf("[getGlobalDCRegionZonesResolver]Parent Object %+v", obj) + var vGlobalDCZoneList []*model.GlobalDCZone + if id != nil && *id != "" { + log.Debugf("[getGlobalDCRegionZonesResolver]Id %q", *id) + vDCZone, err := nc.GlobalRoot().Inventory().Regions(getParentName(obj.ParentLabels, "dcregions.global.tsm.tanzu.vmware.com")).GetZones(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDCRegionZonesResolver]Error getting Zones node %q : %s", *id, err) + return vGlobalDCZoneList, nil + } + dn := vDCZone.DisplayName() +parentLabels := map[string]interface{}{"dczones.global.tsm.tanzu.vmware.com":dn} +vName := string(vDCZone.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDCZone { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + vGlobalDCZoneList = append(vGlobalDCZoneList, ret) + + log.Debugf("[getGlobalDCRegionZonesResolver]Output Zones objects %v", vGlobalDCZoneList) + + return vGlobalDCZoneList, nil + } + + log.Debug("[getGlobalDCRegionZonesResolver]Id is empty, process all Zoness") + + vDCZoneParent, err := nc.GlobalRoot().Inventory().GetRegions(context.TODO(), getParentName(obj.ParentLabels, "dcregions.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDCRegionZonesResolver]Error getting parent node %s", err) + return vGlobalDCZoneList, nil + } + vDCZoneAllObj, err := vDCZoneParent.GetAllZones(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDCRegionZonesResolver]Error getting Zones objects %s", err) + return vGlobalDCZoneList, nil + } + for _, i := range vDCZoneAllObj { + vDCZone, err := nc.GlobalRoot().Inventory().Regions(getParentName(obj.ParentLabels, "dcregions.global.tsm.tanzu.vmware.com")).GetZones(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDCRegionZonesResolver]Error getting Zones node %q : %s", i.DisplayName(), err) + continue + } + dn := vDCZone.DisplayName() +parentLabels := map[string]interface{}{"dczones.global.tsm.tanzu.vmware.com":dn} +vName := string(vDCZone.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDCZone { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + vGlobalDCZoneList = append(vGlobalDCZoneList, ret) + } + + log.Debugf("[getGlobalDCRegionZonesResolver]Output Zones objects %v", vGlobalDCZoneList) + + return vGlobalDCZoneList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Clusters Node: DCZone PKG: Global +////////////////////////////////////// +func getGlobalDCZoneClustersResolver(obj *model.GlobalDCZone, id *string) ([]*model.GlobalCluster, error) { + log.Debugf("[getGlobalDCZoneClustersResolver]Parent Object %+v", obj) + var vGlobalClusterList []*model.GlobalCluster + if id != nil && *id != "" { + log.Debugf("[getGlobalDCZoneClustersResolver]Id %q", *id) + vClusterParent, err := nc.GlobalRoot().Inventory().Regions(getParentName(obj.ParentLabels, "dcregions.global.tsm.tanzu.vmware.com")).GetZones(context.TODO(), getParentName(obj.ParentLabels, "dczones.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDCZoneClustersResolver]Error getting Clusters %q : %s", *id, err) + return vGlobalClusterList, nil + } + vCluster, err := vClusterParent.GetClusters(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDCZoneClustersResolver]Error getting Clusters %q : %s", *id, err) + return vGlobalClusterList, nil + } + dn := vCluster.DisplayName() +parentLabels := map[string]interface{}{"clusters.global.tsm.tanzu.vmware.com":dn} +vName := string(vCluster.Spec.Name) +vUuid := string(vCluster.Spec.Uuid) +vConnected := bool(vCluster.Spec.Connected) +vIstioState := string(vCluster.Spec.IstioState) +vStatus := string(vCluster.Spec.Status) +vStatusHistory := string(vCluster.Spec.StatusHistory) +vCastatus := string(vCluster.Spec.Castatus) +vCaStatusHistory := string(vCluster.Spec.CaStatusHistory) +vComponentStatuses := string(vCluster.Spec.ComponentStatuses) +vComponentStatusesHistory := string(vCluster.Spec.ComponentStatusesHistory) +vType := string(vCluster.Spec.Type) +vProjectId := string(vCluster.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCluster { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Uuid: &vUuid, + Connected: &vConnected, + IstioState: &vIstioState, + Status: &vStatus, + StatusHistory: &vStatusHistory, + Castatus: &vCastatus, + CaStatusHistory: &vCaStatusHistory, + ComponentStatuses: &vComponentStatuses, + ComponentStatusesHistory: &vComponentStatusesHistory, + Type: &vType, + ProjectId: &vProjectId, + } + vGlobalClusterList = append(vGlobalClusterList, ret) + + log.Debugf("[getGlobalDCZoneClustersResolver]Output Clusters objects %v", vGlobalClusterList) + + return vGlobalClusterList, nil + } + + log.Debug("[getGlobalDCZoneClustersResolver]Id is empty, process all Clusterss") + + vClusterParent, err := nc.GlobalRoot().Inventory().Regions(getParentName(obj.ParentLabels, "dcregions.global.tsm.tanzu.vmware.com")).GetZones(context.TODO(), getParentName(obj.ParentLabels, "dczones.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDCZoneClustersResolver]Error getting parent node %s", err) + return vGlobalClusterList, nil + } + vClusterAllObj, err := vClusterParent.GetAllClusters(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDCZoneClustersResolver]Error getting Clusters %s", err) + return vGlobalClusterList, nil + } + for _, i := range vClusterAllObj { + vClusterParent, err := nc.GlobalRoot().Inventory().Regions(getParentName(obj.ParentLabels, "dcregions.global.tsm.tanzu.vmware.com")).GetZones(context.TODO(), getParentName(obj.ParentLabels, "dczones.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDCZoneClustersResolver]Error getting parent node %s, skipping...", err) + continue + } + vCluster, err := vClusterParent.GetClusters(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDCZoneClustersResolver]Error getting Clusters node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vCluster.DisplayName() +parentLabels := map[string]interface{}{"clusters.global.tsm.tanzu.vmware.com":dn} +vName := string(vCluster.Spec.Name) +vUuid := string(vCluster.Spec.Uuid) +vConnected := bool(vCluster.Spec.Connected) +vIstioState := string(vCluster.Spec.IstioState) +vStatus := string(vCluster.Spec.Status) +vStatusHistory := string(vCluster.Spec.StatusHistory) +vCastatus := string(vCluster.Spec.Castatus) +vCaStatusHistory := string(vCluster.Spec.CaStatusHistory) +vComponentStatuses := string(vCluster.Spec.ComponentStatuses) +vComponentStatusesHistory := string(vCluster.Spec.ComponentStatusesHistory) +vType := string(vCluster.Spec.Type) +vProjectId := string(vCluster.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCluster { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Uuid: &vUuid, + Connected: &vConnected, + IstioState: &vIstioState, + Status: &vStatus, + StatusHistory: &vStatusHistory, + Castatus: &vCastatus, + CaStatusHistory: &vCaStatusHistory, + ComponentStatuses: &vComponentStatuses, + ComponentStatusesHistory: &vComponentStatusesHistory, + Type: &vType, + ProjectId: &vProjectId, + } + vGlobalClusterList = append(vGlobalClusterList, ret) + } + log.Debugf("[getGlobalDCZoneClustersResolver]List of Clusters object %v", vGlobalClusterList) + return vGlobalClusterList, nil +} + +////////////////////////////////////// +// LINK RESOLVER +// FieldName: Service Node: DestinationRule PKG: Global +////////////////////////////////////// +func getGlobalDestinationRuleServiceResolver(obj *model.GlobalDestinationRule) (*model.GlobalService, error) { + log.Debugf("[getGlobalDestinationRuleServiceResolver]Parent Object %+v", obj) + vServiceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), getParentName(obj.ParentLabels, "destinationrules.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceResolver]Error getting parent node %s", err) + return &model.GlobalService{}, nil + } + vService, err := vServiceParent.GetService(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceResolver]Error getting Service object %s", err) + return &model.GlobalService{}, nil + } + dn := vService.DisplayName() +parentLabels := map[string]interface{}{"services.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vService.Spec.Metadata) +vSpec := string(vService.Spec.Spec) +vName := string(vService.Spec.Name) +vNamespace := string(vService.Spec.Namespace) +vApiLink := string(vService.Spec.ApiLink) +vIpAddress := string(vService.Spec.IpAddress) +vAnnotations := string(vService.Spec.Annotations) +vCreationTimestamp := string(vService.Spec.CreationTimestamp) +vLabels := string(vService.Spec.Labels) +vUid := string(vService.Spec.Uid) +vPorts := string(vService.Spec.Ports) +vSelector := string(vService.Spec.Selector) +vType := string(vService.Spec.Type) +vStatus := string(vService.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalService { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Name: &vName, + Namespace: &vNamespace, + ApiLink: &vApiLink, + IpAddress: &vIpAddress, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Uid: &vUid, + Ports: &vPorts, + Selector: &vSelector, + Type: &vType, + Status: &vStatus, + } + log.Debugf("[getGlobalDestinationRuleServiceResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceDeployments Node: DestinationRule PKG: Global +////////////////////////////////////// +func getGlobalDestinationRuleServiceDeploymentsResolver(obj *model.GlobalDestinationRule, id *string) ([]*model.GlobalServiceDeployment, error) { + log.Debugf("[getGlobalDestinationRuleServiceDeploymentsResolver]Parent Object %+v", obj) + var vGlobalServiceDeploymentList []*model.GlobalServiceDeployment + if id != nil && *id != "" { + log.Debugf("[getGlobalDestinationRuleServiceDeploymentsResolver]Id %q", *id) + vServiceDeploymentParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), getParentName(obj.ParentLabels, "destinationrules.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceDeploymentsResolver]Error getting ServiceDeployments %q : %s", *id, err) + return vGlobalServiceDeploymentList, nil + } + vServiceDeployment, err := vServiceDeploymentParent.GetServiceDeployments(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceDeploymentsResolver]Error getting ServiceDeployments %q : %s", *id, err) + return vGlobalServiceDeploymentList, nil + } + dn := vServiceDeployment.DisplayName() +parentLabels := map[string]interface{}{"servicedeployments.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceDeployment.Spec.Metadata) +vSpec := string(vServiceDeployment.Spec.Spec) +vStatus := string(vServiceDeployment.Spec.Status) +vNamespace := string(vServiceDeployment.Spec.Namespace) +vAnnotations := string(vServiceDeployment.Spec.Annotations) +vCreationTimestamp := string(vServiceDeployment.Spec.CreationTimestamp) +vLabels := string(vServiceDeployment.Spec.Labels) +vName := string(vServiceDeployment.Spec.Name) +vApiLink := string(vServiceDeployment.Spec.ApiLink) +vUid := string(vServiceDeployment.Spec.Uid) +vGeneration := int(vServiceDeployment.Spec.Generation) +vSelector := string(vServiceDeployment.Spec.Selector) +vReplicas := int(vServiceDeployment.Spec.Replicas) +vDnsPolicy := string(vServiceDeployment.Spec.DnsPolicy) +vRestartPolicy := string(vServiceDeployment.Spec.RestartPolicy) +vSchedulerName := string(vServiceDeployment.Spec.SchedulerName) +vSecurityContext := string(vServiceDeployment.Spec.SecurityContext) +vServiceAccount := string(vServiceDeployment.Spec.ServiceAccount) +vServiceAccountName := string(vServiceDeployment.Spec.ServiceAccountName) +vTerminationGracePeriodSeconds := int(vServiceDeployment.Spec.TerminationGracePeriodSeconds) +vVolumes := string(vServiceDeployment.Spec.Volumes) +vTemplateLabels := string(vServiceDeployment.Spec.TemplateLabels) +vStatusReplicas := int(vServiceDeployment.Spec.StatusReplicas) +vAvailableReplicas := int(vServiceDeployment.Spec.AvailableReplicas) +vUpdatedReplicas := int(vServiceDeployment.Spec.UpdatedReplicas) +vReadyReplicas := int(vServiceDeployment.Spec.ReadyReplicas) +vObservedGeneration := int(vServiceDeployment.Spec.ObservedGeneration) +vConditions := string(vServiceDeployment.Spec.Conditions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDeployment { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Namespace: &vNamespace, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Name: &vName, + ApiLink: &vApiLink, + Uid: &vUid, + Generation: &vGeneration, + Selector: &vSelector, + Replicas: &vReplicas, + DnsPolicy: &vDnsPolicy, + RestartPolicy: &vRestartPolicy, + SchedulerName: &vSchedulerName, + SecurityContext: &vSecurityContext, + ServiceAccount: &vServiceAccount, + ServiceAccountName: &vServiceAccountName, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Volumes: &vVolumes, + TemplateLabels: &vTemplateLabels, + StatusReplicas: &vStatusReplicas, + AvailableReplicas: &vAvailableReplicas, + UpdatedReplicas: &vUpdatedReplicas, + ReadyReplicas: &vReadyReplicas, + ObservedGeneration: &vObservedGeneration, + Conditions: &vConditions, + } + vGlobalServiceDeploymentList = append(vGlobalServiceDeploymentList, ret) + + log.Debugf("[getGlobalDestinationRuleServiceDeploymentsResolver]Output ServiceDeployments objects %v", vGlobalServiceDeploymentList) + + return vGlobalServiceDeploymentList, nil + } + + log.Debug("[getGlobalDestinationRuleServiceDeploymentsResolver]Id is empty, process all ServiceDeploymentss") + + vServiceDeploymentParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), getParentName(obj.ParentLabels, "destinationrules.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceDeploymentsResolver]Error getting parent node %s", err) + return vGlobalServiceDeploymentList, nil + } + vServiceDeploymentAllObj, err := vServiceDeploymentParent.GetAllServiceDeployments(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceDeploymentsResolver]Error getting ServiceDeployments %s", err) + return vGlobalServiceDeploymentList, nil + } + for _, i := range vServiceDeploymentAllObj { + vServiceDeploymentParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), getParentName(obj.ParentLabels, "destinationrules.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceDeploymentsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceDeployment, err := vServiceDeploymentParent.GetServiceDeployments(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceDeploymentsResolver]Error getting ServiceDeployments node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceDeployment.DisplayName() +parentLabels := map[string]interface{}{"servicedeployments.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceDeployment.Spec.Metadata) +vSpec := string(vServiceDeployment.Spec.Spec) +vStatus := string(vServiceDeployment.Spec.Status) +vNamespace := string(vServiceDeployment.Spec.Namespace) +vAnnotations := string(vServiceDeployment.Spec.Annotations) +vCreationTimestamp := string(vServiceDeployment.Spec.CreationTimestamp) +vLabels := string(vServiceDeployment.Spec.Labels) +vName := string(vServiceDeployment.Spec.Name) +vApiLink := string(vServiceDeployment.Spec.ApiLink) +vUid := string(vServiceDeployment.Spec.Uid) +vGeneration := int(vServiceDeployment.Spec.Generation) +vSelector := string(vServiceDeployment.Spec.Selector) +vReplicas := int(vServiceDeployment.Spec.Replicas) +vDnsPolicy := string(vServiceDeployment.Spec.DnsPolicy) +vRestartPolicy := string(vServiceDeployment.Spec.RestartPolicy) +vSchedulerName := string(vServiceDeployment.Spec.SchedulerName) +vSecurityContext := string(vServiceDeployment.Spec.SecurityContext) +vServiceAccount := string(vServiceDeployment.Spec.ServiceAccount) +vServiceAccountName := string(vServiceDeployment.Spec.ServiceAccountName) +vTerminationGracePeriodSeconds := int(vServiceDeployment.Spec.TerminationGracePeriodSeconds) +vVolumes := string(vServiceDeployment.Spec.Volumes) +vTemplateLabels := string(vServiceDeployment.Spec.TemplateLabels) +vStatusReplicas := int(vServiceDeployment.Spec.StatusReplicas) +vAvailableReplicas := int(vServiceDeployment.Spec.AvailableReplicas) +vUpdatedReplicas := int(vServiceDeployment.Spec.UpdatedReplicas) +vReadyReplicas := int(vServiceDeployment.Spec.ReadyReplicas) +vObservedGeneration := int(vServiceDeployment.Spec.ObservedGeneration) +vConditions := string(vServiceDeployment.Spec.Conditions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDeployment { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Namespace: &vNamespace, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Name: &vName, + ApiLink: &vApiLink, + Uid: &vUid, + Generation: &vGeneration, + Selector: &vSelector, + Replicas: &vReplicas, + DnsPolicy: &vDnsPolicy, + RestartPolicy: &vRestartPolicy, + SchedulerName: &vSchedulerName, + SecurityContext: &vSecurityContext, + ServiceAccount: &vServiceAccount, + ServiceAccountName: &vServiceAccountName, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Volumes: &vVolumes, + TemplateLabels: &vTemplateLabels, + StatusReplicas: &vStatusReplicas, + AvailableReplicas: &vAvailableReplicas, + UpdatedReplicas: &vUpdatedReplicas, + ReadyReplicas: &vReadyReplicas, + ObservedGeneration: &vObservedGeneration, + Conditions: &vConditions, + } + vGlobalServiceDeploymentList = append(vGlobalServiceDeploymentList, ret) + } + log.Debugf("[getGlobalDestinationRuleServiceDeploymentsResolver]List of ServiceDeployments object %v", vGlobalServiceDeploymentList) + return vGlobalServiceDeploymentList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceReplicaSets Node: DestinationRule PKG: Global +////////////////////////////////////// +func getGlobalDestinationRuleServiceReplicaSetsResolver(obj *model.GlobalDestinationRule, id *string) ([]*model.GlobalServiceReplicaSet, error) { + log.Debugf("[getGlobalDestinationRuleServiceReplicaSetsResolver]Parent Object %+v", obj) + var vGlobalServiceReplicaSetList []*model.GlobalServiceReplicaSet + if id != nil && *id != "" { + log.Debugf("[getGlobalDestinationRuleServiceReplicaSetsResolver]Id %q", *id) + vServiceReplicaSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), getParentName(obj.ParentLabels, "destinationrules.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceReplicaSetsResolver]Error getting ServiceReplicaSets %q : %s", *id, err) + return vGlobalServiceReplicaSetList, nil + } + vServiceReplicaSet, err := vServiceReplicaSetParent.GetServiceReplicaSets(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceReplicaSetsResolver]Error getting ServiceReplicaSets %q : %s", *id, err) + return vGlobalServiceReplicaSetList, nil + } + dn := vServiceReplicaSet.DisplayName() +parentLabels := map[string]interface{}{"servicereplicasets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceReplicaSet.Spec.Name) +vMetadata := string(vServiceReplicaSet.Spec.Metadata) +vSpec := string(vServiceReplicaSet.Spec.Spec) +vStatus := string(vServiceReplicaSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceReplicaSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceReplicaSetList = append(vGlobalServiceReplicaSetList, ret) + + log.Debugf("[getGlobalDestinationRuleServiceReplicaSetsResolver]Output ServiceReplicaSets objects %v", vGlobalServiceReplicaSetList) + + return vGlobalServiceReplicaSetList, nil + } + + log.Debug("[getGlobalDestinationRuleServiceReplicaSetsResolver]Id is empty, process all ServiceReplicaSetss") + + vServiceReplicaSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), getParentName(obj.ParentLabels, "destinationrules.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceReplicaSetsResolver]Error getting parent node %s", err) + return vGlobalServiceReplicaSetList, nil + } + vServiceReplicaSetAllObj, err := vServiceReplicaSetParent.GetAllServiceReplicaSets(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceReplicaSetsResolver]Error getting ServiceReplicaSets %s", err) + return vGlobalServiceReplicaSetList, nil + } + for _, i := range vServiceReplicaSetAllObj { + vServiceReplicaSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), getParentName(obj.ParentLabels, "destinationrules.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceReplicaSetsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceReplicaSet, err := vServiceReplicaSetParent.GetServiceReplicaSets(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceReplicaSetsResolver]Error getting ServiceReplicaSets node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceReplicaSet.DisplayName() +parentLabels := map[string]interface{}{"servicereplicasets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceReplicaSet.Spec.Name) +vMetadata := string(vServiceReplicaSet.Spec.Metadata) +vSpec := string(vServiceReplicaSet.Spec.Spec) +vStatus := string(vServiceReplicaSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceReplicaSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceReplicaSetList = append(vGlobalServiceReplicaSetList, ret) + } + log.Debugf("[getGlobalDestinationRuleServiceReplicaSetsResolver]List of ServiceReplicaSets object %v", vGlobalServiceReplicaSetList) + return vGlobalServiceReplicaSetList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceStatefulSets Node: DestinationRule PKG: Global +////////////////////////////////////// +func getGlobalDestinationRuleServiceStatefulSetsResolver(obj *model.GlobalDestinationRule, id *string) ([]*model.GlobalServiceStatefulSet, error) { + log.Debugf("[getGlobalDestinationRuleServiceStatefulSetsResolver]Parent Object %+v", obj) + var vGlobalServiceStatefulSetList []*model.GlobalServiceStatefulSet + if id != nil && *id != "" { + log.Debugf("[getGlobalDestinationRuleServiceStatefulSetsResolver]Id %q", *id) + vServiceStatefulSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), getParentName(obj.ParentLabels, "destinationrules.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceStatefulSetsResolver]Error getting ServiceStatefulSets %q : %s", *id, err) + return vGlobalServiceStatefulSetList, nil + } + vServiceStatefulSet, err := vServiceStatefulSetParent.GetServiceStatefulSets(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceStatefulSetsResolver]Error getting ServiceStatefulSets %q : %s", *id, err) + return vGlobalServiceStatefulSetList, nil + } + dn := vServiceStatefulSet.DisplayName() +parentLabels := map[string]interface{}{"servicestatefulsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceStatefulSet.Spec.Name) +vMetadata := string(vServiceStatefulSet.Spec.Metadata) +vSpec := string(vServiceStatefulSet.Spec.Spec) +vStatus := string(vServiceStatefulSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceStatefulSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceStatefulSetList = append(vGlobalServiceStatefulSetList, ret) + + log.Debugf("[getGlobalDestinationRuleServiceStatefulSetsResolver]Output ServiceStatefulSets objects %v", vGlobalServiceStatefulSetList) + + return vGlobalServiceStatefulSetList, nil + } + + log.Debug("[getGlobalDestinationRuleServiceStatefulSetsResolver]Id is empty, process all ServiceStatefulSetss") + + vServiceStatefulSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), getParentName(obj.ParentLabels, "destinationrules.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceStatefulSetsResolver]Error getting parent node %s", err) + return vGlobalServiceStatefulSetList, nil + } + vServiceStatefulSetAllObj, err := vServiceStatefulSetParent.GetAllServiceStatefulSets(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceStatefulSetsResolver]Error getting ServiceStatefulSets %s", err) + return vGlobalServiceStatefulSetList, nil + } + for _, i := range vServiceStatefulSetAllObj { + vServiceStatefulSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), getParentName(obj.ParentLabels, "destinationrules.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceStatefulSetsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceStatefulSet, err := vServiceStatefulSetParent.GetServiceStatefulSets(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceStatefulSetsResolver]Error getting ServiceStatefulSets node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceStatefulSet.DisplayName() +parentLabels := map[string]interface{}{"servicestatefulsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceStatefulSet.Spec.Name) +vMetadata := string(vServiceStatefulSet.Spec.Metadata) +vSpec := string(vServiceStatefulSet.Spec.Spec) +vStatus := string(vServiceStatefulSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceStatefulSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceStatefulSetList = append(vGlobalServiceStatefulSetList, ret) + } + log.Debugf("[getGlobalDestinationRuleServiceStatefulSetsResolver]List of ServiceStatefulSets object %v", vGlobalServiceStatefulSetList) + return vGlobalServiceStatefulSetList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceDaemonSets Node: DestinationRule PKG: Global +////////////////////////////////////// +func getGlobalDestinationRuleServiceDaemonSetsResolver(obj *model.GlobalDestinationRule, id *string) ([]*model.GlobalServiceDaemonSet, error) { + log.Debugf("[getGlobalDestinationRuleServiceDaemonSetsResolver]Parent Object %+v", obj) + var vGlobalServiceDaemonSetList []*model.GlobalServiceDaemonSet + if id != nil && *id != "" { + log.Debugf("[getGlobalDestinationRuleServiceDaemonSetsResolver]Id %q", *id) + vServiceDaemonSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), getParentName(obj.ParentLabels, "destinationrules.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceDaemonSetsResolver]Error getting ServiceDaemonSets %q : %s", *id, err) + return vGlobalServiceDaemonSetList, nil + } + vServiceDaemonSet, err := vServiceDaemonSetParent.GetServiceDaemonSets(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceDaemonSetsResolver]Error getting ServiceDaemonSets %q : %s", *id, err) + return vGlobalServiceDaemonSetList, nil + } + dn := vServiceDaemonSet.DisplayName() +parentLabels := map[string]interface{}{"servicedaemonsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceDaemonSet.Spec.Name) +vMetadata := string(vServiceDaemonSet.Spec.Metadata) +vSpec := string(vServiceDaemonSet.Spec.Spec) +vStatus := string(vServiceDaemonSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDaemonSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceDaemonSetList = append(vGlobalServiceDaemonSetList, ret) + + log.Debugf("[getGlobalDestinationRuleServiceDaemonSetsResolver]Output ServiceDaemonSets objects %v", vGlobalServiceDaemonSetList) + + return vGlobalServiceDaemonSetList, nil + } + + log.Debug("[getGlobalDestinationRuleServiceDaemonSetsResolver]Id is empty, process all ServiceDaemonSetss") + + vServiceDaemonSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), getParentName(obj.ParentLabels, "destinationrules.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceDaemonSetsResolver]Error getting parent node %s", err) + return vGlobalServiceDaemonSetList, nil + } + vServiceDaemonSetAllObj, err := vServiceDaemonSetParent.GetAllServiceDaemonSets(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceDaemonSetsResolver]Error getting ServiceDaemonSets %s", err) + return vGlobalServiceDaemonSetList, nil + } + for _, i := range vServiceDaemonSetAllObj { + vServiceDaemonSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), getParentName(obj.ParentLabels, "destinationrules.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceDaemonSetsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceDaemonSet, err := vServiceDaemonSetParent.GetServiceDaemonSets(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceDaemonSetsResolver]Error getting ServiceDaemonSets node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceDaemonSet.DisplayName() +parentLabels := map[string]interface{}{"servicedaemonsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceDaemonSet.Spec.Name) +vMetadata := string(vServiceDaemonSet.Spec.Metadata) +vSpec := string(vServiceDaemonSet.Spec.Spec) +vStatus := string(vServiceDaemonSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDaemonSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceDaemonSetList = append(vGlobalServiceDaemonSetList, ret) + } + log.Debugf("[getGlobalDestinationRuleServiceDaemonSetsResolver]List of ServiceDaemonSets object %v", vGlobalServiceDaemonSetList) + return vGlobalServiceDaemonSetList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceJobs Node: DestinationRule PKG: Global +////////////////////////////////////// +func getGlobalDestinationRuleServiceJobsResolver(obj *model.GlobalDestinationRule, id *string) ([]*model.GlobalServiceJob, error) { + log.Debugf("[getGlobalDestinationRuleServiceJobsResolver]Parent Object %+v", obj) + var vGlobalServiceJobList []*model.GlobalServiceJob + if id != nil && *id != "" { + log.Debugf("[getGlobalDestinationRuleServiceJobsResolver]Id %q", *id) + vServiceJobParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), getParentName(obj.ParentLabels, "destinationrules.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceJobsResolver]Error getting ServiceJobs %q : %s", *id, err) + return vGlobalServiceJobList, nil + } + vServiceJob, err := vServiceJobParent.GetServiceJobs(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceJobsResolver]Error getting ServiceJobs %q : %s", *id, err) + return vGlobalServiceJobList, nil + } + dn := vServiceJob.DisplayName() +parentLabels := map[string]interface{}{"servicejobs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceJob.Spec.Name) +vMetadata := string(vServiceJob.Spec.Metadata) +vSpec := string(vServiceJob.Spec.Spec) +vStatus := string(vServiceJob.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceJob { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceJobList = append(vGlobalServiceJobList, ret) + + log.Debugf("[getGlobalDestinationRuleServiceJobsResolver]Output ServiceJobs objects %v", vGlobalServiceJobList) + + return vGlobalServiceJobList, nil + } + + log.Debug("[getGlobalDestinationRuleServiceJobsResolver]Id is empty, process all ServiceJobss") + + vServiceJobParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), getParentName(obj.ParentLabels, "destinationrules.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceJobsResolver]Error getting parent node %s", err) + return vGlobalServiceJobList, nil + } + vServiceJobAllObj, err := vServiceJobParent.GetAllServiceJobs(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceJobsResolver]Error getting ServiceJobs %s", err) + return vGlobalServiceJobList, nil + } + for _, i := range vServiceJobAllObj { + vServiceJobParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), getParentName(obj.ParentLabels, "destinationrules.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceJobsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceJob, err := vServiceJobParent.GetServiceJobs(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDestinationRuleServiceJobsResolver]Error getting ServiceJobs node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceJob.DisplayName() +parentLabels := map[string]interface{}{"servicejobs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceJob.Spec.Name) +vMetadata := string(vServiceJob.Spec.Metadata) +vSpec := string(vServiceJob.Spec.Spec) +vStatus := string(vServiceJob.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceJob { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceJobList = append(vGlobalServiceJobList, ret) + } + log.Debugf("[getGlobalDestinationRuleServiceJobsResolver]List of ServiceJobs object %v", vGlobalServiceJobList) + return vGlobalServiceJobList, nil +} + +////////////////////////////////////// +// LINK RESOLVER +// FieldName: Template Node: Directory PKG: Global +////////////////////////////////////// +func getGlobalDirectoryTemplateResolver(obj *model.GlobalDirectory) (*model.GlobalTemplate, error) { + log.Debugf("[getGlobalDirectoryTemplateResolver]Parent Object %+v", obj) + vTemplateParent, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).Database().GetDirectories(context.TODO(), getParentName(obj.ParentLabels, "directories.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDirectoryTemplateResolver]Error getting parent node %s", err) + return &model.GlobalTemplate{}, nil + } + vTemplate, err := vTemplateParent.GetTemplate(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDirectoryTemplateResolver]Error getting Template object %s", err) + return &model.GlobalTemplate{}, nil + } + dn := vTemplate.DisplayName() +parentLabels := map[string]interface{}{"templates.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalTemplate { + Id: &dn, + ParentLabels: parentLabels, + } + log.Debugf("[getGlobalDirectoryTemplateResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// LINK RESOLVER +// FieldName: Inventory Node: Directory PKG: Global +////////////////////////////////////// +func getGlobalDirectoryInventoryResolver(obj *model.GlobalDirectory) (*model.GlobalInventory, error) { + log.Debugf("[getGlobalDirectoryInventoryResolver]Parent Object %+v", obj) + vInventoryParent, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).Database().GetDirectories(context.TODO(), getParentName(obj.ParentLabels, "directories.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDirectoryInventoryResolver]Error getting parent node %s", err) + return &model.GlobalInventory{}, nil + } + vInventory, err := vInventoryParent.GetInventory(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDirectoryInventoryResolver]Error getting Inventory object %s", err) + return &model.GlobalInventory{}, nil + } + dn := vInventory.DisplayName() +parentLabels := map[string]interface{}{"inventories.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalInventory { + Id: &dn, + ParentLabels: parentLabels, + } + log.Debugf("[getGlobalDirectoryInventoryResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: DnsConfig Node: DNSConfigFolder PKG: Global +////////////////////////////////////// +func getGlobalDNSConfigFolderDnsConfigResolver(obj *model.GlobalDNSConfigFolder, id *string) ([]*model.GlobalDNSConfig, error) { + log.Debugf("[getGlobalDNSConfigFolderDnsConfigResolver]Parent Object %+v", obj) + var vGlobalDNSConfigList []*model.GlobalDNSConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalDNSConfigFolderDnsConfigResolver]Id %q", *id) + vDNSConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).DnsConfigFolder(getParentName(obj.ParentLabels, "dnsconfigfolders.global.tsm.tanzu.vmware.com")).GetDnsConfig(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDNSConfigFolderDnsConfigResolver]Error getting DnsConfig node %q : %s", *id, err) + return vGlobalDNSConfigList, nil + } + dn := vDNSConfig.DisplayName() +parentLabels := map[string]interface{}{"dnsconfigs.global.tsm.tanzu.vmware.com":dn} +vOwnedBy := string(vDNSConfig.Spec.OwnedBy) +vDnsSuffix := string(vDNSConfig.Spec.DnsSuffix) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDNSConfig { + Id: &dn, + ParentLabels: parentLabels, + OwnedBy: &vOwnedBy, + DnsSuffix: &vDnsSuffix, + } + vGlobalDNSConfigList = append(vGlobalDNSConfigList, ret) + + log.Debugf("[getGlobalDNSConfigFolderDnsConfigResolver]Output DnsConfig objects %v", vGlobalDNSConfigList) + + return vGlobalDNSConfigList, nil + } + + log.Debug("[getGlobalDNSConfigFolderDnsConfigResolver]Id is empty, process all DnsConfigs") + + vDNSConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDnsConfigFolder(context.TODO(), getParentName(obj.ParentLabels, "dnsconfigfolders.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDNSConfigFolderDnsConfigResolver]Error getting parent node %s", err) + return vGlobalDNSConfigList, nil + } + vDNSConfigAllObj, err := vDNSConfigParent.GetAllDnsConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDNSConfigFolderDnsConfigResolver]Error getting DnsConfig objects %s", err) + return vGlobalDNSConfigList, nil + } + for _, i := range vDNSConfigAllObj { + vDNSConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).DnsConfigFolder(getParentName(obj.ParentLabels, "dnsconfigfolders.global.tsm.tanzu.vmware.com")).GetDnsConfig(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDNSConfigFolderDnsConfigResolver]Error getting DnsConfig node %q : %s", i.DisplayName(), err) + continue + } + dn := vDNSConfig.DisplayName() +parentLabels := map[string]interface{}{"dnsconfigs.global.tsm.tanzu.vmware.com":dn} +vOwnedBy := string(vDNSConfig.Spec.OwnedBy) +vDnsSuffix := string(vDNSConfig.Spec.DnsSuffix) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDNSConfig { + Id: &dn, + ParentLabels: parentLabels, + OwnedBy: &vOwnedBy, + DnsSuffix: &vDnsSuffix, + } + vGlobalDNSConfigList = append(vGlobalDNSConfigList, ret) + } + + log.Debugf("[getGlobalDNSConfigFolderDnsConfigResolver]Output DnsConfig objects %v", vGlobalDNSConfigList) + + return vGlobalDNSConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: DnsProbeConfigs Node: DNSProbesConfigFolder PKG: Global +////////////////////////////////////// +func getGlobalDNSProbesConfigFolderDnsProbeConfigsResolver(obj *model.GlobalDNSProbesConfigFolder, id *string) ([]*model.GlobalDNSProbeConfig, error) { + log.Debugf("[getGlobalDNSProbesConfigFolderDnsProbeConfigsResolver]Parent Object %+v", obj) + var vGlobalDNSProbeConfigList []*model.GlobalDNSProbeConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalDNSProbesConfigFolderDnsProbeConfigsResolver]Id %q", *id) + vDNSProbeConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).DnsProbesConfigFolder().GetDnsProbeConfigs(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDNSProbesConfigFolderDnsProbeConfigsResolver]Error getting DnsProbeConfigs node %q : %s", *id, err) + return vGlobalDNSProbeConfigList, nil + } + dn := vDNSProbeConfig.DisplayName() +parentLabels := map[string]interface{}{"dnsprobeconfigs.global.tsm.tanzu.vmware.com":dn} +vDomain := string(vDNSProbeConfig.Spec.Domain) +vCreateTimestamp := string(vDNSProbeConfig.Spec.CreateTimestamp) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDNSProbeConfig { + Id: &dn, + ParentLabels: parentLabels, + Domain: &vDomain, + CreateTimestamp: &vCreateTimestamp, + } + vGlobalDNSProbeConfigList = append(vGlobalDNSProbeConfigList, ret) + + log.Debugf("[getGlobalDNSProbesConfigFolderDnsProbeConfigsResolver]Output DnsProbeConfigs objects %v", vGlobalDNSProbeConfigList) + + return vGlobalDNSProbeConfigList, nil + } + + log.Debug("[getGlobalDNSProbesConfigFolderDnsProbeConfigsResolver]Id is empty, process all DnsProbeConfigss") + + vDNSProbeConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDnsProbesConfigFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDNSProbesConfigFolderDnsProbeConfigsResolver]Error getting parent node %s", err) + return vGlobalDNSProbeConfigList, nil + } + vDNSProbeConfigAllObj, err := vDNSProbeConfigParent.GetAllDnsProbeConfigs(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDNSProbesConfigFolderDnsProbeConfigsResolver]Error getting DnsProbeConfigs objects %s", err) + return vGlobalDNSProbeConfigList, nil + } + for _, i := range vDNSProbeConfigAllObj { + vDNSProbeConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).DnsProbesConfigFolder().GetDnsProbeConfigs(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDNSProbesConfigFolderDnsProbeConfigsResolver]Error getting DnsProbeConfigs node %q : %s", i.DisplayName(), err) + continue + } + dn := vDNSProbeConfig.DisplayName() +parentLabels := map[string]interface{}{"dnsprobeconfigs.global.tsm.tanzu.vmware.com":dn} +vDomain := string(vDNSProbeConfig.Spec.Domain) +vCreateTimestamp := string(vDNSProbeConfig.Spec.CreateTimestamp) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDNSProbeConfig { + Id: &dn, + ParentLabels: parentLabels, + Domain: &vDomain, + CreateTimestamp: &vCreateTimestamp, + } + vGlobalDNSProbeConfigList = append(vGlobalDNSProbeConfigList, ret) + } + + log.Debugf("[getGlobalDNSProbesConfigFolderDnsProbeConfigsResolver]Output DnsProbeConfigs objects %v", vGlobalDNSProbeConfigList) + + return vGlobalDNSProbeConfigList, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: LabelConfig Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigLabelConfigResolver(obj *model.GlobalDomainConfig, id *string) (*model.GlobalLabelConfig, error) { + log.Debugf("[getGlobalDomainConfigLabelConfigResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigLabelConfigResolver]Id %q", *id) + vLabelConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetLabelConfig(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigLabelConfigResolver]Error getting LabelConfig node %q : %s", *id, err) + return &model.GlobalLabelConfig{}, nil + } + dn := vLabelConfig.DisplayName() +parentLabels := map[string]interface{}{"labelconfigs.global.tsm.tanzu.vmware.com":dn} +vLabels := string(vLabelConfig.Spec.Labels) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalLabelConfig { + Id: &dn, + ParentLabels: parentLabels, + Labels: &vLabels, + } + + log.Debugf("[getGlobalDomainConfigLabelConfigResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalDomainConfigLabelConfigResolver]Id is empty, process all LabelConfigs") + vLabelConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigLabelConfigResolver]Failed to get parent node %s", err) + return &model.GlobalLabelConfig{}, nil + } + vLabelConfig, err := vLabelConfigParent.GetLabelConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigLabelConfigResolver]Error getting LabelConfig node %s", err) + return &model.GlobalLabelConfig{}, nil + } + dn := vLabelConfig.DisplayName() +parentLabels := map[string]interface{}{"labelconfigs.global.tsm.tanzu.vmware.com":dn} +vLabels := string(vLabelConfig.Spec.Labels) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalLabelConfig { + Id: &dn, + ParentLabels: parentLabels, + Labels: &vLabels, + } + + log.Debugf("[getGlobalDomainConfigLabelConfigResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Policy Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigPolicyResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalPolicyConfig, error) { + log.Debugf("[getGlobalDomainConfigPolicyResolver]Parent Object %+v", obj) + var vGlobalPolicyConfigList []*model.GlobalPolicyConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigPolicyResolver]Id %q", *id) + vPolicyConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetPolicy(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigPolicyResolver]Error getting Policy node %q : %s", *id, err) + return vGlobalPolicyConfigList, nil + } + dn := vPolicyConfig.DisplayName() +parentLabels := map[string]interface{}{"policyconfigs.global.tsm.tanzu.vmware.com":dn} +vSrc := string(vPolicyConfig.Spec.Src) +vDst := string(vPolicyConfig.Spec.Dst) +vAction := string(vPolicyConfig.Spec.Action) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalPolicyConfig { + Id: &dn, + ParentLabels: parentLabels, + Src: &vSrc, + Dst: &vDst, + Action: &vAction, + } + vGlobalPolicyConfigList = append(vGlobalPolicyConfigList, ret) + + log.Debugf("[getGlobalDomainConfigPolicyResolver]Output Policy objects %v", vGlobalPolicyConfigList) + + return vGlobalPolicyConfigList, nil + } + + log.Debug("[getGlobalDomainConfigPolicyResolver]Id is empty, process all Policys") + + vPolicyConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigPolicyResolver]Error getting parent node %s", err) + return vGlobalPolicyConfigList, nil + } + vPolicyConfigAllObj, err := vPolicyConfigParent.GetAllPolicy(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigPolicyResolver]Error getting Policy objects %s", err) + return vGlobalPolicyConfigList, nil + } + for _, i := range vPolicyConfigAllObj { + vPolicyConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetPolicy(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigPolicyResolver]Error getting Policy node %q : %s", i.DisplayName(), err) + continue + } + dn := vPolicyConfig.DisplayName() +parentLabels := map[string]interface{}{"policyconfigs.global.tsm.tanzu.vmware.com":dn} +vSrc := string(vPolicyConfig.Spec.Src) +vDst := string(vPolicyConfig.Spec.Dst) +vAction := string(vPolicyConfig.Spec.Action) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalPolicyConfig { + Id: &dn, + ParentLabels: parentLabels, + Src: &vSrc, + Dst: &vDst, + Action: &vAction, + } + vGlobalPolicyConfigList = append(vGlobalPolicyConfigList, ret) + } + + log.Debugf("[getGlobalDomainConfigPolicyResolver]Output Policy objects %v", vGlobalPolicyConfigList) + + return vGlobalPolicyConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: NetworkAttachmentDefinition Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigNetworkAttachmentDefinitionResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalNetworkAttachmentDefinitionConfig, error) { + log.Debugf("[getGlobalDomainConfigNetworkAttachmentDefinitionResolver]Parent Object %+v", obj) + var vGlobalNetworkAttachmentDefinitionConfigList []*model.GlobalNetworkAttachmentDefinitionConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigNetworkAttachmentDefinitionResolver]Id %q", *id) + vNetworkAttachmentDefinitionConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetNetworkAttachmentDefinition(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigNetworkAttachmentDefinitionResolver]Error getting NetworkAttachmentDefinition node %q : %s", *id, err) + return vGlobalNetworkAttachmentDefinitionConfigList, nil + } + dn := vNetworkAttachmentDefinitionConfig.DisplayName() +parentLabels := map[string]interface{}{"networkattachmentdefinitionconfigs.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vNetworkAttachmentDefinitionConfig.Spec.Metadata) +vName := string(vNetworkAttachmentDefinitionConfig.Spec.Name) +vNamespace := string(vNetworkAttachmentDefinitionConfig.Spec.Namespace) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNetworkAttachmentDefinitionConfig { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Name: &vName, + Namespace: &vNamespace, + } + vGlobalNetworkAttachmentDefinitionConfigList = append(vGlobalNetworkAttachmentDefinitionConfigList, ret) + + log.Debugf("[getGlobalDomainConfigNetworkAttachmentDefinitionResolver]Output NetworkAttachmentDefinition objects %v", vGlobalNetworkAttachmentDefinitionConfigList) + + return vGlobalNetworkAttachmentDefinitionConfigList, nil + } + + log.Debug("[getGlobalDomainConfigNetworkAttachmentDefinitionResolver]Id is empty, process all NetworkAttachmentDefinitions") + + vNetworkAttachmentDefinitionConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigNetworkAttachmentDefinitionResolver]Error getting parent node %s", err) + return vGlobalNetworkAttachmentDefinitionConfigList, nil + } + vNetworkAttachmentDefinitionConfigAllObj, err := vNetworkAttachmentDefinitionConfigParent.GetAllNetworkAttachmentDefinition(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigNetworkAttachmentDefinitionResolver]Error getting NetworkAttachmentDefinition objects %s", err) + return vGlobalNetworkAttachmentDefinitionConfigList, nil + } + for _, i := range vNetworkAttachmentDefinitionConfigAllObj { + vNetworkAttachmentDefinitionConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetNetworkAttachmentDefinition(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigNetworkAttachmentDefinitionResolver]Error getting NetworkAttachmentDefinition node %q : %s", i.DisplayName(), err) + continue + } + dn := vNetworkAttachmentDefinitionConfig.DisplayName() +parentLabels := map[string]interface{}{"networkattachmentdefinitionconfigs.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vNetworkAttachmentDefinitionConfig.Spec.Metadata) +vName := string(vNetworkAttachmentDefinitionConfig.Spec.Name) +vNamespace := string(vNetworkAttachmentDefinitionConfig.Spec.Namespace) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNetworkAttachmentDefinitionConfig { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Name: &vName, + Namespace: &vNamespace, + } + vGlobalNetworkAttachmentDefinitionConfigList = append(vGlobalNetworkAttachmentDefinitionConfigList, ret) + } + + log.Debugf("[getGlobalDomainConfigNetworkAttachmentDefinitionResolver]Output NetworkAttachmentDefinition objects %v", vGlobalNetworkAttachmentDefinitionConfigList) + + return vGlobalNetworkAttachmentDefinitionConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Services Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigServicesResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalServiceConfig, error) { + log.Debugf("[getGlobalDomainConfigServicesResolver]Parent Object %+v", obj) + var vGlobalServiceConfigList []*model.GlobalServiceConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigServicesResolver]Id %q", *id) + vServiceConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigServicesResolver]Error getting Services node %q : %s", *id, err) + return vGlobalServiceConfigList, nil + } + dn := vServiceConfig.DisplayName() +parentLabels := map[string]interface{}{"serviceconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceConfig.Spec.Name) +vOwnedBy := string(vServiceConfig.Spec.OwnedBy) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + OwnedBy: &vOwnedBy, + } + vGlobalServiceConfigList = append(vGlobalServiceConfigList, ret) + + log.Debugf("[getGlobalDomainConfigServicesResolver]Output Services objects %v", vGlobalServiceConfigList) + + return vGlobalServiceConfigList, nil + } + + log.Debug("[getGlobalDomainConfigServicesResolver]Id is empty, process all Servicess") + + vServiceConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigServicesResolver]Error getting parent node %s", err) + return vGlobalServiceConfigList, nil + } + vServiceConfigAllObj, err := vServiceConfigParent.GetAllServices(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigServicesResolver]Error getting Services objects %s", err) + return vGlobalServiceConfigList, nil + } + for _, i := range vServiceConfigAllObj { + vServiceConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigServicesResolver]Error getting Services node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceConfig.DisplayName() +parentLabels := map[string]interface{}{"serviceconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceConfig.Spec.Name) +vOwnedBy := string(vServiceConfig.Spec.OwnedBy) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + OwnedBy: &vOwnedBy, + } + vGlobalServiceConfigList = append(vGlobalServiceConfigList, ret) + } + + log.Debugf("[getGlobalDomainConfigServicesResolver]Output Services objects %v", vGlobalServiceConfigList) + + return vGlobalServiceConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceEntries Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigServiceEntriesResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalServiceEntryConfig, error) { + log.Debugf("[getGlobalDomainConfigServiceEntriesResolver]Parent Object %+v", obj) + var vGlobalServiceEntryConfigList []*model.GlobalServiceEntryConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigServiceEntriesResolver]Id %q", *id) + vServiceEntryConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetServiceEntries(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigServiceEntriesResolver]Error getting ServiceEntries node %q : %s", *id, err) + return vGlobalServiceEntryConfigList, nil + } + dn := vServiceEntryConfig.DisplayName() +parentLabels := map[string]interface{}{"serviceentryconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceEntryConfig.Spec.Name) +vOwnedBy := string(vServiceEntryConfig.Spec.OwnedBy) +vService := string(vServiceEntryConfig.Spec.Service) +vServiceFQDN := string(vServiceEntryConfig.Spec.ServiceFQDN) +vDescription := string(vServiceEntryConfig.Spec.Description) +vServicePortList := string(vServiceEntryConfig.Spec.ServicePortList) +Tags, _ := json.Marshal(vServiceEntryConfig.Spec.Tags) +TagsData := string(Tags) +vLabels := string(vServiceEntryConfig.Spec.Labels) +Endpoints, _ := json.Marshal(vServiceEntryConfig.Spec.Endpoints) +EndpointsData := string(Endpoints) +vEndpointList := string(vServiceEntryConfig.Spec.EndpointList) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceEntryConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + OwnedBy: &vOwnedBy, + Service: &vService, + ServiceFQDN: &vServiceFQDN, + Description: &vDescription, + ServicePortList: &vServicePortList, + Tags: &TagsData, + Labels: &vLabels, + Endpoints: &EndpointsData, + EndpointList: &vEndpointList, + } + vGlobalServiceEntryConfigList = append(vGlobalServiceEntryConfigList, ret) + + log.Debugf("[getGlobalDomainConfigServiceEntriesResolver]Output ServiceEntries objects %v", vGlobalServiceEntryConfigList) + + return vGlobalServiceEntryConfigList, nil + } + + log.Debug("[getGlobalDomainConfigServiceEntriesResolver]Id is empty, process all ServiceEntriess") + + vServiceEntryConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigServiceEntriesResolver]Error getting parent node %s", err) + return vGlobalServiceEntryConfigList, nil + } + vServiceEntryConfigAllObj, err := vServiceEntryConfigParent.GetAllServiceEntries(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigServiceEntriesResolver]Error getting ServiceEntries objects %s", err) + return vGlobalServiceEntryConfigList, nil + } + for _, i := range vServiceEntryConfigAllObj { + vServiceEntryConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetServiceEntries(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigServiceEntriesResolver]Error getting ServiceEntries node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceEntryConfig.DisplayName() +parentLabels := map[string]interface{}{"serviceentryconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceEntryConfig.Spec.Name) +vOwnedBy := string(vServiceEntryConfig.Spec.OwnedBy) +vService := string(vServiceEntryConfig.Spec.Service) +vServiceFQDN := string(vServiceEntryConfig.Spec.ServiceFQDN) +vDescription := string(vServiceEntryConfig.Spec.Description) +vServicePortList := string(vServiceEntryConfig.Spec.ServicePortList) +Tags, _ := json.Marshal(vServiceEntryConfig.Spec.Tags) +TagsData := string(Tags) +vLabels := string(vServiceEntryConfig.Spec.Labels) +Endpoints, _ := json.Marshal(vServiceEntryConfig.Spec.Endpoints) +EndpointsData := string(Endpoints) +vEndpointList := string(vServiceEntryConfig.Spec.EndpointList) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceEntryConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + OwnedBy: &vOwnedBy, + Service: &vService, + ServiceFQDN: &vServiceFQDN, + Description: &vDescription, + ServicePortList: &vServicePortList, + Tags: &TagsData, + Labels: &vLabels, + Endpoints: &EndpointsData, + EndpointList: &vEndpointList, + } + vGlobalServiceEntryConfigList = append(vGlobalServiceEntryConfigList, ret) + } + + log.Debugf("[getGlobalDomainConfigServiceEntriesResolver]Output ServiceEntries objects %v", vGlobalServiceEntryConfigList) + + return vGlobalServiceEntryConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: GatewayConfig Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigGatewayConfigResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalGatewayConfig, error) { + log.Debugf("[getGlobalDomainConfigGatewayConfigResolver]Parent Object %+v", obj) + var vGlobalGatewayConfigList []*model.GlobalGatewayConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigGatewayConfigResolver]Id %q", *id) + vGatewayConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetGatewayConfig(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigGatewayConfigResolver]Error getting GatewayConfig node %q : %s", *id, err) + return vGlobalGatewayConfigList, nil + } + dn := vGatewayConfig.DisplayName() +parentLabels := map[string]interface{}{"gatewayconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vGatewayConfig.Spec.Name) +vOwnedBy := string(vGatewayConfig.Spec.OwnedBy) +vLabels := string(vGatewayConfig.Spec.Labels) +vListeners := string(vGatewayConfig.Spec.Listeners) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGatewayConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + OwnedBy: &vOwnedBy, + Labels: &vLabels, + Listeners: &vListeners, + } + vGlobalGatewayConfigList = append(vGlobalGatewayConfigList, ret) + + log.Debugf("[getGlobalDomainConfigGatewayConfigResolver]Output GatewayConfig objects %v", vGlobalGatewayConfigList) + + return vGlobalGatewayConfigList, nil + } + + log.Debug("[getGlobalDomainConfigGatewayConfigResolver]Id is empty, process all GatewayConfigs") + + vGatewayConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigGatewayConfigResolver]Error getting parent node %s", err) + return vGlobalGatewayConfigList, nil + } + vGatewayConfigAllObj, err := vGatewayConfigParent.GetAllGatewayConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigGatewayConfigResolver]Error getting GatewayConfig objects %s", err) + return vGlobalGatewayConfigList, nil + } + for _, i := range vGatewayConfigAllObj { + vGatewayConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetGatewayConfig(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigGatewayConfigResolver]Error getting GatewayConfig node %q : %s", i.DisplayName(), err) + continue + } + dn := vGatewayConfig.DisplayName() +parentLabels := map[string]interface{}{"gatewayconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vGatewayConfig.Spec.Name) +vOwnedBy := string(vGatewayConfig.Spec.OwnedBy) +vLabels := string(vGatewayConfig.Spec.Labels) +vListeners := string(vGatewayConfig.Spec.Listeners) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGatewayConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + OwnedBy: &vOwnedBy, + Labels: &vLabels, + Listeners: &vListeners, + } + vGlobalGatewayConfigList = append(vGlobalGatewayConfigList, ret) + } + + log.Debugf("[getGlobalDomainConfigGatewayConfigResolver]Output GatewayConfig objects %v", vGlobalGatewayConfigList) + + return vGlobalGatewayConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Autoscalers Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigAutoscalersResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalAutoscalerConfig, error) { + log.Debugf("[getGlobalDomainConfigAutoscalersResolver]Parent Object %+v", obj) + var vGlobalAutoscalerConfigList []*model.GlobalAutoscalerConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigAutoscalersResolver]Id %q", *id) + vAutoscalerConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetAutoscalers(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigAutoscalersResolver]Error getting Autoscalers node %q : %s", *id, err) + return vGlobalAutoscalerConfigList, nil + } + dn := vAutoscalerConfig.DisplayName() +parentLabels := map[string]interface{}{"autoscalerconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vAutoscalerConfig.Spec.Name) +vConfigSource := string(vAutoscalerConfig.Spec.ConfigSource) +vDesiredState := string(vAutoscalerConfig.Spec.DesiredState) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAutoscalerConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + ConfigSource: &vConfigSource, + DesiredState: &vDesiredState, + } + vGlobalAutoscalerConfigList = append(vGlobalAutoscalerConfigList, ret) + + log.Debugf("[getGlobalDomainConfigAutoscalersResolver]Output Autoscalers objects %v", vGlobalAutoscalerConfigList) + + return vGlobalAutoscalerConfigList, nil + } + + log.Debug("[getGlobalDomainConfigAutoscalersResolver]Id is empty, process all Autoscalerss") + + vAutoscalerConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigAutoscalersResolver]Error getting parent node %s", err) + return vGlobalAutoscalerConfigList, nil + } + vAutoscalerConfigAllObj, err := vAutoscalerConfigParent.GetAllAutoscalers(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigAutoscalersResolver]Error getting Autoscalers objects %s", err) + return vGlobalAutoscalerConfigList, nil + } + for _, i := range vAutoscalerConfigAllObj { + vAutoscalerConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetAutoscalers(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigAutoscalersResolver]Error getting Autoscalers node %q : %s", i.DisplayName(), err) + continue + } + dn := vAutoscalerConfig.DisplayName() +parentLabels := map[string]interface{}{"autoscalerconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vAutoscalerConfig.Spec.Name) +vConfigSource := string(vAutoscalerConfig.Spec.ConfigSource) +vDesiredState := string(vAutoscalerConfig.Spec.DesiredState) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAutoscalerConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + ConfigSource: &vConfigSource, + DesiredState: &vDesiredState, + } + vGlobalAutoscalerConfigList = append(vGlobalAutoscalerConfigList, ret) + } + + log.Debugf("[getGlobalDomainConfigAutoscalersResolver]Output Autoscalers objects %v", vGlobalAutoscalerConfigList) + + return vGlobalAutoscalerConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: HostConfigV2 Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigHostConfigV2Resolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalHostConfigV2, error) { + log.Debugf("[getGlobalDomainConfigHostConfigV2Resolver]Parent Object %+v", obj) + var vGlobalHostConfigV2List []*model.GlobalHostConfigV2 + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigHostConfigV2Resolver]Id %q", *id) + vHostConfigV2, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetHostConfigV2(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigHostConfigV2Resolver]Error getting HostConfigV2 node %q : %s", *id, err) + return vGlobalHostConfigV2List, nil + } + dn := vHostConfigV2.DisplayName() +parentLabels := map[string]interface{}{"hostconfigv2s.global.tsm.tanzu.vmware.com":dn} +vName := string(vHostConfigV2.Spec.Name) +vHost := string(vHostConfigV2.Spec.Host) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalHostConfigV2 { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Host: &vHost, + } + vGlobalHostConfigV2List = append(vGlobalHostConfigV2List, ret) + + log.Debugf("[getGlobalDomainConfigHostConfigV2Resolver]Output HostConfigV2 objects %v", vGlobalHostConfigV2List) + + return vGlobalHostConfigV2List, nil + } + + log.Debug("[getGlobalDomainConfigHostConfigV2Resolver]Id is empty, process all HostConfigV2s") + + vHostConfigV2Parent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigHostConfigV2Resolver]Error getting parent node %s", err) + return vGlobalHostConfigV2List, nil + } + vHostConfigV2AllObj, err := vHostConfigV2Parent.GetAllHostConfigV2(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigHostConfigV2Resolver]Error getting HostConfigV2 objects %s", err) + return vGlobalHostConfigV2List, nil + } + for _, i := range vHostConfigV2AllObj { + vHostConfigV2, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetHostConfigV2(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigHostConfigV2Resolver]Error getting HostConfigV2 node %q : %s", i.DisplayName(), err) + continue + } + dn := vHostConfigV2.DisplayName() +parentLabels := map[string]interface{}{"hostconfigv2s.global.tsm.tanzu.vmware.com":dn} +vName := string(vHostConfigV2.Spec.Name) +vHost := string(vHostConfigV2.Spec.Host) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalHostConfigV2 { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Host: &vHost, + } + vGlobalHostConfigV2List = append(vGlobalHostConfigV2List, ret) + } + + log.Debugf("[getGlobalDomainConfigHostConfigV2Resolver]Output HostConfigV2 objects %v", vGlobalHostConfigV2List) + + return vGlobalHostConfigV2List, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: InboundAuthenticationConfig Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigInboundAuthenticationConfigResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalInboundAuthenticationConfig, error) { + log.Debugf("[getGlobalDomainConfigInboundAuthenticationConfigResolver]Parent Object %+v", obj) + var vGlobalInboundAuthenticationConfigList []*model.GlobalInboundAuthenticationConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigInboundAuthenticationConfigResolver]Id %q", *id) + vInboundAuthenticationConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetInboundAuthenticationConfig(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigInboundAuthenticationConfigResolver]Error getting InboundAuthenticationConfig node %q : %s", *id, err) + return vGlobalInboundAuthenticationConfigList, nil + } + dn := vInboundAuthenticationConfig.DisplayName() +parentLabels := map[string]interface{}{"inboundauthenticationconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vInboundAuthenticationConfig.Spec.Name) +vOwnedBy := string(vInboundAuthenticationConfig.Spec.OwnedBy) +vMode := string(vInboundAuthenticationConfig.Spec.Mode) +vPorts := string(vInboundAuthenticationConfig.Spec.Ports) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalInboundAuthenticationConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + OwnedBy: &vOwnedBy, + Mode: &vMode, + Ports: &vPorts, + } + vGlobalInboundAuthenticationConfigList = append(vGlobalInboundAuthenticationConfigList, ret) + + log.Debugf("[getGlobalDomainConfigInboundAuthenticationConfigResolver]Output InboundAuthenticationConfig objects %v", vGlobalInboundAuthenticationConfigList) + + return vGlobalInboundAuthenticationConfigList, nil + } + + log.Debug("[getGlobalDomainConfigInboundAuthenticationConfigResolver]Id is empty, process all InboundAuthenticationConfigs") + + vInboundAuthenticationConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigInboundAuthenticationConfigResolver]Error getting parent node %s", err) + return vGlobalInboundAuthenticationConfigList, nil + } + vInboundAuthenticationConfigAllObj, err := vInboundAuthenticationConfigParent.GetAllInboundAuthenticationConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigInboundAuthenticationConfigResolver]Error getting InboundAuthenticationConfig objects %s", err) + return vGlobalInboundAuthenticationConfigList, nil + } + for _, i := range vInboundAuthenticationConfigAllObj { + vInboundAuthenticationConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetInboundAuthenticationConfig(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigInboundAuthenticationConfigResolver]Error getting InboundAuthenticationConfig node %q : %s", i.DisplayName(), err) + continue + } + dn := vInboundAuthenticationConfig.DisplayName() +parentLabels := map[string]interface{}{"inboundauthenticationconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vInboundAuthenticationConfig.Spec.Name) +vOwnedBy := string(vInboundAuthenticationConfig.Spec.OwnedBy) +vMode := string(vInboundAuthenticationConfig.Spec.Mode) +vPorts := string(vInboundAuthenticationConfig.Spec.Ports) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalInboundAuthenticationConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + OwnedBy: &vOwnedBy, + Mode: &vMode, + Ports: &vPorts, + } + vGlobalInboundAuthenticationConfigList = append(vGlobalInboundAuthenticationConfigList, ret) + } + + log.Debugf("[getGlobalDomainConfigInboundAuthenticationConfigResolver]Output InboundAuthenticationConfig objects %v", vGlobalInboundAuthenticationConfigList) + + return vGlobalInboundAuthenticationConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Slos Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigSlosResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalSloConfig, error) { + log.Debugf("[getGlobalDomainConfigSlosResolver]Parent Object %+v", obj) + var vGlobalSloConfigList []*model.GlobalSloConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigSlosResolver]Id %q", *id) + vSloConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetSlos(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigSlosResolver]Error getting Slos node %q : %s", *id, err) + return vGlobalSloConfigList, nil + } + dn := vSloConfig.DisplayName() +parentLabels := map[string]interface{}{"sloconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vSloConfig.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSloConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + vGlobalSloConfigList = append(vGlobalSloConfigList, ret) + + log.Debugf("[getGlobalDomainConfigSlosResolver]Output Slos objects %v", vGlobalSloConfigList) + + return vGlobalSloConfigList, nil + } + + log.Debug("[getGlobalDomainConfigSlosResolver]Id is empty, process all Sloss") + + vSloConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigSlosResolver]Error getting parent node %s", err) + return vGlobalSloConfigList, nil + } + vSloConfigAllObj, err := vSloConfigParent.GetAllSlos(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigSlosResolver]Error getting Slos objects %s", err) + return vGlobalSloConfigList, nil + } + for _, i := range vSloConfigAllObj { + vSloConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetSlos(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigSlosResolver]Error getting Slos node %q : %s", i.DisplayName(), err) + continue + } + dn := vSloConfig.DisplayName() +parentLabels := map[string]interface{}{"sloconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vSloConfig.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSloConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + vGlobalSloConfigList = append(vGlobalSloConfigList, ret) + } + + log.Debugf("[getGlobalDomainConfigSlosResolver]Output Slos objects %v", vGlobalSloConfigList) + + return vGlobalSloConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Secrets Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigSecretsResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalSecretRTConfig, error) { + log.Debugf("[getGlobalDomainConfigSecretsResolver]Parent Object %+v", obj) + var vGlobalSecretRTConfigList []*model.GlobalSecretRTConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigSecretsResolver]Id %q", *id) + vSecretRTConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetSecrets(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigSecretsResolver]Error getting Secrets node %q : %s", *id, err) + return vGlobalSecretRTConfigList, nil + } + dn := vSecretRTConfig.DisplayName() +parentLabels := map[string]interface{}{"secretrtconfigs.global.tsm.tanzu.vmware.com":dn} +vType := string(vSecretRTConfig.Spec.Type) +vData := string(vSecretRTConfig.Spec.Data) +vIsBase64Encoded := bool(vSecretRTConfig.Spec.IsBase64Encoded) +vOwnedBy := string(vSecretRTConfig.Spec.OwnedBy) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSecretRTConfig { + Id: &dn, + ParentLabels: parentLabels, + Type: &vType, + Data: &vData, + IsBase64Encoded: &vIsBase64Encoded, + OwnedBy: &vOwnedBy, + } + vGlobalSecretRTConfigList = append(vGlobalSecretRTConfigList, ret) + + log.Debugf("[getGlobalDomainConfigSecretsResolver]Output Secrets objects %v", vGlobalSecretRTConfigList) + + return vGlobalSecretRTConfigList, nil + } + + log.Debug("[getGlobalDomainConfigSecretsResolver]Id is empty, process all Secretss") + + vSecretRTConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigSecretsResolver]Error getting parent node %s", err) + return vGlobalSecretRTConfigList, nil + } + vSecretRTConfigAllObj, err := vSecretRTConfigParent.GetAllSecrets(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigSecretsResolver]Error getting Secrets objects %s", err) + return vGlobalSecretRTConfigList, nil + } + for _, i := range vSecretRTConfigAllObj { + vSecretRTConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetSecrets(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigSecretsResolver]Error getting Secrets node %q : %s", i.DisplayName(), err) + continue + } + dn := vSecretRTConfig.DisplayName() +parentLabels := map[string]interface{}{"secretrtconfigs.global.tsm.tanzu.vmware.com":dn} +vType := string(vSecretRTConfig.Spec.Type) +vData := string(vSecretRTConfig.Spec.Data) +vIsBase64Encoded := bool(vSecretRTConfig.Spec.IsBase64Encoded) +vOwnedBy := string(vSecretRTConfig.Spec.OwnedBy) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSecretRTConfig { + Id: &dn, + ParentLabels: parentLabels, + Type: &vType, + Data: &vData, + IsBase64Encoded: &vIsBase64Encoded, + OwnedBy: &vOwnedBy, + } + vGlobalSecretRTConfigList = append(vGlobalSecretRTConfigList, ret) + } + + log.Debugf("[getGlobalDomainConfigSecretsResolver]Output Secrets objects %v", vGlobalSecretRTConfigList) + + return vGlobalSecretRTConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ExternalServices Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigExternalServicesResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalExternalServicesRT, error) { + log.Debugf("[getGlobalDomainConfigExternalServicesResolver]Parent Object %+v", obj) + var vGlobalExternalServicesRTList []*model.GlobalExternalServicesRT + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigExternalServicesResolver]Id %q", *id) + vExternalServicesRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetExternalServices(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigExternalServicesResolver]Error getting ExternalServices node %q : %s", *id, err) + return vGlobalExternalServicesRTList, nil + } + dn := vExternalServicesRT.DisplayName() +parentLabels := map[string]interface{}{"externalservicesrts.global.tsm.tanzu.vmware.com":dn} +vOwnedBy := string(vExternalServicesRT.Spec.OwnedBy) +vCreatedByGNS := string(vExternalServicesRT.Spec.CreatedByGNS) +vCreatedByESName := string(vExternalServicesRT.Spec.CreatedByESName) +vCreatedBySDFolder := string(vExternalServicesRT.Spec.CreatedBySDFolder) +vCreatedBySDEntry := string(vExternalServicesRT.Spec.CreatedBySDEntry) +vServicePort := int(vExternalServicesRT.Spec.ServicePort) +vProtocol := string(vExternalServicesRT.Spec.Protocol) +vHostname := string(vExternalServicesRT.Spec.Hostname) +vPort := int(vExternalServicesRT.Spec.Port) +vServerCertificate := string(vExternalServicesRT.Spec.ServerCertificate) +vHostnameAlias := string(vExternalServicesRT.Spec.HostnameAlias) +EndpointList, _ := json.Marshal(vExternalServicesRT.Spec.EndpointList) +EndpointListData := string(EndpointList) +EgressGateways, _ := json.Marshal(vExternalServicesRT.Spec.EgressGateways) +EgressGatewaysData := string(EgressGateways) +vClientCertificate := string(vExternalServicesRT.Spec.ClientCertificate) +vClientKey := string(vExternalServicesRT.Spec.ClientKey) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalServicesRT { + Id: &dn, + ParentLabels: parentLabels, + OwnedBy: &vOwnedBy, + CreatedByGNS: &vCreatedByGNS, + CreatedByESName: &vCreatedByESName, + CreatedBySDFolder: &vCreatedBySDFolder, + CreatedBySDEntry: &vCreatedBySDEntry, + ServicePort: &vServicePort, + Protocol: &vProtocol, + Hostname: &vHostname, + Port: &vPort, + ServerCertificate: &vServerCertificate, + HostnameAlias: &vHostnameAlias, + EndpointList: &EndpointListData, + EgressGateways: &EgressGatewaysData, + ClientCertificate: &vClientCertificate, + ClientKey: &vClientKey, + } + vGlobalExternalServicesRTList = append(vGlobalExternalServicesRTList, ret) + + log.Debugf("[getGlobalDomainConfigExternalServicesResolver]Output ExternalServices objects %v", vGlobalExternalServicesRTList) + + return vGlobalExternalServicesRTList, nil + } + + log.Debug("[getGlobalDomainConfigExternalServicesResolver]Id is empty, process all ExternalServicess") + + vExternalServicesRTParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigExternalServicesResolver]Error getting parent node %s", err) + return vGlobalExternalServicesRTList, nil + } + vExternalServicesRTAllObj, err := vExternalServicesRTParent.GetAllExternalServices(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigExternalServicesResolver]Error getting ExternalServices objects %s", err) + return vGlobalExternalServicesRTList, nil + } + for _, i := range vExternalServicesRTAllObj { + vExternalServicesRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetExternalServices(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigExternalServicesResolver]Error getting ExternalServices node %q : %s", i.DisplayName(), err) + continue + } + dn := vExternalServicesRT.DisplayName() +parentLabels := map[string]interface{}{"externalservicesrts.global.tsm.tanzu.vmware.com":dn} +vOwnedBy := string(vExternalServicesRT.Spec.OwnedBy) +vCreatedByGNS := string(vExternalServicesRT.Spec.CreatedByGNS) +vCreatedByESName := string(vExternalServicesRT.Spec.CreatedByESName) +vCreatedBySDFolder := string(vExternalServicesRT.Spec.CreatedBySDFolder) +vCreatedBySDEntry := string(vExternalServicesRT.Spec.CreatedBySDEntry) +vServicePort := int(vExternalServicesRT.Spec.ServicePort) +vProtocol := string(vExternalServicesRT.Spec.Protocol) +vHostname := string(vExternalServicesRT.Spec.Hostname) +vPort := int(vExternalServicesRT.Spec.Port) +vServerCertificate := string(vExternalServicesRT.Spec.ServerCertificate) +vHostnameAlias := string(vExternalServicesRT.Spec.HostnameAlias) +EndpointList, _ := json.Marshal(vExternalServicesRT.Spec.EndpointList) +EndpointListData := string(EndpointList) +EgressGateways, _ := json.Marshal(vExternalServicesRT.Spec.EgressGateways) +EgressGatewaysData := string(EgressGateways) +vClientCertificate := string(vExternalServicesRT.Spec.ClientCertificate) +vClientKey := string(vExternalServicesRT.Spec.ClientKey) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalServicesRT { + Id: &dn, + ParentLabels: parentLabels, + OwnedBy: &vOwnedBy, + CreatedByGNS: &vCreatedByGNS, + CreatedByESName: &vCreatedByESName, + CreatedBySDFolder: &vCreatedBySDFolder, + CreatedBySDEntry: &vCreatedBySDEntry, + ServicePort: &vServicePort, + Protocol: &vProtocol, + Hostname: &vHostname, + Port: &vPort, + ServerCertificate: &vServerCertificate, + HostnameAlias: &vHostnameAlias, + EndpointList: &EndpointListData, + EgressGateways: &EgressGatewaysData, + ClientCertificate: &vClientCertificate, + ClientKey: &vClientKey, + } + vGlobalExternalServicesRTList = append(vGlobalExternalServicesRTList, ret) + } + + log.Debugf("[getGlobalDomainConfigExternalServicesResolver]Output ExternalServices objects %v", vGlobalExternalServicesRTList) + + return vGlobalExternalServicesRTList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ApiDiscovery Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigApiDiscoveryResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalApiDiscoveryRT, error) { + log.Debugf("[getGlobalDomainConfigApiDiscoveryResolver]Parent Object %+v", obj) + var vGlobalApiDiscoveryRTList []*model.GlobalApiDiscoveryRT + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigApiDiscoveryResolver]Id %q", *id) + vApiDiscoveryRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetApiDiscovery(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigApiDiscoveryResolver]Error getting ApiDiscovery node %q : %s", *id, err) + return vGlobalApiDiscoveryRTList, nil + } + dn := vApiDiscoveryRT.DisplayName() +parentLabels := map[string]interface{}{"apidiscoveryrts.global.tsm.tanzu.vmware.com":dn} +vGnsid := string(vApiDiscoveryRT.Spec.Gnsid) +Selectors, _ := json.Marshal(vApiDiscoveryRT.Spec.Selectors) +SelectorsData := string(Selectors) +Spec, _ := json.Marshal(vApiDiscoveryRT.Spec.Spec) +SpecData := string(Spec) +vCompressionEnabled := bool(vApiDiscoveryRT.Spec.CompressionEnabled) +IsEndpointApiPrechecks, _ := json.Marshal(vApiDiscoveryRT.Spec.IsEndpointApiPrechecks) +IsEndpointApiPrechecksData := string(IsEndpointApiPrechecks) +ProcessingToggles, _ := json.Marshal(vApiDiscoveryRT.Spec.ProcessingToggles) +ProcessingTogglesData := string(ProcessingToggles) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalApiDiscoveryRT { + Id: &dn, + ParentLabels: parentLabels, + Gnsid: &vGnsid, + Selectors: &SelectorsData, + Spec: &SpecData, + CompressionEnabled: &vCompressionEnabled, + IsEndpointApiPrechecks: &IsEndpointApiPrechecksData, + ProcessingToggles: &ProcessingTogglesData, + } + vGlobalApiDiscoveryRTList = append(vGlobalApiDiscoveryRTList, ret) + + log.Debugf("[getGlobalDomainConfigApiDiscoveryResolver]Output ApiDiscovery objects %v", vGlobalApiDiscoveryRTList) + + return vGlobalApiDiscoveryRTList, nil + } + + log.Debug("[getGlobalDomainConfigApiDiscoveryResolver]Id is empty, process all ApiDiscoverys") + + vApiDiscoveryRTParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigApiDiscoveryResolver]Error getting parent node %s", err) + return vGlobalApiDiscoveryRTList, nil + } + vApiDiscoveryRTAllObj, err := vApiDiscoveryRTParent.GetAllApiDiscovery(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigApiDiscoveryResolver]Error getting ApiDiscovery objects %s", err) + return vGlobalApiDiscoveryRTList, nil + } + for _, i := range vApiDiscoveryRTAllObj { + vApiDiscoveryRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetApiDiscovery(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigApiDiscoveryResolver]Error getting ApiDiscovery node %q : %s", i.DisplayName(), err) + continue + } + dn := vApiDiscoveryRT.DisplayName() +parentLabels := map[string]interface{}{"apidiscoveryrts.global.tsm.tanzu.vmware.com":dn} +vGnsid := string(vApiDiscoveryRT.Spec.Gnsid) +Selectors, _ := json.Marshal(vApiDiscoveryRT.Spec.Selectors) +SelectorsData := string(Selectors) +Spec, _ := json.Marshal(vApiDiscoveryRT.Spec.Spec) +SpecData := string(Spec) +vCompressionEnabled := bool(vApiDiscoveryRT.Spec.CompressionEnabled) +IsEndpointApiPrechecks, _ := json.Marshal(vApiDiscoveryRT.Spec.IsEndpointApiPrechecks) +IsEndpointApiPrechecksData := string(IsEndpointApiPrechecks) +ProcessingToggles, _ := json.Marshal(vApiDiscoveryRT.Spec.ProcessingToggles) +ProcessingTogglesData := string(ProcessingToggles) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalApiDiscoveryRT { + Id: &dn, + ParentLabels: parentLabels, + Gnsid: &vGnsid, + Selectors: &SelectorsData, + Spec: &SpecData, + CompressionEnabled: &vCompressionEnabled, + IsEndpointApiPrechecks: &IsEndpointApiPrechecksData, + ProcessingToggles: &ProcessingTogglesData, + } + vGlobalApiDiscoveryRTList = append(vGlobalApiDiscoveryRTList, ret) + } + + log.Debugf("[getGlobalDomainConfigApiDiscoveryResolver]Output ApiDiscovery objects %v", vGlobalApiDiscoveryRTList) + + return vGlobalApiDiscoveryRTList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: GeoDiscovery Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigGeoDiscoveryResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalGeoDiscoveryRT, error) { + log.Debugf("[getGlobalDomainConfigGeoDiscoveryResolver]Parent Object %+v", obj) + var vGlobalGeoDiscoveryRTList []*model.GlobalGeoDiscoveryRT + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigGeoDiscoveryResolver]Id %q", *id) + vGeoDiscoveryRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetGeoDiscovery(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigGeoDiscoveryResolver]Error getting GeoDiscovery node %q : %s", *id, err) + return vGlobalGeoDiscoveryRTList, nil + } + dn := vGeoDiscoveryRT.DisplayName() +parentLabels := map[string]interface{}{"geodiscoveryrts.global.tsm.tanzu.vmware.com":dn} +vGnsid := string(vGeoDiscoveryRT.Spec.Gnsid) +vSelectors := string(vGeoDiscoveryRT.Spec.Selectors) +vSpec := string(vGeoDiscoveryRT.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGeoDiscoveryRT { + Id: &dn, + ParentLabels: parentLabels, + Gnsid: &vGnsid, + Selectors: &vSelectors, + Spec: &vSpec, + } + vGlobalGeoDiscoveryRTList = append(vGlobalGeoDiscoveryRTList, ret) + + log.Debugf("[getGlobalDomainConfigGeoDiscoveryResolver]Output GeoDiscovery objects %v", vGlobalGeoDiscoveryRTList) + + return vGlobalGeoDiscoveryRTList, nil + } + + log.Debug("[getGlobalDomainConfigGeoDiscoveryResolver]Id is empty, process all GeoDiscoverys") + + vGeoDiscoveryRTParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigGeoDiscoveryResolver]Error getting parent node %s", err) + return vGlobalGeoDiscoveryRTList, nil + } + vGeoDiscoveryRTAllObj, err := vGeoDiscoveryRTParent.GetAllGeoDiscovery(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigGeoDiscoveryResolver]Error getting GeoDiscovery objects %s", err) + return vGlobalGeoDiscoveryRTList, nil + } + for _, i := range vGeoDiscoveryRTAllObj { + vGeoDiscoveryRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetGeoDiscovery(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigGeoDiscoveryResolver]Error getting GeoDiscovery node %q : %s", i.DisplayName(), err) + continue + } + dn := vGeoDiscoveryRT.DisplayName() +parentLabels := map[string]interface{}{"geodiscoveryrts.global.tsm.tanzu.vmware.com":dn} +vGnsid := string(vGeoDiscoveryRT.Spec.Gnsid) +vSelectors := string(vGeoDiscoveryRT.Spec.Selectors) +vSpec := string(vGeoDiscoveryRT.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGeoDiscoveryRT { + Id: &dn, + ParentLabels: parentLabels, + Gnsid: &vGnsid, + Selectors: &vSelectors, + Spec: &vSpec, + } + vGlobalGeoDiscoveryRTList = append(vGlobalGeoDiscoveryRTList, ret) + } + + log.Debugf("[getGlobalDomainConfigGeoDiscoveryResolver]Output GeoDiscovery objects %v", vGlobalGeoDiscoveryRTList) + + return vGlobalGeoDiscoveryRTList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: PiiDiscovery Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigPiiDiscoveryResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalPiiDiscoveryRT, error) { + log.Debugf("[getGlobalDomainConfigPiiDiscoveryResolver]Parent Object %+v", obj) + var vGlobalPiiDiscoveryRTList []*model.GlobalPiiDiscoveryRT + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigPiiDiscoveryResolver]Id %q", *id) + vPiiDiscoveryRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetPiiDiscovery(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigPiiDiscoveryResolver]Error getting PiiDiscovery node %q : %s", *id, err) + return vGlobalPiiDiscoveryRTList, nil + } + dn := vPiiDiscoveryRT.DisplayName() +parentLabels := map[string]interface{}{"piidiscoveryrts.global.tsm.tanzu.vmware.com":dn} +vGnsid := string(vPiiDiscoveryRT.Spec.Gnsid) +vSelectors := string(vPiiDiscoveryRT.Spec.Selectors) +vSpec := string(vPiiDiscoveryRT.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalPiiDiscoveryRT { + Id: &dn, + ParentLabels: parentLabels, + Gnsid: &vGnsid, + Selectors: &vSelectors, + Spec: &vSpec, + } + vGlobalPiiDiscoveryRTList = append(vGlobalPiiDiscoveryRTList, ret) + + log.Debugf("[getGlobalDomainConfigPiiDiscoveryResolver]Output PiiDiscovery objects %v", vGlobalPiiDiscoveryRTList) + + return vGlobalPiiDiscoveryRTList, nil + } + + log.Debug("[getGlobalDomainConfigPiiDiscoveryResolver]Id is empty, process all PiiDiscoverys") + + vPiiDiscoveryRTParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigPiiDiscoveryResolver]Error getting parent node %s", err) + return vGlobalPiiDiscoveryRTList, nil + } + vPiiDiscoveryRTAllObj, err := vPiiDiscoveryRTParent.GetAllPiiDiscovery(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigPiiDiscoveryResolver]Error getting PiiDiscovery objects %s", err) + return vGlobalPiiDiscoveryRTList, nil + } + for _, i := range vPiiDiscoveryRTAllObj { + vPiiDiscoveryRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetPiiDiscovery(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigPiiDiscoveryResolver]Error getting PiiDiscovery node %q : %s", i.DisplayName(), err) + continue + } + dn := vPiiDiscoveryRT.DisplayName() +parentLabels := map[string]interface{}{"piidiscoveryrts.global.tsm.tanzu.vmware.com":dn} +vGnsid := string(vPiiDiscoveryRT.Spec.Gnsid) +vSelectors := string(vPiiDiscoveryRT.Spec.Selectors) +vSpec := string(vPiiDiscoveryRT.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalPiiDiscoveryRT { + Id: &dn, + ParentLabels: parentLabels, + Gnsid: &vGnsid, + Selectors: &vSelectors, + Spec: &vSpec, + } + vGlobalPiiDiscoveryRTList = append(vGlobalPiiDiscoveryRTList, ret) + } + + log.Debugf("[getGlobalDomainConfigPiiDiscoveryResolver]Output PiiDiscovery objects %v", vGlobalPiiDiscoveryRTList) + + return vGlobalPiiDiscoveryRTList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: AttackDiscovery Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigAttackDiscoveryResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalAttackDiscoveryRT, error) { + log.Debugf("[getGlobalDomainConfigAttackDiscoveryResolver]Parent Object %+v", obj) + var vGlobalAttackDiscoveryRTList []*model.GlobalAttackDiscoveryRT + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigAttackDiscoveryResolver]Id %q", *id) + vAttackDiscoveryRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetAttackDiscovery(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigAttackDiscoveryResolver]Error getting AttackDiscovery node %q : %s", *id, err) + return vGlobalAttackDiscoveryRTList, nil + } + dn := vAttackDiscoveryRT.DisplayName() +parentLabels := map[string]interface{}{"attackdiscoveryrts.global.tsm.tanzu.vmware.com":dn} +vGnsid := string(vAttackDiscoveryRT.Spec.Gnsid) +vSelectors := string(vAttackDiscoveryRT.Spec.Selectors) +vSpec := string(vAttackDiscoveryRT.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAttackDiscoveryRT { + Id: &dn, + ParentLabels: parentLabels, + Gnsid: &vGnsid, + Selectors: &vSelectors, + Spec: &vSpec, + } + vGlobalAttackDiscoveryRTList = append(vGlobalAttackDiscoveryRTList, ret) + + log.Debugf("[getGlobalDomainConfigAttackDiscoveryResolver]Output AttackDiscovery objects %v", vGlobalAttackDiscoveryRTList) + + return vGlobalAttackDiscoveryRTList, nil + } + + log.Debug("[getGlobalDomainConfigAttackDiscoveryResolver]Id is empty, process all AttackDiscoverys") + + vAttackDiscoveryRTParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigAttackDiscoveryResolver]Error getting parent node %s", err) + return vGlobalAttackDiscoveryRTList, nil + } + vAttackDiscoveryRTAllObj, err := vAttackDiscoveryRTParent.GetAllAttackDiscovery(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigAttackDiscoveryResolver]Error getting AttackDiscovery objects %s", err) + return vGlobalAttackDiscoveryRTList, nil + } + for _, i := range vAttackDiscoveryRTAllObj { + vAttackDiscoveryRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetAttackDiscovery(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigAttackDiscoveryResolver]Error getting AttackDiscovery node %q : %s", i.DisplayName(), err) + continue + } + dn := vAttackDiscoveryRT.DisplayName() +parentLabels := map[string]interface{}{"attackdiscoveryrts.global.tsm.tanzu.vmware.com":dn} +vGnsid := string(vAttackDiscoveryRT.Spec.Gnsid) +vSelectors := string(vAttackDiscoveryRT.Spec.Selectors) +vSpec := string(vAttackDiscoveryRT.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAttackDiscoveryRT { + Id: &dn, + ParentLabels: parentLabels, + Gnsid: &vGnsid, + Selectors: &vSelectors, + Spec: &vSpec, + } + vGlobalAttackDiscoveryRTList = append(vGlobalAttackDiscoveryRTList, ret) + } + + log.Debugf("[getGlobalDomainConfigAttackDiscoveryResolver]Output AttackDiscovery objects %v", vGlobalAttackDiscoveryRTList) + + return vGlobalAttackDiscoveryRTList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: UserDiscovery Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigUserDiscoveryResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalUserDiscoveryRT, error) { + log.Debugf("[getGlobalDomainConfigUserDiscoveryResolver]Parent Object %+v", obj) + var vGlobalUserDiscoveryRTList []*model.GlobalUserDiscoveryRT + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigUserDiscoveryResolver]Id %q", *id) + vUserDiscoveryRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetUserDiscovery(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigUserDiscoveryResolver]Error getting UserDiscovery node %q : %s", *id, err) + return vGlobalUserDiscoveryRTList, nil + } + dn := vUserDiscoveryRT.DisplayName() +parentLabels := map[string]interface{}{"userdiscoveryrts.global.tsm.tanzu.vmware.com":dn} +vGnsid := string(vUserDiscoveryRT.Spec.Gnsid) +vSelectors := string(vUserDiscoveryRT.Spec.Selectors) +vSpec := string(vUserDiscoveryRT.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalUserDiscoveryRT { + Id: &dn, + ParentLabels: parentLabels, + Gnsid: &vGnsid, + Selectors: &vSelectors, + Spec: &vSpec, + } + vGlobalUserDiscoveryRTList = append(vGlobalUserDiscoveryRTList, ret) + + log.Debugf("[getGlobalDomainConfigUserDiscoveryResolver]Output UserDiscovery objects %v", vGlobalUserDiscoveryRTList) + + return vGlobalUserDiscoveryRTList, nil + } + + log.Debug("[getGlobalDomainConfigUserDiscoveryResolver]Id is empty, process all UserDiscoverys") + + vUserDiscoveryRTParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigUserDiscoveryResolver]Error getting parent node %s", err) + return vGlobalUserDiscoveryRTList, nil + } + vUserDiscoveryRTAllObj, err := vUserDiscoveryRTParent.GetAllUserDiscovery(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigUserDiscoveryResolver]Error getting UserDiscovery objects %s", err) + return vGlobalUserDiscoveryRTList, nil + } + for _, i := range vUserDiscoveryRTAllObj { + vUserDiscoveryRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetUserDiscovery(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigUserDiscoveryResolver]Error getting UserDiscovery node %q : %s", i.DisplayName(), err) + continue + } + dn := vUserDiscoveryRT.DisplayName() +parentLabels := map[string]interface{}{"userdiscoveryrts.global.tsm.tanzu.vmware.com":dn} +vGnsid := string(vUserDiscoveryRT.Spec.Gnsid) +vSelectors := string(vUserDiscoveryRT.Spec.Selectors) +vSpec := string(vUserDiscoveryRT.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalUserDiscoveryRT { + Id: &dn, + ParentLabels: parentLabels, + Gnsid: &vGnsid, + Selectors: &vSelectors, + Spec: &vSpec, + } + vGlobalUserDiscoveryRTList = append(vGlobalUserDiscoveryRTList, ret) + } + + log.Debugf("[getGlobalDomainConfigUserDiscoveryResolver]Output UserDiscovery objects %v", vGlobalUserDiscoveryRTList) + + return vGlobalUserDiscoveryRTList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: PublicService Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigPublicServiceResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalPublicServiceRT, error) { + log.Debugf("[getGlobalDomainConfigPublicServiceResolver]Parent Object %+v", obj) + var vGlobalPublicServiceRTList []*model.GlobalPublicServiceRT + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigPublicServiceResolver]Id %q", *id) + vPublicServiceRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetPublicService(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigPublicServiceResolver]Error getting PublicService node %q : %s", *id, err) + return vGlobalPublicServiceRTList, nil + } + dn := vPublicServiceRT.DisplayName() +parentLabels := map[string]interface{}{"publicservicerts.global.tsm.tanzu.vmware.com":dn} +vOwnedBy := string(vPublicServiceRT.Spec.OwnedBy) +FqdnList, _ := json.Marshal(vPublicServiceRT.Spec.FqdnList) +FqdnListData := string(FqdnList) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalPublicServiceRT { + Id: &dn, + ParentLabels: parentLabels, + OwnedBy: &vOwnedBy, + FqdnList: &FqdnListData, + } + vGlobalPublicServiceRTList = append(vGlobalPublicServiceRTList, ret) + + log.Debugf("[getGlobalDomainConfigPublicServiceResolver]Output PublicService objects %v", vGlobalPublicServiceRTList) + + return vGlobalPublicServiceRTList, nil + } + + log.Debug("[getGlobalDomainConfigPublicServiceResolver]Id is empty, process all PublicServices") + + vPublicServiceRTParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigPublicServiceResolver]Error getting parent node %s", err) + return vGlobalPublicServiceRTList, nil + } + vPublicServiceRTAllObj, err := vPublicServiceRTParent.GetAllPublicService(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigPublicServiceResolver]Error getting PublicService objects %s", err) + return vGlobalPublicServiceRTList, nil + } + for _, i := range vPublicServiceRTAllObj { + vPublicServiceRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetPublicService(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigPublicServiceResolver]Error getting PublicService node %q : %s", i.DisplayName(), err) + continue + } + dn := vPublicServiceRT.DisplayName() +parentLabels := map[string]interface{}{"publicservicerts.global.tsm.tanzu.vmware.com":dn} +vOwnedBy := string(vPublicServiceRT.Spec.OwnedBy) +FqdnList, _ := json.Marshal(vPublicServiceRT.Spec.FqdnList) +FqdnListData := string(FqdnList) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalPublicServiceRT { + Id: &dn, + ParentLabels: parentLabels, + OwnedBy: &vOwnedBy, + FqdnList: &FqdnListData, + } + vGlobalPublicServiceRTList = append(vGlobalPublicServiceRTList, ret) + } + + log.Debugf("[getGlobalDomainConfigPublicServiceResolver]Output PublicService objects %v", vGlobalPublicServiceRTList) + + return vGlobalPublicServiceRTList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: GnsAccessControlPolicy Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigGnsAccessControlPolicyResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalGnsAccessControlPolicyRT, error) { + log.Debugf("[getGlobalDomainConfigGnsAccessControlPolicyResolver]Parent Object %+v", obj) + var vGlobalGnsAccessControlPolicyRTList []*model.GlobalGnsAccessControlPolicyRT + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigGnsAccessControlPolicyResolver]Id %q", *id) + vGnsAccessControlPolicyRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetGnsAccessControlPolicy(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigGnsAccessControlPolicyResolver]Error getting GnsAccessControlPolicy node %q : %s", *id, err) + return vGlobalGnsAccessControlPolicyRTList, nil + } + dn := vGnsAccessControlPolicyRT.DisplayName() +parentLabels := map[string]interface{}{"gnsaccesscontrolpolicyrts.global.tsm.tanzu.vmware.com":dn} +vGnsid := string(vGnsAccessControlPolicyRT.Spec.Gnsid) +vSpec := string(vGnsAccessControlPolicyRT.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsAccessControlPolicyRT { + Id: &dn, + ParentLabels: parentLabels, + Gnsid: &vGnsid, + Spec: &vSpec, + } + vGlobalGnsAccessControlPolicyRTList = append(vGlobalGnsAccessControlPolicyRTList, ret) + + log.Debugf("[getGlobalDomainConfigGnsAccessControlPolicyResolver]Output GnsAccessControlPolicy objects %v", vGlobalGnsAccessControlPolicyRTList) + + return vGlobalGnsAccessControlPolicyRTList, nil + } + + log.Debug("[getGlobalDomainConfigGnsAccessControlPolicyResolver]Id is empty, process all GnsAccessControlPolicys") + + vGnsAccessControlPolicyRTParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigGnsAccessControlPolicyResolver]Error getting parent node %s", err) + return vGlobalGnsAccessControlPolicyRTList, nil + } + vGnsAccessControlPolicyRTAllObj, err := vGnsAccessControlPolicyRTParent.GetAllGnsAccessControlPolicy(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigGnsAccessControlPolicyResolver]Error getting GnsAccessControlPolicy objects %s", err) + return vGlobalGnsAccessControlPolicyRTList, nil + } + for _, i := range vGnsAccessControlPolicyRTAllObj { + vGnsAccessControlPolicyRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetGnsAccessControlPolicy(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigGnsAccessControlPolicyResolver]Error getting GnsAccessControlPolicy node %q : %s", i.DisplayName(), err) + continue + } + dn := vGnsAccessControlPolicyRT.DisplayName() +parentLabels := map[string]interface{}{"gnsaccesscontrolpolicyrts.global.tsm.tanzu.vmware.com":dn} +vGnsid := string(vGnsAccessControlPolicyRT.Spec.Gnsid) +vSpec := string(vGnsAccessControlPolicyRT.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsAccessControlPolicyRT { + Id: &dn, + ParentLabels: parentLabels, + Gnsid: &vGnsid, + Spec: &vSpec, + } + vGlobalGnsAccessControlPolicyRTList = append(vGlobalGnsAccessControlPolicyRTList, ret) + } + + log.Debugf("[getGlobalDomainConfigGnsAccessControlPolicyResolver]Output GnsAccessControlPolicy objects %v", vGlobalGnsAccessControlPolicyRTList) + + return vGlobalGnsAccessControlPolicyRTList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: GnsSchemaViolationDiscovery Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigGnsSchemaViolationDiscoveryResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalSchemaViolationDiscoveryRT, error) { + log.Debugf("[getGlobalDomainConfigGnsSchemaViolationDiscoveryResolver]Parent Object %+v", obj) + var vGlobalSchemaViolationDiscoveryRTList []*model.GlobalSchemaViolationDiscoveryRT + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigGnsSchemaViolationDiscoveryResolver]Id %q", *id) + vSchemaViolationDiscoveryRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetGnsSchemaViolationDiscovery(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigGnsSchemaViolationDiscoveryResolver]Error getting GnsSchemaViolationDiscovery node %q : %s", *id, err) + return vGlobalSchemaViolationDiscoveryRTList, nil + } + dn := vSchemaViolationDiscoveryRT.DisplayName() +parentLabels := map[string]interface{}{"schemaviolationdiscoveryrts.global.tsm.tanzu.vmware.com":dn} +vGnsid := string(vSchemaViolationDiscoveryRT.Spec.Gnsid) +vSelectors := string(vSchemaViolationDiscoveryRT.Spec.Selectors) +vSpec := string(vSchemaViolationDiscoveryRT.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSchemaViolationDiscoveryRT { + Id: &dn, + ParentLabels: parentLabels, + Gnsid: &vGnsid, + Selectors: &vSelectors, + Spec: &vSpec, + } + vGlobalSchemaViolationDiscoveryRTList = append(vGlobalSchemaViolationDiscoveryRTList, ret) + + log.Debugf("[getGlobalDomainConfigGnsSchemaViolationDiscoveryResolver]Output GnsSchemaViolationDiscovery objects %v", vGlobalSchemaViolationDiscoveryRTList) + + return vGlobalSchemaViolationDiscoveryRTList, nil + } + + log.Debug("[getGlobalDomainConfigGnsSchemaViolationDiscoveryResolver]Id is empty, process all GnsSchemaViolationDiscoverys") + + vSchemaViolationDiscoveryRTParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigGnsSchemaViolationDiscoveryResolver]Error getting parent node %s", err) + return vGlobalSchemaViolationDiscoveryRTList, nil + } + vSchemaViolationDiscoveryRTAllObj, err := vSchemaViolationDiscoveryRTParent.GetAllGnsSchemaViolationDiscovery(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigGnsSchemaViolationDiscoveryResolver]Error getting GnsSchemaViolationDiscovery objects %s", err) + return vGlobalSchemaViolationDiscoveryRTList, nil + } + for _, i := range vSchemaViolationDiscoveryRTAllObj { + vSchemaViolationDiscoveryRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetGnsSchemaViolationDiscovery(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigGnsSchemaViolationDiscoveryResolver]Error getting GnsSchemaViolationDiscovery node %q : %s", i.DisplayName(), err) + continue + } + dn := vSchemaViolationDiscoveryRT.DisplayName() +parentLabels := map[string]interface{}{"schemaviolationdiscoveryrts.global.tsm.tanzu.vmware.com":dn} +vGnsid := string(vSchemaViolationDiscoveryRT.Spec.Gnsid) +vSelectors := string(vSchemaViolationDiscoveryRT.Spec.Selectors) +vSpec := string(vSchemaViolationDiscoveryRT.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSchemaViolationDiscoveryRT { + Id: &dn, + ParentLabels: parentLabels, + Gnsid: &vGnsid, + Selectors: &vSelectors, + Spec: &vSpec, + } + vGlobalSchemaViolationDiscoveryRTList = append(vGlobalSchemaViolationDiscoveryRTList, ret) + } + + log.Debugf("[getGlobalDomainConfigGnsSchemaViolationDiscoveryResolver]Output GnsSchemaViolationDiscovery objects %v", vGlobalSchemaViolationDiscoveryRTList) + + return vGlobalSchemaViolationDiscoveryRTList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: GnsSegmentationPolicy Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigGnsSegmentationPolicyResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalGnsSegmentationPolicyRT, error) { + log.Debugf("[getGlobalDomainConfigGnsSegmentationPolicyResolver]Parent Object %+v", obj) + var vGlobalGnsSegmentationPolicyRTList []*model.GlobalGnsSegmentationPolicyRT + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigGnsSegmentationPolicyResolver]Id %q", *id) + vGnsSegmentationPolicyRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetGnsSegmentationPolicy(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigGnsSegmentationPolicyResolver]Error getting GnsSegmentationPolicy node %q : %s", *id, err) + return vGlobalGnsSegmentationPolicyRTList, nil + } + dn := vGnsSegmentationPolicyRT.DisplayName() +parentLabels := map[string]interface{}{"gnssegmentationpolicyrts.global.tsm.tanzu.vmware.com":dn} +vGnsid := string(vGnsSegmentationPolicyRT.Spec.Gnsid) +vSpec := string(vGnsSegmentationPolicyRT.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsSegmentationPolicyRT { + Id: &dn, + ParentLabels: parentLabels, + Gnsid: &vGnsid, + Spec: &vSpec, + } + vGlobalGnsSegmentationPolicyRTList = append(vGlobalGnsSegmentationPolicyRTList, ret) + + log.Debugf("[getGlobalDomainConfigGnsSegmentationPolicyResolver]Output GnsSegmentationPolicy objects %v", vGlobalGnsSegmentationPolicyRTList) + + return vGlobalGnsSegmentationPolicyRTList, nil + } + + log.Debug("[getGlobalDomainConfigGnsSegmentationPolicyResolver]Id is empty, process all GnsSegmentationPolicys") + + vGnsSegmentationPolicyRTParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigGnsSegmentationPolicyResolver]Error getting parent node %s", err) + return vGlobalGnsSegmentationPolicyRTList, nil + } + vGnsSegmentationPolicyRTAllObj, err := vGnsSegmentationPolicyRTParent.GetAllGnsSegmentationPolicy(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigGnsSegmentationPolicyResolver]Error getting GnsSegmentationPolicy objects %s", err) + return vGlobalGnsSegmentationPolicyRTList, nil + } + for _, i := range vGnsSegmentationPolicyRTAllObj { + vGnsSegmentationPolicyRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetGnsSegmentationPolicy(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigGnsSegmentationPolicyResolver]Error getting GnsSegmentationPolicy node %q : %s", i.DisplayName(), err) + continue + } + dn := vGnsSegmentationPolicyRT.DisplayName() +parentLabels := map[string]interface{}{"gnssegmentationpolicyrts.global.tsm.tanzu.vmware.com":dn} +vGnsid := string(vGnsSegmentationPolicyRT.Spec.Gnsid) +vSpec := string(vGnsSegmentationPolicyRT.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsSegmentationPolicyRT { + Id: &dn, + ParentLabels: parentLabels, + Gnsid: &vGnsid, + Spec: &vSpec, + } + vGlobalGnsSegmentationPolicyRTList = append(vGlobalGnsSegmentationPolicyRTList, ret) + } + + log.Debugf("[getGlobalDomainConfigGnsSegmentationPolicyResolver]Output GnsSegmentationPolicy objects %v", vGlobalGnsSegmentationPolicyRTList) + + return vGlobalGnsSegmentationPolicyRTList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: CertificateAuthority Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigCertificateAuthorityResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalCertificateAuthorityRT, error) { + log.Debugf("[getGlobalDomainConfigCertificateAuthorityResolver]Parent Object %+v", obj) + var vGlobalCertificateAuthorityRTList []*model.GlobalCertificateAuthorityRT + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigCertificateAuthorityResolver]Id %q", *id) + vCertificateAuthorityRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetCertificateAuthority(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigCertificateAuthorityResolver]Error getting CertificateAuthority node %q : %s", *id, err) + return vGlobalCertificateAuthorityRTList, nil + } + dn := vCertificateAuthorityRT.DisplayName() +parentLabels := map[string]interface{}{"certificateauthorityrts.global.tsm.tanzu.vmware.com":dn} +vUrl := string(vCertificateAuthorityRT.Spec.Url) +vType := string(vCertificateAuthorityRT.Spec.Type) +vTemplatePath := string(vCertificateAuthorityRT.Spec.TemplatePath) +vSecretRef := string(vCertificateAuthorityRT.Spec.SecretRef) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCertificateAuthorityRT { + Id: &dn, + ParentLabels: parentLabels, + Url: &vUrl, + Type: &vType, + TemplatePath: &vTemplatePath, + SecretRef: &vSecretRef, + } + vGlobalCertificateAuthorityRTList = append(vGlobalCertificateAuthorityRTList, ret) + + log.Debugf("[getGlobalDomainConfigCertificateAuthorityResolver]Output CertificateAuthority objects %v", vGlobalCertificateAuthorityRTList) + + return vGlobalCertificateAuthorityRTList, nil + } + + log.Debug("[getGlobalDomainConfigCertificateAuthorityResolver]Id is empty, process all CertificateAuthoritys") + + vCertificateAuthorityRTParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigCertificateAuthorityResolver]Error getting parent node %s", err) + return vGlobalCertificateAuthorityRTList, nil + } + vCertificateAuthorityRTAllObj, err := vCertificateAuthorityRTParent.GetAllCertificateAuthority(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigCertificateAuthorityResolver]Error getting CertificateAuthority objects %s", err) + return vGlobalCertificateAuthorityRTList, nil + } + for _, i := range vCertificateAuthorityRTAllObj { + vCertificateAuthorityRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetCertificateAuthority(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigCertificateAuthorityResolver]Error getting CertificateAuthority node %q : %s", i.DisplayName(), err) + continue + } + dn := vCertificateAuthorityRT.DisplayName() +parentLabels := map[string]interface{}{"certificateauthorityrts.global.tsm.tanzu.vmware.com":dn} +vUrl := string(vCertificateAuthorityRT.Spec.Url) +vType := string(vCertificateAuthorityRT.Spec.Type) +vTemplatePath := string(vCertificateAuthorityRT.Spec.TemplatePath) +vSecretRef := string(vCertificateAuthorityRT.Spec.SecretRef) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCertificateAuthorityRT { + Id: &dn, + ParentLabels: parentLabels, + Url: &vUrl, + Type: &vType, + TemplatePath: &vTemplatePath, + SecretRef: &vSecretRef, + } + vGlobalCertificateAuthorityRTList = append(vGlobalCertificateAuthorityRTList, ret) + } + + log.Debugf("[getGlobalDomainConfigCertificateAuthorityResolver]Output CertificateAuthority objects %v", vGlobalCertificateAuthorityRTList) + + return vGlobalCertificateAuthorityRTList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: GnsEndpointsConfig Node: DomainConfig PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigGnsEndpointsConfigResolver(obj *model.GlobalDomainConfig, id *string) ([]*model.GlobalGnsEndpointsConfig, error) { + log.Debugf("[getGlobalDomainConfigGnsEndpointsConfigResolver]Parent Object %+v", obj) + var vGlobalGnsEndpointsConfigList []*model.GlobalGnsEndpointsConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigGnsEndpointsConfigResolver]Id %q", *id) + vGnsEndpointsConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetGnsEndpointsConfig(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigGnsEndpointsConfigResolver]Error getting GnsEndpointsConfig node %q : %s", *id, err) + return vGlobalGnsEndpointsConfigList, nil + } + dn := vGnsEndpointsConfig.DisplayName() +parentLabels := map[string]interface{}{"gnsendpointsconfigs.global.tsm.tanzu.vmware.com":dn} +vEndpoints := string(vGnsEndpointsConfig.Spec.Endpoints) +vGnsId := string(vGnsEndpointsConfig.Spec.GnsId) +EndpointServices, _ := json.Marshal(vGnsEndpointsConfig.Spec.EndpointServices) +EndpointServicesData := string(EndpointServices) +vServicePortList := string(vGnsEndpointsConfig.Spec.ServicePortList) +vSelector := string(vGnsEndpointsConfig.Spec.Selector) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsEndpointsConfig { + Id: &dn, + ParentLabels: parentLabels, + Endpoints: &vEndpoints, + GnsId: &vGnsId, + EndpointServices: &EndpointServicesData, + ServicePortList: &vServicePortList, + Selector: &vSelector, + } + vGlobalGnsEndpointsConfigList = append(vGlobalGnsEndpointsConfigList, ret) + + log.Debugf("[getGlobalDomainConfigGnsEndpointsConfigResolver]Output GnsEndpointsConfig objects %v", vGlobalGnsEndpointsConfigList) + + return vGlobalGnsEndpointsConfigList, nil + } + + log.Debug("[getGlobalDomainConfigGnsEndpointsConfigResolver]Id is empty, process all GnsEndpointsConfigs") + + vGnsEndpointsConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigGnsEndpointsConfigResolver]Error getting parent node %s", err) + return vGlobalGnsEndpointsConfigList, nil + } + vGnsEndpointsConfigAllObj, err := vGnsEndpointsConfigParent.GetAllGnsEndpointsConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigGnsEndpointsConfigResolver]Error getting GnsEndpointsConfig objects %s", err) + return vGlobalGnsEndpointsConfigList, nil + } + for _, i := range vGnsEndpointsConfigAllObj { + vGnsEndpointsConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetGnsEndpointsConfig(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigGnsEndpointsConfigResolver]Error getting GnsEndpointsConfig node %q : %s", i.DisplayName(), err) + continue + } + dn := vGnsEndpointsConfig.DisplayName() +parentLabels := map[string]interface{}{"gnsendpointsconfigs.global.tsm.tanzu.vmware.com":dn} +vEndpoints := string(vGnsEndpointsConfig.Spec.Endpoints) +vGnsId := string(vGnsEndpointsConfig.Spec.GnsId) +EndpointServices, _ := json.Marshal(vGnsEndpointsConfig.Spec.EndpointServices) +EndpointServicesData := string(EndpointServices) +vServicePortList := string(vGnsEndpointsConfig.Spec.ServicePortList) +vSelector := string(vGnsEndpointsConfig.Spec.Selector) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsEndpointsConfig { + Id: &dn, + ParentLabels: parentLabels, + Endpoints: &vEndpoints, + GnsId: &vGnsId, + EndpointServices: &EndpointServicesData, + ServicePortList: &vServicePortList, + Selector: &vSelector, + } + vGlobalGnsEndpointsConfigList = append(vGlobalGnsEndpointsConfigList, ret) + } + + log.Debugf("[getGlobalDomainConfigGnsEndpointsConfigResolver]Output GnsEndpointsConfig objects %v", vGlobalGnsEndpointsConfigList) + + return vGlobalGnsEndpointsConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: SecretHashes Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainSecretHashesResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalSecretHash, error) { + log.Debugf("[getGlobalDomainSecretHashesResolver]Parent Object %+v", obj) + var vGlobalSecretHashList []*model.GlobalSecretHash + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainSecretHashesResolver]Id %q", *id) + vSecretHash, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetSecretHashes(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainSecretHashesResolver]Error getting SecretHashes node %q : %s", *id, err) + return vGlobalSecretHashList, nil + } + dn := vSecretHash.DisplayName() +parentLabels := map[string]interface{}{"secrethashes.global.tsm.tanzu.vmware.com":dn} +vName := string(vSecretHash.Spec.Name) +vType := string(vSecretHash.Spec.Type) +vMetadata := string(vSecretHash.Spec.Metadata) +vDataHash := string(vSecretHash.Spec.DataHash) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSecretHash { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Type: &vType, + Metadata: &vMetadata, + DataHash: &vDataHash, + } + vGlobalSecretHashList = append(vGlobalSecretHashList, ret) + + log.Debugf("[getGlobalDomainSecretHashesResolver]Output SecretHashes objects %v", vGlobalSecretHashList) + + return vGlobalSecretHashList, nil + } + + log.Debug("[getGlobalDomainSecretHashesResolver]Id is empty, process all SecretHashess") + + vSecretHashParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainSecretHashesResolver]Error getting parent node %s", err) + return vGlobalSecretHashList, nil + } + vSecretHashAllObj, err := vSecretHashParent.GetAllSecretHashes(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainSecretHashesResolver]Error getting SecretHashes objects %s", err) + return vGlobalSecretHashList, nil + } + for _, i := range vSecretHashAllObj { + vSecretHash, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetSecretHashes(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainSecretHashesResolver]Error getting SecretHashes node %q : %s", i.DisplayName(), err) + continue + } + dn := vSecretHash.DisplayName() +parentLabels := map[string]interface{}{"secrethashes.global.tsm.tanzu.vmware.com":dn} +vName := string(vSecretHash.Spec.Name) +vType := string(vSecretHash.Spec.Type) +vMetadata := string(vSecretHash.Spec.Metadata) +vDataHash := string(vSecretHash.Spec.DataHash) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSecretHash { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Type: &vType, + Metadata: &vMetadata, + DataHash: &vDataHash, + } + vGlobalSecretHashList = append(vGlobalSecretHashList, ret) + } + + log.Debugf("[getGlobalDomainSecretHashesResolver]Output SecretHashes objects %v", vGlobalSecretHashList) + + return vGlobalSecretHashList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceInstances Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainServiceInstancesResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalServiceInstance, error) { + log.Debugf("[getGlobalDomainServiceInstancesResolver]Parent Object %+v", obj) + var vGlobalServiceInstanceList []*model.GlobalServiceInstance + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainServiceInstancesResolver]Id %q", *id) + vServiceInstance, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceInstances(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainServiceInstancesResolver]Error getting ServiceInstances node %q : %s", *id, err) + return vGlobalServiceInstanceList, nil + } + dn := vServiceInstance.DisplayName() +parentLabels := map[string]interface{}{"serviceinstances.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceInstance.Spec.Metadata) +vSpec := string(vServiceInstance.Spec.Spec) +vStatus := string(vServiceInstance.Spec.Status) +vName := string(vServiceInstance.Spec.Name) +vNamespace := string(vServiceInstance.Spec.Namespace) +vAnnotations := string(vServiceInstance.Spec.Annotations) +vLabels := string(vServiceInstance.Spec.Labels) +vApiLink := string(vServiceInstance.Spec.ApiLink) +vUid := string(vServiceInstance.Spec.Uid) +vRestartPolicy := string(vServiceInstance.Spec.RestartPolicy) +vDnsPolicy := string(vServiceInstance.Spec.DnsPolicy) +vHostNetwork := bool(vServiceInstance.Spec.HostNetwork) +vSecurityContext := string(vServiceInstance.Spec.SecurityContext) +vTerminationGracePeriodSeconds := int(vServiceInstance.Spec.TerminationGracePeriodSeconds) +vTolerations := string(vServiceInstance.Spec.Tolerations) +vStatusConditions := string(vServiceInstance.Spec.StatusConditions) +vStatusContainer := string(vServiceInstance.Spec.StatusContainer) +vPodIP := string(vServiceInstance.Spec.PodIP) +vQosClass := string(vServiceInstance.Spec.QosClass) +vPhase := string(vServiceInstance.Spec.Phase) +vStartTime := string(vServiceInstance.Spec.StartTime) +vNodeName := string(vServiceInstance.Spec.NodeName) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceInstance { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Name: &vName, + Namespace: &vNamespace, + Annotations: &vAnnotations, + Labels: &vLabels, + ApiLink: &vApiLink, + Uid: &vUid, + RestartPolicy: &vRestartPolicy, + DnsPolicy: &vDnsPolicy, + HostNetwork: &vHostNetwork, + SecurityContext: &vSecurityContext, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Tolerations: &vTolerations, + StatusConditions: &vStatusConditions, + StatusContainer: &vStatusContainer, + PodIP: &vPodIP, + QosClass: &vQosClass, + Phase: &vPhase, + StartTime: &vStartTime, + NodeName: &vNodeName, + } + vGlobalServiceInstanceList = append(vGlobalServiceInstanceList, ret) + + log.Debugf("[getGlobalDomainServiceInstancesResolver]Output ServiceInstances objects %v", vGlobalServiceInstanceList) + + return vGlobalServiceInstanceList, nil + } + + log.Debug("[getGlobalDomainServiceInstancesResolver]Id is empty, process all ServiceInstancess") + + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainServiceInstancesResolver]Error getting parent node %s", err) + return vGlobalServiceInstanceList, nil + } + vServiceInstanceAllObj, err := vServiceInstanceParent.GetAllServiceInstances(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainServiceInstancesResolver]Error getting ServiceInstances objects %s", err) + return vGlobalServiceInstanceList, nil + } + for _, i := range vServiceInstanceAllObj { + vServiceInstance, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceInstances(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainServiceInstancesResolver]Error getting ServiceInstances node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceInstance.DisplayName() +parentLabels := map[string]interface{}{"serviceinstances.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceInstance.Spec.Metadata) +vSpec := string(vServiceInstance.Spec.Spec) +vStatus := string(vServiceInstance.Spec.Status) +vName := string(vServiceInstance.Spec.Name) +vNamespace := string(vServiceInstance.Spec.Namespace) +vAnnotations := string(vServiceInstance.Spec.Annotations) +vLabels := string(vServiceInstance.Spec.Labels) +vApiLink := string(vServiceInstance.Spec.ApiLink) +vUid := string(vServiceInstance.Spec.Uid) +vRestartPolicy := string(vServiceInstance.Spec.RestartPolicy) +vDnsPolicy := string(vServiceInstance.Spec.DnsPolicy) +vHostNetwork := bool(vServiceInstance.Spec.HostNetwork) +vSecurityContext := string(vServiceInstance.Spec.SecurityContext) +vTerminationGracePeriodSeconds := int(vServiceInstance.Spec.TerminationGracePeriodSeconds) +vTolerations := string(vServiceInstance.Spec.Tolerations) +vStatusConditions := string(vServiceInstance.Spec.StatusConditions) +vStatusContainer := string(vServiceInstance.Spec.StatusContainer) +vPodIP := string(vServiceInstance.Spec.PodIP) +vQosClass := string(vServiceInstance.Spec.QosClass) +vPhase := string(vServiceInstance.Spec.Phase) +vStartTime := string(vServiceInstance.Spec.StartTime) +vNodeName := string(vServiceInstance.Spec.NodeName) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceInstance { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Name: &vName, + Namespace: &vNamespace, + Annotations: &vAnnotations, + Labels: &vLabels, + ApiLink: &vApiLink, + Uid: &vUid, + RestartPolicy: &vRestartPolicy, + DnsPolicy: &vDnsPolicy, + HostNetwork: &vHostNetwork, + SecurityContext: &vSecurityContext, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Tolerations: &vTolerations, + StatusConditions: &vStatusConditions, + StatusContainer: &vStatusContainer, + PodIP: &vPodIP, + QosClass: &vQosClass, + Phase: &vPhase, + StartTime: &vStartTime, + NodeName: &vNodeName, + } + vGlobalServiceInstanceList = append(vGlobalServiceInstanceList, ret) + } + + log.Debugf("[getGlobalDomainServiceInstancesResolver]Output ServiceInstances objects %v", vGlobalServiceInstanceList) + + return vGlobalServiceInstanceList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceDeployments Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainServiceDeploymentsResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalServiceDeployment, error) { + log.Debugf("[getGlobalDomainServiceDeploymentsResolver]Parent Object %+v", obj) + var vGlobalServiceDeploymentList []*model.GlobalServiceDeployment + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainServiceDeploymentsResolver]Id %q", *id) + vServiceDeployment, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceDeployments(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainServiceDeploymentsResolver]Error getting ServiceDeployments node %q : %s", *id, err) + return vGlobalServiceDeploymentList, nil + } + dn := vServiceDeployment.DisplayName() +parentLabels := map[string]interface{}{"servicedeployments.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceDeployment.Spec.Metadata) +vSpec := string(vServiceDeployment.Spec.Spec) +vStatus := string(vServiceDeployment.Spec.Status) +vNamespace := string(vServiceDeployment.Spec.Namespace) +vAnnotations := string(vServiceDeployment.Spec.Annotations) +vCreationTimestamp := string(vServiceDeployment.Spec.CreationTimestamp) +vLabels := string(vServiceDeployment.Spec.Labels) +vName := string(vServiceDeployment.Spec.Name) +vApiLink := string(vServiceDeployment.Spec.ApiLink) +vUid := string(vServiceDeployment.Spec.Uid) +vGeneration := int(vServiceDeployment.Spec.Generation) +vSelector := string(vServiceDeployment.Spec.Selector) +vReplicas := int(vServiceDeployment.Spec.Replicas) +vDnsPolicy := string(vServiceDeployment.Spec.DnsPolicy) +vRestartPolicy := string(vServiceDeployment.Spec.RestartPolicy) +vSchedulerName := string(vServiceDeployment.Spec.SchedulerName) +vSecurityContext := string(vServiceDeployment.Spec.SecurityContext) +vServiceAccount := string(vServiceDeployment.Spec.ServiceAccount) +vServiceAccountName := string(vServiceDeployment.Spec.ServiceAccountName) +vTerminationGracePeriodSeconds := int(vServiceDeployment.Spec.TerminationGracePeriodSeconds) +vVolumes := string(vServiceDeployment.Spec.Volumes) +vTemplateLabels := string(vServiceDeployment.Spec.TemplateLabels) +vStatusReplicas := int(vServiceDeployment.Spec.StatusReplicas) +vAvailableReplicas := int(vServiceDeployment.Spec.AvailableReplicas) +vUpdatedReplicas := int(vServiceDeployment.Spec.UpdatedReplicas) +vReadyReplicas := int(vServiceDeployment.Spec.ReadyReplicas) +vObservedGeneration := int(vServiceDeployment.Spec.ObservedGeneration) +vConditions := string(vServiceDeployment.Spec.Conditions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDeployment { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Namespace: &vNamespace, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Name: &vName, + ApiLink: &vApiLink, + Uid: &vUid, + Generation: &vGeneration, + Selector: &vSelector, + Replicas: &vReplicas, + DnsPolicy: &vDnsPolicy, + RestartPolicy: &vRestartPolicy, + SchedulerName: &vSchedulerName, + SecurityContext: &vSecurityContext, + ServiceAccount: &vServiceAccount, + ServiceAccountName: &vServiceAccountName, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Volumes: &vVolumes, + TemplateLabels: &vTemplateLabels, + StatusReplicas: &vStatusReplicas, + AvailableReplicas: &vAvailableReplicas, + UpdatedReplicas: &vUpdatedReplicas, + ReadyReplicas: &vReadyReplicas, + ObservedGeneration: &vObservedGeneration, + Conditions: &vConditions, + } + vGlobalServiceDeploymentList = append(vGlobalServiceDeploymentList, ret) + + log.Debugf("[getGlobalDomainServiceDeploymentsResolver]Output ServiceDeployments objects %v", vGlobalServiceDeploymentList) + + return vGlobalServiceDeploymentList, nil + } + + log.Debug("[getGlobalDomainServiceDeploymentsResolver]Id is empty, process all ServiceDeploymentss") + + vServiceDeploymentParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainServiceDeploymentsResolver]Error getting parent node %s", err) + return vGlobalServiceDeploymentList, nil + } + vServiceDeploymentAllObj, err := vServiceDeploymentParent.GetAllServiceDeployments(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainServiceDeploymentsResolver]Error getting ServiceDeployments objects %s", err) + return vGlobalServiceDeploymentList, nil + } + for _, i := range vServiceDeploymentAllObj { + vServiceDeployment, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceDeployments(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainServiceDeploymentsResolver]Error getting ServiceDeployments node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceDeployment.DisplayName() +parentLabels := map[string]interface{}{"servicedeployments.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceDeployment.Spec.Metadata) +vSpec := string(vServiceDeployment.Spec.Spec) +vStatus := string(vServiceDeployment.Spec.Status) +vNamespace := string(vServiceDeployment.Spec.Namespace) +vAnnotations := string(vServiceDeployment.Spec.Annotations) +vCreationTimestamp := string(vServiceDeployment.Spec.CreationTimestamp) +vLabels := string(vServiceDeployment.Spec.Labels) +vName := string(vServiceDeployment.Spec.Name) +vApiLink := string(vServiceDeployment.Spec.ApiLink) +vUid := string(vServiceDeployment.Spec.Uid) +vGeneration := int(vServiceDeployment.Spec.Generation) +vSelector := string(vServiceDeployment.Spec.Selector) +vReplicas := int(vServiceDeployment.Spec.Replicas) +vDnsPolicy := string(vServiceDeployment.Spec.DnsPolicy) +vRestartPolicy := string(vServiceDeployment.Spec.RestartPolicy) +vSchedulerName := string(vServiceDeployment.Spec.SchedulerName) +vSecurityContext := string(vServiceDeployment.Spec.SecurityContext) +vServiceAccount := string(vServiceDeployment.Spec.ServiceAccount) +vServiceAccountName := string(vServiceDeployment.Spec.ServiceAccountName) +vTerminationGracePeriodSeconds := int(vServiceDeployment.Spec.TerminationGracePeriodSeconds) +vVolumes := string(vServiceDeployment.Spec.Volumes) +vTemplateLabels := string(vServiceDeployment.Spec.TemplateLabels) +vStatusReplicas := int(vServiceDeployment.Spec.StatusReplicas) +vAvailableReplicas := int(vServiceDeployment.Spec.AvailableReplicas) +vUpdatedReplicas := int(vServiceDeployment.Spec.UpdatedReplicas) +vReadyReplicas := int(vServiceDeployment.Spec.ReadyReplicas) +vObservedGeneration := int(vServiceDeployment.Spec.ObservedGeneration) +vConditions := string(vServiceDeployment.Spec.Conditions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDeployment { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Namespace: &vNamespace, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Name: &vName, + ApiLink: &vApiLink, + Uid: &vUid, + Generation: &vGeneration, + Selector: &vSelector, + Replicas: &vReplicas, + DnsPolicy: &vDnsPolicy, + RestartPolicy: &vRestartPolicy, + SchedulerName: &vSchedulerName, + SecurityContext: &vSecurityContext, + ServiceAccount: &vServiceAccount, + ServiceAccountName: &vServiceAccountName, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Volumes: &vVolumes, + TemplateLabels: &vTemplateLabels, + StatusReplicas: &vStatusReplicas, + AvailableReplicas: &vAvailableReplicas, + UpdatedReplicas: &vUpdatedReplicas, + ReadyReplicas: &vReadyReplicas, + ObservedGeneration: &vObservedGeneration, + Conditions: &vConditions, + } + vGlobalServiceDeploymentList = append(vGlobalServiceDeploymentList, ret) + } + + log.Debugf("[getGlobalDomainServiceDeploymentsResolver]Output ServiceDeployments objects %v", vGlobalServiceDeploymentList) + + return vGlobalServiceDeploymentList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceStatefulSets Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainServiceStatefulSetsResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalServiceStatefulSet, error) { + log.Debugf("[getGlobalDomainServiceStatefulSetsResolver]Parent Object %+v", obj) + var vGlobalServiceStatefulSetList []*model.GlobalServiceStatefulSet + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainServiceStatefulSetsResolver]Id %q", *id) + vServiceStatefulSet, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceStatefulSets(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainServiceStatefulSetsResolver]Error getting ServiceStatefulSets node %q : %s", *id, err) + return vGlobalServiceStatefulSetList, nil + } + dn := vServiceStatefulSet.DisplayName() +parentLabels := map[string]interface{}{"servicestatefulsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceStatefulSet.Spec.Name) +vMetadata := string(vServiceStatefulSet.Spec.Metadata) +vSpec := string(vServiceStatefulSet.Spec.Spec) +vStatus := string(vServiceStatefulSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceStatefulSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceStatefulSetList = append(vGlobalServiceStatefulSetList, ret) + + log.Debugf("[getGlobalDomainServiceStatefulSetsResolver]Output ServiceStatefulSets objects %v", vGlobalServiceStatefulSetList) + + return vGlobalServiceStatefulSetList, nil + } + + log.Debug("[getGlobalDomainServiceStatefulSetsResolver]Id is empty, process all ServiceStatefulSetss") + + vServiceStatefulSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainServiceStatefulSetsResolver]Error getting parent node %s", err) + return vGlobalServiceStatefulSetList, nil + } + vServiceStatefulSetAllObj, err := vServiceStatefulSetParent.GetAllServiceStatefulSets(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainServiceStatefulSetsResolver]Error getting ServiceStatefulSets objects %s", err) + return vGlobalServiceStatefulSetList, nil + } + for _, i := range vServiceStatefulSetAllObj { + vServiceStatefulSet, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceStatefulSets(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainServiceStatefulSetsResolver]Error getting ServiceStatefulSets node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceStatefulSet.DisplayName() +parentLabels := map[string]interface{}{"servicestatefulsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceStatefulSet.Spec.Name) +vMetadata := string(vServiceStatefulSet.Spec.Metadata) +vSpec := string(vServiceStatefulSet.Spec.Spec) +vStatus := string(vServiceStatefulSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceStatefulSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceStatefulSetList = append(vGlobalServiceStatefulSetList, ret) + } + + log.Debugf("[getGlobalDomainServiceStatefulSetsResolver]Output ServiceStatefulSets objects %v", vGlobalServiceStatefulSetList) + + return vGlobalServiceStatefulSetList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceDaemonSets Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainServiceDaemonSetsResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalServiceDaemonSet, error) { + log.Debugf("[getGlobalDomainServiceDaemonSetsResolver]Parent Object %+v", obj) + var vGlobalServiceDaemonSetList []*model.GlobalServiceDaemonSet + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainServiceDaemonSetsResolver]Id %q", *id) + vServiceDaemonSet, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceDaemonSets(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainServiceDaemonSetsResolver]Error getting ServiceDaemonSets node %q : %s", *id, err) + return vGlobalServiceDaemonSetList, nil + } + dn := vServiceDaemonSet.DisplayName() +parentLabels := map[string]interface{}{"servicedaemonsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceDaemonSet.Spec.Name) +vMetadata := string(vServiceDaemonSet.Spec.Metadata) +vSpec := string(vServiceDaemonSet.Spec.Spec) +vStatus := string(vServiceDaemonSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDaemonSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceDaemonSetList = append(vGlobalServiceDaemonSetList, ret) + + log.Debugf("[getGlobalDomainServiceDaemonSetsResolver]Output ServiceDaemonSets objects %v", vGlobalServiceDaemonSetList) + + return vGlobalServiceDaemonSetList, nil + } + + log.Debug("[getGlobalDomainServiceDaemonSetsResolver]Id is empty, process all ServiceDaemonSetss") + + vServiceDaemonSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainServiceDaemonSetsResolver]Error getting parent node %s", err) + return vGlobalServiceDaemonSetList, nil + } + vServiceDaemonSetAllObj, err := vServiceDaemonSetParent.GetAllServiceDaemonSets(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainServiceDaemonSetsResolver]Error getting ServiceDaemonSets objects %s", err) + return vGlobalServiceDaemonSetList, nil + } + for _, i := range vServiceDaemonSetAllObj { + vServiceDaemonSet, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceDaemonSets(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainServiceDaemonSetsResolver]Error getting ServiceDaemonSets node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceDaemonSet.DisplayName() +parentLabels := map[string]interface{}{"servicedaemonsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceDaemonSet.Spec.Name) +vMetadata := string(vServiceDaemonSet.Spec.Metadata) +vSpec := string(vServiceDaemonSet.Spec.Spec) +vStatus := string(vServiceDaemonSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDaemonSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceDaemonSetList = append(vGlobalServiceDaemonSetList, ret) + } + + log.Debugf("[getGlobalDomainServiceDaemonSetsResolver]Output ServiceDaemonSets objects %v", vGlobalServiceDaemonSetList) + + return vGlobalServiceDaemonSetList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceReplicaSets Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainServiceReplicaSetsResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalServiceReplicaSet, error) { + log.Debugf("[getGlobalDomainServiceReplicaSetsResolver]Parent Object %+v", obj) + var vGlobalServiceReplicaSetList []*model.GlobalServiceReplicaSet + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainServiceReplicaSetsResolver]Id %q", *id) + vServiceReplicaSet, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceReplicaSets(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainServiceReplicaSetsResolver]Error getting ServiceReplicaSets node %q : %s", *id, err) + return vGlobalServiceReplicaSetList, nil + } + dn := vServiceReplicaSet.DisplayName() +parentLabels := map[string]interface{}{"servicereplicasets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceReplicaSet.Spec.Name) +vMetadata := string(vServiceReplicaSet.Spec.Metadata) +vSpec := string(vServiceReplicaSet.Spec.Spec) +vStatus := string(vServiceReplicaSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceReplicaSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceReplicaSetList = append(vGlobalServiceReplicaSetList, ret) + + log.Debugf("[getGlobalDomainServiceReplicaSetsResolver]Output ServiceReplicaSets objects %v", vGlobalServiceReplicaSetList) + + return vGlobalServiceReplicaSetList, nil + } + + log.Debug("[getGlobalDomainServiceReplicaSetsResolver]Id is empty, process all ServiceReplicaSetss") + + vServiceReplicaSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainServiceReplicaSetsResolver]Error getting parent node %s", err) + return vGlobalServiceReplicaSetList, nil + } + vServiceReplicaSetAllObj, err := vServiceReplicaSetParent.GetAllServiceReplicaSets(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainServiceReplicaSetsResolver]Error getting ServiceReplicaSets objects %s", err) + return vGlobalServiceReplicaSetList, nil + } + for _, i := range vServiceReplicaSetAllObj { + vServiceReplicaSet, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceReplicaSets(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainServiceReplicaSetsResolver]Error getting ServiceReplicaSets node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceReplicaSet.DisplayName() +parentLabels := map[string]interface{}{"servicereplicasets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceReplicaSet.Spec.Name) +vMetadata := string(vServiceReplicaSet.Spec.Metadata) +vSpec := string(vServiceReplicaSet.Spec.Spec) +vStatus := string(vServiceReplicaSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceReplicaSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceReplicaSetList = append(vGlobalServiceReplicaSetList, ret) + } + + log.Debugf("[getGlobalDomainServiceReplicaSetsResolver]Output ServiceReplicaSets objects %v", vGlobalServiceReplicaSetList) + + return vGlobalServiceReplicaSetList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceCronJobs Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainServiceCronJobsResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalServiceCronJob, error) { + log.Debugf("[getGlobalDomainServiceCronJobsResolver]Parent Object %+v", obj) + var vGlobalServiceCronJobList []*model.GlobalServiceCronJob + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainServiceCronJobsResolver]Id %q", *id) + vServiceCronJob, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceCronJobs(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainServiceCronJobsResolver]Error getting ServiceCronJobs node %q : %s", *id, err) + return vGlobalServiceCronJobList, nil + } + dn := vServiceCronJob.DisplayName() +parentLabels := map[string]interface{}{"servicecronjobs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceCronJob.Spec.Name) +vMetadata := string(vServiceCronJob.Spec.Metadata) +vSpec := string(vServiceCronJob.Spec.Spec) +vStatus := string(vServiceCronJob.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceCronJob { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceCronJobList = append(vGlobalServiceCronJobList, ret) + + log.Debugf("[getGlobalDomainServiceCronJobsResolver]Output ServiceCronJobs objects %v", vGlobalServiceCronJobList) + + return vGlobalServiceCronJobList, nil + } + + log.Debug("[getGlobalDomainServiceCronJobsResolver]Id is empty, process all ServiceCronJobss") + + vServiceCronJobParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainServiceCronJobsResolver]Error getting parent node %s", err) + return vGlobalServiceCronJobList, nil + } + vServiceCronJobAllObj, err := vServiceCronJobParent.GetAllServiceCronJobs(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainServiceCronJobsResolver]Error getting ServiceCronJobs objects %s", err) + return vGlobalServiceCronJobList, nil + } + for _, i := range vServiceCronJobAllObj { + vServiceCronJob, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceCronJobs(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainServiceCronJobsResolver]Error getting ServiceCronJobs node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceCronJob.DisplayName() +parentLabels := map[string]interface{}{"servicecronjobs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceCronJob.Spec.Name) +vMetadata := string(vServiceCronJob.Spec.Metadata) +vSpec := string(vServiceCronJob.Spec.Spec) +vStatus := string(vServiceCronJob.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceCronJob { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceCronJobList = append(vGlobalServiceCronJobList, ret) + } + + log.Debugf("[getGlobalDomainServiceCronJobsResolver]Output ServiceCronJobs objects %v", vGlobalServiceCronJobList) + + return vGlobalServiceCronJobList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceJobs Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainServiceJobsResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalServiceJob, error) { + log.Debugf("[getGlobalDomainServiceJobsResolver]Parent Object %+v", obj) + var vGlobalServiceJobList []*model.GlobalServiceJob + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainServiceJobsResolver]Id %q", *id) + vServiceJob, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceJobs(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainServiceJobsResolver]Error getting ServiceJobs node %q : %s", *id, err) + return vGlobalServiceJobList, nil + } + dn := vServiceJob.DisplayName() +parentLabels := map[string]interface{}{"servicejobs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceJob.Spec.Name) +vMetadata := string(vServiceJob.Spec.Metadata) +vSpec := string(vServiceJob.Spec.Spec) +vStatus := string(vServiceJob.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceJob { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceJobList = append(vGlobalServiceJobList, ret) + + log.Debugf("[getGlobalDomainServiceJobsResolver]Output ServiceJobs objects %v", vGlobalServiceJobList) + + return vGlobalServiceJobList, nil + } + + log.Debug("[getGlobalDomainServiceJobsResolver]Id is empty, process all ServiceJobss") + + vServiceJobParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainServiceJobsResolver]Error getting parent node %s", err) + return vGlobalServiceJobList, nil + } + vServiceJobAllObj, err := vServiceJobParent.GetAllServiceJobs(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainServiceJobsResolver]Error getting ServiceJobs objects %s", err) + return vGlobalServiceJobList, nil + } + for _, i := range vServiceJobAllObj { + vServiceJob, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceJobs(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainServiceJobsResolver]Error getting ServiceJobs node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceJob.DisplayName() +parentLabels := map[string]interface{}{"servicejobs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceJob.Spec.Name) +vMetadata := string(vServiceJob.Spec.Metadata) +vSpec := string(vServiceJob.Spec.Spec) +vStatus := string(vServiceJob.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceJob { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceJobList = append(vGlobalServiceJobList, ret) + } + + log.Debugf("[getGlobalDomainServiceJobsResolver]Output ServiceJobs objects %v", vGlobalServiceJobList) + + return vGlobalServiceJobList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: VirtualServices Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainVirtualServicesResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalVirtualService, error) { + log.Debugf("[getGlobalDomainVirtualServicesResolver]Parent Object %+v", obj) + var vGlobalVirtualServiceList []*model.GlobalVirtualService + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainVirtualServicesResolver]Id %q", *id) + vVirtualService, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetVirtualServices(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainVirtualServicesResolver]Error getting VirtualServices node %q : %s", *id, err) + return vGlobalVirtualServiceList, nil + } + dn := vVirtualService.DisplayName() +parentLabels := map[string]interface{}{"virtualservices.global.tsm.tanzu.vmware.com":dn} +vName := string(vVirtualService.Spec.Name) +vCreationTimestamp := string(vVirtualService.Spec.CreationTimestamp) +vApiLink := string(vVirtualService.Spec.ApiLink) +vUid := string(vVirtualService.Spec.Uid) +vAnnotations := string(vVirtualService.Spec.Annotations) +vLabels := string(vVirtualService.Spec.Labels) +vHosts := string(vVirtualService.Spec.Hosts) +vHttp := string(vVirtualService.Spec.Http) +vTls := string(vVirtualService.Spec.Tls) +vTcp := string(vVirtualService.Spec.Tcp) +vGatewayNames := string(vVirtualService.Spec.GatewayNames) +ExportTo, _ := json.Marshal(vVirtualService.Spec.ExportTo) +ExportToData := string(ExportTo) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalVirtualService { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + CreationTimestamp: &vCreationTimestamp, + ApiLink: &vApiLink, + Uid: &vUid, + Annotations: &vAnnotations, + Labels: &vLabels, + Hosts: &vHosts, + Http: &vHttp, + Tls: &vTls, + Tcp: &vTcp, + GatewayNames: &vGatewayNames, + ExportTo: &ExportToData, + } + vGlobalVirtualServiceList = append(vGlobalVirtualServiceList, ret) + + log.Debugf("[getGlobalDomainVirtualServicesResolver]Output VirtualServices objects %v", vGlobalVirtualServiceList) + + return vGlobalVirtualServiceList, nil + } + + log.Debug("[getGlobalDomainVirtualServicesResolver]Id is empty, process all VirtualServicess") + + vVirtualServiceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainVirtualServicesResolver]Error getting parent node %s", err) + return vGlobalVirtualServiceList, nil + } + vVirtualServiceAllObj, err := vVirtualServiceParent.GetAllVirtualServices(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainVirtualServicesResolver]Error getting VirtualServices objects %s", err) + return vGlobalVirtualServiceList, nil + } + for _, i := range vVirtualServiceAllObj { + vVirtualService, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetVirtualServices(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainVirtualServicesResolver]Error getting VirtualServices node %q : %s", i.DisplayName(), err) + continue + } + dn := vVirtualService.DisplayName() +parentLabels := map[string]interface{}{"virtualservices.global.tsm.tanzu.vmware.com":dn} +vName := string(vVirtualService.Spec.Name) +vCreationTimestamp := string(vVirtualService.Spec.CreationTimestamp) +vApiLink := string(vVirtualService.Spec.ApiLink) +vUid := string(vVirtualService.Spec.Uid) +vAnnotations := string(vVirtualService.Spec.Annotations) +vLabels := string(vVirtualService.Spec.Labels) +vHosts := string(vVirtualService.Spec.Hosts) +vHttp := string(vVirtualService.Spec.Http) +vTls := string(vVirtualService.Spec.Tls) +vTcp := string(vVirtualService.Spec.Tcp) +vGatewayNames := string(vVirtualService.Spec.GatewayNames) +ExportTo, _ := json.Marshal(vVirtualService.Spec.ExportTo) +ExportToData := string(ExportTo) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalVirtualService { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + CreationTimestamp: &vCreationTimestamp, + ApiLink: &vApiLink, + Uid: &vUid, + Annotations: &vAnnotations, + Labels: &vLabels, + Hosts: &vHosts, + Http: &vHttp, + Tls: &vTls, + Tcp: &vTcp, + GatewayNames: &vGatewayNames, + ExportTo: &ExportToData, + } + vGlobalVirtualServiceList = append(vGlobalVirtualServiceList, ret) + } + + log.Debugf("[getGlobalDomainVirtualServicesResolver]Output VirtualServices objects %v", vGlobalVirtualServiceList) + + return vGlobalVirtualServiceList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceEntry Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainServiceEntryResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalServiceEntry, error) { + log.Debugf("[getGlobalDomainServiceEntryResolver]Parent Object %+v", obj) + var vGlobalServiceEntryList []*model.GlobalServiceEntry + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainServiceEntryResolver]Id %q", *id) + vServiceEntry, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceEntry(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainServiceEntryResolver]Error getting ServiceEntry node %q : %s", *id, err) + return vGlobalServiceEntryList, nil + } + dn := vServiceEntry.DisplayName() +parentLabels := map[string]interface{}{"serviceentries.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceEntry.Spec.Name) +vAnnotations := string(vServiceEntry.Spec.Annotations) +vLabels := string(vServiceEntry.Spec.Labels) +vCreationTimestamp := string(vServiceEntry.Spec.CreationTimestamp) +vApiLink := string(vServiceEntry.Spec.ApiLink) +vUid := string(vServiceEntry.Spec.Uid) +vHosts := string(vServiceEntry.Spec.Hosts) +vAddresses := string(vServiceEntry.Spec.Addresses) +vPorts := string(vServiceEntry.Spec.Ports) +vLocation := string(vServiceEntry.Spec.Location) +vResolution := string(vServiceEntry.Spec.Resolution) +vEndpoints := string(vServiceEntry.Spec.Endpoints) +ExportTo, _ := json.Marshal(vServiceEntry.Spec.ExportTo) +ExportToData := string(ExportTo) +vWorkloadSelectorLabels := string(vServiceEntry.Spec.WorkloadSelectorLabels) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceEntry { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Annotations: &vAnnotations, + Labels: &vLabels, + CreationTimestamp: &vCreationTimestamp, + ApiLink: &vApiLink, + Uid: &vUid, + Hosts: &vHosts, + Addresses: &vAddresses, + Ports: &vPorts, + Location: &vLocation, + Resolution: &vResolution, + Endpoints: &vEndpoints, + ExportTo: &ExportToData, + WorkloadSelectorLabels: &vWorkloadSelectorLabels, + } + vGlobalServiceEntryList = append(vGlobalServiceEntryList, ret) + + log.Debugf("[getGlobalDomainServiceEntryResolver]Output ServiceEntry objects %v", vGlobalServiceEntryList) + + return vGlobalServiceEntryList, nil + } + + log.Debug("[getGlobalDomainServiceEntryResolver]Id is empty, process all ServiceEntrys") + + vServiceEntryParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainServiceEntryResolver]Error getting parent node %s", err) + return vGlobalServiceEntryList, nil + } + vServiceEntryAllObj, err := vServiceEntryParent.GetAllServiceEntry(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainServiceEntryResolver]Error getting ServiceEntry objects %s", err) + return vGlobalServiceEntryList, nil + } + for _, i := range vServiceEntryAllObj { + vServiceEntry, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceEntry(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainServiceEntryResolver]Error getting ServiceEntry node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceEntry.DisplayName() +parentLabels := map[string]interface{}{"serviceentries.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceEntry.Spec.Name) +vAnnotations := string(vServiceEntry.Spec.Annotations) +vLabels := string(vServiceEntry.Spec.Labels) +vCreationTimestamp := string(vServiceEntry.Spec.CreationTimestamp) +vApiLink := string(vServiceEntry.Spec.ApiLink) +vUid := string(vServiceEntry.Spec.Uid) +vHosts := string(vServiceEntry.Spec.Hosts) +vAddresses := string(vServiceEntry.Spec.Addresses) +vPorts := string(vServiceEntry.Spec.Ports) +vLocation := string(vServiceEntry.Spec.Location) +vResolution := string(vServiceEntry.Spec.Resolution) +vEndpoints := string(vServiceEntry.Spec.Endpoints) +ExportTo, _ := json.Marshal(vServiceEntry.Spec.ExportTo) +ExportToData := string(ExportTo) +vWorkloadSelectorLabels := string(vServiceEntry.Spec.WorkloadSelectorLabels) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceEntry { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Annotations: &vAnnotations, + Labels: &vLabels, + CreationTimestamp: &vCreationTimestamp, + ApiLink: &vApiLink, + Uid: &vUid, + Hosts: &vHosts, + Addresses: &vAddresses, + Ports: &vPorts, + Location: &vLocation, + Resolution: &vResolution, + Endpoints: &vEndpoints, + ExportTo: &ExportToData, + WorkloadSelectorLabels: &vWorkloadSelectorLabels, + } + vGlobalServiceEntryList = append(vGlobalServiceEntryList, ret) + } + + log.Debugf("[getGlobalDomainServiceEntryResolver]Output ServiceEntry objects %v", vGlobalServiceEntryList) + + return vGlobalServiceEntryList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: WorkloadEntry Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainWorkloadEntryResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalWorkloadEntry, error) { + log.Debugf("[getGlobalDomainWorkloadEntryResolver]Parent Object %+v", obj) + var vGlobalWorkloadEntryList []*model.GlobalWorkloadEntry + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainWorkloadEntryResolver]Id %q", *id) + vWorkloadEntry, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetWorkloadEntry(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainWorkloadEntryResolver]Error getting WorkloadEntry node %q : %s", *id, err) + return vGlobalWorkloadEntryList, nil + } + dn := vWorkloadEntry.DisplayName() +parentLabels := map[string]interface{}{"workloadentries.global.tsm.tanzu.vmware.com":dn} +vName := string(vWorkloadEntry.Spec.Name) +vAnnotations := string(vWorkloadEntry.Spec.Annotations) +vLabels := string(vWorkloadEntry.Spec.Labels) +vCreationTimestamp := string(vWorkloadEntry.Spec.CreationTimestamp) +vApiLink := string(vWorkloadEntry.Spec.ApiLink) +vUid := string(vWorkloadEntry.Spec.Uid) +vAddress := string(vWorkloadEntry.Spec.Address) +vWorkloadLabels := string(vWorkloadEntry.Spec.WorkloadLabels) +vPorts := string(vWorkloadEntry.Spec.Ports) +vLocality := string(vWorkloadEntry.Spec.Locality) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalWorkloadEntry { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Annotations: &vAnnotations, + Labels: &vLabels, + CreationTimestamp: &vCreationTimestamp, + ApiLink: &vApiLink, + Uid: &vUid, + Address: &vAddress, + WorkloadLabels: &vWorkloadLabels, + Ports: &vPorts, + Locality: &vLocality, + } + vGlobalWorkloadEntryList = append(vGlobalWorkloadEntryList, ret) + + log.Debugf("[getGlobalDomainWorkloadEntryResolver]Output WorkloadEntry objects %v", vGlobalWorkloadEntryList) + + return vGlobalWorkloadEntryList, nil + } + + log.Debug("[getGlobalDomainWorkloadEntryResolver]Id is empty, process all WorkloadEntrys") + + vWorkloadEntryParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainWorkloadEntryResolver]Error getting parent node %s", err) + return vGlobalWorkloadEntryList, nil + } + vWorkloadEntryAllObj, err := vWorkloadEntryParent.GetAllWorkloadEntry(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainWorkloadEntryResolver]Error getting WorkloadEntry objects %s", err) + return vGlobalWorkloadEntryList, nil + } + for _, i := range vWorkloadEntryAllObj { + vWorkloadEntry, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetWorkloadEntry(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainWorkloadEntryResolver]Error getting WorkloadEntry node %q : %s", i.DisplayName(), err) + continue + } + dn := vWorkloadEntry.DisplayName() +parentLabels := map[string]interface{}{"workloadentries.global.tsm.tanzu.vmware.com":dn} +vName := string(vWorkloadEntry.Spec.Name) +vAnnotations := string(vWorkloadEntry.Spec.Annotations) +vLabels := string(vWorkloadEntry.Spec.Labels) +vCreationTimestamp := string(vWorkloadEntry.Spec.CreationTimestamp) +vApiLink := string(vWorkloadEntry.Spec.ApiLink) +vUid := string(vWorkloadEntry.Spec.Uid) +vAddress := string(vWorkloadEntry.Spec.Address) +vWorkloadLabels := string(vWorkloadEntry.Spec.WorkloadLabels) +vPorts := string(vWorkloadEntry.Spec.Ports) +vLocality := string(vWorkloadEntry.Spec.Locality) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalWorkloadEntry { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Annotations: &vAnnotations, + Labels: &vLabels, + CreationTimestamp: &vCreationTimestamp, + ApiLink: &vApiLink, + Uid: &vUid, + Address: &vAddress, + WorkloadLabels: &vWorkloadLabels, + Ports: &vPorts, + Locality: &vLocality, + } + vGlobalWorkloadEntryList = append(vGlobalWorkloadEntryList, ret) + } + + log.Debugf("[getGlobalDomainWorkloadEntryResolver]Output WorkloadEntry objects %v", vGlobalWorkloadEntryList) + + return vGlobalWorkloadEntryList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: DestinationRules Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainDestinationRulesResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalDestinationRule, error) { + log.Debugf("[getGlobalDomainDestinationRulesResolver]Parent Object %+v", obj) + var vGlobalDestinationRuleList []*model.GlobalDestinationRule + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainDestinationRulesResolver]Id %q", *id) + vDestinationRule, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainDestinationRulesResolver]Error getting DestinationRules node %q : %s", *id, err) + return vGlobalDestinationRuleList, nil + } + dn := vDestinationRule.DisplayName() +parentLabels := map[string]interface{}{"destinationrules.global.tsm.tanzu.vmware.com":dn} +vName := string(vDestinationRule.Spec.Name) +vAnnotations := string(vDestinationRule.Spec.Annotations) +vLabels := string(vDestinationRule.Spec.Labels) +vCreationTimestamp := string(vDestinationRule.Spec.CreationTimestamp) +vApiLink := string(vDestinationRule.Spec.ApiLink) +vUid := string(vDestinationRule.Spec.Uid) +vHost := string(vDestinationRule.Spec.Host) +vTrafficPolicy := string(vDestinationRule.Spec.TrafficPolicy) +vSubsets := string(vDestinationRule.Spec.Subsets) +ExportTo, _ := json.Marshal(vDestinationRule.Spec.ExportTo) +ExportToData := string(ExportTo) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDestinationRule { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Annotations: &vAnnotations, + Labels: &vLabels, + CreationTimestamp: &vCreationTimestamp, + ApiLink: &vApiLink, + Uid: &vUid, + Host: &vHost, + TrafficPolicy: &vTrafficPolicy, + Subsets: &vSubsets, + ExportTo: &ExportToData, + } + vGlobalDestinationRuleList = append(vGlobalDestinationRuleList, ret) + + log.Debugf("[getGlobalDomainDestinationRulesResolver]Output DestinationRules objects %v", vGlobalDestinationRuleList) + + return vGlobalDestinationRuleList, nil + } + + log.Debug("[getGlobalDomainDestinationRulesResolver]Id is empty, process all DestinationRuless") + + vDestinationRuleParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainDestinationRulesResolver]Error getting parent node %s", err) + return vGlobalDestinationRuleList, nil + } + vDestinationRuleAllObj, err := vDestinationRuleParent.GetAllDestinationRules(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainDestinationRulesResolver]Error getting DestinationRules objects %s", err) + return vGlobalDestinationRuleList, nil + } + for _, i := range vDestinationRuleAllObj { + vDestinationRule, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetDestinationRules(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainDestinationRulesResolver]Error getting DestinationRules node %q : %s", i.DisplayName(), err) + continue + } + dn := vDestinationRule.DisplayName() +parentLabels := map[string]interface{}{"destinationrules.global.tsm.tanzu.vmware.com":dn} +vName := string(vDestinationRule.Spec.Name) +vAnnotations := string(vDestinationRule.Spec.Annotations) +vLabels := string(vDestinationRule.Spec.Labels) +vCreationTimestamp := string(vDestinationRule.Spec.CreationTimestamp) +vApiLink := string(vDestinationRule.Spec.ApiLink) +vUid := string(vDestinationRule.Spec.Uid) +vHost := string(vDestinationRule.Spec.Host) +vTrafficPolicy := string(vDestinationRule.Spec.TrafficPolicy) +vSubsets := string(vDestinationRule.Spec.Subsets) +ExportTo, _ := json.Marshal(vDestinationRule.Spec.ExportTo) +ExportToData := string(ExportTo) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDestinationRule { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Annotations: &vAnnotations, + Labels: &vLabels, + CreationTimestamp: &vCreationTimestamp, + ApiLink: &vApiLink, + Uid: &vUid, + Host: &vHost, + TrafficPolicy: &vTrafficPolicy, + Subsets: &vSubsets, + ExportTo: &ExportToData, + } + vGlobalDestinationRuleList = append(vGlobalDestinationRuleList, ret) + } + + log.Debugf("[getGlobalDomainDestinationRulesResolver]Output DestinationRules objects %v", vGlobalDestinationRuleList) + + return vGlobalDestinationRuleList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Services Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainServicesResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalService, error) { + log.Debugf("[getGlobalDomainServicesResolver]Parent Object %+v", obj) + var vGlobalServiceList []*model.GlobalService + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainServicesResolver]Id %q", *id) + vService, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainServicesResolver]Error getting Services node %q : %s", *id, err) + return vGlobalServiceList, nil + } + dn := vService.DisplayName() +parentLabels := map[string]interface{}{"services.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vService.Spec.Metadata) +vSpec := string(vService.Spec.Spec) +vName := string(vService.Spec.Name) +vNamespace := string(vService.Spec.Namespace) +vApiLink := string(vService.Spec.ApiLink) +vIpAddress := string(vService.Spec.IpAddress) +vAnnotations := string(vService.Spec.Annotations) +vCreationTimestamp := string(vService.Spec.CreationTimestamp) +vLabels := string(vService.Spec.Labels) +vUid := string(vService.Spec.Uid) +vPorts := string(vService.Spec.Ports) +vSelector := string(vService.Spec.Selector) +vType := string(vService.Spec.Type) +vStatus := string(vService.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalService { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Name: &vName, + Namespace: &vNamespace, + ApiLink: &vApiLink, + IpAddress: &vIpAddress, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Uid: &vUid, + Ports: &vPorts, + Selector: &vSelector, + Type: &vType, + Status: &vStatus, + } + vGlobalServiceList = append(vGlobalServiceList, ret) + + log.Debugf("[getGlobalDomainServicesResolver]Output Services objects %v", vGlobalServiceList) + + return vGlobalServiceList, nil + } + + log.Debug("[getGlobalDomainServicesResolver]Id is empty, process all Servicess") + + vServiceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainServicesResolver]Error getting parent node %s", err) + return vGlobalServiceList, nil + } + vServiceAllObj, err := vServiceParent.GetAllServices(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainServicesResolver]Error getting Services objects %s", err) + return vGlobalServiceList, nil + } + for _, i := range vServiceAllObj { + vService, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainServicesResolver]Error getting Services node %q : %s", i.DisplayName(), err) + continue + } + dn := vService.DisplayName() +parentLabels := map[string]interface{}{"services.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vService.Spec.Metadata) +vSpec := string(vService.Spec.Spec) +vName := string(vService.Spec.Name) +vNamespace := string(vService.Spec.Namespace) +vApiLink := string(vService.Spec.ApiLink) +vIpAddress := string(vService.Spec.IpAddress) +vAnnotations := string(vService.Spec.Annotations) +vCreationTimestamp := string(vService.Spec.CreationTimestamp) +vLabels := string(vService.Spec.Labels) +vUid := string(vService.Spec.Uid) +vPorts := string(vService.Spec.Ports) +vSelector := string(vService.Spec.Selector) +vType := string(vService.Spec.Type) +vStatus := string(vService.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalService { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Name: &vName, + Namespace: &vNamespace, + ApiLink: &vApiLink, + IpAddress: &vIpAddress, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Uid: &vUid, + Ports: &vPorts, + Selector: &vSelector, + Type: &vType, + Status: &vStatus, + } + vGlobalServiceList = append(vGlobalServiceList, ret) + } + + log.Debugf("[getGlobalDomainServicesResolver]Output Services objects %v", vGlobalServiceList) + + return vGlobalServiceList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Endpoints Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainEndpointsResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalEndpoints, error) { + log.Debugf("[getGlobalDomainEndpointsResolver]Parent Object %+v", obj) + var vGlobalEndpointsList []*model.GlobalEndpoints + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainEndpointsResolver]Id %q", *id) + vEndpoints, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetEndpoints(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainEndpointsResolver]Error getting Endpoints node %q : %s", *id, err) + return vGlobalEndpointsList, nil + } + dn := vEndpoints.DisplayName() +parentLabels := map[string]interface{}{"endpoints.global.tsm.tanzu.vmware.com":dn} +vName := string(vEndpoints.Spec.Name) +vMetadata := string(vEndpoints.Spec.Metadata) +vSubsets := string(vEndpoints.Spec.Subsets) +vGnsId := string(vEndpoints.Spec.GnsId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalEndpoints { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Subsets: &vSubsets, + GnsId: &vGnsId, + } + vGlobalEndpointsList = append(vGlobalEndpointsList, ret) + + log.Debugf("[getGlobalDomainEndpointsResolver]Output Endpoints objects %v", vGlobalEndpointsList) + + return vGlobalEndpointsList, nil + } + + log.Debug("[getGlobalDomainEndpointsResolver]Id is empty, process all Endpointss") + + vEndpointsParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainEndpointsResolver]Error getting parent node %s", err) + return vGlobalEndpointsList, nil + } + vEndpointsAllObj, err := vEndpointsParent.GetAllEndpoints(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainEndpointsResolver]Error getting Endpoints objects %s", err) + return vGlobalEndpointsList, nil + } + for _, i := range vEndpointsAllObj { + vEndpoints, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetEndpoints(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainEndpointsResolver]Error getting Endpoints node %q : %s", i.DisplayName(), err) + continue + } + dn := vEndpoints.DisplayName() +parentLabels := map[string]interface{}{"endpoints.global.tsm.tanzu.vmware.com":dn} +vName := string(vEndpoints.Spec.Name) +vMetadata := string(vEndpoints.Spec.Metadata) +vSubsets := string(vEndpoints.Spec.Subsets) +vGnsId := string(vEndpoints.Spec.GnsId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalEndpoints { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Subsets: &vSubsets, + GnsId: &vGnsId, + } + vGlobalEndpointsList = append(vGlobalEndpointsList, ret) + } + + log.Debugf("[getGlobalDomainEndpointsResolver]Output Endpoints objects %v", vGlobalEndpointsList) + + return vGlobalEndpointsList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Gateways Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainGatewaysResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalGateway, error) { + log.Debugf("[getGlobalDomainGatewaysResolver]Parent Object %+v", obj) + var vGlobalGatewayList []*model.GlobalGateway + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainGatewaysResolver]Id %q", *id) + vGateway, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetGateways(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainGatewaysResolver]Error getting Gateways node %q : %s", *id, err) + return vGlobalGatewayList, nil + } + dn := vGateway.DisplayName() +parentLabels := map[string]interface{}{"gateways.global.tsm.tanzu.vmware.com":dn} +vName := string(vGateway.Spec.Name) +vLabels := string(vGateway.Spec.Labels) +vAnnotations := string(vGateway.Spec.Annotations) +vSpec := string(vGateway.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGateway { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Labels: &vLabels, + Annotations: &vAnnotations, + Spec: &vSpec, + } + vGlobalGatewayList = append(vGlobalGatewayList, ret) + + log.Debugf("[getGlobalDomainGatewaysResolver]Output Gateways objects %v", vGlobalGatewayList) + + return vGlobalGatewayList, nil + } + + log.Debug("[getGlobalDomainGatewaysResolver]Id is empty, process all Gatewayss") + + vGatewayParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainGatewaysResolver]Error getting parent node %s", err) + return vGlobalGatewayList, nil + } + vGatewayAllObj, err := vGatewayParent.GetAllGateways(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainGatewaysResolver]Error getting Gateways objects %s", err) + return vGlobalGatewayList, nil + } + for _, i := range vGatewayAllObj { + vGateway, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetGateways(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainGatewaysResolver]Error getting Gateways node %q : %s", i.DisplayName(), err) + continue + } + dn := vGateway.DisplayName() +parentLabels := map[string]interface{}{"gateways.global.tsm.tanzu.vmware.com":dn} +vName := string(vGateway.Spec.Name) +vLabels := string(vGateway.Spec.Labels) +vAnnotations := string(vGateway.Spec.Annotations) +vSpec := string(vGateway.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGateway { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Labels: &vLabels, + Annotations: &vAnnotations, + Spec: &vSpec, + } + vGlobalGatewayList = append(vGlobalGatewayList, ret) + } + + log.Debugf("[getGlobalDomainGatewaysResolver]Output Gateways objects %v", vGlobalGatewayList) + + return vGlobalGatewayList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: AuthenticationPolicies Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainAuthenticationPoliciesResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalAuthenticationPolicy, error) { + log.Debugf("[getGlobalDomainAuthenticationPoliciesResolver]Parent Object %+v", obj) + var vGlobalAuthenticationPolicyList []*model.GlobalAuthenticationPolicy + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainAuthenticationPoliciesResolver]Id %q", *id) + vAuthenticationPolicy, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetAuthenticationPolicies(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainAuthenticationPoliciesResolver]Error getting AuthenticationPolicies node %q : %s", *id, err) + return vGlobalAuthenticationPolicyList, nil + } + dn := vAuthenticationPolicy.DisplayName() +parentLabels := map[string]interface{}{"authenticationpolicies.global.tsm.tanzu.vmware.com":dn} +vName := string(vAuthenticationPolicy.Spec.Name) +vLabels := string(vAuthenticationPolicy.Spec.Labels) +vAnnotations := string(vAuthenticationPolicy.Spec.Annotations) +vSpec := string(vAuthenticationPolicy.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAuthenticationPolicy { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Labels: &vLabels, + Annotations: &vAnnotations, + Spec: &vSpec, + } + vGlobalAuthenticationPolicyList = append(vGlobalAuthenticationPolicyList, ret) + + log.Debugf("[getGlobalDomainAuthenticationPoliciesResolver]Output AuthenticationPolicies objects %v", vGlobalAuthenticationPolicyList) + + return vGlobalAuthenticationPolicyList, nil + } + + log.Debug("[getGlobalDomainAuthenticationPoliciesResolver]Id is empty, process all AuthenticationPoliciess") + + vAuthenticationPolicyParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainAuthenticationPoliciesResolver]Error getting parent node %s", err) + return vGlobalAuthenticationPolicyList, nil + } + vAuthenticationPolicyAllObj, err := vAuthenticationPolicyParent.GetAllAuthenticationPolicies(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainAuthenticationPoliciesResolver]Error getting AuthenticationPolicies objects %s", err) + return vGlobalAuthenticationPolicyList, nil + } + for _, i := range vAuthenticationPolicyAllObj { + vAuthenticationPolicy, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetAuthenticationPolicies(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainAuthenticationPoliciesResolver]Error getting AuthenticationPolicies node %q : %s", i.DisplayName(), err) + continue + } + dn := vAuthenticationPolicy.DisplayName() +parentLabels := map[string]interface{}{"authenticationpolicies.global.tsm.tanzu.vmware.com":dn} +vName := string(vAuthenticationPolicy.Spec.Name) +vLabels := string(vAuthenticationPolicy.Spec.Labels) +vAnnotations := string(vAuthenticationPolicy.Spec.Annotations) +vSpec := string(vAuthenticationPolicy.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAuthenticationPolicy { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Labels: &vLabels, + Annotations: &vAnnotations, + Spec: &vSpec, + } + vGlobalAuthenticationPolicyList = append(vGlobalAuthenticationPolicyList, ret) + } + + log.Debugf("[getGlobalDomainAuthenticationPoliciesResolver]Output AuthenticationPolicies objects %v", vGlobalAuthenticationPolicyList) + + return vGlobalAuthenticationPolicyList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Configmap Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainConfigmapResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalConfigMap, error) { + log.Debugf("[getGlobalDomainConfigmapResolver]Parent Object %+v", obj) + var vGlobalConfigMapList []*model.GlobalConfigMap + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainConfigmapResolver]Id %q", *id) + vConfigMap, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetConfigmap(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainConfigmapResolver]Error getting Configmap node %q : %s", *id, err) + return vGlobalConfigMapList, nil + } + dn := vConfigMap.DisplayName() +parentLabels := map[string]interface{}{"configmaps.global.tsm.tanzu.vmware.com":dn} +vName := string(vConfigMap.Spec.Name) +vAnnotations := string(vConfigMap.Spec.Annotations) +vLabels := string(vConfigMap.Spec.Labels) +vMetadata := string(vConfigMap.Spec.Metadata) +vData := string(vConfigMap.Spec.Data) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalConfigMap { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Annotations: &vAnnotations, + Labels: &vLabels, + Metadata: &vMetadata, + Data: &vData, + } + vGlobalConfigMapList = append(vGlobalConfigMapList, ret) + + log.Debugf("[getGlobalDomainConfigmapResolver]Output Configmap objects %v", vGlobalConfigMapList) + + return vGlobalConfigMapList, nil + } + + log.Debug("[getGlobalDomainConfigmapResolver]Id is empty, process all Configmaps") + + vConfigMapParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainConfigmapResolver]Error getting parent node %s", err) + return vGlobalConfigMapList, nil + } + vConfigMapAllObj, err := vConfigMapParent.GetAllConfigmap(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainConfigmapResolver]Error getting Configmap objects %s", err) + return vGlobalConfigMapList, nil + } + for _, i := range vConfigMapAllObj { + vConfigMap, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetConfigmap(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainConfigmapResolver]Error getting Configmap node %q : %s", i.DisplayName(), err) + continue + } + dn := vConfigMap.DisplayName() +parentLabels := map[string]interface{}{"configmaps.global.tsm.tanzu.vmware.com":dn} +vName := string(vConfigMap.Spec.Name) +vAnnotations := string(vConfigMap.Spec.Annotations) +vLabels := string(vConfigMap.Spec.Labels) +vMetadata := string(vConfigMap.Spec.Metadata) +vData := string(vConfigMap.Spec.Data) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalConfigMap { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Annotations: &vAnnotations, + Labels: &vLabels, + Metadata: &vMetadata, + Data: &vData, + } + vGlobalConfigMapList = append(vGlobalConfigMapList, ret) + } + + log.Debugf("[getGlobalDomainConfigmapResolver]Output Configmap objects %v", vGlobalConfigMapList) + + return vGlobalConfigMapList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Envoyfilter Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainEnvoyfilterResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalEnvoyFilter, error) { + log.Debugf("[getGlobalDomainEnvoyfilterResolver]Parent Object %+v", obj) + var vGlobalEnvoyFilterList []*model.GlobalEnvoyFilter + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainEnvoyfilterResolver]Id %q", *id) + vEnvoyFilter, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetEnvoyfilter(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainEnvoyfilterResolver]Error getting Envoyfilter node %q : %s", *id, err) + return vGlobalEnvoyFilterList, nil + } + dn := vEnvoyFilter.DisplayName() +parentLabels := map[string]interface{}{"envoyfilters.global.tsm.tanzu.vmware.com":dn} +vName := string(vEnvoyFilter.Spec.Name) +vLabels := string(vEnvoyFilter.Spec.Labels) +vAnnotations := string(vEnvoyFilter.Spec.Annotations) +vSpec := string(vEnvoyFilter.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalEnvoyFilter { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Labels: &vLabels, + Annotations: &vAnnotations, + Spec: &vSpec, + } + vGlobalEnvoyFilterList = append(vGlobalEnvoyFilterList, ret) + + log.Debugf("[getGlobalDomainEnvoyfilterResolver]Output Envoyfilter objects %v", vGlobalEnvoyFilterList) + + return vGlobalEnvoyFilterList, nil + } + + log.Debug("[getGlobalDomainEnvoyfilterResolver]Id is empty, process all Envoyfilters") + + vEnvoyFilterParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainEnvoyfilterResolver]Error getting parent node %s", err) + return vGlobalEnvoyFilterList, nil + } + vEnvoyFilterAllObj, err := vEnvoyFilterParent.GetAllEnvoyfilter(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainEnvoyfilterResolver]Error getting Envoyfilter objects %s", err) + return vGlobalEnvoyFilterList, nil + } + for _, i := range vEnvoyFilterAllObj { + vEnvoyFilter, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetEnvoyfilter(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainEnvoyfilterResolver]Error getting Envoyfilter node %q : %s", i.DisplayName(), err) + continue + } + dn := vEnvoyFilter.DisplayName() +parentLabels := map[string]interface{}{"envoyfilters.global.tsm.tanzu.vmware.com":dn} +vName := string(vEnvoyFilter.Spec.Name) +vLabels := string(vEnvoyFilter.Spec.Labels) +vAnnotations := string(vEnvoyFilter.Spec.Annotations) +vSpec := string(vEnvoyFilter.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalEnvoyFilter { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Labels: &vLabels, + Annotations: &vAnnotations, + Spec: &vSpec, + } + vGlobalEnvoyFilterList = append(vGlobalEnvoyFilterList, ret) + } + + log.Debugf("[getGlobalDomainEnvoyfilterResolver]Output Envoyfilter objects %v", vGlobalEnvoyFilterList) + + return vGlobalEnvoyFilterList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Autoscalers Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainAutoscalersResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalAutoscalerCR, error) { + log.Debugf("[getGlobalDomainAutoscalersResolver]Parent Object %+v", obj) + var vGlobalAutoscalerCRList []*model.GlobalAutoscalerCR + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainAutoscalersResolver]Id %q", *id) + vAutoscalerCR, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetAutoscalers(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainAutoscalersResolver]Error getting Autoscalers node %q : %s", *id, err) + return vGlobalAutoscalerCRList, nil + } + dn := vAutoscalerCR.DisplayName() +parentLabels := map[string]interface{}{"autoscalercrs.global.tsm.tanzu.vmware.com":dn} +vName := string(vAutoscalerCR.Spec.Name) +vAutoscalingDefinition := string(vAutoscalerCR.Spec.AutoscalingDefinition) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAutoscalerCR { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + AutoscalingDefinition: &vAutoscalingDefinition, + } + vGlobalAutoscalerCRList = append(vGlobalAutoscalerCRList, ret) + + log.Debugf("[getGlobalDomainAutoscalersResolver]Output Autoscalers objects %v", vGlobalAutoscalerCRList) + + return vGlobalAutoscalerCRList, nil + } + + log.Debug("[getGlobalDomainAutoscalersResolver]Id is empty, process all Autoscalerss") + + vAutoscalerCRParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainAutoscalersResolver]Error getting parent node %s", err) + return vGlobalAutoscalerCRList, nil + } + vAutoscalerCRAllObj, err := vAutoscalerCRParent.GetAllAutoscalers(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainAutoscalersResolver]Error getting Autoscalers objects %s", err) + return vGlobalAutoscalerCRList, nil + } + for _, i := range vAutoscalerCRAllObj { + vAutoscalerCR, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetAutoscalers(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainAutoscalersResolver]Error getting Autoscalers node %q : %s", i.DisplayName(), err) + continue + } + dn := vAutoscalerCR.DisplayName() +parentLabels := map[string]interface{}{"autoscalercrs.global.tsm.tanzu.vmware.com":dn} +vName := string(vAutoscalerCR.Spec.Name) +vAutoscalingDefinition := string(vAutoscalerCR.Spec.AutoscalingDefinition) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAutoscalerCR { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + AutoscalingDefinition: &vAutoscalingDefinition, + } + vGlobalAutoscalerCRList = append(vGlobalAutoscalerCRList, ret) + } + + log.Debugf("[getGlobalDomainAutoscalersResolver]Output Autoscalers objects %v", vGlobalAutoscalerCRList) + + return vGlobalAutoscalerCRList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: PeerAuthentication Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainPeerAuthenticationResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalPeerAuthentication, error) { + log.Debugf("[getGlobalDomainPeerAuthenticationResolver]Parent Object %+v", obj) + var vGlobalPeerAuthenticationList []*model.GlobalPeerAuthentication + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainPeerAuthenticationResolver]Id %q", *id) + vPeerAuthentication, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetPeerAuthentication(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainPeerAuthenticationResolver]Error getting PeerAuthentication node %q : %s", *id, err) + return vGlobalPeerAuthenticationList, nil + } + dn := vPeerAuthentication.DisplayName() +parentLabels := map[string]interface{}{"peerauthentications.global.tsm.tanzu.vmware.com":dn} +vName := string(vPeerAuthentication.Spec.Name) +vLabels := string(vPeerAuthentication.Spec.Labels) +vAnnotations := string(vPeerAuthentication.Spec.Annotations) +vSpec := string(vPeerAuthentication.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalPeerAuthentication { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Labels: &vLabels, + Annotations: &vAnnotations, + Spec: &vSpec, + } + vGlobalPeerAuthenticationList = append(vGlobalPeerAuthenticationList, ret) + + log.Debugf("[getGlobalDomainPeerAuthenticationResolver]Output PeerAuthentication objects %v", vGlobalPeerAuthenticationList) + + return vGlobalPeerAuthenticationList, nil + } + + log.Debug("[getGlobalDomainPeerAuthenticationResolver]Id is empty, process all PeerAuthentications") + + vPeerAuthenticationParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainPeerAuthenticationResolver]Error getting parent node %s", err) + return vGlobalPeerAuthenticationList, nil + } + vPeerAuthenticationAllObj, err := vPeerAuthenticationParent.GetAllPeerAuthentication(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainPeerAuthenticationResolver]Error getting PeerAuthentication objects %s", err) + return vGlobalPeerAuthenticationList, nil + } + for _, i := range vPeerAuthenticationAllObj { + vPeerAuthentication, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetPeerAuthentication(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainPeerAuthenticationResolver]Error getting PeerAuthentication node %q : %s", i.DisplayName(), err) + continue + } + dn := vPeerAuthentication.DisplayName() +parentLabels := map[string]interface{}{"peerauthentications.global.tsm.tanzu.vmware.com":dn} +vName := string(vPeerAuthentication.Spec.Name) +vLabels := string(vPeerAuthentication.Spec.Labels) +vAnnotations := string(vPeerAuthentication.Spec.Annotations) +vSpec := string(vPeerAuthentication.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalPeerAuthentication { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Labels: &vLabels, + Annotations: &vAnnotations, + Spec: &vSpec, + } + vGlobalPeerAuthenticationList = append(vGlobalPeerAuthenticationList, ret) + } + + log.Debugf("[getGlobalDomainPeerAuthenticationResolver]Output PeerAuthentication objects %v", vGlobalPeerAuthenticationList) + + return vGlobalPeerAuthenticationList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: KnativeIngresses Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainKnativeIngressesResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalKnativeIngress, error) { + log.Debugf("[getGlobalDomainKnativeIngressesResolver]Parent Object %+v", obj) + var vGlobalKnativeIngressList []*model.GlobalKnativeIngress + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainKnativeIngressesResolver]Id %q", *id) + vKnativeIngress, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetKnativeIngresses(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainKnativeIngressesResolver]Error getting KnativeIngresses node %q : %s", *id, err) + return vGlobalKnativeIngressList, nil + } + dn := vKnativeIngress.DisplayName() +parentLabels := map[string]interface{}{"knativeingresses.global.tsm.tanzu.vmware.com":dn} +vName := string(vKnativeIngress.Spec.Name) +vCreationTimestamp := string(vKnativeIngress.Spec.CreationTimestamp) +vApiLink := string(vKnativeIngress.Spec.ApiLink) +vLabels := string(vKnativeIngress.Spec.Labels) +vAnnotations := string(vKnativeIngress.Spec.Annotations) +vSpec := string(vKnativeIngress.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalKnativeIngress { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + CreationTimestamp: &vCreationTimestamp, + ApiLink: &vApiLink, + Labels: &vLabels, + Annotations: &vAnnotations, + Spec: &vSpec, + } + vGlobalKnativeIngressList = append(vGlobalKnativeIngressList, ret) + + log.Debugf("[getGlobalDomainKnativeIngressesResolver]Output KnativeIngresses objects %v", vGlobalKnativeIngressList) + + return vGlobalKnativeIngressList, nil + } + + log.Debug("[getGlobalDomainKnativeIngressesResolver]Id is empty, process all KnativeIngressess") + + vKnativeIngressParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainKnativeIngressesResolver]Error getting parent node %s", err) + return vGlobalKnativeIngressList, nil + } + vKnativeIngressAllObj, err := vKnativeIngressParent.GetAllKnativeIngresses(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainKnativeIngressesResolver]Error getting KnativeIngresses objects %s", err) + return vGlobalKnativeIngressList, nil + } + for _, i := range vKnativeIngressAllObj { + vKnativeIngress, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetKnativeIngresses(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainKnativeIngressesResolver]Error getting KnativeIngresses node %q : %s", i.DisplayName(), err) + continue + } + dn := vKnativeIngress.DisplayName() +parentLabels := map[string]interface{}{"knativeingresses.global.tsm.tanzu.vmware.com":dn} +vName := string(vKnativeIngress.Spec.Name) +vCreationTimestamp := string(vKnativeIngress.Spec.CreationTimestamp) +vApiLink := string(vKnativeIngress.Spec.ApiLink) +vLabels := string(vKnativeIngress.Spec.Labels) +vAnnotations := string(vKnativeIngress.Spec.Annotations) +vSpec := string(vKnativeIngress.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalKnativeIngress { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + CreationTimestamp: &vCreationTimestamp, + ApiLink: &vApiLink, + Labels: &vLabels, + Annotations: &vAnnotations, + Spec: &vSpec, + } + vGlobalKnativeIngressList = append(vGlobalKnativeIngressList, ret) + } + + log.Debugf("[getGlobalDomainKnativeIngressesResolver]Output KnativeIngresses objects %v", vGlobalKnativeIngressList) + + return vGlobalKnativeIngressList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: NetworkAttachmentDefinition Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainNetworkAttachmentDefinitionResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalNetworkAttachmentDefinition, error) { + log.Debugf("[getGlobalDomainNetworkAttachmentDefinitionResolver]Parent Object %+v", obj) + var vGlobalNetworkAttachmentDefinitionList []*model.GlobalNetworkAttachmentDefinition + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainNetworkAttachmentDefinitionResolver]Id %q", *id) + vNetworkAttachmentDefinition, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetNetworkAttachmentDefinition(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainNetworkAttachmentDefinitionResolver]Error getting NetworkAttachmentDefinition node %q : %s", *id, err) + return vGlobalNetworkAttachmentDefinitionList, nil + } + dn := vNetworkAttachmentDefinition.DisplayName() +parentLabels := map[string]interface{}{"networkattachmentdefinitions.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vNetworkAttachmentDefinition.Spec.Metadata) +vName := string(vNetworkAttachmentDefinition.Spec.Name) +vNamespace := string(vNetworkAttachmentDefinition.Spec.Namespace) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNetworkAttachmentDefinition { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Name: &vName, + Namespace: &vNamespace, + } + vGlobalNetworkAttachmentDefinitionList = append(vGlobalNetworkAttachmentDefinitionList, ret) + + log.Debugf("[getGlobalDomainNetworkAttachmentDefinitionResolver]Output NetworkAttachmentDefinition objects %v", vGlobalNetworkAttachmentDefinitionList) + + return vGlobalNetworkAttachmentDefinitionList, nil + } + + log.Debug("[getGlobalDomainNetworkAttachmentDefinitionResolver]Id is empty, process all NetworkAttachmentDefinitions") + + vNetworkAttachmentDefinitionParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainNetworkAttachmentDefinitionResolver]Error getting parent node %s", err) + return vGlobalNetworkAttachmentDefinitionList, nil + } + vNetworkAttachmentDefinitionAllObj, err := vNetworkAttachmentDefinitionParent.GetAllNetworkAttachmentDefinition(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainNetworkAttachmentDefinitionResolver]Error getting NetworkAttachmentDefinition objects %s", err) + return vGlobalNetworkAttachmentDefinitionList, nil + } + for _, i := range vNetworkAttachmentDefinitionAllObj { + vNetworkAttachmentDefinition, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetNetworkAttachmentDefinition(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainNetworkAttachmentDefinitionResolver]Error getting NetworkAttachmentDefinition node %q : %s", i.DisplayName(), err) + continue + } + dn := vNetworkAttachmentDefinition.DisplayName() +parentLabels := map[string]interface{}{"networkattachmentdefinitions.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vNetworkAttachmentDefinition.Spec.Metadata) +vName := string(vNetworkAttachmentDefinition.Spec.Name) +vNamespace := string(vNetworkAttachmentDefinition.Spec.Namespace) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNetworkAttachmentDefinition { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Name: &vName, + Namespace: &vNamespace, + } + vGlobalNetworkAttachmentDefinitionList = append(vGlobalNetworkAttachmentDefinitionList, ret) + } + + log.Debugf("[getGlobalDomainNetworkAttachmentDefinitionResolver]Output NetworkAttachmentDefinition objects %v", vGlobalNetworkAttachmentDefinitionList) + + return vGlobalNetworkAttachmentDefinitionList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Issuers Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainIssuersResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalIssuer, error) { + log.Debugf("[getGlobalDomainIssuersResolver]Parent Object %+v", obj) + var vGlobalIssuerList []*model.GlobalIssuer + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainIssuersResolver]Id %q", *id) + vIssuer, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetIssuers(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainIssuersResolver]Error getting Issuers node %q : %s", *id, err) + return vGlobalIssuerList, nil + } + dn := vIssuer.DisplayName() +parentLabels := map[string]interface{}{"issuers.global.tsm.tanzu.vmware.com":dn} +vName := string(vIssuer.Spec.Name) +vMetadata := string(vIssuer.Spec.Metadata) +vVenafi := string(vIssuer.Spec.Venafi) +vStatus := string(vIssuer.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalIssuer { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Venafi: &vVenafi, + Status: &vStatus, + } + vGlobalIssuerList = append(vGlobalIssuerList, ret) + + log.Debugf("[getGlobalDomainIssuersResolver]Output Issuers objects %v", vGlobalIssuerList) + + return vGlobalIssuerList, nil + } + + log.Debug("[getGlobalDomainIssuersResolver]Id is empty, process all Issuerss") + + vIssuerParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainIssuersResolver]Error getting parent node %s", err) + return vGlobalIssuerList, nil + } + vIssuerAllObj, err := vIssuerParent.GetAllIssuers(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainIssuersResolver]Error getting Issuers objects %s", err) + return vGlobalIssuerList, nil + } + for _, i := range vIssuerAllObj { + vIssuer, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetIssuers(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainIssuersResolver]Error getting Issuers node %q : %s", i.DisplayName(), err) + continue + } + dn := vIssuer.DisplayName() +parentLabels := map[string]interface{}{"issuers.global.tsm.tanzu.vmware.com":dn} +vName := string(vIssuer.Spec.Name) +vMetadata := string(vIssuer.Spec.Metadata) +vVenafi := string(vIssuer.Spec.Venafi) +vStatus := string(vIssuer.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalIssuer { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Venafi: &vVenafi, + Status: &vStatus, + } + vGlobalIssuerList = append(vGlobalIssuerList, ret) + } + + log.Debugf("[getGlobalDomainIssuersResolver]Output Issuers objects %v", vGlobalIssuerList) + + return vGlobalIssuerList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Certificates Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainCertificatesResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalCertificate, error) { + log.Debugf("[getGlobalDomainCertificatesResolver]Parent Object %+v", obj) + var vGlobalCertificateList []*model.GlobalCertificate + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainCertificatesResolver]Id %q", *id) + vCertificate, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetCertificates(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainCertificatesResolver]Error getting Certificates node %q : %s", *id, err) + return vGlobalCertificateList, nil + } + dn := vCertificate.DisplayName() +parentLabels := map[string]interface{}{"certificates.global.tsm.tanzu.vmware.com":dn} +vName := string(vCertificate.Spec.Name) +vMetadata := string(vCertificate.Spec.Metadata) +vIssuerRef := string(vCertificate.Spec.IssuerRef) +vPrivateKey := string(vCertificate.Spec.PrivateKey) +vSubject := string(vCertificate.Spec.Subject) +vCommonName := string(vCertificate.Spec.CommonName) +vDuration := string(vCertificate.Spec.Duration) +DnsNames, _ := json.Marshal(vCertificate.Spec.DnsNames) +DnsNamesData := string(DnsNames) +IpAddresses, _ := json.Marshal(vCertificate.Spec.IpAddresses) +IpAddressesData := string(IpAddresses) +vSecretName := string(vCertificate.Spec.SecretName) +vRenewBefore := string(vCertificate.Spec.RenewBefore) +EmailAddresses, _ := json.Marshal(vCertificate.Spec.EmailAddresses) +EmailAddressesData := string(EmailAddresses) +Uris, _ := json.Marshal(vCertificate.Spec.Uris) +UrisData := string(Uris) +vSecretTemplate := string(vCertificate.Spec.SecretTemplate) +vKeyStores := string(vCertificate.Spec.KeyStores) +vIsCA := bool(vCertificate.Spec.IsCA) +vEncodeUsagesInRequest := string(vCertificate.Spec.EncodeUsagesInRequest) +vUsages := string(vCertificate.Spec.Usages) +vRevisionHistoryLimit := int(vCertificate.Spec.RevisionHistoryLimit) +vAdditionalOutputFormats := string(vCertificate.Spec.AdditionalOutputFormats) +vStatus := string(vCertificate.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCertificate { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + IssuerRef: &vIssuerRef, + PrivateKey: &vPrivateKey, + Subject: &vSubject, + CommonName: &vCommonName, + Duration: &vDuration, + DnsNames: &DnsNamesData, + IpAddresses: &IpAddressesData, + SecretName: &vSecretName, + RenewBefore: &vRenewBefore, + EmailAddresses: &EmailAddressesData, + Uris: &UrisData, + SecretTemplate: &vSecretTemplate, + KeyStores: &vKeyStores, + IsCA: &vIsCA, + EncodeUsagesInRequest: &vEncodeUsagesInRequest, + Usages: &vUsages, + RevisionHistoryLimit: &vRevisionHistoryLimit, + AdditionalOutputFormats: &vAdditionalOutputFormats, + Status: &vStatus, + } + vGlobalCertificateList = append(vGlobalCertificateList, ret) + + log.Debugf("[getGlobalDomainCertificatesResolver]Output Certificates objects %v", vGlobalCertificateList) + + return vGlobalCertificateList, nil + } + + log.Debug("[getGlobalDomainCertificatesResolver]Id is empty, process all Certificatess") + + vCertificateParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainCertificatesResolver]Error getting parent node %s", err) + return vGlobalCertificateList, nil + } + vCertificateAllObj, err := vCertificateParent.GetAllCertificates(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainCertificatesResolver]Error getting Certificates objects %s", err) + return vGlobalCertificateList, nil + } + for _, i := range vCertificateAllObj { + vCertificate, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetCertificates(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainCertificatesResolver]Error getting Certificates node %q : %s", i.DisplayName(), err) + continue + } + dn := vCertificate.DisplayName() +parentLabels := map[string]interface{}{"certificates.global.tsm.tanzu.vmware.com":dn} +vName := string(vCertificate.Spec.Name) +vMetadata := string(vCertificate.Spec.Metadata) +vIssuerRef := string(vCertificate.Spec.IssuerRef) +vPrivateKey := string(vCertificate.Spec.PrivateKey) +vSubject := string(vCertificate.Spec.Subject) +vCommonName := string(vCertificate.Spec.CommonName) +vDuration := string(vCertificate.Spec.Duration) +DnsNames, _ := json.Marshal(vCertificate.Spec.DnsNames) +DnsNamesData := string(DnsNames) +IpAddresses, _ := json.Marshal(vCertificate.Spec.IpAddresses) +IpAddressesData := string(IpAddresses) +vSecretName := string(vCertificate.Spec.SecretName) +vRenewBefore := string(vCertificate.Spec.RenewBefore) +EmailAddresses, _ := json.Marshal(vCertificate.Spec.EmailAddresses) +EmailAddressesData := string(EmailAddresses) +Uris, _ := json.Marshal(vCertificate.Spec.Uris) +UrisData := string(Uris) +vSecretTemplate := string(vCertificate.Spec.SecretTemplate) +vKeyStores := string(vCertificate.Spec.KeyStores) +vIsCA := bool(vCertificate.Spec.IsCA) +vEncodeUsagesInRequest := string(vCertificate.Spec.EncodeUsagesInRequest) +vUsages := string(vCertificate.Spec.Usages) +vRevisionHistoryLimit := int(vCertificate.Spec.RevisionHistoryLimit) +vAdditionalOutputFormats := string(vCertificate.Spec.AdditionalOutputFormats) +vStatus := string(vCertificate.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCertificate { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + IssuerRef: &vIssuerRef, + PrivateKey: &vPrivateKey, + Subject: &vSubject, + CommonName: &vCommonName, + Duration: &vDuration, + DnsNames: &DnsNamesData, + IpAddresses: &IpAddressesData, + SecretName: &vSecretName, + RenewBefore: &vRenewBefore, + EmailAddresses: &EmailAddressesData, + Uris: &UrisData, + SecretTemplate: &vSecretTemplate, + KeyStores: &vKeyStores, + IsCA: &vIsCA, + EncodeUsagesInRequest: &vEncodeUsagesInRequest, + Usages: &vUsages, + RevisionHistoryLimit: &vRevisionHistoryLimit, + AdditionalOutputFormats: &vAdditionalOutputFormats, + Status: &vStatus, + } + vGlobalCertificateList = append(vGlobalCertificateList, ret) + } + + log.Debugf("[getGlobalDomainCertificatesResolver]Output Certificates objects %v", vGlobalCertificateList) + + return vGlobalCertificateList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: CertificateRequests Node: Domain PKG: Global +////////////////////////////////////// +func getGlobalDomainCertificateRequestsResolver(obj *model.GlobalDomain, id *string) ([]*model.GlobalCertificateRequest, error) { + log.Debugf("[getGlobalDomainCertificateRequestsResolver]Parent Object %+v", obj) + var vGlobalCertificateRequestList []*model.GlobalCertificateRequest + if id != nil && *id != "" { + log.Debugf("[getGlobalDomainCertificateRequestsResolver]Id %q", *id) + vCertificateRequest, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetCertificateRequests(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalDomainCertificateRequestsResolver]Error getting CertificateRequests node %q : %s", *id, err) + return vGlobalCertificateRequestList, nil + } + dn := vCertificateRequest.DisplayName() +parentLabels := map[string]interface{}{"certificaterequests.global.tsm.tanzu.vmware.com":dn} +vName := string(vCertificateRequest.Spec.Name) +vMetadata := string(vCertificateRequest.Spec.Metadata) +vIssuerRef := string(vCertificateRequest.Spec.IssuerRef) +vRequest := string(vCertificateRequest.Spec.Request) +vDuration := string(vCertificateRequest.Spec.Duration) +vUid := string(vCertificateRequest.Spec.Uid) +vIsCA := bool(vCertificateRequest.Spec.IsCA) +vUsername := string(vCertificateRequest.Spec.Username) +vUsages := string(vCertificateRequest.Spec.Usages) +vGroups := string(vCertificateRequest.Spec.Groups) +vExtra := string(vCertificateRequest.Spec.Extra) +vStatus := string(vCertificateRequest.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCertificateRequest { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + IssuerRef: &vIssuerRef, + Request: &vRequest, + Duration: &vDuration, + Uid: &vUid, + IsCA: &vIsCA, + Username: &vUsername, + Usages: &vUsages, + Groups: &vGroups, + Extra: &vExtra, + Status: &vStatus, + } + vGlobalCertificateRequestList = append(vGlobalCertificateRequestList, ret) + + log.Debugf("[getGlobalDomainCertificateRequestsResolver]Output CertificateRequests objects %v", vGlobalCertificateRequestList) + + return vGlobalCertificateRequestList, nil + } + + log.Debug("[getGlobalDomainCertificateRequestsResolver]Id is empty, process all CertificateRequestss") + + vCertificateRequestParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetDomains(context.TODO(), getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalDomainCertificateRequestsResolver]Error getting parent node %s", err) + return vGlobalCertificateRequestList, nil + } + vCertificateRequestAllObj, err := vCertificateRequestParent.GetAllCertificateRequests(context.TODO()) + if err != nil { + log.Errorf("[getGlobalDomainCertificateRequestsResolver]Error getting CertificateRequests objects %s", err) + return vGlobalCertificateRequestList, nil + } + for _, i := range vCertificateRequestAllObj { + vCertificateRequest, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetCertificateRequests(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalDomainCertificateRequestsResolver]Error getting CertificateRequests node %q : %s", i.DisplayName(), err) + continue + } + dn := vCertificateRequest.DisplayName() +parentLabels := map[string]interface{}{"certificaterequests.global.tsm.tanzu.vmware.com":dn} +vName := string(vCertificateRequest.Spec.Name) +vMetadata := string(vCertificateRequest.Spec.Metadata) +vIssuerRef := string(vCertificateRequest.Spec.IssuerRef) +vRequest := string(vCertificateRequest.Spec.Request) +vDuration := string(vCertificateRequest.Spec.Duration) +vUid := string(vCertificateRequest.Spec.Uid) +vIsCA := bool(vCertificateRequest.Spec.IsCA) +vUsername := string(vCertificateRequest.Spec.Username) +vUsages := string(vCertificateRequest.Spec.Usages) +vGroups := string(vCertificateRequest.Spec.Groups) +vExtra := string(vCertificateRequest.Spec.Extra) +vStatus := string(vCertificateRequest.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCertificateRequest { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + IssuerRef: &vIssuerRef, + Request: &vRequest, + Duration: &vDuration, + Uid: &vUid, + IsCA: &vIsCA, + Username: &vUsername, + Usages: &vUsages, + Groups: &vGroups, + Extra: &vExtra, + Status: &vStatus, + } + vGlobalCertificateRequestList = append(vGlobalCertificateRequestList, ret) + } + + log.Debugf("[getGlobalDomainCertificateRequestsResolver]Output CertificateRequests objects %v", vGlobalCertificateRequestList) + + return vGlobalCertificateRequestList, nil +} + +////////////////////////////////////// +// LINK RESOLVER +// FieldName: Account Node: ExternalDNSConfigN PKG: Global +////////////////////////////////////// +func getGlobalExternalDNSConfigNAccountResolver(obj *model.GlobalExternalDNSConfigN) (*model.GlobalExternalAccountConfigN, error) { + log.Debugf("[getGlobalExternalDNSConfigNAccountResolver]Parent Object %+v", obj) + vExternalAccountConfigNParent, err := nc.GlobalRoot().Config().GetExternalDNS(context.TODO(), getParentName(obj.ParentLabels, "externaldnsconfigns.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalDNSConfigNAccountResolver]Error getting parent node %s", err) + return &model.GlobalExternalAccountConfigN{}, nil + } + vExternalAccountConfigN, err := vExternalAccountConfigNParent.GetAccount(context.TODO()) + if err != nil { + log.Errorf("[getGlobalExternalDNSConfigNAccountResolver]Error getting Account object %s", err) + return &model.GlobalExternalAccountConfigN{}, nil + } + dn := vExternalAccountConfigN.DisplayName() +parentLabels := map[string]interface{}{"externalaccountconfigns.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vExternalAccountConfigN.Spec.Config) +vProxyConfig := string(vExternalAccountConfigN.Spec.ProxyConfig) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalAccountConfigN { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + ProxyConfig: &vProxyConfig, + } + log.Debugf("[getGlobalExternalDNSConfigNAccountResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: DnsRecords Node: ExternalDNSInventoryPrimaryDomain PKG: Global +////////////////////////////////////// +func getGlobalExternalDNSInventoryPrimaryDomainDnsRecordsResolver(obj *model.GlobalExternalDNSInventoryPrimaryDomain, id *string) ([]*model.GlobalExternalDNSInventoryRecord, error) { + log.Debugf("[getGlobalExternalDNSInventoryPrimaryDomainDnsRecordsResolver]Parent Object %+v", obj) + var vGlobalExternalDNSInventoryRecordList []*model.GlobalExternalDNSInventoryRecord + if id != nil && *id != "" { + log.Debugf("[getGlobalExternalDNSInventoryPrimaryDomainDnsRecordsResolver]Id %q", *id) + vExternalDNSInventoryRecord, err := nc.GlobalRoot().Inventory().ExternalDNS(getParentName(obj.ParentLabels, "externaldnsinventories.global.tsm.tanzu.vmware.com")).PrimaryDomains(getParentName(obj.ParentLabels, "externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com")).GetDnsRecords(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryPrimaryDomainDnsRecordsResolver]Error getting DnsRecords node %q : %s", *id, err) + return vGlobalExternalDNSInventoryRecordList, nil + } + dn := vExternalDNSInventoryRecord.DisplayName() +parentLabels := map[string]interface{}{"externaldnsinventoryrecords.global.tsm.tanzu.vmware.com":dn} +vDnsRecordType := string(vExternalDNSInventoryRecord.Spec.DnsRecordType) +vTtl := int(vExternalDNSInventoryRecord.Spec.Ttl) +vValue := string(vExternalDNSInventoryRecord.Spec.Value) +vWeight := int(vExternalDNSInventoryRecord.Spec.Weight) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSInventoryRecord { + Id: &dn, + ParentLabels: parentLabels, + DnsRecordType: &vDnsRecordType, + Ttl: &vTtl, + Value: &vValue, + Weight: &vWeight, + } + vGlobalExternalDNSInventoryRecordList = append(vGlobalExternalDNSInventoryRecordList, ret) + + log.Debugf("[getGlobalExternalDNSInventoryPrimaryDomainDnsRecordsResolver]Output DnsRecords objects %v", vGlobalExternalDNSInventoryRecordList) + + return vGlobalExternalDNSInventoryRecordList, nil + } + + log.Debug("[getGlobalExternalDNSInventoryPrimaryDomainDnsRecordsResolver]Id is empty, process all DnsRecordss") + + vExternalDNSInventoryRecordParent, err := nc.GlobalRoot().Inventory().ExternalDNS(getParentName(obj.ParentLabels, "externaldnsinventories.global.tsm.tanzu.vmware.com")).GetPrimaryDomains(context.TODO(), getParentName(obj.ParentLabels, "externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryPrimaryDomainDnsRecordsResolver]Error getting parent node %s", err) + return vGlobalExternalDNSInventoryRecordList, nil + } + vExternalDNSInventoryRecordAllObj, err := vExternalDNSInventoryRecordParent.GetAllDnsRecords(context.TODO()) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryPrimaryDomainDnsRecordsResolver]Error getting DnsRecords objects %s", err) + return vGlobalExternalDNSInventoryRecordList, nil + } + for _, i := range vExternalDNSInventoryRecordAllObj { + vExternalDNSInventoryRecord, err := nc.GlobalRoot().Inventory().ExternalDNS(getParentName(obj.ParentLabels, "externaldnsinventories.global.tsm.tanzu.vmware.com")).PrimaryDomains(getParentName(obj.ParentLabels, "externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com")).GetDnsRecords(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryPrimaryDomainDnsRecordsResolver]Error getting DnsRecords node %q : %s", i.DisplayName(), err) + continue + } + dn := vExternalDNSInventoryRecord.DisplayName() +parentLabels := map[string]interface{}{"externaldnsinventoryrecords.global.tsm.tanzu.vmware.com":dn} +vDnsRecordType := string(vExternalDNSInventoryRecord.Spec.DnsRecordType) +vTtl := int(vExternalDNSInventoryRecord.Spec.Ttl) +vValue := string(vExternalDNSInventoryRecord.Spec.Value) +vWeight := int(vExternalDNSInventoryRecord.Spec.Weight) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSInventoryRecord { + Id: &dn, + ParentLabels: parentLabels, + DnsRecordType: &vDnsRecordType, + Ttl: &vTtl, + Value: &vValue, + Weight: &vWeight, + } + vGlobalExternalDNSInventoryRecordList = append(vGlobalExternalDNSInventoryRecordList, ret) + } + + log.Debugf("[getGlobalExternalDNSInventoryPrimaryDomainDnsRecordsResolver]Output DnsRecords objects %v", vGlobalExternalDNSInventoryRecordList) + + return vGlobalExternalDNSInventoryRecordList, nil +} + +////////////////////////////////////// +// LINK RESOLVER +// FieldName: HealthCheck Node: ExternalDNSInventoryRecord PKG: Global +////////////////////////////////////// +func getGlobalExternalDNSInventoryRecordHealthCheckResolver(obj *model.GlobalExternalDNSInventoryRecord) (*model.GlobalExternalDNSInventoryHealthCheck, error) { + log.Debugf("[getGlobalExternalDNSInventoryRecordHealthCheckResolver]Parent Object %+v", obj) + vExternalDNSInventoryHealthCheckParent, err := nc.GlobalRoot().Inventory().ExternalDNS(getParentName(obj.ParentLabels, "externaldnsinventories.global.tsm.tanzu.vmware.com")).PrimaryDomains(getParentName(obj.ParentLabels, "externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com")).GetDnsRecords(context.TODO(), getParentName(obj.ParentLabels, "externaldnsinventoryrecords.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryRecordHealthCheckResolver]Error getting parent node %s", err) + return &model.GlobalExternalDNSInventoryHealthCheck{}, nil + } + vExternalDNSInventoryHealthCheck, err := vExternalDNSInventoryHealthCheckParent.GetHealthCheck(context.TODO()) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryRecordHealthCheckResolver]Error getting HealthCheck object %s", err) + return &model.GlobalExternalDNSInventoryHealthCheck{}, nil + } + dn := vExternalDNSInventoryHealthCheck.DisplayName() +parentLabels := map[string]interface{}{"externaldnsinventoryhealthchecks.global.tsm.tanzu.vmware.com":dn} +vName := string(vExternalDNSInventoryHealthCheck.Spec.Name) +vProtocol := string(vExternalDNSInventoryHealthCheck.Spec.Protocol) +vPort := int(vExternalDNSInventoryHealthCheck.Spec.Port) +vPath := string(vExternalDNSInventoryHealthCheck.Spec.Path) +vHealthThreshold := int(vExternalDNSInventoryHealthCheck.Spec.HealthThreshold) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSInventoryHealthCheck { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Protocol: &vProtocol, + Port: &vPort, + Path: &vPath, + HealthThreshold: &vHealthThreshold, + } + log.Debugf("[getGlobalExternalDNSInventoryRecordHealthCheckResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: PrimaryDomains Node: ExternalDNSInventoryZone PKG: Global +////////////////////////////////////// +func getGlobalExternalDNSInventoryZonePrimaryDomainsResolver(obj *model.GlobalExternalDNSInventoryZone, id *string) ([]*model.GlobalExternalDNSInventoryPrimaryDomain, error) { + log.Debugf("[getGlobalExternalDNSInventoryZonePrimaryDomainsResolver]Parent Object %+v", obj) + var vGlobalExternalDNSInventoryPrimaryDomainList []*model.GlobalExternalDNSInventoryPrimaryDomain + if id != nil && *id != "" { + log.Debugf("[getGlobalExternalDNSInventoryZonePrimaryDomainsResolver]Id %q", *id) + vExternalDNSInventoryPrimaryDomainParent, err := nc.GlobalRoot().Inventory().ExternalDNS(getParentName(obj.ParentLabels, "externaldnsinventories.global.tsm.tanzu.vmware.com")).GetZones(context.TODO(), getParentName(obj.ParentLabels, "externaldnsinventoryzones.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryZonePrimaryDomainsResolver]Error getting PrimaryDomains %q : %s", *id, err) + return vGlobalExternalDNSInventoryPrimaryDomainList, nil + } + vExternalDNSInventoryPrimaryDomain, err := vExternalDNSInventoryPrimaryDomainParent.GetPrimaryDomains(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryZonePrimaryDomainsResolver]Error getting PrimaryDomains %q : %s", *id, err) + return vGlobalExternalDNSInventoryPrimaryDomainList, nil + } + dn := vExternalDNSInventoryPrimaryDomain.DisplayName() +parentLabels := map[string]interface{}{"externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com":dn} +vRegion := string(vExternalDNSInventoryPrimaryDomain.Spec.Region) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSInventoryPrimaryDomain { + Id: &dn, + ParentLabels: parentLabels, + Region: &vRegion, + } + vGlobalExternalDNSInventoryPrimaryDomainList = append(vGlobalExternalDNSInventoryPrimaryDomainList, ret) + + log.Debugf("[getGlobalExternalDNSInventoryZonePrimaryDomainsResolver]Output PrimaryDomains objects %v", vGlobalExternalDNSInventoryPrimaryDomainList) + + return vGlobalExternalDNSInventoryPrimaryDomainList, nil + } + + log.Debug("[getGlobalExternalDNSInventoryZonePrimaryDomainsResolver]Id is empty, process all PrimaryDomainss") + + vExternalDNSInventoryPrimaryDomainParent, err := nc.GlobalRoot().Inventory().ExternalDNS(getParentName(obj.ParentLabels, "externaldnsinventories.global.tsm.tanzu.vmware.com")).GetZones(context.TODO(), getParentName(obj.ParentLabels, "externaldnsinventoryzones.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryZonePrimaryDomainsResolver]Error getting parent node %s", err) + return vGlobalExternalDNSInventoryPrimaryDomainList, nil + } + vExternalDNSInventoryPrimaryDomainAllObj, err := vExternalDNSInventoryPrimaryDomainParent.GetAllPrimaryDomains(context.TODO()) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryZonePrimaryDomainsResolver]Error getting PrimaryDomains %s", err) + return vGlobalExternalDNSInventoryPrimaryDomainList, nil + } + for _, i := range vExternalDNSInventoryPrimaryDomainAllObj { + vExternalDNSInventoryPrimaryDomainParent, err := nc.GlobalRoot().Inventory().ExternalDNS(getParentName(obj.ParentLabels, "externaldnsinventories.global.tsm.tanzu.vmware.com")).GetZones(context.TODO(), getParentName(obj.ParentLabels, "externaldnsinventoryzones.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryZonePrimaryDomainsResolver]Error getting parent node %s, skipping...", err) + continue + } + vExternalDNSInventoryPrimaryDomain, err := vExternalDNSInventoryPrimaryDomainParent.GetPrimaryDomains(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryZonePrimaryDomainsResolver]Error getting PrimaryDomains node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vExternalDNSInventoryPrimaryDomain.DisplayName() +parentLabels := map[string]interface{}{"externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com":dn} +vRegion := string(vExternalDNSInventoryPrimaryDomain.Spec.Region) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSInventoryPrimaryDomain { + Id: &dn, + ParentLabels: parentLabels, + Region: &vRegion, + } + vGlobalExternalDNSInventoryPrimaryDomainList = append(vGlobalExternalDNSInventoryPrimaryDomainList, ret) + } + log.Debugf("[getGlobalExternalDNSInventoryZonePrimaryDomainsResolver]List of PrimaryDomains object %v", vGlobalExternalDNSInventoryPrimaryDomainList) + return vGlobalExternalDNSInventoryPrimaryDomainList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Zones Node: ExternalDNSInventory PKG: Global +////////////////////////////////////// +func getGlobalExternalDNSInventoryZonesResolver(obj *model.GlobalExternalDNSInventory, id *string) ([]*model.GlobalExternalDNSInventoryZone, error) { + log.Debugf("[getGlobalExternalDNSInventoryZonesResolver]Parent Object %+v", obj) + var vGlobalExternalDNSInventoryZoneList []*model.GlobalExternalDNSInventoryZone + if id != nil && *id != "" { + log.Debugf("[getGlobalExternalDNSInventoryZonesResolver]Id %q", *id) + vExternalDNSInventoryZone, err := nc.GlobalRoot().Inventory().ExternalDNS(getParentName(obj.ParentLabels, "externaldnsinventories.global.tsm.tanzu.vmware.com")).GetZones(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryZonesResolver]Error getting Zones node %q : %s", *id, err) + return vGlobalExternalDNSInventoryZoneList, nil + } + dn := vExternalDNSInventoryZone.DisplayName() +parentLabels := map[string]interface{}{"externaldnsinventoryzones.global.tsm.tanzu.vmware.com":dn} +vRecords := int(vExternalDNSInventoryZone.Spec.Records) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSInventoryZone { + Id: &dn, + ParentLabels: parentLabels, + Records: &vRecords, + } + vGlobalExternalDNSInventoryZoneList = append(vGlobalExternalDNSInventoryZoneList, ret) + + log.Debugf("[getGlobalExternalDNSInventoryZonesResolver]Output Zones objects %v", vGlobalExternalDNSInventoryZoneList) + + return vGlobalExternalDNSInventoryZoneList, nil + } + + log.Debug("[getGlobalExternalDNSInventoryZonesResolver]Id is empty, process all Zoness") + + vExternalDNSInventoryZoneParent, err := nc.GlobalRoot().Inventory().GetExternalDNS(context.TODO(), getParentName(obj.ParentLabels, "externaldnsinventories.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryZonesResolver]Error getting parent node %s", err) + return vGlobalExternalDNSInventoryZoneList, nil + } + vExternalDNSInventoryZoneAllObj, err := vExternalDNSInventoryZoneParent.GetAllZones(context.TODO()) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryZonesResolver]Error getting Zones objects %s", err) + return vGlobalExternalDNSInventoryZoneList, nil + } + for _, i := range vExternalDNSInventoryZoneAllObj { + vExternalDNSInventoryZone, err := nc.GlobalRoot().Inventory().ExternalDNS(getParentName(obj.ParentLabels, "externaldnsinventories.global.tsm.tanzu.vmware.com")).GetZones(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryZonesResolver]Error getting Zones node %q : %s", i.DisplayName(), err) + continue + } + dn := vExternalDNSInventoryZone.DisplayName() +parentLabels := map[string]interface{}{"externaldnsinventoryzones.global.tsm.tanzu.vmware.com":dn} +vRecords := int(vExternalDNSInventoryZone.Spec.Records) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSInventoryZone { + Id: &dn, + ParentLabels: parentLabels, + Records: &vRecords, + } + vGlobalExternalDNSInventoryZoneList = append(vGlobalExternalDNSInventoryZoneList, ret) + } + + log.Debugf("[getGlobalExternalDNSInventoryZonesResolver]Output Zones objects %v", vGlobalExternalDNSInventoryZoneList) + + return vGlobalExternalDNSInventoryZoneList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: PrimaryDomains Node: ExternalDNSInventory PKG: Global +////////////////////////////////////// +func getGlobalExternalDNSInventoryPrimaryDomainsResolver(obj *model.GlobalExternalDNSInventory, id *string) ([]*model.GlobalExternalDNSInventoryPrimaryDomain, error) { + log.Debugf("[getGlobalExternalDNSInventoryPrimaryDomainsResolver]Parent Object %+v", obj) + var vGlobalExternalDNSInventoryPrimaryDomainList []*model.GlobalExternalDNSInventoryPrimaryDomain + if id != nil && *id != "" { + log.Debugf("[getGlobalExternalDNSInventoryPrimaryDomainsResolver]Id %q", *id) + vExternalDNSInventoryPrimaryDomain, err := nc.GlobalRoot().Inventory().ExternalDNS(getParentName(obj.ParentLabels, "externaldnsinventories.global.tsm.tanzu.vmware.com")).GetPrimaryDomains(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryPrimaryDomainsResolver]Error getting PrimaryDomains node %q : %s", *id, err) + return vGlobalExternalDNSInventoryPrimaryDomainList, nil + } + dn := vExternalDNSInventoryPrimaryDomain.DisplayName() +parentLabels := map[string]interface{}{"externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com":dn} +vRegion := string(vExternalDNSInventoryPrimaryDomain.Spec.Region) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSInventoryPrimaryDomain { + Id: &dn, + ParentLabels: parentLabels, + Region: &vRegion, + } + vGlobalExternalDNSInventoryPrimaryDomainList = append(vGlobalExternalDNSInventoryPrimaryDomainList, ret) + + log.Debugf("[getGlobalExternalDNSInventoryPrimaryDomainsResolver]Output PrimaryDomains objects %v", vGlobalExternalDNSInventoryPrimaryDomainList) + + return vGlobalExternalDNSInventoryPrimaryDomainList, nil + } + + log.Debug("[getGlobalExternalDNSInventoryPrimaryDomainsResolver]Id is empty, process all PrimaryDomainss") + + vExternalDNSInventoryPrimaryDomainParent, err := nc.GlobalRoot().Inventory().GetExternalDNS(context.TODO(), getParentName(obj.ParentLabels, "externaldnsinventories.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryPrimaryDomainsResolver]Error getting parent node %s", err) + return vGlobalExternalDNSInventoryPrimaryDomainList, nil + } + vExternalDNSInventoryPrimaryDomainAllObj, err := vExternalDNSInventoryPrimaryDomainParent.GetAllPrimaryDomains(context.TODO()) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryPrimaryDomainsResolver]Error getting PrimaryDomains objects %s", err) + return vGlobalExternalDNSInventoryPrimaryDomainList, nil + } + for _, i := range vExternalDNSInventoryPrimaryDomainAllObj { + vExternalDNSInventoryPrimaryDomain, err := nc.GlobalRoot().Inventory().ExternalDNS(getParentName(obj.ParentLabels, "externaldnsinventories.global.tsm.tanzu.vmware.com")).GetPrimaryDomains(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryPrimaryDomainsResolver]Error getting PrimaryDomains node %q : %s", i.DisplayName(), err) + continue + } + dn := vExternalDNSInventoryPrimaryDomain.DisplayName() +parentLabels := map[string]interface{}{"externaldnsinventoryprimarydomains.global.tsm.tanzu.vmware.com":dn} +vRegion := string(vExternalDNSInventoryPrimaryDomain.Spec.Region) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSInventoryPrimaryDomain { + Id: &dn, + ParentLabels: parentLabels, + Region: &vRegion, + } + vGlobalExternalDNSInventoryPrimaryDomainList = append(vGlobalExternalDNSInventoryPrimaryDomainList, ret) + } + + log.Debugf("[getGlobalExternalDNSInventoryPrimaryDomainsResolver]Output PrimaryDomains objects %v", vGlobalExternalDNSInventoryPrimaryDomainList) + + return vGlobalExternalDNSInventoryPrimaryDomainList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: HealthChecks Node: ExternalDNSInventory PKG: Global +////////////////////////////////////// +func getGlobalExternalDNSInventoryHealthChecksResolver(obj *model.GlobalExternalDNSInventory, id *string) ([]*model.GlobalExternalDNSInventoryHealthCheck, error) { + log.Debugf("[getGlobalExternalDNSInventoryHealthChecksResolver]Parent Object %+v", obj) + var vGlobalExternalDNSInventoryHealthCheckList []*model.GlobalExternalDNSInventoryHealthCheck + if id != nil && *id != "" { + log.Debugf("[getGlobalExternalDNSInventoryHealthChecksResolver]Id %q", *id) + vExternalDNSInventoryHealthCheck, err := nc.GlobalRoot().Inventory().ExternalDNS(getParentName(obj.ParentLabels, "externaldnsinventories.global.tsm.tanzu.vmware.com")).GetHealthChecks(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryHealthChecksResolver]Error getting HealthChecks node %q : %s", *id, err) + return vGlobalExternalDNSInventoryHealthCheckList, nil + } + dn := vExternalDNSInventoryHealthCheck.DisplayName() +parentLabels := map[string]interface{}{"externaldnsinventoryhealthchecks.global.tsm.tanzu.vmware.com":dn} +vName := string(vExternalDNSInventoryHealthCheck.Spec.Name) +vProtocol := string(vExternalDNSInventoryHealthCheck.Spec.Protocol) +vPort := int(vExternalDNSInventoryHealthCheck.Spec.Port) +vPath := string(vExternalDNSInventoryHealthCheck.Spec.Path) +vHealthThreshold := int(vExternalDNSInventoryHealthCheck.Spec.HealthThreshold) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSInventoryHealthCheck { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Protocol: &vProtocol, + Port: &vPort, + Path: &vPath, + HealthThreshold: &vHealthThreshold, + } + vGlobalExternalDNSInventoryHealthCheckList = append(vGlobalExternalDNSInventoryHealthCheckList, ret) + + log.Debugf("[getGlobalExternalDNSInventoryHealthChecksResolver]Output HealthChecks objects %v", vGlobalExternalDNSInventoryHealthCheckList) + + return vGlobalExternalDNSInventoryHealthCheckList, nil + } + + log.Debug("[getGlobalExternalDNSInventoryHealthChecksResolver]Id is empty, process all HealthCheckss") + + vExternalDNSInventoryHealthCheckParent, err := nc.GlobalRoot().Inventory().GetExternalDNS(context.TODO(), getParentName(obj.ParentLabels, "externaldnsinventories.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryHealthChecksResolver]Error getting parent node %s", err) + return vGlobalExternalDNSInventoryHealthCheckList, nil + } + vExternalDNSInventoryHealthCheckAllObj, err := vExternalDNSInventoryHealthCheckParent.GetAllHealthChecks(context.TODO()) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryHealthChecksResolver]Error getting HealthChecks objects %s", err) + return vGlobalExternalDNSInventoryHealthCheckList, nil + } + for _, i := range vExternalDNSInventoryHealthCheckAllObj { + vExternalDNSInventoryHealthCheck, err := nc.GlobalRoot().Inventory().ExternalDNS(getParentName(obj.ParentLabels, "externaldnsinventories.global.tsm.tanzu.vmware.com")).GetHealthChecks(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalExternalDNSInventoryHealthChecksResolver]Error getting HealthChecks node %q : %s", i.DisplayName(), err) + continue + } + dn := vExternalDNSInventoryHealthCheck.DisplayName() +parentLabels := map[string]interface{}{"externaldnsinventoryhealthchecks.global.tsm.tanzu.vmware.com":dn} +vName := string(vExternalDNSInventoryHealthCheck.Spec.Name) +vProtocol := string(vExternalDNSInventoryHealthCheck.Spec.Protocol) +vPort := int(vExternalDNSInventoryHealthCheck.Spec.Port) +vPath := string(vExternalDNSInventoryHealthCheck.Spec.Path) +vHealthThreshold := int(vExternalDNSInventoryHealthCheck.Spec.HealthThreshold) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSInventoryHealthCheck { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Protocol: &vProtocol, + Port: &vPort, + Path: &vPath, + HealthThreshold: &vHealthThreshold, + } + vGlobalExternalDNSInventoryHealthCheckList = append(vGlobalExternalDNSInventoryHealthCheckList, ret) + } + + log.Debugf("[getGlobalExternalDNSInventoryHealthChecksResolver]Output HealthChecks objects %v", vGlobalExternalDNSInventoryHealthCheckList) + + return vGlobalExternalDNSInventoryHealthCheckList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Subdomains Node: ExternalDNSRuntimePrimaryDomain PKG: Global +////////////////////////////////////// +func getGlobalExternalDNSRuntimePrimaryDomainSubdomainsResolver(obj *model.GlobalExternalDNSRuntimePrimaryDomain, id *string) ([]*model.GlobalExternalDNSRuntimeSubdomain, error) { + log.Debugf("[getGlobalExternalDNSRuntimePrimaryDomainSubdomainsResolver]Parent Object %+v", obj) + var vGlobalExternalDNSRuntimeSubdomainList []*model.GlobalExternalDNSRuntimeSubdomain + if id != nil && *id != "" { + log.Debugf("[getGlobalExternalDNSRuntimePrimaryDomainSubdomainsResolver]Id %q", *id) + vExternalDNSRuntimeSubdomain, err := nc.GlobalRoot().Runtime().ExternalDNS().PrimaryDomains(getParentName(obj.ParentLabels, "externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com")).GetSubdomains(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalExternalDNSRuntimePrimaryDomainSubdomainsResolver]Error getting Subdomains node %q : %s", *id, err) + return vGlobalExternalDNSRuntimeSubdomainList, nil + } + dn := vExternalDNSRuntimeSubdomain.DisplayName() +parentLabels := map[string]interface{}{"externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com":dn} +vRecordType := string(vExternalDNSRuntimeSubdomain.Spec.RecordType) +vTtl := int(vExternalDNSRuntimeSubdomain.Spec.Ttl) +vHealthCheckDomain := string(vExternalDNSRuntimeSubdomain.Spec.HealthCheckDomain) +vHealthCheckExternalPort := int(vExternalDNSRuntimeSubdomain.Spec.HealthCheckExternalPort) +vHealthCheckPort := int(vExternalDNSRuntimeSubdomain.Spec.HealthCheckPort) +vHealthCheckPath := string(vExternalDNSRuntimeSubdomain.Spec.HealthCheckPath) +vHealthCheckThreshold := int(vExternalDNSRuntimeSubdomain.Spec.HealthCheckThreshold) +vHealthCheckInterval := int(vExternalDNSRuntimeSubdomain.Spec.HealthCheckInterval) +vHealthCheckProtocol := string(vExternalDNSRuntimeSubdomain.Spec.HealthCheckProtocol) +vGnsVersion := string(vExternalDNSRuntimeSubdomain.Spec.GnsVersion) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSRuntimeSubdomain { + Id: &dn, + ParentLabels: parentLabels, + RecordType: &vRecordType, + Ttl: &vTtl, + HealthCheckDomain: &vHealthCheckDomain, + HealthCheckExternalPort: &vHealthCheckExternalPort, + HealthCheckPort: &vHealthCheckPort, + HealthCheckPath: &vHealthCheckPath, + HealthCheckThreshold: &vHealthCheckThreshold, + HealthCheckInterval: &vHealthCheckInterval, + HealthCheckProtocol: &vHealthCheckProtocol, + GnsVersion: &vGnsVersion, + } + vGlobalExternalDNSRuntimeSubdomainList = append(vGlobalExternalDNSRuntimeSubdomainList, ret) + + log.Debugf("[getGlobalExternalDNSRuntimePrimaryDomainSubdomainsResolver]Output Subdomains objects %v", vGlobalExternalDNSRuntimeSubdomainList) + + return vGlobalExternalDNSRuntimeSubdomainList, nil + } + + log.Debug("[getGlobalExternalDNSRuntimePrimaryDomainSubdomainsResolver]Id is empty, process all Subdomainss") + + vExternalDNSRuntimeSubdomainParent, err := nc.GlobalRoot().Runtime().ExternalDNS().GetPrimaryDomains(context.TODO(), getParentName(obj.ParentLabels, "externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalDNSRuntimePrimaryDomainSubdomainsResolver]Error getting parent node %s", err) + return vGlobalExternalDNSRuntimeSubdomainList, nil + } + vExternalDNSRuntimeSubdomainAllObj, err := vExternalDNSRuntimeSubdomainParent.GetAllSubdomains(context.TODO()) + if err != nil { + log.Errorf("[getGlobalExternalDNSRuntimePrimaryDomainSubdomainsResolver]Error getting Subdomains objects %s", err) + return vGlobalExternalDNSRuntimeSubdomainList, nil + } + for _, i := range vExternalDNSRuntimeSubdomainAllObj { + vExternalDNSRuntimeSubdomain, err := nc.GlobalRoot().Runtime().ExternalDNS().PrimaryDomains(getParentName(obj.ParentLabels, "externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com")).GetSubdomains(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalExternalDNSRuntimePrimaryDomainSubdomainsResolver]Error getting Subdomains node %q : %s", i.DisplayName(), err) + continue + } + dn := vExternalDNSRuntimeSubdomain.DisplayName() +parentLabels := map[string]interface{}{"externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com":dn} +vRecordType := string(vExternalDNSRuntimeSubdomain.Spec.RecordType) +vTtl := int(vExternalDNSRuntimeSubdomain.Spec.Ttl) +vHealthCheckDomain := string(vExternalDNSRuntimeSubdomain.Spec.HealthCheckDomain) +vHealthCheckExternalPort := int(vExternalDNSRuntimeSubdomain.Spec.HealthCheckExternalPort) +vHealthCheckPort := int(vExternalDNSRuntimeSubdomain.Spec.HealthCheckPort) +vHealthCheckPath := string(vExternalDNSRuntimeSubdomain.Spec.HealthCheckPath) +vHealthCheckThreshold := int(vExternalDNSRuntimeSubdomain.Spec.HealthCheckThreshold) +vHealthCheckInterval := int(vExternalDNSRuntimeSubdomain.Spec.HealthCheckInterval) +vHealthCheckProtocol := string(vExternalDNSRuntimeSubdomain.Spec.HealthCheckProtocol) +vGnsVersion := string(vExternalDNSRuntimeSubdomain.Spec.GnsVersion) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSRuntimeSubdomain { + Id: &dn, + ParentLabels: parentLabels, + RecordType: &vRecordType, + Ttl: &vTtl, + HealthCheckDomain: &vHealthCheckDomain, + HealthCheckExternalPort: &vHealthCheckExternalPort, + HealthCheckPort: &vHealthCheckPort, + HealthCheckPath: &vHealthCheckPath, + HealthCheckThreshold: &vHealthCheckThreshold, + HealthCheckInterval: &vHealthCheckInterval, + HealthCheckProtocol: &vHealthCheckProtocol, + GnsVersion: &vGnsVersion, + } + vGlobalExternalDNSRuntimeSubdomainList = append(vGlobalExternalDNSRuntimeSubdomainList, ret) + } + + log.Debugf("[getGlobalExternalDNSRuntimePrimaryDomainSubdomainsResolver]Output Subdomains objects %v", vGlobalExternalDNSRuntimeSubdomainList) + + return vGlobalExternalDNSRuntimeSubdomainList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: PrimaryDomains Node: ExternalDNSRuntime PKG: Global +////////////////////////////////////// +func getGlobalExternalDNSRuntimePrimaryDomainsResolver(obj *model.GlobalExternalDNSRuntime, id *string) ([]*model.GlobalExternalDNSRuntimePrimaryDomain, error) { + log.Debugf("[getGlobalExternalDNSRuntimePrimaryDomainsResolver]Parent Object %+v", obj) + var vGlobalExternalDNSRuntimePrimaryDomainList []*model.GlobalExternalDNSRuntimePrimaryDomain + if id != nil && *id != "" { + log.Debugf("[getGlobalExternalDNSRuntimePrimaryDomainsResolver]Id %q", *id) + vExternalDNSRuntimePrimaryDomain, err := nc.GlobalRoot().Runtime().ExternalDNS().GetPrimaryDomains(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalExternalDNSRuntimePrimaryDomainsResolver]Error getting PrimaryDomains node %q : %s", *id, err) + return vGlobalExternalDNSRuntimePrimaryDomainList, nil + } + dn := vExternalDNSRuntimePrimaryDomain.DisplayName() +parentLabels := map[string]interface{}{"externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com":dn} +vPrimaryDomain := string(vExternalDNSRuntimePrimaryDomain.Spec.PrimaryDomain) +vDnsServerID := string(vExternalDNSRuntimePrimaryDomain.Spec.DnsServerID) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSRuntimePrimaryDomain { + Id: &dn, + ParentLabels: parentLabels, + PrimaryDomain: &vPrimaryDomain, + DnsServerID: &vDnsServerID, + } + vGlobalExternalDNSRuntimePrimaryDomainList = append(vGlobalExternalDNSRuntimePrimaryDomainList, ret) + + log.Debugf("[getGlobalExternalDNSRuntimePrimaryDomainsResolver]Output PrimaryDomains objects %v", vGlobalExternalDNSRuntimePrimaryDomainList) + + return vGlobalExternalDNSRuntimePrimaryDomainList, nil + } + + log.Debug("[getGlobalExternalDNSRuntimePrimaryDomainsResolver]Id is empty, process all PrimaryDomainss") + + vExternalDNSRuntimePrimaryDomainParent, err := nc.GlobalRoot().Runtime().GetExternalDNS(context.TODO()) + if err != nil { + log.Errorf("[getGlobalExternalDNSRuntimePrimaryDomainsResolver]Error getting parent node %s", err) + return vGlobalExternalDNSRuntimePrimaryDomainList, nil + } + vExternalDNSRuntimePrimaryDomainAllObj, err := vExternalDNSRuntimePrimaryDomainParent.GetAllPrimaryDomains(context.TODO()) + if err != nil { + log.Errorf("[getGlobalExternalDNSRuntimePrimaryDomainsResolver]Error getting PrimaryDomains objects %s", err) + return vGlobalExternalDNSRuntimePrimaryDomainList, nil + } + for _, i := range vExternalDNSRuntimePrimaryDomainAllObj { + vExternalDNSRuntimePrimaryDomain, err := nc.GlobalRoot().Runtime().ExternalDNS().GetPrimaryDomains(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalExternalDNSRuntimePrimaryDomainsResolver]Error getting PrimaryDomains node %q : %s", i.DisplayName(), err) + continue + } + dn := vExternalDNSRuntimePrimaryDomain.DisplayName() +parentLabels := map[string]interface{}{"externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com":dn} +vPrimaryDomain := string(vExternalDNSRuntimePrimaryDomain.Spec.PrimaryDomain) +vDnsServerID := string(vExternalDNSRuntimePrimaryDomain.Spec.DnsServerID) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSRuntimePrimaryDomain { + Id: &dn, + ParentLabels: parentLabels, + PrimaryDomain: &vPrimaryDomain, + DnsServerID: &vDnsServerID, + } + vGlobalExternalDNSRuntimePrimaryDomainList = append(vGlobalExternalDNSRuntimePrimaryDomainList, ret) + } + + log.Debugf("[getGlobalExternalDNSRuntimePrimaryDomainsResolver]Output PrimaryDomains objects %v", vGlobalExternalDNSRuntimePrimaryDomainList) + + return vGlobalExternalDNSRuntimePrimaryDomainList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Endpoints Node: ExternalDNSRuntimeSubdomain PKG: Global +////////////////////////////////////// +func getGlobalExternalDNSRuntimeSubdomainEndpointsResolver(obj *model.GlobalExternalDNSRuntimeSubdomain, id *string) ([]*model.GlobalExternalDNSRuntimeEndpoint, error) { + log.Debugf("[getGlobalExternalDNSRuntimeSubdomainEndpointsResolver]Parent Object %+v", obj) + var vGlobalExternalDNSRuntimeEndpointList []*model.GlobalExternalDNSRuntimeEndpoint + if id != nil && *id != "" { + log.Debugf("[getGlobalExternalDNSRuntimeSubdomainEndpointsResolver]Id %q", *id) + vExternalDNSRuntimeEndpoint, err := nc.GlobalRoot().Runtime().ExternalDNS().PrimaryDomains(getParentName(obj.ParentLabels, "externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com")).Subdomains(getParentName(obj.ParentLabels, "externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com")).GetEndpoints(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalExternalDNSRuntimeSubdomainEndpointsResolver]Error getting Endpoints node %q : %s", *id, err) + return vGlobalExternalDNSRuntimeEndpointList, nil + } + dn := vExternalDNSRuntimeEndpoint.DisplayName() +parentLabels := map[string]interface{}{"externaldnsruntimeendpoints.global.tsm.tanzu.vmware.com":dn} +vWeight := int(vExternalDNSRuntimeEndpoint.Spec.Weight) +vActive := bool(vExternalDNSRuntimeEndpoint.Spec.Active) +vGnsVersion := string(vExternalDNSRuntimeEndpoint.Spec.GnsVersion) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSRuntimeEndpoint { + Id: &dn, + ParentLabels: parentLabels, + Weight: &vWeight, + Active: &vActive, + GnsVersion: &vGnsVersion, + } + vGlobalExternalDNSRuntimeEndpointList = append(vGlobalExternalDNSRuntimeEndpointList, ret) + + log.Debugf("[getGlobalExternalDNSRuntimeSubdomainEndpointsResolver]Output Endpoints objects %v", vGlobalExternalDNSRuntimeEndpointList) + + return vGlobalExternalDNSRuntimeEndpointList, nil + } + + log.Debug("[getGlobalExternalDNSRuntimeSubdomainEndpointsResolver]Id is empty, process all Endpointss") + + vExternalDNSRuntimeEndpointParent, err := nc.GlobalRoot().Runtime().ExternalDNS().PrimaryDomains(getParentName(obj.ParentLabels, "externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com")).GetSubdomains(context.TODO(), getParentName(obj.ParentLabels, "externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalDNSRuntimeSubdomainEndpointsResolver]Error getting parent node %s", err) + return vGlobalExternalDNSRuntimeEndpointList, nil + } + vExternalDNSRuntimeEndpointAllObj, err := vExternalDNSRuntimeEndpointParent.GetAllEndpoints(context.TODO()) + if err != nil { + log.Errorf("[getGlobalExternalDNSRuntimeSubdomainEndpointsResolver]Error getting Endpoints objects %s", err) + return vGlobalExternalDNSRuntimeEndpointList, nil + } + for _, i := range vExternalDNSRuntimeEndpointAllObj { + vExternalDNSRuntimeEndpoint, err := nc.GlobalRoot().Runtime().ExternalDNS().PrimaryDomains(getParentName(obj.ParentLabels, "externaldnsruntimeprimarydomains.global.tsm.tanzu.vmware.com")).Subdomains(getParentName(obj.ParentLabels, "externaldnsruntimesubdomains.global.tsm.tanzu.vmware.com")).GetEndpoints(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalExternalDNSRuntimeSubdomainEndpointsResolver]Error getting Endpoints node %q : %s", i.DisplayName(), err) + continue + } + dn := vExternalDNSRuntimeEndpoint.DisplayName() +parentLabels := map[string]interface{}{"externaldnsruntimeendpoints.global.tsm.tanzu.vmware.com":dn} +vWeight := int(vExternalDNSRuntimeEndpoint.Spec.Weight) +vActive := bool(vExternalDNSRuntimeEndpoint.Spec.Active) +vGnsVersion := string(vExternalDNSRuntimeEndpoint.Spec.GnsVersion) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSRuntimeEndpoint { + Id: &dn, + ParentLabels: parentLabels, + Weight: &vWeight, + Active: &vActive, + GnsVersion: &vGnsVersion, + } + vGlobalExternalDNSRuntimeEndpointList = append(vGlobalExternalDNSRuntimeEndpointList, ret) + } + + log.Debugf("[getGlobalExternalDNSRuntimeSubdomainEndpointsResolver]Output Endpoints objects %v", vGlobalExternalDNSRuntimeEndpointList) + + return vGlobalExternalDNSRuntimeEndpointList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Plugins Node: ExternalPluginConfigFolder PKG: Global +////////////////////////////////////// +func getGlobalExternalPluginConfigFolderPluginsResolver(obj *model.GlobalExternalPluginConfigFolder, id *string) ([]*model.GlobalExternalPluginConfig, error) { + log.Debugf("[getGlobalExternalPluginConfigFolderPluginsResolver]Parent Object %+v", obj) + var vGlobalExternalPluginConfigList []*model.GlobalExternalPluginConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalExternalPluginConfigFolderPluginsResolver]Id %q", *id) + vExternalPluginConfig, err := nc.GlobalRoot().Config().ExternalPlugins(getParentName(obj.ParentLabels, "externalpluginconfigfolders.global.tsm.tanzu.vmware.com")).GetPlugins(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalExternalPluginConfigFolderPluginsResolver]Error getting Plugins node %q : %s", *id, err) + return vGlobalExternalPluginConfigList, nil + } + dn := vExternalPluginConfig.DisplayName() +parentLabels := map[string]interface{}{"externalpluginconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vExternalPluginConfig.Spec.Name) +vProviderName := string(vExternalPluginConfig.Spec.ProviderName) +vInstallConfig := string(vExternalPluginConfig.Spec.InstallConfig) +vType := string(vExternalPluginConfig.Spec.Type) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalPluginConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + ProviderName: &vProviderName, + InstallConfig: &vInstallConfig, + Type: &vType, + } + vGlobalExternalPluginConfigList = append(vGlobalExternalPluginConfigList, ret) + + log.Debugf("[getGlobalExternalPluginConfigFolderPluginsResolver]Output Plugins objects %v", vGlobalExternalPluginConfigList) + + return vGlobalExternalPluginConfigList, nil + } + + log.Debug("[getGlobalExternalPluginConfigFolderPluginsResolver]Id is empty, process all Pluginss") + + vExternalPluginConfigParent, err := nc.GlobalRoot().Config().GetExternalPlugins(context.TODO(), getParentName(obj.ParentLabels, "externalpluginconfigfolders.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalPluginConfigFolderPluginsResolver]Error getting parent node %s", err) + return vGlobalExternalPluginConfigList, nil + } + vExternalPluginConfigAllObj, err := vExternalPluginConfigParent.GetAllPlugins(context.TODO()) + if err != nil { + log.Errorf("[getGlobalExternalPluginConfigFolderPluginsResolver]Error getting Plugins objects %s", err) + return vGlobalExternalPluginConfigList, nil + } + for _, i := range vExternalPluginConfigAllObj { + vExternalPluginConfig, err := nc.GlobalRoot().Config().ExternalPlugins(getParentName(obj.ParentLabels, "externalpluginconfigfolders.global.tsm.tanzu.vmware.com")).GetPlugins(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalExternalPluginConfigFolderPluginsResolver]Error getting Plugins node %q : %s", i.DisplayName(), err) + continue + } + dn := vExternalPluginConfig.DisplayName() +parentLabels := map[string]interface{}{"externalpluginconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vExternalPluginConfig.Spec.Name) +vProviderName := string(vExternalPluginConfig.Spec.ProviderName) +vInstallConfig := string(vExternalPluginConfig.Spec.InstallConfig) +vType := string(vExternalPluginConfig.Spec.Type) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalPluginConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + ProviderName: &vProviderName, + InstallConfig: &vInstallConfig, + Type: &vType, + } + vGlobalExternalPluginConfigList = append(vGlobalExternalPluginConfigList, ret) + } + + log.Debugf("[getGlobalExternalPluginConfigFolderPluginsResolver]Output Plugins objects %v", vGlobalExternalPluginConfigList) + + return vGlobalExternalPluginConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: PluginInstances Node: ExternalPluginConfig PKG: Global +////////////////////////////////////// +func getGlobalExternalPluginConfigPluginInstancesResolver(obj *model.GlobalExternalPluginConfig, id *string) ([]*model.GlobalExternalPluginInstanceConfig, error) { + log.Debugf("[getGlobalExternalPluginConfigPluginInstancesResolver]Parent Object %+v", obj) + var vGlobalExternalPluginInstanceConfigList []*model.GlobalExternalPluginInstanceConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalExternalPluginConfigPluginInstancesResolver]Id %q", *id) + vExternalPluginInstanceConfig, err := nc.GlobalRoot().Config().ExternalPlugins(getParentName(obj.ParentLabels, "externalpluginconfigfolders.global.tsm.tanzu.vmware.com")).Plugins(getParentName(obj.ParentLabels, "externalpluginconfigs.global.tsm.tanzu.vmware.com")).GetPluginInstances(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalExternalPluginConfigPluginInstancesResolver]Error getting PluginInstances node %q : %s", *id, err) + return vGlobalExternalPluginInstanceConfigList, nil + } + dn := vExternalPluginInstanceConfig.DisplayName() +parentLabels := map[string]interface{}{"externalplugininstanceconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vExternalPluginInstanceConfig.Spec.Name) +vSecurityToken := string(vExternalPluginInstanceConfig.Spec.SecurityToken) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalPluginInstanceConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + SecurityToken: &vSecurityToken, + } + vGlobalExternalPluginInstanceConfigList = append(vGlobalExternalPluginInstanceConfigList, ret) + + log.Debugf("[getGlobalExternalPluginConfigPluginInstancesResolver]Output PluginInstances objects %v", vGlobalExternalPluginInstanceConfigList) + + return vGlobalExternalPluginInstanceConfigList, nil + } + + log.Debug("[getGlobalExternalPluginConfigPluginInstancesResolver]Id is empty, process all PluginInstancess") + + vExternalPluginInstanceConfigParent, err := nc.GlobalRoot().Config().ExternalPlugins(getParentName(obj.ParentLabels, "externalpluginconfigfolders.global.tsm.tanzu.vmware.com")).GetPlugins(context.TODO(), getParentName(obj.ParentLabels, "externalpluginconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalPluginConfigPluginInstancesResolver]Error getting parent node %s", err) + return vGlobalExternalPluginInstanceConfigList, nil + } + vExternalPluginInstanceConfigAllObj, err := vExternalPluginInstanceConfigParent.GetAllPluginInstances(context.TODO()) + if err != nil { + log.Errorf("[getGlobalExternalPluginConfigPluginInstancesResolver]Error getting PluginInstances objects %s", err) + return vGlobalExternalPluginInstanceConfigList, nil + } + for _, i := range vExternalPluginInstanceConfigAllObj { + vExternalPluginInstanceConfig, err := nc.GlobalRoot().Config().ExternalPlugins(getParentName(obj.ParentLabels, "externalpluginconfigfolders.global.tsm.tanzu.vmware.com")).Plugins(getParentName(obj.ParentLabels, "externalpluginconfigs.global.tsm.tanzu.vmware.com")).GetPluginInstances(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalExternalPluginConfigPluginInstancesResolver]Error getting PluginInstances node %q : %s", i.DisplayName(), err) + continue + } + dn := vExternalPluginInstanceConfig.DisplayName() +parentLabels := map[string]interface{}{"externalplugininstanceconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vExternalPluginInstanceConfig.Spec.Name) +vSecurityToken := string(vExternalPluginInstanceConfig.Spec.SecurityToken) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalPluginInstanceConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + SecurityToken: &vSecurityToken, + } + vGlobalExternalPluginInstanceConfigList = append(vGlobalExternalPluginInstanceConfigList, ret) + } + + log.Debugf("[getGlobalExternalPluginConfigPluginInstancesResolver]Output PluginInstances objects %v", vGlobalExternalPluginInstanceConfigList) + + return vGlobalExternalPluginInstanceConfigList, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: Capabilitiy Node: ExternalPluginInstanceConfig PKG: Global +////////////////////////////////////// +func getGlobalExternalPluginInstanceConfigCapabilitiyResolver(obj *model.GlobalExternalPluginInstanceConfig, id *string) (*model.GlobalExternalPluginCapability, error) { + log.Debugf("[getGlobalExternalPluginInstanceConfigCapabilitiyResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalExternalPluginInstanceConfigCapabilitiyResolver]Id %q", *id) + vExternalPluginCapability, err := nc.GlobalRoot().Config().ExternalPlugins(getParentName(obj.ParentLabels, "externalpluginconfigfolders.global.tsm.tanzu.vmware.com")).Plugins(getParentName(obj.ParentLabels, "externalpluginconfigs.global.tsm.tanzu.vmware.com")).PluginInstances(getParentName(obj.ParentLabels, "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com")).GetCapabilitiy(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalExternalPluginInstanceConfigCapabilitiyResolver]Error getting Capabilitiy node %q : %s", *id, err) + return &model.GlobalExternalPluginCapability{}, nil + } + dn := vExternalPluginCapability.DisplayName() +parentLabels := map[string]interface{}{"externalplugincapabilities.global.tsm.tanzu.vmware.com":dn} +vCapability := string(vExternalPluginCapability.Spec.Capability) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalPluginCapability { + Id: &dn, + ParentLabels: parentLabels, + Capability: &vCapability, + } + + log.Debugf("[getGlobalExternalPluginInstanceConfigCapabilitiyResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalExternalPluginInstanceConfigCapabilitiyResolver]Id is empty, process all Capabilitiys") + vExternalPluginCapabilityParent, err := nc.GlobalRoot().Config().ExternalPlugins(getParentName(obj.ParentLabels, "externalpluginconfigfolders.global.tsm.tanzu.vmware.com")).Plugins(getParentName(obj.ParentLabels, "externalpluginconfigs.global.tsm.tanzu.vmware.com")).GetPluginInstances(context.TODO(), getParentName(obj.ParentLabels, "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalPluginInstanceConfigCapabilitiyResolver]Failed to get parent node %s", err) + return &model.GlobalExternalPluginCapability{}, nil + } + vExternalPluginCapability, err := vExternalPluginCapabilityParent.GetCapabilitiy(context.TODO()) + if err != nil { + log.Errorf("[getGlobalExternalPluginInstanceConfigCapabilitiyResolver]Error getting Capabilitiy node %s", err) + return &model.GlobalExternalPluginCapability{}, nil + } + dn := vExternalPluginCapability.DisplayName() +parentLabels := map[string]interface{}{"externalplugincapabilities.global.tsm.tanzu.vmware.com":dn} +vCapability := string(vExternalPluginCapability.Spec.Capability) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalPluginCapability { + Id: &dn, + ParentLabels: parentLabels, + Capability: &vCapability, + } + + log.Debugf("[getGlobalExternalPluginInstanceConfigCapabilitiyResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Monitors Node: ExternalPluginInstanceConfig PKG: Global +////////////////////////////////////// +func getGlobalExternalPluginInstanceConfigMonitorsResolver(obj *model.GlobalExternalPluginInstanceConfig, id *string) ([]*model.GlobalExternalPluginMonitor, error) { + log.Debugf("[getGlobalExternalPluginInstanceConfigMonitorsResolver]Parent Object %+v", obj) + var vGlobalExternalPluginMonitorList []*model.GlobalExternalPluginMonitor + if id != nil && *id != "" { + log.Debugf("[getGlobalExternalPluginInstanceConfigMonitorsResolver]Id %q", *id) + vExternalPluginMonitor, err := nc.GlobalRoot().Config().ExternalPlugins(getParentName(obj.ParentLabels, "externalpluginconfigfolders.global.tsm.tanzu.vmware.com")).Plugins(getParentName(obj.ParentLabels, "externalpluginconfigs.global.tsm.tanzu.vmware.com")).PluginInstances(getParentName(obj.ParentLabels, "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com")).GetMonitors(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalExternalPluginInstanceConfigMonitorsResolver]Error getting Monitors node %q : %s", *id, err) + return vGlobalExternalPluginMonitorList, nil + } + dn := vExternalPluginMonitor.DisplayName() +parentLabels := map[string]interface{}{"externalpluginmonitors.global.tsm.tanzu.vmware.com":dn} +vObjType := string(vExternalPluginMonitor.Spec.ObjType) +vPluginCapability := string(vExternalPluginMonitor.Spec.PluginCapability) +vFn := string(vExternalPluginMonitor.Spec.Fn) +vArg1 := string(vExternalPluginMonitor.Spec.Arg1) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalPluginMonitor { + Id: &dn, + ParentLabels: parentLabels, + ObjType: &vObjType, + PluginCapability: &vPluginCapability, + Fn: &vFn, + Arg1: &vArg1, + } + vGlobalExternalPluginMonitorList = append(vGlobalExternalPluginMonitorList, ret) + + log.Debugf("[getGlobalExternalPluginInstanceConfigMonitorsResolver]Output Monitors objects %v", vGlobalExternalPluginMonitorList) + + return vGlobalExternalPluginMonitorList, nil + } + + log.Debug("[getGlobalExternalPluginInstanceConfigMonitorsResolver]Id is empty, process all Monitorss") + + vExternalPluginMonitorParent, err := nc.GlobalRoot().Config().ExternalPlugins(getParentName(obj.ParentLabels, "externalpluginconfigfolders.global.tsm.tanzu.vmware.com")).Plugins(getParentName(obj.ParentLabels, "externalpluginconfigs.global.tsm.tanzu.vmware.com")).GetPluginInstances(context.TODO(), getParentName(obj.ParentLabels, "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalPluginInstanceConfigMonitorsResolver]Error getting parent node %s", err) + return vGlobalExternalPluginMonitorList, nil + } + vExternalPluginMonitorAllObj, err := vExternalPluginMonitorParent.GetAllMonitors(context.TODO()) + if err != nil { + log.Errorf("[getGlobalExternalPluginInstanceConfigMonitorsResolver]Error getting Monitors objects %s", err) + return vGlobalExternalPluginMonitorList, nil + } + for _, i := range vExternalPluginMonitorAllObj { + vExternalPluginMonitor, err := nc.GlobalRoot().Config().ExternalPlugins(getParentName(obj.ParentLabels, "externalpluginconfigfolders.global.tsm.tanzu.vmware.com")).Plugins(getParentName(obj.ParentLabels, "externalpluginconfigs.global.tsm.tanzu.vmware.com")).PluginInstances(getParentName(obj.ParentLabels, "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com")).GetMonitors(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalExternalPluginInstanceConfigMonitorsResolver]Error getting Monitors node %q : %s", i.DisplayName(), err) + continue + } + dn := vExternalPluginMonitor.DisplayName() +parentLabels := map[string]interface{}{"externalpluginmonitors.global.tsm.tanzu.vmware.com":dn} +vObjType := string(vExternalPluginMonitor.Spec.ObjType) +vPluginCapability := string(vExternalPluginMonitor.Spec.PluginCapability) +vFn := string(vExternalPluginMonitor.Spec.Fn) +vArg1 := string(vExternalPluginMonitor.Spec.Arg1) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalPluginMonitor { + Id: &dn, + ParentLabels: parentLabels, + ObjType: &vObjType, + PluginCapability: &vPluginCapability, + Fn: &vFn, + Arg1: &vArg1, + } + vGlobalExternalPluginMonitorList = append(vGlobalExternalPluginMonitorList, ret) + } + + log.Debugf("[getGlobalExternalPluginInstanceConfigMonitorsResolver]Output Monitors objects %v", vGlobalExternalPluginMonitorList) + + return vGlobalExternalPluginMonitorList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Clusters Node: ExternalPluginInstanceConfig PKG: Global +////////////////////////////////////// +func getGlobalExternalPluginInstanceConfigClustersResolver(obj *model.GlobalExternalPluginInstanceConfig, id *string) ([]*model.GlobalCluster, error) { + log.Debugf("[getGlobalExternalPluginInstanceConfigClustersResolver]Parent Object %+v", obj) + var vGlobalClusterList []*model.GlobalCluster + if id != nil && *id != "" { + log.Debugf("[getGlobalExternalPluginInstanceConfigClustersResolver]Id %q", *id) + vClusterParent, err := nc.GlobalRoot().Config().ExternalPlugins(getParentName(obj.ParentLabels, "externalpluginconfigfolders.global.tsm.tanzu.vmware.com")).Plugins(getParentName(obj.ParentLabels, "externalpluginconfigs.global.tsm.tanzu.vmware.com")).GetPluginInstances(context.TODO(), getParentName(obj.ParentLabels, "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalPluginInstanceConfigClustersResolver]Error getting Clusters %q : %s", *id, err) + return vGlobalClusterList, nil + } + vCluster, err := vClusterParent.GetClusters(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalExternalPluginInstanceConfigClustersResolver]Error getting Clusters %q : %s", *id, err) + return vGlobalClusterList, nil + } + dn := vCluster.DisplayName() +parentLabels := map[string]interface{}{"clusters.global.tsm.tanzu.vmware.com":dn} +vName := string(vCluster.Spec.Name) +vUuid := string(vCluster.Spec.Uuid) +vConnected := bool(vCluster.Spec.Connected) +vIstioState := string(vCluster.Spec.IstioState) +vStatus := string(vCluster.Spec.Status) +vStatusHistory := string(vCluster.Spec.StatusHistory) +vCastatus := string(vCluster.Spec.Castatus) +vCaStatusHistory := string(vCluster.Spec.CaStatusHistory) +vComponentStatuses := string(vCluster.Spec.ComponentStatuses) +vComponentStatusesHistory := string(vCluster.Spec.ComponentStatusesHistory) +vType := string(vCluster.Spec.Type) +vProjectId := string(vCluster.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCluster { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Uuid: &vUuid, + Connected: &vConnected, + IstioState: &vIstioState, + Status: &vStatus, + StatusHistory: &vStatusHistory, + Castatus: &vCastatus, + CaStatusHistory: &vCaStatusHistory, + ComponentStatuses: &vComponentStatuses, + ComponentStatusesHistory: &vComponentStatusesHistory, + Type: &vType, + ProjectId: &vProjectId, + } + vGlobalClusterList = append(vGlobalClusterList, ret) + + log.Debugf("[getGlobalExternalPluginInstanceConfigClustersResolver]Output Clusters objects %v", vGlobalClusterList) + + return vGlobalClusterList, nil + } + + log.Debug("[getGlobalExternalPluginInstanceConfigClustersResolver]Id is empty, process all Clusterss") + + vClusterParent, err := nc.GlobalRoot().Config().ExternalPlugins(getParentName(obj.ParentLabels, "externalpluginconfigfolders.global.tsm.tanzu.vmware.com")).Plugins(getParentName(obj.ParentLabels, "externalpluginconfigs.global.tsm.tanzu.vmware.com")).GetPluginInstances(context.TODO(), getParentName(obj.ParentLabels, "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalPluginInstanceConfigClustersResolver]Error getting parent node %s", err) + return vGlobalClusterList, nil + } + vClusterAllObj, err := vClusterParent.GetAllClusters(context.TODO()) + if err != nil { + log.Errorf("[getGlobalExternalPluginInstanceConfigClustersResolver]Error getting Clusters %s", err) + return vGlobalClusterList, nil + } + for _, i := range vClusterAllObj { + vClusterParent, err := nc.GlobalRoot().Config().ExternalPlugins(getParentName(obj.ParentLabels, "externalpluginconfigfolders.global.tsm.tanzu.vmware.com")).Plugins(getParentName(obj.ParentLabels, "externalpluginconfigs.global.tsm.tanzu.vmware.com")).GetPluginInstances(context.TODO(), getParentName(obj.ParentLabels, "externalplugininstanceconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalExternalPluginInstanceConfigClustersResolver]Error getting parent node %s, skipping...", err) + continue + } + vCluster, err := vClusterParent.GetClusters(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalExternalPluginInstanceConfigClustersResolver]Error getting Clusters node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vCluster.DisplayName() +parentLabels := map[string]interface{}{"clusters.global.tsm.tanzu.vmware.com":dn} +vName := string(vCluster.Spec.Name) +vUuid := string(vCluster.Spec.Uuid) +vConnected := bool(vCluster.Spec.Connected) +vIstioState := string(vCluster.Spec.IstioState) +vStatus := string(vCluster.Spec.Status) +vStatusHistory := string(vCluster.Spec.StatusHistory) +vCastatus := string(vCluster.Spec.Castatus) +vCaStatusHistory := string(vCluster.Spec.CaStatusHistory) +vComponentStatuses := string(vCluster.Spec.ComponentStatuses) +vComponentStatusesHistory := string(vCluster.Spec.ComponentStatusesHistory) +vType := string(vCluster.Spec.Type) +vProjectId := string(vCluster.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCluster { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Uuid: &vUuid, + Connected: &vConnected, + IstioState: &vIstioState, + Status: &vStatus, + StatusHistory: &vStatusHistory, + Castatus: &vCastatus, + CaStatusHistory: &vCaStatusHistory, + ComponentStatuses: &vComponentStatuses, + ComponentStatusesHistory: &vComponentStatusesHistory, + Type: &vType, + ProjectId: &vProjectId, + } + vGlobalClusterList = append(vGlobalClusterList, ret) + } + log.Debugf("[getGlobalExternalPluginInstanceConfigClustersResolver]List of Clusters object %v", vGlobalClusterList) + return vGlobalClusterList, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: Certificate Node: GatewayConfigAdditionalListeners PKG: Global +////////////////////////////////////// +func getGlobalGatewayConfigAdditionalListenersCertificateResolver(obj *model.GlobalGatewayConfigAdditionalListeners, id *string) (*model.GlobalGatewayConfigListenerCertificate, error) { + log.Debugf("[getGlobalGatewayConfigAdditionalListenersCertificateResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalGatewayConfigAdditionalListenersCertificateResolver]Id %q", *id) + vGatewayConfigListenerCertificate, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GatewayConfig(getParentName(obj.ParentLabels, "gatewayconfigs.global.tsm.tanzu.vmware.com")).AdditionalListeners(getParentName(obj.ParentLabels, "gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com")).GetCertificate(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGatewayConfigAdditionalListenersCertificateResolver]Error getting Certificate node %q : %s", *id, err) + return &model.GlobalGatewayConfigListenerCertificate{}, nil + } + dn := vGatewayConfigListenerCertificate.DisplayName() +parentLabels := map[string]interface{}{"gatewayconfiglistenercertificates.global.tsm.tanzu.vmware.com":dn} +vEncryptedCertificate := string(vGatewayConfigListenerCertificate.Spec.EncryptedCertificate) +vEncryptedPrivateKey := string(vGatewayConfigListenerCertificate.Spec.EncryptedPrivateKey) +vEncryptedCertChain := string(vGatewayConfigListenerCertificate.Spec.EncryptedCertChain) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGatewayConfigListenerCertificate { + Id: &dn, + ParentLabels: parentLabels, + EncryptedCertificate: &vEncryptedCertificate, + EncryptedPrivateKey: &vEncryptedPrivateKey, + EncryptedCertChain: &vEncryptedCertChain, + } + + log.Debugf("[getGlobalGatewayConfigAdditionalListenersCertificateResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalGatewayConfigAdditionalListenersCertificateResolver]Id is empty, process all Certificates") + vGatewayConfigListenerCertificateParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GatewayConfig(getParentName(obj.ParentLabels, "gatewayconfigs.global.tsm.tanzu.vmware.com")).GetAdditionalListeners(context.TODO(), getParentName(obj.ParentLabels, "gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGatewayConfigAdditionalListenersCertificateResolver]Failed to get parent node %s", err) + return &model.GlobalGatewayConfigListenerCertificate{}, nil + } + vGatewayConfigListenerCertificate, err := vGatewayConfigListenerCertificateParent.GetCertificate(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGatewayConfigAdditionalListenersCertificateResolver]Error getting Certificate node %s", err) + return &model.GlobalGatewayConfigListenerCertificate{}, nil + } + dn := vGatewayConfigListenerCertificate.DisplayName() +parentLabels := map[string]interface{}{"gatewayconfiglistenercertificates.global.tsm.tanzu.vmware.com":dn} +vEncryptedCertificate := string(vGatewayConfigListenerCertificate.Spec.EncryptedCertificate) +vEncryptedPrivateKey := string(vGatewayConfigListenerCertificate.Spec.EncryptedPrivateKey) +vEncryptedCertChain := string(vGatewayConfigListenerCertificate.Spec.EncryptedCertChain) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGatewayConfigListenerCertificate { + Id: &dn, + ParentLabels: parentLabels, + EncryptedCertificate: &vEncryptedCertificate, + EncryptedPrivateKey: &vEncryptedPrivateKey, + EncryptedCertChain: &vEncryptedCertChain, + } + + log.Debugf("[getGlobalGatewayConfigAdditionalListenersCertificateResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ListenerRoutes Node: GatewayConfigAdditionalListeners PKG: Global +////////////////////////////////////// +func getGlobalGatewayConfigAdditionalListenersListenerRoutesResolver(obj *model.GlobalGatewayConfigAdditionalListeners, id *string) ([]*model.GlobalGatewayConfigListenerDestinationRoute, error) { + log.Debugf("[getGlobalGatewayConfigAdditionalListenersListenerRoutesResolver]Parent Object %+v", obj) + var vGlobalGatewayConfigListenerDestinationRouteList []*model.GlobalGatewayConfigListenerDestinationRoute + if id != nil && *id != "" { + log.Debugf("[getGlobalGatewayConfigAdditionalListenersListenerRoutesResolver]Id %q", *id) + vGatewayConfigListenerDestinationRoute, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GatewayConfig(getParentName(obj.ParentLabels, "gatewayconfigs.global.tsm.tanzu.vmware.com")).AdditionalListeners(getParentName(obj.ParentLabels, "gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com")).GetListenerRoutes(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGatewayConfigAdditionalListenersListenerRoutesResolver]Error getting ListenerRoutes node %q : %s", *id, err) + return vGlobalGatewayConfigListenerDestinationRouteList, nil + } + dn := vGatewayConfigListenerDestinationRoute.DisplayName() +parentLabels := map[string]interface{}{"gatewayconfiglistenerdestinationroutes.global.tsm.tanzu.vmware.com":dn} +vHost := string(vGatewayConfigListenerDestinationRoute.Spec.Host) +vTarget := string(vGatewayConfigListenerDestinationRoute.Spec.Target) +Paths, _ := json.Marshal(vGatewayConfigListenerDestinationRoute.Spec.Paths) +PathsData := string(Paths) +vPort := int(vGatewayConfigListenerDestinationRoute.Spec.Port) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGatewayConfigListenerDestinationRoute { + Id: &dn, + ParentLabels: parentLabels, + Host: &vHost, + Target: &vTarget, + Paths: &PathsData, + Port: &vPort, + } + vGlobalGatewayConfigListenerDestinationRouteList = append(vGlobalGatewayConfigListenerDestinationRouteList, ret) + + log.Debugf("[getGlobalGatewayConfigAdditionalListenersListenerRoutesResolver]Output ListenerRoutes objects %v", vGlobalGatewayConfigListenerDestinationRouteList) + + return vGlobalGatewayConfigListenerDestinationRouteList, nil + } + + log.Debug("[getGlobalGatewayConfigAdditionalListenersListenerRoutesResolver]Id is empty, process all ListenerRoutess") + + vGatewayConfigListenerDestinationRouteParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GatewayConfig(getParentName(obj.ParentLabels, "gatewayconfigs.global.tsm.tanzu.vmware.com")).GetAdditionalListeners(context.TODO(), getParentName(obj.ParentLabels, "gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGatewayConfigAdditionalListenersListenerRoutesResolver]Error getting parent node %s", err) + return vGlobalGatewayConfigListenerDestinationRouteList, nil + } + vGatewayConfigListenerDestinationRouteAllObj, err := vGatewayConfigListenerDestinationRouteParent.GetAllListenerRoutes(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGatewayConfigAdditionalListenersListenerRoutesResolver]Error getting ListenerRoutes objects %s", err) + return vGlobalGatewayConfigListenerDestinationRouteList, nil + } + for _, i := range vGatewayConfigListenerDestinationRouteAllObj { + vGatewayConfigListenerDestinationRoute, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GatewayConfig(getParentName(obj.ParentLabels, "gatewayconfigs.global.tsm.tanzu.vmware.com")).AdditionalListeners(getParentName(obj.ParentLabels, "gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com")).GetListenerRoutes(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGatewayConfigAdditionalListenersListenerRoutesResolver]Error getting ListenerRoutes node %q : %s", i.DisplayName(), err) + continue + } + dn := vGatewayConfigListenerDestinationRoute.DisplayName() +parentLabels := map[string]interface{}{"gatewayconfiglistenerdestinationroutes.global.tsm.tanzu.vmware.com":dn} +vHost := string(vGatewayConfigListenerDestinationRoute.Spec.Host) +vTarget := string(vGatewayConfigListenerDestinationRoute.Spec.Target) +Paths, _ := json.Marshal(vGatewayConfigListenerDestinationRoute.Spec.Paths) +PathsData := string(Paths) +vPort := int(vGatewayConfigListenerDestinationRoute.Spec.Port) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGatewayConfigListenerDestinationRoute { + Id: &dn, + ParentLabels: parentLabels, + Host: &vHost, + Target: &vTarget, + Paths: &PathsData, + Port: &vPort, + } + vGlobalGatewayConfigListenerDestinationRouteList = append(vGlobalGatewayConfigListenerDestinationRouteList, ret) + } + + log.Debugf("[getGlobalGatewayConfigAdditionalListenersListenerRoutesResolver]Output ListenerRoutes objects %v", vGlobalGatewayConfigListenerDestinationRouteList) + + return vGlobalGatewayConfigListenerDestinationRouteList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: AdditionalListeners Node: GatewayConfig PKG: Global +////////////////////////////////////// +func getGlobalGatewayConfigAdditionalListenersResolver(obj *model.GlobalGatewayConfig, id *string) ([]*model.GlobalGatewayConfigAdditionalListeners, error) { + log.Debugf("[getGlobalGatewayConfigAdditionalListenersResolver]Parent Object %+v", obj) + var vGlobalGatewayConfigAdditionalListenersList []*model.GlobalGatewayConfigAdditionalListeners + if id != nil && *id != "" { + log.Debugf("[getGlobalGatewayConfigAdditionalListenersResolver]Id %q", *id) + vGatewayConfigAdditionalListeners, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GatewayConfig(getParentName(obj.ParentLabels, "gatewayconfigs.global.tsm.tanzu.vmware.com")).GetAdditionalListeners(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGatewayConfigAdditionalListenersResolver]Error getting AdditionalListeners node %q : %s", *id, err) + return vGlobalGatewayConfigAdditionalListenersList, nil + } + dn := vGatewayConfigAdditionalListeners.DisplayName() +parentLabels := map[string]interface{}{"gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com":dn} +vName := string(vGatewayConfigAdditionalListeners.Spec.Name) +vPort := int(vGatewayConfigAdditionalListeners.Spec.Port) +vProtocol := string(vGatewayConfigAdditionalListeners.Spec.Protocol) +vTlsMode := string(vGatewayConfigAdditionalListeners.Spec.TlsMode) +vOwnedBy := string(vGatewayConfigAdditionalListeners.Spec.OwnedBy) +Hosts, _ := json.Marshal(vGatewayConfigAdditionalListeners.Spec.Hosts) +HostsData := string(Hosts) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGatewayConfigAdditionalListeners { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Port: &vPort, + Protocol: &vProtocol, + TlsMode: &vTlsMode, + OwnedBy: &vOwnedBy, + Hosts: &HostsData, + } + vGlobalGatewayConfigAdditionalListenersList = append(vGlobalGatewayConfigAdditionalListenersList, ret) + + log.Debugf("[getGlobalGatewayConfigAdditionalListenersResolver]Output AdditionalListeners objects %v", vGlobalGatewayConfigAdditionalListenersList) + + return vGlobalGatewayConfigAdditionalListenersList, nil + } + + log.Debug("[getGlobalGatewayConfigAdditionalListenersResolver]Id is empty, process all AdditionalListenerss") + + vGatewayConfigAdditionalListenersParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetGatewayConfig(context.TODO(), getParentName(obj.ParentLabels, "gatewayconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGatewayConfigAdditionalListenersResolver]Error getting parent node %s", err) + return vGlobalGatewayConfigAdditionalListenersList, nil + } + vGatewayConfigAdditionalListenersAllObj, err := vGatewayConfigAdditionalListenersParent.GetAllAdditionalListeners(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGatewayConfigAdditionalListenersResolver]Error getting AdditionalListeners objects %s", err) + return vGlobalGatewayConfigAdditionalListenersList, nil + } + for _, i := range vGatewayConfigAdditionalListenersAllObj { + vGatewayConfigAdditionalListeners, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GatewayConfig(getParentName(obj.ParentLabels, "gatewayconfigs.global.tsm.tanzu.vmware.com")).GetAdditionalListeners(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGatewayConfigAdditionalListenersResolver]Error getting AdditionalListeners node %q : %s", i.DisplayName(), err) + continue + } + dn := vGatewayConfigAdditionalListeners.DisplayName() +parentLabels := map[string]interface{}{"gatewayconfigadditionallistenerses.global.tsm.tanzu.vmware.com":dn} +vName := string(vGatewayConfigAdditionalListeners.Spec.Name) +vPort := int(vGatewayConfigAdditionalListeners.Spec.Port) +vProtocol := string(vGatewayConfigAdditionalListeners.Spec.Protocol) +vTlsMode := string(vGatewayConfigAdditionalListeners.Spec.TlsMode) +vOwnedBy := string(vGatewayConfigAdditionalListeners.Spec.OwnedBy) +Hosts, _ := json.Marshal(vGatewayConfigAdditionalListeners.Spec.Hosts) +HostsData := string(Hosts) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGatewayConfigAdditionalListeners { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Port: &vPort, + Protocol: &vProtocol, + TlsMode: &vTlsMode, + OwnedBy: &vOwnedBy, + Hosts: &HostsData, + } + vGlobalGatewayConfigAdditionalListenersList = append(vGlobalGatewayConfigAdditionalListenersList, ret) + } + + log.Debugf("[getGlobalGatewayConfigAdditionalListenersResolver]Output AdditionalListeners objects %v", vGlobalGatewayConfigAdditionalListenersList) + + return vGlobalGatewayConfigAdditionalListenersList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Services Node: Gateway PKG: Global +////////////////////////////////////// +func getGlobalGatewayServicesResolver(obj *model.GlobalGateway, id *string) ([]*model.GlobalService, error) { + log.Debugf("[getGlobalGatewayServicesResolver]Parent Object %+v", obj) + var vGlobalServiceList []*model.GlobalService + if id != nil && *id != "" { + log.Debugf("[getGlobalGatewayServicesResolver]Id %q", *id) + vServiceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetGateways(context.TODO(), getParentName(obj.ParentLabels, "gateways.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGatewayServicesResolver]Error getting Services %q : %s", *id, err) + return vGlobalServiceList, nil + } + vService, err := vServiceParent.GetServices(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGatewayServicesResolver]Error getting Services %q : %s", *id, err) + return vGlobalServiceList, nil + } + dn := vService.DisplayName() +parentLabels := map[string]interface{}{"services.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vService.Spec.Metadata) +vSpec := string(vService.Spec.Spec) +vName := string(vService.Spec.Name) +vNamespace := string(vService.Spec.Namespace) +vApiLink := string(vService.Spec.ApiLink) +vIpAddress := string(vService.Spec.IpAddress) +vAnnotations := string(vService.Spec.Annotations) +vCreationTimestamp := string(vService.Spec.CreationTimestamp) +vLabels := string(vService.Spec.Labels) +vUid := string(vService.Spec.Uid) +vPorts := string(vService.Spec.Ports) +vSelector := string(vService.Spec.Selector) +vType := string(vService.Spec.Type) +vStatus := string(vService.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalService { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Name: &vName, + Namespace: &vNamespace, + ApiLink: &vApiLink, + IpAddress: &vIpAddress, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Uid: &vUid, + Ports: &vPorts, + Selector: &vSelector, + Type: &vType, + Status: &vStatus, + } + vGlobalServiceList = append(vGlobalServiceList, ret) + + log.Debugf("[getGlobalGatewayServicesResolver]Output Services objects %v", vGlobalServiceList) + + return vGlobalServiceList, nil + } + + log.Debug("[getGlobalGatewayServicesResolver]Id is empty, process all Servicess") + + vServiceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetGateways(context.TODO(), getParentName(obj.ParentLabels, "gateways.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGatewayServicesResolver]Error getting parent node %s", err) + return vGlobalServiceList, nil + } + vServiceAllObj, err := vServiceParent.GetAllServices(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGatewayServicesResolver]Error getting Services %s", err) + return vGlobalServiceList, nil + } + for _, i := range vServiceAllObj { + vServiceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetGateways(context.TODO(), getParentName(obj.ParentLabels, "gateways.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGatewayServicesResolver]Error getting parent node %s, skipping...", err) + continue + } + vService, err := vServiceParent.GetServices(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGatewayServicesResolver]Error getting Services node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vService.DisplayName() +parentLabels := map[string]interface{}{"services.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vService.Spec.Metadata) +vSpec := string(vService.Spec.Spec) +vName := string(vService.Spec.Name) +vNamespace := string(vService.Spec.Namespace) +vApiLink := string(vService.Spec.ApiLink) +vIpAddress := string(vService.Spec.IpAddress) +vAnnotations := string(vService.Spec.Annotations) +vCreationTimestamp := string(vService.Spec.CreationTimestamp) +vLabels := string(vService.Spec.Labels) +vUid := string(vService.Spec.Uid) +vPorts := string(vService.Spec.Ports) +vSelector := string(vService.Spec.Selector) +vType := string(vService.Spec.Type) +vStatus := string(vService.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalService { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Name: &vName, + Namespace: &vNamespace, + ApiLink: &vApiLink, + IpAddress: &vIpAddress, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Uid: &vUid, + Ports: &vPorts, + Selector: &vSelector, + Type: &vType, + Status: &vStatus, + } + vGlobalServiceList = append(vGlobalServiceList, ret) + } + log.Debugf("[getGlobalGatewayServicesResolver]List of Services object %v", vGlobalServiceList) + return vGlobalServiceList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: RoutingPolicies Node: GlobalNs PKG: Global +////////////////////////////////////// +func getGlobalGlobalNsRoutingPoliciesResolver(obj *model.GlobalGlobalNs, id *string) ([]*model.GlobalRPolicy, error) { + log.Debugf("[getGlobalGlobalNsRoutingPoliciesResolver]Parent Object %+v", obj) + var vGlobalRPolicyList []*model.GlobalRPolicy + if id != nil && *id != "" { + log.Debugf("[getGlobalGlobalNsRoutingPoliciesResolver]Id %q", *id) + vRPolicy, err := nc.GlobalRoot().Runtime().AllsparkServices().AwsConnector().Gns(getParentName(obj.ParentLabels, "globalnses.global.tsm.tanzu.vmware.com")).GetRoutingPolicies(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGlobalNsRoutingPoliciesResolver]Error getting RoutingPolicies node %q : %s", *id, err) + return vGlobalRPolicyList, nil + } + dn := vRPolicy.DisplayName() +parentLabels := map[string]interface{}{"rpolicies.global.tsm.tanzu.vmware.com":dn} +vHealthCheckId := string(vRPolicy.Spec.HealthCheckId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalRPolicy { + Id: &dn, + ParentLabels: parentLabels, + HealthCheckId: &vHealthCheckId, + } + vGlobalRPolicyList = append(vGlobalRPolicyList, ret) + + log.Debugf("[getGlobalGlobalNsRoutingPoliciesResolver]Output RoutingPolicies objects %v", vGlobalRPolicyList) + + return vGlobalRPolicyList, nil + } + + log.Debug("[getGlobalGlobalNsRoutingPoliciesResolver]Id is empty, process all RoutingPoliciess") + + vRPolicyParent, err := nc.GlobalRoot().Runtime().AllsparkServices().AwsConnector().GetGns(context.TODO(), getParentName(obj.ParentLabels, "globalnses.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGlobalNsRoutingPoliciesResolver]Error getting parent node %s", err) + return vGlobalRPolicyList, nil + } + vRPolicyAllObj, err := vRPolicyParent.GetAllRoutingPolicies(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGlobalNsRoutingPoliciesResolver]Error getting RoutingPolicies objects %s", err) + return vGlobalRPolicyList, nil + } + for _, i := range vRPolicyAllObj { + vRPolicy, err := nc.GlobalRoot().Runtime().AllsparkServices().AwsConnector().Gns(getParentName(obj.ParentLabels, "globalnses.global.tsm.tanzu.vmware.com")).GetRoutingPolicies(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGlobalNsRoutingPoliciesResolver]Error getting RoutingPolicies node %q : %s", i.DisplayName(), err) + continue + } + dn := vRPolicy.DisplayName() +parentLabels := map[string]interface{}{"rpolicies.global.tsm.tanzu.vmware.com":dn} +vHealthCheckId := string(vRPolicy.Spec.HealthCheckId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalRPolicy { + Id: &dn, + ParentLabels: parentLabels, + HealthCheckId: &vHealthCheckId, + } + vGlobalRPolicyList = append(vGlobalRPolicyList, ret) + } + + log.Debugf("[getGlobalGlobalNsRoutingPoliciesResolver]Output RoutingPolicies objects %v", vGlobalRPolicyList) + + return vGlobalRPolicyList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Tenants Node: GlobalRegistrationService PKG: Global +////////////////////////////////////// +func getGlobalGlobalRegistrationServiceTenantsResolver(obj *model.GlobalGlobalRegistrationService, id *string) ([]*model.GlobalTenant, error) { + log.Debugf("[getGlobalGlobalRegistrationServiceTenantsResolver]Parent Object %+v", obj) + var vGlobalTenantList []*model.GlobalTenant + if id != nil && *id != "" { + log.Debugf("[getGlobalGlobalRegistrationServiceTenantsResolver]Id %q", *id) + vTenant, err := nc.GlobalRoot().Runtime().AllsparkServices().GlobalRegistrationService(getParentName(obj.ParentLabels, "globalregistrationservices.global.tsm.tanzu.vmware.com")).GetTenants(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGlobalRegistrationServiceTenantsResolver]Error getting Tenants node %q : %s", *id, err) + return vGlobalTenantList, nil + } + dn := vTenant.DisplayName() +parentLabels := map[string]interface{}{"tenants.global.tsm.tanzu.vmware.com":dn} +vName := string(vTenant.Spec.Name) +vTenantName := string(vTenant.Spec.TenantName) +vContactEmail := string(vTenant.Spec.ContactEmail) +vYaml := string(vTenant.Spec.Yaml) +vLb := string(vTenant.Spec.Lb) +vCompanySize := string(vTenant.Spec.CompanySize) +vAddress := string(vTenant.Spec.Address) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalTenant { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + TenantName: &vTenantName, + ContactEmail: &vContactEmail, + Yaml: &vYaml, + Lb: &vLb, + CompanySize: &vCompanySize, + Address: &vAddress, + } + vGlobalTenantList = append(vGlobalTenantList, ret) + + log.Debugf("[getGlobalGlobalRegistrationServiceTenantsResolver]Output Tenants objects %v", vGlobalTenantList) + + return vGlobalTenantList, nil + } + + log.Debug("[getGlobalGlobalRegistrationServiceTenantsResolver]Id is empty, process all Tenantss") + + vTenantParent, err := nc.GlobalRoot().Runtime().AllsparkServices().GetGlobalRegistrationService(context.TODO(), getParentName(obj.ParentLabels, "globalregistrationservices.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGlobalRegistrationServiceTenantsResolver]Error getting parent node %s", err) + return vGlobalTenantList, nil + } + vTenantAllObj, err := vTenantParent.GetAllTenants(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGlobalRegistrationServiceTenantsResolver]Error getting Tenants objects %s", err) + return vGlobalTenantList, nil + } + for _, i := range vTenantAllObj { + vTenant, err := nc.GlobalRoot().Runtime().AllsparkServices().GlobalRegistrationService(getParentName(obj.ParentLabels, "globalregistrationservices.global.tsm.tanzu.vmware.com")).GetTenants(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGlobalRegistrationServiceTenantsResolver]Error getting Tenants node %q : %s", i.DisplayName(), err) + continue + } + dn := vTenant.DisplayName() +parentLabels := map[string]interface{}{"tenants.global.tsm.tanzu.vmware.com":dn} +vName := string(vTenant.Spec.Name) +vTenantName := string(vTenant.Spec.TenantName) +vContactEmail := string(vTenant.Spec.ContactEmail) +vYaml := string(vTenant.Spec.Yaml) +vLb := string(vTenant.Spec.Lb) +vCompanySize := string(vTenant.Spec.CompanySize) +vAddress := string(vTenant.Spec.Address) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalTenant { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + TenantName: &vTenantName, + ContactEmail: &vContactEmail, + Yaml: &vYaml, + Lb: &vLb, + CompanySize: &vCompanySize, + Address: &vAddress, + } + vGlobalTenantList = append(vGlobalTenantList, ret) + } + + log.Debugf("[getGlobalGlobalRegistrationServiceTenantsResolver]Output Tenants objects %v", vGlobalTenantList) + + return vGlobalTenantList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: TenantToken Node: GlobalRegistrationService PKG: Global +////////////////////////////////////// +func getGlobalGlobalRegistrationServiceTenantTokenResolver(obj *model.GlobalGlobalRegistrationService, id *string) ([]*model.GlobalTenantToken, error) { + log.Debugf("[getGlobalGlobalRegistrationServiceTenantTokenResolver]Parent Object %+v", obj) + var vGlobalTenantTokenList []*model.GlobalTenantToken + if id != nil && *id != "" { + log.Debugf("[getGlobalGlobalRegistrationServiceTenantTokenResolver]Id %q", *id) + vTenantToken, err := nc.GlobalRoot().Runtime().AllsparkServices().GlobalRegistrationService(getParentName(obj.ParentLabels, "globalregistrationservices.global.tsm.tanzu.vmware.com")).GetTenantToken(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGlobalRegistrationServiceTenantTokenResolver]Error getting TenantToken node %q : %s", *id, err) + return vGlobalTenantTokenList, nil + } + dn := vTenantToken.DisplayName() +parentLabels := map[string]interface{}{"tenanttokens.global.tsm.tanzu.vmware.com":dn} +vTtl := int(vTenantToken.Spec.Ttl) +vCreated := string(vTenantToken.Spec.Created) +vTenantId := string(vTenantToken.Spec.TenantId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalTenantToken { + Id: &dn, + ParentLabels: parentLabels, + Ttl: &vTtl, + Created: &vCreated, + TenantId: &vTenantId, + } + vGlobalTenantTokenList = append(vGlobalTenantTokenList, ret) + + log.Debugf("[getGlobalGlobalRegistrationServiceTenantTokenResolver]Output TenantToken objects %v", vGlobalTenantTokenList) + + return vGlobalTenantTokenList, nil + } + + log.Debug("[getGlobalGlobalRegistrationServiceTenantTokenResolver]Id is empty, process all TenantTokens") + + vTenantTokenParent, err := nc.GlobalRoot().Runtime().AllsparkServices().GetGlobalRegistrationService(context.TODO(), getParentName(obj.ParentLabels, "globalregistrationservices.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGlobalRegistrationServiceTenantTokenResolver]Error getting parent node %s", err) + return vGlobalTenantTokenList, nil + } + vTenantTokenAllObj, err := vTenantTokenParent.GetAllTenantToken(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGlobalRegistrationServiceTenantTokenResolver]Error getting TenantToken objects %s", err) + return vGlobalTenantTokenList, nil + } + for _, i := range vTenantTokenAllObj { + vTenantToken, err := nc.GlobalRoot().Runtime().AllsparkServices().GlobalRegistrationService(getParentName(obj.ParentLabels, "globalregistrationservices.global.tsm.tanzu.vmware.com")).GetTenantToken(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGlobalRegistrationServiceTenantTokenResolver]Error getting TenantToken node %q : %s", i.DisplayName(), err) + continue + } + dn := vTenantToken.DisplayName() +parentLabels := map[string]interface{}{"tenanttokens.global.tsm.tanzu.vmware.com":dn} +vTtl := int(vTenantToken.Spec.Ttl) +vCreated := string(vTenantToken.Spec.Created) +vTenantId := string(vTenantToken.Spec.TenantId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalTenantToken { + Id: &dn, + ParentLabels: parentLabels, + Ttl: &vTtl, + Created: &vCreated, + TenantId: &vTenantId, + } + vGlobalTenantTokenList = append(vGlobalTenantTokenList, ret) + } + + log.Debugf("[getGlobalGlobalRegistrationServiceTenantTokenResolver]Output TenantToken objects %v", vGlobalTenantTokenList) + + return vGlobalTenantTokenList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Gns Node: GlobalNamespace PKG: Global +////////////////////////////////////// +func getGlobalGlobalNamespaceGnsResolver(obj *model.GlobalGlobalNamespace, id *string) ([]*model.GlobalGNS, error) { + log.Debugf("[getGlobalGlobalNamespaceGnsResolver]Parent Object %+v", obj) + var vGlobalGNSList []*model.GlobalGNS + if id != nil && *id != "" { + log.Debugf("[getGlobalGlobalNamespaceGnsResolver]Id %q", *id) + vGNS, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGlobalNamespaceGnsResolver]Error getting Gns node %q : %s", *id, err) + return vGlobalGNSList, nil + } + dn := vGNS.DisplayName() +parentLabels := map[string]interface{}{"gnss.global.tsm.tanzu.vmware.com":dn} +vDomain := string(vGNS.Spec.Domain) +vUseSharedGateway := bool(vGNS.Spec.UseSharedGateway) +vMTLSEnforced := bool(vGNS.Spec.MTLSEnforced) +vMTLSPermissive := bool(vGNS.Spec.MTLSPermissive) +vApiDiscoveryEnabled := bool(vGNS.Spec.ApiDiscoveryEnabled) +vMTLSExceptions := string(vGNS.Spec.MTLSExceptions) +vCaType := string(vGNS.Spec.CaType) +vCa := string(vGNS.Spec.Ca) +vDescription := string(vGNS.Spec.Description) +vColor := string(vGNS.Spec.Color) +vVersion := string(vGNS.Spec.Version) +vProjectId := string(vGNS.Spec.ProjectId) +vMemberDomains := string(vGNS.Spec.MemberDomains) +vMatchingConditions := string(vGNS.Spec.MatchingConditions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGNS { + Id: &dn, + ParentLabels: parentLabels, + Domain: &vDomain, + UseSharedGateway: &vUseSharedGateway, + MTLSEnforced: &vMTLSEnforced, + MTLSPermissive: &vMTLSPermissive, + ApiDiscoveryEnabled: &vApiDiscoveryEnabled, + MTLSExceptions: &vMTLSExceptions, + CaType: &vCaType, + Ca: &vCa, + Description: &vDescription, + Color: &vColor, + Version: &vVersion, + ProjectId: &vProjectId, + MemberDomains: &vMemberDomains, + MatchingConditions: &vMatchingConditions, + } + vGlobalGNSList = append(vGlobalGNSList, ret) + + log.Debugf("[getGlobalGlobalNamespaceGnsResolver]Output Gns objects %v", vGlobalGNSList) + + return vGlobalGNSList, nil + } + + log.Debug("[getGlobalGlobalNamespaceGnsResolver]Id is empty, process all Gnss") + + vGNSParent, err := nc.GlobalRoot().Config().GetGlobalNamespace(context.TODO(), getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGlobalNamespaceGnsResolver]Error getting parent node %s", err) + return vGlobalGNSList, nil + } + vGNSAllObj, err := vGNSParent.GetAllGns(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGlobalNamespaceGnsResolver]Error getting Gns objects %s", err) + return vGlobalGNSList, nil + } + for _, i := range vGNSAllObj { + vGNS, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGlobalNamespaceGnsResolver]Error getting Gns node %q : %s", i.DisplayName(), err) + continue + } + dn := vGNS.DisplayName() +parentLabels := map[string]interface{}{"gnss.global.tsm.tanzu.vmware.com":dn} +vDomain := string(vGNS.Spec.Domain) +vUseSharedGateway := bool(vGNS.Spec.UseSharedGateway) +vMTLSEnforced := bool(vGNS.Spec.MTLSEnforced) +vMTLSPermissive := bool(vGNS.Spec.MTLSPermissive) +vApiDiscoveryEnabled := bool(vGNS.Spec.ApiDiscoveryEnabled) +vMTLSExceptions := string(vGNS.Spec.MTLSExceptions) +vCaType := string(vGNS.Spec.CaType) +vCa := string(vGNS.Spec.Ca) +vDescription := string(vGNS.Spec.Description) +vColor := string(vGNS.Spec.Color) +vVersion := string(vGNS.Spec.Version) +vProjectId := string(vGNS.Spec.ProjectId) +vMemberDomains := string(vGNS.Spec.MemberDomains) +vMatchingConditions := string(vGNS.Spec.MatchingConditions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGNS { + Id: &dn, + ParentLabels: parentLabels, + Domain: &vDomain, + UseSharedGateway: &vUseSharedGateway, + MTLSEnforced: &vMTLSEnforced, + MTLSPermissive: &vMTLSPermissive, + ApiDiscoveryEnabled: &vApiDiscoveryEnabled, + MTLSExceptions: &vMTLSExceptions, + CaType: &vCaType, + Ca: &vCa, + Description: &vDescription, + Color: &vColor, + Version: &vVersion, + ProjectId: &vProjectId, + MemberDomains: &vMemberDomains, + MatchingConditions: &vMatchingConditions, + } + vGlobalGNSList = append(vGlobalGNSList, ret) + } + + log.Debugf("[getGlobalGlobalNamespaceGnsResolver]Output Gns objects %v", vGlobalGNSList) + + return vGlobalGNSList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: GnsSvcGroupRT Node: GnsBindingRT PKG: Global +////////////////////////////////////// +func getGlobalGnsBindingRTGnsSvcGroupRTResolver(obj *model.GlobalGnsBindingRT, id *string) ([]*model.GlobalGnsSvcGroupRT, error) { + log.Debugf("[getGlobalGnsBindingRTGnsSvcGroupRTResolver]Parent Object %+v", obj) + var vGlobalGnsSvcGroupRTList []*model.GlobalGnsSvcGroupRT + if id != nil && *id != "" { + log.Debugf("[getGlobalGnsBindingRTGnsSvcGroupRTResolver]Id %q", *id) + vGnsSvcGroupRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GnsBinding(getParentName(obj.ParentLabels, "gnsbindingrts.global.tsm.tanzu.vmware.com")).GetGnsSvcGroupRT(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGnsBindingRTGnsSvcGroupRTResolver]Error getting GnsSvcGroupRT node %q : %s", *id, err) + return vGlobalGnsSvcGroupRTList, nil + } + dn := vGnsSvcGroupRT.DisplayName() +parentLabels := map[string]interface{}{"gnssvcgrouprts.global.tsm.tanzu.vmware.com":dn} +vName := string(vGnsSvcGroupRT.Spec.Name) +vDisplayName := string(vGnsSvcGroupRT.Spec.DisplayName) +vDescription := string(vGnsSvcGroupRT.Spec.Description) +vServices := string(vGnsSvcGroupRT.Spec.Services) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsSvcGroupRT { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + DisplayName: &vDisplayName, + Description: &vDescription, + Services: &vServices, + } + vGlobalGnsSvcGroupRTList = append(vGlobalGnsSvcGroupRTList, ret) + + log.Debugf("[getGlobalGnsBindingRTGnsSvcGroupRTResolver]Output GnsSvcGroupRT objects %v", vGlobalGnsSvcGroupRTList) + + return vGlobalGnsSvcGroupRTList, nil + } + + log.Debug("[getGlobalGnsBindingRTGnsSvcGroupRTResolver]Id is empty, process all GnsSvcGroupRTs") + + vGnsSvcGroupRTParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetGnsBinding(context.TODO(), getParentName(obj.ParentLabels, "gnsbindingrts.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGnsBindingRTGnsSvcGroupRTResolver]Error getting parent node %s", err) + return vGlobalGnsSvcGroupRTList, nil + } + vGnsSvcGroupRTAllObj, err := vGnsSvcGroupRTParent.GetAllGnsSvcGroupRT(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGnsBindingRTGnsSvcGroupRTResolver]Error getting GnsSvcGroupRT objects %s", err) + return vGlobalGnsSvcGroupRTList, nil + } + for _, i := range vGnsSvcGroupRTAllObj { + vGnsSvcGroupRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GnsBinding(getParentName(obj.ParentLabels, "gnsbindingrts.global.tsm.tanzu.vmware.com")).GetGnsSvcGroupRT(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGnsBindingRTGnsSvcGroupRTResolver]Error getting GnsSvcGroupRT node %q : %s", i.DisplayName(), err) + continue + } + dn := vGnsSvcGroupRT.DisplayName() +parentLabels := map[string]interface{}{"gnssvcgrouprts.global.tsm.tanzu.vmware.com":dn} +vName := string(vGnsSvcGroupRT.Spec.Name) +vDisplayName := string(vGnsSvcGroupRT.Spec.DisplayName) +vDescription := string(vGnsSvcGroupRT.Spec.Description) +vServices := string(vGnsSvcGroupRT.Spec.Services) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsSvcGroupRT { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + DisplayName: &vDisplayName, + Description: &vDescription, + Services: &vServices, + } + vGlobalGnsSvcGroupRTList = append(vGlobalGnsSvcGroupRTList, ret) + } + + log.Debugf("[getGlobalGnsBindingRTGnsSvcGroupRTResolver]Output GnsSvcGroupRT objects %v", vGlobalGnsSvcGroupRTList) + + return vGlobalGnsSvcGroupRTList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: GnsRoutingRules Node: GnsBindingRT PKG: Global +////////////////////////////////////// +func getGlobalGnsBindingRTGnsRoutingRulesResolver(obj *model.GlobalGnsBindingRT, id *string) ([]*model.GlobalGnsRoutingRuleConfig, error) { + log.Debugf("[getGlobalGnsBindingRTGnsRoutingRulesResolver]Parent Object %+v", obj) + var vGlobalGnsRoutingRuleConfigList []*model.GlobalGnsRoutingRuleConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalGnsBindingRTGnsRoutingRulesResolver]Id %q", *id) + vGnsRoutingRuleConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GnsBinding(getParentName(obj.ParentLabels, "gnsbindingrts.global.tsm.tanzu.vmware.com")).GetGnsRoutingRules(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGnsBindingRTGnsRoutingRulesResolver]Error getting GnsRoutingRules node %q : %s", *id, err) + return vGlobalGnsRoutingRuleConfigList, nil + } + dn := vGnsRoutingRuleConfig.DisplayName() +parentLabels := map[string]interface{}{"gnsroutingruleconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vGnsRoutingRuleConfig.Spec.Name) +vOwnedBy := string(vGnsRoutingRuleConfig.Spec.OwnedBy) +vServiceFQDN := string(vGnsRoutingRuleConfig.Spec.ServiceFQDN) +vPortName := string(vGnsRoutingRuleConfig.Spec.PortName) +vPort := int(vGnsRoutingRuleConfig.Spec.Port) +vHttpRouteRules := string(vGnsRoutingRuleConfig.Spec.HttpRouteRules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsRoutingRuleConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + OwnedBy: &vOwnedBy, + ServiceFQDN: &vServiceFQDN, + PortName: &vPortName, + Port: &vPort, + HttpRouteRules: &vHttpRouteRules, + } + vGlobalGnsRoutingRuleConfigList = append(vGlobalGnsRoutingRuleConfigList, ret) + + log.Debugf("[getGlobalGnsBindingRTGnsRoutingRulesResolver]Output GnsRoutingRules objects %v", vGlobalGnsRoutingRuleConfigList) + + return vGlobalGnsRoutingRuleConfigList, nil + } + + log.Debug("[getGlobalGnsBindingRTGnsRoutingRulesResolver]Id is empty, process all GnsRoutingRuless") + + vGnsRoutingRuleConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetGnsBinding(context.TODO(), getParentName(obj.ParentLabels, "gnsbindingrts.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGnsBindingRTGnsRoutingRulesResolver]Error getting parent node %s", err) + return vGlobalGnsRoutingRuleConfigList, nil + } + vGnsRoutingRuleConfigAllObj, err := vGnsRoutingRuleConfigParent.GetAllGnsRoutingRules(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGnsBindingRTGnsRoutingRulesResolver]Error getting GnsRoutingRules objects %s", err) + return vGlobalGnsRoutingRuleConfigList, nil + } + for _, i := range vGnsRoutingRuleConfigAllObj { + vGnsRoutingRuleConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GnsBinding(getParentName(obj.ParentLabels, "gnsbindingrts.global.tsm.tanzu.vmware.com")).GetGnsRoutingRules(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGnsBindingRTGnsRoutingRulesResolver]Error getting GnsRoutingRules node %q : %s", i.DisplayName(), err) + continue + } + dn := vGnsRoutingRuleConfig.DisplayName() +parentLabels := map[string]interface{}{"gnsroutingruleconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vGnsRoutingRuleConfig.Spec.Name) +vOwnedBy := string(vGnsRoutingRuleConfig.Spec.OwnedBy) +vServiceFQDN := string(vGnsRoutingRuleConfig.Spec.ServiceFQDN) +vPortName := string(vGnsRoutingRuleConfig.Spec.PortName) +vPort := int(vGnsRoutingRuleConfig.Spec.Port) +vHttpRouteRules := string(vGnsRoutingRuleConfig.Spec.HttpRouteRules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsRoutingRuleConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + OwnedBy: &vOwnedBy, + ServiceFQDN: &vServiceFQDN, + PortName: &vPortName, + Port: &vPort, + HttpRouteRules: &vHttpRouteRules, + } + vGlobalGnsRoutingRuleConfigList = append(vGlobalGnsRoutingRuleConfigList, ret) + } + + log.Debugf("[getGlobalGnsBindingRTGnsRoutingRulesResolver]Output GnsRoutingRules objects %v", vGlobalGnsRoutingRuleConfigList) + + return vGlobalGnsRoutingRuleConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: GnsServiceEntryConfig Node: GnsBindingRT PKG: Global +////////////////////////////////////// +func getGlobalGnsBindingRTGnsServiceEntryConfigResolver(obj *model.GlobalGnsBindingRT, id *string) ([]*model.GlobalGnsServiceEntryConfig, error) { + log.Debugf("[getGlobalGnsBindingRTGnsServiceEntryConfigResolver]Parent Object %+v", obj) + var vGlobalGnsServiceEntryConfigList []*model.GlobalGnsServiceEntryConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalGnsBindingRTGnsServiceEntryConfigResolver]Id %q", *id) + vGnsServiceEntryConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GnsBinding(getParentName(obj.ParentLabels, "gnsbindingrts.global.tsm.tanzu.vmware.com")).GetGnsServiceEntryConfig(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGnsBindingRTGnsServiceEntryConfigResolver]Error getting GnsServiceEntryConfig node %q : %s", *id, err) + return vGlobalGnsServiceEntryConfigList, nil + } + dn := vGnsServiceEntryConfig.DisplayName() +parentLabels := map[string]interface{}{"gnsserviceentryconfigs.global.tsm.tanzu.vmware.com":dn} +vService := string(vGnsServiceEntryConfig.Spec.Service) +vPorts := string(vGnsServiceEntryConfig.Spec.Ports) +vVersions := string(vGnsServiceEntryConfig.Spec.Versions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsServiceEntryConfig { + Id: &dn, + ParentLabels: parentLabels, + Service: &vService, + Ports: &vPorts, + Versions: &vVersions, + } + vGlobalGnsServiceEntryConfigList = append(vGlobalGnsServiceEntryConfigList, ret) + + log.Debugf("[getGlobalGnsBindingRTGnsServiceEntryConfigResolver]Output GnsServiceEntryConfig objects %v", vGlobalGnsServiceEntryConfigList) + + return vGlobalGnsServiceEntryConfigList, nil + } + + log.Debug("[getGlobalGnsBindingRTGnsServiceEntryConfigResolver]Id is empty, process all GnsServiceEntryConfigs") + + vGnsServiceEntryConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetGnsBinding(context.TODO(), getParentName(obj.ParentLabels, "gnsbindingrts.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGnsBindingRTGnsServiceEntryConfigResolver]Error getting parent node %s", err) + return vGlobalGnsServiceEntryConfigList, nil + } + vGnsServiceEntryConfigAllObj, err := vGnsServiceEntryConfigParent.GetAllGnsServiceEntryConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGnsBindingRTGnsServiceEntryConfigResolver]Error getting GnsServiceEntryConfig objects %s", err) + return vGlobalGnsServiceEntryConfigList, nil + } + for _, i := range vGnsServiceEntryConfigAllObj { + vGnsServiceEntryConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GnsBinding(getParentName(obj.ParentLabels, "gnsbindingrts.global.tsm.tanzu.vmware.com")).GetGnsServiceEntryConfig(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGnsBindingRTGnsServiceEntryConfigResolver]Error getting GnsServiceEntryConfig node %q : %s", i.DisplayName(), err) + continue + } + dn := vGnsServiceEntryConfig.DisplayName() +parentLabels := map[string]interface{}{"gnsserviceentryconfigs.global.tsm.tanzu.vmware.com":dn} +vService := string(vGnsServiceEntryConfig.Spec.Service) +vPorts := string(vGnsServiceEntryConfig.Spec.Ports) +vVersions := string(vGnsServiceEntryConfig.Spec.Versions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsServiceEntryConfig { + Id: &dn, + ParentLabels: parentLabels, + Service: &vService, + Ports: &vPorts, + Versions: &vVersions, + } + vGlobalGnsServiceEntryConfigList = append(vGlobalGnsServiceEntryConfigList, ret) + } + + log.Debugf("[getGlobalGnsBindingRTGnsServiceEntryConfigResolver]Output GnsServiceEntryConfig objects %v", vGlobalGnsServiceEntryConfigList) + + return vGlobalGnsServiceEntryConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: RoutingConfigs Node: PublicServiceConfig PKG: Global +////////////////////////////////////// +func getGlobalPublicServiceConfigRoutingConfigsResolver(obj *model.GlobalPublicServiceConfig, id *string) ([]*model.GlobalPublicServiceRouteConfig, error) { + log.Debugf("[getGlobalPublicServiceConfigRoutingConfigsResolver]Parent Object %+v", obj) + var vGlobalPublicServiceRouteConfigList []*model.GlobalPublicServiceRouteConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalPublicServiceConfigRoutingConfigsResolver]Id %q", *id) + vPublicServiceRouteConfig, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).PublicServices(getParentName(obj.ParentLabels, "publicserviceconfigs.global.tsm.tanzu.vmware.com")).GetRoutingConfigs(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigRoutingConfigsResolver]Error getting RoutingConfigs node %q : %s", *id, err) + return vGlobalPublicServiceRouteConfigList, nil + } + dn := vPublicServiceRouteConfig.DisplayName() +parentLabels := map[string]interface{}{"publicservicerouteconfigs.global.tsm.tanzu.vmware.com":dn} +vType := string(vPublicServiceRouteConfig.Spec.Type) +vRoutes := string(vPublicServiceRouteConfig.Spec.Routes) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalPublicServiceRouteConfig { + Id: &dn, + ParentLabels: parentLabels, + Type: &vType, + Routes: &vRoutes, + } + vGlobalPublicServiceRouteConfigList = append(vGlobalPublicServiceRouteConfigList, ret) + + log.Debugf("[getGlobalPublicServiceConfigRoutingConfigsResolver]Output RoutingConfigs objects %v", vGlobalPublicServiceRouteConfigList) + + return vGlobalPublicServiceRouteConfigList, nil + } + + log.Debug("[getGlobalPublicServiceConfigRoutingConfigsResolver]Id is empty, process all RoutingConfigss") + + vPublicServiceRouteConfigParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetPublicServices(context.TODO(), getParentName(obj.ParentLabels, "publicserviceconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigRoutingConfigsResolver]Error getting parent node %s", err) + return vGlobalPublicServiceRouteConfigList, nil + } + vPublicServiceRouteConfigAllObj, err := vPublicServiceRouteConfigParent.GetAllRoutingConfigs(context.TODO()) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigRoutingConfigsResolver]Error getting RoutingConfigs objects %s", err) + return vGlobalPublicServiceRouteConfigList, nil + } + for _, i := range vPublicServiceRouteConfigAllObj { + vPublicServiceRouteConfig, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).PublicServices(getParentName(obj.ParentLabels, "publicserviceconfigs.global.tsm.tanzu.vmware.com")).GetRoutingConfigs(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigRoutingConfigsResolver]Error getting RoutingConfigs node %q : %s", i.DisplayName(), err) + continue + } + dn := vPublicServiceRouteConfig.DisplayName() +parentLabels := map[string]interface{}{"publicservicerouteconfigs.global.tsm.tanzu.vmware.com":dn} +vType := string(vPublicServiceRouteConfig.Spec.Type) +vRoutes := string(vPublicServiceRouteConfig.Spec.Routes) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalPublicServiceRouteConfig { + Id: &dn, + ParentLabels: parentLabels, + Type: &vType, + Routes: &vRoutes, + } + vGlobalPublicServiceRouteConfigList = append(vGlobalPublicServiceRouteConfigList, ret) + } + + log.Debugf("[getGlobalPublicServiceConfigRoutingConfigsResolver]Output RoutingConfigs objects %v", vGlobalPublicServiceRouteConfigList) + + return vGlobalPublicServiceRouteConfigList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ExternalDNS Node: PublicServiceConfig PKG: Global +////////////////////////////////////// +func getGlobalPublicServiceConfigExternalDNSResolver(obj *model.GlobalPublicServiceConfig, id *string) ([]*model.GlobalExternalDNSConfigN, error) { + log.Debugf("[getGlobalPublicServiceConfigExternalDNSResolver]Parent Object %+v", obj) + var vGlobalExternalDNSConfigNList []*model.GlobalExternalDNSConfigN + if id != nil && *id != "" { + log.Debugf("[getGlobalPublicServiceConfigExternalDNSResolver]Id %q", *id) + vExternalDNSConfigNParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetPublicServices(context.TODO(), getParentName(obj.ParentLabels, "publicserviceconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigExternalDNSResolver]Error getting ExternalDNS %q : %s", *id, err) + return vGlobalExternalDNSConfigNList, nil + } + vExternalDNSConfigN, err := vExternalDNSConfigNParent.GetExternalDNS(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigExternalDNSResolver]Error getting ExternalDNS %q : %s", *id, err) + return vGlobalExternalDNSConfigNList, nil + } + dn := vExternalDNSConfigN.DisplayName() +parentLabels := map[string]interface{}{"externaldnsconfigns.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vExternalDNSConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSConfigN { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + } + vGlobalExternalDNSConfigNList = append(vGlobalExternalDNSConfigNList, ret) + + log.Debugf("[getGlobalPublicServiceConfigExternalDNSResolver]Output ExternalDNS objects %v", vGlobalExternalDNSConfigNList) + + return vGlobalExternalDNSConfigNList, nil + } + + log.Debug("[getGlobalPublicServiceConfigExternalDNSResolver]Id is empty, process all ExternalDNSs") + + vExternalDNSConfigNParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetPublicServices(context.TODO(), getParentName(obj.ParentLabels, "publicserviceconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigExternalDNSResolver]Error getting parent node %s", err) + return vGlobalExternalDNSConfigNList, nil + } + vExternalDNSConfigNAllObj, err := vExternalDNSConfigNParent.GetAllExternalDNS(context.TODO()) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigExternalDNSResolver]Error getting ExternalDNS %s", err) + return vGlobalExternalDNSConfigNList, nil + } + for _, i := range vExternalDNSConfigNAllObj { + vExternalDNSConfigNParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetPublicServices(context.TODO(), getParentName(obj.ParentLabels, "publicserviceconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigExternalDNSResolver]Error getting parent node %s, skipping...", err) + continue + } + vExternalDNSConfigN, err := vExternalDNSConfigNParent.GetExternalDNS(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigExternalDNSResolver]Error getting ExternalDNS node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vExternalDNSConfigN.DisplayName() +parentLabels := map[string]interface{}{"externaldnsconfigns.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vExternalDNSConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSConfigN { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + } + vGlobalExternalDNSConfigNList = append(vGlobalExternalDNSConfigNList, ret) + } + log.Debugf("[getGlobalPublicServiceConfigExternalDNSResolver]List of ExternalDNS object %v", vGlobalExternalDNSConfigNList) + return vGlobalExternalDNSConfigNList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Certificates Node: PublicServiceConfig PKG: Global +////////////////////////////////////// +func getGlobalPublicServiceConfigCertificatesResolver(obj *model.GlobalPublicServiceConfig, id *string) ([]*model.GlobalCertificateConfigN, error) { + log.Debugf("[getGlobalPublicServiceConfigCertificatesResolver]Parent Object %+v", obj) + var vGlobalCertificateConfigNList []*model.GlobalCertificateConfigN + if id != nil && *id != "" { + log.Debugf("[getGlobalPublicServiceConfigCertificatesResolver]Id %q", *id) + vCertificateConfigNParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetPublicServices(context.TODO(), getParentName(obj.ParentLabels, "publicserviceconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigCertificatesResolver]Error getting Certificates %q : %s", *id, err) + return vGlobalCertificateConfigNList, nil + } + vCertificateConfigN, err := vCertificateConfigNParent.GetCertificates(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigCertificatesResolver]Error getting Certificates %q : %s", *id, err) + return vGlobalCertificateConfigNList, nil + } + dn := vCertificateConfigN.DisplayName() +parentLabels := map[string]interface{}{"certificateconfigns.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vCertificateConfigN.Spec.ProjectId) +vBeginsOn := string(vCertificateConfigN.Spec.BeginsOn) +vExpiresOn := string(vCertificateConfigN.Spec.ExpiresOn) +vIssuedToCN := string(vCertificateConfigN.Spec.IssuedToCN) +vConfig := string(vCertificateConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCertificateConfigN { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + BeginsOn: &vBeginsOn, + ExpiresOn: &vExpiresOn, + IssuedToCN: &vIssuedToCN, + Config: &vConfig, + } + vGlobalCertificateConfigNList = append(vGlobalCertificateConfigNList, ret) + + log.Debugf("[getGlobalPublicServiceConfigCertificatesResolver]Output Certificates objects %v", vGlobalCertificateConfigNList) + + return vGlobalCertificateConfigNList, nil + } + + log.Debug("[getGlobalPublicServiceConfigCertificatesResolver]Id is empty, process all Certificatess") + + vCertificateConfigNParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetPublicServices(context.TODO(), getParentName(obj.ParentLabels, "publicserviceconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigCertificatesResolver]Error getting parent node %s", err) + return vGlobalCertificateConfigNList, nil + } + vCertificateConfigNAllObj, err := vCertificateConfigNParent.GetAllCertificates(context.TODO()) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigCertificatesResolver]Error getting Certificates %s", err) + return vGlobalCertificateConfigNList, nil + } + for _, i := range vCertificateConfigNAllObj { + vCertificateConfigNParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetPublicServices(context.TODO(), getParentName(obj.ParentLabels, "publicserviceconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigCertificatesResolver]Error getting parent node %s, skipping...", err) + continue + } + vCertificateConfigN, err := vCertificateConfigNParent.GetCertificates(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigCertificatesResolver]Error getting Certificates node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vCertificateConfigN.DisplayName() +parentLabels := map[string]interface{}{"certificateconfigns.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vCertificateConfigN.Spec.ProjectId) +vBeginsOn := string(vCertificateConfigN.Spec.BeginsOn) +vExpiresOn := string(vCertificateConfigN.Spec.ExpiresOn) +vIssuedToCN := string(vCertificateConfigN.Spec.IssuedToCN) +vConfig := string(vCertificateConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCertificateConfigN { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + BeginsOn: &vBeginsOn, + ExpiresOn: &vExpiresOn, + IssuedToCN: &vIssuedToCN, + Config: &vConfig, + } + vGlobalCertificateConfigNList = append(vGlobalCertificateConfigNList, ret) + } + log.Debugf("[getGlobalPublicServiceConfigCertificatesResolver]List of Certificates object %v", vGlobalCertificateConfigNList) + return vGlobalCertificateConfigNList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: HealthChecks Node: PublicServiceConfig PKG: Global +////////////////////////////////////// +func getGlobalPublicServiceConfigHealthChecksResolver(obj *model.GlobalPublicServiceConfig, id *string) ([]*model.GlobalHealthCheckConfigN, error) { + log.Debugf("[getGlobalPublicServiceConfigHealthChecksResolver]Parent Object %+v", obj) + var vGlobalHealthCheckConfigNList []*model.GlobalHealthCheckConfigN + if id != nil && *id != "" { + log.Debugf("[getGlobalPublicServiceConfigHealthChecksResolver]Id %q", *id) + vHealthCheckConfigNParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetPublicServices(context.TODO(), getParentName(obj.ParentLabels, "publicserviceconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigHealthChecksResolver]Error getting HealthChecks %q : %s", *id, err) + return vGlobalHealthCheckConfigNList, nil + } + vHealthCheckConfigN, err := vHealthCheckConfigNParent.GetHealthChecks(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigHealthChecksResolver]Error getting HealthChecks %q : %s", *id, err) + return vGlobalHealthCheckConfigNList, nil + } + dn := vHealthCheckConfigN.DisplayName() +parentLabels := map[string]interface{}{"healthcheckconfigns.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vHealthCheckConfigN.Spec.ProjectId) +vConfig := string(vHealthCheckConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalHealthCheckConfigN { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + Config: &vConfig, + } + vGlobalHealthCheckConfigNList = append(vGlobalHealthCheckConfigNList, ret) + + log.Debugf("[getGlobalPublicServiceConfigHealthChecksResolver]Output HealthChecks objects %v", vGlobalHealthCheckConfigNList) + + return vGlobalHealthCheckConfigNList, nil + } + + log.Debug("[getGlobalPublicServiceConfigHealthChecksResolver]Id is empty, process all HealthCheckss") + + vHealthCheckConfigNParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetPublicServices(context.TODO(), getParentName(obj.ParentLabels, "publicserviceconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigHealthChecksResolver]Error getting parent node %s", err) + return vGlobalHealthCheckConfigNList, nil + } + vHealthCheckConfigNAllObj, err := vHealthCheckConfigNParent.GetAllHealthChecks(context.TODO()) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigHealthChecksResolver]Error getting HealthChecks %s", err) + return vGlobalHealthCheckConfigNList, nil + } + for _, i := range vHealthCheckConfigNAllObj { + vHealthCheckConfigNParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetPublicServices(context.TODO(), getParentName(obj.ParentLabels, "publicserviceconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigHealthChecksResolver]Error getting parent node %s, skipping...", err) + continue + } + vHealthCheckConfigN, err := vHealthCheckConfigNParent.GetHealthChecks(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalPublicServiceConfigHealthChecksResolver]Error getting HealthChecks node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vHealthCheckConfigN.DisplayName() +parentLabels := map[string]interface{}{"healthcheckconfigns.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vHealthCheckConfigN.Spec.ProjectId) +vConfig := string(vHealthCheckConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalHealthCheckConfigN { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + Config: &vConfig, + } + vGlobalHealthCheckConfigNList = append(vGlobalHealthCheckConfigNList, ret) + } + log.Debugf("[getGlobalPublicServiceConfigHealthChecksResolver]List of HealthChecks object %v", vGlobalHealthCheckConfigNList) + return vGlobalHealthCheckConfigNList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Services Node: GNSSvcGroup PKG: Global +////////////////////////////////////// +func getGlobalGNSSvcGroupServicesResolver(obj *model.GlobalGNSSvcGroup, id *string) ([]*model.GlobalService, error) { + log.Debugf("[getGlobalGNSSvcGroupServicesResolver]Parent Object %+v", obj) + var vGlobalServiceList []*model.GlobalService + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSSvcGroupServicesResolver]Id %q", *id) + vServiceParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetGnsServiceGroups(context.TODO(), getParentName(obj.ParentLabels, "gnssvcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSSvcGroupServicesResolver]Error getting Services %q : %s", *id, err) + return vGlobalServiceList, nil + } + vService, err := vServiceParent.GetServices(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSSvcGroupServicesResolver]Error getting Services %q : %s", *id, err) + return vGlobalServiceList, nil + } + dn := vService.DisplayName() +parentLabels := map[string]interface{}{"services.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vService.Spec.Metadata) +vSpec := string(vService.Spec.Spec) +vName := string(vService.Spec.Name) +vNamespace := string(vService.Spec.Namespace) +vApiLink := string(vService.Spec.ApiLink) +vIpAddress := string(vService.Spec.IpAddress) +vAnnotations := string(vService.Spec.Annotations) +vCreationTimestamp := string(vService.Spec.CreationTimestamp) +vLabels := string(vService.Spec.Labels) +vUid := string(vService.Spec.Uid) +vPorts := string(vService.Spec.Ports) +vSelector := string(vService.Spec.Selector) +vType := string(vService.Spec.Type) +vStatus := string(vService.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalService { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Name: &vName, + Namespace: &vNamespace, + ApiLink: &vApiLink, + IpAddress: &vIpAddress, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Uid: &vUid, + Ports: &vPorts, + Selector: &vSelector, + Type: &vType, + Status: &vStatus, + } + vGlobalServiceList = append(vGlobalServiceList, ret) + + log.Debugf("[getGlobalGNSSvcGroupServicesResolver]Output Services objects %v", vGlobalServiceList) + + return vGlobalServiceList, nil + } + + log.Debug("[getGlobalGNSSvcGroupServicesResolver]Id is empty, process all Servicess") + + vServiceParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetGnsServiceGroups(context.TODO(), getParentName(obj.ParentLabels, "gnssvcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSSvcGroupServicesResolver]Error getting parent node %s", err) + return vGlobalServiceList, nil + } + vServiceAllObj, err := vServiceParent.GetAllServices(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSSvcGroupServicesResolver]Error getting Services %s", err) + return vGlobalServiceList, nil + } + for _, i := range vServiceAllObj { + vServiceParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetGnsServiceGroups(context.TODO(), getParentName(obj.ParentLabels, "gnssvcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSSvcGroupServicesResolver]Error getting parent node %s, skipping...", err) + continue + } + vService, err := vServiceParent.GetServices(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSSvcGroupServicesResolver]Error getting Services node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vService.DisplayName() +parentLabels := map[string]interface{}{"services.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vService.Spec.Metadata) +vSpec := string(vService.Spec.Spec) +vName := string(vService.Spec.Name) +vNamespace := string(vService.Spec.Namespace) +vApiLink := string(vService.Spec.ApiLink) +vIpAddress := string(vService.Spec.IpAddress) +vAnnotations := string(vService.Spec.Annotations) +vCreationTimestamp := string(vService.Spec.CreationTimestamp) +vLabels := string(vService.Spec.Labels) +vUid := string(vService.Spec.Uid) +vPorts := string(vService.Spec.Ports) +vSelector := string(vService.Spec.Selector) +vType := string(vService.Spec.Type) +vStatus := string(vService.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalService { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Name: &vName, + Namespace: &vNamespace, + ApiLink: &vApiLink, + IpAddress: &vIpAddress, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Uid: &vUid, + Ports: &vPorts, + Selector: &vSelector, + Type: &vType, + Status: &vStatus, + } + vGlobalServiceList = append(vGlobalServiceList, ret) + } + log.Debugf("[getGlobalGNSSvcGroupServicesResolver]List of Services object %v", vGlobalServiceList) + return vGlobalServiceList, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: RoutingConfig Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSRoutingConfigResolver(obj *model.GlobalGNS, id *string) (*model.GlobalGNSRoutingConfig, error) { + log.Debugf("[getGlobalGNSRoutingConfigResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSRoutingConfigResolver]Id %q", *id) + vGNSRoutingConfig, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetRoutingConfig(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSRoutingConfigResolver]Error getting RoutingConfig node %q : %s", *id, err) + return &model.GlobalGNSRoutingConfig{}, nil + } + dn := vGNSRoutingConfig.DisplayName() +parentLabels := map[string]interface{}{"gnsroutingconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vGNSRoutingConfig.Spec.Name) +vSpec := string(vGNSRoutingConfig.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGNSRoutingConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Spec: &vSpec, + } + + log.Debugf("[getGlobalGNSRoutingConfigResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalGNSRoutingConfigResolver]Id is empty, process all RoutingConfigs") + vGNSRoutingConfigParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSRoutingConfigResolver]Failed to get parent node %s", err) + return &model.GlobalGNSRoutingConfig{}, nil + } + vGNSRoutingConfig, err := vGNSRoutingConfigParent.GetRoutingConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSRoutingConfigResolver]Error getting RoutingConfig node %s", err) + return &model.GlobalGNSRoutingConfig{}, nil + } + dn := vGNSRoutingConfig.DisplayName() +parentLabels := map[string]interface{}{"gnsroutingconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vGNSRoutingConfig.Spec.Name) +vSpec := string(vGNSRoutingConfig.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGNSRoutingConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Spec: &vSpec, + } + + log.Debugf("[getGlobalGNSRoutingConfigResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: GnsServiceGroups Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSGnsServiceGroupsResolver(obj *model.GlobalGNS, id *string) ([]*model.GlobalGNSSvcGroup, error) { + log.Debugf("[getGlobalGNSGnsServiceGroupsResolver]Parent Object %+v", obj) + var vGlobalGNSSvcGroupList []*model.GlobalGNSSvcGroup + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSGnsServiceGroupsResolver]Id %q", *id) + vGNSSvcGroup, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetGnsServiceGroups(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSGnsServiceGroupsResolver]Error getting GnsServiceGroups node %q : %s", *id, err) + return vGlobalGNSSvcGroupList, nil + } + dn := vGNSSvcGroup.DisplayName() +parentLabels := map[string]interface{}{"gnssvcgroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vGNSSvcGroup.Spec.DisplayName) +vDescription := string(vGNSSvcGroup.Spec.Description) +vColor := string(vGNSSvcGroup.Spec.Color) +vRules := string(vGNSSvcGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGNSSvcGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + Description: &vDescription, + Color: &vColor, + Rules: &vRules, + } + vGlobalGNSSvcGroupList = append(vGlobalGNSSvcGroupList, ret) + + log.Debugf("[getGlobalGNSGnsServiceGroupsResolver]Output GnsServiceGroups objects %v", vGlobalGNSSvcGroupList) + + return vGlobalGNSSvcGroupList, nil + } + + log.Debug("[getGlobalGNSGnsServiceGroupsResolver]Id is empty, process all GnsServiceGroupss") + + vGNSSvcGroupParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSGnsServiceGroupsResolver]Error getting parent node %s", err) + return vGlobalGNSSvcGroupList, nil + } + vGNSSvcGroupAllObj, err := vGNSSvcGroupParent.GetAllGnsServiceGroups(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSGnsServiceGroupsResolver]Error getting GnsServiceGroups objects %s", err) + return vGlobalGNSSvcGroupList, nil + } + for _, i := range vGNSSvcGroupAllObj { + vGNSSvcGroup, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetGnsServiceGroups(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSGnsServiceGroupsResolver]Error getting GnsServiceGroups node %q : %s", i.DisplayName(), err) + continue + } + dn := vGNSSvcGroup.DisplayName() +parentLabels := map[string]interface{}{"gnssvcgroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vGNSSvcGroup.Spec.DisplayName) +vDescription := string(vGNSSvcGroup.Spec.Description) +vColor := string(vGNSSvcGroup.Spec.Color) +vRules := string(vGNSSvcGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGNSSvcGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + Description: &vDescription, + Color: &vColor, + Rules: &vRules, + } + vGlobalGNSSvcGroupList = append(vGlobalGNSSvcGroupList, ret) + } + + log.Debugf("[getGlobalGNSGnsServiceGroupsResolver]Output GnsServiceGroups objects %v", vGlobalGNSSvcGroupList) + + return vGlobalGNSSvcGroupList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: PublicServices Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSPublicServicesResolver(obj *model.GlobalGNS, id *string) ([]*model.GlobalPublicServiceConfig, error) { + log.Debugf("[getGlobalGNSPublicServicesResolver]Parent Object %+v", obj) + var vGlobalPublicServiceConfigList []*model.GlobalPublicServiceConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSPublicServicesResolver]Id %q", *id) + vPublicServiceConfig, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetPublicServices(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSPublicServicesResolver]Error getting PublicServices node %q : %s", *id, err) + return vGlobalPublicServiceConfigList, nil + } + dn := vPublicServiceConfig.DisplayName() +parentLabels := map[string]interface{}{"publicserviceconfigs.global.tsm.tanzu.vmware.com":dn} +vFqdn := string(vPublicServiceConfig.Spec.Fqdn) +vConfig := string(vPublicServiceConfig.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalPublicServiceConfig { + Id: &dn, + ParentLabels: parentLabels, + Fqdn: &vFqdn, + Config: &vConfig, + } + vGlobalPublicServiceConfigList = append(vGlobalPublicServiceConfigList, ret) + + log.Debugf("[getGlobalGNSPublicServicesResolver]Output PublicServices objects %v", vGlobalPublicServiceConfigList) + + return vGlobalPublicServiceConfigList, nil + } + + log.Debug("[getGlobalGNSPublicServicesResolver]Id is empty, process all PublicServicess") + + vPublicServiceConfigParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSPublicServicesResolver]Error getting parent node %s", err) + return vGlobalPublicServiceConfigList, nil + } + vPublicServiceConfigAllObj, err := vPublicServiceConfigParent.GetAllPublicServices(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSPublicServicesResolver]Error getting PublicServices objects %s", err) + return vGlobalPublicServiceConfigList, nil + } + for _, i := range vPublicServiceConfigAllObj { + vPublicServiceConfig, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetPublicServices(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSPublicServicesResolver]Error getting PublicServices node %q : %s", i.DisplayName(), err) + continue + } + dn := vPublicServiceConfig.DisplayName() +parentLabels := map[string]interface{}{"publicserviceconfigs.global.tsm.tanzu.vmware.com":dn} +vFqdn := string(vPublicServiceConfig.Spec.Fqdn) +vConfig := string(vPublicServiceConfig.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalPublicServiceConfig { + Id: &dn, + ParentLabels: parentLabels, + Fqdn: &vFqdn, + Config: &vConfig, + } + vGlobalPublicServiceConfigList = append(vGlobalPublicServiceConfigList, ret) + } + + log.Debugf("[getGlobalGNSPublicServicesResolver]Output PublicServices objects %v", vGlobalPublicServiceConfigList) + + return vGlobalPublicServiceConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: SharedServices Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSSharedServicesResolver(obj *model.GlobalGNS, id *string) ([]*model.GlobalSharedServiceConfig, error) { + log.Debugf("[getGlobalGNSSharedServicesResolver]Parent Object %+v", obj) + var vGlobalSharedServiceConfigList []*model.GlobalSharedServiceConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSSharedServicesResolver]Id %q", *id) + vSharedServiceConfig, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetSharedServices(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSSharedServicesResolver]Error getting SharedServices node %q : %s", *id, err) + return vGlobalSharedServiceConfigList, nil + } + dn := vSharedServiceConfig.DisplayName() +parentLabels := map[string]interface{}{"sharedserviceconfigs.global.tsm.tanzu.vmware.com":dn} +vSpec := string(vSharedServiceConfig.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSharedServiceConfig { + Id: &dn, + ParentLabels: parentLabels, + Spec: &vSpec, + } + vGlobalSharedServiceConfigList = append(vGlobalSharedServiceConfigList, ret) + + log.Debugf("[getGlobalGNSSharedServicesResolver]Output SharedServices objects %v", vGlobalSharedServiceConfigList) + + return vGlobalSharedServiceConfigList, nil + } + + log.Debug("[getGlobalGNSSharedServicesResolver]Id is empty, process all SharedServicess") + + vSharedServiceConfigParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSSharedServicesResolver]Error getting parent node %s", err) + return vGlobalSharedServiceConfigList, nil + } + vSharedServiceConfigAllObj, err := vSharedServiceConfigParent.GetAllSharedServices(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSSharedServicesResolver]Error getting SharedServices objects %s", err) + return vGlobalSharedServiceConfigList, nil + } + for _, i := range vSharedServiceConfigAllObj { + vSharedServiceConfig, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetSharedServices(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSSharedServicesResolver]Error getting SharedServices node %q : %s", i.DisplayName(), err) + continue + } + dn := vSharedServiceConfig.DisplayName() +parentLabels := map[string]interface{}{"sharedserviceconfigs.global.tsm.tanzu.vmware.com":dn} +vSpec := string(vSharedServiceConfig.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSharedServiceConfig { + Id: &dn, + ParentLabels: parentLabels, + Spec: &vSpec, + } + vGlobalSharedServiceConfigList = append(vGlobalSharedServiceConfigList, ret) + } + + log.Debugf("[getGlobalGNSSharedServicesResolver]Output SharedServices objects %v", vGlobalSharedServiceConfigList) + + return vGlobalSharedServiceConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: SloPolicies Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSSloPoliciesResolver(obj *model.GlobalGNS, id *string) ([]*model.GlobalSLOPolicy, error) { + log.Debugf("[getGlobalGNSSloPoliciesResolver]Parent Object %+v", obj) + var vGlobalSLOPolicyList []*model.GlobalSLOPolicy + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSSloPoliciesResolver]Id %q", *id) + vSLOPolicy, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetSloPolicies(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSSloPoliciesResolver]Error getting SloPolicies node %q : %s", *id, err) + return vGlobalSLOPolicyList, nil + } + dn := vSLOPolicy.DisplayName() +parentLabels := map[string]interface{}{"slopolicies.global.tsm.tanzu.vmware.com":dn} +vName := string(vSLOPolicy.Spec.Name) +vDisabled := bool(vSLOPolicy.Spec.Disabled) +vDescription := string(vSLOPolicy.Spec.Description) +vLabels := string(vSLOPolicy.Spec.Labels) +vSlis := string(vSLOPolicy.Spec.Slis) +ServiceNames, _ := json.Marshal(vSLOPolicy.Spec.ServiceNames) +ServiceNamesData := string(ServiceNames) +vSloTargetValue := string(vSLOPolicy.Spec.SloTargetValue) +vSloPeriod := string(vSLOPolicy.Spec.SloPeriod) +vSloKind := string(vSLOPolicy.Spec.SloKind) +Actions, _ := json.Marshal(vSLOPolicy.Spec.Actions) +ActionsData := string(Actions) +vSloCreationTime := string(vSLOPolicy.Spec.SloCreationTime) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSLOPolicy { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Disabled: &vDisabled, + Description: &vDescription, + Labels: &vLabels, + Slis: &vSlis, + ServiceNames: &ServiceNamesData, + SloTargetValue: &vSloTargetValue, + SloPeriod: &vSloPeriod, + SloKind: &vSloKind, + Actions: &ActionsData, + SloCreationTime: &vSloCreationTime, + } + vGlobalSLOPolicyList = append(vGlobalSLOPolicyList, ret) + + log.Debugf("[getGlobalGNSSloPoliciesResolver]Output SloPolicies objects %v", vGlobalSLOPolicyList) + + return vGlobalSLOPolicyList, nil + } + + log.Debug("[getGlobalGNSSloPoliciesResolver]Id is empty, process all SloPoliciess") + + vSLOPolicyParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSSloPoliciesResolver]Error getting parent node %s", err) + return vGlobalSLOPolicyList, nil + } + vSLOPolicyAllObj, err := vSLOPolicyParent.GetAllSloPolicies(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSSloPoliciesResolver]Error getting SloPolicies objects %s", err) + return vGlobalSLOPolicyList, nil + } + for _, i := range vSLOPolicyAllObj { + vSLOPolicy, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetSloPolicies(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSSloPoliciesResolver]Error getting SloPolicies node %q : %s", i.DisplayName(), err) + continue + } + dn := vSLOPolicy.DisplayName() +parentLabels := map[string]interface{}{"slopolicies.global.tsm.tanzu.vmware.com":dn} +vName := string(vSLOPolicy.Spec.Name) +vDisabled := bool(vSLOPolicy.Spec.Disabled) +vDescription := string(vSLOPolicy.Spec.Description) +vLabels := string(vSLOPolicy.Spec.Labels) +vSlis := string(vSLOPolicy.Spec.Slis) +ServiceNames, _ := json.Marshal(vSLOPolicy.Spec.ServiceNames) +ServiceNamesData := string(ServiceNames) +vSloTargetValue := string(vSLOPolicy.Spec.SloTargetValue) +vSloPeriod := string(vSLOPolicy.Spec.SloPeriod) +vSloKind := string(vSLOPolicy.Spec.SloKind) +Actions, _ := json.Marshal(vSLOPolicy.Spec.Actions) +ActionsData := string(Actions) +vSloCreationTime := string(vSLOPolicy.Spec.SloCreationTime) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSLOPolicy { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Disabled: &vDisabled, + Description: &vDescription, + Labels: &vLabels, + Slis: &vSlis, + ServiceNames: &ServiceNamesData, + SloTargetValue: &vSloTargetValue, + SloPeriod: &vSloPeriod, + SloKind: &vSloKind, + Actions: &ActionsData, + SloCreationTime: &vSloCreationTime, + } + vGlobalSLOPolicyList = append(vGlobalSLOPolicyList, ret) + } + + log.Debugf("[getGlobalGNSSloPoliciesResolver]Output SloPolicies objects %v", vGlobalSLOPolicyList) + + return vGlobalSLOPolicyList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ExternalServices Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSExternalServicesResolver(obj *model.GlobalGNS, id *string) ([]*model.GlobalExternalServiceConfig, error) { + log.Debugf("[getGlobalGNSExternalServicesResolver]Parent Object %+v", obj) + var vGlobalExternalServiceConfigList []*model.GlobalExternalServiceConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSExternalServicesResolver]Id %q", *id) + vExternalServiceConfig, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetExternalServices(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSExternalServicesResolver]Error getting ExternalServices node %q : %s", *id, err) + return vGlobalExternalServiceConfigList, nil + } + dn := vExternalServiceConfig.DisplayName() +parentLabels := map[string]interface{}{"externalserviceconfigs.global.tsm.tanzu.vmware.com":dn} +vSpec := string(vExternalServiceConfig.Spec.Spec) +vSystem := bool(vExternalServiceConfig.Spec.System) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalServiceConfig { + Id: &dn, + ParentLabels: parentLabels, + Spec: &vSpec, + System: &vSystem, + } + vGlobalExternalServiceConfigList = append(vGlobalExternalServiceConfigList, ret) + + log.Debugf("[getGlobalGNSExternalServicesResolver]Output ExternalServices objects %v", vGlobalExternalServiceConfigList) + + return vGlobalExternalServiceConfigList, nil + } + + log.Debug("[getGlobalGNSExternalServicesResolver]Id is empty, process all ExternalServicess") + + vExternalServiceConfigParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSExternalServicesResolver]Error getting parent node %s", err) + return vGlobalExternalServiceConfigList, nil + } + vExternalServiceConfigAllObj, err := vExternalServiceConfigParent.GetAllExternalServices(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSExternalServicesResolver]Error getting ExternalServices objects %s", err) + return vGlobalExternalServiceConfigList, nil + } + for _, i := range vExternalServiceConfigAllObj { + vExternalServiceConfig, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetExternalServices(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSExternalServicesResolver]Error getting ExternalServices node %q : %s", i.DisplayName(), err) + continue + } + dn := vExternalServiceConfig.DisplayName() +parentLabels := map[string]interface{}{"externalserviceconfigs.global.tsm.tanzu.vmware.com":dn} +vSpec := string(vExternalServiceConfig.Spec.Spec) +vSystem := bool(vExternalServiceConfig.Spec.System) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalServiceConfig { + Id: &dn, + ParentLabels: parentLabels, + Spec: &vSpec, + System: &vSystem, + } + vGlobalExternalServiceConfigList = append(vGlobalExternalServiceConfigList, ret) + } + + log.Debugf("[getGlobalGNSExternalServicesResolver]Output ExternalServices objects %v", vGlobalExternalServiceConfigList) + + return vGlobalExternalServiceConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: AutoscalingPolicies Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSAutoscalingPoliciesResolver(obj *model.GlobalGNS, id *string) ([]*model.GlobalAutoscalingPolicy, error) { + log.Debugf("[getGlobalGNSAutoscalingPoliciesResolver]Parent Object %+v", obj) + var vGlobalAutoscalingPolicyList []*model.GlobalAutoscalingPolicy + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSAutoscalingPoliciesResolver]Id %q", *id) + vAutoscalingPolicy, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetAutoscalingPolicies(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSAutoscalingPoliciesResolver]Error getting AutoscalingPolicies node %q : %s", *id, err) + return vGlobalAutoscalingPolicyList, nil + } + dn := vAutoscalingPolicy.DisplayName() +parentLabels := map[string]interface{}{"autoscalingpolicies.global.tsm.tanzu.vmware.com":dn} +vName := string(vAutoscalingPolicy.Spec.Name) +vDescription := string(vAutoscalingPolicy.Spec.Description) +vLabels := string(vAutoscalingPolicy.Spec.Labels) +vServiceName := string(vAutoscalingPolicy.Spec.ServiceName) +vAutoscalerSpec := string(vAutoscalingPolicy.Spec.AutoscalerSpec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAutoscalingPolicy { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Description: &vDescription, + Labels: &vLabels, + ServiceName: &vServiceName, + AutoscalerSpec: &vAutoscalerSpec, + } + vGlobalAutoscalingPolicyList = append(vGlobalAutoscalingPolicyList, ret) + + log.Debugf("[getGlobalGNSAutoscalingPoliciesResolver]Output AutoscalingPolicies objects %v", vGlobalAutoscalingPolicyList) + + return vGlobalAutoscalingPolicyList, nil + } + + log.Debug("[getGlobalGNSAutoscalingPoliciesResolver]Id is empty, process all AutoscalingPoliciess") + + vAutoscalingPolicyParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSAutoscalingPoliciesResolver]Error getting parent node %s", err) + return vGlobalAutoscalingPolicyList, nil + } + vAutoscalingPolicyAllObj, err := vAutoscalingPolicyParent.GetAllAutoscalingPolicies(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSAutoscalingPoliciesResolver]Error getting AutoscalingPolicies objects %s", err) + return vGlobalAutoscalingPolicyList, nil + } + for _, i := range vAutoscalingPolicyAllObj { + vAutoscalingPolicy, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetAutoscalingPolicies(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSAutoscalingPoliciesResolver]Error getting AutoscalingPolicies node %q : %s", i.DisplayName(), err) + continue + } + dn := vAutoscalingPolicy.DisplayName() +parentLabels := map[string]interface{}{"autoscalingpolicies.global.tsm.tanzu.vmware.com":dn} +vName := string(vAutoscalingPolicy.Spec.Name) +vDescription := string(vAutoscalingPolicy.Spec.Description) +vLabels := string(vAutoscalingPolicy.Spec.Labels) +vServiceName := string(vAutoscalingPolicy.Spec.ServiceName) +vAutoscalerSpec := string(vAutoscalingPolicy.Spec.AutoscalerSpec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAutoscalingPolicy { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Description: &vDescription, + Labels: &vLabels, + ServiceName: &vServiceName, + AutoscalerSpec: &vAutoscalerSpec, + } + vGlobalAutoscalingPolicyList = append(vGlobalAutoscalingPolicyList, ret) + } + + log.Debugf("[getGlobalGNSAutoscalingPoliciesResolver]Output AutoscalingPolicies objects %v", vGlobalAutoscalingPolicyList) + + return vGlobalAutoscalingPolicyList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: RoutingPolicies Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSRoutingPoliciesResolver(obj *model.GlobalGNS, id *string) ([]*model.GlobalGNSRoutingConfig, error) { + log.Debugf("[getGlobalGNSRoutingPoliciesResolver]Parent Object %+v", obj) + var vGlobalGNSRoutingConfigList []*model.GlobalGNSRoutingConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSRoutingPoliciesResolver]Id %q", *id) + vGNSRoutingConfig, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetRoutingPolicies(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSRoutingPoliciesResolver]Error getting RoutingPolicies node %q : %s", *id, err) + return vGlobalGNSRoutingConfigList, nil + } + dn := vGNSRoutingConfig.DisplayName() +parentLabels := map[string]interface{}{"gnsroutingconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vGNSRoutingConfig.Spec.Name) +vSpec := string(vGNSRoutingConfig.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGNSRoutingConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Spec: &vSpec, + } + vGlobalGNSRoutingConfigList = append(vGlobalGNSRoutingConfigList, ret) + + log.Debugf("[getGlobalGNSRoutingPoliciesResolver]Output RoutingPolicies objects %v", vGlobalGNSRoutingConfigList) + + return vGlobalGNSRoutingConfigList, nil + } + + log.Debug("[getGlobalGNSRoutingPoliciesResolver]Id is empty, process all RoutingPoliciess") + + vGNSRoutingConfigParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSRoutingPoliciesResolver]Error getting parent node %s", err) + return vGlobalGNSRoutingConfigList, nil + } + vGNSRoutingConfigAllObj, err := vGNSRoutingConfigParent.GetAllRoutingPolicies(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSRoutingPoliciesResolver]Error getting RoutingPolicies objects %s", err) + return vGlobalGNSRoutingConfigList, nil + } + for _, i := range vGNSRoutingConfigAllObj { + vGNSRoutingConfig, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetRoutingPolicies(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSRoutingPoliciesResolver]Error getting RoutingPolicies node %q : %s", i.DisplayName(), err) + continue + } + dn := vGNSRoutingConfig.DisplayName() +parentLabels := map[string]interface{}{"gnsroutingconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vGNSRoutingConfig.Spec.Name) +vSpec := string(vGNSRoutingConfig.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGNSRoutingConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Spec: &vSpec, + } + vGlobalGNSRoutingConfigList = append(vGlobalGNSRoutingConfigList, ret) + } + + log.Debugf("[getGlobalGNSRoutingPoliciesResolver]Output RoutingPolicies objects %v", vGlobalGNSRoutingConfigList) + + return vGlobalGNSRoutingConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ApiDiscovery Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSApiDiscoveryResolver(obj *model.GlobalGNS, id *string) ([]*model.GlobalApiDiscovery, error) { + log.Debugf("[getGlobalGNSApiDiscoveryResolver]Parent Object %+v", obj) + var vGlobalApiDiscoveryList []*model.GlobalApiDiscovery + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSApiDiscoveryResolver]Id %q", *id) + vApiDiscovery, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetApiDiscovery(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSApiDiscoveryResolver]Error getting ApiDiscovery node %q : %s", *id, err) + return vGlobalApiDiscoveryList, nil + } + dn := vApiDiscovery.DisplayName() +parentLabels := map[string]interface{}{"apidiscoveries.global.tsm.tanzu.vmware.com":dn} +vDescription := string(vApiDiscovery.Spec.Description) +Labels, _ := json.Marshal(vApiDiscovery.Spec.Labels) +LabelsData := string(Labels) +Spec, _ := json.Marshal(vApiDiscovery.Spec.Spec) +SpecData := string(Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalApiDiscovery { + Id: &dn, + ParentLabels: parentLabels, + Description: &vDescription, + Labels: &LabelsData, + Spec: &SpecData, + } + vGlobalApiDiscoveryList = append(vGlobalApiDiscoveryList, ret) + + log.Debugf("[getGlobalGNSApiDiscoveryResolver]Output ApiDiscovery objects %v", vGlobalApiDiscoveryList) + + return vGlobalApiDiscoveryList, nil + } + + log.Debug("[getGlobalGNSApiDiscoveryResolver]Id is empty, process all ApiDiscoverys") + + vApiDiscoveryParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSApiDiscoveryResolver]Error getting parent node %s", err) + return vGlobalApiDiscoveryList, nil + } + vApiDiscoveryAllObj, err := vApiDiscoveryParent.GetAllApiDiscovery(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSApiDiscoveryResolver]Error getting ApiDiscovery objects %s", err) + return vGlobalApiDiscoveryList, nil + } + for _, i := range vApiDiscoveryAllObj { + vApiDiscovery, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetApiDiscovery(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSApiDiscoveryResolver]Error getting ApiDiscovery node %q : %s", i.DisplayName(), err) + continue + } + dn := vApiDiscovery.DisplayName() +parentLabels := map[string]interface{}{"apidiscoveries.global.tsm.tanzu.vmware.com":dn} +vDescription := string(vApiDiscovery.Spec.Description) +Labels, _ := json.Marshal(vApiDiscovery.Spec.Labels) +LabelsData := string(Labels) +Spec, _ := json.Marshal(vApiDiscovery.Spec.Spec) +SpecData := string(Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalApiDiscovery { + Id: &dn, + ParentLabels: parentLabels, + Description: &vDescription, + Labels: &LabelsData, + Spec: &SpecData, + } + vGlobalApiDiscoveryList = append(vGlobalApiDiscoveryList, ret) + } + + log.Debugf("[getGlobalGNSApiDiscoveryResolver]Output ApiDiscovery objects %v", vGlobalApiDiscoveryList) + + return vGlobalApiDiscoveryList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: GeoDiscovery Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSGeoDiscoveryResolver(obj *model.GlobalGNS, id *string) ([]*model.GlobalGeoDiscovery, error) { + log.Debugf("[getGlobalGNSGeoDiscoveryResolver]Parent Object %+v", obj) + var vGlobalGeoDiscoveryList []*model.GlobalGeoDiscovery + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSGeoDiscoveryResolver]Id %q", *id) + vGeoDiscovery, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetGeoDiscovery(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSGeoDiscoveryResolver]Error getting GeoDiscovery node %q : %s", *id, err) + return vGlobalGeoDiscoveryList, nil + } + dn := vGeoDiscovery.DisplayName() +parentLabels := map[string]interface{}{"geodiscoveries.global.tsm.tanzu.vmware.com":dn} +vDescription := string(vGeoDiscovery.Spec.Description) +vLabels := string(vGeoDiscovery.Spec.Labels) +vSpec := string(vGeoDiscovery.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGeoDiscovery { + Id: &dn, + ParentLabels: parentLabels, + Description: &vDescription, + Labels: &vLabels, + Spec: &vSpec, + } + vGlobalGeoDiscoveryList = append(vGlobalGeoDiscoveryList, ret) + + log.Debugf("[getGlobalGNSGeoDiscoveryResolver]Output GeoDiscovery objects %v", vGlobalGeoDiscoveryList) + + return vGlobalGeoDiscoveryList, nil + } + + log.Debug("[getGlobalGNSGeoDiscoveryResolver]Id is empty, process all GeoDiscoverys") + + vGeoDiscoveryParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSGeoDiscoveryResolver]Error getting parent node %s", err) + return vGlobalGeoDiscoveryList, nil + } + vGeoDiscoveryAllObj, err := vGeoDiscoveryParent.GetAllGeoDiscovery(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSGeoDiscoveryResolver]Error getting GeoDiscovery objects %s", err) + return vGlobalGeoDiscoveryList, nil + } + for _, i := range vGeoDiscoveryAllObj { + vGeoDiscovery, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetGeoDiscovery(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSGeoDiscoveryResolver]Error getting GeoDiscovery node %q : %s", i.DisplayName(), err) + continue + } + dn := vGeoDiscovery.DisplayName() +parentLabels := map[string]interface{}{"geodiscoveries.global.tsm.tanzu.vmware.com":dn} +vDescription := string(vGeoDiscovery.Spec.Description) +vLabels := string(vGeoDiscovery.Spec.Labels) +vSpec := string(vGeoDiscovery.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGeoDiscovery { + Id: &dn, + ParentLabels: parentLabels, + Description: &vDescription, + Labels: &vLabels, + Spec: &vSpec, + } + vGlobalGeoDiscoveryList = append(vGlobalGeoDiscoveryList, ret) + } + + log.Debugf("[getGlobalGNSGeoDiscoveryResolver]Output GeoDiscovery objects %v", vGlobalGeoDiscoveryList) + + return vGlobalGeoDiscoveryList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: PiiDiscovery Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSPiiDiscoveryResolver(obj *model.GlobalGNS, id *string) ([]*model.GlobalPiiDiscovery, error) { + log.Debugf("[getGlobalGNSPiiDiscoveryResolver]Parent Object %+v", obj) + var vGlobalPiiDiscoveryList []*model.GlobalPiiDiscovery + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSPiiDiscoveryResolver]Id %q", *id) + vPiiDiscovery, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetPiiDiscovery(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSPiiDiscoveryResolver]Error getting PiiDiscovery node %q : %s", *id, err) + return vGlobalPiiDiscoveryList, nil + } + dn := vPiiDiscovery.DisplayName() +parentLabels := map[string]interface{}{"piidiscoveries.global.tsm.tanzu.vmware.com":dn} +vDescription := string(vPiiDiscovery.Spec.Description) +vLabels := string(vPiiDiscovery.Spec.Labels) +vSpec := string(vPiiDiscovery.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalPiiDiscovery { + Id: &dn, + ParentLabels: parentLabels, + Description: &vDescription, + Labels: &vLabels, + Spec: &vSpec, + } + vGlobalPiiDiscoveryList = append(vGlobalPiiDiscoveryList, ret) + + log.Debugf("[getGlobalGNSPiiDiscoveryResolver]Output PiiDiscovery objects %v", vGlobalPiiDiscoveryList) + + return vGlobalPiiDiscoveryList, nil + } + + log.Debug("[getGlobalGNSPiiDiscoveryResolver]Id is empty, process all PiiDiscoverys") + + vPiiDiscoveryParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSPiiDiscoveryResolver]Error getting parent node %s", err) + return vGlobalPiiDiscoveryList, nil + } + vPiiDiscoveryAllObj, err := vPiiDiscoveryParent.GetAllPiiDiscovery(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSPiiDiscoveryResolver]Error getting PiiDiscovery objects %s", err) + return vGlobalPiiDiscoveryList, nil + } + for _, i := range vPiiDiscoveryAllObj { + vPiiDiscovery, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetPiiDiscovery(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSPiiDiscoveryResolver]Error getting PiiDiscovery node %q : %s", i.DisplayName(), err) + continue + } + dn := vPiiDiscovery.DisplayName() +parentLabels := map[string]interface{}{"piidiscoveries.global.tsm.tanzu.vmware.com":dn} +vDescription := string(vPiiDiscovery.Spec.Description) +vLabels := string(vPiiDiscovery.Spec.Labels) +vSpec := string(vPiiDiscovery.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalPiiDiscovery { + Id: &dn, + ParentLabels: parentLabels, + Description: &vDescription, + Labels: &vLabels, + Spec: &vSpec, + } + vGlobalPiiDiscoveryList = append(vGlobalPiiDiscoveryList, ret) + } + + log.Debugf("[getGlobalGNSPiiDiscoveryResolver]Output PiiDiscovery objects %v", vGlobalPiiDiscoveryList) + + return vGlobalPiiDiscoveryList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: AttackDiscovery Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSAttackDiscoveryResolver(obj *model.GlobalGNS, id *string) ([]*model.GlobalAttackDiscovery, error) { + log.Debugf("[getGlobalGNSAttackDiscoveryResolver]Parent Object %+v", obj) + var vGlobalAttackDiscoveryList []*model.GlobalAttackDiscovery + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSAttackDiscoveryResolver]Id %q", *id) + vAttackDiscovery, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetAttackDiscovery(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSAttackDiscoveryResolver]Error getting AttackDiscovery node %q : %s", *id, err) + return vGlobalAttackDiscoveryList, nil + } + dn := vAttackDiscovery.DisplayName() +parentLabels := map[string]interface{}{"attackdiscoveries.global.tsm.tanzu.vmware.com":dn} +vDescription := string(vAttackDiscovery.Spec.Description) +vLabels := string(vAttackDiscovery.Spec.Labels) +vSpec := string(vAttackDiscovery.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAttackDiscovery { + Id: &dn, + ParentLabels: parentLabels, + Description: &vDescription, + Labels: &vLabels, + Spec: &vSpec, + } + vGlobalAttackDiscoveryList = append(vGlobalAttackDiscoveryList, ret) + + log.Debugf("[getGlobalGNSAttackDiscoveryResolver]Output AttackDiscovery objects %v", vGlobalAttackDiscoveryList) + + return vGlobalAttackDiscoveryList, nil + } + + log.Debug("[getGlobalGNSAttackDiscoveryResolver]Id is empty, process all AttackDiscoverys") + + vAttackDiscoveryParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSAttackDiscoveryResolver]Error getting parent node %s", err) + return vGlobalAttackDiscoveryList, nil + } + vAttackDiscoveryAllObj, err := vAttackDiscoveryParent.GetAllAttackDiscovery(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSAttackDiscoveryResolver]Error getting AttackDiscovery objects %s", err) + return vGlobalAttackDiscoveryList, nil + } + for _, i := range vAttackDiscoveryAllObj { + vAttackDiscovery, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetAttackDiscovery(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSAttackDiscoveryResolver]Error getting AttackDiscovery node %q : %s", i.DisplayName(), err) + continue + } + dn := vAttackDiscovery.DisplayName() +parentLabels := map[string]interface{}{"attackdiscoveries.global.tsm.tanzu.vmware.com":dn} +vDescription := string(vAttackDiscovery.Spec.Description) +vLabels := string(vAttackDiscovery.Spec.Labels) +vSpec := string(vAttackDiscovery.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAttackDiscovery { + Id: &dn, + ParentLabels: parentLabels, + Description: &vDescription, + Labels: &vLabels, + Spec: &vSpec, + } + vGlobalAttackDiscoveryList = append(vGlobalAttackDiscoveryList, ret) + } + + log.Debugf("[getGlobalGNSAttackDiscoveryResolver]Output AttackDiscovery objects %v", vGlobalAttackDiscoveryList) + + return vGlobalAttackDiscoveryList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: UserDiscovery Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSUserDiscoveryResolver(obj *model.GlobalGNS, id *string) ([]*model.GlobalUserDiscovery, error) { + log.Debugf("[getGlobalGNSUserDiscoveryResolver]Parent Object %+v", obj) + var vGlobalUserDiscoveryList []*model.GlobalUserDiscovery + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSUserDiscoveryResolver]Id %q", *id) + vUserDiscovery, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetUserDiscovery(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSUserDiscoveryResolver]Error getting UserDiscovery node %q : %s", *id, err) + return vGlobalUserDiscoveryList, nil + } + dn := vUserDiscovery.DisplayName() +parentLabels := map[string]interface{}{"userdiscoveries.global.tsm.tanzu.vmware.com":dn} +vDescription := string(vUserDiscovery.Spec.Description) +vLabels := string(vUserDiscovery.Spec.Labels) +vSpec := string(vUserDiscovery.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalUserDiscovery { + Id: &dn, + ParentLabels: parentLabels, + Description: &vDescription, + Labels: &vLabels, + Spec: &vSpec, + } + vGlobalUserDiscoveryList = append(vGlobalUserDiscoveryList, ret) + + log.Debugf("[getGlobalGNSUserDiscoveryResolver]Output UserDiscovery objects %v", vGlobalUserDiscoveryList) + + return vGlobalUserDiscoveryList, nil + } + + log.Debug("[getGlobalGNSUserDiscoveryResolver]Id is empty, process all UserDiscoverys") + + vUserDiscoveryParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSUserDiscoveryResolver]Error getting parent node %s", err) + return vGlobalUserDiscoveryList, nil + } + vUserDiscoveryAllObj, err := vUserDiscoveryParent.GetAllUserDiscovery(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSUserDiscoveryResolver]Error getting UserDiscovery objects %s", err) + return vGlobalUserDiscoveryList, nil + } + for _, i := range vUserDiscoveryAllObj { + vUserDiscovery, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetUserDiscovery(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSUserDiscoveryResolver]Error getting UserDiscovery node %q : %s", i.DisplayName(), err) + continue + } + dn := vUserDiscovery.DisplayName() +parentLabels := map[string]interface{}{"userdiscoveries.global.tsm.tanzu.vmware.com":dn} +vDescription := string(vUserDiscovery.Spec.Description) +vLabels := string(vUserDiscovery.Spec.Labels) +vSpec := string(vUserDiscovery.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalUserDiscovery { + Id: &dn, + ParentLabels: parentLabels, + Description: &vDescription, + Labels: &vLabels, + Spec: &vSpec, + } + vGlobalUserDiscoveryList = append(vGlobalUserDiscoveryList, ret) + } + + log.Debugf("[getGlobalGNSUserDiscoveryResolver]Output UserDiscovery objects %v", vGlobalUserDiscoveryList) + + return vGlobalUserDiscoveryList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: GnsAccessControlPolicy Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSGnsAccessControlPolicyResolver(obj *model.GlobalGNS, id *string) ([]*model.GlobalGnsAccessControlPolicy, error) { + log.Debugf("[getGlobalGNSGnsAccessControlPolicyResolver]Parent Object %+v", obj) + var vGlobalGnsAccessControlPolicyList []*model.GlobalGnsAccessControlPolicy + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSGnsAccessControlPolicyResolver]Id %q", *id) + vGnsAccessControlPolicy, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetGnsAccessControlPolicy(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSGnsAccessControlPolicyResolver]Error getting GnsAccessControlPolicy node %q : %s", *id, err) + return vGlobalGnsAccessControlPolicyList, nil + } + dn := vGnsAccessControlPolicy.DisplayName() +parentLabels := map[string]interface{}{"gnsaccesscontrolpolicies.global.tsm.tanzu.vmware.com":dn} +vDescription := string(vGnsAccessControlPolicy.Spec.Description) +vLabels := string(vGnsAccessControlPolicy.Spec.Labels) +vSpec := string(vGnsAccessControlPolicy.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsAccessControlPolicy { + Id: &dn, + ParentLabels: parentLabels, + Description: &vDescription, + Labels: &vLabels, + Spec: &vSpec, + } + vGlobalGnsAccessControlPolicyList = append(vGlobalGnsAccessControlPolicyList, ret) + + log.Debugf("[getGlobalGNSGnsAccessControlPolicyResolver]Output GnsAccessControlPolicy objects %v", vGlobalGnsAccessControlPolicyList) + + return vGlobalGnsAccessControlPolicyList, nil + } + + log.Debug("[getGlobalGNSGnsAccessControlPolicyResolver]Id is empty, process all GnsAccessControlPolicys") + + vGnsAccessControlPolicyParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSGnsAccessControlPolicyResolver]Error getting parent node %s", err) + return vGlobalGnsAccessControlPolicyList, nil + } + vGnsAccessControlPolicyAllObj, err := vGnsAccessControlPolicyParent.GetAllGnsAccessControlPolicy(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSGnsAccessControlPolicyResolver]Error getting GnsAccessControlPolicy objects %s", err) + return vGlobalGnsAccessControlPolicyList, nil + } + for _, i := range vGnsAccessControlPolicyAllObj { + vGnsAccessControlPolicy, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetGnsAccessControlPolicy(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSGnsAccessControlPolicyResolver]Error getting GnsAccessControlPolicy node %q : %s", i.DisplayName(), err) + continue + } + dn := vGnsAccessControlPolicy.DisplayName() +parentLabels := map[string]interface{}{"gnsaccesscontrolpolicies.global.tsm.tanzu.vmware.com":dn} +vDescription := string(vGnsAccessControlPolicy.Spec.Description) +vLabels := string(vGnsAccessControlPolicy.Spec.Labels) +vSpec := string(vGnsAccessControlPolicy.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsAccessControlPolicy { + Id: &dn, + ParentLabels: parentLabels, + Description: &vDescription, + Labels: &vLabels, + Spec: &vSpec, + } + vGlobalGnsAccessControlPolicyList = append(vGlobalGnsAccessControlPolicyList, ret) + } + + log.Debugf("[getGlobalGNSGnsAccessControlPolicyResolver]Output GnsAccessControlPolicy objects %v", vGlobalGnsAccessControlPolicyList) + + return vGlobalGnsAccessControlPolicyList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: GnsSchemaViolationDiscovery Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSGnsSchemaViolationDiscoveryResolver(obj *model.GlobalGNS, id *string) ([]*model.GlobalGnsSchemaViolationDiscovery, error) { + log.Debugf("[getGlobalGNSGnsSchemaViolationDiscoveryResolver]Parent Object %+v", obj) + var vGlobalGnsSchemaViolationDiscoveryList []*model.GlobalGnsSchemaViolationDiscovery + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSGnsSchemaViolationDiscoveryResolver]Id %q", *id) + vGnsSchemaViolationDiscovery, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetGnsSchemaViolationDiscovery(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSGnsSchemaViolationDiscoveryResolver]Error getting GnsSchemaViolationDiscovery node %q : %s", *id, err) + return vGlobalGnsSchemaViolationDiscoveryList, nil + } + dn := vGnsSchemaViolationDiscovery.DisplayName() +parentLabels := map[string]interface{}{"gnsschemaviolationdiscoveries.global.tsm.tanzu.vmware.com":dn} +vDescription := string(vGnsSchemaViolationDiscovery.Spec.Description) +vLabels := string(vGnsSchemaViolationDiscovery.Spec.Labels) +vSpec := string(vGnsSchemaViolationDiscovery.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsSchemaViolationDiscovery { + Id: &dn, + ParentLabels: parentLabels, + Description: &vDescription, + Labels: &vLabels, + Spec: &vSpec, + } + vGlobalGnsSchemaViolationDiscoveryList = append(vGlobalGnsSchemaViolationDiscoveryList, ret) + + log.Debugf("[getGlobalGNSGnsSchemaViolationDiscoveryResolver]Output GnsSchemaViolationDiscovery objects %v", vGlobalGnsSchemaViolationDiscoveryList) + + return vGlobalGnsSchemaViolationDiscoveryList, nil + } + + log.Debug("[getGlobalGNSGnsSchemaViolationDiscoveryResolver]Id is empty, process all GnsSchemaViolationDiscoverys") + + vGnsSchemaViolationDiscoveryParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSGnsSchemaViolationDiscoveryResolver]Error getting parent node %s", err) + return vGlobalGnsSchemaViolationDiscoveryList, nil + } + vGnsSchemaViolationDiscoveryAllObj, err := vGnsSchemaViolationDiscoveryParent.GetAllGnsSchemaViolationDiscovery(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSGnsSchemaViolationDiscoveryResolver]Error getting GnsSchemaViolationDiscovery objects %s", err) + return vGlobalGnsSchemaViolationDiscoveryList, nil + } + for _, i := range vGnsSchemaViolationDiscoveryAllObj { + vGnsSchemaViolationDiscovery, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetGnsSchemaViolationDiscovery(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSGnsSchemaViolationDiscoveryResolver]Error getting GnsSchemaViolationDiscovery node %q : %s", i.DisplayName(), err) + continue + } + dn := vGnsSchemaViolationDiscovery.DisplayName() +parentLabels := map[string]interface{}{"gnsschemaviolationdiscoveries.global.tsm.tanzu.vmware.com":dn} +vDescription := string(vGnsSchemaViolationDiscovery.Spec.Description) +vLabels := string(vGnsSchemaViolationDiscovery.Spec.Labels) +vSpec := string(vGnsSchemaViolationDiscovery.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsSchemaViolationDiscovery { + Id: &dn, + ParentLabels: parentLabels, + Description: &vDescription, + Labels: &vLabels, + Spec: &vSpec, + } + vGlobalGnsSchemaViolationDiscoveryList = append(vGlobalGnsSchemaViolationDiscoveryList, ret) + } + + log.Debugf("[getGlobalGNSGnsSchemaViolationDiscoveryResolver]Output GnsSchemaViolationDiscovery objects %v", vGlobalGnsSchemaViolationDiscoveryList) + + return vGlobalGnsSchemaViolationDiscoveryList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: GnsSegmentationPolicy Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSGnsSegmentationPolicyResolver(obj *model.GlobalGNS, id *string) ([]*model.GlobalGnsSegmentationPolicy, error) { + log.Debugf("[getGlobalGNSGnsSegmentationPolicyResolver]Parent Object %+v", obj) + var vGlobalGnsSegmentationPolicyList []*model.GlobalGnsSegmentationPolicy + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSGnsSegmentationPolicyResolver]Id %q", *id) + vGnsSegmentationPolicy, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetGnsSegmentationPolicy(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSGnsSegmentationPolicyResolver]Error getting GnsSegmentationPolicy node %q : %s", *id, err) + return vGlobalGnsSegmentationPolicyList, nil + } + dn := vGnsSegmentationPolicy.DisplayName() +parentLabels := map[string]interface{}{"gnssegmentationpolicies.global.tsm.tanzu.vmware.com":dn} +vDescription := string(vGnsSegmentationPolicy.Spec.Description) +vLabels := string(vGnsSegmentationPolicy.Spec.Labels) +Spec, _ := json.Marshal(vGnsSegmentationPolicy.Spec.Spec) +SpecData := string(Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsSegmentationPolicy { + Id: &dn, + ParentLabels: parentLabels, + Description: &vDescription, + Labels: &vLabels, + Spec: &SpecData, + } + vGlobalGnsSegmentationPolicyList = append(vGlobalGnsSegmentationPolicyList, ret) + + log.Debugf("[getGlobalGNSGnsSegmentationPolicyResolver]Output GnsSegmentationPolicy objects %v", vGlobalGnsSegmentationPolicyList) + + return vGlobalGnsSegmentationPolicyList, nil + } + + log.Debug("[getGlobalGNSGnsSegmentationPolicyResolver]Id is empty, process all GnsSegmentationPolicys") + + vGnsSegmentationPolicyParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSGnsSegmentationPolicyResolver]Error getting parent node %s", err) + return vGlobalGnsSegmentationPolicyList, nil + } + vGnsSegmentationPolicyAllObj, err := vGnsSegmentationPolicyParent.GetAllGnsSegmentationPolicy(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSGnsSegmentationPolicyResolver]Error getting GnsSegmentationPolicy objects %s", err) + return vGlobalGnsSegmentationPolicyList, nil + } + for _, i := range vGnsSegmentationPolicyAllObj { + vGnsSegmentationPolicy, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).Gns(getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")).GetGnsSegmentationPolicy(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSGnsSegmentationPolicyResolver]Error getting GnsSegmentationPolicy node %q : %s", i.DisplayName(), err) + continue + } + dn := vGnsSegmentationPolicy.DisplayName() +parentLabels := map[string]interface{}{"gnssegmentationpolicies.global.tsm.tanzu.vmware.com":dn} +vDescription := string(vGnsSegmentationPolicy.Spec.Description) +vLabels := string(vGnsSegmentationPolicy.Spec.Labels) +Spec, _ := json.Marshal(vGnsSegmentationPolicy.Spec.Spec) +SpecData := string(Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGnsSegmentationPolicy { + Id: &dn, + ParentLabels: parentLabels, + Description: &vDescription, + Labels: &vLabels, + Spec: &SpecData, + } + vGlobalGnsSegmentationPolicyList = append(vGlobalGnsSegmentationPolicyList, ret) + } + + log.Debugf("[getGlobalGNSGnsSegmentationPolicyResolver]Output GnsSegmentationPolicy objects %v", vGlobalGnsSegmentationPolicyList) + + return vGlobalGnsSegmentationPolicyList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: MemberGroups Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSMemberGroupsResolver(obj *model.GlobalGNS, id *string) ([]*model.GlobalSvcGroup, error) { + log.Debugf("[getGlobalGNSMemberGroupsResolver]Parent Object %+v", obj) + var vGlobalSvcGroupList []*model.GlobalSvcGroup + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSMemberGroupsResolver]Id %q", *id) + vSvcGroupParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSMemberGroupsResolver]Error getting MemberGroups %q : %s", *id, err) + return vGlobalSvcGroupList, nil + } + vSvcGroup, err := vSvcGroupParent.GetMemberGroups(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSMemberGroupsResolver]Error getting MemberGroups %q : %s", *id, err) + return vGlobalSvcGroupList, nil + } + dn := vSvcGroup.DisplayName() +parentLabels := map[string]interface{}{"svcgroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vSvcGroup.Spec.DisplayName) +vInternalPredefinedGroup := bool(vSvcGroup.Spec.InternalPredefinedGroup) +vDescription := string(vSvcGroup.Spec.Description) +vColor := string(vSvcGroup.Spec.Color) +vProjectId := string(vSvcGroup.Spec.ProjectId) +vRules := string(vSvcGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSvcGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + InternalPredefinedGroup: &vInternalPredefinedGroup, + Description: &vDescription, + Color: &vColor, + ProjectId: &vProjectId, + Rules: &vRules, + } + vGlobalSvcGroupList = append(vGlobalSvcGroupList, ret) + + log.Debugf("[getGlobalGNSMemberGroupsResolver]Output MemberGroups objects %v", vGlobalSvcGroupList) + + return vGlobalSvcGroupList, nil + } + + log.Debug("[getGlobalGNSMemberGroupsResolver]Id is empty, process all MemberGroupss") + + vSvcGroupParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSMemberGroupsResolver]Error getting parent node %s", err) + return vGlobalSvcGroupList, nil + } + vSvcGroupAllObj, err := vSvcGroupParent.GetAllMemberGroups(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSMemberGroupsResolver]Error getting MemberGroups %s", err) + return vGlobalSvcGroupList, nil + } + for _, i := range vSvcGroupAllObj { + vSvcGroupParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSMemberGroupsResolver]Error getting parent node %s, skipping...", err) + continue + } + vSvcGroup, err := vSvcGroupParent.GetMemberGroups(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSMemberGroupsResolver]Error getting MemberGroups node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vSvcGroup.DisplayName() +parentLabels := map[string]interface{}{"svcgroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vSvcGroup.Spec.DisplayName) +vInternalPredefinedGroup := bool(vSvcGroup.Spec.InternalPredefinedGroup) +vDescription := string(vSvcGroup.Spec.Description) +vColor := string(vSvcGroup.Spec.Color) +vProjectId := string(vSvcGroup.Spec.ProjectId) +vRules := string(vSvcGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSvcGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + InternalPredefinedGroup: &vInternalPredefinedGroup, + Description: &vDescription, + Color: &vColor, + ProjectId: &vProjectId, + Rules: &vRules, + } + vGlobalSvcGroupList = append(vGlobalSvcGroupList, ret) + } + log.Debugf("[getGlobalGNSMemberGroupsResolver]List of MemberGroups object %v", vGlobalSvcGroupList) + return vGlobalSvcGroupList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Members Node: GNS PKG: Global +////////////////////////////////////// +func getGlobalGNSMembersResolver(obj *model.GlobalGNS, id *string) ([]*model.GlobalDomain, error) { + log.Debugf("[getGlobalGNSMembersResolver]Parent Object %+v", obj) + var vGlobalDomainList []*model.GlobalDomain + if id != nil && *id != "" { + log.Debugf("[getGlobalGNSMembersResolver]Id %q", *id) + vDomainParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSMembersResolver]Error getting Members %q : %s", *id, err) + return vGlobalDomainList, nil + } + vDomain, err := vDomainParent.GetMembers(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalGNSMembersResolver]Error getting Members %q : %s", *id, err) + return vGlobalDomainList, nil + } + dn := vDomain.DisplayName() +parentLabels := map[string]interface{}{"domains.global.tsm.tanzu.vmware.com":dn} +vName := string(vDomain.Spec.Name) +vEnviornmentType := string(vDomain.Spec.EnviornmentType) +vApiLink := string(vDomain.Spec.ApiLink) +vAnnotations := string(vDomain.Spec.Annotations) +vLabels := string(vDomain.Spec.Labels) +vMetadata := string(vDomain.Spec.Metadata) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDomain { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + EnviornmentType: &vEnviornmentType, + ApiLink: &vApiLink, + Annotations: &vAnnotations, + Labels: &vLabels, + Metadata: &vMetadata, + } + vGlobalDomainList = append(vGlobalDomainList, ret) + + log.Debugf("[getGlobalGNSMembersResolver]Output Members objects %v", vGlobalDomainList) + + return vGlobalDomainList, nil + } + + log.Debug("[getGlobalGNSMembersResolver]Id is empty, process all Memberss") + + vDomainParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSMembersResolver]Error getting parent node %s", err) + return vGlobalDomainList, nil + } + vDomainAllObj, err := vDomainParent.GetAllMembers(context.TODO()) + if err != nil { + log.Errorf("[getGlobalGNSMembersResolver]Error getting Members %s", err) + return vGlobalDomainList, nil + } + for _, i := range vDomainAllObj { + vDomainParent, err := nc.GlobalRoot().Config().GlobalNamespace(getParentName(obj.ParentLabels, "globalnamespaces.global.tsm.tanzu.vmware.com")).GetGns(context.TODO(), getParentName(obj.ParentLabels, "gnss.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalGNSMembersResolver]Error getting parent node %s, skipping...", err) + continue + } + vDomain, err := vDomainParent.GetMembers(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalGNSMembersResolver]Error getting Members node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vDomain.DisplayName() +parentLabels := map[string]interface{}{"domains.global.tsm.tanzu.vmware.com":dn} +vName := string(vDomain.Spec.Name) +vEnviornmentType := string(vDomain.Spec.EnviornmentType) +vApiLink := string(vDomain.Spec.ApiLink) +vAnnotations := string(vDomain.Spec.Annotations) +vLabels := string(vDomain.Spec.Labels) +vMetadata := string(vDomain.Spec.Metadata) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDomain { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + EnviornmentType: &vEnviornmentType, + ApiLink: &vApiLink, + Annotations: &vAnnotations, + Labels: &vLabels, + Metadata: &vMetadata, + } + vGlobalDomainList = append(vGlobalDomainList, ret) + } + log.Debugf("[getGlobalGNSMembersResolver]List of Members object %v", vGlobalDomainList) + return vGlobalDomainList, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: HaConfigV2 Node: HostConfigV2 PKG: Global +////////////////////////////////////// +func getGlobalHostConfigV2HaConfigV2Resolver(obj *model.GlobalHostConfigV2, id *string) (*model.GlobalHaConfigV2, error) { + log.Debugf("[getGlobalHostConfigV2HaConfigV2Resolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalHostConfigV2HaConfigV2Resolver]Id %q", *id) + vHaConfigV2, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).HostConfigV2(getParentName(obj.ParentLabels, "hostconfigv2s.global.tsm.tanzu.vmware.com")).GetHaConfigV2(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalHostConfigV2HaConfigV2Resolver]Error getting HaConfigV2 node %q : %s", *id, err) + return &model.GlobalHaConfigV2{}, nil + } + dn := vHaConfigV2.DisplayName() +parentLabels := map[string]interface{}{"haconfigv2s.global.tsm.tanzu.vmware.com":dn} +vConfigType := string(vHaConfigV2.Spec.ConfigType) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalHaConfigV2 { + Id: &dn, + ParentLabels: parentLabels, + ConfigType: &vConfigType, + } + + log.Debugf("[getGlobalHostConfigV2HaConfigV2Resolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalHostConfigV2HaConfigV2Resolver]Id is empty, process all HaConfigV2s") + vHaConfigV2Parent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetHostConfigV2(context.TODO(), getParentName(obj.ParentLabels, "hostconfigv2s.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalHostConfigV2HaConfigV2Resolver]Failed to get parent node %s", err) + return &model.GlobalHaConfigV2{}, nil + } + vHaConfigV2, err := vHaConfigV2Parent.GetHaConfigV2(context.TODO()) + if err != nil { + log.Errorf("[getGlobalHostConfigV2HaConfigV2Resolver]Error getting HaConfigV2 node %s", err) + return &model.GlobalHaConfigV2{}, nil + } + dn := vHaConfigV2.DisplayName() +parentLabels := map[string]interface{}{"haconfigv2s.global.tsm.tanzu.vmware.com":dn} +vConfigType := string(vHaConfigV2.Spec.ConfigType) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalHaConfigV2 { + Id: &dn, + ParentLabels: parentLabels, + ConfigType: &vConfigType, + } + + log.Debugf("[getGlobalHostConfigV2HaConfigV2Resolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: OutboundAuthenticationMode Node: HostConfigV2 PKG: Global +////////////////////////////////////// +func getGlobalHostConfigV2OutboundAuthenticationModeResolver(obj *model.GlobalHostConfigV2, id *string) (*model.GlobalOutboundAuthenticationMode, error) { + log.Debugf("[getGlobalHostConfigV2OutboundAuthenticationModeResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalHostConfigV2OutboundAuthenticationModeResolver]Id %q", *id) + vOutboundAuthenticationMode, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).HostConfigV2(getParentName(obj.ParentLabels, "hostconfigv2s.global.tsm.tanzu.vmware.com")).GetOutboundAuthenticationMode(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalHostConfigV2OutboundAuthenticationModeResolver]Error getting OutboundAuthenticationMode node %q : %s", *id, err) + return &model.GlobalOutboundAuthenticationMode{}, nil + } + dn := vOutboundAuthenticationMode.DisplayName() +parentLabels := map[string]interface{}{"outboundauthenticationmodes.global.tsm.tanzu.vmware.com":dn} +vMode := string(vOutboundAuthenticationMode.Spec.Mode) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalOutboundAuthenticationMode { + Id: &dn, + ParentLabels: parentLabels, + Mode: &vMode, + } + + log.Debugf("[getGlobalHostConfigV2OutboundAuthenticationModeResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalHostConfigV2OutboundAuthenticationModeResolver]Id is empty, process all OutboundAuthenticationModes") + vOutboundAuthenticationModeParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetHostConfigV2(context.TODO(), getParentName(obj.ParentLabels, "hostconfigv2s.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalHostConfigV2OutboundAuthenticationModeResolver]Failed to get parent node %s", err) + return &model.GlobalOutboundAuthenticationMode{}, nil + } + vOutboundAuthenticationMode, err := vOutboundAuthenticationModeParent.GetOutboundAuthenticationMode(context.TODO()) + if err != nil { + log.Errorf("[getGlobalHostConfigV2OutboundAuthenticationModeResolver]Error getting OutboundAuthenticationMode node %s", err) + return &model.GlobalOutboundAuthenticationMode{}, nil + } + dn := vOutboundAuthenticationMode.DisplayName() +parentLabels := map[string]interface{}{"outboundauthenticationmodes.global.tsm.tanzu.vmware.com":dn} +vMode := string(vOutboundAuthenticationMode.Spec.Mode) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalOutboundAuthenticationMode { + Id: &dn, + ParentLabels: parentLabels, + Mode: &vMode, + } + + log.Debugf("[getGlobalHostConfigV2OutboundAuthenticationModeResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: HaConfig Node: HostConfig PKG: Global +////////////////////////////////////// +func getGlobalHostConfigHaConfigResolver(obj *model.GlobalHostConfig, id *string) (*model.GlobalHaConfig, error) { + log.Debugf("[getGlobalHostConfigHaConfigResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalHostConfigHaConfigResolver]Id %q", *id) + vHaConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).HostConfig(getParentName(obj.ParentLabels, "hostconfigs.global.tsm.tanzu.vmware.com")).GetHaConfig(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalHostConfigHaConfigResolver]Error getting HaConfig node %q : %s", *id, err) + return &model.GlobalHaConfig{}, nil + } + dn := vHaConfig.DisplayName() +parentLabels := map[string]interface{}{"haconfigs.global.tsm.tanzu.vmware.com":dn} +vConfigType := string(vHaConfig.Spec.ConfigType) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalHaConfig { + Id: &dn, + ParentLabels: parentLabels, + ConfigType: &vConfigType, + } + + log.Debugf("[getGlobalHostConfigHaConfigResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalHostConfigHaConfigResolver]Id is empty, process all HaConfigs") + vHaConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetHostConfig(context.TODO(), getParentName(obj.ParentLabels, "hostconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalHostConfigHaConfigResolver]Failed to get parent node %s", err) + return &model.GlobalHaConfig{}, nil + } + vHaConfig, err := vHaConfigParent.GetHaConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalHostConfigHaConfigResolver]Error getting HaConfig node %s", err) + return &model.GlobalHaConfig{}, nil + } + dn := vHaConfig.DisplayName() +parentLabels := map[string]interface{}{"haconfigs.global.tsm.tanzu.vmware.com":dn} +vConfigType := string(vHaConfig.Spec.ConfigType) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalHaConfig { + Id: &dn, + ParentLabels: parentLabels, + ConfigType: &vConfigType, + } + + log.Debugf("[getGlobalHostConfigHaConfigResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: JobFolder Node: Inventory PKG: Global +////////////////////////////////////// +func getGlobalInventoryJobFolderResolver(obj *model.GlobalInventory, id *string) (*model.GlobalJobFolder, error) { + log.Debugf("[getGlobalInventoryJobFolderResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalInventoryJobFolderResolver]Id %q", *id) + vJobFolder, err := nc.GlobalRoot().Inventory().GetJobFolder(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalInventoryJobFolderResolver]Error getting JobFolder node %q : %s", *id, err) + return &model.GlobalJobFolder{}, nil + } + dn := vJobFolder.DisplayName() +parentLabels := map[string]interface{}{"jobfolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalJobFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalInventoryJobFolderResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalInventoryJobFolderResolver]Id is empty, process all JobFolders") + vJobFolderParent, err := nc.GlobalRoot().GetInventory(context.TODO()) + if err != nil { + log.Errorf("[getGlobalInventoryJobFolderResolver]Failed to get parent node %s", err) + return &model.GlobalJobFolder{}, nil + } + vJobFolder, err := vJobFolderParent.GetJobFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalInventoryJobFolderResolver]Error getting JobFolder node %s", err) + return &model.GlobalJobFolder{}, nil + } + dn := vJobFolder.DisplayName() +parentLabels := map[string]interface{}{"jobfolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalJobFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalInventoryJobFolderResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Regions Node: Inventory PKG: Global +////////////////////////////////////// +func getGlobalInventoryRegionsResolver(obj *model.GlobalInventory, id *string) ([]*model.GlobalDCRegion, error) { + log.Debugf("[getGlobalInventoryRegionsResolver]Parent Object %+v", obj) + var vGlobalDCRegionList []*model.GlobalDCRegion + if id != nil && *id != "" { + log.Debugf("[getGlobalInventoryRegionsResolver]Id %q", *id) + vDCRegion, err := nc.GlobalRoot().Inventory().GetRegions(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalInventoryRegionsResolver]Error getting Regions node %q : %s", *id, err) + return vGlobalDCRegionList, nil + } + dn := vDCRegion.DisplayName() +parentLabels := map[string]interface{}{"dcregions.global.tsm.tanzu.vmware.com":dn} +vName := string(vDCRegion.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDCRegion { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + vGlobalDCRegionList = append(vGlobalDCRegionList, ret) + + log.Debugf("[getGlobalInventoryRegionsResolver]Output Regions objects %v", vGlobalDCRegionList) + + return vGlobalDCRegionList, nil + } + + log.Debug("[getGlobalInventoryRegionsResolver]Id is empty, process all Regionss") + + vDCRegionParent, err := nc.GlobalRoot().GetInventory(context.TODO()) + if err != nil { + log.Errorf("[getGlobalInventoryRegionsResolver]Error getting parent node %s", err) + return vGlobalDCRegionList, nil + } + vDCRegionAllObj, err := vDCRegionParent.GetAllRegions(context.TODO()) + if err != nil { + log.Errorf("[getGlobalInventoryRegionsResolver]Error getting Regions objects %s", err) + return vGlobalDCRegionList, nil + } + for _, i := range vDCRegionAllObj { + vDCRegion, err := nc.GlobalRoot().Inventory().GetRegions(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalInventoryRegionsResolver]Error getting Regions node %q : %s", i.DisplayName(), err) + continue + } + dn := vDCRegion.DisplayName() +parentLabels := map[string]interface{}{"dcregions.global.tsm.tanzu.vmware.com":dn} +vName := string(vDCRegion.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDCRegion { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + vGlobalDCRegionList = append(vGlobalDCRegionList, ret) + } + + log.Debugf("[getGlobalInventoryRegionsResolver]Output Regions objects %v", vGlobalDCRegionList) + + return vGlobalDCRegionList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Clusters Node: Inventory PKG: Global +////////////////////////////////////// +func getGlobalInventoryClustersResolver(obj *model.GlobalInventory, id *string) ([]*model.GlobalCluster, error) { + log.Debugf("[getGlobalInventoryClustersResolver]Parent Object %+v", obj) + var vGlobalClusterList []*model.GlobalCluster + if id != nil && *id != "" { + log.Debugf("[getGlobalInventoryClustersResolver]Id %q", *id) + vCluster, err := nc.GlobalRoot().Inventory().GetClusters(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalInventoryClustersResolver]Error getting Clusters node %q : %s", *id, err) + return vGlobalClusterList, nil + } + dn := vCluster.DisplayName() +parentLabels := map[string]interface{}{"clusters.global.tsm.tanzu.vmware.com":dn} +vName := string(vCluster.Spec.Name) +vUuid := string(vCluster.Spec.Uuid) +vConnected := bool(vCluster.Spec.Connected) +vIstioState := string(vCluster.Spec.IstioState) +vStatus := string(vCluster.Spec.Status) +vStatusHistory := string(vCluster.Spec.StatusHistory) +vCastatus := string(vCluster.Spec.Castatus) +vCaStatusHistory := string(vCluster.Spec.CaStatusHistory) +vComponentStatuses := string(vCluster.Spec.ComponentStatuses) +vComponentStatusesHistory := string(vCluster.Spec.ComponentStatusesHistory) +vType := string(vCluster.Spec.Type) +vProjectId := string(vCluster.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCluster { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Uuid: &vUuid, + Connected: &vConnected, + IstioState: &vIstioState, + Status: &vStatus, + StatusHistory: &vStatusHistory, + Castatus: &vCastatus, + CaStatusHistory: &vCaStatusHistory, + ComponentStatuses: &vComponentStatuses, + ComponentStatusesHistory: &vComponentStatusesHistory, + Type: &vType, + ProjectId: &vProjectId, + } + vGlobalClusterList = append(vGlobalClusterList, ret) + + log.Debugf("[getGlobalInventoryClustersResolver]Output Clusters objects %v", vGlobalClusterList) + + return vGlobalClusterList, nil + } + + log.Debug("[getGlobalInventoryClustersResolver]Id is empty, process all Clusterss") + + vClusterParent, err := nc.GlobalRoot().GetInventory(context.TODO()) + if err != nil { + log.Errorf("[getGlobalInventoryClustersResolver]Error getting parent node %s", err) + return vGlobalClusterList, nil + } + vClusterAllObj, err := vClusterParent.GetAllClusters(context.TODO()) + if err != nil { + log.Errorf("[getGlobalInventoryClustersResolver]Error getting Clusters objects %s", err) + return vGlobalClusterList, nil + } + for _, i := range vClusterAllObj { + vCluster, err := nc.GlobalRoot().Inventory().GetClusters(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalInventoryClustersResolver]Error getting Clusters node %q : %s", i.DisplayName(), err) + continue + } + dn := vCluster.DisplayName() +parentLabels := map[string]interface{}{"clusters.global.tsm.tanzu.vmware.com":dn} +vName := string(vCluster.Spec.Name) +vUuid := string(vCluster.Spec.Uuid) +vConnected := bool(vCluster.Spec.Connected) +vIstioState := string(vCluster.Spec.IstioState) +vStatus := string(vCluster.Spec.Status) +vStatusHistory := string(vCluster.Spec.StatusHistory) +vCastatus := string(vCluster.Spec.Castatus) +vCaStatusHistory := string(vCluster.Spec.CaStatusHistory) +vComponentStatuses := string(vCluster.Spec.ComponentStatuses) +vComponentStatusesHistory := string(vCluster.Spec.ComponentStatusesHistory) +vType := string(vCluster.Spec.Type) +vProjectId := string(vCluster.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCluster { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Uuid: &vUuid, + Connected: &vConnected, + IstioState: &vIstioState, + Status: &vStatus, + StatusHistory: &vStatusHistory, + Castatus: &vCastatus, + CaStatusHistory: &vCaStatusHistory, + ComponentStatuses: &vComponentStatuses, + ComponentStatusesHistory: &vComponentStatusesHistory, + Type: &vType, + ProjectId: &vProjectId, + } + vGlobalClusterList = append(vGlobalClusterList, ret) + } + + log.Debugf("[getGlobalInventoryClustersResolver]Output Clusters objects %v", vGlobalClusterList) + + return vGlobalClusterList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ExternalDNS Node: Inventory PKG: Global +////////////////////////////////////// +func getGlobalInventoryExternalDNSResolver(obj *model.GlobalInventory, id *string) ([]*model.GlobalExternalDNSInventory, error) { + log.Debugf("[getGlobalInventoryExternalDNSResolver]Parent Object %+v", obj) + var vGlobalExternalDNSInventoryList []*model.GlobalExternalDNSInventory + if id != nil && *id != "" { + log.Debugf("[getGlobalInventoryExternalDNSResolver]Id %q", *id) + vExternalDNSInventory, err := nc.GlobalRoot().Inventory().GetExternalDNS(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalInventoryExternalDNSResolver]Error getting ExternalDNS node %q : %s", *id, err) + return vGlobalExternalDNSInventoryList, nil + } + dn := vExternalDNSInventory.DisplayName() +parentLabels := map[string]interface{}{"externaldnsinventories.global.tsm.tanzu.vmware.com":dn} +EnabledForProjects, _ := json.Marshal(vExternalDNSInventory.Spec.EnabledForProjects) +EnabledForProjectsData := string(EnabledForProjects) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSInventory { + Id: &dn, + ParentLabels: parentLabels, + EnabledForProjects: &EnabledForProjectsData, + } + vGlobalExternalDNSInventoryList = append(vGlobalExternalDNSInventoryList, ret) + + log.Debugf("[getGlobalInventoryExternalDNSResolver]Output ExternalDNS objects %v", vGlobalExternalDNSInventoryList) + + return vGlobalExternalDNSInventoryList, nil + } + + log.Debug("[getGlobalInventoryExternalDNSResolver]Id is empty, process all ExternalDNSs") + + vExternalDNSInventoryParent, err := nc.GlobalRoot().GetInventory(context.TODO()) + if err != nil { + log.Errorf("[getGlobalInventoryExternalDNSResolver]Error getting parent node %s", err) + return vGlobalExternalDNSInventoryList, nil + } + vExternalDNSInventoryAllObj, err := vExternalDNSInventoryParent.GetAllExternalDNS(context.TODO()) + if err != nil { + log.Errorf("[getGlobalInventoryExternalDNSResolver]Error getting ExternalDNS objects %s", err) + return vGlobalExternalDNSInventoryList, nil + } + for _, i := range vExternalDNSInventoryAllObj { + vExternalDNSInventory, err := nc.GlobalRoot().Inventory().GetExternalDNS(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalInventoryExternalDNSResolver]Error getting ExternalDNS node %q : %s", i.DisplayName(), err) + continue + } + dn := vExternalDNSInventory.DisplayName() +parentLabels := map[string]interface{}{"externaldnsinventories.global.tsm.tanzu.vmware.com":dn} +EnabledForProjects, _ := json.Marshal(vExternalDNSInventory.Spec.EnabledForProjects) +EnabledForProjectsData := string(EnabledForProjects) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSInventory { + Id: &dn, + ParentLabels: parentLabels, + EnabledForProjects: &EnabledForProjectsData, + } + vGlobalExternalDNSInventoryList = append(vGlobalExternalDNSInventoryList, ret) + } + + log.Debugf("[getGlobalInventoryExternalDNSResolver]Output ExternalDNS objects %v", vGlobalExternalDNSInventoryList) + + return vGlobalExternalDNSInventoryList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: JobConfig Node: JobConfigFolder PKG: Global +////////////////////////////////////// +func getGlobalJobConfigFolderJobConfigResolver(obj *model.GlobalJobConfigFolder, id *string) ([]*model.GlobalJobConfig, error) { + log.Debugf("[getGlobalJobConfigFolderJobConfigResolver]Parent Object %+v", obj) + var vGlobalJobConfigList []*model.GlobalJobConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalJobConfigFolderJobConfigResolver]Id %q", *id) + vJobConfig, err := nc.GlobalRoot().Runtime().JobConfigFolder().GetJobConfig(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalJobConfigFolderJobConfigResolver]Error getting JobConfig node %q : %s", *id, err) + return vGlobalJobConfigList, nil + } + dn := vJobConfig.DisplayName() +parentLabels := map[string]interface{}{"jobconfigs.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vJobConfig.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalJobConfig { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + } + vGlobalJobConfigList = append(vGlobalJobConfigList, ret) + + log.Debugf("[getGlobalJobConfigFolderJobConfigResolver]Output JobConfig objects %v", vGlobalJobConfigList) + + return vGlobalJobConfigList, nil + } + + log.Debug("[getGlobalJobConfigFolderJobConfigResolver]Id is empty, process all JobConfigs") + + vJobConfigParent, err := nc.GlobalRoot().Runtime().GetJobConfigFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalJobConfigFolderJobConfigResolver]Error getting parent node %s", err) + return vGlobalJobConfigList, nil + } + vJobConfigAllObj, err := vJobConfigParent.GetAllJobConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalJobConfigFolderJobConfigResolver]Error getting JobConfig objects %s", err) + return vGlobalJobConfigList, nil + } + for _, i := range vJobConfigAllObj { + vJobConfig, err := nc.GlobalRoot().Runtime().JobConfigFolder().GetJobConfig(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalJobConfigFolderJobConfigResolver]Error getting JobConfig node %q : %s", i.DisplayName(), err) + continue + } + dn := vJobConfig.DisplayName() +parentLabels := map[string]interface{}{"jobconfigs.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vJobConfig.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalJobConfig { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + } + vGlobalJobConfigList = append(vGlobalJobConfigList, ret) + } + + log.Debugf("[getGlobalJobConfigFolderJobConfigResolver]Output JobConfig objects %v", vGlobalJobConfigList) + + return vGlobalJobConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Jobs Node: JobFolder PKG: Global +////////////////////////////////////// +func getGlobalJobFolderJobsResolver(obj *model.GlobalJobFolder, id *string) ([]*model.GlobalJob, error) { + log.Debugf("[getGlobalJobFolderJobsResolver]Parent Object %+v", obj) + var vGlobalJobList []*model.GlobalJob + if id != nil && *id != "" { + log.Debugf("[getGlobalJobFolderJobsResolver]Id %q", *id) + vJob, err := nc.GlobalRoot().Inventory().JobFolder(getParentName(obj.ParentLabels, "jobfolders.global.tsm.tanzu.vmware.com")).GetJobs(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalJobFolderJobsResolver]Error getting Jobs node %q : %s", *id, err) + return vGlobalJobList, nil + } + dn := vJob.DisplayName() +parentLabels := map[string]interface{}{"jobs.global.tsm.tanzu.vmware.com":dn} +vStatus := string(vJob.Spec.Status) +vProjectId := string(vJob.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalJob { + Id: &dn, + ParentLabels: parentLabels, + Status: &vStatus, + ProjectId: &vProjectId, + } + vGlobalJobList = append(vGlobalJobList, ret) + + log.Debugf("[getGlobalJobFolderJobsResolver]Output Jobs objects %v", vGlobalJobList) + + return vGlobalJobList, nil + } + + log.Debug("[getGlobalJobFolderJobsResolver]Id is empty, process all Jobss") + + vJobParent, err := nc.GlobalRoot().Inventory().GetJobFolder(context.TODO(), getParentName(obj.ParentLabels, "jobfolders.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalJobFolderJobsResolver]Error getting parent node %s", err) + return vGlobalJobList, nil + } + vJobAllObj, err := vJobParent.GetAllJobs(context.TODO()) + if err != nil { + log.Errorf("[getGlobalJobFolderJobsResolver]Error getting Jobs objects %s", err) + return vGlobalJobList, nil + } + for _, i := range vJobAllObj { + vJob, err := nc.GlobalRoot().Inventory().JobFolder(getParentName(obj.ParentLabels, "jobfolders.global.tsm.tanzu.vmware.com")).GetJobs(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalJobFolderJobsResolver]Error getting Jobs node %q : %s", i.DisplayName(), err) + continue + } + dn := vJob.DisplayName() +parentLabels := map[string]interface{}{"jobs.global.tsm.tanzu.vmware.com":dn} +vStatus := string(vJob.Spec.Status) +vProjectId := string(vJob.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalJob { + Id: &dn, + ParentLabels: parentLabels, + Status: &vStatus, + ProjectId: &vProjectId, + } + vGlobalJobList = append(vGlobalJobList, ret) + } + + log.Debugf("[getGlobalJobFolderJobsResolver]Output Jobs objects %v", vGlobalJobList) + + return vGlobalJobList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Resources Node: LocalRegistrationServiceCluster PKG: Global +////////////////////////////////////// +func getGlobalLocalRegistrationServiceClusterResourcesResolver(obj *model.GlobalLocalRegistrationServiceCluster, id *string) ([]*model.GlobalLocalRegistrationServiceResource, error) { + log.Debugf("[getGlobalLocalRegistrationServiceClusterResourcesResolver]Parent Object %+v", obj) + var vGlobalLocalRegistrationServiceResourceList []*model.GlobalLocalRegistrationServiceResource + if id != nil && *id != "" { + log.Debugf("[getGlobalLocalRegistrationServiceClusterResourcesResolver]Id %q", *id) + vLocalRegistrationServiceResource, err := nc.GlobalRoot().Runtime().AllsparkServices().LocalRegistrationService(getParentName(obj.ParentLabels, "localregistrationservices.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "localregistrationserviceclusters.global.tsm.tanzu.vmware.com")).GetResources(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalLocalRegistrationServiceClusterResourcesResolver]Error getting Resources node %q : %s", *id, err) + return vGlobalLocalRegistrationServiceResourceList, nil + } + dn := vLocalRegistrationServiceResource.DisplayName() +parentLabels := map[string]interface{}{"localregistrationserviceresources.global.tsm.tanzu.vmware.com":dn} +vType := string(vLocalRegistrationServiceResource.Spec.Type) +vLocation := string(vLocalRegistrationServiceResource.Spec.Location) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalLocalRegistrationServiceResource { + Id: &dn, + ParentLabels: parentLabels, + Type: &vType, + Location: &vLocation, + } + vGlobalLocalRegistrationServiceResourceList = append(vGlobalLocalRegistrationServiceResourceList, ret) + + log.Debugf("[getGlobalLocalRegistrationServiceClusterResourcesResolver]Output Resources objects %v", vGlobalLocalRegistrationServiceResourceList) + + return vGlobalLocalRegistrationServiceResourceList, nil + } + + log.Debug("[getGlobalLocalRegistrationServiceClusterResourcesResolver]Id is empty, process all Resourcess") + + vLocalRegistrationServiceResourceParent, err := nc.GlobalRoot().Runtime().AllsparkServices().LocalRegistrationService(getParentName(obj.ParentLabels, "localregistrationservices.global.tsm.tanzu.vmware.com")).GetClusters(context.TODO(), getParentName(obj.ParentLabels, "localregistrationserviceclusters.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalLocalRegistrationServiceClusterResourcesResolver]Error getting parent node %s", err) + return vGlobalLocalRegistrationServiceResourceList, nil + } + vLocalRegistrationServiceResourceAllObj, err := vLocalRegistrationServiceResourceParent.GetAllResources(context.TODO()) + if err != nil { + log.Errorf("[getGlobalLocalRegistrationServiceClusterResourcesResolver]Error getting Resources objects %s", err) + return vGlobalLocalRegistrationServiceResourceList, nil + } + for _, i := range vLocalRegistrationServiceResourceAllObj { + vLocalRegistrationServiceResource, err := nc.GlobalRoot().Runtime().AllsparkServices().LocalRegistrationService(getParentName(obj.ParentLabels, "localregistrationservices.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "localregistrationserviceclusters.global.tsm.tanzu.vmware.com")).GetResources(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalLocalRegistrationServiceClusterResourcesResolver]Error getting Resources node %q : %s", i.DisplayName(), err) + continue + } + dn := vLocalRegistrationServiceResource.DisplayName() +parentLabels := map[string]interface{}{"localregistrationserviceresources.global.tsm.tanzu.vmware.com":dn} +vType := string(vLocalRegistrationServiceResource.Spec.Type) +vLocation := string(vLocalRegistrationServiceResource.Spec.Location) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalLocalRegistrationServiceResource { + Id: &dn, + ParentLabels: parentLabels, + Type: &vType, + Location: &vLocation, + } + vGlobalLocalRegistrationServiceResourceList = append(vGlobalLocalRegistrationServiceResourceList, ret) + } + + log.Debugf("[getGlobalLocalRegistrationServiceClusterResourcesResolver]Output Resources objects %v", vGlobalLocalRegistrationServiceResourceList) + + return vGlobalLocalRegistrationServiceResourceList, nil +} + +////////////////////////////////////// +// LINK RESOLVER +// FieldName: Template Node: LocalRegistrationService PKG: Global +////////////////////////////////////// +func getGlobalLocalRegistrationServiceTemplateResolver(obj *model.GlobalLocalRegistrationService) (*model.GlobalServiceTemplate, error) { + log.Debugf("[getGlobalLocalRegistrationServiceTemplateResolver]Parent Object %+v", obj) + vServiceTemplateParent, err := nc.GlobalRoot().Runtime().AllsparkServices().GetLocalRegistrationService(context.TODO(), getParentName(obj.ParentLabels, "localregistrationservices.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalLocalRegistrationServiceTemplateResolver]Error getting parent node %s", err) + return &model.GlobalServiceTemplate{}, nil + } + vServiceTemplate, err := vServiceTemplateParent.GetTemplate(context.TODO()) + if err != nil { + log.Errorf("[getGlobalLocalRegistrationServiceTemplateResolver]Error getting Template object %s", err) + return &model.GlobalServiceTemplate{}, nil + } + dn := vServiceTemplate.DisplayName() +parentLabels := map[string]interface{}{"servicetemplates.global.tsm.tanzu.vmware.com":dn} +vVersion := string(vServiceTemplate.Spec.Version) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceTemplate { + Id: &dn, + ParentLabels: parentLabels, + Version: &vVersion, + } + log.Debugf("[getGlobalLocalRegistrationServiceTemplateResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Clusters Node: LocalRegistrationService PKG: Global +////////////////////////////////////// +func getGlobalLocalRegistrationServiceClustersResolver(obj *model.GlobalLocalRegistrationService, id *string) ([]*model.GlobalLocalRegistrationServiceCluster, error) { + log.Debugf("[getGlobalLocalRegistrationServiceClustersResolver]Parent Object %+v", obj) + var vGlobalLocalRegistrationServiceClusterList []*model.GlobalLocalRegistrationServiceCluster + if id != nil && *id != "" { + log.Debugf("[getGlobalLocalRegistrationServiceClustersResolver]Id %q", *id) + vLocalRegistrationServiceCluster, err := nc.GlobalRoot().Runtime().AllsparkServices().LocalRegistrationService(getParentName(obj.ParentLabels, "localregistrationservices.global.tsm.tanzu.vmware.com")).GetClusters(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalLocalRegistrationServiceClustersResolver]Error getting Clusters node %q : %s", *id, err) + return vGlobalLocalRegistrationServiceClusterList, nil + } + dn := vLocalRegistrationServiceCluster.DisplayName() +parentLabels := map[string]interface{}{"localregistrationserviceclusters.global.tsm.tanzu.vmware.com":dn} +vTenant := string(vLocalRegistrationServiceCluster.Spec.Tenant) +vType := string(vLocalRegistrationServiceCluster.Spec.Type) +vVersion := string(vLocalRegistrationServiceCluster.Spec.Version) +vErrorCount := int(vLocalRegistrationServiceCluster.Spec.ErrorCount) +vRestartCount := int(vLocalRegistrationServiceCluster.Spec.RestartCount) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalLocalRegistrationServiceCluster { + Id: &dn, + ParentLabels: parentLabels, + Tenant: &vTenant, + Type: &vType, + Version: &vVersion, + ErrorCount: &vErrorCount, + RestartCount: &vRestartCount, + } + vGlobalLocalRegistrationServiceClusterList = append(vGlobalLocalRegistrationServiceClusterList, ret) + + log.Debugf("[getGlobalLocalRegistrationServiceClustersResolver]Output Clusters objects %v", vGlobalLocalRegistrationServiceClusterList) + + return vGlobalLocalRegistrationServiceClusterList, nil + } + + log.Debug("[getGlobalLocalRegistrationServiceClustersResolver]Id is empty, process all Clusterss") + + vLocalRegistrationServiceClusterParent, err := nc.GlobalRoot().Runtime().AllsparkServices().GetLocalRegistrationService(context.TODO(), getParentName(obj.ParentLabels, "localregistrationservices.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalLocalRegistrationServiceClustersResolver]Error getting parent node %s", err) + return vGlobalLocalRegistrationServiceClusterList, nil + } + vLocalRegistrationServiceClusterAllObj, err := vLocalRegistrationServiceClusterParent.GetAllClusters(context.TODO()) + if err != nil { + log.Errorf("[getGlobalLocalRegistrationServiceClustersResolver]Error getting Clusters objects %s", err) + return vGlobalLocalRegistrationServiceClusterList, nil + } + for _, i := range vLocalRegistrationServiceClusterAllObj { + vLocalRegistrationServiceCluster, err := nc.GlobalRoot().Runtime().AllsparkServices().LocalRegistrationService(getParentName(obj.ParentLabels, "localregistrationservices.global.tsm.tanzu.vmware.com")).GetClusters(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalLocalRegistrationServiceClustersResolver]Error getting Clusters node %q : %s", i.DisplayName(), err) + continue + } + dn := vLocalRegistrationServiceCluster.DisplayName() +parentLabels := map[string]interface{}{"localregistrationserviceclusters.global.tsm.tanzu.vmware.com":dn} +vTenant := string(vLocalRegistrationServiceCluster.Spec.Tenant) +vType := string(vLocalRegistrationServiceCluster.Spec.Type) +vVersion := string(vLocalRegistrationServiceCluster.Spec.Version) +vErrorCount := int(vLocalRegistrationServiceCluster.Spec.ErrorCount) +vRestartCount := int(vLocalRegistrationServiceCluster.Spec.RestartCount) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalLocalRegistrationServiceCluster { + Id: &dn, + ParentLabels: parentLabels, + Tenant: &vTenant, + Type: &vType, + Version: &vVersion, + ErrorCount: &vErrorCount, + RestartCount: &vRestartCount, + } + vGlobalLocalRegistrationServiceClusterList = append(vGlobalLocalRegistrationServiceClusterList, ret) + } + + log.Debugf("[getGlobalLocalRegistrationServiceClustersResolver]Output Clusters objects %v", vGlobalLocalRegistrationServiceClusterList) + + return vGlobalLocalRegistrationServiceClusterList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Log Node: LogFolder PKG: Global +////////////////////////////////////// +func getGlobalLogFolderLogResolver(obj *model.GlobalLogFolder, id *string) ([]*model.GlobalLog, error) { + log.Debugf("[getGlobalLogFolderLogResolver]Parent Object %+v", obj) + var vGlobalLogList []*model.GlobalLog + if id != nil && *id != "" { + log.Debugf("[getGlobalLogFolderLogResolver]Id %q", *id) + vLog, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).LogFolder(getParentName(obj.ParentLabels, "logfolders.global.tsm.tanzu.vmware.com")).GetLog(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalLogFolderLogResolver]Error getting Log node %q : %s", *id, err) + return vGlobalLogList, nil + } + dn := vLog.DisplayName() +parentLabels := map[string]interface{}{"logs.global.tsm.tanzu.vmware.com":dn} +vRequest := string(vLog.Spec.Request) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalLog { + Id: &dn, + ParentLabels: parentLabels, + Request: &vRequest, + } + vGlobalLogList = append(vGlobalLogList, ret) + + log.Debugf("[getGlobalLogFolderLogResolver]Output Log objects %v", vGlobalLogList) + + return vGlobalLogList, nil + } + + log.Debug("[getGlobalLogFolderLogResolver]Id is empty, process all Logs") + + vLogParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetLogFolder(context.TODO(), getParentName(obj.ParentLabels, "logfolders.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalLogFolderLogResolver]Error getting parent node %s", err) + return vGlobalLogList, nil + } + vLogAllObj, err := vLogParent.GetAllLog(context.TODO()) + if err != nil { + log.Errorf("[getGlobalLogFolderLogResolver]Error getting Log objects %s", err) + return vGlobalLogList, nil + } + for _, i := range vLogAllObj { + vLog, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).LogFolder(getParentName(obj.ParentLabels, "logfolders.global.tsm.tanzu.vmware.com")).GetLog(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalLogFolderLogResolver]Error getting Log node %q : %s", i.DisplayName(), err) + continue + } + dn := vLog.DisplayName() +parentLabels := map[string]interface{}{"logs.global.tsm.tanzu.vmware.com":dn} +vRequest := string(vLog.Spec.Request) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalLog { + Id: &dn, + ParentLabels: parentLabels, + Request: &vRequest, + } + vGlobalLogList = append(vGlobalLogList, ret) + } + + log.Debugf("[getGlobalLogFolderLogResolver]Output Log objects %v", vGlobalLogList) + + return vGlobalLogList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Clusters Node: NodeFolder PKG: Global +////////////////////////////////////// +func getGlobalNodeFolderClustersResolver(obj *model.GlobalNodeFolder, id *string) ([]*model.GlobalNodeFolderCluster, error) { + log.Debugf("[getGlobalNodeFolderClustersResolver]Parent Object %+v", obj) + var vGlobalNodeFolderClusterList []*model.GlobalNodeFolderCluster + if id != nil && *id != "" { + log.Debugf("[getGlobalNodeFolderClustersResolver]Id %q", *id) + vNodeFolderCluster, err := nc.GlobalRoot().Runtime().NodeFolder().GetClusters(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalNodeFolderClustersResolver]Error getting Clusters node %q : %s", *id, err) + return vGlobalNodeFolderClusterList, nil + } + dn := vNodeFolderCluster.DisplayName() +parentLabels := map[string]interface{}{"nodefolderclusters.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNodeFolderCluster { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalNodeFolderClusterList = append(vGlobalNodeFolderClusterList, ret) + + log.Debugf("[getGlobalNodeFolderClustersResolver]Output Clusters objects %v", vGlobalNodeFolderClusterList) + + return vGlobalNodeFolderClusterList, nil + } + + log.Debug("[getGlobalNodeFolderClustersResolver]Id is empty, process all Clusterss") + + vNodeFolderClusterParent, err := nc.GlobalRoot().Runtime().GetNodeFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalNodeFolderClustersResolver]Error getting parent node %s", err) + return vGlobalNodeFolderClusterList, nil + } + vNodeFolderClusterAllObj, err := vNodeFolderClusterParent.GetAllClusters(context.TODO()) + if err != nil { + log.Errorf("[getGlobalNodeFolderClustersResolver]Error getting Clusters objects %s", err) + return vGlobalNodeFolderClusterList, nil + } + for _, i := range vNodeFolderClusterAllObj { + vNodeFolderCluster, err := nc.GlobalRoot().Runtime().NodeFolder().GetClusters(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalNodeFolderClustersResolver]Error getting Clusters node %q : %s", i.DisplayName(), err) + continue + } + dn := vNodeFolderCluster.DisplayName() +parentLabels := map[string]interface{}{"nodefolderclusters.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNodeFolderCluster { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalNodeFolderClusterList = append(vGlobalNodeFolderClusterList, ret) + } + + log.Debugf("[getGlobalNodeFolderClustersResolver]Output Clusters objects %v", vGlobalNodeFolderClusterList) + + return vGlobalNodeFolderClusterList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: DefinitionVersions Node: NodeTemplate PKG: Global +////////////////////////////////////// +func getGlobalNodeTemplateDefinitionVersionsResolver(obj *model.GlobalNodeTemplate, id *string) ([]*model.GlobalNodeDefinition, error) { + log.Debugf("[getGlobalNodeTemplateDefinitionVersionsResolver]Parent Object %+v", obj) + var vGlobalNodeDefinitionList []*model.GlobalNodeDefinition + if id != nil && *id != "" { + log.Debugf("[getGlobalNodeTemplateDefinitionVersionsResolver]Id %q", *id) + vNodeDefinition, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).NodeTemplates(getParentName(obj.ParentLabels, "nodetemplates.global.tsm.tanzu.vmware.com")).GetDefinitionVersions(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalNodeTemplateDefinitionVersionsResolver]Error getting DefinitionVersions node %q : %s", *id, err) + return vGlobalNodeDefinitionList, nil + } + dn := vNodeDefinition.DisplayName() +parentLabels := map[string]interface{}{"nodedefinitions.global.tsm.tanzu.vmware.com":dn} +vType := string(vNodeDefinition.Spec.Type) +vVersion := string(vNodeDefinition.Spec.Version) +vProvider := string(vNodeDefinition.Spec.Provider) +vImageInfo := string(vNodeDefinition.Spec.ImageInfo) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNodeDefinition { + Id: &dn, + ParentLabels: parentLabels, + Type: &vType, + Version: &vVersion, + Provider: &vProvider, + ImageInfo: &vImageInfo, + } + vGlobalNodeDefinitionList = append(vGlobalNodeDefinitionList, ret) + + log.Debugf("[getGlobalNodeTemplateDefinitionVersionsResolver]Output DefinitionVersions objects %v", vGlobalNodeDefinitionList) + + return vGlobalNodeDefinitionList, nil + } + + log.Debug("[getGlobalNodeTemplateDefinitionVersionsResolver]Id is empty, process all DefinitionVersionss") + + vNodeDefinitionParent, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).GetNodeTemplates(context.TODO(), getParentName(obj.ParentLabels, "nodetemplates.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalNodeTemplateDefinitionVersionsResolver]Error getting parent node %s", err) + return vGlobalNodeDefinitionList, nil + } + vNodeDefinitionAllObj, err := vNodeDefinitionParent.GetAllDefinitionVersions(context.TODO()) + if err != nil { + log.Errorf("[getGlobalNodeTemplateDefinitionVersionsResolver]Error getting DefinitionVersions objects %s", err) + return vGlobalNodeDefinitionList, nil + } + for _, i := range vNodeDefinitionAllObj { + vNodeDefinition, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).NodeTemplates(getParentName(obj.ParentLabels, "nodetemplates.global.tsm.tanzu.vmware.com")).GetDefinitionVersions(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalNodeTemplateDefinitionVersionsResolver]Error getting DefinitionVersions node %q : %s", i.DisplayName(), err) + continue + } + dn := vNodeDefinition.DisplayName() +parentLabels := map[string]interface{}{"nodedefinitions.global.tsm.tanzu.vmware.com":dn} +vType := string(vNodeDefinition.Spec.Type) +vVersion := string(vNodeDefinition.Spec.Version) +vProvider := string(vNodeDefinition.Spec.Provider) +vImageInfo := string(vNodeDefinition.Spec.ImageInfo) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNodeDefinition { + Id: &dn, + ParentLabels: parentLabels, + Type: &vType, + Version: &vVersion, + Provider: &vProvider, + ImageInfo: &vImageInfo, + } + vGlobalNodeDefinitionList = append(vGlobalNodeDefinitionList, ret) + } + + log.Debugf("[getGlobalNodeTemplateDefinitionVersionsResolver]Output DefinitionVersions objects %v", vGlobalNodeDefinitionList) + + return vGlobalNodeDefinitionList, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: Status Node: Node PKG: Global +////////////////////////////////////// +func getGlobalNodeStatusResolver(obj *model.GlobalNode, id *string) (*model.GlobalNodeStatus, error) { + log.Debugf("[getGlobalNodeStatusResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalNodeStatusResolver]Id %q", *id) + vNodeStatus, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Nodes(getParentName(obj.ParentLabels, "nodes.global.tsm.tanzu.vmware.com")).GetStatus(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalNodeStatusResolver]Error getting Status node %q : %s", *id, err) + return &model.GlobalNodeStatus{}, nil + } + dn := vNodeStatus.DisplayName() +parentLabels := map[string]interface{}{"nodestatuses.global.tsm.tanzu.vmware.com":dn} +vAddresses := string(vNodeStatus.Spec.Addresses) +vAllocatable := string(vNodeStatus.Spec.Allocatable) +vCapacity := string(vNodeStatus.Spec.Capacity) +vDaemonEndpoints := string(vNodeStatus.Spec.DaemonEndpoints) +vConditions := string(vNodeStatus.Spec.Conditions) +vImages := string(vNodeStatus.Spec.Images) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNodeStatus { + Id: &dn, + ParentLabels: parentLabels, + Addresses: &vAddresses, + Allocatable: &vAllocatable, + Capacity: &vCapacity, + DaemonEndpoints: &vDaemonEndpoints, + Conditions: &vConditions, + Images: &vImages, + } + + log.Debugf("[getGlobalNodeStatusResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalNodeStatusResolver]Id is empty, process all Statuss") + vNodeStatusParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).GetNodes(context.TODO(), getParentName(obj.ParentLabels, "nodes.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalNodeStatusResolver]Failed to get parent node %s", err) + return &model.GlobalNodeStatus{}, nil + } + vNodeStatus, err := vNodeStatusParent.GetStatus(context.TODO()) + if err != nil { + log.Errorf("[getGlobalNodeStatusResolver]Error getting Status node %s", err) + return &model.GlobalNodeStatus{}, nil + } + dn := vNodeStatus.DisplayName() +parentLabels := map[string]interface{}{"nodestatuses.global.tsm.tanzu.vmware.com":dn} +vAddresses := string(vNodeStatus.Spec.Addresses) +vAllocatable := string(vNodeStatus.Spec.Allocatable) +vCapacity := string(vNodeStatus.Spec.Capacity) +vDaemonEndpoints := string(vNodeStatus.Spec.DaemonEndpoints) +vConditions := string(vNodeStatus.Spec.Conditions) +vImages := string(vNodeStatus.Spec.Images) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNodeStatus { + Id: &dn, + ParentLabels: parentLabels, + Addresses: &vAddresses, + Allocatable: &vAllocatable, + Capacity: &vCapacity, + DaemonEndpoints: &vDaemonEndpoints, + Conditions: &vConditions, + Images: &vImages, + } + + log.Debugf("[getGlobalNodeStatusResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: PolicyConfigs Node: AccessControlPolicy PKG: Global +////////////////////////////////////// +func getGlobalAccessControlPolicyPolicyConfigsResolver(obj *model.GlobalAccessControlPolicy, id *string) ([]*model.GlobalACPConfig, error) { + log.Debugf("[getGlobalAccessControlPolicyPolicyConfigsResolver]Parent Object %+v", obj) + var vGlobalACPConfigList []*model.GlobalACPConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalAccessControlPolicyPolicyConfigsResolver]Id %q", *id) + vACPConfig, err := nc.GlobalRoot().Config().Policy(getParentName(obj.ParentLabels, "accesscontrolpolicies.global.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalAccessControlPolicyPolicyConfigsResolver]Error getting PolicyConfigs node %q : %s", *id, err) + return vGlobalACPConfigList, nil + } + dn := vACPConfig.DisplayName() +parentLabels := map[string]interface{}{"acpconfigs.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vACPConfig.Spec.DisplayName) +vGns := string(vACPConfig.Spec.Gns) +vDescription := string(vACPConfig.Spec.Description) +Tags, _ := json.Marshal(vACPConfig.Spec.Tags) +TagsData := string(Tags) +vProjectId := string(vACPConfig.Spec.ProjectId) +DestGroups, _ := json.Marshal(vACPConfig.Spec.DestGroups) +DestGroupsData := string(DestGroups) +SourceGroups, _ := json.Marshal(vACPConfig.Spec.SourceGroups) +SourceGroupsData := string(SourceGroups) +Conditions, _ := json.Marshal(vACPConfig.Spec.Conditions) +ConditionsData := string(Conditions) +Actions, _ := json.Marshal(vACPConfig.Spec.Actions) +ActionsData := string(Actions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalACPConfig { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + Gns: &vGns, + Description: &vDescription, + Tags: &TagsData, + ProjectId: &vProjectId, + DestGroups: &DestGroupsData, + SourceGroups: &SourceGroupsData, + Conditions: &ConditionsData, + Actions: &ActionsData, + } + vGlobalACPConfigList = append(vGlobalACPConfigList, ret) + + log.Debugf("[getGlobalAccessControlPolicyPolicyConfigsResolver]Output PolicyConfigs objects %v", vGlobalACPConfigList) + + return vGlobalACPConfigList, nil + } + + log.Debug("[getGlobalAccessControlPolicyPolicyConfigsResolver]Id is empty, process all PolicyConfigss") + + vACPConfigParent, err := nc.GlobalRoot().Config().GetPolicy(context.TODO(), getParentName(obj.ParentLabels, "accesscontrolpolicies.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalAccessControlPolicyPolicyConfigsResolver]Error getting parent node %s", err) + return vGlobalACPConfigList, nil + } + vACPConfigAllObj, err := vACPConfigParent.GetAllPolicyConfigs(context.TODO()) + if err != nil { + log.Errorf("[getGlobalAccessControlPolicyPolicyConfigsResolver]Error getting PolicyConfigs objects %s", err) + return vGlobalACPConfigList, nil + } + for _, i := range vACPConfigAllObj { + vACPConfig, err := nc.GlobalRoot().Config().Policy(getParentName(obj.ParentLabels, "accesscontrolpolicies.global.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalAccessControlPolicyPolicyConfigsResolver]Error getting PolicyConfigs node %q : %s", i.DisplayName(), err) + continue + } + dn := vACPConfig.DisplayName() +parentLabels := map[string]interface{}{"acpconfigs.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vACPConfig.Spec.DisplayName) +vGns := string(vACPConfig.Spec.Gns) +vDescription := string(vACPConfig.Spec.Description) +Tags, _ := json.Marshal(vACPConfig.Spec.Tags) +TagsData := string(Tags) +vProjectId := string(vACPConfig.Spec.ProjectId) +DestGroups, _ := json.Marshal(vACPConfig.Spec.DestGroups) +DestGroupsData := string(DestGroups) +SourceGroups, _ := json.Marshal(vACPConfig.Spec.SourceGroups) +SourceGroupsData := string(SourceGroups) +Conditions, _ := json.Marshal(vACPConfig.Spec.Conditions) +ConditionsData := string(Conditions) +Actions, _ := json.Marshal(vACPConfig.Spec.Actions) +ActionsData := string(Actions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalACPConfig { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + Gns: &vGns, + Description: &vDescription, + Tags: &TagsData, + ProjectId: &vProjectId, + DestGroups: &DestGroupsData, + SourceGroups: &SourceGroupsData, + Conditions: &ConditionsData, + Actions: &ActionsData, + } + vGlobalACPConfigList = append(vGlobalACPConfigList, ret) + } + + log.Debugf("[getGlobalAccessControlPolicyPolicyConfigsResolver]Output PolicyConfigs objects %v", vGlobalACPConfigList) + + return vGlobalACPConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Upgrade Node: ProgressiveUpgrade PKG: Global +////////////////////////////////////// +func getGlobalProgressiveUpgradeUpgradeResolver(obj *model.GlobalProgressiveUpgrade, id *string) ([]*model.GlobalProgressiveUpgradeConfig, error) { + log.Debugf("[getGlobalProgressiveUpgradeUpgradeResolver]Parent Object %+v", obj) + var vGlobalProgressiveUpgradeConfigList []*model.GlobalProgressiveUpgradeConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalProgressiveUpgradeUpgradeResolver]Id %q", *id) + vProgressiveUpgradeConfig, err := nc.GlobalRoot().Config().ProgressiveUpgrade(getParentName(obj.ParentLabels, "progressiveupgrades.global.tsm.tanzu.vmware.com")).GetUpgrade(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProgressiveUpgradeUpgradeResolver]Error getting Upgrade node %q : %s", *id, err) + return vGlobalProgressiveUpgradeConfigList, nil + } + dn := vProgressiveUpgradeConfig.DisplayName() +parentLabels := map[string]interface{}{"progressiveupgradeconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vProgressiveUpgradeConfig.Spec.Name) +vServices := string(vProgressiveUpgradeConfig.Spec.Services) +vUpgradeStrategy := string(vProgressiveUpgradeConfig.Spec.UpgradeStrategy) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalProgressiveUpgradeConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Services: &vServices, + UpgradeStrategy: &vUpgradeStrategy, + } + vGlobalProgressiveUpgradeConfigList = append(vGlobalProgressiveUpgradeConfigList, ret) + + log.Debugf("[getGlobalProgressiveUpgradeUpgradeResolver]Output Upgrade objects %v", vGlobalProgressiveUpgradeConfigList) + + return vGlobalProgressiveUpgradeConfigList, nil + } + + log.Debug("[getGlobalProgressiveUpgradeUpgradeResolver]Id is empty, process all Upgrades") + + vProgressiveUpgradeConfigParent, err := nc.GlobalRoot().Config().GetProgressiveUpgrade(context.TODO(), getParentName(obj.ParentLabels, "progressiveupgrades.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProgressiveUpgradeUpgradeResolver]Error getting parent node %s", err) + return vGlobalProgressiveUpgradeConfigList, nil + } + vProgressiveUpgradeConfigAllObj, err := vProgressiveUpgradeConfigParent.GetAllUpgrade(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProgressiveUpgradeUpgradeResolver]Error getting Upgrade objects %s", err) + return vGlobalProgressiveUpgradeConfigList, nil + } + for _, i := range vProgressiveUpgradeConfigAllObj { + vProgressiveUpgradeConfig, err := nc.GlobalRoot().Config().ProgressiveUpgrade(getParentName(obj.ParentLabels, "progressiveupgrades.global.tsm.tanzu.vmware.com")).GetUpgrade(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalProgressiveUpgradeUpgradeResolver]Error getting Upgrade node %q : %s", i.DisplayName(), err) + continue + } + dn := vProgressiveUpgradeConfig.DisplayName() +parentLabels := map[string]interface{}{"progressiveupgradeconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vProgressiveUpgradeConfig.Spec.Name) +vServices := string(vProgressiveUpgradeConfig.Spec.Services) +vUpgradeStrategy := string(vProgressiveUpgradeConfig.Spec.UpgradeStrategy) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalProgressiveUpgradeConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Services: &vServices, + UpgradeStrategy: &vUpgradeStrategy, + } + vGlobalProgressiveUpgradeConfigList = append(vGlobalProgressiveUpgradeConfigList, ret) + } + + log.Debugf("[getGlobalProgressiveUpgradeUpgradeResolver]Output Upgrade objects %v", vGlobalProgressiveUpgradeConfigList) + + return vGlobalProgressiveUpgradeConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Upgrades Node: ProgressiveUpgradeFolder PKG: Global +////////////////////////////////////// +func getGlobalProgressiveUpgradeFolderUpgradesResolver(obj *model.GlobalProgressiveUpgradeFolder, id *string) ([]*model.GlobalProgressiveUpgradeRuntime, error) { + log.Debugf("[getGlobalProgressiveUpgradeFolderUpgradesResolver]Parent Object %+v", obj) + var vGlobalProgressiveUpgradeRuntimeList []*model.GlobalProgressiveUpgradeRuntime + if id != nil && *id != "" { + log.Debugf("[getGlobalProgressiveUpgradeFolderUpgradesResolver]Id %q", *id) + vProgressiveUpgradeRuntime, err := nc.GlobalRoot().Runtime().ProgressiveUpgrade().GetUpgrades(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProgressiveUpgradeFolderUpgradesResolver]Error getting Upgrades node %q : %s", *id, err) + return vGlobalProgressiveUpgradeRuntimeList, nil + } + dn := vProgressiveUpgradeRuntime.DisplayName() +parentLabels := map[string]interface{}{"progressiveupgraderuntimes.global.tsm.tanzu.vmware.com":dn} +vUpgradeName := string(vProgressiveUpgradeRuntime.Spec.UpgradeName) +vStatus := string(vProgressiveUpgradeRuntime.Spec.Status) +vStep := string(vProgressiveUpgradeRuntime.Spec.Step) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalProgressiveUpgradeRuntime { + Id: &dn, + ParentLabels: parentLabels, + UpgradeName: &vUpgradeName, + Status: &vStatus, + Step: &vStep, + } + vGlobalProgressiveUpgradeRuntimeList = append(vGlobalProgressiveUpgradeRuntimeList, ret) + + log.Debugf("[getGlobalProgressiveUpgradeFolderUpgradesResolver]Output Upgrades objects %v", vGlobalProgressiveUpgradeRuntimeList) + + return vGlobalProgressiveUpgradeRuntimeList, nil + } + + log.Debug("[getGlobalProgressiveUpgradeFolderUpgradesResolver]Id is empty, process all Upgradess") + + vProgressiveUpgradeRuntimeParent, err := nc.GlobalRoot().Runtime().GetProgressiveUpgrade(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProgressiveUpgradeFolderUpgradesResolver]Error getting parent node %s", err) + return vGlobalProgressiveUpgradeRuntimeList, nil + } + vProgressiveUpgradeRuntimeAllObj, err := vProgressiveUpgradeRuntimeParent.GetAllUpgrades(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProgressiveUpgradeFolderUpgradesResolver]Error getting Upgrades objects %s", err) + return vGlobalProgressiveUpgradeRuntimeList, nil + } + for _, i := range vProgressiveUpgradeRuntimeAllObj { + vProgressiveUpgradeRuntime, err := nc.GlobalRoot().Runtime().ProgressiveUpgrade().GetUpgrades(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalProgressiveUpgradeFolderUpgradesResolver]Error getting Upgrades node %q : %s", i.DisplayName(), err) + continue + } + dn := vProgressiveUpgradeRuntime.DisplayName() +parentLabels := map[string]interface{}{"progressiveupgraderuntimes.global.tsm.tanzu.vmware.com":dn} +vUpgradeName := string(vProgressiveUpgradeRuntime.Spec.UpgradeName) +vStatus := string(vProgressiveUpgradeRuntime.Spec.Status) +vStep := string(vProgressiveUpgradeRuntime.Spec.Step) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalProgressiveUpgradeRuntime { + Id: &dn, + ParentLabels: parentLabels, + UpgradeName: &vUpgradeName, + Status: &vStatus, + Step: &vStep, + } + vGlobalProgressiveUpgradeRuntimeList = append(vGlobalProgressiveUpgradeRuntimeList, ret) + } + + log.Debugf("[getGlobalProgressiveUpgradeFolderUpgradesResolver]Output Upgrades objects %v", vGlobalProgressiveUpgradeRuntimeList) + + return vGlobalProgressiveUpgradeRuntimeList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: CertificateAuthorities Node: ProjectConfig PKG: Global +////////////////////////////////////// +func getGlobalProjectConfigCertificateAuthoritiesResolver(obj *model.GlobalProjectConfig, id *string) ([]*model.GlobalCertificateAuthorityConfigN, error) { + log.Debugf("[getGlobalProjectConfigCertificateAuthoritiesResolver]Parent Object %+v", obj) + var vGlobalCertificateAuthorityConfigNList []*model.GlobalCertificateAuthorityConfigN + if id != nil && *id != "" { + log.Debugf("[getGlobalProjectConfigCertificateAuthoritiesResolver]Id %q", *id) + vCertificateAuthorityConfigN, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).Config(getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")).GetCertificateAuthorities(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProjectConfigCertificateAuthoritiesResolver]Error getting CertificateAuthorities node %q : %s", *id, err) + return vGlobalCertificateAuthorityConfigNList, nil + } + dn := vCertificateAuthorityConfigN.DisplayName() +parentLabels := map[string]interface{}{"certificateauthorityconfigns.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vCertificateAuthorityConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCertificateAuthorityConfigN { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + } + vGlobalCertificateAuthorityConfigNList = append(vGlobalCertificateAuthorityConfigNList, ret) + + log.Debugf("[getGlobalProjectConfigCertificateAuthoritiesResolver]Output CertificateAuthorities objects %v", vGlobalCertificateAuthorityConfigNList) + + return vGlobalCertificateAuthorityConfigNList, nil + } + + log.Debug("[getGlobalProjectConfigCertificateAuthoritiesResolver]Id is empty, process all CertificateAuthoritiess") + + vCertificateAuthorityConfigNParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigCertificateAuthoritiesResolver]Error getting parent node %s", err) + return vGlobalCertificateAuthorityConfigNList, nil + } + vCertificateAuthorityConfigNAllObj, err := vCertificateAuthorityConfigNParent.GetAllCertificateAuthorities(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProjectConfigCertificateAuthoritiesResolver]Error getting CertificateAuthorities objects %s", err) + return vGlobalCertificateAuthorityConfigNList, nil + } + for _, i := range vCertificateAuthorityConfigNAllObj { + vCertificateAuthorityConfigN, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).Config(getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")).GetCertificateAuthorities(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalProjectConfigCertificateAuthoritiesResolver]Error getting CertificateAuthorities node %q : %s", i.DisplayName(), err) + continue + } + dn := vCertificateAuthorityConfigN.DisplayName() +parentLabels := map[string]interface{}{"certificateauthorityconfigns.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vCertificateAuthorityConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCertificateAuthorityConfigN { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + } + vGlobalCertificateAuthorityConfigNList = append(vGlobalCertificateAuthorityConfigNList, ret) + } + + log.Debugf("[getGlobalProjectConfigCertificateAuthoritiesResolver]Output CertificateAuthorities objects %v", vGlobalCertificateAuthorityConfigNList) + + return vGlobalCertificateAuthorityConfigNList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: SvcGroups Node: ProjectConfig PKG: Global +////////////////////////////////////// +func getGlobalProjectConfigSvcGroupsResolver(obj *model.GlobalProjectConfig, id *string) ([]*model.GlobalSvcGroup, error) { + log.Debugf("[getGlobalProjectConfigSvcGroupsResolver]Parent Object %+v", obj) + var vGlobalSvcGroupList []*model.GlobalSvcGroup + if id != nil && *id != "" { + log.Debugf("[getGlobalProjectConfigSvcGroupsResolver]Id %q", *id) + vSvcGroupParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigSvcGroupsResolver]Error getting SvcGroups %q : %s", *id, err) + return vGlobalSvcGroupList, nil + } + vSvcGroup, err := vSvcGroupParent.GetSvcGroups(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProjectConfigSvcGroupsResolver]Error getting SvcGroups %q : %s", *id, err) + return vGlobalSvcGroupList, nil + } + dn := vSvcGroup.DisplayName() +parentLabels := map[string]interface{}{"svcgroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vSvcGroup.Spec.DisplayName) +vInternalPredefinedGroup := bool(vSvcGroup.Spec.InternalPredefinedGroup) +vDescription := string(vSvcGroup.Spec.Description) +vColor := string(vSvcGroup.Spec.Color) +vProjectId := string(vSvcGroup.Spec.ProjectId) +vRules := string(vSvcGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSvcGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + InternalPredefinedGroup: &vInternalPredefinedGroup, + Description: &vDescription, + Color: &vColor, + ProjectId: &vProjectId, + Rules: &vRules, + } + vGlobalSvcGroupList = append(vGlobalSvcGroupList, ret) + + log.Debugf("[getGlobalProjectConfigSvcGroupsResolver]Output SvcGroups objects %v", vGlobalSvcGroupList) + + return vGlobalSvcGroupList, nil + } + + log.Debug("[getGlobalProjectConfigSvcGroupsResolver]Id is empty, process all SvcGroupss") + + vSvcGroupParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigSvcGroupsResolver]Error getting parent node %s", err) + return vGlobalSvcGroupList, nil + } + vSvcGroupAllObj, err := vSvcGroupParent.GetAllSvcGroups(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProjectConfigSvcGroupsResolver]Error getting SvcGroups %s", err) + return vGlobalSvcGroupList, nil + } + for _, i := range vSvcGroupAllObj { + vSvcGroupParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigSvcGroupsResolver]Error getting parent node %s, skipping...", err) + continue + } + vSvcGroup, err := vSvcGroupParent.GetSvcGroups(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalProjectConfigSvcGroupsResolver]Error getting SvcGroups node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vSvcGroup.DisplayName() +parentLabels := map[string]interface{}{"svcgroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vSvcGroup.Spec.DisplayName) +vInternalPredefinedGroup := bool(vSvcGroup.Spec.InternalPredefinedGroup) +vDescription := string(vSvcGroup.Spec.Description) +vColor := string(vSvcGroup.Spec.Color) +vProjectId := string(vSvcGroup.Spec.ProjectId) +vRules := string(vSvcGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSvcGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + InternalPredefinedGroup: &vInternalPredefinedGroup, + Description: &vDescription, + Color: &vColor, + ProjectId: &vProjectId, + Rules: &vRules, + } + vGlobalSvcGroupList = append(vGlobalSvcGroupList, ret) + } + log.Debugf("[getGlobalProjectConfigSvcGroupsResolver]List of SvcGroups object %v", vGlobalSvcGroupList) + return vGlobalSvcGroupList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Gns Node: ProjectConfig PKG: Global +////////////////////////////////////// +func getGlobalProjectConfigGnsResolver(obj *model.GlobalProjectConfig, id *string) ([]*model.GlobalGNS, error) { + log.Debugf("[getGlobalProjectConfigGnsResolver]Parent Object %+v", obj) + var vGlobalGNSList []*model.GlobalGNS + if id != nil && *id != "" { + log.Debugf("[getGlobalProjectConfigGnsResolver]Id %q", *id) + vGNSParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigGnsResolver]Error getting Gns %q : %s", *id, err) + return vGlobalGNSList, nil + } + vGNS, err := vGNSParent.GetGns(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProjectConfigGnsResolver]Error getting Gns %q : %s", *id, err) + return vGlobalGNSList, nil + } + dn := vGNS.DisplayName() +parentLabels := map[string]interface{}{"gnss.global.tsm.tanzu.vmware.com":dn} +vDomain := string(vGNS.Spec.Domain) +vUseSharedGateway := bool(vGNS.Spec.UseSharedGateway) +vMTLSEnforced := bool(vGNS.Spec.MTLSEnforced) +vMTLSPermissive := bool(vGNS.Spec.MTLSPermissive) +vApiDiscoveryEnabled := bool(vGNS.Spec.ApiDiscoveryEnabled) +vMTLSExceptions := string(vGNS.Spec.MTLSExceptions) +vCaType := string(vGNS.Spec.CaType) +vCa := string(vGNS.Spec.Ca) +vDescription := string(vGNS.Spec.Description) +vColor := string(vGNS.Spec.Color) +vVersion := string(vGNS.Spec.Version) +vProjectId := string(vGNS.Spec.ProjectId) +vMemberDomains := string(vGNS.Spec.MemberDomains) +vMatchingConditions := string(vGNS.Spec.MatchingConditions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGNS { + Id: &dn, + ParentLabels: parentLabels, + Domain: &vDomain, + UseSharedGateway: &vUseSharedGateway, + MTLSEnforced: &vMTLSEnforced, + MTLSPermissive: &vMTLSPermissive, + ApiDiscoveryEnabled: &vApiDiscoveryEnabled, + MTLSExceptions: &vMTLSExceptions, + CaType: &vCaType, + Ca: &vCa, + Description: &vDescription, + Color: &vColor, + Version: &vVersion, + ProjectId: &vProjectId, + MemberDomains: &vMemberDomains, + MatchingConditions: &vMatchingConditions, + } + vGlobalGNSList = append(vGlobalGNSList, ret) + + log.Debugf("[getGlobalProjectConfigGnsResolver]Output Gns objects %v", vGlobalGNSList) + + return vGlobalGNSList, nil + } + + log.Debug("[getGlobalProjectConfigGnsResolver]Id is empty, process all Gnss") + + vGNSParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigGnsResolver]Error getting parent node %s", err) + return vGlobalGNSList, nil + } + vGNSAllObj, err := vGNSParent.GetAllGns(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProjectConfigGnsResolver]Error getting Gns %s", err) + return vGlobalGNSList, nil + } + for _, i := range vGNSAllObj { + vGNSParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigGnsResolver]Error getting parent node %s, skipping...", err) + continue + } + vGNS, err := vGNSParent.GetGns(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalProjectConfigGnsResolver]Error getting Gns node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vGNS.DisplayName() +parentLabels := map[string]interface{}{"gnss.global.tsm.tanzu.vmware.com":dn} +vDomain := string(vGNS.Spec.Domain) +vUseSharedGateway := bool(vGNS.Spec.UseSharedGateway) +vMTLSEnforced := bool(vGNS.Spec.MTLSEnforced) +vMTLSPermissive := bool(vGNS.Spec.MTLSPermissive) +vApiDiscoveryEnabled := bool(vGNS.Spec.ApiDiscoveryEnabled) +vMTLSExceptions := string(vGNS.Spec.MTLSExceptions) +vCaType := string(vGNS.Spec.CaType) +vCa := string(vGNS.Spec.Ca) +vDescription := string(vGNS.Spec.Description) +vColor := string(vGNS.Spec.Color) +vVersion := string(vGNS.Spec.Version) +vProjectId := string(vGNS.Spec.ProjectId) +vMemberDomains := string(vGNS.Spec.MemberDomains) +vMatchingConditions := string(vGNS.Spec.MatchingConditions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGNS { + Id: &dn, + ParentLabels: parentLabels, + Domain: &vDomain, + UseSharedGateway: &vUseSharedGateway, + MTLSEnforced: &vMTLSEnforced, + MTLSPermissive: &vMTLSPermissive, + ApiDiscoveryEnabled: &vApiDiscoveryEnabled, + MTLSExceptions: &vMTLSExceptions, + CaType: &vCaType, + Ca: &vCa, + Description: &vDescription, + Color: &vColor, + Version: &vVersion, + ProjectId: &vProjectId, + MemberDomains: &vMemberDomains, + MatchingConditions: &vMatchingConditions, + } + vGlobalGNSList = append(vGlobalGNSList, ret) + } + log.Debugf("[getGlobalProjectConfigGnsResolver]List of Gns object %v", vGlobalGNSList) + return vGlobalGNSList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: PolicyConfigs Node: ProjectConfig PKG: Global +////////////////////////////////////// +func getGlobalProjectConfigPolicyConfigsResolver(obj *model.GlobalProjectConfig, id *string) ([]*model.GlobalACPConfig, error) { + log.Debugf("[getGlobalProjectConfigPolicyConfigsResolver]Parent Object %+v", obj) + var vGlobalACPConfigList []*model.GlobalACPConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalProjectConfigPolicyConfigsResolver]Id %q", *id) + vACPConfigParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigPolicyConfigsResolver]Error getting PolicyConfigs %q : %s", *id, err) + return vGlobalACPConfigList, nil + } + vACPConfig, err := vACPConfigParent.GetPolicyConfigs(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProjectConfigPolicyConfigsResolver]Error getting PolicyConfigs %q : %s", *id, err) + return vGlobalACPConfigList, nil + } + dn := vACPConfig.DisplayName() +parentLabels := map[string]interface{}{"acpconfigs.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vACPConfig.Spec.DisplayName) +vGns := string(vACPConfig.Spec.Gns) +vDescription := string(vACPConfig.Spec.Description) +Tags, _ := json.Marshal(vACPConfig.Spec.Tags) +TagsData := string(Tags) +vProjectId := string(vACPConfig.Spec.ProjectId) +DestGroups, _ := json.Marshal(vACPConfig.Spec.DestGroups) +DestGroupsData := string(DestGroups) +SourceGroups, _ := json.Marshal(vACPConfig.Spec.SourceGroups) +SourceGroupsData := string(SourceGroups) +Conditions, _ := json.Marshal(vACPConfig.Spec.Conditions) +ConditionsData := string(Conditions) +Actions, _ := json.Marshal(vACPConfig.Spec.Actions) +ActionsData := string(Actions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalACPConfig { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + Gns: &vGns, + Description: &vDescription, + Tags: &TagsData, + ProjectId: &vProjectId, + DestGroups: &DestGroupsData, + SourceGroups: &SourceGroupsData, + Conditions: &ConditionsData, + Actions: &ActionsData, + } + vGlobalACPConfigList = append(vGlobalACPConfigList, ret) + + log.Debugf("[getGlobalProjectConfigPolicyConfigsResolver]Output PolicyConfigs objects %v", vGlobalACPConfigList) + + return vGlobalACPConfigList, nil + } + + log.Debug("[getGlobalProjectConfigPolicyConfigsResolver]Id is empty, process all PolicyConfigss") + + vACPConfigParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigPolicyConfigsResolver]Error getting parent node %s", err) + return vGlobalACPConfigList, nil + } + vACPConfigAllObj, err := vACPConfigParent.GetAllPolicyConfigs(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProjectConfigPolicyConfigsResolver]Error getting PolicyConfigs %s", err) + return vGlobalACPConfigList, nil + } + for _, i := range vACPConfigAllObj { + vACPConfigParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigPolicyConfigsResolver]Error getting parent node %s, skipping...", err) + continue + } + vACPConfig, err := vACPConfigParent.GetPolicyConfigs(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalProjectConfigPolicyConfigsResolver]Error getting PolicyConfigs node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vACPConfig.DisplayName() +parentLabels := map[string]interface{}{"acpconfigs.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vACPConfig.Spec.DisplayName) +vGns := string(vACPConfig.Spec.Gns) +vDescription := string(vACPConfig.Spec.Description) +Tags, _ := json.Marshal(vACPConfig.Spec.Tags) +TagsData := string(Tags) +vProjectId := string(vACPConfig.Spec.ProjectId) +DestGroups, _ := json.Marshal(vACPConfig.Spec.DestGroups) +DestGroupsData := string(DestGroups) +SourceGroups, _ := json.Marshal(vACPConfig.Spec.SourceGroups) +SourceGroupsData := string(SourceGroups) +Conditions, _ := json.Marshal(vACPConfig.Spec.Conditions) +ConditionsData := string(Conditions) +Actions, _ := json.Marshal(vACPConfig.Spec.Actions) +ActionsData := string(Actions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalACPConfig { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + Gns: &vGns, + Description: &vDescription, + Tags: &TagsData, + ProjectId: &vProjectId, + DestGroups: &DestGroupsData, + SourceGroups: &SourceGroupsData, + Conditions: &ConditionsData, + Actions: &ActionsData, + } + vGlobalACPConfigList = append(vGlobalACPConfigList, ret) + } + log.Debugf("[getGlobalProjectConfigPolicyConfigsResolver]List of PolicyConfigs object %v", vGlobalACPConfigList) + return vGlobalACPConfigList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: TemplateGroups Node: ProjectConfig PKG: Global +////////////////////////////////////// +func getGlobalProjectConfigTemplateGroupsResolver(obj *model.GlobalProjectConfig, id *string) ([]*model.GlobalTemplateGroup, error) { + log.Debugf("[getGlobalProjectConfigTemplateGroupsResolver]Parent Object %+v", obj) + var vGlobalTemplateGroupList []*model.GlobalTemplateGroup + if id != nil && *id != "" { + log.Debugf("[getGlobalProjectConfigTemplateGroupsResolver]Id %q", *id) + vTemplateGroupParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigTemplateGroupsResolver]Error getting TemplateGroups %q : %s", *id, err) + return vGlobalTemplateGroupList, nil + } + vTemplateGroup, err := vTemplateGroupParent.GetTemplateGroups(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProjectConfigTemplateGroupsResolver]Error getting TemplateGroups %q : %s", *id, err) + return vGlobalTemplateGroupList, nil + } + dn := vTemplateGroup.DisplayName() +parentLabels := map[string]interface{}{"templategroups.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vTemplateGroup.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalTemplateGroup { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + } + vGlobalTemplateGroupList = append(vGlobalTemplateGroupList, ret) + + log.Debugf("[getGlobalProjectConfigTemplateGroupsResolver]Output TemplateGroups objects %v", vGlobalTemplateGroupList) + + return vGlobalTemplateGroupList, nil + } + + log.Debug("[getGlobalProjectConfigTemplateGroupsResolver]Id is empty, process all TemplateGroupss") + + vTemplateGroupParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigTemplateGroupsResolver]Error getting parent node %s", err) + return vGlobalTemplateGroupList, nil + } + vTemplateGroupAllObj, err := vTemplateGroupParent.GetAllTemplateGroups(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProjectConfigTemplateGroupsResolver]Error getting TemplateGroups %s", err) + return vGlobalTemplateGroupList, nil + } + for _, i := range vTemplateGroupAllObj { + vTemplateGroupParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigTemplateGroupsResolver]Error getting parent node %s, skipping...", err) + continue + } + vTemplateGroup, err := vTemplateGroupParent.GetTemplateGroups(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalProjectConfigTemplateGroupsResolver]Error getting TemplateGroups node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vTemplateGroup.DisplayName() +parentLabels := map[string]interface{}{"templategroups.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vTemplateGroup.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalTemplateGroup { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + } + vGlobalTemplateGroupList = append(vGlobalTemplateGroupList, ret) + } + log.Debugf("[getGlobalProjectConfigTemplateGroupsResolver]List of TemplateGroups object %v", vGlobalTemplateGroupList) + return vGlobalTemplateGroupList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Certificates Node: ProjectConfig PKG: Global +////////////////////////////////////// +func getGlobalProjectConfigCertificatesResolver(obj *model.GlobalProjectConfig, id *string) ([]*model.GlobalCertificateConfigN, error) { + log.Debugf("[getGlobalProjectConfigCertificatesResolver]Parent Object %+v", obj) + var vGlobalCertificateConfigNList []*model.GlobalCertificateConfigN + if id != nil && *id != "" { + log.Debugf("[getGlobalProjectConfigCertificatesResolver]Id %q", *id) + vCertificateConfigNParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigCertificatesResolver]Error getting Certificates %q : %s", *id, err) + return vGlobalCertificateConfigNList, nil + } + vCertificateConfigN, err := vCertificateConfigNParent.GetCertificates(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProjectConfigCertificatesResolver]Error getting Certificates %q : %s", *id, err) + return vGlobalCertificateConfigNList, nil + } + dn := vCertificateConfigN.DisplayName() +parentLabels := map[string]interface{}{"certificateconfigns.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vCertificateConfigN.Spec.ProjectId) +vBeginsOn := string(vCertificateConfigN.Spec.BeginsOn) +vExpiresOn := string(vCertificateConfigN.Spec.ExpiresOn) +vIssuedToCN := string(vCertificateConfigN.Spec.IssuedToCN) +vConfig := string(vCertificateConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCertificateConfigN { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + BeginsOn: &vBeginsOn, + ExpiresOn: &vExpiresOn, + IssuedToCN: &vIssuedToCN, + Config: &vConfig, + } + vGlobalCertificateConfigNList = append(vGlobalCertificateConfigNList, ret) + + log.Debugf("[getGlobalProjectConfigCertificatesResolver]Output Certificates objects %v", vGlobalCertificateConfigNList) + + return vGlobalCertificateConfigNList, nil + } + + log.Debug("[getGlobalProjectConfigCertificatesResolver]Id is empty, process all Certificatess") + + vCertificateConfigNParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigCertificatesResolver]Error getting parent node %s", err) + return vGlobalCertificateConfigNList, nil + } + vCertificateConfigNAllObj, err := vCertificateConfigNParent.GetAllCertificates(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProjectConfigCertificatesResolver]Error getting Certificates %s", err) + return vGlobalCertificateConfigNList, nil + } + for _, i := range vCertificateConfigNAllObj { + vCertificateConfigNParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigCertificatesResolver]Error getting parent node %s, skipping...", err) + continue + } + vCertificateConfigN, err := vCertificateConfigNParent.GetCertificates(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalProjectConfigCertificatesResolver]Error getting Certificates node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vCertificateConfigN.DisplayName() +parentLabels := map[string]interface{}{"certificateconfigns.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vCertificateConfigN.Spec.ProjectId) +vBeginsOn := string(vCertificateConfigN.Spec.BeginsOn) +vExpiresOn := string(vCertificateConfigN.Spec.ExpiresOn) +vIssuedToCN := string(vCertificateConfigN.Spec.IssuedToCN) +vConfig := string(vCertificateConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCertificateConfigN { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + BeginsOn: &vBeginsOn, + ExpiresOn: &vExpiresOn, + IssuedToCN: &vIssuedToCN, + Config: &vConfig, + } + vGlobalCertificateConfigNList = append(vGlobalCertificateConfigNList, ret) + } + log.Debugf("[getGlobalProjectConfigCertificatesResolver]List of Certificates object %v", vGlobalCertificateConfigNList) + return vGlobalCertificateConfigNList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ExternalAccounts Node: ProjectConfig PKG: Global +////////////////////////////////////// +func getGlobalProjectConfigExternalAccountsResolver(obj *model.GlobalProjectConfig, id *string) ([]*model.GlobalExternalAccountConfigN, error) { + log.Debugf("[getGlobalProjectConfigExternalAccountsResolver]Parent Object %+v", obj) + var vGlobalExternalAccountConfigNList []*model.GlobalExternalAccountConfigN + if id != nil && *id != "" { + log.Debugf("[getGlobalProjectConfigExternalAccountsResolver]Id %q", *id) + vExternalAccountConfigNParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigExternalAccountsResolver]Error getting ExternalAccounts %q : %s", *id, err) + return vGlobalExternalAccountConfigNList, nil + } + vExternalAccountConfigN, err := vExternalAccountConfigNParent.GetExternalAccounts(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProjectConfigExternalAccountsResolver]Error getting ExternalAccounts %q : %s", *id, err) + return vGlobalExternalAccountConfigNList, nil + } + dn := vExternalAccountConfigN.DisplayName() +parentLabels := map[string]interface{}{"externalaccountconfigns.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vExternalAccountConfigN.Spec.Config) +vProxyConfig := string(vExternalAccountConfigN.Spec.ProxyConfig) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalAccountConfigN { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + ProxyConfig: &vProxyConfig, + } + vGlobalExternalAccountConfigNList = append(vGlobalExternalAccountConfigNList, ret) + + log.Debugf("[getGlobalProjectConfigExternalAccountsResolver]Output ExternalAccounts objects %v", vGlobalExternalAccountConfigNList) + + return vGlobalExternalAccountConfigNList, nil + } + + log.Debug("[getGlobalProjectConfigExternalAccountsResolver]Id is empty, process all ExternalAccountss") + + vExternalAccountConfigNParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigExternalAccountsResolver]Error getting parent node %s", err) + return vGlobalExternalAccountConfigNList, nil + } + vExternalAccountConfigNAllObj, err := vExternalAccountConfigNParent.GetAllExternalAccounts(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProjectConfigExternalAccountsResolver]Error getting ExternalAccounts %s", err) + return vGlobalExternalAccountConfigNList, nil + } + for _, i := range vExternalAccountConfigNAllObj { + vExternalAccountConfigNParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigExternalAccountsResolver]Error getting parent node %s, skipping...", err) + continue + } + vExternalAccountConfigN, err := vExternalAccountConfigNParent.GetExternalAccounts(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalProjectConfigExternalAccountsResolver]Error getting ExternalAccounts node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vExternalAccountConfigN.DisplayName() +parentLabels := map[string]interface{}{"externalaccountconfigns.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vExternalAccountConfigN.Spec.Config) +vProxyConfig := string(vExternalAccountConfigN.Spec.ProxyConfig) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalAccountConfigN { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + ProxyConfig: &vProxyConfig, + } + vGlobalExternalAccountConfigNList = append(vGlobalExternalAccountConfigNList, ret) + } + log.Debugf("[getGlobalProjectConfigExternalAccountsResolver]List of ExternalAccounts object %v", vGlobalExternalAccountConfigNList) + return vGlobalExternalAccountConfigNList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ExternalDNS Node: ProjectConfig PKG: Global +////////////////////////////////////// +func getGlobalProjectConfigExternalDNSResolver(obj *model.GlobalProjectConfig, id *string) ([]*model.GlobalExternalDNSConfigN, error) { + log.Debugf("[getGlobalProjectConfigExternalDNSResolver]Parent Object %+v", obj) + var vGlobalExternalDNSConfigNList []*model.GlobalExternalDNSConfigN + if id != nil && *id != "" { + log.Debugf("[getGlobalProjectConfigExternalDNSResolver]Id %q", *id) + vExternalDNSConfigNParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigExternalDNSResolver]Error getting ExternalDNS %q : %s", *id, err) + return vGlobalExternalDNSConfigNList, nil + } + vExternalDNSConfigN, err := vExternalDNSConfigNParent.GetExternalDNS(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProjectConfigExternalDNSResolver]Error getting ExternalDNS %q : %s", *id, err) + return vGlobalExternalDNSConfigNList, nil + } + dn := vExternalDNSConfigN.DisplayName() +parentLabels := map[string]interface{}{"externaldnsconfigns.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vExternalDNSConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSConfigN { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + } + vGlobalExternalDNSConfigNList = append(vGlobalExternalDNSConfigNList, ret) + + log.Debugf("[getGlobalProjectConfigExternalDNSResolver]Output ExternalDNS objects %v", vGlobalExternalDNSConfigNList) + + return vGlobalExternalDNSConfigNList, nil + } + + log.Debug("[getGlobalProjectConfigExternalDNSResolver]Id is empty, process all ExternalDNSs") + + vExternalDNSConfigNParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigExternalDNSResolver]Error getting parent node %s", err) + return vGlobalExternalDNSConfigNList, nil + } + vExternalDNSConfigNAllObj, err := vExternalDNSConfigNParent.GetAllExternalDNS(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProjectConfigExternalDNSResolver]Error getting ExternalDNS %s", err) + return vGlobalExternalDNSConfigNList, nil + } + for _, i := range vExternalDNSConfigNAllObj { + vExternalDNSConfigNParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigExternalDNSResolver]Error getting parent node %s, skipping...", err) + continue + } + vExternalDNSConfigN, err := vExternalDNSConfigNParent.GetExternalDNS(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalProjectConfigExternalDNSResolver]Error getting ExternalDNS node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vExternalDNSConfigN.DisplayName() +parentLabels := map[string]interface{}{"externaldnsconfigns.global.tsm.tanzu.vmware.com":dn} +vConfig := string(vExternalDNSConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSConfigN { + Id: &dn, + ParentLabels: parentLabels, + Config: &vConfig, + } + vGlobalExternalDNSConfigNList = append(vGlobalExternalDNSConfigNList, ret) + } + log.Debugf("[getGlobalProjectConfigExternalDNSResolver]List of ExternalDNS object %v", vGlobalExternalDNSConfigNList) + return vGlobalExternalDNSConfigNList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Autoscalers Node: ProjectConfig PKG: Global +////////////////////////////////////// +func getGlobalProjectConfigAutoscalersResolver(obj *model.GlobalProjectConfig, id *string) ([]*model.GlobalAutoscaler, error) { + log.Debugf("[getGlobalProjectConfigAutoscalersResolver]Parent Object %+v", obj) + var vGlobalAutoscalerList []*model.GlobalAutoscaler + if id != nil && *id != "" { + log.Debugf("[getGlobalProjectConfigAutoscalersResolver]Id %q", *id) + vAutoscalerParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigAutoscalersResolver]Error getting Autoscalers %q : %s", *id, err) + return vGlobalAutoscalerList, nil + } + vAutoscaler, err := vAutoscalerParent.GetAutoscalers(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProjectConfigAutoscalersResolver]Error getting Autoscalers %q : %s", *id, err) + return vGlobalAutoscalerList, nil + } + dn := vAutoscaler.DisplayName() +parentLabels := map[string]interface{}{"autoscalers.global.tsm.tanzu.vmware.com":dn} +vName := string(vAutoscaler.Spec.Name) +vProjectId := string(vAutoscaler.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAutoscaler { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + ProjectId: &vProjectId, + } + vGlobalAutoscalerList = append(vGlobalAutoscalerList, ret) + + log.Debugf("[getGlobalProjectConfigAutoscalersResolver]Output Autoscalers objects %v", vGlobalAutoscalerList) + + return vGlobalAutoscalerList, nil + } + + log.Debug("[getGlobalProjectConfigAutoscalersResolver]Id is empty, process all Autoscalerss") + + vAutoscalerParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigAutoscalersResolver]Error getting parent node %s", err) + return vGlobalAutoscalerList, nil + } + vAutoscalerAllObj, err := vAutoscalerParent.GetAllAutoscalers(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProjectConfigAutoscalersResolver]Error getting Autoscalers %s", err) + return vGlobalAutoscalerList, nil + } + for _, i := range vAutoscalerAllObj { + vAutoscalerParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigAutoscalersResolver]Error getting parent node %s, skipping...", err) + continue + } + vAutoscaler, err := vAutoscalerParent.GetAutoscalers(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalProjectConfigAutoscalersResolver]Error getting Autoscalers node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vAutoscaler.DisplayName() +parentLabels := map[string]interface{}{"autoscalers.global.tsm.tanzu.vmware.com":dn} +vName := string(vAutoscaler.Spec.Name) +vProjectId := string(vAutoscaler.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAutoscaler { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + ProjectId: &vProjectId, + } + vGlobalAutoscalerList = append(vGlobalAutoscalerList, ret) + } + log.Debugf("[getGlobalProjectConfigAutoscalersResolver]List of Autoscalers object %v", vGlobalAutoscalerList) + return vGlobalAutoscalerList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Clusters Node: ProjectConfig PKG: Global +////////////////////////////////////// +func getGlobalProjectConfigClustersResolver(obj *model.GlobalProjectConfig, id *string) ([]*model.GlobalClusterSettings, error) { + log.Debugf("[getGlobalProjectConfigClustersResolver]Parent Object %+v", obj) + var vGlobalClusterSettingsList []*model.GlobalClusterSettings + if id != nil && *id != "" { + log.Debugf("[getGlobalProjectConfigClustersResolver]Id %q", *id) + vClusterSettingsParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigClustersResolver]Error getting Clusters %q : %s", *id, err) + return vGlobalClusterSettingsList, nil + } + vClusterSettings, err := vClusterSettingsParent.GetClusters(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProjectConfigClustersResolver]Error getting Clusters %q : %s", *id, err) + return vGlobalClusterSettingsList, nil + } + dn := vClusterSettings.DisplayName() +parentLabels := map[string]interface{}{"clustersettingses.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vClusterSettings.Spec.ProjectId) +vDisplayName := string(vClusterSettings.Spec.DisplayName) +vDescription := string(vClusterSettings.Spec.Description) +vTags := string(vClusterSettings.Spec.Tags) +vLabels := string(vClusterSettings.Spec.Labels) +vAutoInstallServiceMesh := bool(vClusterSettings.Spec.AutoInstallServiceMesh) +vEnableNamespaceExclusions := bool(vClusterSettings.Spec.EnableNamespaceExclusions) +vNamespaceExclusions := string(vClusterSettings.Spec.NamespaceExclusions) +vSystemNamespaceExclusions := string(vClusterSettings.Spec.SystemNamespaceExclusions) +vAgentDomain := string(vClusterSettings.Spec.AgentDomain) +vProxyConfig := string(vClusterSettings.Spec.ProxyConfig) +vAutoInstallServiceMeshConfig := string(vClusterSettings.Spec.AutoInstallServiceMeshConfig) +vRegistryAccount := string(vClusterSettings.Spec.RegistryAccount) +vCaLabels := string(vClusterSettings.Spec.CaLabels) +vEnableInternalGateway := bool(vClusterSettings.Spec.EnableInternalGateway) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalClusterSettings { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + DisplayName: &vDisplayName, + Description: &vDescription, + Tags: &vTags, + Labels: &vLabels, + AutoInstallServiceMesh: &vAutoInstallServiceMesh, + EnableNamespaceExclusions: &vEnableNamespaceExclusions, + NamespaceExclusions: &vNamespaceExclusions, + SystemNamespaceExclusions: &vSystemNamespaceExclusions, + AgentDomain: &vAgentDomain, + ProxyConfig: &vProxyConfig, + AutoInstallServiceMeshConfig: &vAutoInstallServiceMeshConfig, + RegistryAccount: &vRegistryAccount, + CaLabels: &vCaLabels, + EnableInternalGateway: &vEnableInternalGateway, + } + vGlobalClusterSettingsList = append(vGlobalClusterSettingsList, ret) + + log.Debugf("[getGlobalProjectConfigClustersResolver]Output Clusters objects %v", vGlobalClusterSettingsList) + + return vGlobalClusterSettingsList, nil + } + + log.Debug("[getGlobalProjectConfigClustersResolver]Id is empty, process all Clusterss") + + vClusterSettingsParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigClustersResolver]Error getting parent node %s", err) + return vGlobalClusterSettingsList, nil + } + vClusterSettingsAllObj, err := vClusterSettingsParent.GetAllClusters(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProjectConfigClustersResolver]Error getting Clusters %s", err) + return vGlobalClusterSettingsList, nil + } + for _, i := range vClusterSettingsAllObj { + vClusterSettingsParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigClustersResolver]Error getting parent node %s, skipping...", err) + continue + } + vClusterSettings, err := vClusterSettingsParent.GetClusters(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalProjectConfigClustersResolver]Error getting Clusters node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vClusterSettings.DisplayName() +parentLabels := map[string]interface{}{"clustersettingses.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vClusterSettings.Spec.ProjectId) +vDisplayName := string(vClusterSettings.Spec.DisplayName) +vDescription := string(vClusterSettings.Spec.Description) +vTags := string(vClusterSettings.Spec.Tags) +vLabels := string(vClusterSettings.Spec.Labels) +vAutoInstallServiceMesh := bool(vClusterSettings.Spec.AutoInstallServiceMesh) +vEnableNamespaceExclusions := bool(vClusterSettings.Spec.EnableNamespaceExclusions) +vNamespaceExclusions := string(vClusterSettings.Spec.NamespaceExclusions) +vSystemNamespaceExclusions := string(vClusterSettings.Spec.SystemNamespaceExclusions) +vAgentDomain := string(vClusterSettings.Spec.AgentDomain) +vProxyConfig := string(vClusterSettings.Spec.ProxyConfig) +vAutoInstallServiceMeshConfig := string(vClusterSettings.Spec.AutoInstallServiceMeshConfig) +vRegistryAccount := string(vClusterSettings.Spec.RegistryAccount) +vCaLabels := string(vClusterSettings.Spec.CaLabels) +vEnableInternalGateway := bool(vClusterSettings.Spec.EnableInternalGateway) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalClusterSettings { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + DisplayName: &vDisplayName, + Description: &vDescription, + Tags: &vTags, + Labels: &vLabels, + AutoInstallServiceMesh: &vAutoInstallServiceMesh, + EnableNamespaceExclusions: &vEnableNamespaceExclusions, + NamespaceExclusions: &vNamespaceExclusions, + SystemNamespaceExclusions: &vSystemNamespaceExclusions, + AgentDomain: &vAgentDomain, + ProxyConfig: &vProxyConfig, + AutoInstallServiceMeshConfig: &vAutoInstallServiceMeshConfig, + RegistryAccount: &vRegistryAccount, + CaLabels: &vCaLabels, + EnableInternalGateway: &vEnableInternalGateway, + } + vGlobalClusterSettingsList = append(vGlobalClusterSettingsList, ret) + } + log.Debugf("[getGlobalProjectConfigClustersResolver]List of Clusters object %v", vGlobalClusterSettingsList) + return vGlobalClusterSettingsList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceLevelObjectives Node: ProjectConfig PKG: Global +////////////////////////////////////// +func getGlobalProjectConfigServiceLevelObjectivesResolver(obj *model.GlobalProjectConfig, id *string) ([]*model.GlobalServiceLevelObjective, error) { + log.Debugf("[getGlobalProjectConfigServiceLevelObjectivesResolver]Parent Object %+v", obj) + var vGlobalServiceLevelObjectiveList []*model.GlobalServiceLevelObjective + if id != nil && *id != "" { + log.Debugf("[getGlobalProjectConfigServiceLevelObjectivesResolver]Id %q", *id) + vServiceLevelObjectiveParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigServiceLevelObjectivesResolver]Error getting ServiceLevelObjectives %q : %s", *id, err) + return vGlobalServiceLevelObjectiveList, nil + } + vServiceLevelObjective, err := vServiceLevelObjectiveParent.GetServiceLevelObjectives(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProjectConfigServiceLevelObjectivesResolver]Error getting ServiceLevelObjectives %q : %s", *id, err) + return vGlobalServiceLevelObjectiveList, nil + } + dn := vServiceLevelObjective.DisplayName() +parentLabels := map[string]interface{}{"servicelevelobjectives.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vServiceLevelObjective.Spec.ProjectId) +vDisabled := bool(vServiceLevelObjective.Spec.Disabled) +vDescription := string(vServiceLevelObjective.Spec.Description) +vLabels := string(vServiceLevelObjective.Spec.Labels) +vSlis := string(vServiceLevelObjective.Spec.Slis) +vSloServices := string(vServiceLevelObjective.Spec.SloServices) +vSloTargetValue := string(vServiceLevelObjective.Spec.SloTargetValue) +vSloPeriod := string(vServiceLevelObjective.Spec.SloPeriod) +vSloCreationTime := string(vServiceLevelObjective.Spec.SloCreationTime) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceLevelObjective { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + Disabled: &vDisabled, + Description: &vDescription, + Labels: &vLabels, + Slis: &vSlis, + SloServices: &vSloServices, + SloTargetValue: &vSloTargetValue, + SloPeriod: &vSloPeriod, + SloCreationTime: &vSloCreationTime, + } + vGlobalServiceLevelObjectiveList = append(vGlobalServiceLevelObjectiveList, ret) + + log.Debugf("[getGlobalProjectConfigServiceLevelObjectivesResolver]Output ServiceLevelObjectives objects %v", vGlobalServiceLevelObjectiveList) + + return vGlobalServiceLevelObjectiveList, nil + } + + log.Debug("[getGlobalProjectConfigServiceLevelObjectivesResolver]Id is empty, process all ServiceLevelObjectivess") + + vServiceLevelObjectiveParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigServiceLevelObjectivesResolver]Error getting parent node %s", err) + return vGlobalServiceLevelObjectiveList, nil + } + vServiceLevelObjectiveAllObj, err := vServiceLevelObjectiveParent.GetAllServiceLevelObjectives(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProjectConfigServiceLevelObjectivesResolver]Error getting ServiceLevelObjectives %s", err) + return vGlobalServiceLevelObjectiveList, nil + } + for _, i := range vServiceLevelObjectiveAllObj { + vServiceLevelObjectiveParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), getParentName(obj.ParentLabels, "projectconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigServiceLevelObjectivesResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceLevelObjective, err := vServiceLevelObjectiveParent.GetServiceLevelObjectives(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalProjectConfigServiceLevelObjectivesResolver]Error getting ServiceLevelObjectives node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceLevelObjective.DisplayName() +parentLabels := map[string]interface{}{"servicelevelobjectives.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vServiceLevelObjective.Spec.ProjectId) +vDisabled := bool(vServiceLevelObjective.Spec.Disabled) +vDescription := string(vServiceLevelObjective.Spec.Description) +vLabels := string(vServiceLevelObjective.Spec.Labels) +vSlis := string(vServiceLevelObjective.Spec.Slis) +vSloServices := string(vServiceLevelObjective.Spec.SloServices) +vSloTargetValue := string(vServiceLevelObjective.Spec.SloTargetValue) +vSloPeriod := string(vServiceLevelObjective.Spec.SloPeriod) +vSloCreationTime := string(vServiceLevelObjective.Spec.SloCreationTime) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceLevelObjective { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + Disabled: &vDisabled, + Description: &vDescription, + Labels: &vLabels, + Slis: &vSlis, + SloServices: &vSloServices, + SloTargetValue: &vSloTargetValue, + SloPeriod: &vSloPeriod, + SloCreationTime: &vSloCreationTime, + } + vGlobalServiceLevelObjectiveList = append(vGlobalServiceLevelObjectiveList, ret) + } + log.Debugf("[getGlobalProjectConfigServiceLevelObjectivesResolver]List of ServiceLevelObjectives object %v", vGlobalServiceLevelObjectiveList) + return vGlobalServiceLevelObjectiveList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Clusters Node: ProjectInventory PKG: Global +////////////////////////////////////// +func getGlobalProjectInventoryClustersResolver(obj *model.GlobalProjectInventory, id *string) ([]*model.GlobalCluster, error) { + log.Debugf("[getGlobalProjectInventoryClustersResolver]Parent Object %+v", obj) + var vGlobalClusterList []*model.GlobalCluster + if id != nil && *id != "" { + log.Debugf("[getGlobalProjectInventoryClustersResolver]Id %q", *id) + vClusterParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetInventory(context.TODO(), getParentName(obj.ParentLabels, "projectinventories.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectInventoryClustersResolver]Error getting Clusters %q : %s", *id, err) + return vGlobalClusterList, nil + } + vCluster, err := vClusterParent.GetClusters(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProjectInventoryClustersResolver]Error getting Clusters %q : %s", *id, err) + return vGlobalClusterList, nil + } + dn := vCluster.DisplayName() +parentLabels := map[string]interface{}{"clusters.global.tsm.tanzu.vmware.com":dn} +vName := string(vCluster.Spec.Name) +vUuid := string(vCluster.Spec.Uuid) +vConnected := bool(vCluster.Spec.Connected) +vIstioState := string(vCluster.Spec.IstioState) +vStatus := string(vCluster.Spec.Status) +vStatusHistory := string(vCluster.Spec.StatusHistory) +vCastatus := string(vCluster.Spec.Castatus) +vCaStatusHistory := string(vCluster.Spec.CaStatusHistory) +vComponentStatuses := string(vCluster.Spec.ComponentStatuses) +vComponentStatusesHistory := string(vCluster.Spec.ComponentStatusesHistory) +vType := string(vCluster.Spec.Type) +vProjectId := string(vCluster.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCluster { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Uuid: &vUuid, + Connected: &vConnected, + IstioState: &vIstioState, + Status: &vStatus, + StatusHistory: &vStatusHistory, + Castatus: &vCastatus, + CaStatusHistory: &vCaStatusHistory, + ComponentStatuses: &vComponentStatuses, + ComponentStatusesHistory: &vComponentStatusesHistory, + Type: &vType, + ProjectId: &vProjectId, + } + vGlobalClusterList = append(vGlobalClusterList, ret) + + log.Debugf("[getGlobalProjectInventoryClustersResolver]Output Clusters objects %v", vGlobalClusterList) + + return vGlobalClusterList, nil + } + + log.Debug("[getGlobalProjectInventoryClustersResolver]Id is empty, process all Clusterss") + + vClusterParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetInventory(context.TODO(), getParentName(obj.ParentLabels, "projectinventories.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectInventoryClustersResolver]Error getting parent node %s", err) + return vGlobalClusterList, nil + } + vClusterAllObj, err := vClusterParent.GetAllClusters(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProjectInventoryClustersResolver]Error getting Clusters %s", err) + return vGlobalClusterList, nil + } + for _, i := range vClusterAllObj { + vClusterParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetInventory(context.TODO(), getParentName(obj.ParentLabels, "projectinventories.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectInventoryClustersResolver]Error getting parent node %s, skipping...", err) + continue + } + vCluster, err := vClusterParent.GetClusters(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalProjectInventoryClustersResolver]Error getting Clusters node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vCluster.DisplayName() +parentLabels := map[string]interface{}{"clusters.global.tsm.tanzu.vmware.com":dn} +vName := string(vCluster.Spec.Name) +vUuid := string(vCluster.Spec.Uuid) +vConnected := bool(vCluster.Spec.Connected) +vIstioState := string(vCluster.Spec.IstioState) +vStatus := string(vCluster.Spec.Status) +vStatusHistory := string(vCluster.Spec.StatusHistory) +vCastatus := string(vCluster.Spec.Castatus) +vCaStatusHistory := string(vCluster.Spec.CaStatusHistory) +vComponentStatuses := string(vCluster.Spec.ComponentStatuses) +vComponentStatusesHistory := string(vCluster.Spec.ComponentStatusesHistory) +vType := string(vCluster.Spec.Type) +vProjectId := string(vCluster.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalCluster { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Uuid: &vUuid, + Connected: &vConnected, + IstioState: &vIstioState, + Status: &vStatus, + StatusHistory: &vStatusHistory, + Castatus: &vCastatus, + CaStatusHistory: &vCaStatusHistory, + ComponentStatuses: &vComponentStatuses, + ComponentStatusesHistory: &vComponentStatusesHistory, + Type: &vType, + ProjectId: &vProjectId, + } + vGlobalClusterList = append(vGlobalClusterList, ret) + } + log.Debugf("[getGlobalProjectInventoryClustersResolver]List of Clusters object %v", vGlobalClusterList) + return vGlobalClusterList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ExternalDNS Node: ProjectInventory PKG: Global +////////////////////////////////////// +func getGlobalProjectInventoryExternalDNSResolver(obj *model.GlobalProjectInventory, id *string) ([]*model.GlobalExternalDNSInventory, error) { + log.Debugf("[getGlobalProjectInventoryExternalDNSResolver]Parent Object %+v", obj) + var vGlobalExternalDNSInventoryList []*model.GlobalExternalDNSInventory + if id != nil && *id != "" { + log.Debugf("[getGlobalProjectInventoryExternalDNSResolver]Id %q", *id) + vExternalDNSInventoryParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetInventory(context.TODO(), getParentName(obj.ParentLabels, "projectinventories.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectInventoryExternalDNSResolver]Error getting ExternalDNS %q : %s", *id, err) + return vGlobalExternalDNSInventoryList, nil + } + vExternalDNSInventory, err := vExternalDNSInventoryParent.GetExternalDNS(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProjectInventoryExternalDNSResolver]Error getting ExternalDNS %q : %s", *id, err) + return vGlobalExternalDNSInventoryList, nil + } + dn := vExternalDNSInventory.DisplayName() +parentLabels := map[string]interface{}{"externaldnsinventories.global.tsm.tanzu.vmware.com":dn} +EnabledForProjects, _ := json.Marshal(vExternalDNSInventory.Spec.EnabledForProjects) +EnabledForProjectsData := string(EnabledForProjects) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSInventory { + Id: &dn, + ParentLabels: parentLabels, + EnabledForProjects: &EnabledForProjectsData, + } + vGlobalExternalDNSInventoryList = append(vGlobalExternalDNSInventoryList, ret) + + log.Debugf("[getGlobalProjectInventoryExternalDNSResolver]Output ExternalDNS objects %v", vGlobalExternalDNSInventoryList) + + return vGlobalExternalDNSInventoryList, nil + } + + log.Debug("[getGlobalProjectInventoryExternalDNSResolver]Id is empty, process all ExternalDNSs") + + vExternalDNSInventoryParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetInventory(context.TODO(), getParentName(obj.ParentLabels, "projectinventories.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectInventoryExternalDNSResolver]Error getting parent node %s", err) + return vGlobalExternalDNSInventoryList, nil + } + vExternalDNSInventoryAllObj, err := vExternalDNSInventoryParent.GetAllExternalDNS(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProjectInventoryExternalDNSResolver]Error getting ExternalDNS %s", err) + return vGlobalExternalDNSInventoryList, nil + } + for _, i := range vExternalDNSInventoryAllObj { + vExternalDNSInventoryParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetInventory(context.TODO(), getParentName(obj.ParentLabels, "projectinventories.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectInventoryExternalDNSResolver]Error getting parent node %s, skipping...", err) + continue + } + vExternalDNSInventory, err := vExternalDNSInventoryParent.GetExternalDNS(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalProjectInventoryExternalDNSResolver]Error getting ExternalDNS node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vExternalDNSInventory.DisplayName() +parentLabels := map[string]interface{}{"externaldnsinventories.global.tsm.tanzu.vmware.com":dn} +EnabledForProjects, _ := json.Marshal(vExternalDNSInventory.Spec.EnabledForProjects) +EnabledForProjectsData := string(EnabledForProjects) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSInventory { + Id: &dn, + ParentLabels: parentLabels, + EnabledForProjects: &EnabledForProjectsData, + } + vGlobalExternalDNSInventoryList = append(vGlobalExternalDNSInventoryList, ret) + } + log.Debugf("[getGlobalProjectInventoryExternalDNSResolver]List of ExternalDNS object %v", vGlobalExternalDNSInventoryList) + return vGlobalExternalDNSInventoryList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Jobs Node: ProjectInventory PKG: Global +////////////////////////////////////// +func getGlobalProjectInventoryJobsResolver(obj *model.GlobalProjectInventory, id *string) ([]*model.GlobalJob, error) { + log.Debugf("[getGlobalProjectInventoryJobsResolver]Parent Object %+v", obj) + var vGlobalJobList []*model.GlobalJob + if id != nil && *id != "" { + log.Debugf("[getGlobalProjectInventoryJobsResolver]Id %q", *id) + vJobParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetInventory(context.TODO(), getParentName(obj.ParentLabels, "projectinventories.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectInventoryJobsResolver]Error getting Jobs %q : %s", *id, err) + return vGlobalJobList, nil + } + vJob, err := vJobParent.GetJobs(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProjectInventoryJobsResolver]Error getting Jobs %q : %s", *id, err) + return vGlobalJobList, nil + } + dn := vJob.DisplayName() +parentLabels := map[string]interface{}{"jobs.global.tsm.tanzu.vmware.com":dn} +vStatus := string(vJob.Spec.Status) +vProjectId := string(vJob.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalJob { + Id: &dn, + ParentLabels: parentLabels, + Status: &vStatus, + ProjectId: &vProjectId, + } + vGlobalJobList = append(vGlobalJobList, ret) + + log.Debugf("[getGlobalProjectInventoryJobsResolver]Output Jobs objects %v", vGlobalJobList) + + return vGlobalJobList, nil + } + + log.Debug("[getGlobalProjectInventoryJobsResolver]Id is empty, process all Jobss") + + vJobParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetInventory(context.TODO(), getParentName(obj.ParentLabels, "projectinventories.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectInventoryJobsResolver]Error getting parent node %s", err) + return vGlobalJobList, nil + } + vJobAllObj, err := vJobParent.GetAllJobs(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProjectInventoryJobsResolver]Error getting Jobs %s", err) + return vGlobalJobList, nil + } + for _, i := range vJobAllObj { + vJobParent, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetInventory(context.TODO(), getParentName(obj.ParentLabels, "projectinventories.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectInventoryJobsResolver]Error getting parent node %s, skipping...", err) + continue + } + vJob, err := vJobParent.GetJobs(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalProjectInventoryJobsResolver]Error getting Jobs node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vJob.DisplayName() +parentLabels := map[string]interface{}{"jobs.global.tsm.tanzu.vmware.com":dn} +vStatus := string(vJob.Spec.Status) +vProjectId := string(vJob.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalJob { + Id: &dn, + ParentLabels: parentLabels, + Status: &vStatus, + ProjectId: &vProjectId, + } + vGlobalJobList = append(vGlobalJobList, ret) + } + log.Debugf("[getGlobalProjectInventoryJobsResolver]List of Jobs object %v", vGlobalJobList) + return vGlobalJobList, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: Config Node: Project PKG: Global +////////////////////////////////////// +func getGlobalProjectConfigResolver(obj *model.GlobalProject, id *string) (*model.GlobalProjectConfig, error) { + log.Debugf("[getGlobalProjectConfigResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalProjectConfigResolver]Id %q", *id) + vProjectConfig, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetConfig(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProjectConfigResolver]Error getting Config node %q : %s", *id, err) + return &model.GlobalProjectConfig{}, nil + } + dn := vProjectConfig.DisplayName() +parentLabels := map[string]interface{}{"projectconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vProjectConfig.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalProjectConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + + log.Debugf("[getGlobalProjectConfigResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalProjectConfigResolver]Id is empty, process all Configs") + vProjectConfigParent, err := nc.GlobalRoot().Config().GetProjects(context.TODO(), getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectConfigResolver]Failed to get parent node %s", err) + return &model.GlobalProjectConfig{}, nil + } + vProjectConfig, err := vProjectConfigParent.GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProjectConfigResolver]Error getting Config node %s", err) + return &model.GlobalProjectConfig{}, nil + } + dn := vProjectConfig.DisplayName() +parentLabels := map[string]interface{}{"projectconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vProjectConfig.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalProjectConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + + log.Debugf("[getGlobalProjectConfigResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: Inventory Node: Project PKG: Global +////////////////////////////////////// +func getGlobalProjectInventoryResolver(obj *model.GlobalProject, id *string) (*model.GlobalProjectInventory, error) { + log.Debugf("[getGlobalProjectInventoryResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalProjectInventoryResolver]Id %q", *id) + vProjectInventory, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetInventory(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProjectInventoryResolver]Error getting Inventory node %q : %s", *id, err) + return &model.GlobalProjectInventory{}, nil + } + dn := vProjectInventory.DisplayName() +parentLabels := map[string]interface{}{"projectinventories.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalProjectInventory { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalProjectInventoryResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalProjectInventoryResolver]Id is empty, process all Inventorys") + vProjectInventoryParent, err := nc.GlobalRoot().Config().GetProjects(context.TODO(), getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectInventoryResolver]Failed to get parent node %s", err) + return &model.GlobalProjectInventory{}, nil + } + vProjectInventory, err := vProjectInventoryParent.GetInventory(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProjectInventoryResolver]Error getting Inventory node %s", err) + return &model.GlobalProjectInventory{}, nil + } + dn := vProjectInventory.DisplayName() +parentLabels := map[string]interface{}{"projectinventories.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalProjectInventory { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalProjectInventoryResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: Query Node: Project PKG: Global +////////////////////////////////////// +func getGlobalProjectQueryResolver(obj *model.GlobalProject, id *string) (*model.GlobalProjectQuery, error) { + log.Debugf("[getGlobalProjectQueryResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalProjectQueryResolver]Id %q", *id) + vProjectQuery, err := nc.GlobalRoot().Config().Projects(getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")).GetQuery(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalProjectQueryResolver]Error getting Query node %q : %s", *id, err) + return &model.GlobalProjectQuery{}, nil + } + dn := vProjectQuery.DisplayName() +parentLabels := map[string]interface{}{"projectqueries.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalProjectQuery { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalProjectQueryResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalProjectQueryResolver]Id is empty, process all Querys") + vProjectQueryParent, err := nc.GlobalRoot().Config().GetProjects(context.TODO(), getParentName(obj.ParentLabels, "projects.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalProjectQueryResolver]Failed to get parent node %s", err) + return &model.GlobalProjectQuery{}, nil + } + vProjectQuery, err := vProjectQueryParent.GetQuery(context.TODO()) + if err != nil { + log.Errorf("[getGlobalProjectQueryResolver]Error getting Query node %s", err) + return &model.GlobalProjectQuery{}, nil + } + dn := vProjectQuery.DisplayName() +parentLabels := map[string]interface{}{"projectqueries.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalProjectQuery { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalProjectQueryResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: SvcGroupRT Node: ResourceGroupRT PKG: Global +////////////////////////////////////// +func getGlobalResourceGroupRTSvcGroupRTResolver(obj *model.GlobalResourceGroupRT, id *string) ([]*model.GlobalSvcGroupRT, error) { + log.Debugf("[getGlobalResourceGroupRTSvcGroupRTResolver]Parent Object %+v", obj) + var vGlobalSvcGroupRTList []*model.GlobalSvcGroupRT + if id != nil && *id != "" { + log.Debugf("[getGlobalResourceGroupRTSvcGroupRTResolver]Id %q", *id) + vSvcGroupRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).ResourceGroup(getParentName(obj.ParentLabels, "resourcegrouprts.global.tsm.tanzu.vmware.com")).GetSvcGroupRT(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalResourceGroupRTSvcGroupRTResolver]Error getting SvcGroupRT node %q : %s", *id, err) + return vGlobalSvcGroupRTList, nil + } + dn := vSvcGroupRT.DisplayName() +parentLabels := map[string]interface{}{"svcgrouprts.global.tsm.tanzu.vmware.com":dn} +vName := string(vSvcGroupRT.Spec.Name) +vDisplayName := string(vSvcGroupRT.Spec.DisplayName) +vDescription := string(vSvcGroupRT.Spec.Description) +vServices := string(vSvcGroupRT.Spec.Services) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSvcGroupRT { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + DisplayName: &vDisplayName, + Description: &vDescription, + Services: &vServices, + } + vGlobalSvcGroupRTList = append(vGlobalSvcGroupRTList, ret) + + log.Debugf("[getGlobalResourceGroupRTSvcGroupRTResolver]Output SvcGroupRT objects %v", vGlobalSvcGroupRTList) + + return vGlobalSvcGroupRTList, nil + } + + log.Debug("[getGlobalResourceGroupRTSvcGroupRTResolver]Id is empty, process all SvcGroupRTs") + + vSvcGroupRTParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).GetResourceGroup(context.TODO(), getParentName(obj.ParentLabels, "resourcegrouprts.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalResourceGroupRTSvcGroupRTResolver]Error getting parent node %s", err) + return vGlobalSvcGroupRTList, nil + } + vSvcGroupRTAllObj, err := vSvcGroupRTParent.GetAllSvcGroupRT(context.TODO()) + if err != nil { + log.Errorf("[getGlobalResourceGroupRTSvcGroupRTResolver]Error getting SvcGroupRT objects %s", err) + return vGlobalSvcGroupRTList, nil + } + for _, i := range vSvcGroupRTAllObj { + vSvcGroupRT, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).ResourceGroup(getParentName(obj.ParentLabels, "resourcegrouprts.global.tsm.tanzu.vmware.com")).GetSvcGroupRT(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalResourceGroupRTSvcGroupRTResolver]Error getting SvcGroupRT node %q : %s", i.DisplayName(), err) + continue + } + dn := vSvcGroupRT.DisplayName() +parentLabels := map[string]interface{}{"svcgrouprts.global.tsm.tanzu.vmware.com":dn} +vName := string(vSvcGroupRT.Spec.Name) +vDisplayName := string(vSvcGroupRT.Spec.DisplayName) +vDescription := string(vSvcGroupRT.Spec.Description) +vServices := string(vSvcGroupRT.Spec.Services) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSvcGroupRT { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + DisplayName: &vDisplayName, + Description: &vDescription, + Services: &vServices, + } + vGlobalSvcGroupRTList = append(vGlobalSvcGroupRTList, ret) + } + + log.Debugf("[getGlobalResourceGroupRTSvcGroupRTResolver]Output SvcGroupRT objects %v", vGlobalSvcGroupRTList) + + return vGlobalSvcGroupRTList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: AppGroups Node: ResourceGroup PKG: Global +////////////////////////////////////// +func getGlobalResourceGroupAppGroupsResolver(obj *model.GlobalResourceGroup, id *string) ([]*model.GlobalAppGroup, error) { + log.Debugf("[getGlobalResourceGroupAppGroupsResolver]Parent Object %+v", obj) + var vGlobalAppGroupList []*model.GlobalAppGroup + if id != nil && *id != "" { + log.Debugf("[getGlobalResourceGroupAppGroupsResolver]Id %q", *id) + vAppGroup, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetAppGroups(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalResourceGroupAppGroupsResolver]Error getting AppGroups node %q : %s", *id, err) + return vGlobalAppGroupList, nil + } + dn := vAppGroup.DisplayName() +parentLabels := map[string]interface{}{"appgroups.global.tsm.tanzu.vmware.com":dn} +vRules := string(vAppGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAppGroup { + Id: &dn, + ParentLabels: parentLabels, + Rules: &vRules, + } + vGlobalAppGroupList = append(vGlobalAppGroupList, ret) + + log.Debugf("[getGlobalResourceGroupAppGroupsResolver]Output AppGroups objects %v", vGlobalAppGroupList) + + return vGlobalAppGroupList, nil + } + + log.Debug("[getGlobalResourceGroupAppGroupsResolver]Id is empty, process all AppGroupss") + + vAppGroupParent, err := nc.GlobalRoot().Config().GetResourceGroups(context.TODO(), getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalResourceGroupAppGroupsResolver]Error getting parent node %s", err) + return vGlobalAppGroupList, nil + } + vAppGroupAllObj, err := vAppGroupParent.GetAllAppGroups(context.TODO()) + if err != nil { + log.Errorf("[getGlobalResourceGroupAppGroupsResolver]Error getting AppGroups objects %s", err) + return vGlobalAppGroupList, nil + } + for _, i := range vAppGroupAllObj { + vAppGroup, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetAppGroups(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalResourceGroupAppGroupsResolver]Error getting AppGroups node %q : %s", i.DisplayName(), err) + continue + } + dn := vAppGroup.DisplayName() +parentLabels := map[string]interface{}{"appgroups.global.tsm.tanzu.vmware.com":dn} +vRules := string(vAppGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAppGroup { + Id: &dn, + ParentLabels: parentLabels, + Rules: &vRules, + } + vGlobalAppGroupList = append(vGlobalAppGroupList, ret) + } + + log.Debugf("[getGlobalResourceGroupAppGroupsResolver]Output AppGroups objects %v", vGlobalAppGroupList) + + return vGlobalAppGroupList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: SvcGroups Node: ResourceGroup PKG: Global +////////////////////////////////////// +func getGlobalResourceGroupSvcGroupsResolver(obj *model.GlobalResourceGroup, id *string) ([]*model.GlobalSvcGroup, error) { + log.Debugf("[getGlobalResourceGroupSvcGroupsResolver]Parent Object %+v", obj) + var vGlobalSvcGroupList []*model.GlobalSvcGroup + if id != nil && *id != "" { + log.Debugf("[getGlobalResourceGroupSvcGroupsResolver]Id %q", *id) + vSvcGroup, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetSvcGroups(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalResourceGroupSvcGroupsResolver]Error getting SvcGroups node %q : %s", *id, err) + return vGlobalSvcGroupList, nil + } + dn := vSvcGroup.DisplayName() +parentLabels := map[string]interface{}{"svcgroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vSvcGroup.Spec.DisplayName) +vInternalPredefinedGroup := bool(vSvcGroup.Spec.InternalPredefinedGroup) +vDescription := string(vSvcGroup.Spec.Description) +vColor := string(vSvcGroup.Spec.Color) +vProjectId := string(vSvcGroup.Spec.ProjectId) +vRules := string(vSvcGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSvcGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + InternalPredefinedGroup: &vInternalPredefinedGroup, + Description: &vDescription, + Color: &vColor, + ProjectId: &vProjectId, + Rules: &vRules, + } + vGlobalSvcGroupList = append(vGlobalSvcGroupList, ret) + + log.Debugf("[getGlobalResourceGroupSvcGroupsResolver]Output SvcGroups objects %v", vGlobalSvcGroupList) + + return vGlobalSvcGroupList, nil + } + + log.Debug("[getGlobalResourceGroupSvcGroupsResolver]Id is empty, process all SvcGroupss") + + vSvcGroupParent, err := nc.GlobalRoot().Config().GetResourceGroups(context.TODO(), getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalResourceGroupSvcGroupsResolver]Error getting parent node %s", err) + return vGlobalSvcGroupList, nil + } + vSvcGroupAllObj, err := vSvcGroupParent.GetAllSvcGroups(context.TODO()) + if err != nil { + log.Errorf("[getGlobalResourceGroupSvcGroupsResolver]Error getting SvcGroups objects %s", err) + return vGlobalSvcGroupList, nil + } + for _, i := range vSvcGroupAllObj { + vSvcGroup, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetSvcGroups(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalResourceGroupSvcGroupsResolver]Error getting SvcGroups node %q : %s", i.DisplayName(), err) + continue + } + dn := vSvcGroup.DisplayName() +parentLabels := map[string]interface{}{"svcgroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vSvcGroup.Spec.DisplayName) +vInternalPredefinedGroup := bool(vSvcGroup.Spec.InternalPredefinedGroup) +vDescription := string(vSvcGroup.Spec.Description) +vColor := string(vSvcGroup.Spec.Color) +vProjectId := string(vSvcGroup.Spec.ProjectId) +vRules := string(vSvcGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSvcGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + InternalPredefinedGroup: &vInternalPredefinedGroup, + Description: &vDescription, + Color: &vColor, + ProjectId: &vProjectId, + Rules: &vRules, + } + vGlobalSvcGroupList = append(vGlobalSvcGroupList, ret) + } + + log.Debugf("[getGlobalResourceGroupSvcGroupsResolver]Output SvcGroups objects %v", vGlobalSvcGroupList) + + return vGlobalSvcGroupList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: NodeGroups Node: ResourceGroup PKG: Global +////////////////////////////////////// +func getGlobalResourceGroupNodeGroupsResolver(obj *model.GlobalResourceGroup, id *string) ([]*model.GlobalNodeGroup, error) { + log.Debugf("[getGlobalResourceGroupNodeGroupsResolver]Parent Object %+v", obj) + var vGlobalNodeGroupList []*model.GlobalNodeGroup + if id != nil && *id != "" { + log.Debugf("[getGlobalResourceGroupNodeGroupsResolver]Id %q", *id) + vNodeGroup, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetNodeGroups(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalResourceGroupNodeGroupsResolver]Error getting NodeGroups node %q : %s", *id, err) + return vGlobalNodeGroupList, nil + } + dn := vNodeGroup.DisplayName() +parentLabels := map[string]interface{}{"nodegroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vNodeGroup.Spec.DisplayName) +vDescription := string(vNodeGroup.Spec.Description) +vScope := string(vNodeGroup.Spec.Scope) +vColor := string(vNodeGroup.Spec.Color) +vRules := string(vNodeGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNodeGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + Description: &vDescription, + Scope: &vScope, + Color: &vColor, + Rules: &vRules, + } + vGlobalNodeGroupList = append(vGlobalNodeGroupList, ret) + + log.Debugf("[getGlobalResourceGroupNodeGroupsResolver]Output NodeGroups objects %v", vGlobalNodeGroupList) + + return vGlobalNodeGroupList, nil + } + + log.Debug("[getGlobalResourceGroupNodeGroupsResolver]Id is empty, process all NodeGroupss") + + vNodeGroupParent, err := nc.GlobalRoot().Config().GetResourceGroups(context.TODO(), getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalResourceGroupNodeGroupsResolver]Error getting parent node %s", err) + return vGlobalNodeGroupList, nil + } + vNodeGroupAllObj, err := vNodeGroupParent.GetAllNodeGroups(context.TODO()) + if err != nil { + log.Errorf("[getGlobalResourceGroupNodeGroupsResolver]Error getting NodeGroups objects %s", err) + return vGlobalNodeGroupList, nil + } + for _, i := range vNodeGroupAllObj { + vNodeGroup, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetNodeGroups(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalResourceGroupNodeGroupsResolver]Error getting NodeGroups node %q : %s", i.DisplayName(), err) + continue + } + dn := vNodeGroup.DisplayName() +parentLabels := map[string]interface{}{"nodegroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vNodeGroup.Spec.DisplayName) +vDescription := string(vNodeGroup.Spec.Description) +vScope := string(vNodeGroup.Spec.Scope) +vColor := string(vNodeGroup.Spec.Color) +vRules := string(vNodeGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNodeGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + Description: &vDescription, + Scope: &vScope, + Color: &vColor, + Rules: &vRules, + } + vGlobalNodeGroupList = append(vGlobalNodeGroupList, ret) + } + + log.Debugf("[getGlobalResourceGroupNodeGroupsResolver]Output NodeGroups objects %v", vGlobalNodeGroupList) + + return vGlobalNodeGroupList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: DataGroups Node: ResourceGroup PKG: Global +////////////////////////////////////// +func getGlobalResourceGroupDataGroupsResolver(obj *model.GlobalResourceGroup, id *string) ([]*model.GlobalDataGroup, error) { + log.Debugf("[getGlobalResourceGroupDataGroupsResolver]Parent Object %+v", obj) + var vGlobalDataGroupList []*model.GlobalDataGroup + if id != nil && *id != "" { + log.Debugf("[getGlobalResourceGroupDataGroupsResolver]Id %q", *id) + vDataGroup, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetDataGroups(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalResourceGroupDataGroupsResolver]Error getting DataGroups node %q : %s", *id, err) + return vGlobalDataGroupList, nil + } + dn := vDataGroup.DisplayName() +parentLabels := map[string]interface{}{"datagroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vDataGroup.Spec.DisplayName) +vDescription := string(vDataGroup.Spec.Description) +vScope := string(vDataGroup.Spec.Scope) +vColor := string(vDataGroup.Spec.Color) +vRules := string(vDataGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDataGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + Description: &vDescription, + Scope: &vScope, + Color: &vColor, + Rules: &vRules, + } + vGlobalDataGroupList = append(vGlobalDataGroupList, ret) + + log.Debugf("[getGlobalResourceGroupDataGroupsResolver]Output DataGroups objects %v", vGlobalDataGroupList) + + return vGlobalDataGroupList, nil + } + + log.Debug("[getGlobalResourceGroupDataGroupsResolver]Id is empty, process all DataGroupss") + + vDataGroupParent, err := nc.GlobalRoot().Config().GetResourceGroups(context.TODO(), getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalResourceGroupDataGroupsResolver]Error getting parent node %s", err) + return vGlobalDataGroupList, nil + } + vDataGroupAllObj, err := vDataGroupParent.GetAllDataGroups(context.TODO()) + if err != nil { + log.Errorf("[getGlobalResourceGroupDataGroupsResolver]Error getting DataGroups objects %s", err) + return vGlobalDataGroupList, nil + } + for _, i := range vDataGroupAllObj { + vDataGroup, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetDataGroups(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalResourceGroupDataGroupsResolver]Error getting DataGroups node %q : %s", i.DisplayName(), err) + continue + } + dn := vDataGroup.DisplayName() +parentLabels := map[string]interface{}{"datagroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vDataGroup.Spec.DisplayName) +vDescription := string(vDataGroup.Spec.Description) +vScope := string(vDataGroup.Spec.Scope) +vColor := string(vDataGroup.Spec.Color) +vRules := string(vDataGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDataGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + Description: &vDescription, + Scope: &vScope, + Color: &vColor, + Rules: &vRules, + } + vGlobalDataGroupList = append(vGlobalDataGroupList, ret) + } + + log.Debugf("[getGlobalResourceGroupDataGroupsResolver]Output DataGroups objects %v", vGlobalDataGroupList) + + return vGlobalDataGroupList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: UserGroups Node: ResourceGroup PKG: Global +////////////////////////////////////// +func getGlobalResourceGroupUserGroupsResolver(obj *model.GlobalResourceGroup, id *string) ([]*model.GlobalUserGroup, error) { + log.Debugf("[getGlobalResourceGroupUserGroupsResolver]Parent Object %+v", obj) + var vGlobalUserGroupList []*model.GlobalUserGroup + if id != nil && *id != "" { + log.Debugf("[getGlobalResourceGroupUserGroupsResolver]Id %q", *id) + vUserGroup, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetUserGroups(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalResourceGroupUserGroupsResolver]Error getting UserGroups node %q : %s", *id, err) + return vGlobalUserGroupList, nil + } + dn := vUserGroup.DisplayName() +parentLabels := map[string]interface{}{"usergroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vUserGroup.Spec.DisplayName) +vDescription := string(vUserGroup.Spec.Description) +vScope := string(vUserGroup.Spec.Scope) +vColor := string(vUserGroup.Spec.Color) +vRules := string(vUserGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalUserGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + Description: &vDescription, + Scope: &vScope, + Color: &vColor, + Rules: &vRules, + } + vGlobalUserGroupList = append(vGlobalUserGroupList, ret) + + log.Debugf("[getGlobalResourceGroupUserGroupsResolver]Output UserGroups objects %v", vGlobalUserGroupList) + + return vGlobalUserGroupList, nil + } + + log.Debug("[getGlobalResourceGroupUserGroupsResolver]Id is empty, process all UserGroupss") + + vUserGroupParent, err := nc.GlobalRoot().Config().GetResourceGroups(context.TODO(), getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalResourceGroupUserGroupsResolver]Error getting parent node %s", err) + return vGlobalUserGroupList, nil + } + vUserGroupAllObj, err := vUserGroupParent.GetAllUserGroups(context.TODO()) + if err != nil { + log.Errorf("[getGlobalResourceGroupUserGroupsResolver]Error getting UserGroups objects %s", err) + return vGlobalUserGroupList, nil + } + for _, i := range vUserGroupAllObj { + vUserGroup, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetUserGroups(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalResourceGroupUserGroupsResolver]Error getting UserGroups node %q : %s", i.DisplayName(), err) + continue + } + dn := vUserGroup.DisplayName() +parentLabels := map[string]interface{}{"usergroups.global.tsm.tanzu.vmware.com":dn} +vDisplayName := string(vUserGroup.Spec.DisplayName) +vDescription := string(vUserGroup.Spec.Description) +vScope := string(vUserGroup.Spec.Scope) +vColor := string(vUserGroup.Spec.Color) +vRules := string(vUserGroup.Spec.Rules) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalUserGroup { + Id: &dn, + ParentLabels: parentLabels, + DisplayName: &vDisplayName, + Description: &vDescription, + Scope: &vScope, + Color: &vColor, + Rules: &vRules, + } + vGlobalUserGroupList = append(vGlobalUserGroupList, ret) + } + + log.Debugf("[getGlobalResourceGroupUserGroupsResolver]Output UserGroups objects %v", vGlobalUserGroupList) + + return vGlobalUserGroupList, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Singleton) +// FieldName: Config Node: Root PKG: Global +////////////////////////////////////// +func getGlobalRootConfigResolver(obj *model.GlobalRoot) (*model.GlobalConfig, error) { + log.Debugf("[getGlobalRootConfigResolver]Parent Object %+v", obj) + vConfig, err := nc.GlobalRoot().GetConfig(context.TODO()) + if err != nil { + log.Errorf("[getGlobalRootConfigResolver]Error getting Root node %s", err) + return &model.GlobalConfig{}, nil + } + dn := vConfig.DisplayName() +parentLabels := map[string]interface{}{"configs.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalConfig { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalRootConfigResolver]Output object %+v", ret) + return ret, nil +} +////////////////////////////////////// +// CHILD RESOLVER (Singleton) +// FieldName: Inventory Node: Root PKG: Global +////////////////////////////////////// +func getGlobalRootInventoryResolver(obj *model.GlobalRoot) (*model.GlobalInventory, error) { + log.Debugf("[getGlobalRootInventoryResolver]Parent Object %+v", obj) + vInventory, err := nc.GlobalRoot().GetInventory(context.TODO()) + if err != nil { + log.Errorf("[getGlobalRootInventoryResolver]Error getting Root node %s", err) + return &model.GlobalInventory{}, nil + } + dn := vInventory.DisplayName() +parentLabels := map[string]interface{}{"inventories.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalInventory { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalRootInventoryResolver]Output object %+v", ret) + return ret, nil +} +////////////////////////////////////// +// CHILD RESOLVER (Singleton) +// FieldName: Runtime Node: Root PKG: Global +////////////////////////////////////// +func getGlobalRootRuntimeResolver(obj *model.GlobalRoot) (*model.GlobalRuntime, error) { + log.Debugf("[getGlobalRootRuntimeResolver]Parent Object %+v", obj) + vRuntime, err := nc.GlobalRoot().GetRuntime(context.TODO()) + if err != nil { + log.Errorf("[getGlobalRootRuntimeResolver]Error getting Root node %s", err) + return &model.GlobalRuntime{}, nil + } + dn := vRuntime.DisplayName() +parentLabels := map[string]interface{}{"runtimes.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalRuntime { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalRootRuntimeResolver]Output object %+v", ret) + return ret, nil +} +////////////////////////////////////// +// CHILD RESOLVER (Singleton) +// FieldName: AllsparkServices Node: Runtime PKG: Global +////////////////////////////////////// +func getGlobalRuntimeAllsparkServicesResolver(obj *model.GlobalRuntime) (*model.GlobalAllSparkServices, error) { + log.Debugf("[getGlobalRuntimeAllsparkServicesResolver]Parent Object %+v", obj) + vAllSparkServices, err := nc.GlobalRoot().Runtime().GetAllsparkServices(context.TODO()) + if err != nil { + log.Errorf("[getGlobalRuntimeAllsparkServicesResolver]Error getting Runtime node %s", err) + return &model.GlobalAllSparkServices{}, nil + } + dn := vAllSparkServices.DisplayName() +parentLabels := map[string]interface{}{"allsparkserviceses.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAllSparkServices { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalRuntimeAllsparkServicesResolver]Output object %+v", ret) + return ret, nil +} +////////////////////////////////////// +// CHILD RESOLVER (Singleton) +// FieldName: UserFolder Node: Runtime PKG: Global +////////////////////////////////////// +func getGlobalRuntimeUserFolderResolver(obj *model.GlobalRuntime) (*model.GlobalUserFolder, error) { + log.Debugf("[getGlobalRuntimeUserFolderResolver]Parent Object %+v", obj) + vUserFolder, err := nc.GlobalRoot().Runtime().GetUserFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalRuntimeUserFolderResolver]Error getting Runtime node %s", err) + return &model.GlobalUserFolder{}, nil + } + dn := vUserFolder.DisplayName() +parentLabels := map[string]interface{}{"userfolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalUserFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalRuntimeUserFolderResolver]Output object %+v", ret) + return ret, nil +} +////////////////////////////////////// +// CHILD RESOLVER (Singleton) +// FieldName: DataFolder Node: Runtime PKG: Global +////////////////////////////////////// +func getGlobalRuntimeDataFolderResolver(obj *model.GlobalRuntime) (*model.GlobalDataFolder, error) { + log.Debugf("[getGlobalRuntimeDataFolderResolver]Parent Object %+v", obj) + vDataFolder, err := nc.GlobalRoot().Runtime().GetDataFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalRuntimeDataFolderResolver]Error getting Runtime node %s", err) + return &model.GlobalDataFolder{}, nil + } + dn := vDataFolder.DisplayName() +parentLabels := map[string]interface{}{"datafolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDataFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalRuntimeDataFolderResolver]Output object %+v", ret) + return ret, nil +} +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: AppFolder Node: Runtime PKG: Global +////////////////////////////////////// +func getGlobalRuntimeAppFolderResolver(obj *model.GlobalRuntime, id *string) (*model.GlobalAppFolder, error) { + log.Debugf("[getGlobalRuntimeAppFolderResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalRuntimeAppFolderResolver]Id %q", *id) + vAppFolder, err := nc.GlobalRoot().Runtime().GetAppFolder(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalRuntimeAppFolderResolver]Error getting AppFolder node %q : %s", *id, err) + return &model.GlobalAppFolder{}, nil + } + dn := vAppFolder.DisplayName() +parentLabels := map[string]interface{}{"appfolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAppFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalRuntimeAppFolderResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalRuntimeAppFolderResolver]Id is empty, process all AppFolders") + vAppFolderParent, err := nc.GlobalRoot().GetRuntime(context.TODO()) + if err != nil { + log.Errorf("[getGlobalRuntimeAppFolderResolver]Failed to get parent node %s", err) + return &model.GlobalAppFolder{}, nil + } + vAppFolder, err := vAppFolderParent.GetAppFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalRuntimeAppFolderResolver]Error getting AppFolder node %s", err) + return &model.GlobalAppFolder{}, nil + } + dn := vAppFolder.DisplayName() +parentLabels := map[string]interface{}{"appfolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAppFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalRuntimeAppFolderResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Singleton) +// FieldName: NodeFolder Node: Runtime PKG: Global +////////////////////////////////////// +func getGlobalRuntimeNodeFolderResolver(obj *model.GlobalRuntime) (*model.GlobalNodeFolder, error) { + log.Debugf("[getGlobalRuntimeNodeFolderResolver]Parent Object %+v", obj) + vNodeFolder, err := nc.GlobalRoot().Runtime().GetNodeFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalRuntimeNodeFolderResolver]Error getting Runtime node %s", err) + return &model.GlobalNodeFolder{}, nil + } + dn := vNodeFolder.DisplayName() +parentLabels := map[string]interface{}{"nodefolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNodeFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalRuntimeNodeFolderResolver]Output object %+v", ret) + return ret, nil +} +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: ClusterFolder Node: Runtime PKG: Global +////////////////////////////////////// +func getGlobalRuntimeClusterFolderResolver(obj *model.GlobalRuntime, id *string) (*model.GlobalClusterFolder, error) { + log.Debugf("[getGlobalRuntimeClusterFolderResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalRuntimeClusterFolderResolver]Id %q", *id) + vClusterFolder, err := nc.GlobalRoot().Runtime().GetClusterFolder(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalRuntimeClusterFolderResolver]Error getting ClusterFolder node %q : %s", *id, err) + return &model.GlobalClusterFolder{}, nil + } + dn := vClusterFolder.DisplayName() +parentLabels := map[string]interface{}{"clusterfolders.global.tsm.tanzu.vmware.com":dn} +vName := string(vClusterFolder.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalClusterFolder { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + + log.Debugf("[getGlobalRuntimeClusterFolderResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalRuntimeClusterFolderResolver]Id is empty, process all ClusterFolders") + vClusterFolderParent, err := nc.GlobalRoot().GetRuntime(context.TODO()) + if err != nil { + log.Errorf("[getGlobalRuntimeClusterFolderResolver]Failed to get parent node %s", err) + return &model.GlobalClusterFolder{}, nil + } + vClusterFolder, err := vClusterFolderParent.GetClusterFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalRuntimeClusterFolderResolver]Error getting ClusterFolder node %s", err) + return &model.GlobalClusterFolder{}, nil + } + dn := vClusterFolder.DisplayName() +parentLabels := map[string]interface{}{"clusterfolders.global.tsm.tanzu.vmware.com":dn} +vName := string(vClusterFolder.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalClusterFolder { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + + log.Debugf("[getGlobalRuntimeClusterFolderResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Singleton) +// FieldName: ProgressiveUpgrade Node: Runtime PKG: Global +////////////////////////////////////// +func getGlobalRuntimeProgressiveUpgradeResolver(obj *model.GlobalRuntime) (*model.GlobalProgressiveUpgradeFolder, error) { + log.Debugf("[getGlobalRuntimeProgressiveUpgradeResolver]Parent Object %+v", obj) + vProgressiveUpgradeFolder, err := nc.GlobalRoot().Runtime().GetProgressiveUpgrade(context.TODO()) + if err != nil { + log.Errorf("[getGlobalRuntimeProgressiveUpgradeResolver]Error getting Runtime node %s", err) + return &model.GlobalProgressiveUpgradeFolder{}, nil + } + dn := vProgressiveUpgradeFolder.DisplayName() +parentLabels := map[string]interface{}{"progressiveupgradefolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalProgressiveUpgradeFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalRuntimeProgressiveUpgradeResolver]Output object %+v", ret) + return ret, nil +} +////////////////////////////////////// +// CHILD RESOLVER (Singleton) +// FieldName: JobConfigFolder Node: Runtime PKG: Global +////////////////////////////////////// +func getGlobalRuntimeJobConfigFolderResolver(obj *model.GlobalRuntime) (*model.GlobalJobConfigFolder, error) { + log.Debugf("[getGlobalRuntimeJobConfigFolderResolver]Parent Object %+v", obj) + vJobConfigFolder, err := nc.GlobalRoot().Runtime().GetJobConfigFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalRuntimeJobConfigFolderResolver]Error getting Runtime node %s", err) + return &model.GlobalJobConfigFolder{}, nil + } + dn := vJobConfigFolder.DisplayName() +parentLabels := map[string]interface{}{"jobconfigfolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalJobConfigFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalRuntimeJobConfigFolderResolver]Output object %+v", ret) + return ret, nil +} +////////////////////////////////////// +// CHILD RESOLVER (Singleton) +// FieldName: ExternalDNS Node: Runtime PKG: Global +////////////////////////////////////// +func getGlobalRuntimeExternalDNSResolver(obj *model.GlobalRuntime) (*model.GlobalExternalDNSRuntime, error) { + log.Debugf("[getGlobalRuntimeExternalDNSResolver]Parent Object %+v", obj) + vExternalDNSRuntime, err := nc.GlobalRoot().Runtime().GetExternalDNS(context.TODO()) + if err != nil { + log.Errorf("[getGlobalRuntimeExternalDNSResolver]Error getting Runtime node %s", err) + return &model.GlobalExternalDNSRuntime{}, nil + } + dn := vExternalDNSRuntime.DisplayName() +parentLabels := map[string]interface{}{"externaldnsruntimes.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalExternalDNSRuntime { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalRuntimeExternalDNSResolver]Output object %+v", ret) + return ret, nil +} +////////////////////////////////////// +// CHILD RESOLVER (Non Singleton) +// FieldName: SloFolder Node: Runtime PKG: Global +////////////////////////////////////// +func getGlobalRuntimeSloFolderResolver(obj *model.GlobalRuntime, id *string) (*model.GlobalSLOFolder, error) { + log.Debugf("[getGlobalRuntimeSloFolderResolver]Parent Object %+v", obj) + if id != nil && *id != "" { + log.Debugf("[getGlobalRuntimeSloFolderResolver]Id %q", *id) + vSLOFolder, err := nc.GlobalRoot().Runtime().GetSloFolder(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalRuntimeSloFolderResolver]Error getting SloFolder node %q : %s", *id, err) + return &model.GlobalSLOFolder{}, nil + } + dn := vSLOFolder.DisplayName() +parentLabels := map[string]interface{}{"slofolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { parentLabels[k] = v } - ret := &model.ConfigFooTypeABC{ - Id: &dn, - ParentLabels: parentLabels, - FooA: &FooAData, - FooB: &FooBData, - FooD: &FooDData, - FooF: &FooFData, + ret := &model.GlobalSLOFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalRuntimeSloFolderResolver]Output object %v", ret) + return ret, nil + } + log.Debug("[getGlobalRuntimeSloFolderResolver]Id is empty, process all SloFolders") + vSLOFolderParent, err := nc.GlobalRoot().GetRuntime(context.TODO()) + if err != nil { + log.Errorf("[getGlobalRuntimeSloFolderResolver]Failed to get parent node %s", err) + return &model.GlobalSLOFolder{}, nil + } + vSLOFolder, err := vSLOFolderParent.GetSloFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalRuntimeSloFolderResolver]Error getting SloFolder node %s", err) + return &model.GlobalSLOFolder{}, nil + } + dn := vSLOFolder.DisplayName() +parentLabels := map[string]interface{}{"slofolders.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSLOFolder { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalRuntimeSloFolderResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILD RESOLVER (Singleton) +// FieldName: ServiceDirectoryRT Node: Runtime PKG: Global +////////////////////////////////////// +func getGlobalRuntimeServiceDirectoryRTResolver(obj *model.GlobalRuntime) (*model.GlobalServiceDirectoryRT, error) { + log.Debugf("[getGlobalRuntimeServiceDirectoryRTResolver]Parent Object %+v", obj) + vServiceDirectoryRT, err := nc.GlobalRoot().Runtime().GetServiceDirectoryRT(context.TODO()) + if err != nil { + log.Errorf("[getGlobalRuntimeServiceDirectoryRTResolver]Error getting Runtime node %s", err) + return &model.GlobalServiceDirectoryRT{}, nil + } + dn := vServiceDirectoryRT.DisplayName() +parentLabels := map[string]interface{}{"servicedirectoryrts.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDirectoryRT { + Id: &dn, + ParentLabels: parentLabels, + } + + log.Debugf("[getGlobalRuntimeServiceDirectoryRTResolver]Output object %+v", ret) + return ret, nil +} +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceVersion Node: ServiceConfig PKG: Global +////////////////////////////////////// +func getGlobalServiceConfigServiceVersionResolver(obj *model.GlobalServiceConfig, id *string) ([]*model.GlobalServiceVersionConfig, error) { + log.Debugf("[getGlobalServiceConfigServiceVersionResolver]Parent Object %+v", obj) + var vGlobalServiceVersionConfigList []*model.GlobalServiceVersionConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceConfigServiceVersionResolver]Id %q", *id) + vServiceVersionConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "serviceconfigs.global.tsm.tanzu.vmware.com")).GetServiceVersion(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceConfigServiceVersionResolver]Error getting ServiceVersion node %q : %s", *id, err) + return vGlobalServiceVersionConfigList, nil + } + dn := vServiceVersionConfig.DisplayName() +parentLabels := map[string]interface{}{"serviceversionconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceVersionConfig.Spec.Name) +vVersion := string(vServiceVersionConfig.Spec.Version) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceVersionConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Version: &vVersion, + } + vGlobalServiceVersionConfigList = append(vGlobalServiceVersionConfigList, ret) + + log.Debugf("[getGlobalServiceConfigServiceVersionResolver]Output ServiceVersion objects %v", vGlobalServiceVersionConfigList) + + return vGlobalServiceVersionConfigList, nil + } + + log.Debug("[getGlobalServiceConfigServiceVersionResolver]Id is empty, process all ServiceVersions") + + vServiceVersionConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "serviceconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceConfigServiceVersionResolver]Error getting parent node %s", err) + return vGlobalServiceVersionConfigList, nil + } + vServiceVersionConfigAllObj, err := vServiceVersionConfigParent.GetAllServiceVersion(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceConfigServiceVersionResolver]Error getting ServiceVersion objects %s", err) + return vGlobalServiceVersionConfigList, nil + } + for _, i := range vServiceVersionConfigAllObj { + vServiceVersionConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "serviceconfigs.global.tsm.tanzu.vmware.com")).GetServiceVersion(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceConfigServiceVersionResolver]Error getting ServiceVersion node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceVersionConfig.DisplayName() +parentLabels := map[string]interface{}{"serviceversionconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceVersionConfig.Spec.Name) +vVersion := string(vServiceVersionConfig.Spec.Version) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceVersionConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Version: &vVersion, + } + vGlobalServiceVersionConfigList = append(vGlobalServiceVersionConfigList, ret) + } + + log.Debugf("[getGlobalServiceConfigServiceVersionResolver]Output ServiceVersion objects %v", vGlobalServiceVersionConfigList) + + return vGlobalServiceVersionConfigList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceInstances Node: ServiceCronJob PKG: Global +////////////////////////////////////// +func getGlobalServiceCronJobServiceInstancesResolver(obj *model.GlobalServiceCronJob, id *string) ([]*model.GlobalServiceInstance, error) { + log.Debugf("[getGlobalServiceCronJobServiceInstancesResolver]Parent Object %+v", obj) + var vGlobalServiceInstanceList []*model.GlobalServiceInstance + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceCronJobServiceInstancesResolver]Id %q", *id) + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceCronJobs(context.TODO(), getParentName(obj.ParentLabels, "servicecronjobs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceCronJobServiceInstancesResolver]Error getting ServiceInstances %q : %s", *id, err) + return vGlobalServiceInstanceList, nil + } + vServiceInstance, err := vServiceInstanceParent.GetServiceInstances(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceCronJobServiceInstancesResolver]Error getting ServiceInstances %q : %s", *id, err) + return vGlobalServiceInstanceList, nil + } + dn := vServiceInstance.DisplayName() +parentLabels := map[string]interface{}{"serviceinstances.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceInstance.Spec.Metadata) +vSpec := string(vServiceInstance.Spec.Spec) +vStatus := string(vServiceInstance.Spec.Status) +vName := string(vServiceInstance.Spec.Name) +vNamespace := string(vServiceInstance.Spec.Namespace) +vAnnotations := string(vServiceInstance.Spec.Annotations) +vLabels := string(vServiceInstance.Spec.Labels) +vApiLink := string(vServiceInstance.Spec.ApiLink) +vUid := string(vServiceInstance.Spec.Uid) +vRestartPolicy := string(vServiceInstance.Spec.RestartPolicy) +vDnsPolicy := string(vServiceInstance.Spec.DnsPolicy) +vHostNetwork := bool(vServiceInstance.Spec.HostNetwork) +vSecurityContext := string(vServiceInstance.Spec.SecurityContext) +vTerminationGracePeriodSeconds := int(vServiceInstance.Spec.TerminationGracePeriodSeconds) +vTolerations := string(vServiceInstance.Spec.Tolerations) +vStatusConditions := string(vServiceInstance.Spec.StatusConditions) +vStatusContainer := string(vServiceInstance.Spec.StatusContainer) +vPodIP := string(vServiceInstance.Spec.PodIP) +vQosClass := string(vServiceInstance.Spec.QosClass) +vPhase := string(vServiceInstance.Spec.Phase) +vStartTime := string(vServiceInstance.Spec.StartTime) +vNodeName := string(vServiceInstance.Spec.NodeName) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceInstance { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Name: &vName, + Namespace: &vNamespace, + Annotations: &vAnnotations, + Labels: &vLabels, + ApiLink: &vApiLink, + Uid: &vUid, + RestartPolicy: &vRestartPolicy, + DnsPolicy: &vDnsPolicy, + HostNetwork: &vHostNetwork, + SecurityContext: &vSecurityContext, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Tolerations: &vTolerations, + StatusConditions: &vStatusConditions, + StatusContainer: &vStatusContainer, + PodIP: &vPodIP, + QosClass: &vQosClass, + Phase: &vPhase, + StartTime: &vStartTime, + NodeName: &vNodeName, + } + vGlobalServiceInstanceList = append(vGlobalServiceInstanceList, ret) + + log.Debugf("[getGlobalServiceCronJobServiceInstancesResolver]Output ServiceInstances objects %v", vGlobalServiceInstanceList) + + return vGlobalServiceInstanceList, nil + } + + log.Debug("[getGlobalServiceCronJobServiceInstancesResolver]Id is empty, process all ServiceInstancess") + + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceCronJobs(context.TODO(), getParentName(obj.ParentLabels, "servicecronjobs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceCronJobServiceInstancesResolver]Error getting parent node %s", err) + return vGlobalServiceInstanceList, nil + } + vServiceInstanceAllObj, err := vServiceInstanceParent.GetAllServiceInstances(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceCronJobServiceInstancesResolver]Error getting ServiceInstances %s", err) + return vGlobalServiceInstanceList, nil + } + for _, i := range vServiceInstanceAllObj { + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceCronJobs(context.TODO(), getParentName(obj.ParentLabels, "servicecronjobs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceCronJobServiceInstancesResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceInstance, err := vServiceInstanceParent.GetServiceInstances(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceCronJobServiceInstancesResolver]Error getting ServiceInstances node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceInstance.DisplayName() +parentLabels := map[string]interface{}{"serviceinstances.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceInstance.Spec.Metadata) +vSpec := string(vServiceInstance.Spec.Spec) +vStatus := string(vServiceInstance.Spec.Status) +vName := string(vServiceInstance.Spec.Name) +vNamespace := string(vServiceInstance.Spec.Namespace) +vAnnotations := string(vServiceInstance.Spec.Annotations) +vLabels := string(vServiceInstance.Spec.Labels) +vApiLink := string(vServiceInstance.Spec.ApiLink) +vUid := string(vServiceInstance.Spec.Uid) +vRestartPolicy := string(vServiceInstance.Spec.RestartPolicy) +vDnsPolicy := string(vServiceInstance.Spec.DnsPolicy) +vHostNetwork := bool(vServiceInstance.Spec.HostNetwork) +vSecurityContext := string(vServiceInstance.Spec.SecurityContext) +vTerminationGracePeriodSeconds := int(vServiceInstance.Spec.TerminationGracePeriodSeconds) +vTolerations := string(vServiceInstance.Spec.Tolerations) +vStatusConditions := string(vServiceInstance.Spec.StatusConditions) +vStatusContainer := string(vServiceInstance.Spec.StatusContainer) +vPodIP := string(vServiceInstance.Spec.PodIP) +vQosClass := string(vServiceInstance.Spec.QosClass) +vPhase := string(vServiceInstance.Spec.Phase) +vStartTime := string(vServiceInstance.Spec.StartTime) +vNodeName := string(vServiceInstance.Spec.NodeName) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceInstance { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Name: &vName, + Namespace: &vNamespace, + Annotations: &vAnnotations, + Labels: &vLabels, + ApiLink: &vApiLink, + Uid: &vUid, + RestartPolicy: &vRestartPolicy, + DnsPolicy: &vDnsPolicy, + HostNetwork: &vHostNetwork, + SecurityContext: &vSecurityContext, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Tolerations: &vTolerations, + StatusConditions: &vStatusConditions, + StatusContainer: &vStatusContainer, + PodIP: &vPodIP, + QosClass: &vQosClass, + Phase: &vPhase, + StartTime: &vStartTime, + NodeName: &vNodeName, + } + vGlobalServiceInstanceList = append(vGlobalServiceInstanceList, ret) + } + log.Debugf("[getGlobalServiceCronJobServiceInstancesResolver]List of ServiceInstances object %v", vGlobalServiceInstanceList) + return vGlobalServiceInstanceList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceJobs Node: ServiceCronJob PKG: Global +////////////////////////////////////// +func getGlobalServiceCronJobServiceJobsResolver(obj *model.GlobalServiceCronJob, id *string) ([]*model.GlobalServiceJob, error) { + log.Debugf("[getGlobalServiceCronJobServiceJobsResolver]Parent Object %+v", obj) + var vGlobalServiceJobList []*model.GlobalServiceJob + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceCronJobServiceJobsResolver]Id %q", *id) + vServiceJobParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceCronJobs(context.TODO(), getParentName(obj.ParentLabels, "servicecronjobs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceCronJobServiceJobsResolver]Error getting ServiceJobs %q : %s", *id, err) + return vGlobalServiceJobList, nil + } + vServiceJob, err := vServiceJobParent.GetServiceJobs(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceCronJobServiceJobsResolver]Error getting ServiceJobs %q : %s", *id, err) + return vGlobalServiceJobList, nil + } + dn := vServiceJob.DisplayName() +parentLabels := map[string]interface{}{"servicejobs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceJob.Spec.Name) +vMetadata := string(vServiceJob.Spec.Metadata) +vSpec := string(vServiceJob.Spec.Spec) +vStatus := string(vServiceJob.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceJob { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceJobList = append(vGlobalServiceJobList, ret) + + log.Debugf("[getGlobalServiceCronJobServiceJobsResolver]Output ServiceJobs objects %v", vGlobalServiceJobList) + + return vGlobalServiceJobList, nil + } + + log.Debug("[getGlobalServiceCronJobServiceJobsResolver]Id is empty, process all ServiceJobss") + + vServiceJobParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceCronJobs(context.TODO(), getParentName(obj.ParentLabels, "servicecronjobs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceCronJobServiceJobsResolver]Error getting parent node %s", err) + return vGlobalServiceJobList, nil + } + vServiceJobAllObj, err := vServiceJobParent.GetAllServiceJobs(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceCronJobServiceJobsResolver]Error getting ServiceJobs %s", err) + return vGlobalServiceJobList, nil + } + for _, i := range vServiceJobAllObj { + vServiceJobParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceCronJobs(context.TODO(), getParentName(obj.ParentLabels, "servicecronjobs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceCronJobServiceJobsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceJob, err := vServiceJobParent.GetServiceJobs(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceCronJobServiceJobsResolver]Error getting ServiceJobs node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceJob.DisplayName() +parentLabels := map[string]interface{}{"servicejobs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceJob.Spec.Name) +vMetadata := string(vServiceJob.Spec.Metadata) +vSpec := string(vServiceJob.Spec.Spec) +vStatus := string(vServiceJob.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceJob { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceJobList = append(vGlobalServiceJobList, ret) + } + log.Debugf("[getGlobalServiceCronJobServiceJobsResolver]List of ServiceJobs object %v", vGlobalServiceJobList) + return vGlobalServiceJobList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceInstances Node: ServiceDaemonSet PKG: Global +////////////////////////////////////// +func getGlobalServiceDaemonSetServiceInstancesResolver(obj *model.GlobalServiceDaemonSet, id *string) ([]*model.GlobalServiceInstance, error) { + log.Debugf("[getGlobalServiceDaemonSetServiceInstancesResolver]Parent Object %+v", obj) + var vGlobalServiceInstanceList []*model.GlobalServiceInstance + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceDaemonSetServiceInstancesResolver]Id %q", *id) + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceDaemonSets(context.TODO(), getParentName(obj.ParentLabels, "servicedaemonsets.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceDaemonSetServiceInstancesResolver]Error getting ServiceInstances %q : %s", *id, err) + return vGlobalServiceInstanceList, nil + } + vServiceInstance, err := vServiceInstanceParent.GetServiceInstances(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceDaemonSetServiceInstancesResolver]Error getting ServiceInstances %q : %s", *id, err) + return vGlobalServiceInstanceList, nil + } + dn := vServiceInstance.DisplayName() +parentLabels := map[string]interface{}{"serviceinstances.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceInstance.Spec.Metadata) +vSpec := string(vServiceInstance.Spec.Spec) +vStatus := string(vServiceInstance.Spec.Status) +vName := string(vServiceInstance.Spec.Name) +vNamespace := string(vServiceInstance.Spec.Namespace) +vAnnotations := string(vServiceInstance.Spec.Annotations) +vLabels := string(vServiceInstance.Spec.Labels) +vApiLink := string(vServiceInstance.Spec.ApiLink) +vUid := string(vServiceInstance.Spec.Uid) +vRestartPolicy := string(vServiceInstance.Spec.RestartPolicy) +vDnsPolicy := string(vServiceInstance.Spec.DnsPolicy) +vHostNetwork := bool(vServiceInstance.Spec.HostNetwork) +vSecurityContext := string(vServiceInstance.Spec.SecurityContext) +vTerminationGracePeriodSeconds := int(vServiceInstance.Spec.TerminationGracePeriodSeconds) +vTolerations := string(vServiceInstance.Spec.Tolerations) +vStatusConditions := string(vServiceInstance.Spec.StatusConditions) +vStatusContainer := string(vServiceInstance.Spec.StatusContainer) +vPodIP := string(vServiceInstance.Spec.PodIP) +vQosClass := string(vServiceInstance.Spec.QosClass) +vPhase := string(vServiceInstance.Spec.Phase) +vStartTime := string(vServiceInstance.Spec.StartTime) +vNodeName := string(vServiceInstance.Spec.NodeName) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceInstance { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Name: &vName, + Namespace: &vNamespace, + Annotations: &vAnnotations, + Labels: &vLabels, + ApiLink: &vApiLink, + Uid: &vUid, + RestartPolicy: &vRestartPolicy, + DnsPolicy: &vDnsPolicy, + HostNetwork: &vHostNetwork, + SecurityContext: &vSecurityContext, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Tolerations: &vTolerations, + StatusConditions: &vStatusConditions, + StatusContainer: &vStatusContainer, + PodIP: &vPodIP, + QosClass: &vQosClass, + Phase: &vPhase, + StartTime: &vStartTime, + NodeName: &vNodeName, + } + vGlobalServiceInstanceList = append(vGlobalServiceInstanceList, ret) + + log.Debugf("[getGlobalServiceDaemonSetServiceInstancesResolver]Output ServiceInstances objects %v", vGlobalServiceInstanceList) + + return vGlobalServiceInstanceList, nil + } + + log.Debug("[getGlobalServiceDaemonSetServiceInstancesResolver]Id is empty, process all ServiceInstancess") + + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceDaemonSets(context.TODO(), getParentName(obj.ParentLabels, "servicedaemonsets.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceDaemonSetServiceInstancesResolver]Error getting parent node %s", err) + return vGlobalServiceInstanceList, nil + } + vServiceInstanceAllObj, err := vServiceInstanceParent.GetAllServiceInstances(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceDaemonSetServiceInstancesResolver]Error getting ServiceInstances %s", err) + return vGlobalServiceInstanceList, nil + } + for _, i := range vServiceInstanceAllObj { + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceDaemonSets(context.TODO(), getParentName(obj.ParentLabels, "servicedaemonsets.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceDaemonSetServiceInstancesResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceInstance, err := vServiceInstanceParent.GetServiceInstances(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceDaemonSetServiceInstancesResolver]Error getting ServiceInstances node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceInstance.DisplayName() +parentLabels := map[string]interface{}{"serviceinstances.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceInstance.Spec.Metadata) +vSpec := string(vServiceInstance.Spec.Spec) +vStatus := string(vServiceInstance.Spec.Status) +vName := string(vServiceInstance.Spec.Name) +vNamespace := string(vServiceInstance.Spec.Namespace) +vAnnotations := string(vServiceInstance.Spec.Annotations) +vLabels := string(vServiceInstance.Spec.Labels) +vApiLink := string(vServiceInstance.Spec.ApiLink) +vUid := string(vServiceInstance.Spec.Uid) +vRestartPolicy := string(vServiceInstance.Spec.RestartPolicy) +vDnsPolicy := string(vServiceInstance.Spec.DnsPolicy) +vHostNetwork := bool(vServiceInstance.Spec.HostNetwork) +vSecurityContext := string(vServiceInstance.Spec.SecurityContext) +vTerminationGracePeriodSeconds := int(vServiceInstance.Spec.TerminationGracePeriodSeconds) +vTolerations := string(vServiceInstance.Spec.Tolerations) +vStatusConditions := string(vServiceInstance.Spec.StatusConditions) +vStatusContainer := string(vServiceInstance.Spec.StatusContainer) +vPodIP := string(vServiceInstance.Spec.PodIP) +vQosClass := string(vServiceInstance.Spec.QosClass) +vPhase := string(vServiceInstance.Spec.Phase) +vStartTime := string(vServiceInstance.Spec.StartTime) +vNodeName := string(vServiceInstance.Spec.NodeName) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceInstance { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Name: &vName, + Namespace: &vNamespace, + Annotations: &vAnnotations, + Labels: &vLabels, + ApiLink: &vApiLink, + Uid: &vUid, + RestartPolicy: &vRestartPolicy, + DnsPolicy: &vDnsPolicy, + HostNetwork: &vHostNetwork, + SecurityContext: &vSecurityContext, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Tolerations: &vTolerations, + StatusConditions: &vStatusConditions, + StatusContainer: &vStatusContainer, + PodIP: &vPodIP, + QosClass: &vQosClass, + Phase: &vPhase, + StartTime: &vStartTime, + NodeName: &vNodeName, + } + vGlobalServiceInstanceList = append(vGlobalServiceInstanceList, ret) + } + log.Debugf("[getGlobalServiceDaemonSetServiceInstancesResolver]List of ServiceInstances object %v", vGlobalServiceInstanceList) + return vGlobalServiceInstanceList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Containers Node: ServiceDeployment PKG: Global +////////////////////////////////////// +func getGlobalServiceDeploymentContainersResolver(obj *model.GlobalServiceDeployment, id *string) ([]*model.GlobalServiceDeploymentContainer, error) { + log.Debugf("[getGlobalServiceDeploymentContainersResolver]Parent Object %+v", obj) + var vGlobalServiceDeploymentContainerList []*model.GlobalServiceDeploymentContainer + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceDeploymentContainersResolver]Id %q", *id) + vServiceDeploymentContainer, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).ServiceDeployments(getParentName(obj.ParentLabels, "servicedeployments.global.tsm.tanzu.vmware.com")).GetContainers(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceDeploymentContainersResolver]Error getting Containers node %q : %s", *id, err) + return vGlobalServiceDeploymentContainerList, nil + } + dn := vServiceDeploymentContainer.DisplayName() +parentLabels := map[string]interface{}{"servicedeploymentcontainers.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceDeploymentContainer.Spec.Name) +vImage := string(vServiceDeploymentContainer.Spec.Image) +vImagePullPolicy := string(vServiceDeploymentContainer.Spec.ImagePullPolicy) +vTerminationMessagePath := string(vServiceDeploymentContainer.Spec.TerminationMessagePath) +vTerminationMessagePolicy := string(vServiceDeploymentContainer.Spec.TerminationMessagePolicy) +vArgs := string(vServiceDeploymentContainer.Spec.Args) +vEnv := string(vServiceDeploymentContainer.Spec.Env) +vLivenessProbe := string(vServiceDeploymentContainer.Spec.LivenessProbe) +vReadinessProbe := string(vServiceDeploymentContainer.Spec.ReadinessProbe) +vPorts := string(vServiceDeploymentContainer.Spec.Ports) +vResources := string(vServiceDeploymentContainer.Spec.Resources) +vVolumeMounts := string(vServiceDeploymentContainer.Spec.VolumeMounts) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDeploymentContainer { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Image: &vImage, + ImagePullPolicy: &vImagePullPolicy, + TerminationMessagePath: &vTerminationMessagePath, + TerminationMessagePolicy: &vTerminationMessagePolicy, + Args: &vArgs, + Env: &vEnv, + LivenessProbe: &vLivenessProbe, + ReadinessProbe: &vReadinessProbe, + Ports: &vPorts, + Resources: &vResources, + VolumeMounts: &vVolumeMounts, + } + vGlobalServiceDeploymentContainerList = append(vGlobalServiceDeploymentContainerList, ret) + + log.Debugf("[getGlobalServiceDeploymentContainersResolver]Output Containers objects %v", vGlobalServiceDeploymentContainerList) + + return vGlobalServiceDeploymentContainerList, nil + } + + log.Debug("[getGlobalServiceDeploymentContainersResolver]Id is empty, process all Containerss") + + vServiceDeploymentContainerParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceDeployments(context.TODO(), getParentName(obj.ParentLabels, "servicedeployments.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceDeploymentContainersResolver]Error getting parent node %s", err) + return vGlobalServiceDeploymentContainerList, nil + } + vServiceDeploymentContainerAllObj, err := vServiceDeploymentContainerParent.GetAllContainers(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceDeploymentContainersResolver]Error getting Containers objects %s", err) + return vGlobalServiceDeploymentContainerList, nil + } + for _, i := range vServiceDeploymentContainerAllObj { + vServiceDeploymentContainer, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).ServiceDeployments(getParentName(obj.ParentLabels, "servicedeployments.global.tsm.tanzu.vmware.com")).GetContainers(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceDeploymentContainersResolver]Error getting Containers node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceDeploymentContainer.DisplayName() +parentLabels := map[string]interface{}{"servicedeploymentcontainers.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceDeploymentContainer.Spec.Name) +vImage := string(vServiceDeploymentContainer.Spec.Image) +vImagePullPolicy := string(vServiceDeploymentContainer.Spec.ImagePullPolicy) +vTerminationMessagePath := string(vServiceDeploymentContainer.Spec.TerminationMessagePath) +vTerminationMessagePolicy := string(vServiceDeploymentContainer.Spec.TerminationMessagePolicy) +vArgs := string(vServiceDeploymentContainer.Spec.Args) +vEnv := string(vServiceDeploymentContainer.Spec.Env) +vLivenessProbe := string(vServiceDeploymentContainer.Spec.LivenessProbe) +vReadinessProbe := string(vServiceDeploymentContainer.Spec.ReadinessProbe) +vPorts := string(vServiceDeploymentContainer.Spec.Ports) +vResources := string(vServiceDeploymentContainer.Spec.Resources) +vVolumeMounts := string(vServiceDeploymentContainer.Spec.VolumeMounts) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDeploymentContainer { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Image: &vImage, + ImagePullPolicy: &vImagePullPolicy, + TerminationMessagePath: &vTerminationMessagePath, + TerminationMessagePolicy: &vTerminationMessagePolicy, + Args: &vArgs, + Env: &vEnv, + LivenessProbe: &vLivenessProbe, + ReadinessProbe: &vReadinessProbe, + Ports: &vPorts, + Resources: &vResources, + VolumeMounts: &vVolumeMounts, + } + vGlobalServiceDeploymentContainerList = append(vGlobalServiceDeploymentContainerList, ret) + } + + log.Debugf("[getGlobalServiceDeploymentContainersResolver]Output Containers objects %v", vGlobalServiceDeploymentContainerList) + + return vGlobalServiceDeploymentContainerList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceInstances Node: ServiceDeployment PKG: Global +////////////////////////////////////// +func getGlobalServiceDeploymentServiceInstancesResolver(obj *model.GlobalServiceDeployment, id *string) ([]*model.GlobalServiceInstance, error) { + log.Debugf("[getGlobalServiceDeploymentServiceInstancesResolver]Parent Object %+v", obj) + var vGlobalServiceInstanceList []*model.GlobalServiceInstance + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceDeploymentServiceInstancesResolver]Id %q", *id) + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceDeployments(context.TODO(), getParentName(obj.ParentLabels, "servicedeployments.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceDeploymentServiceInstancesResolver]Error getting ServiceInstances %q : %s", *id, err) + return vGlobalServiceInstanceList, nil + } + vServiceInstance, err := vServiceInstanceParent.GetServiceInstances(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceDeploymentServiceInstancesResolver]Error getting ServiceInstances %q : %s", *id, err) + return vGlobalServiceInstanceList, nil + } + dn := vServiceInstance.DisplayName() +parentLabels := map[string]interface{}{"serviceinstances.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceInstance.Spec.Metadata) +vSpec := string(vServiceInstance.Spec.Spec) +vStatus := string(vServiceInstance.Spec.Status) +vName := string(vServiceInstance.Spec.Name) +vNamespace := string(vServiceInstance.Spec.Namespace) +vAnnotations := string(vServiceInstance.Spec.Annotations) +vLabels := string(vServiceInstance.Spec.Labels) +vApiLink := string(vServiceInstance.Spec.ApiLink) +vUid := string(vServiceInstance.Spec.Uid) +vRestartPolicy := string(vServiceInstance.Spec.RestartPolicy) +vDnsPolicy := string(vServiceInstance.Spec.DnsPolicy) +vHostNetwork := bool(vServiceInstance.Spec.HostNetwork) +vSecurityContext := string(vServiceInstance.Spec.SecurityContext) +vTerminationGracePeriodSeconds := int(vServiceInstance.Spec.TerminationGracePeriodSeconds) +vTolerations := string(vServiceInstance.Spec.Tolerations) +vStatusConditions := string(vServiceInstance.Spec.StatusConditions) +vStatusContainer := string(vServiceInstance.Spec.StatusContainer) +vPodIP := string(vServiceInstance.Spec.PodIP) +vQosClass := string(vServiceInstance.Spec.QosClass) +vPhase := string(vServiceInstance.Spec.Phase) +vStartTime := string(vServiceInstance.Spec.StartTime) +vNodeName := string(vServiceInstance.Spec.NodeName) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceInstance { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Name: &vName, + Namespace: &vNamespace, + Annotations: &vAnnotations, + Labels: &vLabels, + ApiLink: &vApiLink, + Uid: &vUid, + RestartPolicy: &vRestartPolicy, + DnsPolicy: &vDnsPolicy, + HostNetwork: &vHostNetwork, + SecurityContext: &vSecurityContext, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Tolerations: &vTolerations, + StatusConditions: &vStatusConditions, + StatusContainer: &vStatusContainer, + PodIP: &vPodIP, + QosClass: &vQosClass, + Phase: &vPhase, + StartTime: &vStartTime, + NodeName: &vNodeName, + } + vGlobalServiceInstanceList = append(vGlobalServiceInstanceList, ret) + + log.Debugf("[getGlobalServiceDeploymentServiceInstancesResolver]Output ServiceInstances objects %v", vGlobalServiceInstanceList) + + return vGlobalServiceInstanceList, nil + } + + log.Debug("[getGlobalServiceDeploymentServiceInstancesResolver]Id is empty, process all ServiceInstancess") + + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceDeployments(context.TODO(), getParentName(obj.ParentLabels, "servicedeployments.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceDeploymentServiceInstancesResolver]Error getting parent node %s", err) + return vGlobalServiceInstanceList, nil + } + vServiceInstanceAllObj, err := vServiceInstanceParent.GetAllServiceInstances(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceDeploymentServiceInstancesResolver]Error getting ServiceInstances %s", err) + return vGlobalServiceInstanceList, nil + } + for _, i := range vServiceInstanceAllObj { + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceDeployments(context.TODO(), getParentName(obj.ParentLabels, "servicedeployments.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceDeploymentServiceInstancesResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceInstance, err := vServiceInstanceParent.GetServiceInstances(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceDeploymentServiceInstancesResolver]Error getting ServiceInstances node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceInstance.DisplayName() +parentLabels := map[string]interface{}{"serviceinstances.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceInstance.Spec.Metadata) +vSpec := string(vServiceInstance.Spec.Spec) +vStatus := string(vServiceInstance.Spec.Status) +vName := string(vServiceInstance.Spec.Name) +vNamespace := string(vServiceInstance.Spec.Namespace) +vAnnotations := string(vServiceInstance.Spec.Annotations) +vLabels := string(vServiceInstance.Spec.Labels) +vApiLink := string(vServiceInstance.Spec.ApiLink) +vUid := string(vServiceInstance.Spec.Uid) +vRestartPolicy := string(vServiceInstance.Spec.RestartPolicy) +vDnsPolicy := string(vServiceInstance.Spec.DnsPolicy) +vHostNetwork := bool(vServiceInstance.Spec.HostNetwork) +vSecurityContext := string(vServiceInstance.Spec.SecurityContext) +vTerminationGracePeriodSeconds := int(vServiceInstance.Spec.TerminationGracePeriodSeconds) +vTolerations := string(vServiceInstance.Spec.Tolerations) +vStatusConditions := string(vServiceInstance.Spec.StatusConditions) +vStatusContainer := string(vServiceInstance.Spec.StatusContainer) +vPodIP := string(vServiceInstance.Spec.PodIP) +vQosClass := string(vServiceInstance.Spec.QosClass) +vPhase := string(vServiceInstance.Spec.Phase) +vStartTime := string(vServiceInstance.Spec.StartTime) +vNodeName := string(vServiceInstance.Spec.NodeName) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceInstance { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Name: &vName, + Namespace: &vNamespace, + Annotations: &vAnnotations, + Labels: &vLabels, + ApiLink: &vApiLink, + Uid: &vUid, + RestartPolicy: &vRestartPolicy, + DnsPolicy: &vDnsPolicy, + HostNetwork: &vHostNetwork, + SecurityContext: &vSecurityContext, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Tolerations: &vTolerations, + StatusConditions: &vStatusConditions, + StatusContainer: &vStatusContainer, + PodIP: &vPodIP, + QosClass: &vQosClass, + Phase: &vPhase, + StartTime: &vStartTime, + NodeName: &vNodeName, + } + vGlobalServiceInstanceList = append(vGlobalServiceInstanceList, ret) + } + log.Debugf("[getGlobalServiceDeploymentServiceInstancesResolver]List of ServiceInstances object %v", vGlobalServiceInstanceList) + return vGlobalServiceInstanceList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceReplicaSet Node: ServiceDeployment PKG: Global +////////////////////////////////////// +func getGlobalServiceDeploymentServiceReplicaSetResolver(obj *model.GlobalServiceDeployment, id *string) ([]*model.GlobalServiceReplicaSet, error) { + log.Debugf("[getGlobalServiceDeploymentServiceReplicaSetResolver]Parent Object %+v", obj) + var vGlobalServiceReplicaSetList []*model.GlobalServiceReplicaSet + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceDeploymentServiceReplicaSetResolver]Id %q", *id) + vServiceReplicaSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceDeployments(context.TODO(), getParentName(obj.ParentLabels, "servicedeployments.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceDeploymentServiceReplicaSetResolver]Error getting ServiceReplicaSet %q : %s", *id, err) + return vGlobalServiceReplicaSetList, nil + } + vServiceReplicaSet, err := vServiceReplicaSetParent.GetServiceReplicaSet(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceDeploymentServiceReplicaSetResolver]Error getting ServiceReplicaSet %q : %s", *id, err) + return vGlobalServiceReplicaSetList, nil + } + dn := vServiceReplicaSet.DisplayName() +parentLabels := map[string]interface{}{"servicereplicasets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceReplicaSet.Spec.Name) +vMetadata := string(vServiceReplicaSet.Spec.Metadata) +vSpec := string(vServiceReplicaSet.Spec.Spec) +vStatus := string(vServiceReplicaSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceReplicaSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceReplicaSetList = append(vGlobalServiceReplicaSetList, ret) + + log.Debugf("[getGlobalServiceDeploymentServiceReplicaSetResolver]Output ServiceReplicaSet objects %v", vGlobalServiceReplicaSetList) + + return vGlobalServiceReplicaSetList, nil + } + + log.Debug("[getGlobalServiceDeploymentServiceReplicaSetResolver]Id is empty, process all ServiceReplicaSets") + + vServiceReplicaSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceDeployments(context.TODO(), getParentName(obj.ParentLabels, "servicedeployments.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceDeploymentServiceReplicaSetResolver]Error getting parent node %s", err) + return vGlobalServiceReplicaSetList, nil + } + vServiceReplicaSetAllObj, err := vServiceReplicaSetParent.GetAllServiceReplicaSet(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceDeploymentServiceReplicaSetResolver]Error getting ServiceReplicaSet %s", err) + return vGlobalServiceReplicaSetList, nil + } + for _, i := range vServiceReplicaSetAllObj { + vServiceReplicaSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceDeployments(context.TODO(), getParentName(obj.ParentLabels, "servicedeployments.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceDeploymentServiceReplicaSetResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceReplicaSet, err := vServiceReplicaSetParent.GetServiceReplicaSet(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceDeploymentServiceReplicaSetResolver]Error getting ServiceReplicaSet node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceReplicaSet.DisplayName() +parentLabels := map[string]interface{}{"servicereplicasets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceReplicaSet.Spec.Name) +vMetadata := string(vServiceReplicaSet.Spec.Metadata) +vSpec := string(vServiceReplicaSet.Spec.Spec) +vStatus := string(vServiceReplicaSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceReplicaSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceReplicaSetList = append(vGlobalServiceReplicaSetList, ret) + } + log.Debugf("[getGlobalServiceDeploymentServiceReplicaSetResolver]List of ServiceReplicaSet object %v", vGlobalServiceReplicaSetList) + return vGlobalServiceReplicaSetList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceDirectoryRTFolderEntry Node: ServiceDirectoryRTFolder PKG: Global +////////////////////////////////////// +func getGlobalServiceDirectoryRTFolderServiceDirectoryRTFolderEntryResolver(obj *model.GlobalServiceDirectoryRTFolder, id *string) ([]*model.GlobalServiceDirectoryRTFolderEntry, error) { + log.Debugf("[getGlobalServiceDirectoryRTFolderServiceDirectoryRTFolderEntryResolver]Parent Object %+v", obj) + var vGlobalServiceDirectoryRTFolderEntryList []*model.GlobalServiceDirectoryRTFolderEntry + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceDirectoryRTFolderServiceDirectoryRTFolderEntryResolver]Id %q", *id) + vServiceDirectoryRTFolderEntry, err := nc.GlobalRoot().Runtime().ServiceDirectoryRT().ServiceDirectoryRTFolder(getParentName(obj.ParentLabels, "servicedirectoryrtfolders.global.tsm.tanzu.vmware.com")).GetServiceDirectoryRTFolderEntry(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceDirectoryRTFolderServiceDirectoryRTFolderEntryResolver]Error getting ServiceDirectoryRTFolderEntry node %q : %s", *id, err) + return vGlobalServiceDirectoryRTFolderEntryList, nil + } + dn := vServiceDirectoryRTFolderEntry.DisplayName() +parentLabels := map[string]interface{}{"servicedirectoryrtfolderentries.global.tsm.tanzu.vmware.com":dn} +vSpec := string(vServiceDirectoryRTFolderEntry.Spec.Spec) +vSpec_type := string(vServiceDirectoryRTFolderEntry.Spec.Spec_type) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDirectoryRTFolderEntry { + Id: &dn, + ParentLabels: parentLabels, + Spec: &vSpec, + Spec_type: &vSpec_type, + } + vGlobalServiceDirectoryRTFolderEntryList = append(vGlobalServiceDirectoryRTFolderEntryList, ret) + + log.Debugf("[getGlobalServiceDirectoryRTFolderServiceDirectoryRTFolderEntryResolver]Output ServiceDirectoryRTFolderEntry objects %v", vGlobalServiceDirectoryRTFolderEntryList) + + return vGlobalServiceDirectoryRTFolderEntryList, nil + } + + log.Debug("[getGlobalServiceDirectoryRTFolderServiceDirectoryRTFolderEntryResolver]Id is empty, process all ServiceDirectoryRTFolderEntrys") + + vServiceDirectoryRTFolderEntryParent, err := nc.GlobalRoot().Runtime().ServiceDirectoryRT().GetServiceDirectoryRTFolder(context.TODO(), getParentName(obj.ParentLabels, "servicedirectoryrtfolders.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceDirectoryRTFolderServiceDirectoryRTFolderEntryResolver]Error getting parent node %s", err) + return vGlobalServiceDirectoryRTFolderEntryList, nil + } + vServiceDirectoryRTFolderEntryAllObj, err := vServiceDirectoryRTFolderEntryParent.GetAllServiceDirectoryRTFolderEntry(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceDirectoryRTFolderServiceDirectoryRTFolderEntryResolver]Error getting ServiceDirectoryRTFolderEntry objects %s", err) + return vGlobalServiceDirectoryRTFolderEntryList, nil + } + for _, i := range vServiceDirectoryRTFolderEntryAllObj { + vServiceDirectoryRTFolderEntry, err := nc.GlobalRoot().Runtime().ServiceDirectoryRT().ServiceDirectoryRTFolder(getParentName(obj.ParentLabels, "servicedirectoryrtfolders.global.tsm.tanzu.vmware.com")).GetServiceDirectoryRTFolderEntry(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceDirectoryRTFolderServiceDirectoryRTFolderEntryResolver]Error getting ServiceDirectoryRTFolderEntry node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceDirectoryRTFolderEntry.DisplayName() +parentLabels := map[string]interface{}{"servicedirectoryrtfolderentries.global.tsm.tanzu.vmware.com":dn} +vSpec := string(vServiceDirectoryRTFolderEntry.Spec.Spec) +vSpec_type := string(vServiceDirectoryRTFolderEntry.Spec.Spec_type) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDirectoryRTFolderEntry { + Id: &dn, + ParentLabels: parentLabels, + Spec: &vSpec, + Spec_type: &vSpec_type, + } + vGlobalServiceDirectoryRTFolderEntryList = append(vGlobalServiceDirectoryRTFolderEntryList, ret) + } + + log.Debugf("[getGlobalServiceDirectoryRTFolderServiceDirectoryRTFolderEntryResolver]Output ServiceDirectoryRTFolderEntry objects %v", vGlobalServiceDirectoryRTFolderEntryList) + + return vGlobalServiceDirectoryRTFolderEntryList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceDirectoryRTFolder Node: ServiceDirectoryRT PKG: Global +////////////////////////////////////// +func getGlobalServiceDirectoryRTServiceDirectoryRTFolderResolver(obj *model.GlobalServiceDirectoryRT, id *string) ([]*model.GlobalServiceDirectoryRTFolder, error) { + log.Debugf("[getGlobalServiceDirectoryRTServiceDirectoryRTFolderResolver]Parent Object %+v", obj) + var vGlobalServiceDirectoryRTFolderList []*model.GlobalServiceDirectoryRTFolder + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceDirectoryRTServiceDirectoryRTFolderResolver]Id %q", *id) + vServiceDirectoryRTFolder, err := nc.GlobalRoot().Runtime().ServiceDirectoryRT().GetServiceDirectoryRTFolder(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceDirectoryRTServiceDirectoryRTFolderResolver]Error getting ServiceDirectoryRTFolder node %q : %s", *id, err) + return vGlobalServiceDirectoryRTFolderList, nil + } + dn := vServiceDirectoryRTFolder.DisplayName() +parentLabels := map[string]interface{}{"servicedirectoryrtfolders.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceDirectoryRTFolder.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDirectoryRTFolder { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + vGlobalServiceDirectoryRTFolderList = append(vGlobalServiceDirectoryRTFolderList, ret) + + log.Debugf("[getGlobalServiceDirectoryRTServiceDirectoryRTFolderResolver]Output ServiceDirectoryRTFolder objects %v", vGlobalServiceDirectoryRTFolderList) + + return vGlobalServiceDirectoryRTFolderList, nil + } + + log.Debug("[getGlobalServiceDirectoryRTServiceDirectoryRTFolderResolver]Id is empty, process all ServiceDirectoryRTFolders") + + vServiceDirectoryRTFolderParent, err := nc.GlobalRoot().Runtime().GetServiceDirectoryRT(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceDirectoryRTServiceDirectoryRTFolderResolver]Error getting parent node %s", err) + return vGlobalServiceDirectoryRTFolderList, nil + } + vServiceDirectoryRTFolderAllObj, err := vServiceDirectoryRTFolderParent.GetAllServiceDirectoryRTFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceDirectoryRTServiceDirectoryRTFolderResolver]Error getting ServiceDirectoryRTFolder objects %s", err) + return vGlobalServiceDirectoryRTFolderList, nil + } + for _, i := range vServiceDirectoryRTFolderAllObj { + vServiceDirectoryRTFolder, err := nc.GlobalRoot().Runtime().ServiceDirectoryRT().GetServiceDirectoryRTFolder(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceDirectoryRTServiceDirectoryRTFolderResolver]Error getting ServiceDirectoryRTFolder node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceDirectoryRTFolder.DisplayName() +parentLabels := map[string]interface{}{"servicedirectoryrtfolders.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceDirectoryRTFolder.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDirectoryRTFolder { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + vGlobalServiceDirectoryRTFolderList = append(vGlobalServiceDirectoryRTFolderList, ret) + } + + log.Debugf("[getGlobalServiceDirectoryRTServiceDirectoryRTFolderResolver]Output ServiceDirectoryRTFolder objects %v", vGlobalServiceDirectoryRTFolderList) + + return vGlobalServiceDirectoryRTFolderList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Entries Node: ServiceDirectoryN PKG: Global +////////////////////////////////////// +func getGlobalServiceDirectoryNEntriesResolver(obj *model.GlobalServiceDirectoryN, id *string) ([]*model.GlobalServiceDirectoryEntryConfig, error) { + log.Debugf("[getGlobalServiceDirectoryNEntriesResolver]Parent Object %+v", obj) + var vGlobalServiceDirectoryEntryConfigList []*model.GlobalServiceDirectoryEntryConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceDirectoryNEntriesResolver]Id %q", *id) + vServiceDirectoryEntryConfig, err := nc.GlobalRoot().Config().ServiceDirectory(getParentName(obj.ParentLabels, "servicedirectoryns.global.tsm.tanzu.vmware.com")).GetEntries(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceDirectoryNEntriesResolver]Error getting Entries node %q : %s", *id, err) + return vGlobalServiceDirectoryEntryConfigList, nil + } + dn := vServiceDirectoryEntryConfig.DisplayName() +parentLabels := map[string]interface{}{"servicedirectoryentryconfigs.global.tsm.tanzu.vmware.com":dn} +vSpec := string(vServiceDirectoryEntryConfig.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDirectoryEntryConfig { + Id: &dn, + ParentLabels: parentLabels, + Spec: &vSpec, + } + vGlobalServiceDirectoryEntryConfigList = append(vGlobalServiceDirectoryEntryConfigList, ret) + + log.Debugf("[getGlobalServiceDirectoryNEntriesResolver]Output Entries objects %v", vGlobalServiceDirectoryEntryConfigList) + + return vGlobalServiceDirectoryEntryConfigList, nil + } + + log.Debug("[getGlobalServiceDirectoryNEntriesResolver]Id is empty, process all Entriess") + + vServiceDirectoryEntryConfigParent, err := nc.GlobalRoot().Config().GetServiceDirectory(context.TODO(), getParentName(obj.ParentLabels, "servicedirectoryns.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceDirectoryNEntriesResolver]Error getting parent node %s", err) + return vGlobalServiceDirectoryEntryConfigList, nil + } + vServiceDirectoryEntryConfigAllObj, err := vServiceDirectoryEntryConfigParent.GetAllEntries(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceDirectoryNEntriesResolver]Error getting Entries objects %s", err) + return vGlobalServiceDirectoryEntryConfigList, nil + } + for _, i := range vServiceDirectoryEntryConfigAllObj { + vServiceDirectoryEntryConfig, err := nc.GlobalRoot().Config().ServiceDirectory(getParentName(obj.ParentLabels, "servicedirectoryns.global.tsm.tanzu.vmware.com")).GetEntries(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceDirectoryNEntriesResolver]Error getting Entries node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceDirectoryEntryConfig.DisplayName() +parentLabels := map[string]interface{}{"servicedirectoryentryconfigs.global.tsm.tanzu.vmware.com":dn} +vSpec := string(vServiceDirectoryEntryConfig.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDirectoryEntryConfig { + Id: &dn, + ParentLabels: parentLabels, + Spec: &vSpec, + } + vGlobalServiceDirectoryEntryConfigList = append(vGlobalServiceDirectoryEntryConfigList, ret) + } + + log.Debugf("[getGlobalServiceDirectoryNEntriesResolver]Output Entries objects %v", vGlobalServiceDirectoryEntryConfigList) + + return vGlobalServiceDirectoryEntryConfigList, nil +} + +////////////////////////////////////// +// LINK RESOLVER +// FieldName: Node Node: ServiceInstance PKG: Global +////////////////////////////////////// +func getGlobalServiceInstanceNodeResolver(obj *model.GlobalServiceInstance) (*model.GlobalNode, error) { + log.Debugf("[getGlobalServiceInstanceNodeResolver]Parent Object %+v", obj) + vNodeParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceInstances(context.TODO(), getParentName(obj.ParentLabels, "serviceinstances.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceInstanceNodeResolver]Error getting parent node %s", err) + return &model.GlobalNode{}, nil + } + vNode, err := vNodeParent.GetNode(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceInstanceNodeResolver]Error getting Node object %s", err) + return &model.GlobalNode{}, nil + } + dn := vNode.DisplayName() +parentLabels := map[string]interface{}{"nodes.global.tsm.tanzu.vmware.com":dn} +vName := string(vNode.Spec.Name) +vExternalID := string(vNode.Spec.ExternalID) +vProviderID := string(vNode.Spec.ProviderID) +vArchitecture := string(vNode.Spec.Architecture) +vContainerRuntimeVersion := string(vNode.Spec.ContainerRuntimeVersion) +vKernelVersion := string(vNode.Spec.KernelVersion) +vOperatingSystem := string(vNode.Spec.OperatingSystem) +vOsImage := string(vNode.Spec.OsImage) +vSystemUUID := string(vNode.Spec.SystemUUID) +vHostName := string(vNode.Spec.HostName) +vApiLink := string(vNode.Spec.ApiLink) +vBootID := string(vNode.Spec.BootID) +vKubeletVersion := string(vNode.Spec.KubeletVersion) +vMachineID := string(vNode.Spec.MachineID) +vCreationTimestamp := string(vNode.Spec.CreationTimestamp) +vAnnotations := string(vNode.Spec.Annotations) +vLabels := string(vNode.Spec.Labels) +vUid := string(vNode.Spec.Uid) +vSpec := string(vNode.Spec.Spec) +vKStatus := string(vNode.Spec.KStatus) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNode { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + ExternalID: &vExternalID, + ProviderID: &vProviderID, + Architecture: &vArchitecture, + ContainerRuntimeVersion: &vContainerRuntimeVersion, + KernelVersion: &vKernelVersion, + OperatingSystem: &vOperatingSystem, + OsImage: &vOsImage, + SystemUUID: &vSystemUUID, + HostName: &vHostName, + ApiLink: &vApiLink, + BootID: &vBootID, + KubeletVersion: &vKubeletVersion, + MachineID: &vMachineID, + CreationTimestamp: &vCreationTimestamp, + Annotations: &vAnnotations, + Labels: &vLabels, + Uid: &vUid, + Spec: &vSpec, + KStatus: &vKStatus, + } + log.Debugf("[getGlobalServiceInstanceNodeResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Containers Node: ServiceInstance PKG: Global +////////////////////////////////////// +func getGlobalServiceInstanceContainersResolver(obj *model.GlobalServiceInstance, id *string) ([]*model.GlobalServiceInstanceContainer, error) { + log.Debugf("[getGlobalServiceInstanceContainersResolver]Parent Object %+v", obj) + var vGlobalServiceInstanceContainerList []*model.GlobalServiceInstanceContainer + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceInstanceContainersResolver]Id %q", *id) + vServiceInstanceContainer, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).ServiceInstances(getParentName(obj.ParentLabels, "serviceinstances.global.tsm.tanzu.vmware.com")).GetContainers(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceInstanceContainersResolver]Error getting Containers node %q : %s", *id, err) + return vGlobalServiceInstanceContainerList, nil + } + dn := vServiceInstanceContainer.DisplayName() +parentLabels := map[string]interface{}{"serviceinstancecontainers.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceInstanceContainer.Spec.Name) +vImage := string(vServiceInstanceContainer.Spec.Image) +vImagePullPolicy := string(vServiceInstanceContainer.Spec.ImagePullPolicy) +vTerminationMessagePath := string(vServiceInstanceContainer.Spec.TerminationMessagePath) +vTerminationMessagePolicy := string(vServiceInstanceContainer.Spec.TerminationMessagePolicy) +vResources := string(vServiceInstanceContainer.Spec.Resources) +vVolumeMounts := string(vServiceInstanceContainer.Spec.VolumeMounts) +vCommand := string(vServiceInstanceContainer.Spec.Command) +vSecurityContext := string(vServiceInstanceContainer.Spec.SecurityContext) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceInstanceContainer { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Image: &vImage, + ImagePullPolicy: &vImagePullPolicy, + TerminationMessagePath: &vTerminationMessagePath, + TerminationMessagePolicy: &vTerminationMessagePolicy, + Resources: &vResources, + VolumeMounts: &vVolumeMounts, + Command: &vCommand, + SecurityContext: &vSecurityContext, + } + vGlobalServiceInstanceContainerList = append(vGlobalServiceInstanceContainerList, ret) + + log.Debugf("[getGlobalServiceInstanceContainersResolver]Output Containers objects %v", vGlobalServiceInstanceContainerList) + + return vGlobalServiceInstanceContainerList, nil + } + + log.Debug("[getGlobalServiceInstanceContainersResolver]Id is empty, process all Containerss") + + vServiceInstanceContainerParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceInstances(context.TODO(), getParentName(obj.ParentLabels, "serviceinstances.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceInstanceContainersResolver]Error getting parent node %s", err) + return vGlobalServiceInstanceContainerList, nil + } + vServiceInstanceContainerAllObj, err := vServiceInstanceContainerParent.GetAllContainers(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceInstanceContainersResolver]Error getting Containers objects %s", err) + return vGlobalServiceInstanceContainerList, nil + } + for _, i := range vServiceInstanceContainerAllObj { + vServiceInstanceContainer, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).ServiceInstances(getParentName(obj.ParentLabels, "serviceinstances.global.tsm.tanzu.vmware.com")).GetContainers(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceInstanceContainersResolver]Error getting Containers node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceInstanceContainer.DisplayName() +parentLabels := map[string]interface{}{"serviceinstancecontainers.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceInstanceContainer.Spec.Name) +vImage := string(vServiceInstanceContainer.Spec.Image) +vImagePullPolicy := string(vServiceInstanceContainer.Spec.ImagePullPolicy) +vTerminationMessagePath := string(vServiceInstanceContainer.Spec.TerminationMessagePath) +vTerminationMessagePolicy := string(vServiceInstanceContainer.Spec.TerminationMessagePolicy) +vResources := string(vServiceInstanceContainer.Spec.Resources) +vVolumeMounts := string(vServiceInstanceContainer.Spec.VolumeMounts) +vCommand := string(vServiceInstanceContainer.Spec.Command) +vSecurityContext := string(vServiceInstanceContainer.Spec.SecurityContext) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceInstanceContainer { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Image: &vImage, + ImagePullPolicy: &vImagePullPolicy, + TerminationMessagePath: &vTerminationMessagePath, + TerminationMessagePolicy: &vTerminationMessagePolicy, + Resources: &vResources, + VolumeMounts: &vVolumeMounts, + Command: &vCommand, + SecurityContext: &vSecurityContext, + } + vGlobalServiceInstanceContainerList = append(vGlobalServiceInstanceContainerList, ret) + } + + log.Debugf("[getGlobalServiceInstanceContainersResolver]Output Containers objects %v", vGlobalServiceInstanceContainerList) + + return vGlobalServiceInstanceContainerList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceInstances Node: ServiceJob PKG: Global +////////////////////////////////////// +func getGlobalServiceJobServiceInstancesResolver(obj *model.GlobalServiceJob, id *string) ([]*model.GlobalServiceInstance, error) { + log.Debugf("[getGlobalServiceJobServiceInstancesResolver]Parent Object %+v", obj) + var vGlobalServiceInstanceList []*model.GlobalServiceInstance + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceJobServiceInstancesResolver]Id %q", *id) + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceJobs(context.TODO(), getParentName(obj.ParentLabels, "servicejobs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceJobServiceInstancesResolver]Error getting ServiceInstances %q : %s", *id, err) + return vGlobalServiceInstanceList, nil + } + vServiceInstance, err := vServiceInstanceParent.GetServiceInstances(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceJobServiceInstancesResolver]Error getting ServiceInstances %q : %s", *id, err) + return vGlobalServiceInstanceList, nil + } + dn := vServiceInstance.DisplayName() +parentLabels := map[string]interface{}{"serviceinstances.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceInstance.Spec.Metadata) +vSpec := string(vServiceInstance.Spec.Spec) +vStatus := string(vServiceInstance.Spec.Status) +vName := string(vServiceInstance.Spec.Name) +vNamespace := string(vServiceInstance.Spec.Namespace) +vAnnotations := string(vServiceInstance.Spec.Annotations) +vLabels := string(vServiceInstance.Spec.Labels) +vApiLink := string(vServiceInstance.Spec.ApiLink) +vUid := string(vServiceInstance.Spec.Uid) +vRestartPolicy := string(vServiceInstance.Spec.RestartPolicy) +vDnsPolicy := string(vServiceInstance.Spec.DnsPolicy) +vHostNetwork := bool(vServiceInstance.Spec.HostNetwork) +vSecurityContext := string(vServiceInstance.Spec.SecurityContext) +vTerminationGracePeriodSeconds := int(vServiceInstance.Spec.TerminationGracePeriodSeconds) +vTolerations := string(vServiceInstance.Spec.Tolerations) +vStatusConditions := string(vServiceInstance.Spec.StatusConditions) +vStatusContainer := string(vServiceInstance.Spec.StatusContainer) +vPodIP := string(vServiceInstance.Spec.PodIP) +vQosClass := string(vServiceInstance.Spec.QosClass) +vPhase := string(vServiceInstance.Spec.Phase) +vStartTime := string(vServiceInstance.Spec.StartTime) +vNodeName := string(vServiceInstance.Spec.NodeName) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceInstance { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Name: &vName, + Namespace: &vNamespace, + Annotations: &vAnnotations, + Labels: &vLabels, + ApiLink: &vApiLink, + Uid: &vUid, + RestartPolicy: &vRestartPolicy, + DnsPolicy: &vDnsPolicy, + HostNetwork: &vHostNetwork, + SecurityContext: &vSecurityContext, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Tolerations: &vTolerations, + StatusConditions: &vStatusConditions, + StatusContainer: &vStatusContainer, + PodIP: &vPodIP, + QosClass: &vQosClass, + Phase: &vPhase, + StartTime: &vStartTime, + NodeName: &vNodeName, + } + vGlobalServiceInstanceList = append(vGlobalServiceInstanceList, ret) + + log.Debugf("[getGlobalServiceJobServiceInstancesResolver]Output ServiceInstances objects %v", vGlobalServiceInstanceList) + + return vGlobalServiceInstanceList, nil + } + + log.Debug("[getGlobalServiceJobServiceInstancesResolver]Id is empty, process all ServiceInstancess") + + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceJobs(context.TODO(), getParentName(obj.ParentLabels, "servicejobs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceJobServiceInstancesResolver]Error getting parent node %s", err) + return vGlobalServiceInstanceList, nil + } + vServiceInstanceAllObj, err := vServiceInstanceParent.GetAllServiceInstances(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceJobServiceInstancesResolver]Error getting ServiceInstances %s", err) + return vGlobalServiceInstanceList, nil + } + for _, i := range vServiceInstanceAllObj { + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceJobs(context.TODO(), getParentName(obj.ParentLabels, "servicejobs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceJobServiceInstancesResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceInstance, err := vServiceInstanceParent.GetServiceInstances(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceJobServiceInstancesResolver]Error getting ServiceInstances node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceInstance.DisplayName() +parentLabels := map[string]interface{}{"serviceinstances.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceInstance.Spec.Metadata) +vSpec := string(vServiceInstance.Spec.Spec) +vStatus := string(vServiceInstance.Spec.Status) +vName := string(vServiceInstance.Spec.Name) +vNamespace := string(vServiceInstance.Spec.Namespace) +vAnnotations := string(vServiceInstance.Spec.Annotations) +vLabels := string(vServiceInstance.Spec.Labels) +vApiLink := string(vServiceInstance.Spec.ApiLink) +vUid := string(vServiceInstance.Spec.Uid) +vRestartPolicy := string(vServiceInstance.Spec.RestartPolicy) +vDnsPolicy := string(vServiceInstance.Spec.DnsPolicy) +vHostNetwork := bool(vServiceInstance.Spec.HostNetwork) +vSecurityContext := string(vServiceInstance.Spec.SecurityContext) +vTerminationGracePeriodSeconds := int(vServiceInstance.Spec.TerminationGracePeriodSeconds) +vTolerations := string(vServiceInstance.Spec.Tolerations) +vStatusConditions := string(vServiceInstance.Spec.StatusConditions) +vStatusContainer := string(vServiceInstance.Spec.StatusContainer) +vPodIP := string(vServiceInstance.Spec.PodIP) +vQosClass := string(vServiceInstance.Spec.QosClass) +vPhase := string(vServiceInstance.Spec.Phase) +vStartTime := string(vServiceInstance.Spec.StartTime) +vNodeName := string(vServiceInstance.Spec.NodeName) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceInstance { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Name: &vName, + Namespace: &vNamespace, + Annotations: &vAnnotations, + Labels: &vLabels, + ApiLink: &vApiLink, + Uid: &vUid, + RestartPolicy: &vRestartPolicy, + DnsPolicy: &vDnsPolicy, + HostNetwork: &vHostNetwork, + SecurityContext: &vSecurityContext, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Tolerations: &vTolerations, + StatusConditions: &vStatusConditions, + StatusContainer: &vStatusContainer, + PodIP: &vPodIP, + QosClass: &vQosClass, + Phase: &vPhase, + StartTime: &vStartTime, + NodeName: &vNodeName, + } + vGlobalServiceInstanceList = append(vGlobalServiceInstanceList, ret) + } + log.Debugf("[getGlobalServiceJobServiceInstancesResolver]List of ServiceInstances object %v", vGlobalServiceInstanceList) + return vGlobalServiceInstanceList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceLevelObjectives Node: ServiceLevelObjectiveFolder PKG: Global +////////////////////////////////////// +func getGlobalServiceLevelObjectiveFolderServiceLevelObjectivesResolver(obj *model.GlobalServiceLevelObjectiveFolder, id *string) ([]*model.GlobalServiceLevelObjective, error) { + log.Debugf("[getGlobalServiceLevelObjectiveFolderServiceLevelObjectivesResolver]Parent Object %+v", obj) + var vGlobalServiceLevelObjectiveList []*model.GlobalServiceLevelObjective + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceLevelObjectiveFolderServiceLevelObjectivesResolver]Id %q", *id) + vServiceLevelObjective, err := nc.GlobalRoot().Config().ServiceLevelObjective(getParentName(obj.ParentLabels, "servicelevelobjectivefolders.global.tsm.tanzu.vmware.com")).GetServiceLevelObjectives(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceLevelObjectiveFolderServiceLevelObjectivesResolver]Error getting ServiceLevelObjectives node %q : %s", *id, err) + return vGlobalServiceLevelObjectiveList, nil + } + dn := vServiceLevelObjective.DisplayName() +parentLabels := map[string]interface{}{"servicelevelobjectives.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vServiceLevelObjective.Spec.ProjectId) +vDisabled := bool(vServiceLevelObjective.Spec.Disabled) +vDescription := string(vServiceLevelObjective.Spec.Description) +vLabels := string(vServiceLevelObjective.Spec.Labels) +vSlis := string(vServiceLevelObjective.Spec.Slis) +vSloServices := string(vServiceLevelObjective.Spec.SloServices) +vSloTargetValue := string(vServiceLevelObjective.Spec.SloTargetValue) +vSloPeriod := string(vServiceLevelObjective.Spec.SloPeriod) +vSloCreationTime := string(vServiceLevelObjective.Spec.SloCreationTime) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceLevelObjective { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + Disabled: &vDisabled, + Description: &vDescription, + Labels: &vLabels, + Slis: &vSlis, + SloServices: &vSloServices, + SloTargetValue: &vSloTargetValue, + SloPeriod: &vSloPeriod, + SloCreationTime: &vSloCreationTime, + } + vGlobalServiceLevelObjectiveList = append(vGlobalServiceLevelObjectiveList, ret) + + log.Debugf("[getGlobalServiceLevelObjectiveFolderServiceLevelObjectivesResolver]Output ServiceLevelObjectives objects %v", vGlobalServiceLevelObjectiveList) + + return vGlobalServiceLevelObjectiveList, nil + } + + log.Debug("[getGlobalServiceLevelObjectiveFolderServiceLevelObjectivesResolver]Id is empty, process all ServiceLevelObjectivess") + + vServiceLevelObjectiveParent, err := nc.GlobalRoot().Config().GetServiceLevelObjective(context.TODO(), getParentName(obj.ParentLabels, "servicelevelobjectivefolders.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceLevelObjectiveFolderServiceLevelObjectivesResolver]Error getting parent node %s", err) + return vGlobalServiceLevelObjectiveList, nil + } + vServiceLevelObjectiveAllObj, err := vServiceLevelObjectiveParent.GetAllServiceLevelObjectives(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceLevelObjectiveFolderServiceLevelObjectivesResolver]Error getting ServiceLevelObjectives objects %s", err) + return vGlobalServiceLevelObjectiveList, nil + } + for _, i := range vServiceLevelObjectiveAllObj { + vServiceLevelObjective, err := nc.GlobalRoot().Config().ServiceLevelObjective(getParentName(obj.ParentLabels, "servicelevelobjectivefolders.global.tsm.tanzu.vmware.com")).GetServiceLevelObjectives(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceLevelObjectiveFolderServiceLevelObjectivesResolver]Error getting ServiceLevelObjectives node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceLevelObjective.DisplayName() +parentLabels := map[string]interface{}{"servicelevelobjectives.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vServiceLevelObjective.Spec.ProjectId) +vDisabled := bool(vServiceLevelObjective.Spec.Disabled) +vDescription := string(vServiceLevelObjective.Spec.Description) +vLabels := string(vServiceLevelObjective.Spec.Labels) +vSlis := string(vServiceLevelObjective.Spec.Slis) +vSloServices := string(vServiceLevelObjective.Spec.SloServices) +vSloTargetValue := string(vServiceLevelObjective.Spec.SloTargetValue) +vSloPeriod := string(vServiceLevelObjective.Spec.SloPeriod) +vSloCreationTime := string(vServiceLevelObjective.Spec.SloCreationTime) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceLevelObjective { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + Disabled: &vDisabled, + Description: &vDescription, + Labels: &vLabels, + Slis: &vSlis, + SloServices: &vSloServices, + SloTargetValue: &vSloTargetValue, + SloPeriod: &vSloPeriod, + SloCreationTime: &vSloCreationTime, + } + vGlobalServiceLevelObjectiveList = append(vGlobalServiceLevelObjectiveList, ret) + } + + log.Debugf("[getGlobalServiceLevelObjectiveFolderServiceLevelObjectivesResolver]Output ServiceLevelObjectives objects %v", vGlobalServiceLevelObjectiveList) + + return vGlobalServiceLevelObjectiveList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceInstances Node: ServiceReplicaSet PKG: Global +////////////////////////////////////// +func getGlobalServiceReplicaSetServiceInstancesResolver(obj *model.GlobalServiceReplicaSet, id *string) ([]*model.GlobalServiceInstance, error) { + log.Debugf("[getGlobalServiceReplicaSetServiceInstancesResolver]Parent Object %+v", obj) + var vGlobalServiceInstanceList []*model.GlobalServiceInstance + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceReplicaSetServiceInstancesResolver]Id %q", *id) + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceReplicaSets(context.TODO(), getParentName(obj.ParentLabels, "servicereplicasets.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceReplicaSetServiceInstancesResolver]Error getting ServiceInstances %q : %s", *id, err) + return vGlobalServiceInstanceList, nil + } + vServiceInstance, err := vServiceInstanceParent.GetServiceInstances(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceReplicaSetServiceInstancesResolver]Error getting ServiceInstances %q : %s", *id, err) + return vGlobalServiceInstanceList, nil + } + dn := vServiceInstance.DisplayName() +parentLabels := map[string]interface{}{"serviceinstances.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceInstance.Spec.Metadata) +vSpec := string(vServiceInstance.Spec.Spec) +vStatus := string(vServiceInstance.Spec.Status) +vName := string(vServiceInstance.Spec.Name) +vNamespace := string(vServiceInstance.Spec.Namespace) +vAnnotations := string(vServiceInstance.Spec.Annotations) +vLabels := string(vServiceInstance.Spec.Labels) +vApiLink := string(vServiceInstance.Spec.ApiLink) +vUid := string(vServiceInstance.Spec.Uid) +vRestartPolicy := string(vServiceInstance.Spec.RestartPolicy) +vDnsPolicy := string(vServiceInstance.Spec.DnsPolicy) +vHostNetwork := bool(vServiceInstance.Spec.HostNetwork) +vSecurityContext := string(vServiceInstance.Spec.SecurityContext) +vTerminationGracePeriodSeconds := int(vServiceInstance.Spec.TerminationGracePeriodSeconds) +vTolerations := string(vServiceInstance.Spec.Tolerations) +vStatusConditions := string(vServiceInstance.Spec.StatusConditions) +vStatusContainer := string(vServiceInstance.Spec.StatusContainer) +vPodIP := string(vServiceInstance.Spec.PodIP) +vQosClass := string(vServiceInstance.Spec.QosClass) +vPhase := string(vServiceInstance.Spec.Phase) +vStartTime := string(vServiceInstance.Spec.StartTime) +vNodeName := string(vServiceInstance.Spec.NodeName) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceInstance { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Name: &vName, + Namespace: &vNamespace, + Annotations: &vAnnotations, + Labels: &vLabels, + ApiLink: &vApiLink, + Uid: &vUid, + RestartPolicy: &vRestartPolicy, + DnsPolicy: &vDnsPolicy, + HostNetwork: &vHostNetwork, + SecurityContext: &vSecurityContext, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Tolerations: &vTolerations, + StatusConditions: &vStatusConditions, + StatusContainer: &vStatusContainer, + PodIP: &vPodIP, + QosClass: &vQosClass, + Phase: &vPhase, + StartTime: &vStartTime, + NodeName: &vNodeName, + } + vGlobalServiceInstanceList = append(vGlobalServiceInstanceList, ret) + + log.Debugf("[getGlobalServiceReplicaSetServiceInstancesResolver]Output ServiceInstances objects %v", vGlobalServiceInstanceList) + + return vGlobalServiceInstanceList, nil + } + + log.Debug("[getGlobalServiceReplicaSetServiceInstancesResolver]Id is empty, process all ServiceInstancess") + + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceReplicaSets(context.TODO(), getParentName(obj.ParentLabels, "servicereplicasets.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceReplicaSetServiceInstancesResolver]Error getting parent node %s", err) + return vGlobalServiceInstanceList, nil + } + vServiceInstanceAllObj, err := vServiceInstanceParent.GetAllServiceInstances(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceReplicaSetServiceInstancesResolver]Error getting ServiceInstances %s", err) + return vGlobalServiceInstanceList, nil + } + for _, i := range vServiceInstanceAllObj { + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceReplicaSets(context.TODO(), getParentName(obj.ParentLabels, "servicereplicasets.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceReplicaSetServiceInstancesResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceInstance, err := vServiceInstanceParent.GetServiceInstances(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceReplicaSetServiceInstancesResolver]Error getting ServiceInstances node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceInstance.DisplayName() +parentLabels := map[string]interface{}{"serviceinstances.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceInstance.Spec.Metadata) +vSpec := string(vServiceInstance.Spec.Spec) +vStatus := string(vServiceInstance.Spec.Status) +vName := string(vServiceInstance.Spec.Name) +vNamespace := string(vServiceInstance.Spec.Namespace) +vAnnotations := string(vServiceInstance.Spec.Annotations) +vLabels := string(vServiceInstance.Spec.Labels) +vApiLink := string(vServiceInstance.Spec.ApiLink) +vUid := string(vServiceInstance.Spec.Uid) +vRestartPolicy := string(vServiceInstance.Spec.RestartPolicy) +vDnsPolicy := string(vServiceInstance.Spec.DnsPolicy) +vHostNetwork := bool(vServiceInstance.Spec.HostNetwork) +vSecurityContext := string(vServiceInstance.Spec.SecurityContext) +vTerminationGracePeriodSeconds := int(vServiceInstance.Spec.TerminationGracePeriodSeconds) +vTolerations := string(vServiceInstance.Spec.Tolerations) +vStatusConditions := string(vServiceInstance.Spec.StatusConditions) +vStatusContainer := string(vServiceInstance.Spec.StatusContainer) +vPodIP := string(vServiceInstance.Spec.PodIP) +vQosClass := string(vServiceInstance.Spec.QosClass) +vPhase := string(vServiceInstance.Spec.Phase) +vStartTime := string(vServiceInstance.Spec.StartTime) +vNodeName := string(vServiceInstance.Spec.NodeName) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceInstance { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Name: &vName, + Namespace: &vNamespace, + Annotations: &vAnnotations, + Labels: &vLabels, + ApiLink: &vApiLink, + Uid: &vUid, + RestartPolicy: &vRestartPolicy, + DnsPolicy: &vDnsPolicy, + HostNetwork: &vHostNetwork, + SecurityContext: &vSecurityContext, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Tolerations: &vTolerations, + StatusConditions: &vStatusConditions, + StatusContainer: &vStatusContainer, + PodIP: &vPodIP, + QosClass: &vQosClass, + Phase: &vPhase, + StartTime: &vStartTime, + NodeName: &vNodeName, + } + vGlobalServiceInstanceList = append(vGlobalServiceInstanceList, ret) + } + log.Debugf("[getGlobalServiceReplicaSetServiceInstancesResolver]List of ServiceInstances object %v", vGlobalServiceInstanceList) + return vGlobalServiceInstanceList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceInstances Node: ServiceStatefulSet PKG: Global +////////////////////////////////////// +func getGlobalServiceStatefulSetServiceInstancesResolver(obj *model.GlobalServiceStatefulSet, id *string) ([]*model.GlobalServiceInstance, error) { + log.Debugf("[getGlobalServiceStatefulSetServiceInstancesResolver]Parent Object %+v", obj) + var vGlobalServiceInstanceList []*model.GlobalServiceInstance + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceStatefulSetServiceInstancesResolver]Id %q", *id) + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceStatefulSets(context.TODO(), getParentName(obj.ParentLabels, "servicestatefulsets.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceStatefulSetServiceInstancesResolver]Error getting ServiceInstances %q : %s", *id, err) + return vGlobalServiceInstanceList, nil + } + vServiceInstance, err := vServiceInstanceParent.GetServiceInstances(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceStatefulSetServiceInstancesResolver]Error getting ServiceInstances %q : %s", *id, err) + return vGlobalServiceInstanceList, nil + } + dn := vServiceInstance.DisplayName() +parentLabels := map[string]interface{}{"serviceinstances.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceInstance.Spec.Metadata) +vSpec := string(vServiceInstance.Spec.Spec) +vStatus := string(vServiceInstance.Spec.Status) +vName := string(vServiceInstance.Spec.Name) +vNamespace := string(vServiceInstance.Spec.Namespace) +vAnnotations := string(vServiceInstance.Spec.Annotations) +vLabels := string(vServiceInstance.Spec.Labels) +vApiLink := string(vServiceInstance.Spec.ApiLink) +vUid := string(vServiceInstance.Spec.Uid) +vRestartPolicy := string(vServiceInstance.Spec.RestartPolicy) +vDnsPolicy := string(vServiceInstance.Spec.DnsPolicy) +vHostNetwork := bool(vServiceInstance.Spec.HostNetwork) +vSecurityContext := string(vServiceInstance.Spec.SecurityContext) +vTerminationGracePeriodSeconds := int(vServiceInstance.Spec.TerminationGracePeriodSeconds) +vTolerations := string(vServiceInstance.Spec.Tolerations) +vStatusConditions := string(vServiceInstance.Spec.StatusConditions) +vStatusContainer := string(vServiceInstance.Spec.StatusContainer) +vPodIP := string(vServiceInstance.Spec.PodIP) +vQosClass := string(vServiceInstance.Spec.QosClass) +vPhase := string(vServiceInstance.Spec.Phase) +vStartTime := string(vServiceInstance.Spec.StartTime) +vNodeName := string(vServiceInstance.Spec.NodeName) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceInstance { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Name: &vName, + Namespace: &vNamespace, + Annotations: &vAnnotations, + Labels: &vLabels, + ApiLink: &vApiLink, + Uid: &vUid, + RestartPolicy: &vRestartPolicy, + DnsPolicy: &vDnsPolicy, + HostNetwork: &vHostNetwork, + SecurityContext: &vSecurityContext, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Tolerations: &vTolerations, + StatusConditions: &vStatusConditions, + StatusContainer: &vStatusContainer, + PodIP: &vPodIP, + QosClass: &vQosClass, + Phase: &vPhase, + StartTime: &vStartTime, + NodeName: &vNodeName, + } + vGlobalServiceInstanceList = append(vGlobalServiceInstanceList, ret) + + log.Debugf("[getGlobalServiceStatefulSetServiceInstancesResolver]Output ServiceInstances objects %v", vGlobalServiceInstanceList) + + return vGlobalServiceInstanceList, nil + } + + log.Debug("[getGlobalServiceStatefulSetServiceInstancesResolver]Id is empty, process all ServiceInstancess") + + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceStatefulSets(context.TODO(), getParentName(obj.ParentLabels, "servicestatefulsets.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceStatefulSetServiceInstancesResolver]Error getting parent node %s", err) + return vGlobalServiceInstanceList, nil + } + vServiceInstanceAllObj, err := vServiceInstanceParent.GetAllServiceInstances(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceStatefulSetServiceInstancesResolver]Error getting ServiceInstances %s", err) + return vGlobalServiceInstanceList, nil + } + for _, i := range vServiceInstanceAllObj { + vServiceInstanceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServiceStatefulSets(context.TODO(), getParentName(obj.ParentLabels, "servicestatefulsets.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceStatefulSetServiceInstancesResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceInstance, err := vServiceInstanceParent.GetServiceInstances(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceStatefulSetServiceInstancesResolver]Error getting ServiceInstances node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceInstance.DisplayName() +parentLabels := map[string]interface{}{"serviceinstances.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceInstance.Spec.Metadata) +vSpec := string(vServiceInstance.Spec.Spec) +vStatus := string(vServiceInstance.Spec.Status) +vName := string(vServiceInstance.Spec.Name) +vNamespace := string(vServiceInstance.Spec.Namespace) +vAnnotations := string(vServiceInstance.Spec.Annotations) +vLabels := string(vServiceInstance.Spec.Labels) +vApiLink := string(vServiceInstance.Spec.ApiLink) +vUid := string(vServiceInstance.Spec.Uid) +vRestartPolicy := string(vServiceInstance.Spec.RestartPolicy) +vDnsPolicy := string(vServiceInstance.Spec.DnsPolicy) +vHostNetwork := bool(vServiceInstance.Spec.HostNetwork) +vSecurityContext := string(vServiceInstance.Spec.SecurityContext) +vTerminationGracePeriodSeconds := int(vServiceInstance.Spec.TerminationGracePeriodSeconds) +vTolerations := string(vServiceInstance.Spec.Tolerations) +vStatusConditions := string(vServiceInstance.Spec.StatusConditions) +vStatusContainer := string(vServiceInstance.Spec.StatusContainer) +vPodIP := string(vServiceInstance.Spec.PodIP) +vQosClass := string(vServiceInstance.Spec.QosClass) +vPhase := string(vServiceInstance.Spec.Phase) +vStartTime := string(vServiceInstance.Spec.StartTime) +vNodeName := string(vServiceInstance.Spec.NodeName) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceInstance { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Name: &vName, + Namespace: &vNamespace, + Annotations: &vAnnotations, + Labels: &vLabels, + ApiLink: &vApiLink, + Uid: &vUid, + RestartPolicy: &vRestartPolicy, + DnsPolicy: &vDnsPolicy, + HostNetwork: &vHostNetwork, + SecurityContext: &vSecurityContext, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Tolerations: &vTolerations, + StatusConditions: &vStatusConditions, + StatusContainer: &vStatusContainer, + PodIP: &vPodIP, + QosClass: &vQosClass, + Phase: &vPhase, + StartTime: &vStartTime, + NodeName: &vNodeName, + } + vGlobalServiceInstanceList = append(vGlobalServiceInstanceList, ret) + } + log.Debugf("[getGlobalServiceStatefulSetServiceInstancesResolver]List of ServiceInstances object %v", vGlobalServiceInstanceList) + return vGlobalServiceInstanceList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceDefinitions Node: ServiceTemplate PKG: Global +////////////////////////////////////// +func getGlobalServiceTemplateServiceDefinitionsResolver(obj *model.GlobalServiceTemplate, id *string) ([]*model.GlobalServiceTemplateServiceDefinition, error) { + log.Debugf("[getGlobalServiceTemplateServiceDefinitionsResolver]Parent Object %+v", obj) + var vGlobalServiceTemplateServiceDefinitionList []*model.GlobalServiceTemplateServiceDefinition + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceTemplateServiceDefinitionsResolver]Id %q", *id) + vServiceTemplateServiceDefinition, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).ServiceTemplates(getParentName(obj.ParentLabels, "servicetemplates.global.tsm.tanzu.vmware.com")).GetServiceDefinitions(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceTemplateServiceDefinitionsResolver]Error getting ServiceDefinitions node %q : %s", *id, err) + return vGlobalServiceTemplateServiceDefinitionList, nil + } + dn := vServiceTemplateServiceDefinition.DisplayName() +parentLabels := map[string]interface{}{"servicetemplateservicedefinitions.global.tsm.tanzu.vmware.com":dn} +vType := string(vServiceTemplateServiceDefinition.Spec.Type) +vVersion := string(vServiceTemplateServiceDefinition.Spec.Version) +vTemplate := string(vServiceTemplateServiceDefinition.Spec.Template) +TemplateArgs, _ := json.Marshal(vServiceTemplateServiceDefinition.Spec.TemplateArgs) +TemplateArgsData := string(TemplateArgs) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceTemplateServiceDefinition { + Id: &dn, + ParentLabels: parentLabels, + Type: &vType, + Version: &vVersion, + Template: &vTemplate, + TemplateArgs: &TemplateArgsData, + } + vGlobalServiceTemplateServiceDefinitionList = append(vGlobalServiceTemplateServiceDefinitionList, ret) + + log.Debugf("[getGlobalServiceTemplateServiceDefinitionsResolver]Output ServiceDefinitions objects %v", vGlobalServiceTemplateServiceDefinitionList) + + return vGlobalServiceTemplateServiceDefinitionList, nil + } + + log.Debug("[getGlobalServiceTemplateServiceDefinitionsResolver]Id is empty, process all ServiceDefinitionss") + + vServiceTemplateServiceDefinitionParent, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).GetServiceTemplates(context.TODO(), getParentName(obj.ParentLabels, "servicetemplates.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceTemplateServiceDefinitionsResolver]Error getting parent node %s", err) + return vGlobalServiceTemplateServiceDefinitionList, nil + } + vServiceTemplateServiceDefinitionAllObj, err := vServiceTemplateServiceDefinitionParent.GetAllServiceDefinitions(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceTemplateServiceDefinitionsResolver]Error getting ServiceDefinitions objects %s", err) + return vGlobalServiceTemplateServiceDefinitionList, nil + } + for _, i := range vServiceTemplateServiceDefinitionAllObj { + vServiceTemplateServiceDefinition, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).ServiceTemplates(getParentName(obj.ParentLabels, "servicetemplates.global.tsm.tanzu.vmware.com")).GetServiceDefinitions(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceTemplateServiceDefinitionsResolver]Error getting ServiceDefinitions node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceTemplateServiceDefinition.DisplayName() +parentLabels := map[string]interface{}{"servicetemplateservicedefinitions.global.tsm.tanzu.vmware.com":dn} +vType := string(vServiceTemplateServiceDefinition.Spec.Type) +vVersion := string(vServiceTemplateServiceDefinition.Spec.Version) +vTemplate := string(vServiceTemplateServiceDefinition.Spec.Template) +TemplateArgs, _ := json.Marshal(vServiceTemplateServiceDefinition.Spec.TemplateArgs) +TemplateArgsData := string(TemplateArgs) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceTemplateServiceDefinition { + Id: &dn, + ParentLabels: parentLabels, + Type: &vType, + Version: &vVersion, + Template: &vTemplate, + TemplateArgs: &TemplateArgsData, + } + vGlobalServiceTemplateServiceDefinitionList = append(vGlobalServiceTemplateServiceDefinitionList, ret) + } + + log.Debugf("[getGlobalServiceTemplateServiceDefinitionsResolver]Output ServiceDefinitions objects %v", vGlobalServiceTemplateServiceDefinitionList) + + return vGlobalServiceTemplateServiceDefinitionList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: MetricMonitors Node: ServiceVersionConfig PKG: Global +////////////////////////////////////// +func getGlobalServiceVersionConfigMetricMonitorsResolver(obj *model.GlobalServiceVersionConfig, id *string) ([]*model.GlobalMetricMonitor, error) { + log.Debugf("[getGlobalServiceVersionConfigMetricMonitorsResolver]Parent Object %+v", obj) + var vGlobalMetricMonitorList []*model.GlobalMetricMonitor + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceVersionConfigMetricMonitorsResolver]Id %q", *id) + vMetricMonitor, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "serviceconfigs.global.tsm.tanzu.vmware.com")).ServiceVersion(getParentName(obj.ParentLabels, "serviceversionconfigs.global.tsm.tanzu.vmware.com")).GetMetricMonitors(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceVersionConfigMetricMonitorsResolver]Error getting MetricMonitors node %q : %s", *id, err) + return vGlobalMetricMonitorList, nil + } + dn := vMetricMonitor.DisplayName() +parentLabels := map[string]interface{}{"metricmonitors.global.tsm.tanzu.vmware.com":dn} +vOwnedBy := string(vMetricMonitor.Spec.OwnedBy) +vSvcMetric := string(vMetricMonitor.Spec.SvcMetric) +vFunctionType := string(vMetricMonitor.Spec.FunctionType) +vFunctionArgs := string(vMetricMonitor.Spec.FunctionArgs) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalMetricMonitor { + Id: &dn, + ParentLabels: parentLabels, + OwnedBy: &vOwnedBy, + SvcMetric: &vSvcMetric, + FunctionType: &vFunctionType, + FunctionArgs: &vFunctionArgs, + } + vGlobalMetricMonitorList = append(vGlobalMetricMonitorList, ret) + + log.Debugf("[getGlobalServiceVersionConfigMetricMonitorsResolver]Output MetricMonitors objects %v", vGlobalMetricMonitorList) + + return vGlobalMetricMonitorList, nil + } + + log.Debug("[getGlobalServiceVersionConfigMetricMonitorsResolver]Id is empty, process all MetricMonitorss") + + vMetricMonitorParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "serviceconfigs.global.tsm.tanzu.vmware.com")).GetServiceVersion(context.TODO(), getParentName(obj.ParentLabels, "serviceversionconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceVersionConfigMetricMonitorsResolver]Error getting parent node %s", err) + return vGlobalMetricMonitorList, nil + } + vMetricMonitorAllObj, err := vMetricMonitorParent.GetAllMetricMonitors(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceVersionConfigMetricMonitorsResolver]Error getting MetricMonitors objects %s", err) + return vGlobalMetricMonitorList, nil + } + for _, i := range vMetricMonitorAllObj { + vMetricMonitor, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "serviceconfigs.global.tsm.tanzu.vmware.com")).ServiceVersion(getParentName(obj.ParentLabels, "serviceversionconfigs.global.tsm.tanzu.vmware.com")).GetMetricMonitors(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceVersionConfigMetricMonitorsResolver]Error getting MetricMonitors node %q : %s", i.DisplayName(), err) + continue + } + dn := vMetricMonitor.DisplayName() +parentLabels := map[string]interface{}{"metricmonitors.global.tsm.tanzu.vmware.com":dn} +vOwnedBy := string(vMetricMonitor.Spec.OwnedBy) +vSvcMetric := string(vMetricMonitor.Spec.SvcMetric) +vFunctionType := string(vMetricMonitor.Spec.FunctionType) +vFunctionArgs := string(vMetricMonitor.Spec.FunctionArgs) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalMetricMonitor { + Id: &dn, + ParentLabels: parentLabels, + OwnedBy: &vOwnedBy, + SvcMetric: &vSvcMetric, + FunctionType: &vFunctionType, + FunctionArgs: &vFunctionArgs, + } + vGlobalMetricMonitorList = append(vGlobalMetricMonitorList, ret) + } + + log.Debugf("[getGlobalServiceVersionConfigMetricMonitorsResolver]Output MetricMonitors objects %v", vGlobalMetricMonitorList) + + return vGlobalMetricMonitorList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceDeployments Node: ServiceVersion PKG: Global +////////////////////////////////////// +func getGlobalServiceVersionServiceDeploymentsResolver(obj *model.GlobalServiceVersion, id *string) ([]*model.GlobalServiceDeployment, error) { + log.Debugf("[getGlobalServiceVersionServiceDeploymentsResolver]Parent Object %+v", obj) + var vGlobalServiceDeploymentList []*model.GlobalServiceDeployment + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceVersionServiceDeploymentsResolver]Id %q", *id) + vServiceDeploymentParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")).GetServiceVersions(context.TODO(), getParentName(obj.ParentLabels, "serviceversions.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceDeploymentsResolver]Error getting ServiceDeployments %q : %s", *id, err) + return vGlobalServiceDeploymentList, nil + } + vServiceDeployment, err := vServiceDeploymentParent.GetServiceDeployments(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceDeploymentsResolver]Error getting ServiceDeployments %q : %s", *id, err) + return vGlobalServiceDeploymentList, nil + } + dn := vServiceDeployment.DisplayName() +parentLabels := map[string]interface{}{"servicedeployments.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceDeployment.Spec.Metadata) +vSpec := string(vServiceDeployment.Spec.Spec) +vStatus := string(vServiceDeployment.Spec.Status) +vNamespace := string(vServiceDeployment.Spec.Namespace) +vAnnotations := string(vServiceDeployment.Spec.Annotations) +vCreationTimestamp := string(vServiceDeployment.Spec.CreationTimestamp) +vLabels := string(vServiceDeployment.Spec.Labels) +vName := string(vServiceDeployment.Spec.Name) +vApiLink := string(vServiceDeployment.Spec.ApiLink) +vUid := string(vServiceDeployment.Spec.Uid) +vGeneration := int(vServiceDeployment.Spec.Generation) +vSelector := string(vServiceDeployment.Spec.Selector) +vReplicas := int(vServiceDeployment.Spec.Replicas) +vDnsPolicy := string(vServiceDeployment.Spec.DnsPolicy) +vRestartPolicy := string(vServiceDeployment.Spec.RestartPolicy) +vSchedulerName := string(vServiceDeployment.Spec.SchedulerName) +vSecurityContext := string(vServiceDeployment.Spec.SecurityContext) +vServiceAccount := string(vServiceDeployment.Spec.ServiceAccount) +vServiceAccountName := string(vServiceDeployment.Spec.ServiceAccountName) +vTerminationGracePeriodSeconds := int(vServiceDeployment.Spec.TerminationGracePeriodSeconds) +vVolumes := string(vServiceDeployment.Spec.Volumes) +vTemplateLabels := string(vServiceDeployment.Spec.TemplateLabels) +vStatusReplicas := int(vServiceDeployment.Spec.StatusReplicas) +vAvailableReplicas := int(vServiceDeployment.Spec.AvailableReplicas) +vUpdatedReplicas := int(vServiceDeployment.Spec.UpdatedReplicas) +vReadyReplicas := int(vServiceDeployment.Spec.ReadyReplicas) +vObservedGeneration := int(vServiceDeployment.Spec.ObservedGeneration) +vConditions := string(vServiceDeployment.Spec.Conditions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDeployment { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Namespace: &vNamespace, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Name: &vName, + ApiLink: &vApiLink, + Uid: &vUid, + Generation: &vGeneration, + Selector: &vSelector, + Replicas: &vReplicas, + DnsPolicy: &vDnsPolicy, + RestartPolicy: &vRestartPolicy, + SchedulerName: &vSchedulerName, + SecurityContext: &vSecurityContext, + ServiceAccount: &vServiceAccount, + ServiceAccountName: &vServiceAccountName, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Volumes: &vVolumes, + TemplateLabels: &vTemplateLabels, + StatusReplicas: &vStatusReplicas, + AvailableReplicas: &vAvailableReplicas, + UpdatedReplicas: &vUpdatedReplicas, + ReadyReplicas: &vReadyReplicas, + ObservedGeneration: &vObservedGeneration, + Conditions: &vConditions, + } + vGlobalServiceDeploymentList = append(vGlobalServiceDeploymentList, ret) + + log.Debugf("[getGlobalServiceVersionServiceDeploymentsResolver]Output ServiceDeployments objects %v", vGlobalServiceDeploymentList) + + return vGlobalServiceDeploymentList, nil + } + + log.Debug("[getGlobalServiceVersionServiceDeploymentsResolver]Id is empty, process all ServiceDeploymentss") + + vServiceDeploymentParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")).GetServiceVersions(context.TODO(), getParentName(obj.ParentLabels, "serviceversions.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceDeploymentsResolver]Error getting parent node %s", err) + return vGlobalServiceDeploymentList, nil + } + vServiceDeploymentAllObj, err := vServiceDeploymentParent.GetAllServiceDeployments(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceDeploymentsResolver]Error getting ServiceDeployments %s", err) + return vGlobalServiceDeploymentList, nil + } + for _, i := range vServiceDeploymentAllObj { + vServiceDeploymentParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")).GetServiceVersions(context.TODO(), getParentName(obj.ParentLabels, "serviceversions.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceDeploymentsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceDeployment, err := vServiceDeploymentParent.GetServiceDeployments(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceDeploymentsResolver]Error getting ServiceDeployments node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceDeployment.DisplayName() +parentLabels := map[string]interface{}{"servicedeployments.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceDeployment.Spec.Metadata) +vSpec := string(vServiceDeployment.Spec.Spec) +vStatus := string(vServiceDeployment.Spec.Status) +vNamespace := string(vServiceDeployment.Spec.Namespace) +vAnnotations := string(vServiceDeployment.Spec.Annotations) +vCreationTimestamp := string(vServiceDeployment.Spec.CreationTimestamp) +vLabels := string(vServiceDeployment.Spec.Labels) +vName := string(vServiceDeployment.Spec.Name) +vApiLink := string(vServiceDeployment.Spec.ApiLink) +vUid := string(vServiceDeployment.Spec.Uid) +vGeneration := int(vServiceDeployment.Spec.Generation) +vSelector := string(vServiceDeployment.Spec.Selector) +vReplicas := int(vServiceDeployment.Spec.Replicas) +vDnsPolicy := string(vServiceDeployment.Spec.DnsPolicy) +vRestartPolicy := string(vServiceDeployment.Spec.RestartPolicy) +vSchedulerName := string(vServiceDeployment.Spec.SchedulerName) +vSecurityContext := string(vServiceDeployment.Spec.SecurityContext) +vServiceAccount := string(vServiceDeployment.Spec.ServiceAccount) +vServiceAccountName := string(vServiceDeployment.Spec.ServiceAccountName) +vTerminationGracePeriodSeconds := int(vServiceDeployment.Spec.TerminationGracePeriodSeconds) +vVolumes := string(vServiceDeployment.Spec.Volumes) +vTemplateLabels := string(vServiceDeployment.Spec.TemplateLabels) +vStatusReplicas := int(vServiceDeployment.Spec.StatusReplicas) +vAvailableReplicas := int(vServiceDeployment.Spec.AvailableReplicas) +vUpdatedReplicas := int(vServiceDeployment.Spec.UpdatedReplicas) +vReadyReplicas := int(vServiceDeployment.Spec.ReadyReplicas) +vObservedGeneration := int(vServiceDeployment.Spec.ObservedGeneration) +vConditions := string(vServiceDeployment.Spec.Conditions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDeployment { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Namespace: &vNamespace, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Name: &vName, + ApiLink: &vApiLink, + Uid: &vUid, + Generation: &vGeneration, + Selector: &vSelector, + Replicas: &vReplicas, + DnsPolicy: &vDnsPolicy, + RestartPolicy: &vRestartPolicy, + SchedulerName: &vSchedulerName, + SecurityContext: &vSecurityContext, + ServiceAccount: &vServiceAccount, + ServiceAccountName: &vServiceAccountName, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Volumes: &vVolumes, + TemplateLabels: &vTemplateLabels, + StatusReplicas: &vStatusReplicas, + AvailableReplicas: &vAvailableReplicas, + UpdatedReplicas: &vUpdatedReplicas, + ReadyReplicas: &vReadyReplicas, + ObservedGeneration: &vObservedGeneration, + Conditions: &vConditions, + } + vGlobalServiceDeploymentList = append(vGlobalServiceDeploymentList, ret) + } + log.Debugf("[getGlobalServiceVersionServiceDeploymentsResolver]List of ServiceDeployments object %v", vGlobalServiceDeploymentList) + return vGlobalServiceDeploymentList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceDaemonSets Node: ServiceVersion PKG: Global +////////////////////////////////////// +func getGlobalServiceVersionServiceDaemonSetsResolver(obj *model.GlobalServiceVersion, id *string) ([]*model.GlobalServiceDaemonSet, error) { + log.Debugf("[getGlobalServiceVersionServiceDaemonSetsResolver]Parent Object %+v", obj) + var vGlobalServiceDaemonSetList []*model.GlobalServiceDaemonSet + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceVersionServiceDaemonSetsResolver]Id %q", *id) + vServiceDaemonSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")).GetServiceVersions(context.TODO(), getParentName(obj.ParentLabels, "serviceversions.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceDaemonSetsResolver]Error getting ServiceDaemonSets %q : %s", *id, err) + return vGlobalServiceDaemonSetList, nil + } + vServiceDaemonSet, err := vServiceDaemonSetParent.GetServiceDaemonSets(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceDaemonSetsResolver]Error getting ServiceDaemonSets %q : %s", *id, err) + return vGlobalServiceDaemonSetList, nil + } + dn := vServiceDaemonSet.DisplayName() +parentLabels := map[string]interface{}{"servicedaemonsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceDaemonSet.Spec.Name) +vMetadata := string(vServiceDaemonSet.Spec.Metadata) +vSpec := string(vServiceDaemonSet.Spec.Spec) +vStatus := string(vServiceDaemonSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDaemonSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceDaemonSetList = append(vGlobalServiceDaemonSetList, ret) + + log.Debugf("[getGlobalServiceVersionServiceDaemonSetsResolver]Output ServiceDaemonSets objects %v", vGlobalServiceDaemonSetList) + + return vGlobalServiceDaemonSetList, nil + } + + log.Debug("[getGlobalServiceVersionServiceDaemonSetsResolver]Id is empty, process all ServiceDaemonSetss") + + vServiceDaemonSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")).GetServiceVersions(context.TODO(), getParentName(obj.ParentLabels, "serviceversions.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceDaemonSetsResolver]Error getting parent node %s", err) + return vGlobalServiceDaemonSetList, nil + } + vServiceDaemonSetAllObj, err := vServiceDaemonSetParent.GetAllServiceDaemonSets(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceDaemonSetsResolver]Error getting ServiceDaemonSets %s", err) + return vGlobalServiceDaemonSetList, nil + } + for _, i := range vServiceDaemonSetAllObj { + vServiceDaemonSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")).GetServiceVersions(context.TODO(), getParentName(obj.ParentLabels, "serviceversions.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceDaemonSetsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceDaemonSet, err := vServiceDaemonSetParent.GetServiceDaemonSets(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceDaemonSetsResolver]Error getting ServiceDaemonSets node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceDaemonSet.DisplayName() +parentLabels := map[string]interface{}{"servicedaemonsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceDaemonSet.Spec.Name) +vMetadata := string(vServiceDaemonSet.Spec.Metadata) +vSpec := string(vServiceDaemonSet.Spec.Spec) +vStatus := string(vServiceDaemonSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDaemonSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceDaemonSetList = append(vGlobalServiceDaemonSetList, ret) + } + log.Debugf("[getGlobalServiceVersionServiceDaemonSetsResolver]List of ServiceDaemonSets object %v", vGlobalServiceDaemonSetList) + return vGlobalServiceDaemonSetList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceStatefulSets Node: ServiceVersion PKG: Global +////////////////////////////////////// +func getGlobalServiceVersionServiceStatefulSetsResolver(obj *model.GlobalServiceVersion, id *string) ([]*model.GlobalServiceStatefulSet, error) { + log.Debugf("[getGlobalServiceVersionServiceStatefulSetsResolver]Parent Object %+v", obj) + var vGlobalServiceStatefulSetList []*model.GlobalServiceStatefulSet + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceVersionServiceStatefulSetsResolver]Id %q", *id) + vServiceStatefulSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")).GetServiceVersions(context.TODO(), getParentName(obj.ParentLabels, "serviceversions.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceStatefulSetsResolver]Error getting ServiceStatefulSets %q : %s", *id, err) + return vGlobalServiceStatefulSetList, nil + } + vServiceStatefulSet, err := vServiceStatefulSetParent.GetServiceStatefulSets(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceStatefulSetsResolver]Error getting ServiceStatefulSets %q : %s", *id, err) + return vGlobalServiceStatefulSetList, nil + } + dn := vServiceStatefulSet.DisplayName() +parentLabels := map[string]interface{}{"servicestatefulsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceStatefulSet.Spec.Name) +vMetadata := string(vServiceStatefulSet.Spec.Metadata) +vSpec := string(vServiceStatefulSet.Spec.Spec) +vStatus := string(vServiceStatefulSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceStatefulSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceStatefulSetList = append(vGlobalServiceStatefulSetList, ret) + + log.Debugf("[getGlobalServiceVersionServiceStatefulSetsResolver]Output ServiceStatefulSets objects %v", vGlobalServiceStatefulSetList) + + return vGlobalServiceStatefulSetList, nil + } + + log.Debug("[getGlobalServiceVersionServiceStatefulSetsResolver]Id is empty, process all ServiceStatefulSetss") + + vServiceStatefulSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")).GetServiceVersions(context.TODO(), getParentName(obj.ParentLabels, "serviceversions.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceStatefulSetsResolver]Error getting parent node %s", err) + return vGlobalServiceStatefulSetList, nil + } + vServiceStatefulSetAllObj, err := vServiceStatefulSetParent.GetAllServiceStatefulSets(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceStatefulSetsResolver]Error getting ServiceStatefulSets %s", err) + return vGlobalServiceStatefulSetList, nil + } + for _, i := range vServiceStatefulSetAllObj { + vServiceStatefulSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")).GetServiceVersions(context.TODO(), getParentName(obj.ParentLabels, "serviceversions.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceStatefulSetsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceStatefulSet, err := vServiceStatefulSetParent.GetServiceStatefulSets(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceVersionServiceStatefulSetsResolver]Error getting ServiceStatefulSets node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceStatefulSet.DisplayName() +parentLabels := map[string]interface{}{"servicestatefulsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceStatefulSet.Spec.Name) +vMetadata := string(vServiceStatefulSet.Spec.Metadata) +vSpec := string(vServiceStatefulSet.Spec.Spec) +vStatus := string(vServiceStatefulSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceStatefulSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceStatefulSetList = append(vGlobalServiceStatefulSetList, ret) + } + log.Debugf("[getGlobalServiceVersionServiceStatefulSetsResolver]List of ServiceStatefulSets object %v", vGlobalServiceStatefulSetList) + return vGlobalServiceStatefulSetList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: AdditionalAttributes Node: Service PKG: Global +////////////////////////////////////// +func getGlobalServiceAdditionalAttributesResolver(obj *model.GlobalService, id *string) ([]*model.GlobalAdditionalAttributes, error) { + log.Debugf("[getGlobalServiceAdditionalAttributesResolver]Parent Object %+v", obj) + var vGlobalAdditionalAttributesList []*model.GlobalAdditionalAttributes + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceAdditionalAttributesResolver]Id %q", *id) + vAdditionalAttributes, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")).GetAdditionalAttributes(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceAdditionalAttributesResolver]Error getting AdditionalAttributes node %q : %s", *id, err) + return vGlobalAdditionalAttributesList, nil + } + dn := vAdditionalAttributes.DisplayName() +parentLabels := map[string]interface{}{"additionalattributeses.global.tsm.tanzu.vmware.com":dn} +vName := string(vAdditionalAttributes.Spec.Name) +Value, _ := json.Marshal(vAdditionalAttributes.Spec.Value) +ValueData := string(Value) +vContext := string(vAdditionalAttributes.Spec.Context) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAdditionalAttributes { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Value: &ValueData, + Context: &vContext, + } + vGlobalAdditionalAttributesList = append(vGlobalAdditionalAttributesList, ret) + + log.Debugf("[getGlobalServiceAdditionalAttributesResolver]Output AdditionalAttributes objects %v", vGlobalAdditionalAttributesList) + + return vGlobalAdditionalAttributesList, nil + } + + log.Debug("[getGlobalServiceAdditionalAttributesResolver]Id is empty, process all AdditionalAttributess") + + vAdditionalAttributesParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceAdditionalAttributesResolver]Error getting parent node %s", err) + return vGlobalAdditionalAttributesList, nil + } + vAdditionalAttributesAllObj, err := vAdditionalAttributesParent.GetAllAdditionalAttributes(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceAdditionalAttributesResolver]Error getting AdditionalAttributes objects %s", err) + return vGlobalAdditionalAttributesList, nil + } + for _, i := range vAdditionalAttributesAllObj { + vAdditionalAttributes, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")).GetAdditionalAttributes(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceAdditionalAttributesResolver]Error getting AdditionalAttributes node %q : %s", i.DisplayName(), err) + continue + } + dn := vAdditionalAttributes.DisplayName() +parentLabels := map[string]interface{}{"additionalattributeses.global.tsm.tanzu.vmware.com":dn} +vName := string(vAdditionalAttributes.Spec.Name) +Value, _ := json.Marshal(vAdditionalAttributes.Spec.Value) +ValueData := string(Value) +vContext := string(vAdditionalAttributes.Spec.Context) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAdditionalAttributes { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Value: &ValueData, + Context: &vContext, + } + vGlobalAdditionalAttributesList = append(vGlobalAdditionalAttributesList, ret) + } + + log.Debugf("[getGlobalServiceAdditionalAttributesResolver]Output AdditionalAttributes objects %v", vGlobalAdditionalAttributesList) + + return vGlobalAdditionalAttributesList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceVersions Node: Service PKG: Global +////////////////////////////////////// +func getGlobalServiceServiceVersionsResolver(obj *model.GlobalService, id *string) ([]*model.GlobalServiceVersion, error) { + log.Debugf("[getGlobalServiceServiceVersionsResolver]Parent Object %+v", obj) + var vGlobalServiceVersionList []*model.GlobalServiceVersion + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceServiceVersionsResolver]Id %q", *id) + vServiceVersion, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")).GetServiceVersions(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceServiceVersionsResolver]Error getting ServiceVersions node %q : %s", *id, err) + return vGlobalServiceVersionList, nil + } + dn := vServiceVersion.DisplayName() +parentLabels := map[string]interface{}{"serviceversions.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceVersion.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceVersion { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + vGlobalServiceVersionList = append(vGlobalServiceVersionList, ret) + + log.Debugf("[getGlobalServiceServiceVersionsResolver]Output ServiceVersions objects %v", vGlobalServiceVersionList) + + return vGlobalServiceVersionList, nil + } + + log.Debug("[getGlobalServiceServiceVersionsResolver]Id is empty, process all ServiceVersionss") + + vServiceVersionParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceServiceVersionsResolver]Error getting parent node %s", err) + return vGlobalServiceVersionList, nil + } + vServiceVersionAllObj, err := vServiceVersionParent.GetAllServiceVersions(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceServiceVersionsResolver]Error getting ServiceVersions objects %s", err) + return vGlobalServiceVersionList, nil + } + for _, i := range vServiceVersionAllObj { + vServiceVersion, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).Services(getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")).GetServiceVersions(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceServiceVersionsResolver]Error getting ServiceVersions node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceVersion.DisplayName() +parentLabels := map[string]interface{}{"serviceversions.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceVersion.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceVersion { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + vGlobalServiceVersionList = append(vGlobalServiceVersionList, ret) + } + + log.Debugf("[getGlobalServiceServiceVersionsResolver]Output ServiceVersions objects %v", vGlobalServiceVersionList) + + return vGlobalServiceVersionList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceDeployments Node: Service PKG: Global +////////////////////////////////////// +func getGlobalServiceServiceDeploymentsResolver(obj *model.GlobalService, id *string) ([]*model.GlobalServiceDeployment, error) { + log.Debugf("[getGlobalServiceServiceDeploymentsResolver]Parent Object %+v", obj) + var vGlobalServiceDeploymentList []*model.GlobalServiceDeployment + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceServiceDeploymentsResolver]Id %q", *id) + vServiceDeploymentParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceServiceDeploymentsResolver]Error getting ServiceDeployments %q : %s", *id, err) + return vGlobalServiceDeploymentList, nil + } + vServiceDeployment, err := vServiceDeploymentParent.GetServiceDeployments(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceServiceDeploymentsResolver]Error getting ServiceDeployments %q : %s", *id, err) + return vGlobalServiceDeploymentList, nil + } + dn := vServiceDeployment.DisplayName() +parentLabels := map[string]interface{}{"servicedeployments.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceDeployment.Spec.Metadata) +vSpec := string(vServiceDeployment.Spec.Spec) +vStatus := string(vServiceDeployment.Spec.Status) +vNamespace := string(vServiceDeployment.Spec.Namespace) +vAnnotations := string(vServiceDeployment.Spec.Annotations) +vCreationTimestamp := string(vServiceDeployment.Spec.CreationTimestamp) +vLabels := string(vServiceDeployment.Spec.Labels) +vName := string(vServiceDeployment.Spec.Name) +vApiLink := string(vServiceDeployment.Spec.ApiLink) +vUid := string(vServiceDeployment.Spec.Uid) +vGeneration := int(vServiceDeployment.Spec.Generation) +vSelector := string(vServiceDeployment.Spec.Selector) +vReplicas := int(vServiceDeployment.Spec.Replicas) +vDnsPolicy := string(vServiceDeployment.Spec.DnsPolicy) +vRestartPolicy := string(vServiceDeployment.Spec.RestartPolicy) +vSchedulerName := string(vServiceDeployment.Spec.SchedulerName) +vSecurityContext := string(vServiceDeployment.Spec.SecurityContext) +vServiceAccount := string(vServiceDeployment.Spec.ServiceAccount) +vServiceAccountName := string(vServiceDeployment.Spec.ServiceAccountName) +vTerminationGracePeriodSeconds := int(vServiceDeployment.Spec.TerminationGracePeriodSeconds) +vVolumes := string(vServiceDeployment.Spec.Volumes) +vTemplateLabels := string(vServiceDeployment.Spec.TemplateLabels) +vStatusReplicas := int(vServiceDeployment.Spec.StatusReplicas) +vAvailableReplicas := int(vServiceDeployment.Spec.AvailableReplicas) +vUpdatedReplicas := int(vServiceDeployment.Spec.UpdatedReplicas) +vReadyReplicas := int(vServiceDeployment.Spec.ReadyReplicas) +vObservedGeneration := int(vServiceDeployment.Spec.ObservedGeneration) +vConditions := string(vServiceDeployment.Spec.Conditions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDeployment { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Namespace: &vNamespace, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Name: &vName, + ApiLink: &vApiLink, + Uid: &vUid, + Generation: &vGeneration, + Selector: &vSelector, + Replicas: &vReplicas, + DnsPolicy: &vDnsPolicy, + RestartPolicy: &vRestartPolicy, + SchedulerName: &vSchedulerName, + SecurityContext: &vSecurityContext, + ServiceAccount: &vServiceAccount, + ServiceAccountName: &vServiceAccountName, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Volumes: &vVolumes, + TemplateLabels: &vTemplateLabels, + StatusReplicas: &vStatusReplicas, + AvailableReplicas: &vAvailableReplicas, + UpdatedReplicas: &vUpdatedReplicas, + ReadyReplicas: &vReadyReplicas, + ObservedGeneration: &vObservedGeneration, + Conditions: &vConditions, + } + vGlobalServiceDeploymentList = append(vGlobalServiceDeploymentList, ret) + + log.Debugf("[getGlobalServiceServiceDeploymentsResolver]Output ServiceDeployments objects %v", vGlobalServiceDeploymentList) + + return vGlobalServiceDeploymentList, nil + } + + log.Debug("[getGlobalServiceServiceDeploymentsResolver]Id is empty, process all ServiceDeploymentss") + + vServiceDeploymentParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceServiceDeploymentsResolver]Error getting parent node %s", err) + return vGlobalServiceDeploymentList, nil + } + vServiceDeploymentAllObj, err := vServiceDeploymentParent.GetAllServiceDeployments(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceServiceDeploymentsResolver]Error getting ServiceDeployments %s", err) + return vGlobalServiceDeploymentList, nil + } + for _, i := range vServiceDeploymentAllObj { + vServiceDeploymentParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceServiceDeploymentsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceDeployment, err := vServiceDeploymentParent.GetServiceDeployments(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceServiceDeploymentsResolver]Error getting ServiceDeployments node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceDeployment.DisplayName() +parentLabels := map[string]interface{}{"servicedeployments.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceDeployment.Spec.Metadata) +vSpec := string(vServiceDeployment.Spec.Spec) +vStatus := string(vServiceDeployment.Spec.Status) +vNamespace := string(vServiceDeployment.Spec.Namespace) +vAnnotations := string(vServiceDeployment.Spec.Annotations) +vCreationTimestamp := string(vServiceDeployment.Spec.CreationTimestamp) +vLabels := string(vServiceDeployment.Spec.Labels) +vName := string(vServiceDeployment.Spec.Name) +vApiLink := string(vServiceDeployment.Spec.ApiLink) +vUid := string(vServiceDeployment.Spec.Uid) +vGeneration := int(vServiceDeployment.Spec.Generation) +vSelector := string(vServiceDeployment.Spec.Selector) +vReplicas := int(vServiceDeployment.Spec.Replicas) +vDnsPolicy := string(vServiceDeployment.Spec.DnsPolicy) +vRestartPolicy := string(vServiceDeployment.Spec.RestartPolicy) +vSchedulerName := string(vServiceDeployment.Spec.SchedulerName) +vSecurityContext := string(vServiceDeployment.Spec.SecurityContext) +vServiceAccount := string(vServiceDeployment.Spec.ServiceAccount) +vServiceAccountName := string(vServiceDeployment.Spec.ServiceAccountName) +vTerminationGracePeriodSeconds := int(vServiceDeployment.Spec.TerminationGracePeriodSeconds) +vVolumes := string(vServiceDeployment.Spec.Volumes) +vTemplateLabels := string(vServiceDeployment.Spec.TemplateLabels) +vStatusReplicas := int(vServiceDeployment.Spec.StatusReplicas) +vAvailableReplicas := int(vServiceDeployment.Spec.AvailableReplicas) +vUpdatedReplicas := int(vServiceDeployment.Spec.UpdatedReplicas) +vReadyReplicas := int(vServiceDeployment.Spec.ReadyReplicas) +vObservedGeneration := int(vServiceDeployment.Spec.ObservedGeneration) +vConditions := string(vServiceDeployment.Spec.Conditions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDeployment { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Namespace: &vNamespace, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Name: &vName, + ApiLink: &vApiLink, + Uid: &vUid, + Generation: &vGeneration, + Selector: &vSelector, + Replicas: &vReplicas, + DnsPolicy: &vDnsPolicy, + RestartPolicy: &vRestartPolicy, + SchedulerName: &vSchedulerName, + SecurityContext: &vSecurityContext, + ServiceAccount: &vServiceAccount, + ServiceAccountName: &vServiceAccountName, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Volumes: &vVolumes, + TemplateLabels: &vTemplateLabels, + StatusReplicas: &vStatusReplicas, + AvailableReplicas: &vAvailableReplicas, + UpdatedReplicas: &vUpdatedReplicas, + ReadyReplicas: &vReadyReplicas, + ObservedGeneration: &vObservedGeneration, + Conditions: &vConditions, + } + vGlobalServiceDeploymentList = append(vGlobalServiceDeploymentList, ret) + } + log.Debugf("[getGlobalServiceServiceDeploymentsResolver]List of ServiceDeployments object %v", vGlobalServiceDeploymentList) + return vGlobalServiceDeploymentList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceStatefulSets Node: Service PKG: Global +////////////////////////////////////// +func getGlobalServiceServiceStatefulSetsResolver(obj *model.GlobalService, id *string) ([]*model.GlobalServiceStatefulSet, error) { + log.Debugf("[getGlobalServiceServiceStatefulSetsResolver]Parent Object %+v", obj) + var vGlobalServiceStatefulSetList []*model.GlobalServiceStatefulSet + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceServiceStatefulSetsResolver]Id %q", *id) + vServiceStatefulSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceServiceStatefulSetsResolver]Error getting ServiceStatefulSets %q : %s", *id, err) + return vGlobalServiceStatefulSetList, nil + } + vServiceStatefulSet, err := vServiceStatefulSetParent.GetServiceStatefulSets(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceServiceStatefulSetsResolver]Error getting ServiceStatefulSets %q : %s", *id, err) + return vGlobalServiceStatefulSetList, nil + } + dn := vServiceStatefulSet.DisplayName() +parentLabels := map[string]interface{}{"servicestatefulsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceStatefulSet.Spec.Name) +vMetadata := string(vServiceStatefulSet.Spec.Metadata) +vSpec := string(vServiceStatefulSet.Spec.Spec) +vStatus := string(vServiceStatefulSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceStatefulSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceStatefulSetList = append(vGlobalServiceStatefulSetList, ret) + + log.Debugf("[getGlobalServiceServiceStatefulSetsResolver]Output ServiceStatefulSets objects %v", vGlobalServiceStatefulSetList) + + return vGlobalServiceStatefulSetList, nil + } + + log.Debug("[getGlobalServiceServiceStatefulSetsResolver]Id is empty, process all ServiceStatefulSetss") + + vServiceStatefulSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceServiceStatefulSetsResolver]Error getting parent node %s", err) + return vGlobalServiceStatefulSetList, nil + } + vServiceStatefulSetAllObj, err := vServiceStatefulSetParent.GetAllServiceStatefulSets(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceServiceStatefulSetsResolver]Error getting ServiceStatefulSets %s", err) + return vGlobalServiceStatefulSetList, nil + } + for _, i := range vServiceStatefulSetAllObj { + vServiceStatefulSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceServiceStatefulSetsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceStatefulSet, err := vServiceStatefulSetParent.GetServiceStatefulSets(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceServiceStatefulSetsResolver]Error getting ServiceStatefulSets node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceStatefulSet.DisplayName() +parentLabels := map[string]interface{}{"servicestatefulsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceStatefulSet.Spec.Name) +vMetadata := string(vServiceStatefulSet.Spec.Metadata) +vSpec := string(vServiceStatefulSet.Spec.Spec) +vStatus := string(vServiceStatefulSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceStatefulSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceStatefulSetList = append(vGlobalServiceStatefulSetList, ret) + } + log.Debugf("[getGlobalServiceServiceStatefulSetsResolver]List of ServiceStatefulSets object %v", vGlobalServiceStatefulSetList) + return vGlobalServiceStatefulSetList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceDaemonSets Node: Service PKG: Global +////////////////////////////////////// +func getGlobalServiceServiceDaemonSetsResolver(obj *model.GlobalService, id *string) ([]*model.GlobalServiceDaemonSet, error) { + log.Debugf("[getGlobalServiceServiceDaemonSetsResolver]Parent Object %+v", obj) + var vGlobalServiceDaemonSetList []*model.GlobalServiceDaemonSet + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceServiceDaemonSetsResolver]Id %q", *id) + vServiceDaemonSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceServiceDaemonSetsResolver]Error getting ServiceDaemonSets %q : %s", *id, err) + return vGlobalServiceDaemonSetList, nil + } + vServiceDaemonSet, err := vServiceDaemonSetParent.GetServiceDaemonSets(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceServiceDaemonSetsResolver]Error getting ServiceDaemonSets %q : %s", *id, err) + return vGlobalServiceDaemonSetList, nil + } + dn := vServiceDaemonSet.DisplayName() +parentLabels := map[string]interface{}{"servicedaemonsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceDaemonSet.Spec.Name) +vMetadata := string(vServiceDaemonSet.Spec.Metadata) +vSpec := string(vServiceDaemonSet.Spec.Spec) +vStatus := string(vServiceDaemonSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDaemonSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceDaemonSetList = append(vGlobalServiceDaemonSetList, ret) + + log.Debugf("[getGlobalServiceServiceDaemonSetsResolver]Output ServiceDaemonSets objects %v", vGlobalServiceDaemonSetList) + + return vGlobalServiceDaemonSetList, nil + } + + log.Debug("[getGlobalServiceServiceDaemonSetsResolver]Id is empty, process all ServiceDaemonSetss") + + vServiceDaemonSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceServiceDaemonSetsResolver]Error getting parent node %s", err) + return vGlobalServiceDaemonSetList, nil + } + vServiceDaemonSetAllObj, err := vServiceDaemonSetParent.GetAllServiceDaemonSets(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceServiceDaemonSetsResolver]Error getting ServiceDaemonSets %s", err) + return vGlobalServiceDaemonSetList, nil + } + for _, i := range vServiceDaemonSetAllObj { + vServiceDaemonSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceServiceDaemonSetsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceDaemonSet, err := vServiceDaemonSetParent.GetServiceDaemonSets(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceServiceDaemonSetsResolver]Error getting ServiceDaemonSets node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceDaemonSet.DisplayName() +parentLabels := map[string]interface{}{"servicedaemonsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceDaemonSet.Spec.Name) +vMetadata := string(vServiceDaemonSet.Spec.Metadata) +vSpec := string(vServiceDaemonSet.Spec.Spec) +vStatus := string(vServiceDaemonSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDaemonSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceDaemonSetList = append(vGlobalServiceDaemonSetList, ret) + } + log.Debugf("[getGlobalServiceServiceDaemonSetsResolver]List of ServiceDaemonSets object %v", vGlobalServiceDaemonSetList) + return vGlobalServiceDaemonSetList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Endpoints Node: Service PKG: Global +////////////////////////////////////// +func getGlobalServiceEndpointsResolver(obj *model.GlobalService, id *string) ([]*model.GlobalEndpoints, error) { + log.Debugf("[getGlobalServiceEndpointsResolver]Parent Object %+v", obj) + var vGlobalEndpointsList []*model.GlobalEndpoints + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceEndpointsResolver]Id %q", *id) + vEndpointsParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceEndpointsResolver]Error getting Endpoints %q : %s", *id, err) + return vGlobalEndpointsList, nil + } + vEndpoints, err := vEndpointsParent.GetEndpoints(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceEndpointsResolver]Error getting Endpoints %q : %s", *id, err) + return vGlobalEndpointsList, nil + } + dn := vEndpoints.DisplayName() +parentLabels := map[string]interface{}{"endpoints.global.tsm.tanzu.vmware.com":dn} +vName := string(vEndpoints.Spec.Name) +vMetadata := string(vEndpoints.Spec.Metadata) +vSubsets := string(vEndpoints.Spec.Subsets) +vGnsId := string(vEndpoints.Spec.GnsId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalEndpoints { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Subsets: &vSubsets, + GnsId: &vGnsId, + } + vGlobalEndpointsList = append(vGlobalEndpointsList, ret) + + log.Debugf("[getGlobalServiceEndpointsResolver]Output Endpoints objects %v", vGlobalEndpointsList) + + return vGlobalEndpointsList, nil + } + + log.Debug("[getGlobalServiceEndpointsResolver]Id is empty, process all Endpointss") + + vEndpointsParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceEndpointsResolver]Error getting parent node %s", err) + return vGlobalEndpointsList, nil + } + vEndpointsAllObj, err := vEndpointsParent.GetAllEndpoints(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceEndpointsResolver]Error getting Endpoints %s", err) + return vGlobalEndpointsList, nil + } + for _, i := range vEndpointsAllObj { + vEndpointsParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceEndpointsResolver]Error getting parent node %s, skipping...", err) + continue + } + vEndpoints, err := vEndpointsParent.GetEndpoints(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceEndpointsResolver]Error getting Endpoints node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vEndpoints.DisplayName() +parentLabels := map[string]interface{}{"endpoints.global.tsm.tanzu.vmware.com":dn} +vName := string(vEndpoints.Spec.Name) +vMetadata := string(vEndpoints.Spec.Metadata) +vSubsets := string(vEndpoints.Spec.Subsets) +vGnsId := string(vEndpoints.Spec.GnsId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalEndpoints { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Subsets: &vSubsets, + GnsId: &vGnsId, + } + vGlobalEndpointsList = append(vGlobalEndpointsList, ret) + } + log.Debugf("[getGlobalServiceEndpointsResolver]List of Endpoints object %v", vGlobalEndpointsList) + return vGlobalEndpointsList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceReplicaSets Node: Service PKG: Global +////////////////////////////////////// +func getGlobalServiceServiceReplicaSetsResolver(obj *model.GlobalService, id *string) ([]*model.GlobalServiceReplicaSet, error) { + log.Debugf("[getGlobalServiceServiceReplicaSetsResolver]Parent Object %+v", obj) + var vGlobalServiceReplicaSetList []*model.GlobalServiceReplicaSet + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceServiceReplicaSetsResolver]Id %q", *id) + vServiceReplicaSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceServiceReplicaSetsResolver]Error getting ServiceReplicaSets %q : %s", *id, err) + return vGlobalServiceReplicaSetList, nil + } + vServiceReplicaSet, err := vServiceReplicaSetParent.GetServiceReplicaSets(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceServiceReplicaSetsResolver]Error getting ServiceReplicaSets %q : %s", *id, err) + return vGlobalServiceReplicaSetList, nil + } + dn := vServiceReplicaSet.DisplayName() +parentLabels := map[string]interface{}{"servicereplicasets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceReplicaSet.Spec.Name) +vMetadata := string(vServiceReplicaSet.Spec.Metadata) +vSpec := string(vServiceReplicaSet.Spec.Spec) +vStatus := string(vServiceReplicaSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceReplicaSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceReplicaSetList = append(vGlobalServiceReplicaSetList, ret) + + log.Debugf("[getGlobalServiceServiceReplicaSetsResolver]Output ServiceReplicaSets objects %v", vGlobalServiceReplicaSetList) + + return vGlobalServiceReplicaSetList, nil + } + + log.Debug("[getGlobalServiceServiceReplicaSetsResolver]Id is empty, process all ServiceReplicaSetss") + + vServiceReplicaSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceServiceReplicaSetsResolver]Error getting parent node %s", err) + return vGlobalServiceReplicaSetList, nil + } + vServiceReplicaSetAllObj, err := vServiceReplicaSetParent.GetAllServiceReplicaSets(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceServiceReplicaSetsResolver]Error getting ServiceReplicaSets %s", err) + return vGlobalServiceReplicaSetList, nil + } + for _, i := range vServiceReplicaSetAllObj { + vServiceReplicaSetParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceServiceReplicaSetsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceReplicaSet, err := vServiceReplicaSetParent.GetServiceReplicaSets(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceServiceReplicaSetsResolver]Error getting ServiceReplicaSets node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceReplicaSet.DisplayName() +parentLabels := map[string]interface{}{"servicereplicasets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceReplicaSet.Spec.Name) +vMetadata := string(vServiceReplicaSet.Spec.Metadata) +vSpec := string(vServiceReplicaSet.Spec.Spec) +vStatus := string(vServiceReplicaSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceReplicaSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceReplicaSetList = append(vGlobalServiceReplicaSetList, ret) + } + log.Debugf("[getGlobalServiceServiceReplicaSetsResolver]List of ServiceReplicaSets object %v", vGlobalServiceReplicaSetList) + return vGlobalServiceReplicaSetList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: ServiceJobs Node: Service PKG: Global +////////////////////////////////////// +func getGlobalServiceServiceJobsResolver(obj *model.GlobalService, id *string) ([]*model.GlobalServiceJob, error) { + log.Debugf("[getGlobalServiceServiceJobsResolver]Parent Object %+v", obj) + var vGlobalServiceJobList []*model.GlobalServiceJob + if id != nil && *id != "" { + log.Debugf("[getGlobalServiceServiceJobsResolver]Id %q", *id) + vServiceJobParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceServiceJobsResolver]Error getting ServiceJobs %q : %s", *id, err) + return vGlobalServiceJobList, nil + } + vServiceJob, err := vServiceJobParent.GetServiceJobs(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalServiceServiceJobsResolver]Error getting ServiceJobs %q : %s", *id, err) + return vGlobalServiceJobList, nil + } + dn := vServiceJob.DisplayName() +parentLabels := map[string]interface{}{"servicejobs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceJob.Spec.Name) +vMetadata := string(vServiceJob.Spec.Metadata) +vSpec := string(vServiceJob.Spec.Spec) +vStatus := string(vServiceJob.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceJob { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceJobList = append(vGlobalServiceJobList, ret) + + log.Debugf("[getGlobalServiceServiceJobsResolver]Output ServiceJobs objects %v", vGlobalServiceJobList) + + return vGlobalServiceJobList, nil + } + + log.Debug("[getGlobalServiceServiceJobsResolver]Id is empty, process all ServiceJobss") + + vServiceJobParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceServiceJobsResolver]Error getting parent node %s", err) + return vGlobalServiceJobList, nil + } + vServiceJobAllObj, err := vServiceJobParent.GetAllServiceJobs(context.TODO()) + if err != nil { + log.Errorf("[getGlobalServiceServiceJobsResolver]Error getting ServiceJobs %s", err) + return vGlobalServiceJobList, nil + } + for _, i := range vServiceJobAllObj { + vServiceJobParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetServices(context.TODO(), getParentName(obj.ParentLabels, "services.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalServiceServiceJobsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceJob, err := vServiceJobParent.GetServiceJobs(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalServiceServiceJobsResolver]Error getting ServiceJobs node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceJob.DisplayName() +parentLabels := map[string]interface{}{"servicejobs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceJob.Spec.Name) +vMetadata := string(vServiceJob.Spec.Metadata) +vSpec := string(vServiceJob.Spec.Spec) +vStatus := string(vServiceJob.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceJob { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceJobList = append(vGlobalServiceJobList, ret) + } + log.Debugf("[getGlobalServiceServiceJobsResolver]List of ServiceJobs object %v", vGlobalServiceJobList) + return vGlobalServiceJobList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: SloServices Node: SloConfig PKG: Global +////////////////////////////////////// +func getGlobalSloConfigSloServicesResolver(obj *model.GlobalSloConfig, id *string) ([]*model.GlobalSloServiceConfig, error) { + log.Debugf("[getGlobalSloConfigSloServicesResolver]Parent Object %+v", obj) + var vGlobalSloServiceConfigList []*model.GlobalSloServiceConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalSloConfigSloServicesResolver]Id %q", *id) + vSloServiceConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).Slos(getParentName(obj.ParentLabels, "sloconfigs.global.tsm.tanzu.vmware.com")).GetSloServices(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalSloConfigSloServicesResolver]Error getting SloServices node %q : %s", *id, err) + return vGlobalSloServiceConfigList, nil + } + dn := vSloServiceConfig.DisplayName() +parentLabels := map[string]interface{}{"sloserviceconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vSloServiceConfig.Spec.Name) +vRemainingBudget := int(vSloServiceConfig.Spec.RemainingBudget) +vLastUpdateTime := string(vSloServiceConfig.Spec.LastUpdateTime) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSloServiceConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + RemainingBudget: &vRemainingBudget, + LastUpdateTime: &vLastUpdateTime, + } + vGlobalSloServiceConfigList = append(vGlobalSloServiceConfigList, ret) + + log.Debugf("[getGlobalSloConfigSloServicesResolver]Output SloServices objects %v", vGlobalSloServiceConfigList) + + return vGlobalSloServiceConfigList, nil + } + + log.Debug("[getGlobalSloConfigSloServicesResolver]Id is empty, process all SloServicess") + + vSloServiceConfigParent, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).GetSlos(context.TODO(), getParentName(obj.ParentLabels, "sloconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalSloConfigSloServicesResolver]Error getting parent node %s", err) + return vGlobalSloServiceConfigList, nil + } + vSloServiceConfigAllObj, err := vSloServiceConfigParent.GetAllSloServices(context.TODO()) + if err != nil { + log.Errorf("[getGlobalSloConfigSloServicesResolver]Error getting SloServices objects %s", err) + return vGlobalSloServiceConfigList, nil + } + for _, i := range vSloServiceConfigAllObj { + vSloServiceConfig, err := nc.GlobalRoot().Runtime().ClusterFolder(getParentName(obj.ParentLabels, "clusterfolders.global.tsm.tanzu.vmware.com")).Clusters(getParentName(obj.ParentLabels, "clusterconfigs.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domainconfigs.global.tsm.tanzu.vmware.com")).Slos(getParentName(obj.ParentLabels, "sloconfigs.global.tsm.tanzu.vmware.com")).GetSloServices(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalSloConfigSloServicesResolver]Error getting SloServices node %q : %s", i.DisplayName(), err) + continue + } + dn := vSloServiceConfig.DisplayName() +parentLabels := map[string]interface{}{"sloserviceconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vSloServiceConfig.Spec.Name) +vRemainingBudget := int(vSloServiceConfig.Spec.RemainingBudget) +vLastUpdateTime := string(vSloServiceConfig.Spec.LastUpdateTime) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalSloServiceConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + RemainingBudget: &vRemainingBudget, + LastUpdateTime: &vLastUpdateTime, + } + vGlobalSloServiceConfigList = append(vGlobalSloServiceConfigList, ret) + } + + log.Debugf("[getGlobalSloConfigSloServicesResolver]Output SloServices objects %v", vGlobalSloServiceConfigList) + + return vGlobalSloServiceConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Slos Node: SLOFolder PKG: Global +////////////////////////////////////// +func getGlobalSLOFolderSlosResolver(obj *model.GlobalSLOFolder, id *string) ([]*model.GlobalFederatedSloConfig, error) { + log.Debugf("[getGlobalSLOFolderSlosResolver]Parent Object %+v", obj) + var vGlobalFederatedSloConfigList []*model.GlobalFederatedSloConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalSLOFolderSlosResolver]Id %q", *id) + vFederatedSloConfig, err := nc.GlobalRoot().Runtime().SloFolder(getParentName(obj.ParentLabels, "slofolders.global.tsm.tanzu.vmware.com")).GetSlos(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalSLOFolderSlosResolver]Error getting Slos node %q : %s", *id, err) + return vGlobalFederatedSloConfigList, nil + } + dn := vFederatedSloConfig.DisplayName() +parentLabels := map[string]interface{}{"federatedsloconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vFederatedSloConfig.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalFederatedSloConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + vGlobalFederatedSloConfigList = append(vGlobalFederatedSloConfigList, ret) + + log.Debugf("[getGlobalSLOFolderSlosResolver]Output Slos objects %v", vGlobalFederatedSloConfigList) + + return vGlobalFederatedSloConfigList, nil + } + + log.Debug("[getGlobalSLOFolderSlosResolver]Id is empty, process all Sloss") + + vFederatedSloConfigParent, err := nc.GlobalRoot().Runtime().GetSloFolder(context.TODO(), getParentName(obj.ParentLabels, "slofolders.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalSLOFolderSlosResolver]Error getting parent node %s", err) + return vGlobalFederatedSloConfigList, nil + } + vFederatedSloConfigAllObj, err := vFederatedSloConfigParent.GetAllSlos(context.TODO()) + if err != nil { + log.Errorf("[getGlobalSLOFolderSlosResolver]Error getting Slos objects %s", err) + return vGlobalFederatedSloConfigList, nil + } + for _, i := range vFederatedSloConfigAllObj { + vFederatedSloConfig, err := nc.GlobalRoot().Runtime().SloFolder(getParentName(obj.ParentLabels, "slofolders.global.tsm.tanzu.vmware.com")).GetSlos(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalSLOFolderSlosResolver]Error getting Slos node %q : %s", i.DisplayName(), err) + continue + } + dn := vFederatedSloConfig.DisplayName() +parentLabels := map[string]interface{}{"federatedsloconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vFederatedSloConfig.Spec.Name) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalFederatedSloConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + } + vGlobalFederatedSloConfigList = append(vGlobalFederatedSloConfigList, ret) + } + + log.Debugf("[getGlobalSLOFolderSlosResolver]Output Slos objects %v", vGlobalFederatedSloConfigList) + + return vGlobalFederatedSloConfigList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: SloServices Node: FederatedSloConfig PKG: Global +////////////////////////////////////// +func getGlobalFederatedSloConfigSloServicesResolver(obj *model.GlobalFederatedSloConfig, id *string) ([]*model.GlobalFederatedSloServiceConfig, error) { + log.Debugf("[getGlobalFederatedSloConfigSloServicesResolver]Parent Object %+v", obj) + var vGlobalFederatedSloServiceConfigList []*model.GlobalFederatedSloServiceConfig + if id != nil && *id != "" { + log.Debugf("[getGlobalFederatedSloConfigSloServicesResolver]Id %q", *id) + vFederatedSloServiceConfig, err := nc.GlobalRoot().Runtime().SloFolder(getParentName(obj.ParentLabels, "slofolders.global.tsm.tanzu.vmware.com")).Slos(getParentName(obj.ParentLabels, "federatedsloconfigs.global.tsm.tanzu.vmware.com")).GetSloServices(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalFederatedSloConfigSloServicesResolver]Error getting SloServices node %q : %s", *id, err) + return vGlobalFederatedSloServiceConfigList, nil + } + dn := vFederatedSloServiceConfig.DisplayName() +parentLabels := map[string]interface{}{"federatedsloserviceconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vFederatedSloServiceConfig.Spec.Name) +vRemainingBudget := int(vFederatedSloServiceConfig.Spec.RemainingBudget) +vLastUpdateTime := string(vFederatedSloServiceConfig.Spec.LastUpdateTime) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalFederatedSloServiceConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + RemainingBudget: &vRemainingBudget, + LastUpdateTime: &vLastUpdateTime, + } + vGlobalFederatedSloServiceConfigList = append(vGlobalFederatedSloServiceConfigList, ret) + + log.Debugf("[getGlobalFederatedSloConfigSloServicesResolver]Output SloServices objects %v", vGlobalFederatedSloServiceConfigList) + + return vGlobalFederatedSloServiceConfigList, nil + } + + log.Debug("[getGlobalFederatedSloConfigSloServicesResolver]Id is empty, process all SloServicess") + + vFederatedSloServiceConfigParent, err := nc.GlobalRoot().Runtime().SloFolder(getParentName(obj.ParentLabels, "slofolders.global.tsm.tanzu.vmware.com")).GetSlos(context.TODO(), getParentName(obj.ParentLabels, "federatedsloconfigs.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalFederatedSloConfigSloServicesResolver]Error getting parent node %s", err) + return vGlobalFederatedSloServiceConfigList, nil + } + vFederatedSloServiceConfigAllObj, err := vFederatedSloServiceConfigParent.GetAllSloServices(context.TODO()) + if err != nil { + log.Errorf("[getGlobalFederatedSloConfigSloServicesResolver]Error getting SloServices objects %s", err) + return vGlobalFederatedSloServiceConfigList, nil + } + for _, i := range vFederatedSloServiceConfigAllObj { + vFederatedSloServiceConfig, err := nc.GlobalRoot().Runtime().SloFolder(getParentName(obj.ParentLabels, "slofolders.global.tsm.tanzu.vmware.com")).Slos(getParentName(obj.ParentLabels, "federatedsloconfigs.global.tsm.tanzu.vmware.com")).GetSloServices(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalFederatedSloConfigSloServicesResolver]Error getting SloServices node %q : %s", i.DisplayName(), err) + continue + } + dn := vFederatedSloServiceConfig.DisplayName() +parentLabels := map[string]interface{}{"federatedsloserviceconfigs.global.tsm.tanzu.vmware.com":dn} +vName := string(vFederatedSloServiceConfig.Spec.Name) +vRemainingBudget := int(vFederatedSloServiceConfig.Spec.RemainingBudget) +vLastUpdateTime := string(vFederatedSloServiceConfig.Spec.LastUpdateTime) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalFederatedSloServiceConfig { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + RemainingBudget: &vRemainingBudget, + LastUpdateTime: &vLastUpdateTime, + } + vGlobalFederatedSloServiceConfigList = append(vGlobalFederatedSloServiceConfigList, ret) + } + + log.Debugf("[getGlobalFederatedSloConfigSloServicesResolver]Output SloServices objects %v", vGlobalFederatedSloServiceConfigList) + + return vGlobalFederatedSloServiceConfigList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Services Node: SvcGroup PKG: Global +////////////////////////////////////// +func getGlobalSvcGroupServicesResolver(obj *model.GlobalSvcGroup, id *string) ([]*model.GlobalService, error) { + log.Debugf("[getGlobalSvcGroupServicesResolver]Parent Object %+v", obj) + var vGlobalServiceList []*model.GlobalService + if id != nil && *id != "" { + log.Debugf("[getGlobalSvcGroupServicesResolver]Id %q", *id) + vServiceParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetSvcGroups(context.TODO(), getParentName(obj.ParentLabels, "svcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalSvcGroupServicesResolver]Error getting Services %q : %s", *id, err) + return vGlobalServiceList, nil + } + vService, err := vServiceParent.GetServices(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalSvcGroupServicesResolver]Error getting Services %q : %s", *id, err) + return vGlobalServiceList, nil + } + dn := vService.DisplayName() +parentLabels := map[string]interface{}{"services.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vService.Spec.Metadata) +vSpec := string(vService.Spec.Spec) +vName := string(vService.Spec.Name) +vNamespace := string(vService.Spec.Namespace) +vApiLink := string(vService.Spec.ApiLink) +vIpAddress := string(vService.Spec.IpAddress) +vAnnotations := string(vService.Spec.Annotations) +vCreationTimestamp := string(vService.Spec.CreationTimestamp) +vLabels := string(vService.Spec.Labels) +vUid := string(vService.Spec.Uid) +vPorts := string(vService.Spec.Ports) +vSelector := string(vService.Spec.Selector) +vType := string(vService.Spec.Type) +vStatus := string(vService.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalService { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Name: &vName, + Namespace: &vNamespace, + ApiLink: &vApiLink, + IpAddress: &vIpAddress, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Uid: &vUid, + Ports: &vPorts, + Selector: &vSelector, + Type: &vType, + Status: &vStatus, + } + vGlobalServiceList = append(vGlobalServiceList, ret) + + log.Debugf("[getGlobalSvcGroupServicesResolver]Output Services objects %v", vGlobalServiceList) + + return vGlobalServiceList, nil + } + + log.Debug("[getGlobalSvcGroupServicesResolver]Id is empty, process all Servicess") + + vServiceParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetSvcGroups(context.TODO(), getParentName(obj.ParentLabels, "svcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalSvcGroupServicesResolver]Error getting parent node %s", err) + return vGlobalServiceList, nil + } + vServiceAllObj, err := vServiceParent.GetAllServices(context.TODO()) + if err != nil { + log.Errorf("[getGlobalSvcGroupServicesResolver]Error getting Services %s", err) + return vGlobalServiceList, nil + } + for _, i := range vServiceAllObj { + vServiceParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetSvcGroups(context.TODO(), getParentName(obj.ParentLabels, "svcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalSvcGroupServicesResolver]Error getting parent node %s, skipping...", err) + continue + } + vService, err := vServiceParent.GetServices(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalSvcGroupServicesResolver]Error getting Services node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vService.DisplayName() +parentLabels := map[string]interface{}{"services.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vService.Spec.Metadata) +vSpec := string(vService.Spec.Spec) +vName := string(vService.Spec.Name) +vNamespace := string(vService.Spec.Namespace) +vApiLink := string(vService.Spec.ApiLink) +vIpAddress := string(vService.Spec.IpAddress) +vAnnotations := string(vService.Spec.Annotations) +vCreationTimestamp := string(vService.Spec.CreationTimestamp) +vLabels := string(vService.Spec.Labels) +vUid := string(vService.Spec.Uid) +vPorts := string(vService.Spec.Ports) +vSelector := string(vService.Spec.Selector) +vType := string(vService.Spec.Type) +vStatus := string(vService.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalService { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Name: &vName, + Namespace: &vNamespace, + ApiLink: &vApiLink, + IpAddress: &vIpAddress, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Uid: &vUid, + Ports: &vPorts, + Selector: &vSelector, + Type: &vType, + Status: &vStatus, + } + vGlobalServiceList = append(vGlobalServiceList, ret) + } + log.Debugf("[getGlobalSvcGroupServicesResolver]List of Services object %v", vGlobalServiceList) + return vGlobalServiceList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Deployments Node: SvcGroup PKG: Global +////////////////////////////////////// +func getGlobalSvcGroupDeploymentsResolver(obj *model.GlobalSvcGroup, id *string) ([]*model.GlobalServiceDeployment, error) { + log.Debugf("[getGlobalSvcGroupDeploymentsResolver]Parent Object %+v", obj) + var vGlobalServiceDeploymentList []*model.GlobalServiceDeployment + if id != nil && *id != "" { + log.Debugf("[getGlobalSvcGroupDeploymentsResolver]Id %q", *id) + vServiceDeploymentParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetSvcGroups(context.TODO(), getParentName(obj.ParentLabels, "svcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalSvcGroupDeploymentsResolver]Error getting Deployments %q : %s", *id, err) + return vGlobalServiceDeploymentList, nil + } + vServiceDeployment, err := vServiceDeploymentParent.GetDeployments(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalSvcGroupDeploymentsResolver]Error getting Deployments %q : %s", *id, err) + return vGlobalServiceDeploymentList, nil + } + dn := vServiceDeployment.DisplayName() +parentLabels := map[string]interface{}{"servicedeployments.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceDeployment.Spec.Metadata) +vSpec := string(vServiceDeployment.Spec.Spec) +vStatus := string(vServiceDeployment.Spec.Status) +vNamespace := string(vServiceDeployment.Spec.Namespace) +vAnnotations := string(vServiceDeployment.Spec.Annotations) +vCreationTimestamp := string(vServiceDeployment.Spec.CreationTimestamp) +vLabels := string(vServiceDeployment.Spec.Labels) +vName := string(vServiceDeployment.Spec.Name) +vApiLink := string(vServiceDeployment.Spec.ApiLink) +vUid := string(vServiceDeployment.Spec.Uid) +vGeneration := int(vServiceDeployment.Spec.Generation) +vSelector := string(vServiceDeployment.Spec.Selector) +vReplicas := int(vServiceDeployment.Spec.Replicas) +vDnsPolicy := string(vServiceDeployment.Spec.DnsPolicy) +vRestartPolicy := string(vServiceDeployment.Spec.RestartPolicy) +vSchedulerName := string(vServiceDeployment.Spec.SchedulerName) +vSecurityContext := string(vServiceDeployment.Spec.SecurityContext) +vServiceAccount := string(vServiceDeployment.Spec.ServiceAccount) +vServiceAccountName := string(vServiceDeployment.Spec.ServiceAccountName) +vTerminationGracePeriodSeconds := int(vServiceDeployment.Spec.TerminationGracePeriodSeconds) +vVolumes := string(vServiceDeployment.Spec.Volumes) +vTemplateLabels := string(vServiceDeployment.Spec.TemplateLabels) +vStatusReplicas := int(vServiceDeployment.Spec.StatusReplicas) +vAvailableReplicas := int(vServiceDeployment.Spec.AvailableReplicas) +vUpdatedReplicas := int(vServiceDeployment.Spec.UpdatedReplicas) +vReadyReplicas := int(vServiceDeployment.Spec.ReadyReplicas) +vObservedGeneration := int(vServiceDeployment.Spec.ObservedGeneration) +vConditions := string(vServiceDeployment.Spec.Conditions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDeployment { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Namespace: &vNamespace, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Name: &vName, + ApiLink: &vApiLink, + Uid: &vUid, + Generation: &vGeneration, + Selector: &vSelector, + Replicas: &vReplicas, + DnsPolicy: &vDnsPolicy, + RestartPolicy: &vRestartPolicy, + SchedulerName: &vSchedulerName, + SecurityContext: &vSecurityContext, + ServiceAccount: &vServiceAccount, + ServiceAccountName: &vServiceAccountName, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Volumes: &vVolumes, + TemplateLabels: &vTemplateLabels, + StatusReplicas: &vStatusReplicas, + AvailableReplicas: &vAvailableReplicas, + UpdatedReplicas: &vUpdatedReplicas, + ReadyReplicas: &vReadyReplicas, + ObservedGeneration: &vObservedGeneration, + Conditions: &vConditions, + } + vGlobalServiceDeploymentList = append(vGlobalServiceDeploymentList, ret) + + log.Debugf("[getGlobalSvcGroupDeploymentsResolver]Output Deployments objects %v", vGlobalServiceDeploymentList) + + return vGlobalServiceDeploymentList, nil + } + + log.Debug("[getGlobalSvcGroupDeploymentsResolver]Id is empty, process all Deploymentss") + + vServiceDeploymentParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetSvcGroups(context.TODO(), getParentName(obj.ParentLabels, "svcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalSvcGroupDeploymentsResolver]Error getting parent node %s", err) + return vGlobalServiceDeploymentList, nil + } + vServiceDeploymentAllObj, err := vServiceDeploymentParent.GetAllDeployments(context.TODO()) + if err != nil { + log.Errorf("[getGlobalSvcGroupDeploymentsResolver]Error getting Deployments %s", err) + return vGlobalServiceDeploymentList, nil + } + for _, i := range vServiceDeploymentAllObj { + vServiceDeploymentParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetSvcGroups(context.TODO(), getParentName(obj.ParentLabels, "svcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalSvcGroupDeploymentsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceDeployment, err := vServiceDeploymentParent.GetDeployments(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalSvcGroupDeploymentsResolver]Error getting Deployments node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceDeployment.DisplayName() +parentLabels := map[string]interface{}{"servicedeployments.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vServiceDeployment.Spec.Metadata) +vSpec := string(vServiceDeployment.Spec.Spec) +vStatus := string(vServiceDeployment.Spec.Status) +vNamespace := string(vServiceDeployment.Spec.Namespace) +vAnnotations := string(vServiceDeployment.Spec.Annotations) +vCreationTimestamp := string(vServiceDeployment.Spec.CreationTimestamp) +vLabels := string(vServiceDeployment.Spec.Labels) +vName := string(vServiceDeployment.Spec.Name) +vApiLink := string(vServiceDeployment.Spec.ApiLink) +vUid := string(vServiceDeployment.Spec.Uid) +vGeneration := int(vServiceDeployment.Spec.Generation) +vSelector := string(vServiceDeployment.Spec.Selector) +vReplicas := int(vServiceDeployment.Spec.Replicas) +vDnsPolicy := string(vServiceDeployment.Spec.DnsPolicy) +vRestartPolicy := string(vServiceDeployment.Spec.RestartPolicy) +vSchedulerName := string(vServiceDeployment.Spec.SchedulerName) +vSecurityContext := string(vServiceDeployment.Spec.SecurityContext) +vServiceAccount := string(vServiceDeployment.Spec.ServiceAccount) +vServiceAccountName := string(vServiceDeployment.Spec.ServiceAccountName) +vTerminationGracePeriodSeconds := int(vServiceDeployment.Spec.TerminationGracePeriodSeconds) +vVolumes := string(vServiceDeployment.Spec.Volumes) +vTemplateLabels := string(vServiceDeployment.Spec.TemplateLabels) +vStatusReplicas := int(vServiceDeployment.Spec.StatusReplicas) +vAvailableReplicas := int(vServiceDeployment.Spec.AvailableReplicas) +vUpdatedReplicas := int(vServiceDeployment.Spec.UpdatedReplicas) +vReadyReplicas := int(vServiceDeployment.Spec.ReadyReplicas) +vObservedGeneration := int(vServiceDeployment.Spec.ObservedGeneration) +vConditions := string(vServiceDeployment.Spec.Conditions) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDeployment { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + Namespace: &vNamespace, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Name: &vName, + ApiLink: &vApiLink, + Uid: &vUid, + Generation: &vGeneration, + Selector: &vSelector, + Replicas: &vReplicas, + DnsPolicy: &vDnsPolicy, + RestartPolicy: &vRestartPolicy, + SchedulerName: &vSchedulerName, + SecurityContext: &vSecurityContext, + ServiceAccount: &vServiceAccount, + ServiceAccountName: &vServiceAccountName, + TerminationGracePeriodSeconds: &vTerminationGracePeriodSeconds, + Volumes: &vVolumes, + TemplateLabels: &vTemplateLabels, + StatusReplicas: &vStatusReplicas, + AvailableReplicas: &vAvailableReplicas, + UpdatedReplicas: &vUpdatedReplicas, + ReadyReplicas: &vReadyReplicas, + ObservedGeneration: &vObservedGeneration, + Conditions: &vConditions, + } + vGlobalServiceDeploymentList = append(vGlobalServiceDeploymentList, ret) + } + log.Debugf("[getGlobalSvcGroupDeploymentsResolver]List of Deployments object %v", vGlobalServiceDeploymentList) + return vGlobalServiceDeploymentList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Daemonsets Node: SvcGroup PKG: Global +////////////////////////////////////// +func getGlobalSvcGroupDaemonsetsResolver(obj *model.GlobalSvcGroup, id *string) ([]*model.GlobalServiceDaemonSet, error) { + log.Debugf("[getGlobalSvcGroupDaemonsetsResolver]Parent Object %+v", obj) + var vGlobalServiceDaemonSetList []*model.GlobalServiceDaemonSet + if id != nil && *id != "" { + log.Debugf("[getGlobalSvcGroupDaemonsetsResolver]Id %q", *id) + vServiceDaemonSetParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetSvcGroups(context.TODO(), getParentName(obj.ParentLabels, "svcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalSvcGroupDaemonsetsResolver]Error getting Daemonsets %q : %s", *id, err) + return vGlobalServiceDaemonSetList, nil + } + vServiceDaemonSet, err := vServiceDaemonSetParent.GetDaemonsets(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalSvcGroupDaemonsetsResolver]Error getting Daemonsets %q : %s", *id, err) + return vGlobalServiceDaemonSetList, nil + } + dn := vServiceDaemonSet.DisplayName() +parentLabels := map[string]interface{}{"servicedaemonsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceDaemonSet.Spec.Name) +vMetadata := string(vServiceDaemonSet.Spec.Metadata) +vSpec := string(vServiceDaemonSet.Spec.Spec) +vStatus := string(vServiceDaemonSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDaemonSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceDaemonSetList = append(vGlobalServiceDaemonSetList, ret) + + log.Debugf("[getGlobalSvcGroupDaemonsetsResolver]Output Daemonsets objects %v", vGlobalServiceDaemonSetList) + + return vGlobalServiceDaemonSetList, nil + } + + log.Debug("[getGlobalSvcGroupDaemonsetsResolver]Id is empty, process all Daemonsetss") + + vServiceDaemonSetParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetSvcGroups(context.TODO(), getParentName(obj.ParentLabels, "svcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalSvcGroupDaemonsetsResolver]Error getting parent node %s", err) + return vGlobalServiceDaemonSetList, nil + } + vServiceDaemonSetAllObj, err := vServiceDaemonSetParent.GetAllDaemonsets(context.TODO()) + if err != nil { + log.Errorf("[getGlobalSvcGroupDaemonsetsResolver]Error getting Daemonsets %s", err) + return vGlobalServiceDaemonSetList, nil + } + for _, i := range vServiceDaemonSetAllObj { + vServiceDaemonSetParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetSvcGroups(context.TODO(), getParentName(obj.ParentLabels, "svcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalSvcGroupDaemonsetsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceDaemonSet, err := vServiceDaemonSetParent.GetDaemonsets(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalSvcGroupDaemonsetsResolver]Error getting Daemonsets node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceDaemonSet.DisplayName() +parentLabels := map[string]interface{}{"servicedaemonsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceDaemonSet.Spec.Name) +vMetadata := string(vServiceDaemonSet.Spec.Metadata) +vSpec := string(vServiceDaemonSet.Spec.Spec) +vStatus := string(vServiceDaemonSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceDaemonSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceDaemonSetList = append(vGlobalServiceDaemonSetList, ret) + } + log.Debugf("[getGlobalSvcGroupDaemonsetsResolver]List of Daemonsets object %v", vGlobalServiceDaemonSetList) + return vGlobalServiceDaemonSetList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Statefulsets Node: SvcGroup PKG: Global +////////////////////////////////////// +func getGlobalSvcGroupStatefulsetsResolver(obj *model.GlobalSvcGroup, id *string) ([]*model.GlobalServiceStatefulSet, error) { + log.Debugf("[getGlobalSvcGroupStatefulsetsResolver]Parent Object %+v", obj) + var vGlobalServiceStatefulSetList []*model.GlobalServiceStatefulSet + if id != nil && *id != "" { + log.Debugf("[getGlobalSvcGroupStatefulsetsResolver]Id %q", *id) + vServiceStatefulSetParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetSvcGroups(context.TODO(), getParentName(obj.ParentLabels, "svcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalSvcGroupStatefulsetsResolver]Error getting Statefulsets %q : %s", *id, err) + return vGlobalServiceStatefulSetList, nil + } + vServiceStatefulSet, err := vServiceStatefulSetParent.GetStatefulsets(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalSvcGroupStatefulsetsResolver]Error getting Statefulsets %q : %s", *id, err) + return vGlobalServiceStatefulSetList, nil + } + dn := vServiceStatefulSet.DisplayName() +parentLabels := map[string]interface{}{"servicestatefulsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceStatefulSet.Spec.Name) +vMetadata := string(vServiceStatefulSet.Spec.Metadata) +vSpec := string(vServiceStatefulSet.Spec.Spec) +vStatus := string(vServiceStatefulSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceStatefulSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceStatefulSetList = append(vGlobalServiceStatefulSetList, ret) + + log.Debugf("[getGlobalSvcGroupStatefulsetsResolver]Output Statefulsets objects %v", vGlobalServiceStatefulSetList) + + return vGlobalServiceStatefulSetList, nil + } + + log.Debug("[getGlobalSvcGroupStatefulsetsResolver]Id is empty, process all Statefulsetss") + + vServiceStatefulSetParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetSvcGroups(context.TODO(), getParentName(obj.ParentLabels, "svcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalSvcGroupStatefulsetsResolver]Error getting parent node %s", err) + return vGlobalServiceStatefulSetList, nil + } + vServiceStatefulSetAllObj, err := vServiceStatefulSetParent.GetAllStatefulsets(context.TODO()) + if err != nil { + log.Errorf("[getGlobalSvcGroupStatefulsetsResolver]Error getting Statefulsets %s", err) + return vGlobalServiceStatefulSetList, nil + } + for _, i := range vServiceStatefulSetAllObj { + vServiceStatefulSetParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetSvcGroups(context.TODO(), getParentName(obj.ParentLabels, "svcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalSvcGroupStatefulsetsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceStatefulSet, err := vServiceStatefulSetParent.GetStatefulsets(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalSvcGroupStatefulsetsResolver]Error getting Statefulsets node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceStatefulSet.DisplayName() +parentLabels := map[string]interface{}{"servicestatefulsets.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceStatefulSet.Spec.Name) +vMetadata := string(vServiceStatefulSet.Spec.Metadata) +vSpec := string(vServiceStatefulSet.Spec.Spec) +vStatus := string(vServiceStatefulSet.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceStatefulSet { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceStatefulSetList = append(vGlobalServiceStatefulSetList, ret) + } + log.Debugf("[getGlobalSvcGroupStatefulsetsResolver]List of Statefulsets object %v", vGlobalServiceStatefulSetList) + return vGlobalServiceStatefulSetList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Jobs Node: SvcGroup PKG: Global +////////////////////////////////////// +func getGlobalSvcGroupJobsResolver(obj *model.GlobalSvcGroup, id *string) ([]*model.GlobalServiceJob, error) { + log.Debugf("[getGlobalSvcGroupJobsResolver]Parent Object %+v", obj) + var vGlobalServiceJobList []*model.GlobalServiceJob + if id != nil && *id != "" { + log.Debugf("[getGlobalSvcGroupJobsResolver]Id %q", *id) + vServiceJobParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetSvcGroups(context.TODO(), getParentName(obj.ParentLabels, "svcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalSvcGroupJobsResolver]Error getting Jobs %q : %s", *id, err) + return vGlobalServiceJobList, nil + } + vServiceJob, err := vServiceJobParent.GetJobs(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalSvcGroupJobsResolver]Error getting Jobs %q : %s", *id, err) + return vGlobalServiceJobList, nil + } + dn := vServiceJob.DisplayName() +parentLabels := map[string]interface{}{"servicejobs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceJob.Spec.Name) +vMetadata := string(vServiceJob.Spec.Metadata) +vSpec := string(vServiceJob.Spec.Spec) +vStatus := string(vServiceJob.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceJob { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceJobList = append(vGlobalServiceJobList, ret) + + log.Debugf("[getGlobalSvcGroupJobsResolver]Output Jobs objects %v", vGlobalServiceJobList) + + return vGlobalServiceJobList, nil + } + + log.Debug("[getGlobalSvcGroupJobsResolver]Id is empty, process all Jobss") + + vServiceJobParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetSvcGroups(context.TODO(), getParentName(obj.ParentLabels, "svcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalSvcGroupJobsResolver]Error getting parent node %s", err) + return vGlobalServiceJobList, nil + } + vServiceJobAllObj, err := vServiceJobParent.GetAllJobs(context.TODO()) + if err != nil { + log.Errorf("[getGlobalSvcGroupJobsResolver]Error getting Jobs %s", err) + return vGlobalServiceJobList, nil + } + for _, i := range vServiceJobAllObj { + vServiceJobParent, err := nc.GlobalRoot().Config().ResourceGroups(getParentName(obj.ParentLabels, "resourcegroups.global.tsm.tanzu.vmware.com")).GetSvcGroups(context.TODO(), getParentName(obj.ParentLabels, "svcgroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalSvcGroupJobsResolver]Error getting parent node %s, skipping...", err) + continue + } + vServiceJob, err := vServiceJobParent.GetJobs(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalSvcGroupJobsResolver]Error getting Jobs node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vServiceJob.DisplayName() +parentLabels := map[string]interface{}{"servicejobs.global.tsm.tanzu.vmware.com":dn} +vName := string(vServiceJob.Spec.Name) +vMetadata := string(vServiceJob.Spec.Metadata) +vSpec := string(vServiceJob.Spec.Spec) +vStatus := string(vServiceJob.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceJob { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Metadata: &vMetadata, + Spec: &vSpec, + Status: &vStatus, + } + vGlobalServiceJobList = append(vGlobalServiceJobList, ret) + } + log.Debugf("[getGlobalSvcGroupJobsResolver]List of Jobs object %v", vGlobalServiceJobList) + return vGlobalServiceJobList, nil +} + +////////////////////////////////////// +// LINK RESOLVER +// FieldName: Template Node: Table PKG: Global +////////////////////////////////////// +func getGlobalTableTemplateResolver(obj *model.GlobalTable) (*model.GlobalTemplate, error) { + log.Debugf("[getGlobalTableTemplateResolver]Parent Object %+v", obj) + vTemplateParent, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).Database().GetTables(context.TODO(), getParentName(obj.ParentLabels, "tables.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalTableTemplateResolver]Error getting parent node %s", err) + return &model.GlobalTemplate{}, nil + } + vTemplate, err := vTemplateParent.GetTemplate(context.TODO()) + if err != nil { + log.Errorf("[getGlobalTableTemplateResolver]Error getting Template object %s", err) + return &model.GlobalTemplate{}, nil + } + dn := vTemplate.DisplayName() +parentLabels := map[string]interface{}{"templates.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalTemplate { + Id: &dn, + ParentLabels: parentLabels, + } + log.Debugf("[getGlobalTableTemplateResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// LINK RESOLVER +// FieldName: Inventory Node: Table PKG: Global +////////////////////////////////////// +func getGlobalTableInventoryResolver(obj *model.GlobalTable) (*model.GlobalInventory, error) { + log.Debugf("[getGlobalTableInventoryResolver]Parent Object %+v", obj) + vInventoryParent, err := nc.GlobalRoot().Runtime().DataFolder().Domain(getParentName(obj.ParentLabels, "datafolderdomains.global.tsm.tanzu.vmware.com")).Database().GetTables(context.TODO(), getParentName(obj.ParentLabels, "tables.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalTableInventoryResolver]Error getting parent node %s", err) + return &model.GlobalInventory{}, nil + } + vInventory, err := vInventoryParent.GetInventory(context.TODO()) + if err != nil { + log.Errorf("[getGlobalTableInventoryResolver]Error getting Inventory object %s", err) + return &model.GlobalInventory{}, nil + } + dn := vInventory.DisplayName() +parentLabels := map[string]interface{}{"inventories.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalInventory { + Id: &dn, + ParentLabels: parentLabels, + } + log.Debugf("[getGlobalTableInventoryResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: DataTemplates Node: TemplateGroup PKG: Global +////////////////////////////////////// +func getGlobalTemplateGroupDataTemplatesResolver(obj *model.GlobalTemplateGroup, id *string) ([]*model.GlobalDataTemplate, error) { + log.Debugf("[getGlobalTemplateGroupDataTemplatesResolver]Parent Object %+v", obj) + var vGlobalDataTemplateList []*model.GlobalDataTemplate + if id != nil && *id != "" { + log.Debugf("[getGlobalTemplateGroupDataTemplatesResolver]Id %q", *id) + vDataTemplate, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).GetDataTemplates(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalTemplateGroupDataTemplatesResolver]Error getting DataTemplates node %q : %s", *id, err) + return vGlobalDataTemplateList, nil + } + dn := vDataTemplate.DisplayName() +parentLabels := map[string]interface{}{"datatemplates.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDataTemplate { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalDataTemplateList = append(vGlobalDataTemplateList, ret) + + log.Debugf("[getGlobalTemplateGroupDataTemplatesResolver]Output DataTemplates objects %v", vGlobalDataTemplateList) + + return vGlobalDataTemplateList, nil + } + + log.Debug("[getGlobalTemplateGroupDataTemplatesResolver]Id is empty, process all DataTemplatess") + + vDataTemplateParent, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).GetTemplateGroups(context.TODO(), getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalTemplateGroupDataTemplatesResolver]Error getting parent node %s", err) + return vGlobalDataTemplateList, nil + } + vDataTemplateAllObj, err := vDataTemplateParent.GetAllDataTemplates(context.TODO()) + if err != nil { + log.Errorf("[getGlobalTemplateGroupDataTemplatesResolver]Error getting DataTemplates objects %s", err) + return vGlobalDataTemplateList, nil + } + for _, i := range vDataTemplateAllObj { + vDataTemplate, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).GetDataTemplates(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalTemplateGroupDataTemplatesResolver]Error getting DataTemplates node %q : %s", i.DisplayName(), err) + continue + } + dn := vDataTemplate.DisplayName() +parentLabels := map[string]interface{}{"datatemplates.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDataTemplate { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalDataTemplateList = append(vGlobalDataTemplateList, ret) + } + + log.Debugf("[getGlobalTemplateGroupDataTemplatesResolver]Output DataTemplates objects %v", vGlobalDataTemplateList) + + return vGlobalDataTemplateList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: NodeTemplates Node: TemplateGroup PKG: Global +////////////////////////////////////// +func getGlobalTemplateGroupNodeTemplatesResolver(obj *model.GlobalTemplateGroup, id *string) ([]*model.GlobalNodeTemplate, error) { + log.Debugf("[getGlobalTemplateGroupNodeTemplatesResolver]Parent Object %+v", obj) + var vGlobalNodeTemplateList []*model.GlobalNodeTemplate + if id != nil && *id != "" { + log.Debugf("[getGlobalTemplateGroupNodeTemplatesResolver]Id %q", *id) + vNodeTemplate, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).GetNodeTemplates(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalTemplateGroupNodeTemplatesResolver]Error getting NodeTemplates node %q : %s", *id, err) + return vGlobalNodeTemplateList, nil + } + dn := vNodeTemplate.DisplayName() +parentLabels := map[string]interface{}{"nodetemplates.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNodeTemplate { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalNodeTemplateList = append(vGlobalNodeTemplateList, ret) + + log.Debugf("[getGlobalTemplateGroupNodeTemplatesResolver]Output NodeTemplates objects %v", vGlobalNodeTemplateList) + + return vGlobalNodeTemplateList, nil + } + + log.Debug("[getGlobalTemplateGroupNodeTemplatesResolver]Id is empty, process all NodeTemplatess") + + vNodeTemplateParent, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).GetTemplateGroups(context.TODO(), getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalTemplateGroupNodeTemplatesResolver]Error getting parent node %s", err) + return vGlobalNodeTemplateList, nil + } + vNodeTemplateAllObj, err := vNodeTemplateParent.GetAllNodeTemplates(context.TODO()) + if err != nil { + log.Errorf("[getGlobalTemplateGroupNodeTemplatesResolver]Error getting NodeTemplates objects %s", err) + return vGlobalNodeTemplateList, nil + } + for _, i := range vNodeTemplateAllObj { + vNodeTemplate, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).GetNodeTemplates(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalTemplateGroupNodeTemplatesResolver]Error getting NodeTemplates node %q : %s", i.DisplayName(), err) + continue + } + dn := vNodeTemplate.DisplayName() +parentLabels := map[string]interface{}{"nodetemplates.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalNodeTemplate { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalNodeTemplateList = append(vGlobalNodeTemplateList, ret) + } + + log.Debugf("[getGlobalTemplateGroupNodeTemplatesResolver]Output NodeTemplates objects %v", vGlobalNodeTemplateList) + + return vGlobalNodeTemplateList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: AppTemplates Node: TemplateGroup PKG: Global +////////////////////////////////////// +func getGlobalTemplateGroupAppTemplatesResolver(obj *model.GlobalTemplateGroup, id *string) ([]*model.GlobalAppTemplate, error) { + log.Debugf("[getGlobalTemplateGroupAppTemplatesResolver]Parent Object %+v", obj) + var vGlobalAppTemplateList []*model.GlobalAppTemplate + if id != nil && *id != "" { + log.Debugf("[getGlobalTemplateGroupAppTemplatesResolver]Id %q", *id) + vAppTemplate, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).GetAppTemplates(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalTemplateGroupAppTemplatesResolver]Error getting AppTemplates node %q : %s", *id, err) + return vGlobalAppTemplateList, nil + } + dn := vAppTemplate.DisplayName() +parentLabels := map[string]interface{}{"apptemplates.global.tsm.tanzu.vmware.com":dn} +vVersion := string(vAppTemplate.Spec.Version) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAppTemplate { + Id: &dn, + ParentLabels: parentLabels, + Version: &vVersion, + } + vGlobalAppTemplateList = append(vGlobalAppTemplateList, ret) + + log.Debugf("[getGlobalTemplateGroupAppTemplatesResolver]Output AppTemplates objects %v", vGlobalAppTemplateList) + + return vGlobalAppTemplateList, nil + } + + log.Debug("[getGlobalTemplateGroupAppTemplatesResolver]Id is empty, process all AppTemplatess") + + vAppTemplateParent, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).GetTemplateGroups(context.TODO(), getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalTemplateGroupAppTemplatesResolver]Error getting parent node %s", err) + return vGlobalAppTemplateList, nil + } + vAppTemplateAllObj, err := vAppTemplateParent.GetAllAppTemplates(context.TODO()) + if err != nil { + log.Errorf("[getGlobalTemplateGroupAppTemplatesResolver]Error getting AppTemplates objects %s", err) + return vGlobalAppTemplateList, nil + } + for _, i := range vAppTemplateAllObj { + vAppTemplate, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).GetAppTemplates(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalTemplateGroupAppTemplatesResolver]Error getting AppTemplates node %q : %s", i.DisplayName(), err) + continue + } + dn := vAppTemplate.DisplayName() +parentLabels := map[string]interface{}{"apptemplates.global.tsm.tanzu.vmware.com":dn} +vVersion := string(vAppTemplate.Spec.Version) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAppTemplate { + Id: &dn, + ParentLabels: parentLabels, + Version: &vVersion, + } + vGlobalAppTemplateList = append(vGlobalAppTemplateList, ret) + } + + log.Debugf("[getGlobalTemplateGroupAppTemplatesResolver]Output AppTemplates objects %v", vGlobalAppTemplateList) + + return vGlobalAppTemplateList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: ServiceTemplates Node: TemplateGroup PKG: Global +////////////////////////////////////// +func getGlobalTemplateGroupServiceTemplatesResolver(obj *model.GlobalTemplateGroup, id *string) ([]*model.GlobalServiceTemplate, error) { + log.Debugf("[getGlobalTemplateGroupServiceTemplatesResolver]Parent Object %+v", obj) + var vGlobalServiceTemplateList []*model.GlobalServiceTemplate + if id != nil && *id != "" { + log.Debugf("[getGlobalTemplateGroupServiceTemplatesResolver]Id %q", *id) + vServiceTemplate, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).GetServiceTemplates(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalTemplateGroupServiceTemplatesResolver]Error getting ServiceTemplates node %q : %s", *id, err) + return vGlobalServiceTemplateList, nil + } + dn := vServiceTemplate.DisplayName() +parentLabels := map[string]interface{}{"servicetemplates.global.tsm.tanzu.vmware.com":dn} +vVersion := string(vServiceTemplate.Spec.Version) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceTemplate { + Id: &dn, + ParentLabels: parentLabels, + Version: &vVersion, + } + vGlobalServiceTemplateList = append(vGlobalServiceTemplateList, ret) + + log.Debugf("[getGlobalTemplateGroupServiceTemplatesResolver]Output ServiceTemplates objects %v", vGlobalServiceTemplateList) + + return vGlobalServiceTemplateList, nil + } + + log.Debug("[getGlobalTemplateGroupServiceTemplatesResolver]Id is empty, process all ServiceTemplatess") + + vServiceTemplateParent, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).GetTemplateGroups(context.TODO(), getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalTemplateGroupServiceTemplatesResolver]Error getting parent node %s", err) + return vGlobalServiceTemplateList, nil + } + vServiceTemplateAllObj, err := vServiceTemplateParent.GetAllServiceTemplates(context.TODO()) + if err != nil { + log.Errorf("[getGlobalTemplateGroupServiceTemplatesResolver]Error getting ServiceTemplates objects %s", err) + return vGlobalServiceTemplateList, nil + } + for _, i := range vServiceTemplateAllObj { + vServiceTemplate, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).GetServiceTemplates(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalTemplateGroupServiceTemplatesResolver]Error getting ServiceTemplates node %q : %s", i.DisplayName(), err) + continue + } + dn := vServiceTemplate.DisplayName() +parentLabels := map[string]interface{}{"servicetemplates.global.tsm.tanzu.vmware.com":dn} +vVersion := string(vServiceTemplate.Spec.Version) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceTemplate { + Id: &dn, + ParentLabels: parentLabels, + Version: &vVersion, + } + vGlobalServiceTemplateList = append(vGlobalServiceTemplateList, ret) + } + + log.Debugf("[getGlobalTemplateGroupServiceTemplatesResolver]Output ServiceTemplates objects %v", vGlobalServiceTemplateList) + + return vGlobalServiceTemplateList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: PolicyTemplates Node: TemplateGroup PKG: Global +////////////////////////////////////// +func getGlobalTemplateGroupPolicyTemplatesResolver(obj *model.GlobalTemplateGroup, id *string) ([]*model.GlobalPolicyTemplate, error) { + log.Debugf("[getGlobalTemplateGroupPolicyTemplatesResolver]Parent Object %+v", obj) + var vGlobalPolicyTemplateList []*model.GlobalPolicyTemplate + if id != nil && *id != "" { + log.Debugf("[getGlobalTemplateGroupPolicyTemplatesResolver]Id %q", *id) + vPolicyTemplate, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).GetPolicyTemplates(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalTemplateGroupPolicyTemplatesResolver]Error getting PolicyTemplates node %q : %s", *id, err) + return vGlobalPolicyTemplateList, nil + } + dn := vPolicyTemplate.DisplayName() +parentLabels := map[string]interface{}{"policytemplates.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalPolicyTemplate { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalPolicyTemplateList = append(vGlobalPolicyTemplateList, ret) + + log.Debugf("[getGlobalTemplateGroupPolicyTemplatesResolver]Output PolicyTemplates objects %v", vGlobalPolicyTemplateList) + + return vGlobalPolicyTemplateList, nil + } + + log.Debug("[getGlobalTemplateGroupPolicyTemplatesResolver]Id is empty, process all PolicyTemplatess") + + vPolicyTemplateParent, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).GetTemplateGroups(context.TODO(), getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalTemplateGroupPolicyTemplatesResolver]Error getting parent node %s", err) + return vGlobalPolicyTemplateList, nil + } + vPolicyTemplateAllObj, err := vPolicyTemplateParent.GetAllPolicyTemplates(context.TODO()) + if err != nil { + log.Errorf("[getGlobalTemplateGroupPolicyTemplatesResolver]Error getting PolicyTemplates objects %s", err) + return vGlobalPolicyTemplateList, nil + } + for _, i := range vPolicyTemplateAllObj { + vPolicyTemplate, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).TemplateGroups(getParentName(obj.ParentLabels, "templategroups.global.tsm.tanzu.vmware.com")).GetPolicyTemplates(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalTemplateGroupPolicyTemplatesResolver]Error getting PolicyTemplates node %q : %s", i.DisplayName(), err) + continue } - vConfigFooTypeABCList = append(vConfigFooTypeABCList, ret) + dn := vPolicyTemplate.DisplayName() +parentLabels := map[string]interface{}{"policytemplates.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalPolicyTemplate { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalPolicyTemplateList = append(vGlobalPolicyTemplateList, ret) } - log.Debugf("[getConfigConfigFooExampleResolver]Output FooExample objects %v", vConfigFooTypeABCList) + log.Debugf("[getGlobalTemplateGroupPolicyTemplatesResolver]Output PolicyTemplates objects %v", vGlobalPolicyTemplateList) - return vConfigFooTypeABCList, nil + return vGlobalPolicyTemplateList, nil } ////////////////////////////////////// -// LINKS RESOLVER -// FieldName: ACPPolicies Node: Config PKG: Config +// CHILDREN RESOLVER +// FieldName: TemplateGroups Node: Template PKG: Global ////////////////////////////////////// -func getConfigConfigACPPoliciesResolver(obj *model.ConfigConfig, id *string) ([]*model.PolicypkgAccessControlPolicy, error) { - log.Debugf("[getConfigConfigACPPoliciesResolver]Parent Object %+v", obj) - var vPolicypkgAccessControlPolicyList []*model.PolicypkgAccessControlPolicy +func getGlobalTemplateTemplateGroupsResolver(obj *model.GlobalTemplate, id *string) ([]*model.GlobalTemplateGroup, error) { + log.Debugf("[getGlobalTemplateTemplateGroupsResolver]Parent Object %+v", obj) + var vGlobalTemplateGroupList []*model.GlobalTemplateGroup if id != nil && *id != "" { - log.Debugf("[getConfigConfigACPPoliciesResolver]Id %q", *id) - vAccessControlPolicyParent, err := nc.RootRoot().GetConfig(context.TODO(), getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")) + log.Debugf("[getGlobalTemplateTemplateGroupsResolver]Id %q", *id) + vTemplateGroup, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).GetTemplateGroups(context.TODO(), *id) if err != nil { - log.Errorf("[getConfigConfigACPPoliciesResolver]Error getting ACPPolicies %q : %s", *id, err) - return vPolicypkgAccessControlPolicyList, nil - } - vAccessControlPolicy, err := vAccessControlPolicyParent.GetACPPolicies(context.TODO(), *id) + log.Errorf("[getGlobalTemplateTemplateGroupsResolver]Error getting TemplateGroups node %q : %s", *id, err) + return vGlobalTemplateGroupList, nil + } + dn := vTemplateGroup.DisplayName() +parentLabels := map[string]interface{}{"templategroups.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vTemplateGroup.Spec.ProjectId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalTemplateGroup { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + } + vGlobalTemplateGroupList = append(vGlobalTemplateGroupList, ret) + + log.Debugf("[getGlobalTemplateTemplateGroupsResolver]Output TemplateGroups objects %v", vGlobalTemplateGroupList) + + return vGlobalTemplateGroupList, nil + } + + log.Debug("[getGlobalTemplateTemplateGroupsResolver]Id is empty, process all TemplateGroupss") + + vTemplateGroupParent, err := nc.GlobalRoot().Config().GetTemplates(context.TODO(), getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalTemplateTemplateGroupsResolver]Error getting parent node %s", err) + return vGlobalTemplateGroupList, nil + } + vTemplateGroupAllObj, err := vTemplateGroupParent.GetAllTemplateGroups(context.TODO()) + if err != nil { + log.Errorf("[getGlobalTemplateTemplateGroupsResolver]Error getting TemplateGroups objects %s", err) + return vGlobalTemplateGroupList, nil + } + for _, i := range vTemplateGroupAllObj { + vTemplateGroup, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).GetTemplateGroups(context.TODO(), i.DisplayName()) if err != nil { - log.Errorf("[getConfigConfigACPPoliciesResolver]Error getting ACPPolicies %q : %s", *id, err) - return vPolicypkgAccessControlPolicyList, nil + log.Errorf("[getGlobalTemplateTemplateGroupsResolver]Error getting TemplateGroups node %q : %s", i.DisplayName(), err) + continue } - dn := vAccessControlPolicy.DisplayName() - parentLabels := map[string]interface{}{"accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com": dn} + dn := vTemplateGroup.DisplayName() +parentLabels := map[string]interface{}{"templategroups.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vTemplateGroup.Spec.ProjectId) for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.PolicypkgAccessControlPolicy{ - Id: &dn, - ParentLabels: parentLabels, - } - vPolicypkgAccessControlPolicyList = append(vPolicypkgAccessControlPolicyList, ret) + parentLabels[k] = v + } + ret := &model.GlobalTemplateGroup { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + } + vGlobalTemplateGroupList = append(vGlobalTemplateGroupList, ret) + } + + log.Debugf("[getGlobalTemplateTemplateGroupsResolver]Output TemplateGroups objects %v", vGlobalTemplateGroupList) + + return vGlobalTemplateGroupList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: HealthChecks Node: Template PKG: Global +////////////////////////////////////// +func getGlobalTemplateHealthChecksResolver(obj *model.GlobalTemplate, id *string) ([]*model.GlobalHealthCheckConfigN, error) { + log.Debugf("[getGlobalTemplateHealthChecksResolver]Parent Object %+v", obj) + var vGlobalHealthCheckConfigNList []*model.GlobalHealthCheckConfigN + if id != nil && *id != "" { + log.Debugf("[getGlobalTemplateHealthChecksResolver]Id %q", *id) + vHealthCheckConfigN, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).GetHealthChecks(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalTemplateHealthChecksResolver]Error getting HealthChecks node %q : %s", *id, err) + return vGlobalHealthCheckConfigNList, nil + } + dn := vHealthCheckConfigN.DisplayName() +parentLabels := map[string]interface{}{"healthcheckconfigns.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vHealthCheckConfigN.Spec.ProjectId) +vConfig := string(vHealthCheckConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalHealthCheckConfigN { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + Config: &vConfig, + } + vGlobalHealthCheckConfigNList = append(vGlobalHealthCheckConfigNList, ret) - log.Debugf("[getConfigConfigACPPoliciesResolver]Output ACPPolicies objects %v", vPolicypkgAccessControlPolicyList) + log.Debugf("[getGlobalTemplateHealthChecksResolver]Output HealthChecks objects %v", vGlobalHealthCheckConfigNList) - return vPolicypkgAccessControlPolicyList, nil + return vGlobalHealthCheckConfigNList, nil } - log.Debug("[getConfigConfigACPPoliciesResolver]Id is empty, process all ACPPoliciess") + log.Debug("[getGlobalTemplateHealthChecksResolver]Id is empty, process all HealthCheckss") - vAccessControlPolicyParent, err := nc.RootRoot().GetConfig(context.TODO(), getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")) + vHealthCheckConfigNParent, err := nc.GlobalRoot().Config().GetTemplates(context.TODO(), getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalTemplateHealthChecksResolver]Error getting parent node %s", err) + return vGlobalHealthCheckConfigNList, nil + } + vHealthCheckConfigNAllObj, err := vHealthCheckConfigNParent.GetAllHealthChecks(context.TODO()) if err != nil { - log.Errorf("[getConfigConfigACPPoliciesResolver]Error getting parent node %s", err) - return vPolicypkgAccessControlPolicyList, nil + log.Errorf("[getGlobalTemplateHealthChecksResolver]Error getting HealthChecks objects %s", err) + return vGlobalHealthCheckConfigNList, nil + } + for _, i := range vHealthCheckConfigNAllObj { + vHealthCheckConfigN, err := nc.GlobalRoot().Config().Templates(getParentName(obj.ParentLabels, "templates.global.tsm.tanzu.vmware.com")).GetHealthChecks(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalTemplateHealthChecksResolver]Error getting HealthChecks node %q : %s", i.DisplayName(), err) + continue + } + dn := vHealthCheckConfigN.DisplayName() +parentLabels := map[string]interface{}{"healthcheckconfigns.global.tsm.tanzu.vmware.com":dn} +vProjectId := string(vHealthCheckConfigN.Spec.ProjectId) +vConfig := string(vHealthCheckConfigN.Spec.Config) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalHealthCheckConfigN { + Id: &dn, + ParentLabels: parentLabels, + ProjectId: &vProjectId, + Config: &vConfig, } - vAccessControlPolicyAllObj, err := vAccessControlPolicyParent.GetAllACPPolicies(context.TODO()) + vGlobalHealthCheckConfigNList = append(vGlobalHealthCheckConfigNList, ret) + } + + log.Debugf("[getGlobalTemplateHealthChecksResolver]Output HealthChecks objects %v", vGlobalHealthCheckConfigNList) + + return vGlobalHealthCheckConfigNList, nil +} + +////////////////////////////////////// +// LINK RESOLVER +// FieldName: Template Node: Tenant PKG: Global +////////////////////////////////////// +func getGlobalTenantTemplateResolver(obj *model.GlobalTenant) (*model.GlobalServiceTemplate, error) { + log.Debugf("[getGlobalTenantTemplateResolver]Parent Object %+v", obj) + vServiceTemplateParent, err := nc.GlobalRoot().Runtime().AllsparkServices().GlobalRegistrationService(getParentName(obj.ParentLabels, "globalregistrationservices.global.tsm.tanzu.vmware.com")).GetTenants(context.TODO(), getParentName(obj.ParentLabels, "tenants.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalTenantTemplateResolver]Error getting parent node %s", err) + return &model.GlobalServiceTemplate{}, nil + } + vServiceTemplate, err := vServiceTemplateParent.GetTemplate(context.TODO()) if err != nil { - log.Errorf("[getConfigConfigACPPoliciesResolver]Error getting ACPPolicies %s", err) - return vPolicypkgAccessControlPolicyList, nil + log.Errorf("[getGlobalTenantTemplateResolver]Error getting Template object %s", err) + return &model.GlobalServiceTemplate{}, nil + } + dn := vServiceTemplate.DisplayName() +parentLabels := map[string]interface{}{"servicetemplates.global.tsm.tanzu.vmware.com":dn} +vVersion := string(vServiceTemplate.Spec.Version) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalServiceTemplate { + Id: &dn, + ParentLabels: parentLabels, + Version: &vVersion, } - for _, i := range vAccessControlPolicyAllObj { - vAccessControlPolicyParent, err := nc.RootRoot().GetConfig(context.TODO(), getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")) + log.Debugf("[getGlobalTenantTemplateResolver]Output object %v", ret) + + return ret, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Resources Node: Tenant PKG: Global +////////////////////////////////////// +func getGlobalTenantResourcesResolver(obj *model.GlobalTenant, id *string) ([]*model.GlobalTenantResource, error) { + log.Debugf("[getGlobalTenantResourcesResolver]Parent Object %+v", obj) + var vGlobalTenantResourceList []*model.GlobalTenantResource + if id != nil && *id != "" { + log.Debugf("[getGlobalTenantResourcesResolver]Id %q", *id) + vTenantResource, err := nc.GlobalRoot().Runtime().AllsparkServices().GlobalRegistrationService(getParentName(obj.ParentLabels, "globalregistrationservices.global.tsm.tanzu.vmware.com")).Tenants(getParentName(obj.ParentLabels, "tenants.global.tsm.tanzu.vmware.com")).GetResources(context.TODO(), *id) if err != nil { - log.Errorf("[getConfigConfigACPPoliciesResolver]Error getting parent node %s, skipping...", err) - continue - } - vAccessControlPolicy, err := vAccessControlPolicyParent.GetACPPolicies(context.TODO(), i.DisplayName()) + log.Errorf("[getGlobalTenantResourcesResolver]Error getting Resources node %q : %s", *id, err) + return vGlobalTenantResourceList, nil + } + dn := vTenantResource.DisplayName() +parentLabels := map[string]interface{}{"tenantresources.global.tsm.tanzu.vmware.com":dn} +vType := string(vTenantResource.Spec.Type) +vLocation := string(vTenantResource.Spec.Location) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalTenantResource { + Id: &dn, + ParentLabels: parentLabels, + Type: &vType, + Location: &vLocation, + } + vGlobalTenantResourceList = append(vGlobalTenantResourceList, ret) + + log.Debugf("[getGlobalTenantResourcesResolver]Output Resources objects %v", vGlobalTenantResourceList) + + return vGlobalTenantResourceList, nil + } + + log.Debug("[getGlobalTenantResourcesResolver]Id is empty, process all Resourcess") + + vTenantResourceParent, err := nc.GlobalRoot().Runtime().AllsparkServices().GlobalRegistrationService(getParentName(obj.ParentLabels, "globalregistrationservices.global.tsm.tanzu.vmware.com")).GetTenants(context.TODO(), getParentName(obj.ParentLabels, "tenants.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalTenantResourcesResolver]Error getting parent node %s", err) + return vGlobalTenantResourceList, nil + } + vTenantResourceAllObj, err := vTenantResourceParent.GetAllResources(context.TODO()) + if err != nil { + log.Errorf("[getGlobalTenantResourcesResolver]Error getting Resources objects %s", err) + return vGlobalTenantResourceList, nil + } + for _, i := range vTenantResourceAllObj { + vTenantResource, err := nc.GlobalRoot().Runtime().AllsparkServices().GlobalRegistrationService(getParentName(obj.ParentLabels, "globalregistrationservices.global.tsm.tanzu.vmware.com")).Tenants(getParentName(obj.ParentLabels, "tenants.global.tsm.tanzu.vmware.com")).GetResources(context.TODO(), i.DisplayName()) if err != nil { - log.Errorf("[getConfigConfigACPPoliciesResolver]Error getting ACPPolicies node %q : %s, skipping...", i.DisplayName(), err) - continue + log.Errorf("[getGlobalTenantResourcesResolver]Error getting Resources node %q : %s", i.DisplayName(), err) + continue } - dn := vAccessControlPolicy.DisplayName() - parentLabels := map[string]interface{}{"accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com": dn} + dn := vTenantResource.DisplayName() +parentLabels := map[string]interface{}{"tenantresources.global.tsm.tanzu.vmware.com":dn} +vType := string(vTenantResource.Spec.Type) +vLocation := string(vTenantResource.Spec.Location) for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.PolicypkgAccessControlPolicy{ - Id: &dn, - ParentLabels: parentLabels, - } - vPolicypkgAccessControlPolicyList = append(vPolicypkgAccessControlPolicyList, ret) + parentLabels[k] = v + } + ret := &model.GlobalTenantResource { + Id: &dn, + ParentLabels: parentLabels, + Type: &vType, + Location: &vLocation, + } + vGlobalTenantResourceList = append(vGlobalTenantResourceList, ret) } - log.Debugf("[getConfigConfigACPPoliciesResolver]List of ACPPolicies object %v", vPolicypkgAccessControlPolicyList) - return vPolicypkgAccessControlPolicyList, nil + + log.Debugf("[getGlobalTenantResourcesResolver]Output Resources objects %v", vGlobalTenantResourceList) + + return vGlobalTenantResourceList, nil } ////////////////////////////////////// -// CHILD RESOLVER (Non Singleton) -// FieldName: GnsAccessControlPolicy Node: Gns PKG: Gns +// CHILDREN RESOLVER +// FieldName: Annotations Node: Tenant PKG: Global ////////////////////////////////////// -func getGnsGnsGnsAccessControlPolicyResolver(obj *model.GnsGns, id *string) (*model.PolicypkgAccessControlPolicy, error) { - log.Debugf("[getGnsGnsGnsAccessControlPolicyResolver]Parent Object %+v", obj) +func getGlobalTenantAnnotationsResolver(obj *model.GlobalTenant, id *string) ([]*model.GlobalAnnotation, error) { + log.Debugf("[getGlobalTenantAnnotationsResolver]Parent Object %+v", obj) + var vGlobalAnnotationList []*model.GlobalAnnotation if id != nil && *id != "" { - log.Debugf("[getGnsGnsGnsAccessControlPolicyResolver]Id %q", *id) - vAccessControlPolicy, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GNS(getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")).GetGnsAccessControlPolicy(context.TODO(), *id) + log.Debugf("[getGlobalTenantAnnotationsResolver]Id %q", *id) + vAnnotation, err := nc.GlobalRoot().Runtime().AllsparkServices().GlobalRegistrationService(getParentName(obj.ParentLabels, "globalregistrationservices.global.tsm.tanzu.vmware.com")).Tenants(getParentName(obj.ParentLabels, "tenants.global.tsm.tanzu.vmware.com")).GetAnnotations(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalTenantAnnotationsResolver]Error getting Annotations node %q : %s", *id, err) + return vGlobalAnnotationList, nil + } + dn := vAnnotation.DisplayName() +parentLabels := map[string]interface{}{"annotations.global.tsm.tanzu.vmware.com":dn} +vName := string(vAnnotation.Spec.Name) +vData := string(vAnnotation.Spec.Data) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAnnotation { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Data: &vData, + } + vGlobalAnnotationList = append(vGlobalAnnotationList, ret) + + log.Debugf("[getGlobalTenantAnnotationsResolver]Output Annotations objects %v", vGlobalAnnotationList) + + return vGlobalAnnotationList, nil + } + + log.Debug("[getGlobalTenantAnnotationsResolver]Id is empty, process all Annotationss") + + vAnnotationParent, err := nc.GlobalRoot().Runtime().AllsparkServices().GlobalRegistrationService(getParentName(obj.ParentLabels, "globalregistrationservices.global.tsm.tanzu.vmware.com")).GetTenants(context.TODO(), getParentName(obj.ParentLabels, "tenants.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalTenantAnnotationsResolver]Error getting parent node %s", err) + return vGlobalAnnotationList, nil + } + vAnnotationAllObj, err := vAnnotationParent.GetAllAnnotations(context.TODO()) + if err != nil { + log.Errorf("[getGlobalTenantAnnotationsResolver]Error getting Annotations objects %s", err) + return vGlobalAnnotationList, nil + } + for _, i := range vAnnotationAllObj { + vAnnotation, err := nc.GlobalRoot().Runtime().AllsparkServices().GlobalRegistrationService(getParentName(obj.ParentLabels, "globalregistrationservices.global.tsm.tanzu.vmware.com")).Tenants(getParentName(obj.ParentLabels, "tenants.global.tsm.tanzu.vmware.com")).GetAnnotations(context.TODO(), i.DisplayName()) if err != nil { - log.Errorf("[getGnsGnsGnsAccessControlPolicyResolver]Error getting GnsAccessControlPolicy node %q : %s", *id, err) - return &model.PolicypkgAccessControlPolicy{}, nil + log.Errorf("[getGlobalTenantAnnotationsResolver]Error getting Annotations node %q : %s", i.DisplayName(), err) + continue } - dn := vAccessControlPolicy.DisplayName() - parentLabels := map[string]interface{}{"accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com": dn} + dn := vAnnotation.DisplayName() +parentLabels := map[string]interface{}{"annotations.global.tsm.tanzu.vmware.com":dn} +vName := string(vAnnotation.Spec.Name) +vData := string(vAnnotation.Spec.Data) for k, v := range obj.ParentLabels { - parentLabels[k] = v - } - ret := &model.PolicypkgAccessControlPolicy{ - Id: &dn, - ParentLabels: parentLabels, - } + parentLabels[k] = v + } + ret := &model.GlobalAnnotation { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Data: &vData, + } + vGlobalAnnotationList = append(vGlobalAnnotationList, ret) + } - log.Debugf("[getGnsGnsGnsAccessControlPolicyResolver]Output object %v", ret) - return ret, nil + log.Debugf("[getGlobalTenantAnnotationsResolver]Output Annotations objects %v", vGlobalAnnotationList) + + return vGlobalAnnotationList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: Users Node: UserFolder PKG: Global +////////////////////////////////////// +func getGlobalUserFolderUsersResolver(obj *model.GlobalUserFolder, id *string) ([]*model.GlobalUser, error) { + log.Debugf("[getGlobalUserFolderUsersResolver]Parent Object %+v", obj) + var vGlobalUserList []*model.GlobalUser + if id != nil && *id != "" { + log.Debugf("[getGlobalUserFolderUsersResolver]Id %q", *id) + vUser, err := nc.GlobalRoot().Runtime().UserFolder().GetUsers(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalUserFolderUsersResolver]Error getting Users node %q : %s", *id, err) + return vGlobalUserList, nil + } + dn := vUser.DisplayName() +parentLabels := map[string]interface{}{"users.global.tsm.tanzu.vmware.com":dn} +vUsername := string(vUser.Spec.Username) +vPassword := string(vUser.Spec.Password) +vEmail := string(vUser.Spec.Email) +AccessTokens, _ := json.Marshal(vUser.Spec.AccessTokens) +AccessTokensData := string(AccessTokens) +vLastActionDate := string(vUser.Spec.LastActionDate) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalUser { + Id: &dn, + ParentLabels: parentLabels, + Username: &vUsername, + Password: &vPassword, + Email: &vEmail, + AccessTokens: &AccessTokensData, + LastActionDate: &vLastActionDate, } - log.Debug("[getGnsGnsGnsAccessControlPolicyResolver]Id is empty, process all GnsAccessControlPolicys") - vAccessControlPolicyParent, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GetGNS(context.TODO(), getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")) - if err != nil { - log.Errorf("[getGnsGnsGnsAccessControlPolicyResolver]Failed to get parent node %s", err) - return &model.PolicypkgAccessControlPolicy{}, nil + vGlobalUserList = append(vGlobalUserList, ret) + + log.Debugf("[getGlobalUserFolderUsersResolver]Output Users objects %v", vGlobalUserList) + + return vGlobalUserList, nil } - vAccessControlPolicy, err := vAccessControlPolicyParent.GetGnsAccessControlPolicy(context.TODO()) + + log.Debug("[getGlobalUserFolderUsersResolver]Id is empty, process all Userss") + + vUserParent, err := nc.GlobalRoot().Runtime().GetUserFolder(context.TODO()) if err != nil { - log.Errorf("[getGnsGnsGnsAccessControlPolicyResolver]Error getting GnsAccessControlPolicy node %s", err) - return &model.PolicypkgAccessControlPolicy{}, nil - } - dn := vAccessControlPolicy.DisplayName() - parentLabels := map[string]interface{}{"accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com": dn} + log.Errorf("[getGlobalUserFolderUsersResolver]Error getting parent node %s", err) + return vGlobalUserList, nil + } + vUserAllObj, err := vUserParent.GetAllUsers(context.TODO()) + if err != nil { + log.Errorf("[getGlobalUserFolderUsersResolver]Error getting Users objects %s", err) + return vGlobalUserList, nil + } + for _, i := range vUserAllObj { + vUser, err := nc.GlobalRoot().Runtime().UserFolder().GetUsers(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalUserFolderUsersResolver]Error getting Users node %q : %s", i.DisplayName(), err) + continue + } + dn := vUser.DisplayName() +parentLabels := map[string]interface{}{"users.global.tsm.tanzu.vmware.com":dn} +vUsername := string(vUser.Spec.Username) +vPassword := string(vUser.Spec.Password) +vEmail := string(vUser.Spec.Email) +AccessTokens, _ := json.Marshal(vUser.Spec.AccessTokens) +AccessTokensData := string(AccessTokens) +vLastActionDate := string(vUser.Spec.LastActionDate) - for k, v := range obj.ParentLabels { - parentLabels[k] = v + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalUser { + Id: &dn, + ParentLabels: parentLabels, + Username: &vUsername, + Password: &vPassword, + Email: &vEmail, + AccessTokens: &AccessTokensData, + LastActionDate: &vLastActionDate, } - ret := &model.PolicypkgAccessControlPolicy{ - Id: &dn, - ParentLabels: parentLabels, + vGlobalUserList = append(vGlobalUserList, ret) } - log.Debugf("[getGnsGnsGnsAccessControlPolicyResolver]Output object %v", ret) + log.Debugf("[getGlobalUserFolderUsersResolver]Output Users objects %v", vGlobalUserList) - return ret, nil + return vGlobalUserList, nil } ////////////////////////////////////// -// CHILD RESOLVER (Singleton) -// FieldName: FooChild Node: Gns PKG: Gns +// CHILDREN RESOLVER +// FieldName: AppUsers Node: UserFolder PKG: Global ////////////////////////////////////// -func getGnsGnsFooChildResolver(obj *model.GnsGns) (*model.GnsBarChild, error) { - log.Debugf("[getGnsGnsFooChildResolver]Parent Object %+v", obj) - vBarChild, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GNS(getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")).GetFooChild(context.TODO()) +func getGlobalUserFolderAppUsersResolver(obj *model.GlobalUserFolder, id *string) ([]*model.GlobalAppUser, error) { + log.Debugf("[getGlobalUserFolderAppUsersResolver]Parent Object %+v", obj) + var vGlobalAppUserList []*model.GlobalAppUser + if id != nil && *id != "" { + log.Debugf("[getGlobalUserFolderAppUsersResolver]Id %q", *id) + vAppUser, err := nc.GlobalRoot().Runtime().UserFolder().GetAppUsers(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalUserFolderAppUsersResolver]Error getting AppUsers node %q : %s", *id, err) + return vGlobalAppUserList, nil + } + dn := vAppUser.DisplayName() +parentLabels := map[string]interface{}{"appusers.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAppUser { + Id: &dn, + ParentLabels: parentLabels, + } + vGlobalAppUserList = append(vGlobalAppUserList, ret) + + log.Debugf("[getGlobalUserFolderAppUsersResolver]Output AppUsers objects %v", vGlobalAppUserList) + + return vGlobalAppUserList, nil + } + + log.Debug("[getGlobalUserFolderAppUsersResolver]Id is empty, process all AppUserss") + + vAppUserParent, err := nc.GlobalRoot().Runtime().GetUserFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalUserFolderAppUsersResolver]Error getting parent node %s", err) + return vGlobalAppUserList, nil + } + vAppUserAllObj, err := vAppUserParent.GetAllAppUsers(context.TODO()) if err != nil { - log.Errorf("[getGnsGnsFooChildResolver]Error getting Gns node %s", err) - return &model.GnsBarChild{}, nil + log.Errorf("[getGlobalUserFolderAppUsersResolver]Error getting AppUsers objects %s", err) + return vGlobalAppUserList, nil + } + for _, i := range vAppUserAllObj { + vAppUser, err := nc.GlobalRoot().Runtime().UserFolder().GetAppUsers(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalUserFolderAppUsersResolver]Error getting AppUsers node %q : %s", i.DisplayName(), err) + continue + } + dn := vAppUser.DisplayName() +parentLabels := map[string]interface{}{"appusers.global.tsm.tanzu.vmware.com":dn} + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAppUser { + Id: &dn, + ParentLabels: parentLabels, } - dn := vBarChild.DisplayName() - parentLabels := map[string]interface{}{"barchilds.gns.tsm.tanzu.vmware.com": dn} - vName := string(vBarChild.Spec.Name) + vGlobalAppUserList = append(vGlobalAppUserList, ret) + } + + log.Debugf("[getGlobalUserFolderAppUsersResolver]Output AppUsers objects %v", vGlobalAppUserList) + + return vGlobalAppUserList, nil +} + +////////////////////////////////////// +// CHILDREN RESOLVER +// FieldName: AccessToken Node: UserFolder PKG: Global +////////////////////////////////////// +func getGlobalUserFolderAccessTokenResolver(obj *model.GlobalUserFolder, id *string) ([]*model.GlobalAccessToken, error) { + log.Debugf("[getGlobalUserFolderAccessTokenResolver]Parent Object %+v", obj) + var vGlobalAccessTokenList []*model.GlobalAccessToken + if id != nil && *id != "" { + log.Debugf("[getGlobalUserFolderAccessTokenResolver]Id %q", *id) + vAccessToken, err := nc.GlobalRoot().Runtime().UserFolder().GetAccessToken(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalUserFolderAccessTokenResolver]Error getting AccessToken node %q : %s", *id, err) + return vGlobalAccessTokenList, nil + } + dn := vAccessToken.DisplayName() +parentLabels := map[string]interface{}{"accesstokens.global.tsm.tanzu.vmware.com":dn} +vTtl := int(vAccessToken.Spec.Ttl) +vCreated := string(vAccessToken.Spec.Created) +vUserId := string(vAccessToken.Spec.UserId) - for k, v := range obj.ParentLabels { - parentLabels[k] = v + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAccessToken { + Id: &dn, + ParentLabels: parentLabels, + Ttl: &vTtl, + Created: &vCreated, + UserId: &vUserId, } - ret := &model.GnsBarChild{ - Id: &dn, - ParentLabels: parentLabels, - Name: &vName, + vGlobalAccessTokenList = append(vGlobalAccessTokenList, ret) + + log.Debugf("[getGlobalUserFolderAccessTokenResolver]Output AccessToken objects %v", vGlobalAccessTokenList) + + return vGlobalAccessTokenList, nil } - log.Debugf("[getGnsGnsFooChildResolver]Output object %+v", ret) - return ret, nil + log.Debug("[getGlobalUserFolderAccessTokenResolver]Id is empty, process all AccessTokens") + + vAccessTokenParent, err := nc.GlobalRoot().Runtime().GetUserFolder(context.TODO()) + if err != nil { + log.Errorf("[getGlobalUserFolderAccessTokenResolver]Error getting parent node %s", err) + return vGlobalAccessTokenList, nil + } + vAccessTokenAllObj, err := vAccessTokenParent.GetAllAccessToken(context.TODO()) + if err != nil { + log.Errorf("[getGlobalUserFolderAccessTokenResolver]Error getting AccessToken objects %s", err) + return vGlobalAccessTokenList, nil + } + for _, i := range vAccessTokenAllObj { + vAccessToken, err := nc.GlobalRoot().Runtime().UserFolder().GetAccessToken(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalUserFolderAccessTokenResolver]Error getting AccessToken node %q : %s", i.DisplayName(), err) + continue + } + dn := vAccessToken.DisplayName() +parentLabels := map[string]interface{}{"accesstokens.global.tsm.tanzu.vmware.com":dn} +vTtl := int(vAccessToken.Spec.Ttl) +vCreated := string(vAccessToken.Spec.Created) +vUserId := string(vAccessToken.Spec.UserId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalAccessToken { + Id: &dn, + ParentLabels: parentLabels, + Ttl: &vTtl, + Created: &vCreated, + UserId: &vUserId, + } + vGlobalAccessTokenList = append(vGlobalAccessTokenList, ret) + } + + log.Debugf("[getGlobalUserFolderAccessTokenResolver]Output AccessToken objects %v", vGlobalAccessTokenList) + + return vGlobalAccessTokenList, nil } ////////////////////////////////////// // CHILDREN RESOLVER -// FieldName: PolicyConfigs Node: AccessControlPolicy PKG: Policypkg +// FieldName: Preferences Node: User PKG: Global ////////////////////////////////////// -func getPolicypkgAccessControlPolicyPolicyConfigsResolver(obj *model.PolicypkgAccessControlPolicy, id *string) ([]*model.PolicypkgACPConfig, error) { - log.Debugf("[getPolicypkgAccessControlPolicyPolicyConfigsResolver]Parent Object %+v", obj) - var vPolicypkgACPConfigList []*model.PolicypkgACPConfig +func getGlobalUserPreferencesResolver(obj *model.GlobalUser, id *string) ([]*model.GlobalUserPreference, error) { + log.Debugf("[getGlobalUserPreferencesResolver]Parent Object %+v", obj) + var vGlobalUserPreferenceList []*model.GlobalUserPreference if id != nil && *id != "" { - log.Debugf("[getPolicypkgAccessControlPolicyPolicyConfigsResolver]Id %q", *id) - vACPConfig, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GNS(getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")).GnsAccessControlPolicy(getParentName(obj.ParentLabels, "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), *id) + log.Debugf("[getGlobalUserPreferencesResolver]Id %q", *id) + vUserPreference, err := nc.GlobalRoot().Runtime().UserFolder().Users(getParentName(obj.ParentLabels, "users.global.tsm.tanzu.vmware.com")).GetPreferences(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalUserPreferencesResolver]Error getting Preferences node %q : %s", *id, err) + return vGlobalUserPreferenceList, nil + } + dn := vUserPreference.DisplayName() +parentLabels := map[string]interface{}{"userpreferences.global.tsm.tanzu.vmware.com":dn} +vName := string(vUserPreference.Spec.Name) +vData := string(vUserPreference.Spec.Data) +vUserId := string(vUserPreference.Spec.UserId) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalUserPreference { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Data: &vData, + UserId: &vUserId, + } + vGlobalUserPreferenceList = append(vGlobalUserPreferenceList, ret) + + log.Debugf("[getGlobalUserPreferencesResolver]Output Preferences objects %v", vGlobalUserPreferenceList) + + return vGlobalUserPreferenceList, nil + } + + log.Debug("[getGlobalUserPreferencesResolver]Id is empty, process all Preferencess") + + vUserPreferenceParent, err := nc.GlobalRoot().Runtime().UserFolder().GetUsers(context.TODO(), getParentName(obj.ParentLabels, "users.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalUserPreferencesResolver]Error getting parent node %s", err) + return vGlobalUserPreferenceList, nil + } + vUserPreferenceAllObj, err := vUserPreferenceParent.GetAllPreferences(context.TODO()) + if err != nil { + log.Errorf("[getGlobalUserPreferencesResolver]Error getting Preferences objects %s", err) + return vGlobalUserPreferenceList, nil + } + for _, i := range vUserPreferenceAllObj { + vUserPreference, err := nc.GlobalRoot().Runtime().UserFolder().Users(getParentName(obj.ParentLabels, "users.global.tsm.tanzu.vmware.com")).GetPreferences(context.TODO(), i.DisplayName()) if err != nil { - log.Errorf("[getPolicypkgAccessControlPolicyPolicyConfigsResolver]Error getting PolicyConfigs node %q : %s", *id, err) - return vPolicypkgACPConfigList, nil + log.Errorf("[getGlobalUserPreferencesResolver]Error getting Preferences node %q : %s", i.DisplayName(), err) + continue } - dn := vACPConfig.DisplayName() - parentLabels := map[string]interface{}{"acpconfigs.policypkg.tsm.tanzu.vmware.com": dn} - vDisplayName := string(vACPConfig.Spec.DisplayName) - vGns := string(vACPConfig.Spec.Gns) - vDescription := string(vACPConfig.Spec.Description) - Tags, _ := json.Marshal(vACPConfig.Spec.Tags) - TagsData := string(Tags) - vProjectId := string(vACPConfig.Spec.ProjectId) - Conditions, _ := json.Marshal(vACPConfig.Spec.Conditions) - ConditionsData := string(Conditions) + dn := vUserPreference.DisplayName() +parentLabels := map[string]interface{}{"userpreferences.global.tsm.tanzu.vmware.com":dn} +vName := string(vUserPreference.Spec.Name) +vData := string(vUserPreference.Spec.Data) +vUserId := string(vUserPreference.Spec.UserId) for k, v := range obj.ParentLabels { - parentLabels[k] = v + parentLabels[k] = v + } + ret := &model.GlobalUserPreference { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Data: &vData, + UserId: &vUserId, + } + vGlobalUserPreferenceList = append(vGlobalUserPreferenceList, ret) + } + + log.Debugf("[getGlobalUserPreferencesResolver]Output Preferences objects %v", vGlobalUserPreferenceList) + + return vGlobalUserPreferenceList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: DestinationRules Node: VirtualService PKG: Global +////////////////////////////////////// +func getGlobalVirtualServiceDestinationRulesResolver(obj *model.GlobalVirtualService, id *string) ([]*model.GlobalDestinationRule, error) { + log.Debugf("[getGlobalVirtualServiceDestinationRulesResolver]Parent Object %+v", obj) + var vGlobalDestinationRuleList []*model.GlobalDestinationRule + if id != nil && *id != "" { + log.Debugf("[getGlobalVirtualServiceDestinationRulesResolver]Id %q", *id) + vDestinationRuleParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetVirtualServices(context.TODO(), getParentName(obj.ParentLabels, "virtualservices.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalVirtualServiceDestinationRulesResolver]Error getting DestinationRules %q : %s", *id, err) + return vGlobalDestinationRuleList, nil } - ret := &model.PolicypkgACPConfig{ - Id: &dn, - ParentLabels: parentLabels, - DisplayName: &vDisplayName, - Gns: &vGns, - Description: &vDescription, - Tags: &TagsData, - ProjectId: &vProjectId, - Conditions: &ConditionsData, + vDestinationRule, err := vDestinationRuleParent.GetDestinationRules(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalVirtualServiceDestinationRulesResolver]Error getting DestinationRules %q : %s", *id, err) + return vGlobalDestinationRuleList, nil } - vPolicypkgACPConfigList = append(vPolicypkgACPConfigList, ret) + dn := vDestinationRule.DisplayName() +parentLabels := map[string]interface{}{"destinationrules.global.tsm.tanzu.vmware.com":dn} +vName := string(vDestinationRule.Spec.Name) +vAnnotations := string(vDestinationRule.Spec.Annotations) +vLabels := string(vDestinationRule.Spec.Labels) +vCreationTimestamp := string(vDestinationRule.Spec.CreationTimestamp) +vApiLink := string(vDestinationRule.Spec.ApiLink) +vUid := string(vDestinationRule.Spec.Uid) +vHost := string(vDestinationRule.Spec.Host) +vTrafficPolicy := string(vDestinationRule.Spec.TrafficPolicy) +vSubsets := string(vDestinationRule.Spec.Subsets) +ExportTo, _ := json.Marshal(vDestinationRule.Spec.ExportTo) +ExportToData := string(ExportTo) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDestinationRule { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Annotations: &vAnnotations, + Labels: &vLabels, + CreationTimestamp: &vCreationTimestamp, + ApiLink: &vApiLink, + Uid: &vUid, + Host: &vHost, + TrafficPolicy: &vTrafficPolicy, + Subsets: &vSubsets, + ExportTo: &ExportToData, + } + vGlobalDestinationRuleList = append(vGlobalDestinationRuleList, ret) - log.Debugf("[getPolicypkgAccessControlPolicyPolicyConfigsResolver]Output PolicyConfigs objects %v", vPolicypkgACPConfigList) + log.Debugf("[getGlobalVirtualServiceDestinationRulesResolver]Output DestinationRules objects %v", vGlobalDestinationRuleList) - return vPolicypkgACPConfigList, nil + return vGlobalDestinationRuleList, nil } - log.Debug("[getPolicypkgAccessControlPolicyPolicyConfigsResolver]Id is empty, process all PolicyConfigss") + log.Debug("[getGlobalVirtualServiceDestinationRulesResolver]Id is empty, process all DestinationRuless") - vACPConfigParent, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GNS(getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")).GetGnsAccessControlPolicy(context.TODO(), getParentName(obj.ParentLabels, "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com")) + vDestinationRuleParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetVirtualServices(context.TODO(), getParentName(obj.ParentLabels, "virtualservices.global.tsm.tanzu.vmware.com")) if err != nil { - log.Errorf("[getPolicypkgAccessControlPolicyPolicyConfigsResolver]Error getting parent node %s", err) - return vPolicypkgACPConfigList, nil - } - vACPConfigAllObj, err := vACPConfigParent.GetAllPolicyConfigs(context.TODO()) + log.Errorf("[getGlobalVirtualServiceDestinationRulesResolver]Error getting parent node %s", err) + return vGlobalDestinationRuleList, nil + } + vDestinationRuleAllObj, err := vDestinationRuleParent.GetAllDestinationRules(context.TODO()) if err != nil { - log.Errorf("[getPolicypkgAccessControlPolicyPolicyConfigsResolver]Error getting PolicyConfigs objects %s", err) - return vPolicypkgACPConfigList, nil + log.Errorf("[getGlobalVirtualServiceDestinationRulesResolver]Error getting DestinationRules %s", err) + return vGlobalDestinationRuleList, nil + } + for _, i := range vDestinationRuleAllObj { + vDestinationRuleParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetVirtualServices(context.TODO(), getParentName(obj.ParentLabels, "virtualservices.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalVirtualServiceDestinationRulesResolver]Error getting parent node %s, skipping...", err) + continue + } + vDestinationRule, err := vDestinationRuleParent.GetDestinationRules(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalVirtualServiceDestinationRulesResolver]Error getting DestinationRules node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vDestinationRule.DisplayName() +parentLabels := map[string]interface{}{"destinationrules.global.tsm.tanzu.vmware.com":dn} +vName := string(vDestinationRule.Spec.Name) +vAnnotations := string(vDestinationRule.Spec.Annotations) +vLabels := string(vDestinationRule.Spec.Labels) +vCreationTimestamp := string(vDestinationRule.Spec.CreationTimestamp) +vApiLink := string(vDestinationRule.Spec.ApiLink) +vUid := string(vDestinationRule.Spec.Uid) +vHost := string(vDestinationRule.Spec.Host) +vTrafficPolicy := string(vDestinationRule.Spec.TrafficPolicy) +vSubsets := string(vDestinationRule.Spec.Subsets) +ExportTo, _ := json.Marshal(vDestinationRule.Spec.ExportTo) +ExportToData := string(ExportTo) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalDestinationRule { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Annotations: &vAnnotations, + Labels: &vLabels, + CreationTimestamp: &vCreationTimestamp, + ApiLink: &vApiLink, + Uid: &vUid, + Host: &vHost, + TrafficPolicy: &vTrafficPolicy, + Subsets: &vSubsets, + ExportTo: &ExportToData, } - for _, i := range vACPConfigAllObj { - vACPConfig, err := nc.RootRoot().Config(getParentName(obj.ParentLabels, "configs.config.tsm.tanzu.vmware.com")).GNS(getParentName(obj.ParentLabels, "gnses.gns.tsm.tanzu.vmware.com")).GnsAccessControlPolicy(getParentName(obj.ParentLabels, "accesscontrolpolicies.policypkg.tsm.tanzu.vmware.com")).GetPolicyConfigs(context.TODO(), i.DisplayName()) + vGlobalDestinationRuleList = append(vGlobalDestinationRuleList, ret) + } + log.Debugf("[getGlobalVirtualServiceDestinationRulesResolver]List of DestinationRules object %v", vGlobalDestinationRuleList) + return vGlobalDestinationRuleList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Services Node: VirtualService PKG: Global +////////////////////////////////////// +func getGlobalVirtualServiceServicesResolver(obj *model.GlobalVirtualService, id *string) ([]*model.GlobalService, error) { + log.Debugf("[getGlobalVirtualServiceServicesResolver]Parent Object %+v", obj) + var vGlobalServiceList []*model.GlobalService + if id != nil && *id != "" { + log.Debugf("[getGlobalVirtualServiceServicesResolver]Id %q", *id) + vServiceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetVirtualServices(context.TODO(), getParentName(obj.ParentLabels, "virtualservices.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalVirtualServiceServicesResolver]Error getting Services %q : %s", *id, err) + return vGlobalServiceList, nil + } + vService, err := vServiceParent.GetServices(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalVirtualServiceServicesResolver]Error getting Services %q : %s", *id, err) + return vGlobalServiceList, nil + } + dn := vService.DisplayName() +parentLabels := map[string]interface{}{"services.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vService.Spec.Metadata) +vSpec := string(vService.Spec.Spec) +vName := string(vService.Spec.Name) +vNamespace := string(vService.Spec.Namespace) +vApiLink := string(vService.Spec.ApiLink) +vIpAddress := string(vService.Spec.IpAddress) +vAnnotations := string(vService.Spec.Annotations) +vCreationTimestamp := string(vService.Spec.CreationTimestamp) +vLabels := string(vService.Spec.Labels) +vUid := string(vService.Spec.Uid) +vPorts := string(vService.Spec.Ports) +vSelector := string(vService.Spec.Selector) +vType := string(vService.Spec.Type) +vStatus := string(vService.Spec.Status) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalService { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Name: &vName, + Namespace: &vNamespace, + ApiLink: &vApiLink, + IpAddress: &vIpAddress, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Uid: &vUid, + Ports: &vPorts, + Selector: &vSelector, + Type: &vType, + Status: &vStatus, + } + vGlobalServiceList = append(vGlobalServiceList, ret) + + log.Debugf("[getGlobalVirtualServiceServicesResolver]Output Services objects %v", vGlobalServiceList) + + return vGlobalServiceList, nil + } + + log.Debug("[getGlobalVirtualServiceServicesResolver]Id is empty, process all Servicess") + + vServiceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetVirtualServices(context.TODO(), getParentName(obj.ParentLabels, "virtualservices.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalVirtualServiceServicesResolver]Error getting parent node %s", err) + return vGlobalServiceList, nil + } + vServiceAllObj, err := vServiceParent.GetAllServices(context.TODO()) + if err != nil { + log.Errorf("[getGlobalVirtualServiceServicesResolver]Error getting Services %s", err) + return vGlobalServiceList, nil + } + for _, i := range vServiceAllObj { + vServiceParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetVirtualServices(context.TODO(), getParentName(obj.ParentLabels, "virtualservices.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalVirtualServiceServicesResolver]Error getting parent node %s, skipping...", err) + continue + } + vService, err := vServiceParent.GetServices(context.TODO(), i.DisplayName()) if err != nil { - log.Errorf("[getPolicypkgAccessControlPolicyPolicyConfigsResolver]Error getting PolicyConfigs node %q : %s", i.DisplayName(), err) + log.Errorf("[getGlobalVirtualServiceServicesResolver]Error getting Services node %q : %s, skipping...", i.DisplayName(), err) continue } - dn := vACPConfig.DisplayName() - parentLabels := map[string]interface{}{"acpconfigs.policypkg.tsm.tanzu.vmware.com": dn} - vDisplayName := string(vACPConfig.Spec.DisplayName) - vGns := string(vACPConfig.Spec.Gns) - vDescription := string(vACPConfig.Spec.Description) - Tags, _ := json.Marshal(vACPConfig.Spec.Tags) - TagsData := string(Tags) - vProjectId := string(vACPConfig.Spec.ProjectId) - Conditions, _ := json.Marshal(vACPConfig.Spec.Conditions) - ConditionsData := string(Conditions) + dn := vService.DisplayName() +parentLabels := map[string]interface{}{"services.global.tsm.tanzu.vmware.com":dn} +vMetadata := string(vService.Spec.Metadata) +vSpec := string(vService.Spec.Spec) +vName := string(vService.Spec.Name) +vNamespace := string(vService.Spec.Namespace) +vApiLink := string(vService.Spec.ApiLink) +vIpAddress := string(vService.Spec.IpAddress) +vAnnotations := string(vService.Spec.Annotations) +vCreationTimestamp := string(vService.Spec.CreationTimestamp) +vLabels := string(vService.Spec.Labels) +vUid := string(vService.Spec.Uid) +vPorts := string(vService.Spec.Ports) +vSelector := string(vService.Spec.Selector) +vType := string(vService.Spec.Type) +vStatus := string(vService.Spec.Status) for k, v := range obj.ParentLabels { - parentLabels[k] = v + parentLabels[k] = v + } + ret := &model.GlobalService { + Id: &dn, + ParentLabels: parentLabels, + Metadata: &vMetadata, + Spec: &vSpec, + Name: &vName, + Namespace: &vNamespace, + ApiLink: &vApiLink, + IpAddress: &vIpAddress, + Annotations: &vAnnotations, + CreationTimestamp: &vCreationTimestamp, + Labels: &vLabels, + Uid: &vUid, + Ports: &vPorts, + Selector: &vSelector, + Type: &vType, + Status: &vStatus, + } + vGlobalServiceList = append(vGlobalServiceList, ret) + } + log.Debugf("[getGlobalVirtualServiceServicesResolver]List of Services object %v", vGlobalServiceList) + return vGlobalServiceList, nil +} + +////////////////////////////////////// +// LINKS RESOLVER +// FieldName: Gateways Node: VirtualService PKG: Global +////////////////////////////////////// +func getGlobalVirtualServiceGatewaysResolver(obj *model.GlobalVirtualService, id *string) ([]*model.GlobalGateway, error) { + log.Debugf("[getGlobalVirtualServiceGatewaysResolver]Parent Object %+v", obj) + var vGlobalGatewayList []*model.GlobalGateway + if id != nil && *id != "" { + log.Debugf("[getGlobalVirtualServiceGatewaysResolver]Id %q", *id) + vGatewayParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetVirtualServices(context.TODO(), getParentName(obj.ParentLabels, "virtualservices.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalVirtualServiceGatewaysResolver]Error getting Gateways %q : %s", *id, err) + return vGlobalGatewayList, nil } - ret := &model.PolicypkgACPConfig{ - Id: &dn, - ParentLabels: parentLabels, - DisplayName: &vDisplayName, - Gns: &vGns, - Description: &vDescription, - Tags: &TagsData, - ProjectId: &vProjectId, - Conditions: &ConditionsData, + vGateway, err := vGatewayParent.GetGateways(context.TODO(), *id) + if err != nil { + log.Errorf("[getGlobalVirtualServiceGatewaysResolver]Error getting Gateways %q : %s", *id, err) + return vGlobalGatewayList, nil } - vPolicypkgACPConfigList = append(vPolicypkgACPConfigList, ret) + dn := vGateway.DisplayName() +parentLabels := map[string]interface{}{"gateways.global.tsm.tanzu.vmware.com":dn} +vName := string(vGateway.Spec.Name) +vLabels := string(vGateway.Spec.Labels) +vAnnotations := string(vGateway.Spec.Annotations) +vSpec := string(vGateway.Spec.Spec) + + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGateway { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Labels: &vLabels, + Annotations: &vAnnotations, + Spec: &vSpec, + } + vGlobalGatewayList = append(vGlobalGatewayList, ret) + + log.Debugf("[getGlobalVirtualServiceGatewaysResolver]Output Gateways objects %v", vGlobalGatewayList) + + return vGlobalGatewayList, nil } - log.Debugf("[getPolicypkgAccessControlPolicyPolicyConfigsResolver]Output PolicyConfigs objects %v", vPolicypkgACPConfigList) + log.Debug("[getGlobalVirtualServiceGatewaysResolver]Id is empty, process all Gatewayss") + + vGatewayParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetVirtualServices(context.TODO(), getParentName(obj.ParentLabels, "virtualservices.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalVirtualServiceGatewaysResolver]Error getting parent node %s", err) + return vGlobalGatewayList, nil + } + vGatewayAllObj, err := vGatewayParent.GetAllGateways(context.TODO()) + if err != nil { + log.Errorf("[getGlobalVirtualServiceGatewaysResolver]Error getting Gateways %s", err) + return vGlobalGatewayList, nil + } + for _, i := range vGatewayAllObj { + vGatewayParent, err := nc.GlobalRoot().Inventory().Clusters(getParentName(obj.ParentLabels, "clusters.global.tsm.tanzu.vmware.com")).Domains(getParentName(obj.ParentLabels, "domains.global.tsm.tanzu.vmware.com")).GetVirtualServices(context.TODO(), getParentName(obj.ParentLabels, "virtualservices.global.tsm.tanzu.vmware.com")) + if err != nil { + log.Errorf("[getGlobalVirtualServiceGatewaysResolver]Error getting parent node %s, skipping...", err) + continue + } + vGateway, err := vGatewayParent.GetGateways(context.TODO(), i.DisplayName()) + if err != nil { + log.Errorf("[getGlobalVirtualServiceGatewaysResolver]Error getting Gateways node %q : %s, skipping...", i.DisplayName(), err) + continue + } + dn := vGateway.DisplayName() +parentLabels := map[string]interface{}{"gateways.global.tsm.tanzu.vmware.com":dn} +vName := string(vGateway.Spec.Name) +vLabels := string(vGateway.Spec.Labels) +vAnnotations := string(vGateway.Spec.Annotations) +vSpec := string(vGateway.Spec.Spec) - return vPolicypkgACPConfigList, nil + for k, v := range obj.ParentLabels { + parentLabels[k] = v + } + ret := &model.GlobalGateway { + Id: &dn, + ParentLabels: parentLabels, + Name: &vName, + Labels: &vLabels, + Annotations: &vAnnotations, + Spec: &vSpec, + } + vGlobalGatewayList = append(vGlobalGatewayList, ret) + } + log.Debugf("[getGlobalVirtualServiceGatewaysResolver]List of Gateways object %v", vGlobalGatewayList) + return vGlobalGatewayList, nil } + diff --git a/compiler/example/output/generated/nexus-gql/graph/model/models_gen.go b/compiler/example/output/generated/nexus-gql/graph/model/models_gen.go deleted file mode 100644 index 55f1654ea..000000000 --- a/compiler/example/output/generated/nexus-gql/graph/model/models_gen.go +++ /dev/null @@ -1,145 +0,0 @@ -// Code generated by github.com/vmware-tanzu/graph-framework-for-microservices/gqlgen, DO NOT EDIT. - -package model - -type NexusGraphqlResponse struct { - Code *int `json:"Code"` - Message *string `json:"Message"` - Data *string `json:"Data"` - Last *string `json:"Last"` - TotalRecords *int `json:"TotalRecords"` -} - -type TimeSeriesData struct { - Code *int `json:"Code"` - Message *string `json:"Message"` - Data *string `json:"Data"` - Last *string `json:"Last"` - TotalRecords *int `json:"TotalRecords"` -} - -type ConfigConfig struct { - Id *string `json:"Id"` - ParentLabels map[string]interface{} `json:"ParentLabels"` - QueryExample *NexusGraphqlResponse `json:"QueryExample"` - ACPPolicies []*PolicypkgAccessControlPolicy `json:"ACPPolicies"` - FooExample []*ConfigFooTypeABC `json:"FooExample"` - MyStr0 *string `json:"MyStr0"` - MyStr1 *string `json:"MyStr1"` - MyStr2 *string `json:"MyStr2"` - XYZPort *string `json:"XYZPort"` - ABCHost *string `json:"ABCHost"` - ClusterNamespaces *string `json:"ClusterNamespaces"` - TestValMarkers *string `json:"TestValMarkers"` - Instance *float64 `json:"Instance"` - CuOption *string `json:"CuOption"` - GNS *GnsGns `json:"GNS"` - DNS *GnsDns `json:"DNS"` - VMPPolicies *PolicypkgVMpolicy `json:"VMPPolicies"` - Domain *ConfigDomain `json:"Domain"` - SvcGrpInfo *ServicegroupSvcGroupLinkInfo `json:"SvcGrpInfo"` -} - -type ConfigDomain struct { - Id *string `json:"Id"` - ParentLabels map[string]interface{} `json:"ParentLabels"` - PointPort *string `json:"PointPort"` - PointString *string `json:"PointString"` - PointInt *int `json:"PointInt"` - PointMap *string `json:"PointMap"` - PointSlice *string `json:"PointSlice"` - SliceOfPoints *string `json:"SliceOfPoints"` - SliceOfArrPoints *string `json:"SliceOfArrPoints"` - MapOfArrsPoints *string `json:"MapOfArrsPoints"` - PointStruct *string `json:"PointStruct"` -} - -type ConfigFooTypeABC struct { - Id *string `json:"Id"` - ParentLabels map[string]interface{} `json:"ParentLabels"` - FooA *string `json:"FooA"` - FooB *string `json:"FooB"` - FooD *string `json:"FooD"` - FooF *string `json:"FooF"` -} - -type GnsBarChild struct { - Id *string `json:"Id"` - ParentLabels map[string]interface{} `json:"ParentLabels"` - Name *string `json:"Name"` -} - -type GnsDns struct { - Id *string `json:"Id"` - ParentLabels map[string]interface{} `json:"ParentLabels"` -} - -type GnsGns struct { - Id *string `json:"Id"` - ParentLabels map[string]interface{} `json:"ParentLabels"` - queryGns1 *NexusGraphqlResponse `json:"queryGns1"` - queryGnsQM1 *TimeSeriesData `json:"queryGnsQM1"` - queryGnsQM *TimeSeriesData `json:"queryGnsQM"` - Domain *string `json:"Domain"` - UseSharedGateway *bool `json:"UseSharedGateway"` - Description *string `json:"Description"` - Meta *string `json:"Meta"` - Port *int `json:"Port"` - OtherDescription *string `json:"OtherDescription"` - MapPointer *string `json:"MapPointer"` - SlicePointer *string `json:"SlicePointer"` - WorkloadSpec *string `json:"WorkloadSpec"` - DifferentSpec *string `json:"DifferentSpec"` - ServiceSegmentRef *string `json:"ServiceSegmentRef"` - ServiceSegmentRefPointer *string `json:"ServiceSegmentRefPointer"` - ServiceSegmentRefs *string `json:"ServiceSegmentRefs"` - ServiceSegmentRefMap *string `json:"ServiceSegmentRefMap"` - GnsAccessControlPolicy *PolicypkgAccessControlPolicy `json:"GnsAccessControlPolicy"` - FooChild *GnsBarChild `json:"FooChild"` -} - -type GnsIgnoreChild struct { - Id *string `json:"Id"` - ParentLabels map[string]interface{} `json:"ParentLabels"` - Name *string `json:"Name"` -} - -type PolicypkgACPConfig struct { - Id *string `json:"Id"` - ParentLabels map[string]interface{} `json:"ParentLabels"` - DisplayName *string `json:"DisplayName"` - Gns *string `json:"Gns"` - Description *string `json:"Description"` - Tags *string `json:"Tags"` - ProjectId *string `json:"ProjectId"` - Conditions *string `json:"Conditions"` -} - -type PolicypkgAccessControlPolicy struct { - Id *string `json:"Id"` - ParentLabels map[string]interface{} `json:"ParentLabels"` - PolicyConfigs []*PolicypkgACPConfig `json:"PolicyConfigs"` -} - -type PolicypkgVMpolicy struct { - Id *string `json:"Id"` - ParentLabels map[string]interface{} `json:"ParentLabels"` - queryGns1 *NexusGraphqlResponse `json:"queryGns1"` - queryGnsQM1 *TimeSeriesData `json:"queryGnsQM1"` - queryGnsQM *TimeSeriesData `json:"queryGnsQM"` -} - -type RootRoot struct { - Id *string `json:"Id"` - ParentLabels map[string]interface{} `json:"ParentLabels"` - Config *ConfigConfig `json:"Config"` -} - -type ServicegroupSvcGroupLinkInfo struct { - Id *string `json:"Id"` - ParentLabels map[string]interface{} `json:"ParentLabels"` - ClusterName *string `json:"ClusterName"` - DomainName *string `json:"DomainName"` - ServiceName *string `json:"ServiceName"` - ServiceType *string `json:"ServiceType"` -} diff --git a/compiler/example/output/generated/nexus-gql/graph/resolver.go b/compiler/example/output/generated/nexus-gql/graph/resolver.go index b5120f4a3..ba5e8081e 100644 --- a/compiler/example/output/generated/nexus-gql/graph/resolver.go +++ b/compiler/example/output/generated/nexus-gql/graph/resolver.go @@ -13,7 +13,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/nexus-gql/graph/model" + "nexustempmodule/nexus-gql/graph/model" ) type Resolver struct{} diff --git a/compiler/example/output/generated/nexus-gql/graph/schema.graphqls b/compiler/example/output/generated/nexus-gql/graph/schema.graphqls index dc5d49a9b..d3239b1ef 100644 --- a/compiler/example/output/generated/nexus-gql/graph/schema.graphqls +++ b/compiler/example/output/generated/nexus-gql/graph/schema.graphqls @@ -1,176 +1,3107 @@ scalar Map + +type global_AccessToken { + Id: ID + ParentLabels: Map + + Ttl: Int + Created: String + UserId: String +} + +type global_ACPConfig { + Id: ID + ParentLabels: Map + + DestSvcGroups(Id: ID): [global_SvcGroup!] + SourceSvcGroups(Id: ID): [global_SvcGroup!] + DisplayName: String + Gns: String + Description: String + Tags: String + ProjectId: String + DestGroups: String + SourceGroups: String + Conditions: String + Actions: String +} + +type global_AdditionalAttributes { + Id: ID + ParentLabels: Map + + Name: String + Value: String + Context: String +} + +type global_AllSparkServices { + Id: ID + ParentLabels: Map + + GlobalRegistrationService(Id: ID): global_GlobalRegistrationService! + LocalRegistrationService(Id: ID): global_LocalRegistrationService! + AwsConnector: global_AwsConnector! +} + +type global_Annotation { + Id: ID + ParentLabels: Map + + Name: String + Data: String +} + +type global_ApiDiscoveryRT { + Id: ID + ParentLabels: Map + + Gnsid: String + Selectors: String + Spec: String + CompressionEnabled: Boolean + IsEndpointApiPrechecks: String + ProcessingToggles: String +} + +type global_ApiDiscovery { + Id: ID + ParentLabels: Map + + Description: String + Labels: String + Spec: String +} + +type global_AppFolder { + Id: ID + ParentLabels: Map + + App(Id: ID): [global_App!] +} + +type global_AppGroup { + Id: ID + ParentLabels: Map + + Services(Id: ID): [global_Service!] + Rules: String +} + +type global_AppTemplateServiceDefinition { + Id: ID + ParentLabels: Map + + Type: String + Version: String + Template: String + TemplateArgs: String +} + +type global_AppTemplate { + Id: ID + ParentLabels: Map + + ServiceDefinitions(Id: ID): [global_AppTemplateServiceDefinition!] + Version: String +} + +type global_AppUser { + Id: ID + ParentLabels: Map + +} + +type global_AppVersion { + Id: ID + ParentLabels: Map + + Template: global_Template! + Inventory: global_Inventory! +} + +type global_App { + Id: ID + ParentLabels: Map + + Version(Id: ID): global_AppVersion! +} + +type global_ApplicationInfo { + Id: ID + ParentLabels: Map + + App: String +} + +type global_AttackDiscoveryRT { + Id: ID + ParentLabels: Map + + Gnsid: String + Selectors: String + Spec: String +} + +type global_AttackDiscovery { + Id: ID + ParentLabels: Map + + Description: String + Labels: String + Spec: String +} + +type global_AuthenticationPolicy { + Id: ID + ParentLabels: Map + + Name: String + Labels: String + Annotations: String + Spec: String +} + +type global_AutoscalerFolder { + Id: ID + ParentLabels: Map + + Autoscalers(Id: ID): [global_Autoscaler!] +} + +type global_AutoscalerConfig { + Id: ID + ParentLabels: Map + + Name: String + ConfigSource: String + DesiredState: String +} + +type global_Autoscaler { + Id: ID + ParentLabels: Map + + Autoscaler: global_AutoscalerCR! + Name: String + ProjectId: String +} + +type global_AutoscalerCR { + Id: ID + ParentLabels: Map + + Name: String + AutoscalingDefinition: String +} + +type global_AutoscalingPolicy { + Id: ID + ParentLabels: Map + + Name: String + Description: String + Labels: String + ServiceName: String + AutoscalerSpec: String +} + +type global_AwsConnector { + Id: ID + ParentLabels: Map + + Gns(Id: ID): [global_GlobalNs!] +} + +type global_Bucket { + Id: ID + ParentLabels: Map + + Template: global_Template! + Inventory: global_Inventory! +} + +type global_CertificateAuthorityRT { + Id: ID + ParentLabels: Map + + Url: String + Type: String + TemplatePath: String + SecretRef: String +} + +type global_CertificateAuthorityConfigN { + Id: ID + ParentLabels: Map + + Config: String +} + +type global_CertificateConfigN { + Id: ID + ParentLabels: Map + + ProjectId: String + BeginsOn: String + ExpiresOn: String + IssuedToCN: String + Config: String +} + +type global_CertificateRequest { + Id: ID + ParentLabels: Map + + Name: String + Metadata: String + IssuerRef: String + Request: String + Duration: String + Uid: String + IsCA: Boolean + Username: String + Usages: String + Groups: String + Extra: String + Status: String +} + +type global_Certificate { + Id: ID + ParentLabels: Map + + Name: String + Metadata: String + IssuerRef: String + PrivateKey: String + Subject: String + CommonName: String + Duration: String + DnsNames: String + IpAddresses: String + SecretName: String + RenewBefore: String + EmailAddresses: String + Uris: String + SecretTemplate: String + KeyStores: String + IsCA: Boolean + EncodeUsagesInRequest: String + Usages: String + RevisionHistoryLimit: Int + AdditionalOutputFormats: String + Status: String +} + +type global_ClusterConfigFolder { + Id: ID + ParentLabels: Map + + Clusters(Id: ID): [global_ClusterSettings!] +} + +type global_ClusterConfig { + Id: ID + ParentLabels: Map + + Domains(Id: ID): [global_DomainConfig!] + HostConfig(Id: ID): [global_HostConfig!] + GnsBinding(Id: ID): [global_GnsBindingRT!] + SecurityContextConstraints(Id: ID): [global_SecurityContextConstraintsConfig!] + Name: String + DnsConfigFolder(Id: ID): global_DNSConfigFolder! + DnsProbesConfigFolder: global_DNSProbesConfigFolder! + LogFolder(Id: ID): global_LogFolder! + ResourceGroup(Id: ID): global_ResourceGroupRT! +} + +type global_ClusterFolder { + Id: ID + ParentLabels: Map + + Clusters(Id: ID): [global_ClusterConfig!] + RemoteGatewayServiceConfigs(Id: ID): [global_RemoteGatewayServiceConfig!] + Name: String +} + +type global_ClusterSettings { + Id: ID + ParentLabels: Map + + ProjectId: String + DisplayName: String + Description: String + Tags: String + Labels: String + AutoInstallServiceMesh: Boolean + EnableNamespaceExclusions: Boolean + NamespaceExclusions: String + SystemNamespaceExclusions: String + AgentDomain: String + ProxyConfig: String + AutoInstallServiceMeshConfig: String + RegistryAccount: String + CaLabels: String + EnableInternalGateway: Boolean +} + +type global_Cluster { + Id: ID + ParentLabels: Map + queryNodeTS( + nodeMetric: NodeMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData queryServiceTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + Groupby: ServiceGroupByEnum + noMetrics: Boolean + limit: Int + last: String + ): TimeSeriesData queryServiceVersionTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + noMetrics: Boolean + ): TimeSeriesData queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String + ): TimeSeriesData queryServiceTopology( + metricStringArray: String + startTime: String + endTime: String + ): TimeSeriesData queryClusterTable( + startTime: String + endTime: String + timeInterval: String + noMetrics: Boolean + ): TimeSeriesData queryNodeTable( + startTime: String + endTime: String + ): TimeSeriesData queryServiceNodeMapGroupedByNode( + startTime: String + endTime: String + ): TimeSeriesData queryServiceNodeMapGroupedByService( + startTime: String + endTime: String + ): TimeSeriesData queryServiceNodeMapGroupedByServiceVersion( + startTime: String + endTime: String + ): TimeSeriesData queryStats( + metricStringArray: String + api: String + method: HTTPMethodEnum + sourceWorkloadDN: String + severity: EventSeverityEnum + startTime: String + endTime: String + ): TimeSeriesData queryLogs( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + from: Int + size: Int + ): TimeSeriesData queryList( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData queryLinechart( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData queryTopN( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + limit: Int + ): TimeSeriesData queryDetail( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + timeInterval: String + timeZone: String + ): TimeSeriesData + Apps(Id: ID): [global_ApplicationInfo!] + DnsProbeStatus(Id: ID): [global_DNSProbeStatus!] + SecurityContextConstraints(Id: ID): [global_SecurityContextConstraints!] + Domains(Id: ID): [global_Domain!] + Nodes(Id: ID): [global_Node!] + Name: String + Uuid: String + Connected: Boolean + IstioState: String + Status: String + StatusHistory: String + Castatus: String + CaStatusHistory: String + ComponentStatuses: String + ComponentStatusesHistory: String + Type: String + ProjectId: String + ConnectionStatus(Id: ID): global_ConnectionStatus! +} + +type global_ConfigMap { + Id: ID + ParentLabels: Map + + Name: String + Annotations: String + Labels: String + Metadata: String + Data: String +} + +type global_Config { + Id: ID + ParentLabels: Map + + Certificates(Id: ID): [global_CertificateConfigN!] + ExternalAccounts(Id: ID): [global_ExternalAccountConfigN!] + ExternalDNS(Id: ID): [global_ExternalDNSConfigN!] + ExternalLB(Id: ID): [global_ExternalLBConfigN!] + FeatureFlags(Id: ID): [global_FeatureFlag!] + Projects(Id: ID): [global_Project!] + ServiceDirectory(Id: ID): [global_ServiceDirectoryN!] + ResourceGroups(Id: ID): global_ResourceGroup! + GlobalNamespace(Id: ID): global_GlobalNamespace! + Policy(Id: ID): global_AccessControlPolicy! + Templates(Id: ID): global_Template! + ProgressiveUpgrade(Id: ID): global_ProgressiveUpgrade! + ExternalPlugins(Id: ID): global_ExternalPluginConfigFolder! + ExternalAuditStorage(Id: ID): global_ExternalAuditStorage! + AutoscalerFolder(Id: ID): global_AutoscalerFolder! + Clusters(Id: ID): global_ClusterConfigFolder! + ServiceLevelObjective(Id: ID): global_ServiceLevelObjectiveFolder! +} + +type global_ConnectionStatus { + Id: ID + ParentLabels: Map + + Connected: Boolean + Message: String + Code: Int +} + +type global_DataFolderDomainCluster { + Id: ID + ParentLabels: Map + +} + +type global_DataFolderDomainServiceVersion { + Id: ID + ParentLabels: Map + +} + +type global_DataFolderDomainService { + Id: ID + ParentLabels: Map + + Versions(Id: ID): [global_DataFolderDomainServiceVersion!] +} + +type global_DataFolderDomain { + Id: ID + ParentLabels: Map + + Service(Id: ID): [global_DataFolderDomainService!] + Cluster(Id: ID): global_DataFolderDomainCluster! + Database: global_Database! +} + +type global_DataFolder { + Id: ID + ParentLabels: Map + + Domain(Id: ID): global_DataFolderDomain! +} + +type global_DataGroup { + Id: ID + ParentLabels: Map + + DisplayName: String + Description: String + Scope: String + Color: String + Rules: String +} + +type global_DataTemplate { + Id: ID + ParentLabels: Map + +} + +type global_Database { + Id: ID + ParentLabels: Map + + Tables(Id: ID): [global_Table!] + Directories(Id: ID): [global_Directory!] + Buckets(Id: ID): [global_Bucket!] +} + +type global_DCRegion { + Id: ID + ParentLabels: Map + + Zones(Id: ID): [global_DCZone!] + Name: String +} + +type global_DCZone { + Id: ID + ParentLabels: Map + + Clusters(Id: ID): [global_Cluster!] + Name: String +} + +type global_DestinationRule { + Id: ID + ParentLabels: Map + + Service: global_Service! + ServiceDeployments(Id: ID): [global_ServiceDeployment!] + ServiceReplicaSets(Id: ID): [global_ServiceReplicaSet!] + ServiceStatefulSets(Id: ID): [global_ServiceStatefulSet!] + ServiceDaemonSets(Id: ID): [global_ServiceDaemonSet!] + ServiceJobs(Id: ID): [global_ServiceJob!] + Name: String + Annotations: String + Labels: String + CreationTimestamp: String + ApiLink: String + Uid: String + Host: String + TrafficPolicy: String + Subsets: String + ExportTo: String +} + +type global_Directory { + Id: ID + ParentLabels: Map + + Template: global_Template! + Inventory: global_Inventory! +} + +type global_DNSConfigFolder { + Id: ID + ParentLabels: Map + + DnsConfig(Id: ID): [global_DNSConfig!] +} + +type global_DNSConfig { + Id: ID + ParentLabels: Map + + OwnedBy: String + DnsSuffix: String +} + +type global_DNSProbeConfig { + Id: ID + ParentLabels: Map + + Domain: String + CreateTimestamp: String +} + +type global_DNSProbeStatus { + Id: ID + ParentLabels: Map + + Name: String + Domain: String + Success: Boolean + UpdateTimestamp: String +} + +type global_DNSProbesConfigFolder { + Id: ID + ParentLabels: Map + + DnsProbeConfigs(Id: ID): [global_DNSProbeConfig!] +} + +type global_DomainConfig { + Id: ID + ParentLabels: Map + + Policy(Id: ID): [global_PolicyConfig!] + NetworkAttachmentDefinition(Id: ID): [global_NetworkAttachmentDefinitionConfig!] + Services(Id: ID): [global_ServiceConfig!] + ServiceEntries(Id: ID): [global_ServiceEntryConfig!] + GatewayConfig(Id: ID): [global_GatewayConfig!] + Autoscalers(Id: ID): [global_AutoscalerConfig!] + HostConfigV2(Id: ID): [global_HostConfigV2!] + InboundAuthenticationConfig(Id: ID): [global_InboundAuthenticationConfig!] + Slos(Id: ID): [global_SloConfig!] + Secrets(Id: ID): [global_SecretRTConfig!] + ExternalServices(Id: ID): [global_ExternalServicesRT!] + ApiDiscovery(Id: ID): [global_ApiDiscoveryRT!] + GeoDiscovery(Id: ID): [global_GeoDiscoveryRT!] + PiiDiscovery(Id: ID): [global_PiiDiscoveryRT!] + AttackDiscovery(Id: ID): [global_AttackDiscoveryRT!] + UserDiscovery(Id: ID): [global_UserDiscoveryRT!] + PublicService(Id: ID): [global_PublicServiceRT!] + GnsAccessControlPolicy(Id: ID): [global_GnsAccessControlPolicyRT!] + GnsSchemaViolationDiscovery(Id: ID): [global_SchemaViolationDiscoveryRT!] + GnsSegmentationPolicy(Id: ID): [global_GnsSegmentationPolicyRT!] + CertificateAuthority(Id: ID): [global_CertificateAuthorityRT!] + GnsEndpointsConfig(Id: ID): [global_GnsEndpointsConfig!] + Name: String + OwnedBy: String + Labels: String + LabelConfig(Id: ID): global_LabelConfig! +} + +type global_Domain { + Id: ID + ParentLabels: Map + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData queryServiceTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + Groupby: ServiceGroupByEnum + noMetrics: Boolean + limit: Int + last: String + ): TimeSeriesData queryServiceVersionTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + noMetrics: Boolean + ): TimeSeriesData queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String + ): TimeSeriesData queryServiceNodeMapGroupedByNode( + startTime: String + endTime: String + ): TimeSeriesData queryServiceNodeMapGroupedByService( + startTime: String + endTime: String + ): TimeSeriesData queryServiceNodeMapGroupedByServiceVersion( + startTime: String + endTime: String + ): TimeSeriesData queryStats( + metricStringArray: String + api: String + method: HTTPMethodEnum + sourceWorkloadDN: String + severity: EventSeverityEnum + startTime: String + endTime: String + ): TimeSeriesData queryLogs( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + from: Int + size: Int + gns: String + ): TimeSeriesData queryList( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData queryLinechart( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData queryTopN( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + limit: Int + ): TimeSeriesData queryDetail( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + timeInterval: String + timeZone: String + ): TimeSeriesData + SecretHashes(Id: ID): [global_SecretHash!] + ServiceInstances(Id: ID): [global_ServiceInstance!] + ServiceDeployments(Id: ID): [global_ServiceDeployment!] + ServiceStatefulSets(Id: ID): [global_ServiceStatefulSet!] + ServiceDaemonSets(Id: ID): [global_ServiceDaemonSet!] + ServiceReplicaSets(Id: ID): [global_ServiceReplicaSet!] + ServiceCronJobs(Id: ID): [global_ServiceCronJob!] + ServiceJobs(Id: ID): [global_ServiceJob!] + VirtualServices(Id: ID): [global_VirtualService!] + ServiceEntry(Id: ID): [global_ServiceEntry!] + WorkloadEntry(Id: ID): [global_WorkloadEntry!] + DestinationRules(Id: ID): [global_DestinationRule!] + Services(Id: ID): [global_Service!] + Endpoints(Id: ID): [global_Endpoints!] + Gateways(Id: ID): [global_Gateway!] + AuthenticationPolicies(Id: ID): [global_AuthenticationPolicy!] + Configmap(Id: ID): [global_ConfigMap!] + Envoyfilter(Id: ID): [global_EnvoyFilter!] + Autoscalers(Id: ID): [global_AutoscalerCR!] + PeerAuthentication(Id: ID): [global_PeerAuthentication!] + KnativeIngresses(Id: ID): [global_KnativeIngress!] + NetworkAttachmentDefinition(Id: ID): [global_NetworkAttachmentDefinition!] + Issuers(Id: ID): [global_Issuer!] + Certificates(Id: ID): [global_Certificate!] + CertificateRequests(Id: ID): [global_CertificateRequest!] + Name: String + EnviornmentType: String + ApiLink: String + Annotations: String + Labels: String + Metadata: String +} + +type global_Endpoints { + Id: ID + ParentLabels: Map + + Name: String + Metadata: String + Subsets: String + GnsId: String +} + +type global_EnvoyFilter { + Id: ID + ParentLabels: Map + + Name: String + Labels: String + Annotations: String + Spec: String +} + +type global_ExternalAccountConfigN { + Id: ID + ParentLabels: Map + + Config: String + ProxyConfig: String +} + +type global_ExternalAuditStorage { + Id: ID + ParentLabels: Map + + Config: String +} + +type global_ExternalDNSConfigN { + Id: ID + ParentLabels: Map + + Account: global_ExternalAccountConfigN! + Config: String +} + +type global_ExternalDNSInventoryHealthCheck { + Id: ID + ParentLabels: Map + + Name: String + Protocol: String + Port: Int + Path: String + HealthThreshold: Int +} + +type global_ExternalDNSInventoryPrimaryDomain { + Id: ID + ParentLabels: Map + + DnsRecords(Id: ID): [global_ExternalDNSInventoryRecord!] + Region: String +} + +type global_ExternalDNSInventoryRecord { + Id: ID + ParentLabels: Map + + HealthCheck: global_ExternalDNSInventoryHealthCheck! + DnsRecordType: String + Ttl: Int + Value: String + Weight: Int +} + +type global_ExternalDNSInventoryZone { + Id: ID + ParentLabels: Map + + PrimaryDomains(Id: ID): [global_ExternalDNSInventoryPrimaryDomain!] + Records: Int +} + +type global_ExternalDNSInventory { + Id: ID + ParentLabels: Map + + Zones(Id: ID): [global_ExternalDNSInventoryZone!] + PrimaryDomains(Id: ID): [global_ExternalDNSInventoryPrimaryDomain!] + HealthChecks(Id: ID): [global_ExternalDNSInventoryHealthCheck!] + EnabledForProjects: String +} + +type global_ExternalDNSRuntimeEndpoint { + Id: ID + ParentLabels: Map + + Weight: Int + Active: Boolean + GnsVersion: String +} + +type global_ExternalDNSRuntimePrimaryDomain { + Id: ID + ParentLabels: Map + + Subdomains(Id: ID): [global_ExternalDNSRuntimeSubdomain!] + PrimaryDomain: String + DnsServerID: String +} + +type global_ExternalDNSRuntime { + Id: ID + ParentLabels: Map + + PrimaryDomains(Id: ID): [global_ExternalDNSRuntimePrimaryDomain!] +} + +type global_ExternalDNSRuntimeSubdomain { + Id: ID + ParentLabels: Map + + Endpoints(Id: ID): [global_ExternalDNSRuntimeEndpoint!] + RecordType: String + Ttl: Int + HealthCheckDomain: String + HealthCheckExternalPort: Int + HealthCheckPort: Int + HealthCheckPath: String + HealthCheckThreshold: Int + HealthCheckInterval: Int + HealthCheckProtocol: String + GnsVersion: String +} + +type global_ExternalLBConfigN { + Id: ID + ParentLabels: Map + + Config: String +} + +type global_ExternalPluginCapability { + Id: ID + ParentLabels: Map + + Capability: String +} + +type global_ExternalPluginConfigFolder { + Id: ID + ParentLabels: Map + + Plugins(Id: ID): [global_ExternalPluginConfig!] +} + +type global_ExternalPluginConfig { + Id: ID + ParentLabels: Map + + PluginInstances(Id: ID): [global_ExternalPluginInstanceConfig!] + Name: String + ProviderName: String + InstallConfig: String + Type: String +} + +type global_ExternalPluginInstanceConfig { + Id: ID + ParentLabels: Map + + Clusters(Id: ID): [global_Cluster!] + Monitors(Id: ID): [global_ExternalPluginMonitor!] + Name: String + SecurityToken: String + Capabilitiy(Id: ID): global_ExternalPluginCapability! +} + +type global_ExternalPluginMonitor { + Id: ID + ParentLabels: Map + + ObjType: String + PluginCapability: String + Fn: String + Arg1: String +} + +type global_ExternalServicesRT { + Id: ID + ParentLabels: Map + + OwnedBy: String + CreatedByGNS: String + CreatedByESName: String + CreatedBySDFolder: String + CreatedBySDEntry: String + ServicePort: Int + Protocol: String + Hostname: String + Port: Int + ServerCertificate: String + HostnameAlias: String + EndpointList: String + EgressGateways: String + ClientCertificate: String + ClientKey: String +} + +type global_FeatureFlag { + Id: ID + ParentLabels: Map + + Name: String + Description: String + Enable: Boolean +} + +type global_GatewayConfigListenerCertificate { + Id: ID + ParentLabels: Map + + EncryptedCertificate: String + EncryptedPrivateKey: String + EncryptedCertChain: String +} + +type global_GatewayConfigAdditionalListeners { + Id: ID + ParentLabels: Map + + ListenerRoutes(Id: ID): [global_GatewayConfigListenerDestinationRoute!] + Name: String + Port: Int + Protocol: String + TlsMode: String + OwnedBy: String + Hosts: String + Certificate(Id: ID): global_GatewayConfigListenerCertificate! +} + +type global_GatewayConfigListenerDestinationRoute { + Id: ID + ParentLabels: Map + + Host: String + Target: String + Paths: String + Port: Int +} + +type global_GatewayConfig { + Id: ID + ParentLabels: Map + + AdditionalListeners(Id: ID): [global_GatewayConfigAdditionalListeners!] + Name: String + OwnedBy: String + Labels: String + Listeners: String +} + +type global_Gateway { + Id: ID + ParentLabels: Map + + Services(Id: ID): [global_Service!] + Name: String + Labels: String + Annotations: String + Spec: String +} + +type global_GeoDiscoveryRT { + Id: ID + ParentLabels: Map + + Gnsid: String + Selectors: String + Spec: String +} + +type global_GeoDiscovery { + Id: ID + ParentLabels: Map + + Description: String + Labels: String + Spec: String +} + +type global_GlobalNs { + Id: ID + ParentLabels: Map + + RoutingPolicies(Id: ID): [global_RPolicy!] + GnsName: String +} + +type global_GlobalRegistrationService { + Id: ID + ParentLabels: Map + + Tenants(Id: ID): [global_Tenant!] + TenantToken(Id: ID): [global_TenantToken!] + BuildID: String + Version: String + ErrorCount: Int +} + +type global_GlobalNamespace { + Id: ID + ParentLabels: Map + + Gns(Id: ID): [global_GNS!] +} + +type global_GnsAccessControlPolicyRT { + Id: ID + ParentLabels: Map + + Gnsid: String + Spec: String +} + +type global_GnsAccessControlPolicy { + Id: ID + ParentLabels: Map + + Description: String + Labels: String + Spec: String +} + +type global_GnsBindingRT { + Id: ID + ParentLabels: Map + + GnsSvcGroupRT(Id: ID): [global_GnsSvcGroupRT!] + GnsRoutingRules(Id: ID): [global_GnsRoutingRuleConfig!] + GnsServiceEntryConfig(Id: ID): [global_GnsServiceEntryConfig!] + Name: String + Domain: String + Namespaces: String + ApiDiscoveryEnabled: Boolean +} + +type global_GnsEndpointsConfig { + Id: ID + ParentLabels: Map + + Endpoints: String + GnsId: String + EndpointServices: String + ServicePortList: String + Selector: String +} + +type global_ExternalServiceConfig { + Id: ID + ParentLabels: Map + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData + Spec: String + System: Boolean +} + +type global_PublicServiceRouteConfig { + Id: ID + ParentLabels: Map + + Type: String + Routes: String +} + +type global_PublicServiceConfig { + Id: ID + ParentLabels: Map + + RoutingConfigs(Id: ID): [global_PublicServiceRouteConfig!] + ExternalDNS(Id: ID): [global_ExternalDNSConfigN!] + Certificates(Id: ID): [global_CertificateConfigN!] + HealthChecks(Id: ID): [global_HealthCheckConfigN!] + Fqdn: String + Config: String +} + +type global_GNSRoutingConfig { + Id: ID + ParentLabels: Map + + Name: String + Spec: String +} + +type global_GnsRoutingRuleConfig { + Id: ID + ParentLabels: Map + + Name: String + OwnedBy: String + ServiceFQDN: String + PortName: String + Port: Int + HttpRouteRules: String +} + +type global_GnsSegmentationPolicyRT { + Id: ID + ParentLabels: Map + + Gnsid: String + Spec: String +} + +type global_GnsSegmentationPolicy { + Id: ID + ParentLabels: Map + + Description: String + Labels: String + Spec: String +} + +type global_GnsServiceEntryConfig { + Id: ID + ParentLabels: Map + + Service: String + Ports: String + Versions: String +} + +type global_GnsSvcGroupRT { + Id: ID + ParentLabels: Map + + Name: String + DisplayName: String + Description: String + Services: String +} + +type global_GNSSvcGroup { + Id: ID + ParentLabels: Map + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String + ): TimeSeriesData queryServiceTable( + startTime: String + endTime: String + SystemServices: Boolean + ExternalServices: Boolean + ShowGateways: Boolean + Groupby: ServiceGroupByEnum + noMetrics: Boolean + limit: Int + last: String + ): TimeSeriesData queryServiceVersionTable( + startTime: String + endTime: String + SystemServices: Boolean + ExternalServices: Boolean + ShowGateways: Boolean + noMetrics: Boolean + ): TimeSeriesData queryServiceNodeMapGroupedByNode( + startTime: String + endTime: String + ): TimeSeriesData queryServiceNodeMapGroupedByService( + startTime: String + endTime: String + ): TimeSeriesData queryClusterTable( + startTime: String + endTime: String + timeInterval: String + noMetrics: Boolean + ): TimeSeriesData + Services(Id: ID): [global_Service!] + DisplayName: String + Description: String + Color: String + Rules: String +} + +type global_SharedServiceConfig { + Id: ID + ParentLabels: Map + + Spec: String +} + +type global_GNS { + Id: ID + ParentLabels: Map + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String + ): TimeSeriesData queryServiceTable( + startTime: String + endTime: String + SystemServices: Boolean + ExternalServices: Boolean + ShowGateways: Boolean + Groupby: ServiceGroupByEnum + noMetrics: Boolean + limit: Int + last: String + ): TimeSeriesData queryServiceVersionTable( + startTime: String + endTime: String + SystemServices: Boolean + ExternalServices: Boolean + ShowGateways: Boolean + noMetrics: Boolean + ): TimeSeriesData queryServiceTopology( + metricStringArray: String + startTime: String + endTime: String + ): TimeSeriesData queryClusterTable( + startTime: String + endTime: String + timeInterval: String + noMetrics: Boolean + ): TimeSeriesData queryNodeTable( + startTime: String + endTime: String + ): TimeSeriesData queryServiceNodeMapGroupedByNode( + startTime: String + endTime: String + ): TimeSeriesData queryServiceNodeMapGroupedByService( + startTime: String + endTime: String + ): TimeSeriesData queryAccessControlPolicyStats( + sourceServiceDN: String + destinationServiceDN: String + policy: String + startTime: String + endTime: String + ): TimeSeriesData queryGNSServiceAPI( + service: String + version: String + showLabels: Boolean + openapiFormatting: Boolean + ): TimeSeriesData queryStats( + metricStringArray: String + destinationService: String + destinationServiceVersion: String + api: String + method: HTTPMethodEnum + sourceWorkloadDN: String + severity: EventSeverityEnum + startTime: String + endTime: String + ): TimeSeriesData queryLogs( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + destinationService: String + destinationServiceVersion: String + api: String + method: HTTPMethodEnum + from: Int + size: Int + ): TimeSeriesData queryList( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + destinationService: String + destinationServiceVersion: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData queryLinechart( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + destinationService: String + destinationServiceVersion: String + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData queryTopN( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + destinationService: String + destinationServiceVersion: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + limit: Int + ): TimeSeriesData queryDetail( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + destinationService: String + destinationServiceVersion: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + timeInterval: String + timeZone: String + ): TimeSeriesData queryIncomingAPIs( + startTime: String + endTime: String + destinationService: String + destinationServiceVersion: String + timeInterval: String + timeZone: String + ): TimeSeriesData queryOutgoingAPIs( + startTime: String + endTime: String + destinationService: String + destinationServiceVersion: String + timeInterval: String + timeZone: String + ): TimeSeriesData queryIncomingTCP( + startTime: String + endTime: String + destinationService: String + destinationServiceVersion: String + ): TimeSeriesData queryOutgoingTCP( + startTime: String + endTime: String + destinationService: String + destinationServiceVersion: String + ): TimeSeriesData + MemberGroups(Id: ID): [global_SvcGroup!] + GnsServiceGroups(Id: ID): [global_GNSSvcGroup!] + Members(Id: ID): [global_Domain!] + PublicServices(Id: ID): [global_PublicServiceConfig!] + SharedServices(Id: ID): [global_SharedServiceConfig!] + SloPolicies(Id: ID): [global_SLOPolicy!] + ExternalServices(Id: ID): [global_ExternalServiceConfig!] + AutoscalingPolicies(Id: ID): [global_AutoscalingPolicy!] + RoutingPolicies(Id: ID): [global_GNSRoutingConfig!] + ApiDiscovery(Id: ID): [global_ApiDiscovery!] + GeoDiscovery(Id: ID): [global_GeoDiscovery!] + PiiDiscovery(Id: ID): [global_PiiDiscovery!] + AttackDiscovery(Id: ID): [global_AttackDiscovery!] + UserDiscovery(Id: ID): [global_UserDiscovery!] + GnsAccessControlPolicy(Id: ID): [global_GnsAccessControlPolicy!] + GnsSchemaViolationDiscovery(Id: ID): [global_GnsSchemaViolationDiscovery!] + GnsSegmentationPolicy(Id: ID): [global_GnsSegmentationPolicy!] + Domain: String + UseSharedGateway: Boolean + MTLSEnforced: Boolean + MTLSPermissive: Boolean + ApiDiscoveryEnabled: Boolean + MTLSExceptions: String + CaType: String + Ca: String + Description: String + Color: String + Version: String + ProjectId: String + MemberDomains: String + MatchingConditions: String + RoutingConfig(Id: ID): global_GNSRoutingConfig! +} + +type global_HaConfigV2 { + Id: ID + ParentLabels: Map + + ConfigType: String +} + +type global_HaConfig { + Id: ID + ParentLabels: Map + + ConfigType: String +} + +type global_HealthCheckConfigN { + Id: ID + ParentLabels: Map + + ProjectId: String + Config: String +} + +type global_HostConfigV2 { + Id: ID + ParentLabels: Map + + Name: String + Host: String + HaConfigV2(Id: ID): global_HaConfigV2! + OutboundAuthenticationMode(Id: ID): global_OutboundAuthenticationMode! +} + +type global_HostConfig { + Id: ID + ParentLabels: Map + + Name: String + Host: String + OwnedBy: String + HaConfig(Id: ID): global_HaConfig! +} + +type global_InboundAuthenticationConfig { + Id: ID + ParentLabels: Map + + Name: String + OwnedBy: String + Mode: String + Ports: String +} + +type global_Inventory { + Id: ID + ParentLabels: Map + queryClusterTable( + startTime: String + endTime: String + timeInterval: String + noMetrics: Boolean + ): TimeSeriesData queryNodeTS( + nodeMetric: NodeMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData queryNodeTable( + startTime: String + endTime: String + ): TimeSeriesData queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData querySloCounts( + svcMetric: SloDetailsEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData querySloTable( + svcMetric: SloDetailsEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData queryClusterInventoryCount( + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String + ): TimeSeriesData queryServiceTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + Groupby: ServiceGroupByEnum + noMetrics: Boolean + limit: Int + last: String + ): TimeSeriesData queryServiceVersionTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + noMetrics: Boolean + ): TimeSeriesData queryServiceAPIs( + startTime: String + endTime: String + Continue: String + limit: Int + ): TimeSeriesData queryStats( + metricStringArray: String + api: String + method: HTTPMethodEnum + sourceWorkloadDN: String + severity: EventSeverityEnum + startTime: String + endTime: String + ): TimeSeriesData queryLogs( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + from: Int + size: Int + ): TimeSeriesData queryList( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData queryLinechart( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData queryTopN( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + limit: Int + ): TimeSeriesData queryDetail( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + timeInterval: String + timeZone: String + ): TimeSeriesData queryRiskTracker( + startTime: String + endTime: String + metric: AnalyticsMetricEnum + direction: TrafficDirectionEnum + ): TimeSeriesData queryRiskTrackerDetail( + startTime: String + endTime: String + metric: AnalyticsMetricEnum + subCategory: String + direction: TrafficDirectionEnum + from: Int + size: Int + ): TimeSeriesData + Regions(Id: ID): [global_DCRegion!] + Clusters(Id: ID): [global_Cluster!] + ExternalDNS(Id: ID): [global_ExternalDNSInventory!] + JobFolder(Id: ID): global_JobFolder! +} + +type global_Issuer { + Id: ID + ParentLabels: Map + + Name: String + Metadata: String + Venafi: String + Status: String +} + +type global_JobConfigFolder { + Id: ID + ParentLabels: Map + + JobConfig(Id: ID): [global_JobConfig!] +} + +type global_JobConfig { + Id: ID + ParentLabels: Map + + Config: String +} + +type global_JobFolder { + Id: ID + ParentLabels: Map + + Jobs(Id: ID): [global_Job!] +} + +type global_Job { + Id: ID + ParentLabels: Map + + Status: String + ProjectId: String +} + +type global_KnativeIngress { + Id: ID + ParentLabels: Map + + Name: String + CreationTimestamp: String + ApiLink: String + Labels: String + Annotations: String + Spec: String +} + +type global_LabelConfig { + Id: ID + ParentLabels: Map + + Labels: String +} + +type global_LocalRegistrationServiceCluster { + Id: ID + ParentLabels: Map + + Resources(Id: ID): [global_LocalRegistrationServiceResource!] + Tenant: String + Type: String + Version: String + ErrorCount: Int + RestartCount: Int +} + +type global_LocalRegistrationServiceResource { + Id: ID + ParentLabels: Map + + Type: String + Location: String +} + +type global_LocalRegistrationService { + Id: ID + ParentLabels: Map + + Clusters(Id: ID): [global_LocalRegistrationServiceCluster!] + Template: global_ServiceTemplate! + BuildID: String + Version: String + ErrorCount: Int +} + +type global_LogFolder { + Id: ID + ParentLabels: Map + + Log(Id: ID): [global_Log!] +} + +type global_Log { + Id: ID + ParentLabels: Map + + Request: String +} + +type global_NetworkAttachmentDefinitionConfig { + Id: ID + ParentLabels: Map + + Metadata: String + Name: String + Namespace: String +} + +type global_NetworkAttachmentDefinition { + Id: ID + ParentLabels: Map + + Metadata: String + Name: String + Namespace: String +} + +type global_NodeDefinition { + Id: ID + ParentLabels: Map + + Type: String + Version: String + Provider: String + ImageInfo: String +} + +type global_NodeFolderCluster { + Id: ID + ParentLabels: Map + +} + +type global_NodeFolder { + Id: ID + ParentLabels: Map + + Clusters(Id: ID): [global_NodeFolderCluster!] +} + +type global_NodeGroup { + Id: ID + ParentLabels: Map + + DisplayName: String + Description: String + Scope: String + Color: String + Rules: String +} + +type global_NodeStatus { + Id: ID + ParentLabels: Map + + Addresses: String + Allocatable: String + Capacity: String + DaemonEndpoints: String + Conditions: String + Images: String +} + +type global_NodeTemplate { + Id: ID + ParentLabels: Map + + DefinitionVersions(Id: ID): [global_NodeDefinition!] +} + +type global_Node { + Id: ID + ParentLabels: Map + queryNodeTS( + nodeMetric: NodeMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData queryNodeTable( + startTime: String + endTime: String + ): TimeSeriesData + Name: String + ExternalID: String + ProviderID: String + Architecture: String + ContainerRuntimeVersion: String + KernelVersion: String + OperatingSystem: String + OsImage: String + SystemUUID: String + HostName: String + ApiLink: String + BootID: String + KubeletVersion: String + MachineID: String + CreationTimestamp: String + Annotations: String + Labels: String + Uid: String + Spec: String + KStatus: String + Status(Id: ID): global_NodeStatus! +} + +type global_OutboundAuthenticationMode { + Id: ID + ParentLabels: Map + + Mode: String +} + +type global_PeerAuthentication { + Id: ID + ParentLabels: Map + + Name: String + Labels: String + Annotations: String + Spec: String +} + +type global_PiiDiscoveryRT { + Id: ID + ParentLabels: Map + + Gnsid: String + Selectors: String + Spec: String +} + +type global_PiiDiscovery { + Id: ID + ParentLabels: Map + + Description: String + Labels: String + Spec: String +} + +type global_PolicyConfig { + Id: ID + ParentLabels: Map + + Src: String + Dst: String + Action: String +} + +type global_PolicyTemplate { + Id: ID + ParentLabels: Map + +} + +type global_AccessControlPolicy { + Id: ID + ParentLabels: Map + + PolicyConfigs(Id: ID): [global_ACPConfig!] +} + +type global_ProgressiveUpgrade { + Id: ID + ParentLabels: Map + + Upgrade(Id: ID): [global_ProgressiveUpgradeConfig!] +} + +type global_ProgressiveUpgradeConfig { + Id: ID + ParentLabels: Map + + Name: String + Services: String + UpgradeStrategy: String +} + +type global_ProgressiveUpgradeFolder { + Id: ID + ParentLabels: Map + + Upgrades(Id: ID): [global_ProgressiveUpgradeRuntime!] +} + +type global_ProgressiveUpgradeRuntime { + Id: ID + ParentLabels: Map + + UpgradeName: String + Status: String + Step: String +} + +type global_ProjectConfig { + Id: ID + ParentLabels: Map + + SvcGroups(Id: ID): [global_SvcGroup!] + Gns(Id: ID): [global_GNS!] + PolicyConfigs(Id: ID): [global_ACPConfig!] + TemplateGroups(Id: ID): [global_TemplateGroup!] + Certificates(Id: ID): [global_CertificateConfigN!] + ExternalAccounts(Id: ID): [global_ExternalAccountConfigN!] + ExternalDNS(Id: ID): [global_ExternalDNSConfigN!] + Autoscalers(Id: ID): [global_Autoscaler!] + Clusters(Id: ID): [global_ClusterSettings!] + ServiceLevelObjectives(Id: ID): [global_ServiceLevelObjective!] + CertificateAuthorities(Id: ID): [global_CertificateAuthorityConfigN!] + Name: String +} + +type global_ProjectInventory { + Id: ID + ParentLabels: Map + + Clusters(Id: ID): [global_Cluster!] + ExternalDNS(Id: ID): [global_ExternalDNSInventory!] + Jobs(Id: ID): [global_Job!] +} + +type global_ProjectQuery { + Id: ID + ParentLabels: Map + queryClusterTable( + startTime: String + endTime: String + timeInterval: String + noMetrics: Boolean + ): TimeSeriesData queryNodeTS( + nodeMetric: NodeMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData queryNodeTable( + startTime: String + endTime: String + ): TimeSeriesData queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData queryClusterInventoryCount( + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData queryServiceTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + Groupby: ServiceGroupByEnum + noMetrics: Boolean + limit: Int + last: String + ): TimeSeriesData queryServiceVersionTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + noMetrics: Boolean + ): TimeSeriesData queryStats( + metricStringArray: String + api: String + method: HTTPMethodEnum + sourceWorkloadDN: String + severity: EventSeverityEnum + startTime: String + endTime: String + ): TimeSeriesData queryLogs( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + from: Int + size: Int + ): TimeSeriesData queryList( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData queryLinechart( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData queryTopN( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + limit: Int + ): TimeSeriesData queryDetail( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + timeInterval: String + timeZone: String + ): TimeSeriesData queryRiskTracker( + startTime: String + endTime: String + metric: AnalyticsMetricEnum + direction: TrafficDirectionEnum + ): TimeSeriesData queryRiskTrackerDetail( + startTime: String + endTime: String + metric: AnalyticsMetricEnum + subCategory: String + direction: TrafficDirectionEnum + from: Int + size: Int + ): TimeSeriesData +} + +type global_Project { + Id: ID + ParentLabels: Map + + Spec: String + Config(Id: ID): global_ProjectConfig! + Inventory(Id: ID): global_ProjectInventory! + Query(Id: ID): global_ProjectQuery! +} + +type global_PublicServiceRT { + Id: ID + ParentLabels: Map + + OwnedBy: String + FqdnList: String +} + +type global_RemoteGatewayServiceConfig { + Id: ID + ParentLabels: Map + + OwnedBy: String + Labels: String + NodeIPs: String + Ports: String +} + +type global_ResourceGroupRT { + Id: ID + ParentLabels: Map + + SvcGroupRT(Id: ID): [global_SvcGroupRT!] +} + +type global_ResourceGroup { + Id: ID + ParentLabels: Map + + AppGroups(Id: ID): [global_AppGroup!] + SvcGroups(Id: ID): [global_SvcGroup!] + NodeGroups(Id: ID): [global_NodeGroup!] + DataGroups(Id: ID): [global_DataGroup!] + UserGroups(Id: ID): [global_UserGroup!] +} type Query { - root: root_Root + root: global_Root +} + +type global_Root { + Id: ID + ParentLabels: Map + + Name: String + Config: global_Config! + Inventory: global_Inventory! + Runtime: global_Runtime! +} + +type global_RPolicy { + Id: ID + ParentLabels: Map + + HealthCheckId: String +} + +type global_Runtime { + Id: ID + ParentLabels: Map + + AllsparkServices: global_AllSparkServices! + UserFolder: global_UserFolder! + DataFolder: global_DataFolder! + AppFolder(Id: ID): global_AppFolder! + NodeFolder: global_NodeFolder! + ClusterFolder(Id: ID): global_ClusterFolder! + ProgressiveUpgrade: global_ProgressiveUpgradeFolder! + JobConfigFolder: global_JobConfigFolder! + ExternalDNS: global_ExternalDNSRuntime! + SloFolder(Id: ID): global_SLOFolder! + ServiceDirectoryRT: global_ServiceDirectoryRT! +} + +type global_SchemaViolationDiscoveryRT { + Id: ID + ParentLabels: Map + + Gnsid: String + Selectors: String + Spec: String +} + +type global_GnsSchemaViolationDiscovery { + Id: ID + ParentLabels: Map + + Description: String + Labels: String + Spec: String +} + +type global_SecretRTConfig { + Id: ID + ParentLabels: Map + + Type: String + Data: String + IsBase64Encoded: Boolean + OwnedBy: String +} + +type global_SecretHash { + Id: ID + ParentLabels: Map + + Name: String + Type: String + Metadata: String + DataHash: String +} + +type global_SecurityContextConstraintsConfig { + Id: ID + ParentLabels: Map + + Metadata: String + Name: String + Groups: String +} + +type global_SecurityContextConstraints { + Id: ID + ParentLabels: Map + + Metadata: String + Name: String + Groups: String +} + +type global_ServiceConfig { + Id: ID + ParentLabels: Map + + ServiceVersion(Id: ID): [global_ServiceVersionConfig!] + Name: String + OwnedBy: String } -type root_Root { +type global_ServiceCronJob { Id: ID ParentLabels: Map - Config(Id: ID): config_Config! + ServiceInstances(Id: ID): [global_ServiceInstance!] + ServiceJobs(Id: ID): [global_ServiceJob!] + Name: String + Metadata: String + Spec: String + Status: String +} + +type global_ServiceDaemonSet { + Id: ID + ParentLabels: Map + queryWorkloadVersionAPI( + version: String + showLabels: Boolean + openapiFormatting: Boolean + ): TimeSeriesData + ServiceInstances(Id: ID): [global_ServiceInstance!] + Name: String + Metadata: String + Spec: String + Status: String +} + +type global_ServiceDeploymentContainer { + Id: ID + ParentLabels: Map + + Name: String + Image: String + ImagePullPolicy: String + TerminationMessagePath: String + TerminationMessagePolicy: String + Args: String + Env: String + LivenessProbe: String + ReadinessProbe: String + Ports: String + Resources: String + VolumeMounts: String +} + +type global_ServiceDeployment { + Id: ID + ParentLabels: Map + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String + ): TimeSeriesData queryWorkloadVersionAPI( + version: String + showLabels: Boolean + openapiFormatting: Boolean + ): TimeSeriesData + Containers(Id: ID): [global_ServiceDeploymentContainer!] + ServiceInstances(Id: ID): [global_ServiceInstance!] + ServiceReplicaSet(Id: ID): [global_ServiceReplicaSet!] + Metadata: String + Spec: String + Status: String + Namespace: String + Annotations: String + CreationTimestamp: String + Labels: String + Name: String + ApiLink: String + Uid: String + Generation: Int + Selector: String + Replicas: Int + DnsPolicy: String + RestartPolicy: String + SchedulerName: String + SecurityContext: String + ServiceAccount: String + ServiceAccountName: String + TerminationGracePeriodSeconds: Int + Volumes: String + TemplateLabels: String + StatusReplicas: Int + AvailableReplicas: Int + UpdatedReplicas: Int + ReadyReplicas: Int + ObservedGeneration: Int + Conditions: String +} + +type global_ServiceDirectoryEntryConfig { + Id: ID + ParentLabels: Map + + Spec: String +} + +type global_ServiceDirectoryRTFolderEntry { + Id: ID + ParentLabels: Map + + Spec: String + Spec_type: String +} + +type global_ServiceDirectoryRTFolder { + Id: ID + ParentLabels: Map + + ServiceDirectoryRTFolderEntry(Id: ID): [global_ServiceDirectoryRTFolderEntry!] + Name: String +} + +type global_ServiceDirectoryRT { + Id: ID + ParentLabels: Map + + ServiceDirectoryRTFolder(Id: ID): [global_ServiceDirectoryRTFolder!] +} + +type global_ServiceDirectoryN { + Id: ID + ParentLabels: Map + + Entries(Id: ID): [global_ServiceDirectoryEntryConfig!] + Spec: String +} + +type global_ServiceEntryConfig { + Id: ID + ParentLabels: Map + + Name: String + OwnedBy: String + Service: String + ServiceFQDN: String + Description: String + ServicePortList: String + Tags: String + Labels: String + Endpoints: String + EndpointList: String } -type config_Config { +type global_ServiceEntry { Id: ID ParentLabels: Map - QueryExample( - StartTime: String - EndTime: String - Interval: String - IsServiceDeployment: Boolean - StartVal: Int - ): NexusGraphqlResponse - ACPPolicies(Id: ID): [policypkg_AccessControlPolicy!] - FooExample(Id: ID): [config_FooTypeABC!] - MyStr0: String - MyStr1: String - MyStr2: String - XYZPort: String - ABCHost: String - ClusterNamespaces: String - TestValMarkers: String - Instance: Float - CuOption: String - GNS(Id: ID): gns_Gns! - DNS: gns_Dns! - VMPPolicies(Id: ID): policypkg_VMpolicy! - Domain(Id: ID): config_Domain! - SvcGrpInfo(Id: ID): servicegroup_SvcGroupLinkInfo! + Name: String + Annotations: String + Labels: String + CreationTimestamp: String + ApiLink: String + Uid: String + Hosts: String + Addresses: String + Ports: String + Location: String + Resolution: String + Endpoints: String + ExportTo: String + WorkloadSelectorLabels: String } -type config_FooTypeABC { +type global_SvcGroupRT { Id: ID ParentLabels: Map - FooA: String - FooB: String - FooD: String - FooF: String + Name: String + DisplayName: String + Description: String + Services: String } -type config_Domain { +type global_ServiceInstanceContainer { Id: ID ParentLabels: Map - PointPort: String - PointString: String - PointInt: Int - PointMap: String - PointSlice: String - SliceOfPoints: String - SliceOfArrPoints: String - MapOfArrsPoints: String - PointStruct: String + Name: String + Image: String + ImagePullPolicy: String + TerminationMessagePath: String + TerminationMessagePolicy: String + Resources: String + VolumeMounts: String + Command: String + SecurityContext: String } -type gns_Gns { +type global_ServiceInstance { Id: ID ParentLabels: Map - queryGns1( - StartTime: String - EndTime: String - Interval: String - IsServiceDeployment: Boolean - StartVal: Int - ): NexusGraphqlResponse - queryGnsQM1: TimeSeriesData - queryGnsQM( - StartTime: String - EndTime: String - TimeInterval: String - SomeUserArg1: String - SomeUserArg2: Int - SomeUserArg3: Boolean + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String ): TimeSeriesData + Containers(Id: ID): [global_ServiceInstanceContainer!] + Node: global_Node! + Metadata: String + Spec: String + Status: String + Name: String + Namespace: String + Annotations: String + Labels: String + ApiLink: String + Uid: String + RestartPolicy: String + DnsPolicy: String + HostNetwork: Boolean + SecurityContext: String + TerminationGracePeriodSeconds: Int + Tolerations: String + StatusConditions: String + StatusContainer: String + PodIP: String + QosClass: String + Phase: String + StartTime: String + NodeName: String +} - Domain: String - UseSharedGateway: Boolean +type global_ServiceJob { + Id: ID + ParentLabels: Map + + ServiceInstances(Id: ID): [global_ServiceInstance!] + Name: String + Metadata: String + Spec: String + Status: String +} + +type global_ServiceLevelObjectiveFolder { + Id: ID + ParentLabels: Map + + ServiceLevelObjectives(Id: ID): [global_ServiceLevelObjective!] +} + +type global_ServiceLevelObjective { + Id: ID + ParentLabels: Map + + ProjectId: String + Disabled: Boolean Description: String - Meta: String - Port: Int - OtherDescription: String - MapPointer: String - SlicePointer: String - WorkloadSpec: String - DifferentSpec: String - ServiceSegmentRef: String - ServiceSegmentRefPointer: String - ServiceSegmentRefs: String - ServiceSegmentRefMap: String - GnsAccessControlPolicy(Id: ID): policypkg_AccessControlPolicy! - FooChild: gns_BarChild! + Labels: String + Slis: String + SloServices: String + SloTargetValue: String + SloPeriod: String + SloCreationTime: String +} + +type global_ServiceReplicaSet { + Id: ID + ParentLabels: Map + + ServiceInstances(Id: ID): [global_ServiceInstance!] + Name: String + Metadata: String + Spec: String + Status: String +} + +type global_ServiceStatefulSet { + Id: ID + ParentLabels: Map + queryWorkloadVersionAPI( + version: String + showLabels: Boolean + openapiFormatting: Boolean + ): TimeSeriesData + ServiceInstances(Id: ID): [global_ServiceInstance!] + Name: String + Metadata: String + Spec: String + Status: String +} + +type global_ServiceTemplateServiceDefinition { + Id: ID + ParentLabels: Map + + Type: String + Version: String + Template: String + TemplateArgs: String } -type gns_BarChild { +type global_ServiceTemplate { Id: ID ParentLabels: Map + ServiceDefinitions(Id: ID): [global_ServiceTemplateServiceDefinition!] + Version: String +} + +type global_ServiceVersionConfig { + Id: ID + ParentLabels: Map + + MetricMonitors(Id: ID): [global_MetricMonitor!] + Name: String + Version: String +} + +type global_MetricMonitor { + Id: ID + ParentLabels: Map + + OwnedBy: String + SvcMetric: String + FunctionType: String + FunctionArgs: String +} + +type global_ServiceVersion { + Id: ID + ParentLabels: Map + queryStats( + metricStringArray: String + api: String + method: HTTPMethodEnum + sourceWorkloadDN: String + severity: EventSeverityEnum + startTime: String + endTime: String + ): TimeSeriesData queryLogs( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + from: Int + size: Int + ): TimeSeriesData queryList( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData queryLinechart( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData queryTopN( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData queryDetail( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData queryIncomingAPIs( + startTime: String + endTime: String + timeInterval: String + timeZone: String + ): TimeSeriesData queryOutgoingAPIs( + startTime: String + endTime: String + timeInterval: String + timeZone: String + ): TimeSeriesData queryIncomingTCP( + startTime: String + endTime: String + ): TimeSeriesData queryOutgoingTCP( + startTime: String + endTime: String + ): TimeSeriesData + ServiceDeployments(Id: ID): [global_ServiceDeployment!] + ServiceDaemonSets(Id: ID): [global_ServiceDaemonSet!] + ServiceStatefulSets(Id: ID): [global_ServiceStatefulSet!] Name: String } -type gns_IgnoreChild { +type global_Service { + Id: ID + ParentLabels: Map + queryServiceAPIs( + startTime: String + endTime: String + version: String + showLabels: Boolean + openapiFormatting: Boolean + ): TimeSeriesData queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData querySloDetails( + svcMetric: SloDetailsEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData querySloCounts( + svcMetric: SloDetailsEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData querySloTable( + svcMetric: SloDetailsEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String + ): TimeSeriesData queryServiceTopology( + metricStringArray: String + startTime: String + endTime: String + ): TimeSeriesData queryServiceNodeMapGroupedByService( + startTime: String + endTime: String + ): TimeSeriesData queryServiceTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + Groupby: ServiceGroupByEnum + noMetrics: Boolean + limit: Int + last: String + ): TimeSeriesData queryServiceVersionTable( + startTime: String + endTime: String + ShowGateways: Boolean + noMetrics: Boolean + ): TimeSeriesData queryStats( + metricStringArray: String + api: String + method: HTTPMethodEnum + sourceWorkloadDN: String + severity: EventSeverityEnum + startTime: String + endTime: String + ): TimeSeriesData queryLogs( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + from: Int + size: Int + ): TimeSeriesData queryList( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData queryLinechart( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData queryTopN( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData queryDetail( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData queryIncomingAPIs( + startTime: String + endTime: String + timeInterval: String + timeZone: String + ): TimeSeriesData queryOutgoingAPIs( + startTime: String + endTime: String + timeInterval: String + timeZone: String + ): TimeSeriesData queryIncomingTCP( + startTime: String + endTime: String + ): TimeSeriesData queryOutgoingTCP( + startTime: String + endTime: String + ): TimeSeriesData + AdditionalAttributes(Id: ID): [global_AdditionalAttributes!] + ServiceDeployments(Id: ID): [global_ServiceDeployment!] + ServiceStatefulSets(Id: ID): [global_ServiceStatefulSet!] + ServiceDaemonSets(Id: ID): [global_ServiceDaemonSet!] + Endpoints(Id: ID): [global_Endpoints!] + ServiceVersions(Id: ID): [global_ServiceVersion!] + ServiceReplicaSets(Id: ID): [global_ServiceReplicaSet!] + ServiceJobs(Id: ID): [global_ServiceJob!] + Metadata: String + Spec: String + Name: String + Namespace: String + ApiLink: String + IpAddress: String + Annotations: String + CreationTimestamp: String + Labels: String + Uid: String + Ports: String + Selector: String + Type: String + Status: String +} + +type global_SloConfig { Id: ID ParentLabels: Map + SloServices(Id: ID): [global_SloServiceConfig!] Name: String } -type gns_Dns { +type global_SloServiceConfig { Id: ID ParentLabels: Map + Name: String + RemainingBudget: Int + LastUpdateTime: String } -type servicegroup_SvcGroupLinkInfo { +type global_SLOFolder { Id: ID ParentLabels: Map - ClusterName: String - DomainName: String - ServiceName: String - ServiceType: String + Slos(Id: ID): [global_FederatedSloConfig!] } -type policypkg_AccessControlPolicy { +type global_FederatedSloConfig { Id: ID ParentLabels: Map - PolicyConfigs(Id: ID): [policypkg_ACPConfig!] + SloServices(Id: ID): [global_FederatedSloServiceConfig!] + Name: String +} + +type global_FederatedSloServiceConfig { + Id: ID + ParentLabels: Map + + Name: String + RemainingBudget: Int + LastUpdateTime: String } -type policypkg_ACPConfig { +type global_SLOPolicy { Id: ID ParentLabels: Map + Name: String + Disabled: Boolean + Description: String + Labels: String + Slis: String + ServiceNames: String + SloTargetValue: String + SloPeriod: String + SloKind: String + Actions: String + SloCreationTime: String +} + +type global_SvcGroup { + Id: ID + ParentLabels: Map + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String + ): TimeSeriesData queryServiceTable( + startTime: String + endTime: String + SystemServices: Boolean + ExternalServices: Boolean + ShowGateways: Boolean + Groupby: ServiceGroupByEnum + noMetrics: Boolean + limit: Int + last: String + ): TimeSeriesData queryServiceVersionTable( + startTime: String + endTime: String + SystemServices: Boolean + ExternalServices: Boolean + ShowGateways: Boolean + noMetrics: Boolean + ): TimeSeriesData queryServiceNodeMapGroupedByNode( + startTime: String + endTime: String + ): TimeSeriesData queryServiceNodeMapGroupedByService( + startTime: String + endTime: String + ): TimeSeriesData queryClusterTable( + startTime: String + endTime: String + timeInterval: String + noMetrics: Boolean + ): TimeSeriesData + Services(Id: ID): [global_Service!] + Deployments(Id: ID): [global_ServiceDeployment!] + Daemonsets(Id: ID): [global_ServiceDaemonSet!] + Statefulsets(Id: ID): [global_ServiceStatefulSet!] + Jobs(Id: ID): [global_ServiceJob!] DisplayName: String - Gns: String + InternalPredefinedGroup: Boolean Description: String - Tags: String + Color: String ProjectId: String - Conditions: String + Rules: String } -type policypkg_VMpolicy { - Id: ID - ParentLabels: Map - queryGns1( - StartTime: String - EndTime: String - Interval: String - IsServiceDeployment: Boolean - StartVal: Int - ): NexusGraphqlResponse - queryGnsQM1: TimeSeriesData - queryGnsQM( - StartTime: String - EndTime: String - TimeInterval: String - SomeUserArg1: String - SomeUserArg2: Int - SomeUserArg3: Boolean - ): TimeSeriesData +type global_Table { + Id: ID + ParentLabels: Map + + Template: global_Template! + Inventory: global_Inventory! +} + +type global_TemplateGroup { + Id: ID + ParentLabels: Map + + DataTemplates(Id: ID): [global_DataTemplate!] + NodeTemplates(Id: ID): [global_NodeTemplate!] + AppTemplates(Id: ID): [global_AppTemplate!] + ServiceTemplates(Id: ID): [global_ServiceTemplate!] + PolicyTemplates(Id: ID): [global_PolicyTemplate!] + ProjectId: String +} + +type global_Template { + Id: ID + ParentLabels: Map + + TemplateGroups(Id: ID): [global_TemplateGroup!] + HealthChecks(Id: ID): [global_HealthCheckConfigN!] +} + +type global_TenantResource { + Id: ID + ParentLabels: Map + + Type: String + Location: String +} + +type global_TenantToken { + Id: ID + ParentLabels: Map + + Ttl: Int + Created: String + TenantId: String +} + +type global_Tenant { + Id: ID + ParentLabels: Map + + Resources(Id: ID): [global_TenantResource!] + Template: global_ServiceTemplate! + Annotations(Id: ID): [global_Annotation!] + Name: String + TenantName: String + ContactEmail: String + Yaml: String + Lb: String + CompanySize: String + Address: String +} + +type global_UserDiscoveryRT { + Id: ID + ParentLabels: Map + + Gnsid: String + Selectors: String + Spec: String +} + +type global_UserDiscovery { + Id: ID + ParentLabels: Map + + Description: String + Labels: String + Spec: String +} + +type global_UserFolder { + Id: ID + ParentLabels: Map + + Users(Id: ID): [global_User!] + AppUsers(Id: ID): [global_AppUser!] + AccessToken(Id: ID): [global_AccessToken!] +} + +type global_UserGroup { + Id: ID + ParentLabels: Map + + DisplayName: String + Description: String + Scope: String + Color: String + Rules: String +} +type global_UserPreference { + Id: ID + ParentLabels: Map + + Name: String + Data: String + UserId: String +} + +type global_User { + Id: ID + ParentLabels: Map + + Preferences(Id: ID): [global_UserPreference!] + Username: String + Password: String + Email: String + AccessTokens: String + LastActionDate: String +} + +type global_VirtualService { + Id: ID + ParentLabels: Map + + DestinationRules(Id: ID): [global_DestinationRule!] + Services(Id: ID): [global_Service!] + Gateways(Id: ID): [global_Gateway!] + Name: String + CreationTimestamp: String + ApiLink: String + Uid: String + Annotations: String + Labels: String + Hosts: String + Http: String + Tls: String + Tcp: String + GatewayNames: String + ExportTo: String +} + +type global_WorkloadEntry { + Id: ID + ParentLabels: Map + + Name: String + Annotations: String + Labels: String + CreationTimestamp: String + ApiLink: String + Uid: String + Address: String + WorkloadLabels: String + Ports: String + Locality: String } type NexusGraphqlResponse { @@ -188,3 +3119,241 @@ type TimeSeriesData { Last: String TotalRecords: Int } + +enum ExternalDNSRecordType { + A + AAAA + AFSDB + APL + CAA + CDNSKEY + CDS + CERT + CNAME + CSYNC + DHCID + DLV + DNAME + DNSKEY + DS + EUI48 + EUI64 + HINFO + HIP + IPSECKEY + KEY + KX + LOC + MX + NAPTR + NS + NSEC + NSEC3 + NSEC3PARAM + OPENPGPKEY + PTR + RRSIG + RP + SIG + SMIMEA + SOA + SRV + SSHFP + TA + TKEY + TLSA + TSIG + TXT + URI + ZONEMD +} + +enum ServiceMetricTypeEnum { + RequestPS + Requests + Latency + p50Latency + p90Latency + p99Latency + ErrorRate + ErrorPS + ClusterCount + NodeCount + ServiceCount + ServiceInstanceCount + Response2xx + Response3xx + Response4xx + Response5xx + SuccessRate + CPUUsageMillicores + MemoryUsageBytes + RequestResponse + DesiredInstanceCount + TotalErrorBudget + RemainingErrorBudget + RemainingErrorBudgetPercentage + IsViolated + ViolatedSlis +} + +enum SloDetailsEnum { + TotalErrorBudget + RemainingErrorBudget + RemainingErrorBudgetPercentage + IsViolated + ViolatedSlis + SloSummary + SloStatus + GnsSloStatus + BurnRate + SloPerformanceTable +} + +enum NodeMetricTypeEnum { + CPUCapacity + CPUUsage + DiskCapacity + DiskUsages + DiskIO + DiskWait + MemoryCapacity + MemoryUsages + MemoryUsagesBytes + IOWait + NetworkIO + ServiceCount + ServiceInstanceCount +} + +enum ServiceGroupByEnum { + serviceversions +} + +enum AnalyticsMetricEnum { + Endpoint + PII + Compliance + Error + Attack + Event + Geo + User + EgressDomain + GlobalNamespace + ResponseCode + Workload + Service + RequestRate + RequestSize + ResponseSize + Latency + ConnectionDuration + ConnectionRate + BytesSent + BytesReceived + GeoWithPII + GeoUnderAttack + AuthError +} + +enum AnalyticsSubMetricEnum { + RequestRate + RequestSize + ResponseSize + Latency + ConnectionDuration + ConnectionRate + BytesSent + BytesReceived +} + +enum HTTPMethodEnum { + GET + POST + PUT + DELETE + HEAD + PATCH +} + +enum EventSeverityEnum { + Info + Warning + Critical +} + +enum TrafficDirectionEnum { + Ingress + Internal + Egress +} + +enum GNSPluginState { + IDLE + PROCESSING + SYNCING + SYNCED + ERROR +} + +enum SLOKind { + Monitored + Actionable +} + +enum OperationType { + SERVICE + NODE + USER + API + DATA +} + +enum Action { + FEDERATE +} + +enum SloPeriodFrequency { + Unknown + Monthly +} + +enum ConfigChangeState { + APPLIED + INSYNC + INERROR +} + +enum ExternalServicesRTProtocols { + HTTP + HTTPS + TCP + TLS +} + +enum MetricMonitorFunction { + Aggregate # Exampe arg to this fn: {windowSeconds: 600} + CheckThreshold # Example arg to this fn: {windowSeconds: 600, threshold: 300} +} + +enum HaType { + BASIC +} + +enum LogState { + NOT_FETCHED + FETCHING + COMPLETED + FAILED +} + +enum ServiceDirectoryRTFolderEntryType { + FromGNS + DirectAdd +} + +directive @jsonencoded(file: String, gofile: String, name: String) on FIELD_DEFINITION +directive @relation(name: String, parameters: String, softlink: String, uuidkey: String) on FIELD_DEFINITION +directive @timeseriesAPI(file: String!, handler: String!) on FIELD_DEFINITION +directive @protobuf(file: String!, name: String!) on FIELD_DEFINITION diff --git a/compiler/example/output/generated/nexus-gql/graph/schema.resolvers.go b/compiler/example/output/generated/nexus-gql/graph/schema.resolvers.go index 676fc29b9..e103ddd4a 100644 --- a/compiler/example/output/generated/nexus-gql/graph/schema.resolvers.go +++ b/compiler/example/output/generated/nexus-gql/graph/schema.resolvers.go @@ -1,135 +1 @@ package graph - -// This file will be automatically regenerated based on the schema, any resolver implementations -// will be copied through when generating and any unknown code will be moved to the end. - -import ( - "context" - - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/nexus-gql/graph/generated" - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/nexus-gql/graph/model" -) - -// Root is the resolver for the root field. -func (r *queryResolver) Root(ctx context.Context) (*model.RootRoot, error) { - return getRootResolver() -} - -// QueryExample is the resolver for the QueryExample field. -func (r *config_ConfigResolver) QueryExample(ctx context.Context, obj *model.ConfigConfig, startTime *string, endTime *string, interval *string, isServiceDeployment *bool, startVal *int) (*model.NexusGraphqlResponse, error) { - return getConfigConfigQueryExampleResolver(obj, startTime, endTime, interval, isServiceDeployment, startVal) -} - -// ACPPolicies is the resolver for the ACPPolicies field. -func (r *config_ConfigResolver) ACPPolicies(ctx context.Context, obj *model.ConfigConfig, id *string) ([]*model.PolicypkgAccessControlPolicy, error) { - return getConfigConfigACPPoliciesResolver(obj, id) -} - -// FooExample is the resolver for the FooExample field. -func (r *config_ConfigResolver) FooExample(ctx context.Context, obj *model.ConfigConfig, id *string) ([]*model.ConfigFooTypeABC, error) { - return getConfigConfigFooExampleResolver(obj, id) -} - -// GNS is the resolver for the GNS field. -func (r *config_ConfigResolver) GNS(ctx context.Context, obj *model.ConfigConfig, id *string) (*model.GnsGns, error) { - return getConfigConfigGNSResolver(obj, id) -} - -// DNS is the resolver for the DNS field. -func (r *config_ConfigResolver) DNS(ctx context.Context, obj *model.ConfigConfig) (*model.GnsDns, error) { - return getConfigConfigDNSResolver(obj) -} - -// VMPPolicies is the resolver for the VMPPolicies field. -func (r *config_ConfigResolver) VMPPolicies(ctx context.Context, obj *model.ConfigConfig, id *string) (*model.PolicypkgVMpolicy, error) { - return getConfigConfigVMPPoliciesResolver(obj, id) -} - -// Domain is the resolver for the Domain field. -func (r *config_ConfigResolver) Domain(ctx context.Context, obj *model.ConfigConfig, id *string) (*model.ConfigDomain, error) { - return getConfigConfigDomainResolver(obj, id) -} - -// SvcGrpInfo is the resolver for the SvcGrpInfo field. -func (r *config_ConfigResolver) SvcGrpInfo(ctx context.Context, obj *model.ConfigConfig, id *string) (*model.ServicegroupSvcGroupLinkInfo, error) { - return getConfigConfigSvcGrpInfoResolver(obj, id) -} - -// QueryGns1 is the resolver for the queryGns1 field. -func (r *gns_GnsResolver) QueryGns1(ctx context.Context, obj *model.GnsGns, startTime *string, endTime *string, interval *string, isServiceDeployment *bool, startVal *int) (*model.NexusGraphqlResponse, error) { - return getGnsGnsqueryGns1Resolver(obj, startTime, endTime, interval, isServiceDeployment, startVal) -} - -// QueryGnsQM1 is the resolver for the queryGnsQM1 field. -func (r *gns_GnsResolver) QueryGnsQM1(ctx context.Context, obj *model.GnsGns) (*model.TimeSeriesData, error) { - return getGnsGnsqueryGnsQM1Resolver(obj) -} - -// QueryGnsQM is the resolver for the queryGnsQM field. -func (r *gns_GnsResolver) QueryGnsQM(ctx context.Context, obj *model.GnsGns, startTime *string, endTime *string, timeInterval *string, someUserArg1 *string, someUserArg2 *int, someUserArg3 *bool) (*model.TimeSeriesData, error) { - return getGnsGnsqueryGnsQMResolver(obj, startTime, endTime, timeInterval, someUserArg1, someUserArg2, someUserArg3) -} - -// GnsAccessControlPolicy is the resolver for the GnsAccessControlPolicy field. -func (r *gns_GnsResolver) GnsAccessControlPolicy(ctx context.Context, obj *model.GnsGns, id *string) (*model.PolicypkgAccessControlPolicy, error) { - return getGnsGnsGnsAccessControlPolicyResolver(obj, id) -} - -// FooChild is the resolver for the FooChild field. -func (r *gns_GnsResolver) FooChild(ctx context.Context, obj *model.GnsGns) (*model.GnsBarChild, error) { - return getGnsGnsFooChildResolver(obj) -} - -// PolicyConfigs is the resolver for the PolicyConfigs field. -func (r *policypkg_AccessControlPolicyResolver) PolicyConfigs(ctx context.Context, obj *model.PolicypkgAccessControlPolicy, id *string) ([]*model.PolicypkgACPConfig, error) { - return getPolicypkgAccessControlPolicyPolicyConfigsResolver(obj, id) -} - -// QueryGns1 is the resolver for the queryGns1 field. -func (r *policypkg_VMpolicyResolver) QueryGns1(ctx context.Context, obj *model.PolicypkgVMpolicy, startTime *string, endTime *string, interval *string, isServiceDeployment *bool, startVal *int) (*model.NexusGraphqlResponse, error) { - return getPolicypkgVMpolicyqueryGns1Resolver(obj, startTime, endTime, interval, isServiceDeployment, startVal) -} - -// QueryGnsQM1 is the resolver for the queryGnsQM1 field. -func (r *policypkg_VMpolicyResolver) QueryGnsQM1(ctx context.Context, obj *model.PolicypkgVMpolicy) (*model.TimeSeriesData, error) { - return getPolicypkgVMpolicyqueryGnsQM1Resolver(obj) -} - -// QueryGnsQM is the resolver for the queryGnsQM field. -func (r *policypkg_VMpolicyResolver) QueryGnsQM(ctx context.Context, obj *model.PolicypkgVMpolicy, startTime *string, endTime *string, timeInterval *string, someUserArg1 *string, someUserArg2 *int, someUserArg3 *bool) (*model.TimeSeriesData, error) { - return getPolicypkgVMpolicyqueryGnsQMResolver(obj, startTime, endTime, timeInterval, someUserArg1, someUserArg2, someUserArg3) -} - -// Config is the resolver for the Config field. -func (r *root_RootResolver) Config(ctx context.Context, obj *model.RootRoot, id *string) (*model.ConfigConfig, error) { - return getRootRootConfigResolver(obj, id) -} - -// Query returns generated.QueryResolver implementation. -func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} } - -// Config_Config returns generated.Config_ConfigResolver implementation. -func (r *Resolver) Config_Config() generated.Config_ConfigResolver { return &config_ConfigResolver{r} } - -// Gns_Gns returns generated.Gns_GnsResolver implementation. -func (r *Resolver) Gns_Gns() generated.Gns_GnsResolver { return &gns_GnsResolver{r} } - -// Policypkg_AccessControlPolicy returns generated.Policypkg_AccessControlPolicyResolver implementation. -func (r *Resolver) Policypkg_AccessControlPolicy() generated.Policypkg_AccessControlPolicyResolver { - return &policypkg_AccessControlPolicyResolver{r} -} - -// Policypkg_VMpolicy returns generated.Policypkg_VMpolicyResolver implementation. -func (r *Resolver) Policypkg_VMpolicy() generated.Policypkg_VMpolicyResolver { - return &policypkg_VMpolicyResolver{r} -} - -// Root_Root returns generated.Root_RootResolver implementation. -func (r *Resolver) Root_Root() generated.Root_RootResolver { return &root_RootResolver{r} } - -type queryResolver struct{ *Resolver } -type config_ConfigResolver struct{ *Resolver } -type gns_GnsResolver struct{ *Resolver } -type policypkg_AccessControlPolicyResolver struct{ *Resolver } -type policypkg_VMpolicyResolver struct{ *Resolver } -type root_RootResolver struct{ *Resolver } diff --git a/compiler/example/output/generated/nexus-gql/server.go b/compiler/example/output/generated/nexus-gql/server.go index 8d32c046e..85cb58a13 100644 --- a/compiler/example/output/generated/nexus-gql/server.go +++ b/compiler/example/output/generated/nexus-gql/server.go @@ -3,14 +3,15 @@ package main import ( "net/http" - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/nexus-gql/graph" - "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/output/generated/nexus-gql/graph/generated" - + "nexustempmodule/nexus-gql/graph" + "nexustempmodule/nexus-gql/graph/generated" "github.com/rs/cors" + "github.com/vmware-tanzu/graph-framework-for-microservices/gqlgen/graphql" "github.com/vmware-tanzu/graph-framework-for-microservices/gqlgen/graphql/handler" "github.com/vmware-tanzu/graph-framework-for-microservices/gqlgen/graphql/playground" ) + func StartHttpServer() { c := cors.New(cors.Options{ AllowedOrigins: []string{"*"}, diff --git a/compiler/example/output/generated/tsm-nexus-gql/graph/schema.graphqls b/compiler/example/output/generated/tsm-nexus-gql/graph/schema.graphqls new file mode 100644 index 000000000..8c4958ff3 --- /dev/null +++ b/compiler/example/output/generated/tsm-nexus-gql/graph/schema.graphqls @@ -0,0 +1,3158 @@ + + +type AccessToken { + id: ID! + ttl: Int + created: String + userId: String +} + +type ACPConfig { + id: ID + destSvcGroups(name: String): [SvcGroup!] @relation(softlink: "true", parameters: ACPSvcGroupLinkInfo, uuidkey: "true") + sourceSvcGroups(name: String): [SvcGroup!] @relation(softlink: "true", parameters: ACPSvcGroupLinkInfo, uuidkey: "true") + displayName: String + gns: String + description: String + tags: [String] + projectId: String + destGroups: String @jsonencoded(file:"./root/config/policy/policy-config/policy-config.ts", gofile:"policy-config.go", name: "ResourceGroupIDs") + sourceGroups: String @jsonencoded(file:"./root/config/policy/policy-config/policy-config.ts", gofile:"policy-config.go", name: "ResourceGroupIDs") + conditions: [String] + actions: String @jsonencoded(file:"./root/config/policy/policy-config/policy-config.ts", gofile:"policy-config.go", name: "PolicyCfgActions") +} + +type AdditionalAttributes { + id: ID + name: String + value: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"AttributeValue") + context: String +} + +type AllSparkServices { + id: ID + globalRegistrationService: GlobalRegistrationService + localRegistrationService: LocalRegistrationService + awsConnector: AwsConnector +} + +type Annotation { + id: ID + name: String! + data: String @jsonencoded +} + +type ApiDiscoveryRT { + id: ID + gnsid: String + selectors: String @jsonencoded(file:"../common-apis/api/tenant/models/common", gofile:"gns_api_discovery.go", name:"ApiDiscoveryClusterResourceSelectorRT") + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsApiDiscovery", gofile:"gns_api_discovery.go", name:"ApiDiscoveryApplicationConfigList") + compressionEnabled: Boolean + isEndpointApiPrechecks: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsApiDiscovery", gofile:"gns_api_discovery.go", name:"APIDiscoveryIsEndpointApiPrechecks") + processingToggles: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsApiDiscovery", gofile:"gns_api_discovery.go", name:"APIDiscoveryProcessingToggles") +} + +type ApiDiscovery { + id: ID + description: String + labels: String @jsonencoded(file:"../common-apis/api/tenant/models/common", gofile:"common.go", name:"LabelsList") + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsApiDiscovery", name:"ApiDiscoveryConfig") +} + +type AppFolder { + id: ID + app(name: ID): [App!] +} + +type AppGroup { + name: ID + services(name: String): [Service!] @relation(softlink: "true", uuidkey: "true") + rules: String @jsonencoded(file:"../common-apis/api/tenant/models/resourceGroup", gofile:"resource_group.go", name:"Rules") +} + +type AppTemplateServiceDefinition { + name: ID! + type: String! + version: String! + template: String! + templateArgs: [String!] +} + +type AppTemplate { + name: ID! + serviceDefinitions(name: ID): [AppTemplateServiceDefinition!] + version: String +} + +type AppUser { + name: ID! +} + +type AppVersion { + id: ID + template: Template @relation(softlink: "true") + inventory: Inventory @relation(softlink: "true") +} + +type App { + name: ID! + version: AppVersion +} + +type ApplicationInfo { + name: ID + app: String @jsonencoded(file:"../common-apis/api/tenant/models/clusterLifecycle.ts", gofile:"cluster_lifecycle.go", name:"ApplicationInstance") +} + +type AttackDiscoveryRT { + id: ID + gnsid: String + selectors: String @jsonencoded(file:"../common-apis/api/tenant/models/common", gofile:"gns_attack_discovery.go", name:"AttackDiscoveryClusterResourceSelectorRT") + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsAttackDiscovery", gofile:"gns_attack_discovery.go", name:"AttackDiscoveryApplicationConfigList") +} + +type AttackDiscovery { + id: ID + description: String + labels: String @jsonencoded(file:"../common-apis/api/tenant/models/common", gofile:"common.go", name:"LabelsList") + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsAttackDiscovery", gofile:"gns_attack_discovery.go", name:"AttackDiscoveryConfig") +} + +type AuthenticationPolicy { + id: ID + name: String + labels: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"Labels") + annotations: String @jsonencoded + spec: String @jsonencoded(file:"./root/inventory/cluster/domain/authentication-policy/istio.d.ts", gofile:"istio.go", name:"PolicySpec") +} + +type AutoscalerFolder { + name: ID + autoscalers(name: String): [Autoscaler!] +} + +type AutoscalerConfig { + id: ID + name: String + configSource: String + desiredState: String @protobuf(file:"./common-apis/protos/autoscaling/autoscaling.proto", name:"AutoscalingDefinition") +} + +type Autoscaler { + id: ID + autoscaler: AutoscalerCR! @relation(name: "HAS", softlink: "true") + name: String + projectId: String +} + +type AutoscalerCR { + id: ID + name: String + autoscalingDefinition: String @protobuf(file:"./common-apis/protos/autoscaling/autoscaling.proto", name:"AutoscalingDefinition") +} + +type AutoscalingPolicy { + id: ID + name: String + description: String + labels: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"Labels") + serviceName: String + autoscalerSpec: String @protobuf(file:"./common-apis/protos/autoscaling/autoscaling.proto" name:"AutoscalingDefinition") +} + +type AwsConnector { + id: ID + gns(gnsName: ID): [GlobalNs!] +} + +type Bucket { + name: ID + template: Template @relation(softlink: "true") + inventory: Inventory @relation(softlink: "true") +} + +type CertificateAuthorityRT { + name: ID + url: String + type: String + templatePath: String + secretRef: String +} + +type CertificateAuthorityConfigN { + id: ID + config: String @jsonencoded(file:"../common-apis/api/tenant/models/certificateAuthority", gofile:"certificate_authority.go", name: "CertificateAuthorityConfig") +} + +type CertificateConfigN { + id: ID + projectId: String + beginsOn: String + expiresOn: String + issuedToCN: String + config: String @jsonencoded(file:"../common-apis/api/tenant/models/certificate", gofile:"certificate.go", name: "CertificateConfig") +} + +type CertificateRequest { + id: ID + name: String + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + issuerRef: String @jsonencoded + request: String + duration: String + uid: String + isCA: Boolean + username: String + usages: String @jsonencoded + groups: String @jsonencoded + extra: String @jsonencoded + status: String @jsonencoded +} + +type Certificate { + id: ID + name: String + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + issuerRef: String @jsonencoded + privateKey: String @jsonencoded + subject: String @jsonencoded + commonName: String + duration: String + dnsNames: [String] + ipAddresses: [String] + secretName: String + renewBefore: String + emailAddresses: [String] + uris: [String] + secretTemplate: String @jsonencoded + keyStores: String @jsonencoded + isCA: Boolean + encodeUsagesInRequest: String @jsonencoded + usages: String @jsonencoded + revisionHistoryLimit: Int + additionalOutputFormats: String @jsonencoded + status: String @jsonencoded +} + +type ClusterConfigFolder { + id: ID + clusters(name: ID): [ClusterSettings!] @relation(name: "HAS", parameters: ClusterSettingsStatus) +} + +type ClusterConfig { + id: ID + domains(name: String): [DomainConfig!] @relation(name: "HAS", parameters: ConfigChangeStatus) + hostConfig(name: String): [HostConfig!] @relation(name: "HAS", parameters: ConfigChangeStatus) @deprecated(reason: "Moved under Domain-Config") + dnsConfigFolder: DNSConfigFolder + dnsProbesConfigFolder: DNSProbesConfigFolder + logFolder: LogFolder + gnsBinding(id: ID): [GnsBindingRT!] @relation(name: "HAS", parameters: ConfigChangeStatus) + securityContextConstraints(name: String): [SecurityContextConstraintsConfig!] @relation(name: "HAS", parameters: ConfigChangeStatus) + resourceGroup: ResourceGroupRT! + name: String +} + +type ClusterFolder { + id: ID + clusters(name: String): [ClusterConfig!] @relation(name: "HAS", parameters: ConfigChangeStatus) + remoteGatewayServiceConfigs(name: ID): [RemoteGatewayServiceConfig!] @relation(name: "HAS", parameters: ConfigChangeStatus) + name: String +} + +type ClusterSettings { + name: ID + projectId: String + displayName: String + description: String + tags: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name: "StringList") + labels: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"Labels") + autoInstallServiceMesh: Boolean + enableNamespaceExclusions: Boolean + namespaceExclusions: String @jsonencoded(file:"../common-apis/api/tenant/models/common", gofile:"common.go", name:"Conditions") + systemNamespaceExclusions: String @jsonencoded(file:"../common-apis/api/tenant/models/common", gofile:"common.go", name:"Conditions") + agentDomain: String + proxyConfig: String @jsonencoded(file:"../common-apis/api/tenant/models/clusterLifecycle", gofile:"cluster_lifecycle.go", name: "ProxyConfigRequest") + autoInstallServiceMeshConfig: String @jsonencoded(file:"../common-apis/api/tenant/models/clusterLifecycle", gofile:"cluster_lifecycle.go", name: "AutoInstallServiceMeshConfig") + registryAccount: String + caLabels: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"CaLabels") + enableInternalGateway: Boolean +} + +type Cluster { + id: ID + queryNodeTS( + nodeMetric: NodeMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryNodeTS") + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTS") + queryServiceTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + Groupby: ServiceGroupByEnum + noMetrics: Boolean + limit: Int + last: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTable") + queryServiceVersionTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + noMetrics: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceVersionTable") + queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceInstanceTable") + queryServiceTopology( + metricStringArray: String + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTopology") + queryClusterTable( + startTime: String + endTime: String + timeInterval: String + noMetrics: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryClusterTable") + queryNodeTable( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryNodeTable") + queryServiceNodeMapGroupedByNode( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceNodeMapGroupedByNode") + queryServiceNodeMapGroupedByService( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceNodeMapGroupedByService") + queryServiceNodeMapGroupedByServiceVersion( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceNodeMapGroupedByServiceVersion") + queryStats( + metricStringArray: String + api: String + method: HTTPMethodEnum + sourceWorkloadDN: String + severity: EventSeverityEnum + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryStats") + queryLogs( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + from: Int + size: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryLogs") + queryList( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryList") + queryLinechart( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryLinechart") + queryTopN( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + limit: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryTopN") + queryDetail( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryDetail") + connectionStatus: ConnectionStatus + apps(name: String): [ApplicationInfo!] + dnsProbeStatus(name: String): [DNSProbeStatus!] + securityContextConstraints(name: String): [SecurityContextConstraints!] + domains(name: String): [Domain!] + nodes(name: String): [Node!] + name: String + uuid: String + connected: Boolean + istioState: String + status: String @jsonencoded(file:"../common-apis/api/tenant/models/clusterLifecycle.ts", gofile:"cluster_lifecycle.go", name:"ClusterStatus") + statusHistory: String @jsonencoded(file:"../common-apis/api/tenant/models/clusterLifecycle.ts", gofile:"cluster_lifecycle.go", name:"ClusterStatusHistory") + castatus: String @jsonencoded(file:"../common-apis/api/tenant/models/clusterLifecycle.ts", gofile:"cluster_lifecycle.go", name:"CaStatus") + caStatusHistory: String @jsonencoded(file:"../common-apis/api/tenant/models/clusterLifecycle.ts", gofile:"cluster_lifecycle.go", name:"CaStatusHistory") + componentStatuses: String @jsonencoded(file:"../common-apis/api/tenant/models/clusterLifecycle.ts", gofile:"cluster_lifecycle.go", name:"ComponentStatuses") + componentStatusesHistory: String @jsonencoded(file:"../common-apis/api/tenant/models/clusterLifecycle.ts", gofile:"cluster_lifecycle.go", name:"ComponentStatusesHistory") + type: String + projectId: String +} + +type ConfigMap { + id: ID + name: String + annotations: String @jsonencoded + labels: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"Labels") + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + data: String @jsonencoded(file:"./root/inventory/cluster/domain/config-map/configmap.d.ts", gofile:"configmap.go", name:"ConfigMapData") +} + +type Config { + id: ID + resourceGroups: ResourceGroup! + globalNamespace: GlobalNamespace! + policy: AccessControlPolicy! + templates: Template + progressiveUpgrade: ProgressiveUpgrade! + externalPlugins: ExternalPluginConfigFolder! + certificates(id: ID): [CertificateConfigN!] + externalAccounts(id: ID): [ExternalAccountConfigN!] @relation(name: "HAS", parameters: ExternalAccountConfigStatus) + externalAuditStorage: ExternalAuditStorage + externalDNS(id: ID): [ExternalDNSConfigN!] + externalLB(id: ID): [ExternalLBConfigN!] + autoscalerFolder: AutoscalerFolder + clusters: ClusterConfigFolder! + serviceLevelObjective: ServiceLevelObjectiveFolder + featureFlags(name: String): [FeatureFlag!] + projects(id: ID): [Project!] + serviceDirectory(id: ID): [ServiceDirectoryN!] +} + +type ConnectionStatus { + id: ID + connected: Boolean + message: String + code: Int +} + +type DataFolderDomainCluster { + name: ID! +} + +type DataFolderDomainServiceVersion { + name: ID +} + +type DataFolderDomainService { + name: ID! + versions(name: ID): [DataFolderDomainServiceVersion!] +} + +type DataFolderDomain { + name: ID! + cluster: DataFolderDomainCluster + service(name: ID): [DataFolderDomainService!] + database: Database +} + +type DataFolder { + id: ID + domain: DataFolderDomain +} + +type DataGroup { + name: ID + displayName: String + description: String + scope: String + color: String + rules: String @jsonencoded(file:"../common-apis/api/tenant/models/resourceGroup", gofile:"resource_group.go", name:"Rules") +} + +type DataTemplate { + name: ID! +} + +type Database { + id: ID + tables(name: ID): [Table] + directories(name: ID): [Directory] + buckets(name: ID): [Bucket] +} + +type DCRegion { + id: ID + zones(name: String): [DCZone!] + name: String +} + +type DCZone { + id: ID + clusters(uuid: String): [Cluster!] @relation(name: "HAS", softlink: "true") + name: String +} + +type DestinationRule { + id: ID + service: Service! @relation(name: "pointsTo", softlink: "true") + serviceDeployments(name: String): [ServiceDeployment!] @relation(name: "pointsTo", parameters: SVToControllerLinkParam, softlink: "true") + serviceReplicaSets(name: String): [ServiceReplicaSet!] @relation(name: "pointsTo", parameters: SVToControllerLinkParam, softlink: "true") + serviceStatefulSets(name: String): [ServiceStatefulSet!] @relation(name: "pointsTo", parameters: SVToControllerLinkParam, softlink: "true") + serviceDaemonSets(name: String): [ServiceDaemonSet!] @relation(name: "pointsTo", parameters: SVToControllerLinkParam, softlink: "true") + serviceJobs(name: String): [ServiceJob!] @relation(name: "pointsTo", parameters: SVToControllerLinkParam, softlink: "true") + name: String + annotations: String @jsonencoded + labels: String @jsonencoded + creationTimestamp: String + apiLink: String + uid: String + host: String + trafficPolicy: String @jsonencoded + subsets: String @jsonencoded + exportTo: [String!] +} + +type Directory { + name: ID + template: Template @relation(softlink: "true") + inventory: Inventory @relation(softlink: "true") +} + +type DNSConfigFolder { + id: ID + dnsConfig(name: ID): [DNSConfig!] @relation(name: "HAS", parameters: ConfigChangeStatus) +} + +type DNSConfig { + name: ID + ownedBy: String + dnsSuffix: String @jsonencoded(file:"./root/runtime/runtime.ts", gofile:"runtime.go", name:"DNSList") +} + +type DNSProbeConfig { + name: ID + domain: String + createTimestamp: String +} + +type DNSProbeStatus { + id: ID + name: String + domain: String + success: Boolean + updateTimestamp: String +} + +type DNSProbesConfigFolder { + id: ID + dnsProbeConfigs(name: ID): [DNSProbeConfig!] @relation(name: "HAS", parameters: ConfigChangeStatus) +} + +type DomainConfig { + id: ID + policy(id: ID): [PolicyConfig!] + labelConfig: LabelConfig + networkAttachmentDefinition(name: String): [NetworkAttachmentDefinitionConfig!] @relation(name: "HAS", parameters: ConfigChangeStatus) + services(name: String): [ServiceConfig!] @relation(name: "HAS", parameters: ConfigChangeStatus) + serviceEntries(name: String): [ServiceEntryConfig!] @relation(name: "HAS", parameters: ConfigChangeStatus) + gatewayConfig(name: String): [GatewayConfig!] @relation(name: "HAS", parameters: ConfigChangeStatus) + autoscalers(name: String): [AutoscalerConfig!] @relation(name: "HAS", parameters: ConfigChangeStatus) + hostConfigV2(name: String): [HostConfigV2!] @relation(name: "HAS", parameters: ConfigChangeStatus) + inboundAuthenticationConfig(name: String): [InboundAuthenticationConfig!] @relation(name: "HAS", parameters: ConfigChangeStatus) + slos(name: String): [SloConfig!] + secrets(id: ID): [SecretRTConfig!] @relation(name: "HAS", parameters: ConfigChangeStatus) + externalServices(name: ID): [ExternalServicesRT!] @relation(name: "HAS", parameters: ConfigChangeStatus) + apiDiscovery(id: ID): [ApiDiscoveryRT!] @relation(name: "HAS", parameters: ConfigChangeStatus) + geoDiscovery(id: ID): [GeoDiscoveryRT!] @relation(name: "HAS", parameters: ConfigChangeStatus) + piiDiscovery(id: ID): [PiiDiscoveryRT!] @relation(name: "HAS", parameters: ConfigChangeStatus) + attackDiscovery(id: ID): [AttackDiscoveryRT!] @relation(name: "HAS", parameters: ConfigChangeStatus) + userDiscovery(id: ID): [UserDiscoveryRT!] @relation(name: "HAS", parameters: ConfigChangeStatus) + publicService(name: ID): [PublicServiceRT!] @relation(name: "HAS", parameters: ConfigChangeStatus) + gnsAccessControlPolicy(name: ID): [GnsAccessControlPolicyRT!] @relation(name: "HAS", parameters: ConfigChangeStatus) + gnsSchemaViolationDiscovery(id: ID): [SchemaViolationDiscoveryRT!] @relation(name: "HAS", parameters: ConfigChangeStatus) + gnsSegmentationPolicy(name: ID): [GnsSegmentationPolicyRT!] @relation(name: "HAS", parameters: ConfigChangeStatus) + certificateAuthority(name: ID): [CertificateAuthorityRT!] @relation(name: "HAS", parameters: ConfigChangeStatus) + gnsEndpointsConfig(endpoints: String): [GnsEndpointsConfig!] @relation(name: "HAS", parameters: ConfigChangeStatus) + name: String + ownedBy: String + labels: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"Labels") +} + +type Domain { + id: ID + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTS") + queryServiceTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + Groupby: ServiceGroupByEnum + noMetrics: Boolean + limit: Int + last: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTable") + queryServiceVersionTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + noMetrics: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceVersionTable") + queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceInstanceTable") + queryServiceNodeMapGroupedByNode( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceNodeMapGroupedByNode") + queryServiceNodeMapGroupedByService( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceNodeMapGroupedByService") + queryServiceNodeMapGroupedByServiceVersion( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceNodeMapGroupedByServiceVersion") + queryStats( + metricStringArray: String + api: String + method: HTTPMethodEnum + sourceWorkloadDN: String + severity: EventSeverityEnum + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryStats") + queryLogs( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + from: Int + size: Int + gns: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryLogs") + queryList( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryList") + queryLinechart( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryLinechart") + queryTopN( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + limit: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryTopN") + queryDetail( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryDetail") + secretHashes(name: String): [SecretHash!] + serviceInstances(name: String): [ServiceInstance!] + serviceDeployments(name: String): [ServiceDeployment!] + serviceStatefulSets(name: String): [ServiceStatefulSet!] + serviceDaemonSets(name: String): [ServiceDaemonSet!] + serviceReplicaSets(name: String): [ServiceReplicaSet!] + serviceCronJobs(name: String): [ServiceCronJob!] + serviceJobs(name: String): [ServiceJob!] + virtualServices(name: String): [VirtualService!] + serviceEntry(name: String): [ServiceEntry!] + workloadEntry(name: String): [WorkloadEntry!] + destinationRules(name: String): [DestinationRule!] + services(name: String): [Service!] + endpoints(name: String): [Endpoints!] + gateways(name: String): [Gateway!] + authenticationPolicies(name: String): [AuthenticationPolicy!] + configmap(name: String): [ConfigMap!] + envoyfilter(name: String): [EnvoyFilter!] + autoscalers(name: String): [AutoscalerCR] + peerAuthentication(name: String): [PeerAuthentication!] + knativeIngresses(name: String): [KnativeIngress!] + networkAttachmentDefinition(name: String): [NetworkAttachmentDefinition!] + issuers(name: String): [Issuer] + certificates(name: String): [Certificate] + certificateRequests(name: String): [CertificateRequest] + name: String + enviornmentType: String! + apiLink: String + annotations: String @jsonencoded + labels: String @jsonencoded + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") +} + +type Endpoints { + id: ID + name: String + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + subsets: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"EndpointSubsets") + gnsId: String +} + +type EnvoyFilter { + id: ID + name: String + labels: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"Labels") + annotations: String @jsonencoded + spec: String @jsonencoded(file:"./root/inventory/cluster/domain/envoy-filter/envoyfilter.d.ts", gofile:"envoyfilter.go", name:"EnvoyFilterSpec") +} + +type ExternalAccountConfigN { + id: ID + config: String @jsonencoded(file:"../common-apis/api/tenant/models/externalAccount", gofile:"external_account.go", name: "ExternalAccountConfig") + proxyConfig: String @jsonencoded(file:"../common-apis/api/tenant/models/externalAccount", gofile:"external_account.go", name: "ExternalAccountProxyConfig") +} + +type ExternalAuditStorage { + id: ID + config: String! @jsonencoded(file:"../common-apis/api/tenant/models/externalAuditStorage", gofile:"external-audit-storage.go", name: "ExternalAuditStorageConfig") +} + +type ExternalDNSConfigN { + id: ID + account: ExternalAccountConfigN @relation(softlink: "true") + config: String @jsonencoded(file:"../common-apis/api/tenant/models/externalDNS", gofile:"external_dns.go", name: "ExternalDNSConfig") +} + +type ExternalDNSInventoryHealthCheck { + id: ID + name: String + protocol: String @jsonencoded(file:"../common-apis/api/tenant/models/template.ts", gofile:"health_check_config.go", name:"HealthCheckConfigProtocol") + port: Int + path: String + healthThreshold: Int +} + +type ExternalDNSInventoryPrimaryDomain { + name: ID + dnsRecords(id: ID): [ExternalDNSInventoryRecord!] + region: String +} + +type ExternalDNSInventoryRecord { + id: ID + healthCheck: ExternalDNSInventoryHealthCheck! @relation(softlink: "true") + dnsRecordType: ExternalDNSRecordType + ttl: Int + value: String + weight: Int +} + +type ExternalDNSInventoryZone { + name: ID + primaryDomains(name: ID): [ExternalDNSInventoryPrimaryDomain] @relation(softlink: "true") + records: Int +} + +type ExternalDNSInventory { + id: ID + zones(name: ID): [ExternalDNSInventoryZone] + primaryDomains(name: ID): [ExternalDNSInventoryPrimaryDomain!] + healthChecks(id: ID): [ExternalDNSInventoryHealthCheck!] + enabledForProjects: [String] +} + +type ExternalDNSRuntimeEndpoint { + endpointAddress: ID + weight: Int + active: Boolean + gnsVersion: String +} + +type ExternalDNSRuntimePrimaryDomain { + name: ID + subdomains(name: ID): [ExternalDNSRuntimeSubdomain!] + primaryDomain: String + dnsServerID: ID +} + +type ExternalDNSRuntime { + id: ID + primaryDomains(name: ID): [ExternalDNSRuntimePrimaryDomain!] +} + +type ExternalDNSRuntimeSubdomain { + name: ID + endpoints(endpointAddress: ID): [ExternalDNSRuntimeEndpoint!] @relation(parameters: ExternalDNSEndpointRuntimeStatus) + recordType: ExternalDNSRecordType + ttl: Int + healthCheckDomain: String + healthCheckExternalPort: Int + healthCheckPort: Int + healthCheckPath: String + healthCheckThreshold: Int + healthCheckInterval: Int + healthCheckProtocol: String + gnsVersion: String +} + +type ExternalLBConfigN { + id: ID + config: String @jsonencoded(file:"../common-apis/api/tenant/models/externalLB", gofile:"external_lb.go", name: "ExternalLBConfig") +} + +type ExternalPluginCapability { + id: ID + capability: String @protobuf(file:"./common-apis/protos/external-plugin/ep-server.proto", name:"RegisterCapabilityArguments") +} + +type ExternalPluginConfigFolder { + id: ID + plugins(id: ID): [ExternalPluginConfig!] +} + +type ExternalPluginConfig { + id: ID + pluginInstances(pluginInstanceId: ID): [ExternalPluginInstanceConfig!] + name: String + providerName: String + installConfig: String + type: String +} + +type ExternalPluginInstanceConfig { + pluginInstanceId: ID + capabilitiy: ExternalPluginCapability + clusters(name: String): [Cluster!] @relation(name: "DeployedOn", softlink: "true") + monitors(id: ID): [ExternalPluginMonitor!] + name: String + securityToken: String @jsonencoded(file: "./root/config/external-plugin-config-folder/external-plugin-config/external-plugin-instance-config/external-plugins.ts", gofile:"external_plugins.go", name: "ExternalPluginSecurityToken") +} + +type ExternalPluginMonitor { + id: ID + objType: String @protobuf(file:"./common-apis/protos/external-plugin/ep-server.proto", name:"ObjectTypes") + pluginCapability: String @protobuf(file:"./common-apis/protos/external-plugin/ep-server.proto", name:"PluginCapability") + fn: String @jsonencoded(file: "./root/config/external-plugin-config-folder/external-plugin-config/external-plugin-instance-config/external-plugins.ts", gofile:"external_plugins.go", name: "ExternalPluginFn") + arg1: String @jsonencoded(file: "./root/config/external-plugin-config-folder/external-plugin-config/external-plugin-instance-config/external-plugins.ts", gofile:"external_plugins.go", name: "ExternalPluginFnArg") +} + +type ExternalServicesRT { + name: ID + ownedBy: String + createdByGNS: String + createdByESName: String + createdBySDFolder: String + createdBySDEntry: String + servicePort: Int + protocol: ExternalServicesRTProtocols + hostname: String + port: Int + serverCertificate: String + hostnameAlias: String + endpointList: [String!] + egressGateways: [String!] + clientCertificate: String + clientKey: String +} + +type FeatureFlag { + id: ID + name: String + description: String + enable: Boolean +} + +type GatewayConfigListenerCertificate { + id: ID + encryptedCertificate: String + encryptedPrivateKey: String + encryptedCertChain: String +} + +type GatewayConfigAdditionalListeners { + id: ID + certificate: GatewayConfigListenerCertificate + listenerRoutes(id: ID): [GatewayConfigListenerDestinationRoute] + name: String + port: Int + protocol: String + tlsMode: String + ownedBy: String + hosts: [String] +} + +type GatewayConfigListenerDestinationRoute { + id: ID + host: String + target: String + paths: [String] + port: Int +} + +type GatewayConfig { + id: ID + additionalListeners(id: ID): [GatewayConfigAdditionalListeners] + name: String + ownedBy: String + labels: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"Labels") + listeners: String @jsonencoded(file:"./common/ts/gateway.d.ts", gofile:"gateway.go", name:"GatewayConfigListeners") +} + +type Gateway { + id: ID + services(name: String): [Service!] @relation(name: "pointsTo", softlink: "true") + name: String + labels: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"Labels") + annotations: String @jsonencoded + spec: String @jsonencoded(file:"./common/ts/gateway.d.ts", gofile:"gateway.go", name:"GatewaySpec") +} + +type GeoDiscoveryRT { + id: ID + gnsid: String + selectors: String @jsonencoded(file:"../common-apis/api/tenant/models/common", gofile:"gns_geo_discovery.go", name:"GeoDiscoveryClusterResourceSelectorRT") + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsGeoDiscovery", gofile:"gns_geo_discovery.go", name:"GeoDiscoveryGeoFencesConfigList") +} + +type GeoDiscovery { + id: ID + description: String + labels: String @jsonencoded(file:"../common-apis/api/tenant/models/common", gofile:"common.go", name:"LabelsList") + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsGeoDiscovery", gofile:"gns_geo_discovery.go", name:"GeoDiscoveryConfig") +} + +type GlobalNs { + id: ID + routingPolicies(policyName: ID): [RPolicy!] + gnsName: String! +} + +type GlobalRegistrationService { + id: ID + tenants(tenantID: ID): [Tenant!] + tenantToken(id: String): [TenantToken!] + buildID: String! + version: String! + errorCount: Int +} + +type GlobalNamespace { + id: ID + gns(name: ID): [GNS!] +} + +type GnsAccessControlPolicyRT { + id: ID + gnsid: String + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsAccessControlPolicy", gofile:"gns_access_control_policy.go", name:"GnsAccessControlPolicySpec") +} + +type GnsAccessControlPolicy { + id: ID + description: String + labels: String @jsonencoded(file:"../common-apis/api/tenant/models/common", gofile:"common.go", name:"LabelsList") + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsAccessControlPolicy", gofile:"gns_access_control_policy.go", name:"GnsAccessControlPolicySpec") +} + +type GnsBindingRT { + id: ID + GnsSvcGroupRT(id: ID): [GnsSvcGroupRT!] @relation(name: "HAS", parameters: ConfigChangeStatus) + gnsRoutingRules(name: String): [GnsRoutingRuleConfig!] @relation(name: "HAS", parameters: ConfigChangeStatus) + gnsServiceEntryConfig(name: String): [GnsServiceEntryConfig!] @relation(name: "HAS", parameters: ConfigChangeStatus) + name: String + domain: String + namespaces: [String] + apiDiscoveryEnabled: Boolean +} + +type GnsEndpointsConfig { + id: ID + endpoints: String! + gnsId: String! + endpointServices: [String] + servicePortList: String! @jsonencoded(file:"./root/runtime/runtime.ts", gofile:"runtime.go", name:"ServicePortList") + selector: String! @jsonencoded +} + +type ExternalServiceConfig { + id: ID + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTS") + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsExternalService", gofile:"gns_external_service.go", name:"GnsExternalServiceConfig") + system: Boolean +} + +type PublicServiceRouteConfig { + id: ID + type: String + routes: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsPublicService", gofile:"gns_public_service_route_config.go", name: "GnsPublicServiceRouteConfig") +} + +type PublicServiceConfig { + id: ID + routingConfigs(id: ID): [PublicServiceRouteConfig!] @relation(parameters: PublicServiceRouteConfigStatus) + externalDNS(id: ID): [ExternalDNSConfigN!] @relation(softlink: "true") + certificates(id: ID): [CertificateConfigN!] @relation(softlink: "true") + healthChecks(id: ID): [HealthCheckConfigN!] @relation(softlink: "true") + fqdn: String + config: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsPublicService", gofile:"gns_public_service.go", name: "GnsPublicServiceConfig") +} + +type GNSRoutingConfig { + id: ID + name: String! + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsTrafficManagement", gofile:"common.go", name:"TrafficRoutingPolicy") +} + +type GnsRoutingRuleConfig { + id: ID + name: String! + ownedBy: String + serviceFQDN: String! + portName: String + port: Int + httpRouteRules: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsTrafficManagement", gofile:"common.go", name:"HTTPRoutingRules") +} + +type GnsSegmentationPolicyRT { + id: ID + gnsid: String + spec: String @jsonencoded(file: "../common-apis/api/tenant/models/gnsSegmentationPolicy", gofile:"gns_segmentation_policy.go", name:"GnsSegmentationPolicySpec") +} + +type GnsSegmentationPolicy { + id: ID + description: String + labels: String @jsonencoded(file:"../common-apis/api/tenant/models/common", gofile:"common.go", name:"LabelsList") + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsSegmentationPolicy", gofile: "gns_segmentation_policy.go", name:"GnsSegmentationPolicySpec") +} + +type GnsServiceEntryConfig { + id: ID + service: String! + ports: String @jsonencoded(file:"./root/runtime/runtime.ts", gofile:"runtime.go", name:"ServicePortList") + versions: String @jsonencoded(file:"./root/runtime/runtime.ts", gofile:"runtime.go", name:"ServiceVersionList") +} + +type GnsSvcGroupRT { + id: ID + name: String + displayName: String + description: String + services: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsServiceGroup", gofile:"gns_service_group.go", name:"ServiceGroupServiceList") +} + +type GNSSvcGroup { + name: ID + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTS") + queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceInstanceTable") + queryServiceTable( + startTime: String + endTime: String + SystemServices: Boolean + ExternalServices: Boolean + ShowGateways: Boolean + Groupby: ServiceGroupByEnum + noMetrics: Boolean + limit: Int + last: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTable") + queryServiceVersionTable( + startTime: String + endTime: String + SystemServices: Boolean + ExternalServices: Boolean + ShowGateways: Boolean + noMetrics: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceVersionTable") + queryServiceNodeMapGroupedByNode( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceNodeMapGroupedByNode") + queryServiceNodeMapGroupedByService( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceNodeMapGroupedByService") + queryClusterTable( + startTime: String + endTime: String + timeInterval: String + noMetrics: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryClusterTable") + services(name: String): [Service!] @relation(softlink: "true", parameters: SvcGroupLinkInfo, uuidkey: "true") + displayName: String + description: String + color: String + rules: String @jsonencoded(file:"../common-apis/api/tenant/models/resourceGroup", gofile:"resource_group.go", name:"Rules") +} + +type SharedServiceConfig { + id: ID + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsPublicService", gofile:"gns_shared_service.go", name: "GnsSharedServiceConfig") +} + +type GNS { + name: ID + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTS") + queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceInstanceTable") + queryServiceTable( + startTime: String + endTime: String + SystemServices: Boolean + ExternalServices: Boolean + ShowGateways: Boolean + Groupby: ServiceGroupByEnum + noMetrics: Boolean + limit: Int + last: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTable") + queryServiceVersionTable( + startTime: String + endTime: String + SystemServices: Boolean + ExternalServices: Boolean + ShowGateways: Boolean + noMetrics: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceVersionTable") + queryServiceTopology( + metricStringArray: String + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTopology") + queryClusterTable( + startTime: String + endTime: String + timeInterval: String + noMetrics: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryClusterTable") + queryNodeTable( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryNodeTable") + queryServiceNodeMapGroupedByNode( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceNodeMapGroupedByNode") + queryServiceNodeMapGroupedByService( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceNodeMapGroupedByService") + queryAccessControlPolicyStats( + sourceServiceDN: String + destinationServiceDN: String + policy: String + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryAccessControlPolicyStats") + queryGNSServiceAPI( + service: String + version: String + showLabels: Boolean + openapiFormatting: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryGNSServiceAPI") + queryStats( + metricStringArray: String + destinationService: String + destinationServiceVersion: String + api: String + method: HTTPMethodEnum + sourceWorkloadDN: String + severity: EventSeverityEnum + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryStats") + queryLogs( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + destinationService: String + destinationServiceVersion: String + api: String + method: HTTPMethodEnum + from: Int + size: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryLogs") + queryList( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + destinationService: String + destinationServiceVersion: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryList") + queryLinechart( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + destinationService: String + destinationServiceVersion: String + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryLinechart") + queryTopN( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + destinationService: String + destinationServiceVersion: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + limit: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryTopN") + queryDetail( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + destinationService: String + destinationServiceVersion: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryDetail") + queryIncomingAPIs( + startTime: String + endTime: String + destinationService: String + destinationServiceVersion: String + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryIncomingAPIs") + queryOutgoingAPIs( + startTime: String + endTime: String + destinationService: String + destinationServiceVersion: String + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryOutgoingAPIs") + queryIncomingTCP( + startTime: String + endTime: String + destinationService: String + destinationServiceVersion: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryIncomingTCP") + queryOutgoingTCP( + startTime: String + endTime: String + destinationService: String + destinationServiceVersion: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryOutgoingTCP") + routingConfig: GNSRoutingConfig @relation(parameters: GNSConfigStatus) @deprecated(reason: "Field is deprecated, use routingPolicies for Traffic Routing Policies!") + memberGroups(name: ID): [SvcGroup!] @relation(softlink: "true") # to be deprecated + gnsServiceGroups(name: ID): [GNSSvcGroup!] + members(name: ID): [Domain!] @relation(softlink: "true", uuidkey: "true", parameters: GNSToDomainLinkInfo) + publicServices(id: ID): [PublicServiceConfig!] @relation(parameters: PublicServiceConfigStatus) + sharedServices(id: ID): [SharedServiceConfig!] + sloPolicies(name: ID): [SLOPolicy!] + externalServices(id: ID): [ExternalServiceConfig!] + autoscalingPolicies(name: ID): [AutoscalingPolicy!] + routingPolicies(name: ID): [GNSRoutingConfig!] @relation(parameters: GNSConfigStatus) # List of GNS Traffic Routing Policies + apiDiscovery(id: ID): [ApiDiscovery!] + GeoDiscovery(id: ID): [GeoDiscovery!] + PiiDiscovery(id: ID): [PiiDiscovery!] + AttackDiscovery(id: ID): [AttackDiscovery!] + UserDiscovery(id: ID): [UserDiscovery!] + gnsAccessControlPolicy(id: ID): [GnsAccessControlPolicy!] + gnsSchemaViolationDiscovery(id: ID): [GnsSchemaViolationDiscovery!] + gnsSegmentationPolicy(id: ID): [GnsSegmentationPolicy!] + domain: String + useSharedGateway: Boolean + mTLSEnforced: Boolean + mTLSPermissive: Boolean + apiDiscoveryEnabled: Boolean + mTLSExceptions: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"MtlsExceptions") + caType: String + ca: String + description: String + color: String + version: String + projectId: String + memberDomains: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name: "StringList") # to be deprecated + matchingConditions: String @jsonencoded(file:"../common-apis/api/tenant/models/globalNamespace", gofile:"global_namespace.go", name:"MatchConditions") +} + +type HaConfigV2 { + id: ID + configType: String @jsonencoded(file:"./root/runtime/runtime.ts", gofile:"runtime.go", name:"HAType") +} + +type HaConfig { + id: ID + configType: HaType +} + +type HealthCheckConfigN { + id: ID + projectId: String + config: String @jsonencoded(file:"../common-apis/api/tenant/models/template.ts", gofile:"health_check_config.go", name: "HealthCheckConfig") +} + +type HostConfigV2 { + id: ID + haConfigV2: HaConfigV2! @relation(name: "HAS", parameters: ConfigChangeStatus) + outboundAuthenticationMode: OutboundAuthenticationMode! @relation(name: "HAS", parameters: ConfigChangeStatus) + name: String! + host: String! +} + +type HostConfig { + id: ID + haConfig: HaConfig! @relation(name: "HAS", parameters: ConfigChangeStatus) + name: String! + host: String! + ownedBy: String +} + +type InboundAuthenticationConfig { + id: ID + name: String + ownedBy: String + mode: String @jsonencoded(file:"./root/runtime/runtime.ts", gofile:"runtime.go", name:"InboundMode") + ports: String @jsonencoded(file:"./root/runtime/runtime.ts", gofile:"runtime.go", name:"PortLevelAuthenticationMap") +} + +type Inventory { + id: ID + queryClusterTable( + startTime: String + endTime: String + timeInterval: String + noMetrics: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryClusterTable") + queryNodeTS( + nodeMetric: NodeMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryNodeTS") + queryNodeTable( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryNodeTable") + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTS") + querySloCounts( + svcMetric: SloDetailsEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "querySloCounts") + querySloTable( + svcMetric: SloDetailsEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "querySloTable") + queryClusterInventoryCount( + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryClusterInventoryCount") + queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceInstanceTable") + queryServiceTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + Groupby: ServiceGroupByEnum + noMetrics: Boolean + limit: Int + last: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTable") + queryServiceVersionTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + noMetrics: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceVersionTable") + queryServiceAPIs( + startTime: String + endTime: String + Continue: String + limit: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceAPIs") + queryStats( + metricStringArray: String + api: String + method: HTTPMethodEnum + sourceWorkloadDN: String + severity: EventSeverityEnum + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryStats") + queryLogs( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + from: Int + size: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryLogs") + queryList( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryList") + queryLinechart( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryLinechart") + queryTopN( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + limit: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryTopN") + queryDetail( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryDetail") + queryRiskTracker( + startTime: String + endTime: String + metric: AnalyticsMetricEnum + direction: TrafficDirectionEnum + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryRiskTracker") + queryRiskTrackerDetail( + startTime: String + endTime: String + metric: AnalyticsMetricEnum + subCategory: String + direction: TrafficDirectionEnum + from: Int + size: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryRiskTrackerDetail") + regions(name: String): [DCRegion!] + clusters(name: String): [Cluster!] + jobFolder: JobFolder + externalDNS(id: ID): [ExternalDNSInventory!] +} + +type Issuer { + id: ID + name: String + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + venafi: String @jsonencoded + status: String @jsonencoded +} + +type JobConfigFolder { + id: ID + jobConfig(name: ID): [JobConfig!] +} + +type JobConfig { + name: ID + config: String @jsonencoded(file:"../common-apis/api/tenant/models/job.ts", gofile:"job.go", name:"JobInfo") +} + +type JobFolder { + id: ID + jobs(name: String): [Job!] +} + +type Job { + name: ID + status: String @jsonencoded(file:"../common-apis/api/tenant/models/job.ts", gofile:"job.go", name:"JobStatusInfo") + projectId: String +} + +type KnativeIngress { + id: ID + name: String + creationTimestamp: String + apiLink: String + labels: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"Labels") + annotations: String @jsonencoded + spec: String @jsonencoded +} + +type LabelConfig { + id: ID + labels: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"Labels") +} + +type LocalRegistrationServiceCluster { + name: ID! + resources(name: ID): [LocalRegistrationServiceResource!] + tenant: String! + type: String + version: String! + errorCount: Int + restartCount: Int +} + +type LocalRegistrationServiceResource { + name: ID! + type: String + location: String +} + +type LocalRegistrationService { + id: ID + clusters(name: ID): [LocalRegistrationServiceCluster!] + template: ServiceTemplate! @relation(softlink: "true", name: "uses") + buildID: String! + version: String! + errorCount: Int +} + +type LogFolder { + id: ID + log(name: ID): [Log!] @relation(name: "HAS", parameters: LogStatus) +} + +type Log { + name: ID + request: String @jsonencoded(file:"../common-apis/api/tenant/models/clusterLifecycle.ts", gofile:"cluster_lifecycle.go", name:"LogRequest") +} + +type NetworkAttachmentDefinitionConfig { + id: ID + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + name: String! + namespace: String +} + +type NetworkAttachmentDefinition { + id: ID + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + name: String! + namespace: String +} + +type NodeDefinition { + name: ID! + type: String! + version: String! + provider: String + imageInfo: String +} + +type NodeFolderCluster { + name: ID! +} + +type NodeFolder { + id: ID + clusters(name: ID): [NodeFolderCluster!] +} + +type NodeGroup { + name: ID + displayName: String + description: String + scope: String + color: String + rules: String @jsonencoded(file:"../common-apis/api/tenant/models/resourceGroup", gofile:"resource_group.go", name:"Rules") +} + +type NodeStatus { + id: ID + addresses: String @jsonencoded + allocatable: String @jsonencoded + capacity: String @jsonencoded + daemonEndpoints: String @jsonencoded + conditions: String @jsonencoded + images: String @jsonencoded +} + +type NodeTemplate { + name: ID! + definitionVersions(name: ID): [NodeDefinition!] +} + +type Node { + id: ID + queryNodeTS( + nodeMetric: NodeMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryNodeTS") + queryNodeTable( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryNodeTable") + status: NodeStatus + name: String + externalID: String + providerID: String + architecture: String + containerRuntimeVersion: String + kernelVersion: String + operatingSystem: String + osImage: String + systemUUID: String + hostName: String + apiLink: String + bootID: String + kubeletVersion: String + machineID: String + creationTimestamp: String + annotations: String @jsonencoded + labels: String @jsonencoded + uid: String + spec: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"NodeSpec") + kStatus: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"KNodeStatus") +} + +type OutboundAuthenticationMode { + id: ID + mode: String @jsonencoded(file:"./root/runtime/runtime.ts", gofile:"runtime.go", name:"OutboundMode") +} + +type PeerAuthentication { + id: ID + name: String + labels: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"Labels") + annotations: String @jsonencoded + spec: String @jsonencoded(file:"./root/inventory/inventory.d.ts", gofile:"inventory.go", name:"PeerAuthenticationSpec") +} + +type PiiDiscoveryRT { + id: ID + gnsid: String + selectors: String @jsonencoded(file:"../common-apis/api/tenant/models/common", gofile:"gns_pii_discovery.go", name:"PiiDiscoveryClusterResourceSelectorRT") + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsPiiDiscovery", gofile:"gns_pii_discovery.go", name:"PiiDiscoveryApplicationConfigList") +} + +type PiiDiscovery { + id: ID + description: String + labels: String @jsonencoded(file:"../common-apis/api/tenant/models/common", gofile:"common.go", name:"LabelsList") + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsPiiDiscovery", gofile:"gns_pii_discovery.go", name:"PiiDiscoveryConfig") +} + +type PolicyConfig { + id: ID + src: String + dst: String + action: String @jsonencoded(file:"./root/runtime/cluster-folder/cluster-config/domain-config/policy-config/runtime-policy.ts", gofile:"runtime-policy.go", name:"PolicyActions") +} + +type PolicyTemplate { + name: ID +} + +type AccessControlPolicy { + id: ID + policyConfigs(name: ID): [ACPConfig!] +} + +type ProgressiveUpgrade { + id: ID + upgrade(id: ID): [ProgressiveUpgradeConfig!] +} + +type ProgressiveUpgradeConfig { + id: ID! + name: String + services: String @jsonencoded(file:"./root/config/progressive-upgrade/progressive-upgrade-config/progressive-upgrade.ts", gofile:"progressive_upgrade.go", name: "UpgradeServices") + upgradeStrategy: String @jsonencoded(file:"./root/config/progressive-upgrade/progressive-upgrade-config/progressive-upgrade.ts", gofile:"progressive_upgrade.go", name:"ProgressiveUpgradeStrategy") +} + +type ProgressiveUpgradeFolder { + id: ID + upgrades(id: ID): [ProgressiveUpgradeRuntime!] +} + +type ProgressiveUpgradeRuntime { + id: ID + upgradeName: String + status: String @jsonencoded(file:"./root/config/progressive-upgrade/progressive-upgrade-config/progressive-upgrade.ts", gofile:"progressive_upgrade.go", name:"ProgressiveUpgradeStatus") + step: String @jsonencoded(file:"./root/config/progressive-upgrade/progressive-upgrade-config/progressive-upgrade.ts", gofile:"progressive_upgrade.go", name:"ProgressiveUpgradeStep") +} + +type ProjectConfig { + id: ID + svcGroups(name: ID): [SvcGroup!] @relation(name: "HAS", softlink: "true") + gns(name: ID): [GNS!] @relation(name: "HAS", softlink: "true") + policyConfigs(name: ID): [ACPConfig!] @relation(name: "HAS", softlink: "true") + templateGroups(name: ID): [TemplateGroup!] @relation(name: "HAS", softlink: "true") + certificates(id: ID): [CertificateConfigN!] @relation(name: "HAS", softlink: "true") + externalAccounts(id: ID): [ExternalAccountConfigN!] @relation(name: "HAS", softlink: "true") + externalDNS(id: ID): [ExternalDNSConfigN!] @relation(name: "HAS", softlink: "true") + autoscalers(name: String): [Autoscaler!] @relation(name: "HAS", softlink: "true") + clusters(name: ID): [ClusterSettings!] @relation(name: "HAS", softlink: "true") + serviceLevelObjectives(name: ID): [ServiceLevelObjective!] @relation(name: "HAS", softlink: "true") + certificateAuthorities(id: ID): [CertificateAuthorityConfigN!] + name: String +} + +type ProjectInventory { + id: ID + clusters(name: String): [Cluster!] @relation(name: "HAS", softlink: "true") + externalDNS(id: ID): [ExternalDNSInventory!] @relation(name: "HAS", softlink: "true") + jobs(name: String): [Job!] @relation(name: "HAS", softlink: "true") +} + +type ProjectQuery { + id: ID + queryClusterTable( + startTime: String + endTime: String + timeInterval: String + noMetrics: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryClusterTable") + queryNodeTS( + nodeMetric: NodeMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryNodeTS") + queryNodeTable( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryNodeTable") + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTS") + queryClusterInventoryCount( + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryClusterInventoryCount") + queryServiceTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + Groupby: ServiceGroupByEnum + noMetrics: Boolean + limit: Int + last: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTable") + queryServiceVersionTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + noMetrics: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceVersionTable") + queryStats( + metricStringArray: String + api: String + method: HTTPMethodEnum + sourceWorkloadDN: String + severity: EventSeverityEnum + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryStats") + queryLogs( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + from: Int + size: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryLogs") + queryList( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryList") + queryLinechart( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryLinechart") + queryTopN( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + limit: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryTopN") + queryDetail( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + direction: TrafficDirectionEnum + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryDetail") + queryRiskTracker( + startTime: String + endTime: String + metric: AnalyticsMetricEnum + direction: TrafficDirectionEnum + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryRiskTracker") + queryRiskTrackerDetail( + startTime: String + endTime: String + metric: AnalyticsMetricEnum + subCategory: String + direction: TrafficDirectionEnum + from: Int + size: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryRiskTrackerDetail") +} + +type Project { + id: ID + config: ProjectConfig + inventory: ProjectInventory + query: ProjectQuery + spec: String @jsonencoded(file: "../common-apis/api/tenant/models/project", gofile: "project.go", name: "ProjectSpec") +} + +type PublicServiceRT { + name: ID + ownedBy: String + fqdnList: [String] +} + +type RemoteGatewayServiceConfig { + name: ID + ownedBy: String + labels: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"Labels") + nodeIPs: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"DMSet") + ports: String @jsonencoded(file:"./root/runtime/runtime.ts", gofile:"runtime.go", name:"ServicePortList") +} + +type ResourceGroupRT { + id: ID + SvcGroupRT(id: ID): [SvcGroupRT!] @relation(name: "HAS", parameters: ConfigChangeStatus) +} + +type ResourceGroup { + id: ID + appGroups(name: ID): [AppGroup!] + svcGroups(name: ID): [SvcGroup!] + nodeGroups(name: ID): [NodeGroup!] + dataGroups(name: ID): [DataGroup!] + userGroups(name: ID): [UserGroup!] +} + +type Root { + id: ID + config: Config + inventory: Inventory + runtime: Runtime + name: String! +} + +type RPolicy { + id: ID + healthCheckId: String +} + +type Runtime { + id: ID + allsparkServices: AllSparkServices + userFolder: UserFolder + dataFolder: DataFolder + appFolder: AppFolder + nodeFolder: NodeFolder + clusterFolder: ClusterFolder + progressiveUpgrade: ProgressiveUpgradeFolder + jobConfigFolder: JobConfigFolder + externalDNS: ExternalDNSRuntime + sloFolder: SLOFolder + serviceDirectoryRT: ServiceDirectoryRT +} + +type SchemaViolationDiscoveryRT { + id: ID + gnsid: String + selectors: String @jsonencoded(file: "../common-apis/api/tenant/models/common", gofile:"gns_schema_violation_discovery.go", name:"GnsSchemaViolationDiscoveryClusterResourceSelectorRT") + spec: String @jsonencoded(file: "../common-apis/api/tenant/models/gnsSchemaViolationDiscovery", gofile:"gns_schema_violation_discovery.go", name:"GnsSchemaViolationDiscoveryConfig") +} + +type GnsSchemaViolationDiscovery { + id: ID + description: String + labels: String @jsonencoded(file:"../common-apis/api/tenant/models/common", gofile:"common.go", name:"LabelsList") + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsSchemaViolationDiscovery", gofile:"gns_schema_violation_discovery.go", name:"GnsSchemaViolationDiscoveryConfig") +} + +type SecretRTConfig { + id: ID + type: String + data: String + isBase64Encoded: Boolean + ownedBy: String +} + +type SecretHash { + id: ID + name: String + type: String + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + dataHash: String +} + +type SecurityContextConstraintsConfig { + id: ID + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + name: String! + groups: [String] +} + +type SecurityContextConstraints { + id: ID + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + name: String! + groups: [String] +} + +type ServiceConfig { + id: ID + serviceVersion(name: String): [ServiceVersionConfig] @relation(name:"HAS", parameters: ServiceVersionLinkConfig) + name: String + ownedBy: String +} + +type ServiceCronJob { + id: ID + serviceInstances(name: String): [ServiceInstance!] @relation(name: "HAS", softlink: "true") + serviceJobs(name: String): [ServiceJob!] @relation(name: "HAS", softlink: "true") + name: String + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + spec: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"CronJobSpec") + status: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"CronJobStatus") +} + +type ServiceDaemonSet { + id: ID + queryWorkloadVersionAPI( + version: String + showLabels: Boolean + openapiFormatting: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryWorkloadVersionAPI") + serviceInstances(name: String): [ServiceInstance!] @relation(name: "HAS", softlink: "true") + name: String + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + spec: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"DaemonSetSpec") + status: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"DaemonSetStatus") +} + +type ServiceDeploymentContainer { + id: ID + name: String + image: String + imagePullPolicy: String + terminationMessagePath: String + terminationMessagePolicy: String + args: String @jsonencoded + env: String @jsonencoded + livenessProbe: String @jsonencoded + readinessProbe: String @jsonencoded + ports: String @jsonencoded + resources: String @jsonencoded + volumeMounts: String @jsonencoded +} + +type ServiceDeployment { + id: ID + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTS") + queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceInstanceTable") + queryWorkloadVersionAPI( + version: String + showLabels: Boolean + openapiFormatting: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryWorkloadVersionAPI") + containers(name: String): [ServiceDeploymentContainer] + serviceInstances(name: String): [ServiceInstance!] @relation(name: "HAS", softlink: "true") + serviceReplicaSet(name: String): [ServiceReplicaSet!] @relation(name: "HAS", softlink: "true") + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + spec: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"DeploymentSpec") + status: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"DeploymentStatus") + namespace: String + annotations: String @jsonencoded + creationTimestamp: String + labels: String @jsonencoded + name: String + apiLink: String + uid: String + generation: Int + selector: String @jsonencoded + replicas: Int + dnsPolicy: String + restartPolicy: String + schedulerName: String + securityContext: String @jsonencoded + serviceAccount: String + serviceAccountName: String + terminationGracePeriodSeconds: Int + volumes: String @jsonencoded + templateLabels: String @jsonencoded + statusReplicas: Int + availableReplicas: Int + updatedReplicas: Int + readyReplicas: Int + observedGeneration: Int + conditions: String @jsonencoded +} + +type ServiceDirectoryEntryConfig { + id: ID + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/serviceDirectory", gofile:"service_directory_entry.go", name:"ServiceDirectoryEntry") +} + +type ServiceDirectoryRTFolderEntry { + id: ID + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/serviceDirectory", gofile:"service_directory_entry.go", name:"ServiceDirectoryEntry") + spec_type: ServiceDirectoryRTFolderEntryType +} + +type ServiceDirectoryRTFolder { + id: ID + serviceDirectoryRTFolderEntry(id: ID): [ServiceDirectoryRTFolderEntry!] + name: String +} + +type ServiceDirectoryRT { + id: ID + serviceDirectoryRTFolder(id: ID): [ServiceDirectoryRTFolder!] +} + +type ServiceDirectoryN { + id: ID + entries(id: ID): [ServiceDirectoryEntryConfig!] + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/serviceDirectory", gofile:"service_directory.go", name:"ServiceDirectorySpec") +} + +type ServiceEntryConfig { + id: ID + name: String + ownedBy: String + service: String + serviceFQDN: String + description: String + servicePortList: String @jsonencoded(file:"./root/runtime/runtime.ts", gofile:"runtime.go", name:"ServicePortList") + tags: [String] + labels: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"Labels") + endpoints: [String] + endpointList: String @jsonencoded(file:"./root/runtime/runtime.ts", gofile:"runtime.go", name:"ServiceEndpointList") +} + +type ServiceEntry { + id: ID + name: String + annotations: String @jsonencoded + labels: String @jsonencoded + creationTimestamp: String + apiLink: String + uid: String + hosts: String @jsonencoded + addresses: String @jsonencoded + ports: String @jsonencoded + location: String + resolution: String + endpoints: String @jsonencoded + exportTo: [String!] + workloadSelectorLabels: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"Labels") +} + +type SvcGroupRT { + id: ID + name: String + displayName: String + description: String + services: String @jsonencoded(file:"../common-apis/api/tenant/models/serviceGroup", gofile:"service_group.go", name:"ServiceGroupSvcList") +} + +type ServiceInstanceContainer { + id: ID + name: String + image: String + imagePullPolicy: String + terminationMessagePath: String + terminationMessagePolicy: String + resources: String @jsonencoded + volumeMounts: String @jsonencoded + command: String @jsonencoded + securityContext: String @jsonencoded +} + +type ServiceInstance { + id: ID + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTS") + queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceInstanceTable") + containers(name: String): [ServiceInstanceContainer] + node: Node! @relation(name: "isLocatedOn", softlink: "true") + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + spec: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"ServiceInstanceSpec") + status: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"ServiceInstanceStatus") + name: String + namespace: String + annotations: String @jsonencoded + labels: String @jsonencoded + apiLink: String + uid: String + restartPolicy: String + dnsPolicy: String + hostNetwork: Boolean + securityContext: String @jsonencoded + terminationGracePeriodSeconds: Int + tolerations: String @jsonencoded + statusConditions: String @jsonencoded + statusContainer: String @jsonencoded + podIP: String + qosClass: String + phase: String + startTime: String + nodeName: String +} + +type ServiceJob { + id: ID + serviceInstances(name: String): [ServiceInstance!] @relation(name: "HAS", softlink: "true") + name: String + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + spec: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"JobSpec") + status: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"JobStatus") +} + +type ServiceLevelObjectiveFolder { + id: ID + ServiceLevelObjectives(name: ID): [ServiceLevelObjective!] +} + +type ServiceLevelObjective { + name: ID! + projectId: String + disabled: Boolean + description: String + labels: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"Labels") + slis: String! @jsonencoded(file: "./root/config/service-level-objective/slo.ts" gofile: "slo.go" name: "ServiceLevelIndicationGroup") + sloServices: String! @jsonencoded(file: "./root/config/service-level-objective/slo.ts" gofile: "slo.go" name: "SloServices") + sloTargetValue: String! @jsonencoded(file: "./root/config/service-level-objective/slo.ts" gofile: "slo.go" name: "SloTargetValue") + sloPeriod: SloPeriodFrequency + sloCreationTime: String! +} + +type ServiceReplicaSet { + id: ID + serviceInstances(name: String): [ServiceInstance!] @relation(name: "HAS", softlink: "true") + name: String + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + spec: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"ReplicaSetSpec") + status: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"ReplicaSetStatus") +} + +type ServiceStatefulSet { + id: ID + queryWorkloadVersionAPI( + version: String + showLabels: Boolean + openapiFormatting: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryWorkloadVersionAPI") + serviceInstances(name: String): [ServiceInstance!] @relation(name: "HAS", softlink: "true") + name: String + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + spec: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"StatefulSetSpec") + status: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"StatefulSetStatus") +} + +type ServiceTemplateServiceDefinition { + name: ID! + type: String! + version: String! + template: String! + templateArgs: [String!] +} + +type ServiceTemplate { + name: ID! + serviceDefinitions(name: ID): [ServiceTemplateServiceDefinition!] + version: String +} + +type ServiceVersionConfig { + id: ID + metricMonitors(name: ID): [MetricMonitor] + name: String + version: String +} + +type MetricMonitor { + name: ID + ownedBy: String + svcMetric: ServiceMetricTypeEnum + functionType: MetricMonitorFunction + functionArgs: String @jsonencoded(file:"./root/runtime/cluster-folder/cluster-config/domain-config/service-config/service-version-config/metric-monitor.ts", gofile:"metric-monitor.go", name:"FnArgs") +} + +type ServiceVersion { + id: ID + queryStats( + metricStringArray: String + api: String + method: HTTPMethodEnum + sourceWorkloadDN: String + severity: EventSeverityEnum + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryStats") + queryLogs( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + from: Int + size: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryLogs") + queryList( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryList") + queryLinechart( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryLinechart") + queryTopN( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryTopN") + queryDetail( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryDetail") + queryIncomingAPIs( + startTime: String + endTime: String + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryIncomingAPIs") + queryOutgoingAPIs( + startTime: String + endTime: String + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryOutgoingAPIs") + queryIncomingTCP( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryIncomingTCP") + queryOutgoingTCP( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryOutgoingTCP") + serviceDeployments(name: String): [ServiceDeployment!] @relation(name: "HAS", softlink: "true") + serviceDaemonSets(name: String): [ServiceDaemonSet!] @relation(name: "HAS", softlink: "true") + serviceStatefulSets(name: String): [ServiceStatefulSet!] @relation(name: "HAS", softlink: "true") + name: String! +} + +type Service { + id: ID + queryServiceAPIs( + startTime: String + endTime: String + version: String + showLabels: Boolean + openapiFormatting: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceAPIs") + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTS") + querySloDetails( + svcMetric: SloDetailsEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "querySloDetails") + querySloCounts( + svcMetric: SloDetailsEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "querySloCounts") + querySloTable( + svcMetric: SloDetailsEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "querySloTable") + queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceInstanceTable") + queryServiceTopology( + metricStringArray: String + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTopology") + queryServiceNodeMapGroupedByService( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceNodeMapGroupedByService") + queryServiceTable( + startTime: String + endTime: String + SystemServices: Boolean + ShowGateways: Boolean + Groupby: ServiceGroupByEnum + noMetrics: Boolean + limit: Int + last: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTable") + queryServiceVersionTable( + startTime: String + endTime: String + ShowGateways: Boolean + noMetrics: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceVersionTable") + queryStats( + metricStringArray: String + api: String + method: HTTPMethodEnum + sourceWorkloadDN: String + severity: EventSeverityEnum + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryStats") + queryLogs( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + from: Int + size: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryLogs") + queryList( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryList") + queryLinechart( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + sourceWorkloadDN: String + severity: EventSeverityEnum + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryLinechart") + queryTopN( + metric: AnalyticsMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + limit: Int + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryTopN") + queryDetail( + metric: AnalyticsMetricEnum + subMetric: AnalyticsSubMetricEnum + startTime: String + endTime: String + api: String + method: HTTPMethodEnum + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryDetail") + queryIncomingAPIs( + startTime: String + endTime: String + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryIncomingAPIs") + queryOutgoingAPIs( + startTime: String + endTime: String + timeInterval: String + timeZone: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryOutgoingAPIs") + queryIncomingTCP( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryIncomingTCP") + queryOutgoingTCP( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryOutgoingTCP") + additionalAttributes(name: String): [AdditionalAttributes!] + serviceDeployments(name: String): [ServiceDeployment!] @relation(name: "HAS", softlink: "true") + serviceStatefulSets(name: String): [ServiceStatefulSet!] @relation(name: "HAS", softlink: "true") + serviceDaemonSets(name: String): [ServiceDaemonSet!] @relation(name: "HAS", softlink: "true") + endpoints(name: String): [Endpoints!] @relation(name: "HAS", softlink: "true") + serviceVersions(name: String): [ServiceVersion!] + serviceReplicaSets(name: String): [ServiceReplicaSet!] @relation(name: "HAS", softlink: "true") @deprecated(reason: "link not maintained") + serviceJobs(name: String): [ServiceJob!] @relation(name: "HAS", softlink: "true") @deprecated(reason: "link not maintained") + metadata: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"Metadata") + spec: String @jsonencoded(file:"./common/ts/kubernetes.d.ts", gofile:"kubernetes.go", name:"ServiceSpec") + name: String + namespace: String + apiLink: String + ipAddress: String + annotations: String @jsonencoded + creationTimestamp: String + labels: String @jsonencoded + uid: String + ports: String @jsonencoded + selector: String @jsonencoded + type: String + status: String @jsonencoded +} + +type SloConfig { + id: ID + sloServices(name: String): [SloServiceConfig!] + name: String +} + +type SloServiceConfig { + id: ID + name: String + remainingBudget: Int + lastUpdateTime: String +} + +type SLOFolder { + name: ID + slos(name: String): [FederatedSloConfig!] +} + +type FederatedSloConfig { + id: ID + sloServices(name: String): [FederatedSloServiceConfig!] + name: String +} + +type FederatedSloServiceConfig { + id: ID + name: String + remainingBudget: Int + lastUpdateTime: String +} + +type SLOPolicy { + id: ID + name: String! + disabled: Boolean + description: String + labels: String @jsonencoded(file:"./common/ts/common.d.ts", gofile:"common.go", name:"Labels") + slis: String! @jsonencoded(file:"./root/config/service-level-objective/slo.ts", gofile:"slo.go", name:"ServiceLevelIndicationGroup") + serviceNames: [String!] + sloTargetValue: String! @jsonencoded(file:"./root/config/service-level-objective/slo.ts", gofile:"slo.go", name:"SloTargetValue") + sloPeriod: SloPeriodFrequency! + sloKind: SLOKind! + actions: [String] + sloCreationTime: String! +} + +type SvcGroup { + name: ID + queryServiceTS( + svcMetric: ServiceMetricTypeEnum + startTime: String + endTime: String + timeInterval: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTS") + queryServiceInstanceTable( + startTime: String + endTime: String + limit: Int + last: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceInstanceTable") + queryServiceTable( + startTime: String + endTime: String + SystemServices: Boolean + ExternalServices: Boolean + ShowGateways: Boolean + Groupby: ServiceGroupByEnum + noMetrics: Boolean + limit: Int + last: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceTable") + queryServiceVersionTable( + startTime: String + endTime: String + SystemServices: Boolean + ExternalServices: Boolean + ShowGateways: Boolean + noMetrics: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceVersionTable") + queryServiceNodeMapGroupedByNode( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceNodeMapGroupedByNode") + queryServiceNodeMapGroupedByService( + startTime: String + endTime: String + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryServiceNodeMapGroupedByService") + queryClusterTable( + startTime: String + endTime: String + timeInterval: String + noMetrics: Boolean + ): TimeSeriesData @timeseriesAPI(file: "../../tsquery/timeSeriesQuery", handler: "queryClusterTable") + services(name: String): [Service!] @relation(softlink: "true", parameters: SvcGroupLinkInfo, uuidkey: "true") + deployments(name: String): [ServiceDeployment!] @relation(softlink: "true", parameters: SvcGroupLinkInfo, uuidkey: "true") + daemonsets(name: String): [ServiceDaemonSet!] @relation(softlink: "true", parameters: SvcGroupLinkInfo, uuidkey: "true") + statefulsets(name: String): [ServiceStatefulSet!] @relation(softlink: "true", parameters: SvcGroupLinkInfo, uuidkey: "true") + jobs(name: String): [ServiceJob!] @relation(softlink: "true", parameters: SvcGroupLinkInfo, uuidkey: "true") + displayName: String + internalPredefinedGroup: Boolean + description: String + color: String + projectId: String + rules: String @jsonencoded(file:"../common-apis/api/tenant/models/resourceGroup", gofile:"resource_group.go", name:"Rules") +} + +type Table { + name: ID! + template: Template @relation(softlink: "true") + inventory: Inventory @relation(softlink: "true") +} + +type TemplateGroup { + name: ID! + dataTemplates(name: ID): [DataTemplate!] + nodeTemplates(name: ID): [NodeTemplate!] + appTemplates(name: ID): [AppTemplate!] + serviceTemplates(name: ID): [ServiceTemplate!] + policyTemplates(name: ID): [PolicyTemplate!] + projectId: String +} + +type Template { + id: ID + templateGroups(name: ID): [TemplateGroup!] + healthChecks(id: ID): [HealthCheckConfigN!] +} + +type TenantResource { + name: ID! + type: String + location: String +} + +type TenantToken { + id: ID! + ttl: Int + created: String + tenantId: String +} + +type Tenant { + tenantID: ID! + resources(name: ID): [TenantResource!] + template: ServiceTemplate! @relation(softlink: "true", name: "uses") + annotations(name: String): [Annotation] + name: String! + tenantName: String! + contactEmail: String! + yaml: String + lb: String + companySize: String + address: String +} + +type UserDiscoveryRT { + id: ID + gnsid: String + selectors: String @jsonencoded(file:"../common-apis/api/tenant/models/common", gofile:"gns_user_discovery.go", name:"UserDiscoveryClusterResourceSelectorRT") + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsUserDiscovery", gofile:"gns_user_discovery.go", name:"UserDiscoveryApplicationConfigList") +} + +type UserDiscovery { + id: ID + description: String + labels: String @jsonencoded(file:"../common-apis/api/tenant/models/common", gofile:"common.go", name:"LabelsList") + spec: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsUserDiscovery", gofile:"gns_user_discovery.go", name:"UserDiscoveryConfig") +} + +type UserFolder { + id: ID + users(name: ID): [User!] + appUsers(name: ID): [AppUser!] + AccessToken(id: String): [AccessToken!] +} + +type UserGroup { + name: ID + displayName: String + description: String + scope: String + color: String + rules: String @jsonencoded(file:"../common-apis/api/tenant/models/resourceGroup", gofile:"resource_group.go", name:"Rules") +} + +type UserPreference { + id: ID + name: String + data: String + userId: ID +} + +type User { + id: ID + preferences(id: ID): [UserPreference] + username: String + password: String + email: String + accessTokens: [String] + lastActionDate: String +} + +type VirtualService { + id: ID + destinationRules(name: String): [DestinationRule!] @relation(name: "pointsTo", softlink: "true") + services(name: String): [Service!] @relation(name: "pointsTo", softlink: "true") + gateways(name: String): [Gateway!] @relation(name: "pointsTo", softlink: "true") + name: String + creationTimestamp: String + apiLink: String + uid: String + annotations: String @jsonencoded + labels: String @jsonencoded + hosts: String @jsonencoded + http: String @jsonencoded + tls: String @jsonencoded + tcp: String @jsonencoded + gatewayNames: String @jsonencoded + exportTo: [String!] +} + +type WorkloadEntry { + id: ID + name: String + annotations: String @jsonencoded + labels: String @jsonencoded + creationTimestamp: String + apiLink: String + uid: String + address: String + workloadLabels: String @jsonencoded + ports: String @jsonencoded + locality: String +} + enum ExternalDNSRecordType { + A + AAAA + AFSDB + APL + CAA + CDNSKEY + CDS + CERT + CNAME + CSYNC + DHCID + DLV + DNAME + DNSKEY + DS + EUI48 + EUI64 + HINFO + HIP + IPSECKEY + KEY + KX + LOC + MX + NAPTR + NS + NSEC + NSEC3 + NSEC3PARAM + OPENPGPKEY + PTR + RRSIG + RP + SIG + SMIMEA + SOA + SRV + SSHFP + TA + TKEY + TLSA + TSIG + TXT + URI + ZONEMD +} + +enum ServiceMetricTypeEnum { + RequestPS + Requests + Latency + p50Latency + p90Latency + p99Latency + ErrorRate + ErrorPS + ClusterCount + NodeCount + ServiceCount + ServiceInstanceCount + Response2xx + Response3xx + Response4xx + Response5xx + SuccessRate + CPUUsageMillicores + MemoryUsageBytes + RequestResponse + DesiredInstanceCount + TotalErrorBudget + RemainingErrorBudget + RemainingErrorBudgetPercentage + IsViolated + ViolatedSlis +} + +enum SloDetailsEnum { + TotalErrorBudget + RemainingErrorBudget + RemainingErrorBudgetPercentage + IsViolated + ViolatedSlis + SloSummary + SloStatus + GnsSloStatus + BurnRate + SloPerformanceTable +} + +enum NodeMetricTypeEnum { + CPUCapacity + CPUUsage + DiskCapacity + DiskUsages + DiskIO + DiskWait + MemoryCapacity + MemoryUsages + MemoryUsagesBytes + IOWait + NetworkIO + ServiceCount + ServiceInstanceCount +} + +enum ServiceGroupByEnum { + serviceversions +} + +enum AnalyticsMetricEnum { + Endpoint + PII + Compliance + Error + Attack + Event + Geo + User + EgressDomain + GlobalNamespace + ResponseCode + Workload + Service + RequestRate + RequestSize + ResponseSize + Latency + ConnectionDuration + ConnectionRate + BytesSent + BytesReceived + GeoWithPII + GeoUnderAttack + AuthError +} + +enum AnalyticsSubMetricEnum { + RequestRate + RequestSize + ResponseSize + Latency + ConnectionDuration + ConnectionRate + BytesSent + BytesReceived +} + +enum HTTPMethodEnum { + GET + POST + PUT + DELETE + HEAD + PATCH +} + +enum EventSeverityEnum { + Info + Warning + Critical +} + +enum TrafficDirectionEnum { + Ingress + Internal + Egress +} + +enum GNSPluginState { + IDLE, + PROCESSING, + SYNCING, + SYNCED, + ERROR +} + +enum SLOKind { + Monitored + Actionable +} + +enum OperationType { + SERVICE + NODE + USER + API + DATA +} + +enum Action { + FEDERATE +} + +enum SloPeriodFrequency { + Unknown + Monthly +} + +enum ConfigChangeState { + APPLIED, + INSYNC, + INERROR +} + +enum ExternalServicesRTProtocols { + HTTP, + HTTPS, + TCP, + TLS +} + +enum MetricMonitorFunction { + Aggregate # Exampe arg to this fn: {windowSeconds: 600} + CheckThreshold # Example arg to this fn: {windowSeconds: 600, threshold: 300} +} + +enum HaType { + BASIC +} + +enum LogState { + NOT_FETCHED, + FETCHING, + COMPLETED, + FAILED +} + +enum ServiceDirectoryRTFolderEntryType { + FromGNS, + DirectAdd +} + + type ExternalAccountConfigStatus { + status: String @jsonencoded(file:"../common-apis/api/tenant/models/externalAccount", gofile:"external_account.go", name: "ExternalAccountStatus") +} + +type PublicServiceConfigStatus { + status: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsPublicService.ts", gofile:"gns_public_service.go", name: "GnsPublicServiceStatus") +} + +type GNSToDomainLinkInfo { + clusterName: String + domainName: String +} + +type GNSConfigStatus { + state: GNSPluginState + configsSynced: Int + timestamp: Int + warnings: String @jsonencoded(file:"./root/config/global-namespace/gns/gns-config-status.ts", gofile:"gns_config_status.go", name:"GNSConfigStatusWarnings") + errors: String @jsonencoded(file:"./root/config/global-namespace/gns/gns-config-status.ts", gofile:"gns_config_status.go", name:"GNSConfigStatusErrors") + history: String @jsonencoded(file:"./root/config/global-namespace/gns/gns-config-status.ts", gofile:"gns_config_status.go", name:"GNSConfigStatusHistory") +} + +type PublicServiceRouteConfigStatus { + status: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsPublicService.ts", gofile:"gns_public_service.go", name: "GnsPublicServiceRouteStatus") +} + +type ACPSvcGroupLinkInfo { + serviceName: String + serviceType: String +} + +type SvcGroupLinkInfo { + clusterName: String + domainName: String + serviceName: String + serviceType: String +} + +type SVToControllerLinkParam { + subsetName: String + trafficWeight: Int +} + +type ServiceVersionLinkConfig { + weight: Int + currentChangeId: String + currentState: ConfigChangeState + errorStatus: String +} + +type LogStatus { + state: LogState + path: String + message: String +} + +type ExternalDNSEndpointRuntimeStatus { + currentChangeId: String + currentState: ConfigChangeState + lastUpdateTime: Int + retryCnt: Int + errors: String @jsonencoded(file:"./root/runtime/config-change-status.ts", gofile:"config_change_status.go", name:"ConfigChangeStatusErrors") + warnings: String @jsonencoded(file:"./root/runtime/config-change-status.ts", gofile:"config_change_status.go", name:"ConfigChangeStatusWarnings") + history: String @jsonencoded(file:"./root/runtime/config-change-status.ts", gofile:"config_change_status.go", name:"ConfigChangeStatusHistory") + healthStatus: String @jsonencoded(file:"../common-apis/api/tenant/models/gnsPublicService", gofile:"health_check_status.go", name:"HealthCheckStatus") +} + +# This link property type is used by many types across the runtime tree. +type ConfigChangeStatus { + currentChangeId: String + currentState: ConfigChangeState + lastUpdateTime: Int + retryCnt: Int + errors: String @jsonencoded(file:"./root/runtime/config-change-status.ts", gofile:"config_change_status.go", name:"ConfigChangeStatusErrors") + warnings: String @jsonencoded(file:"./root/runtime/config-change-status.ts", gofile:"config_change_status.go", name:"ConfigChangeStatusWarnings") + history: String @jsonencoded(file:"./root/runtime/config-change-status.ts", gofile:"config_change_status.go", name:"ConfigChangeStatusHistory") +} + +type ClusterSettingsStatus { + syncStatus: String @jsonencoded(file:"../common-apis/api/tenant/models/clusterLifecycle.ts", gofile:"cluster_lifecycle.go", name:"ClusterSyncStatus") + caSyncStatus: String @jsonencoded(file:"../common-apis/api/tenant/models/clusterLifecycle.ts", gofile:"cluster_lifecycle.go", name:"CaSyncStatus") + processedNamespaces: [String] + onboardURL: String + token: String + tokenId: String + tokenCreationTs: String +} + +type ResourceGroupRef { + name: String + type: String +} + type TimeSeriesData { + code: Int + data: String @jsonencoded + last: String + message: String + totalRecords: Int +} + diff --git a/compiler/example/test-utils/output-group-name-with-hyphen-datamodel/crd_generated/tsm-nexus-gql/graph/schema.graphqls b/compiler/example/test-utils/output-group-name-with-hyphen-datamodel/crd_generated/tsm-nexus-gql/graph/schema.graphqls new file mode 100644 index 000000000..f4a368413 --- /dev/null +++ b/compiler/example/test-utils/output-group-name-with-hyphen-datamodel/crd_generated/tsm-nexus-gql/graph/schema.graphqls @@ -0,0 +1,37 @@ +schema { + query: Root +} + +type config_Config { + id: ID + fieldX: String + fieldY: Int + myStructField: String +} + +type project_Project { + id: ID + config: _Config + key: String + field1: String + field2: Int +} + +type root_Root { + id: ID + project: _Project + someRootData: String +} + +directive @jsonencoded(file: String, gofile: String, name: String) on FIELD_DEFINITION +directive @relation(name: String, parameters: String, softlink: String, uuidkey: String) on FIELD_DEFINITION +directive @timeseriesAPI(file: String!, handler: String!) on FIELD_DEFINITION +directive @protobuf(file: String!, name: String!) on FIELD_DEFINITION + +type TimeSeriesData { + Code: Int + Message: String + Data: String + Last: String + TotalRecords: Int +} diff --git a/compiler/go.mod b/compiler/go.mod index e4dc70936..d79585016 100644 --- a/compiler/go.mod +++ b/compiler/go.mod @@ -3,34 +3,46 @@ module github.com/vmware-tanzu/graph-framework-for-microservices/compiler go 1.17 require ( + github.com/elliotchance/orderedmap v1.5.0 github.com/fatih/structtag v1.2.0 github.com/ghodss/yaml v1.0.0 github.com/gogo/protobuf v1.3.2 + github.com/golang/protobuf v1.5.2 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.20.2 + github.com/onsi/gomega v1.23.0 + github.com/otiai10/copy v1.9.0 + github.com/rs/cors v1.8.3 github.com/sirupsen/logrus v1.8.1 github.com/vmware-tanzu/graph-framework-for-microservices/common-library v0.0.0-20221129104902-06818e531062 github.com/vmware-tanzu/graph-framework-for-microservices/gqlgen v0.0.0-00010101000000-000000000000 github.com/vmware-tanzu/graph-framework-for-microservices/kube-openapi v0.0.0-20220603123335-7416bd4754d3 - github.com/vmware-tanzu/graph-framework-for-microservices/nexus v0.0.0-00010101000000-000000000000 - golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 - golang.org/x/text v0.3.8 - golang.org/x/tools v0.1.12 + github.com/vmware-tanzu/graph-framework-for-microservices/nexus v0.0.0-20221114103953-d31f6492d7fc + golang.org/x/mod v0.6.0 + golang.org/x/text v0.5.0 + golang.org/x/tools v0.2.0 + google.golang.org/grpc v1.50.1 + istio.io/api v0.0.0-20221222163824-3417dfab291b + k8s.io/api v0.26.0 k8s.io/apiextensions-apiserver v0.24.0 + k8s.io/apimachinery v0.26.0 + k8s.io/client-go v0.24.0 k8s.io/gengo v0.0.0-20220307231824-4627b89bbf1b + k8s.io/utils v0.0.0-20221107191617-1a15be271d1d ) require ( github.com/BurntSushi/toml v1.2.1 // indirect github.com/agnivade/levenshtein v1.1.1 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful v2.15.0+incompatible // indirect + github.com/emicklei/go-restful/v3 v3.8.0 // indirect + github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.20.0 // indirect github.com/go-openapi/swag v0.21.1 // indirect - github.com/golang/protobuf v1.5.2 // indirect github.com/gonvenience/bunt v1.3.4 // indirect github.com/gonvenience/neat v1.3.11 // indirect github.com/gonvenience/term v1.0.2 // indirect @@ -40,6 +52,8 @@ require ( github.com/google/gnostic v0.6.9 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.2.0 // indirect + github.com/gorilla/websocket v1.5.0 // indirect + github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/homeport/dyff v1.5.6 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -49,9 +63,12 @@ require ( github.com/mattn/go-isatty v0.0.16 // indirect github.com/mitchellh/go-ps v1.0.0 // indirect github.com/mitchellh/hashstructure v1.1.0 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nxadm/tail v1.4.8 // indirect + github.com/pkg/errors v0.9.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sergi/go-diff v1.2.0 // indirect github.com/texttheater/golang-levenshtein v1.0.1 // indirect @@ -59,21 +76,25 @@ require ( github.com/vektah/gqlparser/v2 v2.5.0 // indirect github.com/virtuald/go-ordered-json v0.0.0-20170621173500-b18e6e673d74 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect - golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect + golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect + golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde // indirect - golang.org/x/sys v0.1.0 // indirect - golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect - google.golang.org/protobuf v1.28.0 // indirect + golang.org/x/sys v0.3.0 // indirect + golang.org/x/term v0.3.0 // indirect + golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto v0.0.0-20221018160656-63c7b68cfc55 // indirect + google.golang.org/protobuf v1.28.1 // indirect gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apimachinery v0.24.0 // indirect - k8s.io/klog/v2 v2.60.1 // indirect - k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect - sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect + k8s.io/klog/v2 v2.80.1 // indirect + k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect + sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect ) replace github.com/vmware-tanzu/graph-framework-for-microservices/kube-openapi => ../kube-openapi diff --git a/compiler/go.sum b/compiler/go.sum index 73f81d0b0..5e8e295ed 100644 --- a/compiler/go.sum +++ b/compiler/go.sum @@ -18,24 +18,160 @@ cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmW cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= +cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= +cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= +cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= +cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= +cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= +cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= +cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= +cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= +cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= +cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= +cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= +cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= +cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= +cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= +cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= +cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= +cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= +cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= +cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= +cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= +cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= +cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= +cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= +cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= +cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= +cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= +cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= +cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= +cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= +cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= +cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= +cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= +cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= +cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= +cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= +cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= +cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= +cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= +cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= +cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= +cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= +cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= +cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= +cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= +cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= +cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= +cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= +cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= +cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= +cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= +cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= +cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= +cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= +cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= +cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= +cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= +cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= +cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= +cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= +cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= +cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= +cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= +cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= +cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= +cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= +cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= +cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= +cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= +cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= +cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= +cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= +cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= +cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= +cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= +cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= +cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= +cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= +cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= +cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= +cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= +cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= +cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= +cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= +cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= +cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= +cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= +cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= +cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= +cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= +cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= +cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= +cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= +cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= +cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= +cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= +cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= +cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= +cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= +cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= +cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= +cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= +cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= +cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= +cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= +cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= +cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= +cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= +cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= +cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= +cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= +cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= +cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= +cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= +cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= +cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= +cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= +cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= +cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= +cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= @@ -64,9 +200,11 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210826220005-b48c857c3a0e/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -100,6 +238,7 @@ github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XP github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= @@ -112,8 +251,8 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7 github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -122,15 +261,19 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elliotchance/orderedmap v1.5.0 h1:1IsExUsjv5XNBD3ZdC7jkAAqLWOOKdbPTmkHx63OsBg= github.com/elliotchance/orderedmap v1.5.0/go.mod h1:wsDwEaX5jEoyhbs7x93zk2H/qv0zwuhg4inXhDkYqys= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.15.0+incompatible h1:8KpYO/Xl/ZudZs5RNOEhWMBY4hmzlZhhRd9cu+jrZP4= github.com/emicklei/go-restful v2.15.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw= +github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -139,7 +282,9 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= @@ -226,6 +371,7 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gonvenience/bunt v1.3.2/go.mod h1:oTOZqb1TVL1KqZm57zUCJCiwUliNfY8+d3QndOVqxpg= github.com/gonvenience/bunt v1.3.3/go.mod h1:XjlODZ8sTL9jQs9c4Kj1ZBTrHSsbUGdoRy7ROCtw8nU= github.com/gonvenience/bunt v1.3.4 h1:Row599Ohja2BPooaqd1tHYdTAKu6SWq7W/UeakTXddM= @@ -263,6 +409,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -273,6 +421,7 @@ github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -285,15 +434,29 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= +github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= +github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -316,6 +479,7 @@ github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -394,6 +558,7 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= @@ -405,6 +570,7 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -428,8 +594,10 @@ github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042 github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= -github.com/onsi/ginkgo/v2 v2.1.6 h1:Fx2POJZfKRQcM1pH49qSZiYeu319wji004qX+GDovrU= github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk= +github.com/onsi/ginkgo/v2 v2.3.0/go.mod h1:Eew0uilEqZmIEZr8JrvYlvOM7Rr6xzTmMV8AyFNU9d0= +github.com/onsi/ginkgo/v2 v2.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs= +github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= @@ -441,9 +609,19 @@ github.com/onsi/gomega v1.18.0/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5h github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= -github.com/onsi/gomega v1.20.2 h1:8uQq0zMgLEfa0vRrrBgaJF2gyW9Da9BmfGV+OyUzfkY= github.com/onsi/gomega v1.20.2/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= +github.com/onsi/gomega v1.21.1/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= +github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ1tuM= +github.com/onsi/gomega v1.23.0 h1:/oxKu9c2HVap+F3PfKort2Hw5DEU+HGlW8n+tguWsys= +github.com/onsi/gomega v1.23.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/otiai10/copy v1.9.0 h1:7KFNiCgZ91Ru4qW4CWPf/7jqtxLagGRmIxWldPP9VY4= +github.com/otiai10/copy v1.9.0/go.mod h1:hsfX19wcn0UWIHUQ3/4fHuehhk2UyArQ9dVFAn3FczI= +github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.4.0 h1:umwcf7gbpEwf7WFzqmWwSv0CzbeMsae2u9ZvpP8j2q4= +github.com/otiai10/mint v1.4.0/go.mod h1:gifjb2MYOoULtKLqUAEILUG/9KONW6f7YsJ6vQLTlFI= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= @@ -482,6 +660,8 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= +github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -540,8 +720,6 @@ github.com/vektah/gqlparser/v2 v2.5.0 h1:GwEwy7AJsqPWrey0bHnn+3JLaHLZVT66wY/+O+T github.com/vektah/gqlparser/v2 v2.5.0/go.mod h1:mPgqFBu/woKTVYWyNk8cO3kh4S/f4aRFZrvOnp3hmCs= github.com/virtuald/go-ordered-json v0.0.0-20170621173500-b18e6e673d74 h1:JwtAtbp7r/7QSyGz8mKUbYJBg2+6Cd7OjM8o/GNOcVo= github.com/virtuald/go-ordered-json v0.0.0-20170621173500-b18e6e673d74/go.mod h1:RmMWU37GKR2s6pgrIEB4ixgpVCt/cf7dnJv3fuH1J1c= -github.com/vmware-tanzu/graph-framework-for-microservices/common-library v0.0.0-20221129104902-06818e531062 h1:afp7MoPbx2O0whu3TnMlwrDBbKSGVyci+/znk1EPDWU= -github.com/vmware-tanzu/graph-framework-for-microservices/common-library v0.0.0-20221129104902-06818e531062/go.mod h1:HxDTcKIU+3yARjpmhAC4P1xNeAJ3XQsz9dBQh7uLjo8= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= @@ -605,6 +783,7 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -641,8 +820,9 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -687,6 +867,7 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -695,9 +876,17 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 h1:Frnccbp+ok2GkUS2tC84yAq/U9Vg+0sIO7aRL3T4Xnc= +golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -710,7 +899,18 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -722,6 +922,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde h1:ejfdSekXMDxDLbRrJMwUk6KnSLZ2McaUCVcIKM+N6jc= golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -783,28 +984,48 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -814,12 +1035,15 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -879,15 +1103,21 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -909,12 +1139,39 @@ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34q google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= +google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= +google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= +google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= +google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= +google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= +google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= +google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -958,10 +1215,68 @@ google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= +google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221018160656-63c7b68cfc55 h1:U1u4KB2kx6KR/aJDjQ97hZ15wQs8ZPvDcGcRynBhkvg= +google.golang.org/genproto v0.0.0-20221018160656-63c7b68cfc55/go.mod h1:45EK0dUbEZ2NHjCeAd2LXmyjAgGUGrpGROgjhC3ADck= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -982,9 +1297,24 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -998,8 +1328,9 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1041,12 +1372,18 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +istio.io/api v0.0.0-20221222163824-3417dfab291b h1:wzdw9dsRO+djEP7wAa75ktLDvgEG5jraECZB5n7zfwg= +istio.io/api v0.0.0-20221222163824-3417dfab291b/go.mod h1:+IPBhFYUZBqH7ATQoxMCu1MGEbtQ+C29exvSGYGOWpI= k8s.io/api v0.24.0/go.mod h1:5Jl90IUrJHUJYEMANRURMiVvJ0g7Ax7r3R1bqO8zx8I= +k8s.io/api v0.26.0 h1:IpPlZnxBpV1xl7TGk/X6lFtpgjgntCg8PJ+qrPHAC7I= +k8s.io/api v0.26.0/go.mod h1:k6HDTaIFC8yn1i6pSClSqIwLABIcLV9l5Q4EcngKnQg= k8s.io/apiextensions-apiserver v0.24.0 h1:JfgFqbA8gKJ/uDT++feAqk9jBIwNnL9YGdQvaI9DLtY= k8s.io/apiextensions-apiserver v0.24.0/go.mod h1:iuVe4aEpe6827lvO6yWQVxiPSpPoSKVjkq+MIdg84cM= -k8s.io/apimachinery v0.24.0 h1:ydFCyC/DjCvFCHK5OPMKBlxayQytB8pxy8YQInd5UyQ= k8s.io/apimachinery v0.24.0/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= +k8s.io/apimachinery v0.26.0 h1:1feANjElT7MvPqp0JT6F3Ss6TWDwmcjLypwoPpEf7zg= +k8s.io/apimachinery v0.26.0/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= k8s.io/apiserver v0.24.0/go.mod h1:WFx2yiOMawnogNToVvUYT9nn1jaIkMKj41ZYCVycsBA= +k8s.io/client-go v0.24.0 h1:lbE4aB1gTHvYFSwm6eD3OF14NhFDKCejlnsGYlSJe5U= k8s.io/client-go v0.24.0/go.mod h1:VFPQET+cAFpYxh6Bq6f4xyMY80G6jKKktU6G0m00VDw= k8s.io/code-generator v0.24.0/go.mod h1:dpVhs00hTuTdTY6jvVxvTFCk6gSMrtfRydbhZwHI15w= k8s.io/component-base v0.24.0/go.mod h1:Dgazgon0i7KYUsS8krG8muGiMVtUZxG037l1MKyXgrA= @@ -1056,21 +1393,27 @@ k8s.io/gengo v0.0.0-20220307231824-4627b89bbf1b h1:vEhKDJESYfeRiaBNmRvO+/12RAo1c k8s.io/gengo v0.0.0-20220307231824-4627b89bbf1b/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.60.1 h1:VW25q3bZx9uE3vvdL6M8ezOX79vA2Aq1nEWLqNQclHc= k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= +k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= +k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= +k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20221107191617-1a15be271d1d h1:0Smp/HP1OH4Rvhe+4B8nWGERtlqAGSftbSbbmm45oFs= +k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= -sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= +sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= +sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y= sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/compiler/pkg/generator/generator_test.go b/compiler/pkg/generator/generator_test.go index 28f11d324..a8b77c993 100644 --- a/compiler/pkg/generator/generator_test.go +++ b/compiler/pkg/generator/generator_test.go @@ -52,7 +52,7 @@ var _ = Describe("Template renderers tests", func() { pkg, ok = pkgs["github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/datamodel/config/gns"] Expect(ok).To(BeTrue()) graphqlQueries := parser.ParseGraphqlQuerySpecs(pkgs) - graph := parser.ParseDSLNodes(exampleDSLPath, baseGroupName, pkgs, graphqlQueries) + graph, _, _ := parser.ParseDSLNodes(exampleDSLPath, baseGroupName, pkgs, graphqlQueries) parentsMap = parser.CreateParentsMap(graph) Expect(parentsMap).To(HaveLen(14)) @@ -203,10 +203,9 @@ var _ = Describe("Template renderers tests", func() { pkgs := parser.ParseDSLPkg(datamodelPath) graphlqQueries := parser.ParseGraphqlQuerySpecs(pkgs) - graph := parser.ParseDSLNodes(datamodelPath, groupName, pkgs, graphlqQueries) + graph, nonNexusTypes, fileset := parser.ParseDSLNodes(datamodelPath, groupName, pkgs, graphlqQueries) methods, codes := rest.ParseResponses(pkgs) - err := generator.RenderCRDTemplate(groupName, crdModulePath, pkgs, graph, - outputDir, methods, codes) + err := generator.RenderCRDTemplate(groupName, crdModulePath, pkgs, graph, outputDir, methods, codes, nonNexusTypes, fileset, nil) Expect(err).NotTo(HaveOccurred()) }) diff --git a/compiler/pkg/generator/graphql_common.go b/compiler/pkg/generator/graphql_common.go index 707befa5c..9887d7dcd 100644 --- a/compiler/pkg/generator/graphql_common.go +++ b/compiler/pkg/generator/graphql_common.go @@ -2,14 +2,20 @@ package generator import ( "fmt" + "go/ast" + "go/types" "strconv" "strings" + "k8s.io/utils/strings/slices" + "golang.org/x/text/cases" "golang.org/x/text/language" log "github.com/sirupsen/logrus" "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/pkg/parser" + "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/pkg/util" + "github.com/vmware-tanzu/graph-framework-for-microservices/nexus/nexus" ) const ( @@ -25,6 +31,78 @@ const ( ` ) +type ReturnStatement struct { + Alias string + ReturnType string + FieldCount int + CRDName string + ChainAPI string + IsSingleton bool +} + +type FieldProperty struct { + IsResolver bool + IsNexusTypeField bool + IsNexusOrSingletonField bool + IsChildOrLink bool + IsChildrenOrLinks bool + IsMapTypeField bool + IsArrayTypeField bool + IsStdTypeField bool + IsCustomTypeField bool + IsPointerTypeField bool + IsStringType bool + IsArrayStdType bool + IsSingleton bool + PkgName string + NodeName string + FieldName string + FieldType string + FieldTypePkgPath string + ModelType string + SchemaFieldName string + SchemaTypeName string + BaseTypeName string + Alias string + ReturnType string + FieldCount int + CRDName string + ChainAPI string + LinkAPI string +} + +type NodeProperty struct { + IsParentNode bool + HasParent bool + IsSingletonNode bool + IsNexusNode bool + BaseImportPath string + CrdName string + ResolverCount int + PkgName string + NodeName string + SchemaName string + Alias string + ReturnType string + GroupResourceNameTitle string + GroupName string + Singular string + Kind string + ResourceName string + ResourceVersion string + ChildFields []FieldProperty + LinkFields []FieldProperty + ChildrenFields []FieldProperty + LinksFields []FieldProperty + ArrayFields []FieldProperty + CustomFields []FieldProperty + NonStructFields []FieldProperty + GraphqlSchemaFields []FieldProperty + ResolverFields map[string][]FieldProperty + CustomQueries []nexus.GraphQLQuery + GraphQlSpec nexus.GraphQLSpec +} + // Convert go standardType to GraphQL standardType func convertGraphqlStdType(t string) string { // remove pointers @@ -55,6 +133,14 @@ func getPkgName(pkgs parser.Packages, pkgPath string) string { return pkgs[importPath].Name } +func GetPkg(pkgs parser.Packages, pkgPath string) parser.Package { + importPath, err := strconv.Unquote(pkgPath) + if err != nil { + log.Errorf("Failed to parse the package path : %s: %v", pkgPath, err) + } + return pkgs[importPath] +} + func genSchemaResolverName(fn1, fn2 string) (string, string) { return fmt.Sprintf("%s_%s", strings.ToLower(fn1), fn2), cases.Title(language.Und, cases.NoLower).String(fn1) + cases.Title(language.Und, cases.NoLower).String(fn2) } @@ -80,6 +166,44 @@ func ValidateImportPkg(pkgName, typeString string, importMap map[string]string, return genSchemaResolverName(pkgName, typeWithoutPointers) } +func GetNexusSchemaFieldName(GraphQlSpec nexus.GraphQLSpec) string { + name := "id" + value := "ID" + if GraphQlSpec.IdName != "" { + name = GraphQlSpec.IdName + } + if !GraphQlSpec.IdNullable { + value = "ID!" + } + return fmt.Sprintf("%s: %s", name, value) +} + +func GetNodeDetails(pkgName, typeString string, importMap map[string]string, pkgs parser.Packages, gqlSpecMap map[string]nexus.GraphQLSpec) string { + typeWithoutPointers := strings.ReplaceAll(typeString, "*", "") + if strings.Contains(typeWithoutPointers, ".") { + part := strings.Split(typeWithoutPointers, ".") + if val, ok := importMap[part[0]]; ok { + p := GetPkg(pkgs, val) + if val, ok := parser.GetNexusGraphqlSpecAnnotation(p, part[1]); ok { + gqlspec := gqlSpecMap[fmt.Sprintf("%s.%s", p.Name, val)] + return GetNexusSchemaFieldName(gqlspec) + } + } + for _, v := range importMap { + pkgName := getPkgName(pkgs, v) + if pkgName == part[0] { + p := GetPkg(pkgs, v) + if val, ok := parser.GetNexusGraphqlSpecAnnotation(p, part[1]); ok { + gqlspec := gqlSpecMap[fmt.Sprintf("%s.%s", p.Name, val)] + return GetNexusSchemaFieldName(gqlspec) + } + } + } + return fmt.Sprintf("id: ID") + } + return fmt.Sprintf("id: ID") +} + func getBaseNodeType(typeString string) string { if strings.Contains(typeString, ".") { part := strings.Split(typeString, ".") @@ -87,3 +211,284 @@ func getBaseNodeType(typeString string) string { } return typeString } + +func constructNexusTypeMap(nodes []*NodeProperty) map[string]string { + crdNameMap := make(map[string]string) + for _, n := range nodes { + if n.IsNexusNode || n.IsSingletonNode { + crdNameMap[n.CrdName] = n.PkgName + n.NodeName + } + } + return crdNameMap +} + +func findTypeAndPkgForField(ptParts []string, importMap map[string]string, pkgs map[string]parser.Package) (string, *parser.Package) { + structPkg := ptParts[0] + structType := ptParts[1] + + pkgPath, ok := importMap[structPkg] + if !ok { + log.Errorf("Cannot find the package name %s for the type %s", structPkg, structType) + return "", nil + } + + importPath, err := strconv.Unquote(pkgPath) + if err != nil { + log.Errorf("Failed to parse package %s for the type %s with error %v", pkgPath, structType, err) + return "", nil + } + + p, ok := pkgs[importPath] + if !ok { + log.Errorf("Cannot find the package details from the path %s for the type %s", importPath, structType) + return "", nil + } + + return structType, &p +} + +/* +collect and construct type alias field into map recursively before +populating the nexus node and custom struct type +ex. nonStructMap[pkgName] = nodeType --> nonStructMap["root"] = "AliasTypeFoo" +*/ +func constructAliasType(sortedPackages []parser.Package) map[string]string { + nonStructMap := make(map[string]string) + for _, pkg := range sortedPackages { + for _, node := range pkg.GetNonStructTypes() { + pkgName := fmt.Sprintf("%s_%s", pkg.Name, parser.GetTypeName(node)) + // NonStruct Map + nonStructType := types.ExprString(node.Type) + nonStructMap[pkgName] = nonStructType + } + } + + return nonStructMap +} + +func setNexusProperties(nodeHelper parser.NodeHelper, node *ast.TypeSpec, nodeProp *NodeProperty) { + if len(nodeHelper.Parents) > 0 { + nodeProp.HasParent = true + } + + if parser.IsSingletonNode(node) { + nodeProp.IsSingletonNode = true + } + + if parser.IsNexusNode(node) { + nodeProp.IsNexusNode = true + } +} + +// isRootOfGraph intended to allow only one root of the graph, +// if we receive multiple node in such behaviour, then we allow the first node and the rest will be skipped with error +// arg: `parents` indicates the node's parents, `rootOfGraph` indicates if the received node is the root of the graph or not. +func isRootOfGraph(parents []string, rootOfGraph bool) bool { + if len(parents) == 0 && !rootOfGraph { + return true + } + + return rootOfGraph +} + +func getGraphqlSchemaName(pattern, fieldName, schemaType string, f *ast.Field) string { + schemaName := fmt.Sprintf(pattern, fieldName, schemaType) + schemaType = strings.TrimPrefix(schemaType, "global_") + if parser.IsFieldAnnotationPresent(f, parser.GRAPHQL_ALIAS_TYPE_ANNOTATION) { + schemaType = parser.GetFieldAnnotationVal(f, parser.GRAPHQL_ALIAS_TYPE_ANNOTATION) + } + if fieldName != "" { + // use camelCase for fieldName #e.g ServiceGroup --> serviceGroup + schemaName = fmt.Sprintf(pattern, getAliasFieldValue(fieldName, f), schemaType) + } + + schemaName = strings.TrimPrefix(schemaName, "global_") + + return schemaName +} + +// func getGraphQLArgs(f *ast.Field) string { +// argKey := "id" +// argVal := "ID" +// k := parser.GetGraphqlArgumentKey(f) +// if k != "" { +// argKey = k +// } +// v := parser.GetGraphqlArgumentValue(f) +// if v != "" { +// argVal = v +// } +// return fmt.Sprintf("%s: %s", argKey, argVal) +// } + +// getTsmGraphqlSchemaFieldName process nexus annotation `nexus-graphql-nullable` and `nexus-graphql-tsm-directive` +func getTsmGraphqlSchemaFieldName(sType GraphQLSchemaType, fieldName, schemaType, listArg string, f *ast.Field, pkg parser.Package, nonNexusTypes *parser.NonNexusTypes) string { + pattern := "" + nullable := parser.IsNexusGraphqlNullField(f) + jsonEncoded := parser.IsJsonStringField(f) + switch sType { + case Standard, JsonMarshal, Child, Link: + if nullable { + pattern = "%s: %s" + } else { + pattern = "%s: %s!" + } + if jsonEncoded { + pattern = "%s: %s" + schemaType = "String" + } + case Array: + if nullable { + pattern = "%s: [%s]" + } else { + pattern = "%s: [%s!]" + } + if jsonEncoded { + pattern = "%s: %s" + schemaType = "String" + } + case NamedChild, NamedLink: + if nullable { + pattern = "%s(" + listArg + "): [%s!]" + } else { + pattern = "%s(" + listArg + "): [%s]" + } + if jsonEncoded { + pattern = "%s(" + listArg + "): %s" + schemaType = "String" + } + } + schemaName := getGraphqlSchemaName(pattern, fieldName, schemaType, f) + + if sType == AliasType { + e := parser.GetFieldAnnotationVal(f, parser.GRAPHQL_ALIAS_TYPE_ANNOTATION) + if e != "" { + schemaName = fmt.Sprintf("%s: %s", getAliasFieldValue(fieldName, f), e) + } else { + schemaName = fmt.Sprintf("%s: %s", getAliasFieldValue(fieldName, f), "String") + } + } + + schemaName = addFieldAnnotations(pkg, f, schemaName, sType, nonNexusTypes) + + return schemaName +} + +func addFieldAnnotations(pkg parser.Package, f *ast.Field, schemaName string, sType GraphQLSchemaType, nonNexusTypes *parser.NonNexusTypes) string { + importMap := pkg.GetImportMap() + // add jsonencoded annotation + if parser.IsFieldAnnotationPresent(f, parser.GRAPHQL_TSM_DIRECTIVE_ANNOTATION) { + replacer := strings.NewReplacer("nexus-graphql-tsm-directive:", "", "\\", "") + out := replacer.Replace(parser.GetFieldAnnotationString(f, parser.GRAPHQL_TSM_DIRECTIVE_ANNOTATION)) + schemaName += " " + strings.Trim(out, "\"") + } else if parser.IsFieldAnnotationPresent(f, parser.GRAPHQL_PROTOBUF_NAME) || + parser.IsFieldAnnotationPresent(f, parser.GRAPHQL_PROTOBUF_FILE) { + schemaName = addProtobufAnnotation(f, schemaName) + } else { + if sType != Link && sType != Child && sType != NamedChild && sType != NamedLink { + if val, ok := f.Type.(*ast.SelectorExpr); ok { + x := types.ExprString(val.X) + if imp, ok := importMap[x]; ok { + if strings.HasPrefix(imp, fmt.Sprintf(`"%s`, pkg.ModPath)) { + schemaName = addJsonencodedAnnotation(f, parser.GRAPHQL_TS_TYPE_ANNOTATION, x, val.Sel.Name, schemaName, false, imp) + } else { + if parser.IsFieldAnnotationPresent(f, parser.GRAPHQL_TYPE_NAME) { + typeName := parser.GetFieldAnnotationVal(f, parser.GRAPHQL_TYPE_NAME) + externalType := fmt.Sprintf("%s.%s", x, val.Sel.Name) + aliasType := fmt.Sprintf("type %s %s", typeName, externalType) + if !slices.Contains(nonNexusTypes.ExternalTypes, aliasType) { + nonNexusTypes.ExternalTypes = append(nonNexusTypes.ExternalTypes, aliasType) + } + schemaName = addJsonencodedAnnotation(f, parser.GRAPHQL_TS_TYPE_ANNOTATION, x, typeName, schemaName, true, imp) + } else { + schemaName = addJsonencodedAnnotation(f, parser.GRAPHQL_TS_TYPE_ANNOTATION, x, val.Sel.Name, schemaName, true, imp) + } + } + } + } else if val, ok := f.Type.(*ast.Ident); ok && convertGraphqlStdType(val.Name) == "" { + x := "" + importExpr := "" + if pkg.Name != "global" { + x = pkg.Name + importExpr = fmt.Sprintf(`"%s"`, pkg.FullName) + } + schemaName = addJsonencodedAnnotation(f, parser.GRAPHQL_TS_TYPE_ANNOTATION, x, val.Name, schemaName, false, importExpr) + } else if parser.IsFieldAnnotationPresent(f, parser.GRAPHQL_JSONENCODED_ANNOTATION) { + schemaName += " @jsonencoded" + } + } + + schemaName = addRelationAnnotation(sType, f, schemaName) + } + + return schemaName +} + +func addJsonencodedAnnotation(f *ast.Field, annotation parser.FieldAnnotation, x string, name string, schemaName string, external bool, importExpr string) string { + args := []string{`gofile:"model.go"`, fmt.Sprintf(`name:"%s"`, name)} + + if parser.IsFieldAnnotationPresent(f, annotation) { + args = append(args, fmt.Sprintf(`file:"%s"`, parser.GetFieldAnnotationVal(f, annotation))) + } + + if !external && x != "" { + importStr := strings.Trim(importExpr, "\"") + namedImport := "nexus_" + importStr[strings.LastIndex(importStr, "/")+1:] + args = append(args, fmt.Sprintf(`goname:"%s.%s"`, namedImport, name)) + } + + schemaName += fmt.Sprintf(" @jsonencoded(%s)", strings.Join(args, ", ")) + + return schemaName +} + +func addRelationAnnotation(sType GraphQLSchemaType, f *ast.Field, schemaName string) string { + var args []string + if sType == Link || sType == NamedLink { + args = append(args, `softlink: "true"`) + } + if parser.IsFieldAnnotationPresent(f, parser.GRAPHQL_RELATION_NAME) { + args = append(args, fmt.Sprintf(`name:"%s"`, parser.GetFieldAnnotationVal(f, parser.GRAPHQL_RELATION_NAME))) + } + + if parser.IsFieldAnnotationPresent(f, parser.GRAPHQL_RELATION_PARAMETERS) { + args = append(args, fmt.Sprintf("parameters:%s", parser.GetFieldAnnotationVal(f, parser.GRAPHQL_RELATION_PARAMETERS))) + } + + if parser.IsFieldAnnotationPresent(f, parser.GRAPHQL_RELATION_UUIDKEY) { + args = append(args, fmt.Sprintf(`uuidkey:"%s"`, parser.GetFieldAnnotationVal(f, parser.GRAPHQL_RELATION_UUIDKEY))) + } + + if len(args) > 0 { + schemaName += fmt.Sprintf(" @relation(%s)", strings.Join(args, ", ")) + } + + return schemaName +} + +func addProtobufAnnotation(f *ast.Field, schemaName string) string { + var args []string + + if parser.IsFieldAnnotationPresent(f, parser.GRAPHQL_PROTOBUF_NAME) { + args = append(args, fmt.Sprintf(`name:"%s"`, parser.GetFieldAnnotationVal(f, parser.GRAPHQL_PROTOBUF_NAME))) + } + + if parser.IsFieldAnnotationPresent(f, parser.GRAPHQL_PROTOBUF_FILE) { + args = append(args, fmt.Sprintf(`file:"%s"`, parser.GetFieldAnnotationVal(f, parser.GRAPHQL_PROTOBUF_FILE))) + } + + if len(args) > 0 { + schemaName += fmt.Sprintf(" @protobuf(%s)", strings.Join(args, ", ")) + } + + return schemaName +} + +// getAliasFieldValue process nexus annotation `nexus-alias-value:` +func getAliasFieldValue(fieldName string, f *ast.Field) string { + e := parser.GetFieldAnnotationVal(f, parser.GRAPHQL_ALIAS_NAME_ANNOTATION) + if e != "" { + return e + } + return util.GetTag(fieldName) +} diff --git a/compiler/pkg/generator/graphql_custom_query_generator.go b/compiler/pkg/generator/graphql_custom_query_generator.go index cba5336af..f89dcd4d8 100644 --- a/compiler/pkg/generator/graphql_custom_query_generator.go +++ b/compiler/pkg/generator/graphql_custom_query_generator.go @@ -17,6 +17,10 @@ func CustomQueryToGraphqlSchema(query nexus.GraphQLQuery) string { args = "(\n" for _, arg := range argsList { graphqlType := convertGraphqlStdType(arg.Type) + // AliasType is to over write arg type with annotation `nexus-alias-type:""` + if arg.AliasType { + graphqlType = arg.Type + } if graphqlType == "" { log.Fatalf("Failed to convert type %s to graphql types, supported types are: "+ "string, bool, int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, "+ @@ -38,5 +42,5 @@ func CustomQueryToGraphqlSchema(query nexus.GraphQLQuery) string { log.Fatalf("Wrong Api Type of Graphql custom query") } - return fmt.Sprintf(" %s"+args+": "+returnType+"\n", query.Name) + return fmt.Sprintf(" %s"+args+": "+returnType, query.Name) } diff --git a/compiler/pkg/generator/graphql_custom_query_generator_test.go b/compiler/pkg/generator/graphql_custom_query_generator_test.go index 2d17a27fc..dde507587 100644 --- a/compiler/pkg/generator/graphql_custom_query_generator_test.go +++ b/compiler/pkg/generator/graphql_custom_query_generator_test.go @@ -17,7 +17,7 @@ var _ = Describe("Graphql Custom query generator tests", func() { BeforeEach(func() { pkgs = parser.ParseDSLPkg(exampleDSLPath) graphqlQueries := parser.ParseGraphqlQuerySpecs(pkgs) - graph := parser.ParseDSLNodes(exampleDSLPath, baseGroupName, pkgs, graphqlQueries) + graph, _, _ := parser.ParseDSLNodes(exampleDSLPath, baseGroupName, pkgs, graphqlQueries) root, ok := graph["roots.root.tsm.tanzu.vmware.com"] Expect(ok).To(BeTrue()) config, ok := root.SingleChildren["Config"] @@ -27,7 +27,7 @@ var _ = Describe("Graphql Custom query generator tests", func() { }) It("should translate graphql query spec to schema", func() { - schema := generator.CustomQueryToGraphqlSchema(gns.GraphqlSpec.Queries[0]) + schema := generator.CustomQueryToGraphqlSchema(gns.GraphqlQuerySpec.Queries[0]) Expect(schema).To(Equal(` queryGns1( StartTime: String EndTime: String @@ -36,7 +36,7 @@ var _ = Describe("Graphql Custom query generator tests", func() { StartVal: Int ): NexusGraphqlResponse `)) - schema = generator.CustomQueryToGraphqlSchema(gns.GraphqlSpec.Queries[1]) + schema = generator.CustomQueryToGraphqlSchema(gns.GraphqlQuerySpec.Queries[1]) Expect(schema).To(Equal(` queryGnsQM1: TimeSeriesData `)) }) diff --git a/compiler/pkg/generator/resolver_generator.go b/compiler/pkg/generator/resolver_generator.go index fa0824c6e..3475eb726 100644 --- a/compiler/pkg/generator/resolver_generator.go +++ b/compiler/pkg/generator/resolver_generator.go @@ -3,84 +3,15 @@ package generator import ( "fmt" "go/ast" - "go/types" "sort" - "strconv" "strings" log "github.com/sirupsen/logrus" "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/pkg/parser" "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/pkg/util" - "github.com/vmware-tanzu/graph-framework-for-microservices/nexus/nexus" ) -type ReturnStatement struct { - Alias string - ReturnType string - FieldCount int - CRDName string - ChainAPI string - IsSingleton bool -} - -type FieldProperty struct { - IsResolver bool - IsNexusTypeField bool - IsNexusOrSingletonField bool - IsChildOrLink bool - IsChildrenOrLinks bool - IsMapTypeField bool - IsArrayTypeField bool - IsStdTypeField bool - IsCustomTypeField bool - IsPointerTypeField bool - IsStringType bool - IsArrayStdType bool - IsSingleton bool - PkgName string - NodeName string - FieldName string - FieldType string - FieldTypePkgPath string - ModelType string - SchemaFieldName string - SchemaTypeName string - BaseTypeName string - Alias string - ReturnType string - FieldCount int - CRDName string - ChainAPI string - LinkAPI string -} - -type NodeProperty struct { - IsParentNode bool - HasParent bool - IsSingletonNode bool - IsNexusNode bool - BaseImportPath string - CrdName string - ResolverCount int - PkgName string - NodeName string - SchemaName string - Alias string - ReturnType string - GroupResourceNameTitle string - ChildFields []FieldProperty - LinkFields []FieldProperty - ChildrenFields []FieldProperty - LinksFields []FieldProperty - ArrayFields []FieldProperty - CustomFields []FieldProperty - NonStructFields []FieldProperty - GraphqlSchemaFields []FieldProperty - ResolverFields map[string][]FieldProperty - CustomQueries []nexus.GraphQLQuery -} - // populateValuesForEachNode populates each node with required resolver properties func populateValuesForEachNode(nodes []*NodeProperty, linkAPI map[string]string, retMap map[string]ReturnStatement) []NodeProperty { var nodeProperties []NodeProperty @@ -259,16 +190,6 @@ func populateValuesForResolver(nodes []*NodeProperty, parentsMap map[string]pars return linkAPI, retMap } -func constructNexusTypeMap(nodes []*NodeProperty) map[string]string { - crdNameMap := make(map[string]string) - for _, n := range nodes { - if n.IsNexusNode || n.IsSingletonNode { - crdNameMap[n.CrdName] = n.PkgName + n.NodeName - } - } - return crdNameMap -} - // processNonNexusFields process and populates properties for each non nexus fields // func processNonNexusFields(aliasNameMap map[string]string, node *ast.TypeSpec, @@ -317,38 +238,6 @@ func processNonNexusFields(aliasNameMap map[string]string, node *ast.TypeSpec, } } -func findTypeAndPkgForField(ptParts []string, importMap map[string]string, pkgs map[string]parser.Package) (string, *parser.Package) { - structPkg := ptParts[0] - structType := ptParts[1] - - // if the import path has alias name, it is resolved - importPath, ok := importMap[structPkg] - if !ok { - // when pkg and directory names are different and no alias name provided, - // try to resolve by package name - for _, path := range importMap { - pkgName := getPkgName(pkgs, path) - if pkgName == structPkg { - importPath = path - } - } - } - - pkgPath, err := strconv.Unquote(importPath) - if err != nil { - log.Errorf("Failed to parse package %s for the type %s with error %v", pkgPath, structType, err) - return "", nil - } - - p, ok := pkgs[pkgPath] - if !ok { - log.Errorf("Cannot find the package details from the path %s for the type %s", importPath, structType) - return "", nil - } - - return structType, &p -} - // SkipSecretSpecAnnotation checks if the field has nexus secrets annotated on them // If yes, the field is skipped in the response. func SkipSecretSpecAnnotation(fieldName, nfType string, pkg parser.Package, importMap map[string]string, pkgs map[string]parser.Package) bool { @@ -477,50 +366,6 @@ func processNexusFields(pkg parser.Package, aliasNameMap map[string]string, node } } -/* -collect and construct type alias field into map recursively before -populating the nexus node and custom struct type -ex. nonStructMap[pkgName] = nodeType --> nonStructMap["root"] = "AliasTypeFoo" -*/ -func constructAliasType(sortedPackages []parser.Package) map[string]string { - nonStructMap := make(map[string]string) - for _, pkg := range sortedPackages { - for _, node := range pkg.GetNonStructTypes() { - pkgName := fmt.Sprintf("%s_%s", pkg.Name, parser.GetTypeName(node)) - // NonStruct Map - nonStructType := types.ExprString(node.Type) - nonStructMap[pkgName] = nonStructType - } - } - - return nonStructMap -} - -func setNexusProperties(nodeHelper parser.NodeHelper, node *ast.TypeSpec, nodeProp *NodeProperty) { - if len(nodeHelper.Parents) > 0 { - nodeProp.HasParent = true - } - - if parser.IsSingletonNode(node) { - nodeProp.IsSingletonNode = true - } - - if parser.IsNexusNode(node) { - nodeProp.IsNexusNode = true - } -} - -// isRootOfGraph intended to allow only one root of the graph, -// if we receive multiple node in such behaviour, then we allow the first node and the rest will be skipped with error -// arg: `parents` indicates the node's parents, `rootOfGraph` indicates if the received node is the root of the graph or not. -func isRootOfGraph(parents []string, rootOfGraph bool) bool { - if len(parents) == 0 && !rootOfGraph { - return true - } - - return rootOfGraph -} - // GenerateGraphqlResolverVars populates the node and its field properties required to generate graphql resolver func GenerateGraphqlResolverVars(baseGroupName, crdModulePath string, pkgs parser.Packages, parentsMap map[string]parser.NodeHelper) ([]NodeProperty, error) { sortedKeys := make([]string, 0, len(pkgs)) @@ -561,7 +406,7 @@ func GenerateGraphqlResolverVars(baseGroupName, crdModulePath string, pkgs parse nodeProp.CrdName = util.GetCrdName(node.Name.String(), pkg.Name, baseGroupName) nodeHelper := parentsMap[nodeProp.CrdName] nodeProp.IsParentNode = parser.IsNexusNode(node) - nodeProp.CustomQueries = nodeHelper.GraphqlSpec.Queries + nodeProp.CustomQueries = nodeHelper.GraphqlQuerySpec.Queries if parser.IsNexusNode(node) && len(nodeHelper.Parents) == 0 && rootOfGraph { log.Errorf("Can't allow multiple root of the graph, skipping Node:%s", nodeProp.NodeName) diff --git a/compiler/pkg/generator/resolver_generator_test.go b/compiler/pkg/generator/resolver_generator_test.go index 5490e2302..03c8cd7c7 100644 --- a/compiler/pkg/generator/resolver_generator_test.go +++ b/compiler/pkg/generator/resolver_generator_test.go @@ -21,7 +21,7 @@ var _ = Describe("Template renderers tests", func() { config.ConfigInstance.IgnoredDirs = []string{"ignored"} pkgs = parser.ParseDSLPkg(exampleDSLPath) graphqlQueries = parser.ParseGraphqlQuerySpecs(pkgs) - graph := parser.ParseDSLNodes(exampleDSLPath, baseGroupName, pkgs, graphqlQueries) + graph, _, _ := parser.ParseDSLNodes(exampleDSLPath, baseGroupName, pkgs, graphqlQueries) parentsMap = parser.CreateParentsMap(graph) }) @@ -53,7 +53,7 @@ var _ = Describe("Template renderers tests", func() { It("should resolve non-singleton root and singleton child node", func() { pkgs = parser.ParseDSLPkg("../../example/test-utils/non-singleton-root") - graph := parser.ParseDSLNodes("../../example/test-utils/non-singleton-root", baseGroupName, pkgs, graphqlQueries) + graph, _, _ := parser.ParseDSLNodes("../../example/test-utils/non-singleton-root", baseGroupName, pkgs, graphqlQueries) parentsMap = parser.CreateParentsMap(graph) vars, err := generator.GenerateGraphqlResolverVars(baseGroupName, crdModulePath, pkgs, parentsMap) diff --git a/compiler/pkg/generator/template/graphql/graphqlResolver.go.tmpl b/compiler/pkg/generator/template/graphql/graphqlResolver.go.tmpl index 1e99f8178..166f139de 100644 --- a/compiler/pkg/generator/template/graphql/graphqlResolver.go.tmpl +++ b/compiler/pkg/generator/template/graphql/graphqlResolver.go.tmpl @@ -27,6 +27,16 @@ func getParentName(parentLabels map[string]interface{}, key string) string { return "" } +type NodeMetricTypeEnum string +type ServiceMetricTypeEnum string +type ServiceGroupByEnum string +type HTTPMethodEnum string +type EventSeverityEnum string +type AnalyticsMetricEnum string +type AnalyticsSubMetricEnum string +type TrafficDirectionEnum string +type SloDetailsEnum string + ////////////////////////////////////// // Nexus K8sAPIEndpointConfig ////////////////////////////////////// @@ -135,7 +145,7 @@ func getRootResolver(id *string) ([]*model.{{$node.PkgName}}{{$node.NodeName}}, {{ end }}{{end}} {{- range $key, $query := $node.CustomQueries }} // Custom query -func get{{$node.PkgName}}{{$node.NodeName}}{{$query.Name}}Resolver(obj *model.{{$node.PkgName}}{{$node.NodeName}}, {{ range $key, $arg := $query.Args }} {{$arg.Name}} *{{$arg.Type}}, {{ end }}) ({{- if eq $query.ApiType 0 }}*model.NexusGraphqlResponse{{- else if eq $query.ApiType 1 }}*model.TimeSeriesData {{- end}}, error) { +func get{{$node.PkgName}}{{$node.NodeName}}{{$query.Name}}Resolver(obj *model.{{$node.PkgName}}{{$node.NodeName}}, {{ range $key, $arg := $query.Args }} {{- if $arg.AliasType }} {{$arg.Name}} *model.{{$arg.Type}}, {{- else }} {{$arg.Name}} *{{$arg.Type}}, {{- end}}{{ end }}) ({{- if eq $query.ApiType 0 }}*model.NexusGraphqlResponse{{- else if eq $query.ApiType 1 }}*model.TimeSeriesData {{- end}}, error) { parentLabels := make(map[string]string) if obj != nil { for k, v := range obj.ParentLabels { diff --git a/compiler/pkg/generator/template/graphql/schema.graphqls.tmpl b/compiler/pkg/generator/template/graphql/schema.graphqls.tmpl index a614e1956..755cc8dd0 100644 --- a/compiler/pkg/generator/template/graphql/schema.graphqls.tmpl +++ b/compiler/pkg/generator/template/graphql/schema.graphqls.tmpl @@ -35,3 +35,14 @@ type TimeSeriesData { Last: String TotalRecords: Int } + +{{- range $key, $val := .GraphQlFiles}} + {{- if eq $key "_tsm_temp/global/common/enums.graphql" }} + {{ $val }} + {{- else}}{{ end }} +{{- end }} + +directive @jsonencoded(file: String, gofile: String, name: String) on FIELD_DEFINITION +directive @relation(name: String, parameters: String, softlink: String, uuidkey: String) on FIELD_DEFINITION +directive @timeseriesAPI(file: String!, handler: String!) on FIELD_DEFINITION +directive @protobuf(file: String!, name: String!) on FIELD_DEFINITION diff --git a/compiler/pkg/generator/template/model.go.tmpl b/compiler/pkg/generator/template/model.go.tmpl new file mode 100644 index 000000000..8fc992aa7 --- /dev/null +++ b/compiler/pkg/generator/template/model.go.tmpl @@ -0,0 +1 @@ +{{.Types}} \ No newline at end of file diff --git a/compiler/pkg/generator/template/tsm-graphql/schema.graphqls.tmpl b/compiler/pkg/generator/template/tsm-graphql/schema.graphqls.tmpl new file mode 100644 index 000000000..8ce8642fe --- /dev/null +++ b/compiler/pkg/generator/template/tsm-graphql/schema.graphqls.tmpl @@ -0,0 +1,15 @@ +{{- range $key, $node := .Nodes }} +{{- if $node.IsNexusNode }} +{{ $length := len $node.GraphqlSchemaFields }}{{- if eq $length 0 }}{{- else }} +type {{ $node.SchemaName }} @nexus(group:"{{ $node.GroupName}}",version:"{{ $node.ResourceVersion}}",kind:"{{ $node.Kind}}",resource:"{{ $node.ResourceName}}",name:"{{ $node.NodeName}}",crdName:"{{ $node.CrdName}}"){ + {{- range $key, $field := $node.GraphqlSchemaFields }} + {{- if $field.SchemaFieldName }} + {{ $field.SchemaFieldName -}} + {{- end}} + {{- end }} +} +{{- end }}{{- end }}{{- end }} + +{{- range $key, $val := .GraphQlFiles}} + {{ $val }} +{{- end }} diff --git a/compiler/pkg/generator/template/types.go.tmpl b/compiler/pkg/generator/template/types.go.tmpl index 1f8581297..539535664 100644 --- a/compiler/pkg/generator/template/types.go.tmpl +++ b/compiler/pkg/generator/template/types.go.tmpl @@ -22,10 +22,17 @@ type Link struct { Name string `json:"name" yaml:"name"` } +// +k8s:openapi-gen=true +type SyncerStatus struct { + EtcdVersion int64 `json:"etcdVersion, omitempty" yaml:"etcdVersion, omitempty"` + CRGenerationId int64 `json:"cRGenerationId, omitempty" yaml:"cRGenerationId, omitempty"` +} + // +k8s:openapi-gen=true type NexusStatus struct { - SourceGeneration int64 `json:"sourceGeneration" yaml:"sourceGeneration"` - RemoteGeneration int64 `json:"remoteGeneration" yaml:"remoteGeneration"` + SourceGeneration int64 `json:"sourceGeneration, omitempty" yaml:"sourceGeneration, omitempty"` + RemoteGeneration int64 `json:"remoteGeneration, omitempty" yaml:"remoteGeneration, omitempty"` + SyncerStatus SyncerStatus `json:"syncerStatus, omitempty" yaml:"syncerStatus, omitempty"` } /* ------------------- CRDs definitions ------------------- */ diff --git a/compiler/pkg/generator/template_renderers.go b/compiler/pkg/generator/template_renderers.go index 3ffdc471e..3530e49b0 100644 --- a/compiler/pkg/generator/template_renderers.go +++ b/compiler/pkg/generator/template_renderers.go @@ -6,6 +6,8 @@ import ( "encoding/json" "fmt" "go/format" + "go/printer" + "go/token" "os" "sort" "strings" @@ -55,9 +57,17 @@ var graphqlResolverTemplateFile []byte //go:embed template/graphql/server.go.tmpl var gqlserverTemplateFile []byte +//go:embed template/tsm-graphql/schema.graphqls.tmpl +var tsmGraphqlSchemaTemplateFile []byte + +//go:embed template/model.go.tmpl +var modelTemplateFile []byte + func RenderCRDTemplate(baseGroupName, crdModulePath string, - pkgs parser.Packages, graph map[string]parser.Node, outputDir string, - httpMethods map[string]nexus.HTTPMethodsResponses, httpCodes map[string]nexus.HTTPCodesResponse) error { + pkgs parser.Packages, graph map[string]parser.Node, + outputDir string, httpMethods map[string]nexus.HTTPMethodsResponses, + httpCodes map[string]nexus.HTTPCodesResponse, nonNexusTypes *parser.NonNexusTypes, + fileset *token.FileSet, graphqlFiles map[string]string) error { parentsMap := parser.CreateParentsMap(graph) pkgNames := make([]string, len(pkgs)) @@ -137,7 +147,7 @@ func RenderCRDTemplate(baseGroupName, crdModulePath string, return err } - err = RenderGraphQL(baseGroupName, outputDir, crdModulePath, pkgs, parentsMap) + err = RenderGraphQL(baseGroupName, outputDir, crdModulePath, pkgs, parentsMap, graphqlFiles, nonNexusTypes) if err != nil { return err } @@ -146,6 +156,11 @@ func RenderCRDTemplate(baseGroupName, crdModulePath string, if err != nil { return err } + + err = RenderNonNexusTypes(outputDir, nonNexusTypes, fileset) + if err != nil { + return err + } return nil } @@ -538,9 +553,10 @@ func RenderClientTemplate(baseGroupName, crdModulePath string, pkgs parser.Packa type GraphDetails struct { BaseImportPath string Nodes []NodeProperty + GraphQlFiles map[string]string } -func RenderGraphQL(baseGroupName, outputDir, crdModulePath string, pkgs parser.Packages, parentsMap map[string]parser.NodeHelper) error { +func RenderGraphQL(baseGroupName, outputDir, crdModulePath string, pkgs parser.Packages, parentsMap map[string]parser.NodeHelper, graphqlFiles map[string]string, nonNexusTypes *parser.NonNexusTypes) error { gqlFolder := outputDir + "/nexus-gql/graph" var ( vars GraphDetails @@ -549,6 +565,7 @@ func RenderGraphQL(baseGroupName, outputDir, crdModulePath string, pkgs parser.P vars.BaseImportPath = crdModulePath vars.Nodes, err = GenerateGraphqlResolverVars(baseGroupName, crdModulePath, pkgs, parentsMap) + vars.GraphQlFiles = graphqlFiles if err != nil { return err } @@ -586,6 +603,25 @@ func RenderGraphQL(baseGroupName, outputDir, crdModulePath string, pkgs parser.P return err } + //Render Graphql Schema Template (TSM) + vars.Nodes, err = GenerateTsmGraphqlSchemaVars(baseGroupName, crdModulePath, pkgs, parentsMap, nonNexusTypes) + if err != nil { + return err + } + tsmGqlFolder := outputDir + "/tsm-nexus-gql/graph" + schemaTemplate, err := readTemplateFile(tsmGraphqlSchemaTemplateFile) + if err != nil { + return err + } + tsmFile, err := renderTemplate(schemaTemplate, vars) + if err != nil { + return err + } + log.Debugf("Rendered graphql schema template: %s", tsmFile) + err = createFile(tsmGqlFolder, "schema.graphqls", tsmFile, false) + if err != nil { + return err + } return nil } @@ -649,3 +685,52 @@ func RenderGqlServerTemplate(vars ServerVars) (*bytes.Buffer, error) { } return renderTemplate(registerGqlserverTemplate, vars) } + +type CommonVars struct { + Types string +} + +func RenderNonNexusTypes(outputDir string, nonNexusTypes *parser.NonNexusTypes, fileset *token.FileSet) error { + outputModelFolder := outputDir + "/model" + err := createFolder(outputModelFolder) + if err != nil { + return err + } + + var output string + for _, decl := range nonNexusTypes.Types { + var buf bytes.Buffer + err := printer.Fprint(&buf, fileset, decl) + if err != nil { + return err + } + + output += fmt.Sprintf("%s\n\n", buf.String()) + } + + for _, val := range nonNexusTypes.Values { + output += fmt.Sprintf("%s\n\n", val) + } + + for _, val := range nonNexusTypes.ExternalTypes { + output += fmt.Sprintf("%s\n\n", val) + } + + vars := CommonVars{Types: output} + tmpl, err := readTemplateFile(modelTemplateFile) + if err != nil { + return err + } + + out, err := renderTemplate(tmpl, vars) + if err != nil { + return err + } + + err = createFile(outputModelFolder, "model.go", out, false) + if err != nil { + return err + } + + return nil +} diff --git a/compiler/pkg/generator/tsm_graphql_generator.go b/compiler/pkg/generator/tsm_graphql_generator.go new file mode 100644 index 000000000..2d2dc85e0 --- /dev/null +++ b/compiler/pkg/generator/tsm_graphql_generator.go @@ -0,0 +1,485 @@ +package generator + +import ( + "fmt" + "go/ast" + "regexp" + "sort" + "strings" + + log "github.com/sirupsen/logrus" + "golang.org/x/text/cases" + "golang.org/x/text/language" + + "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/pkg/parser" + "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/pkg/util" + "github.com/vmware-tanzu/graph-framework-for-microservices/nexus/nexus" +) + +type GraphQLSchemaType int + +const ( + Standard GraphQLSchemaType = iota + Array + JsonMarshal + Child + Link + NamedChild + NamedLink + AliasType +) + +// tsmPopulateValuesForEachNode populates each node with required resolver properties +func tsmPopulateValuesForEachNode(nodes []*NodeProperty, linkAPI map[string]string, retMap map[string]ReturnStatement) []NodeProperty { + var nodeProperties []NodeProperty + for _, n := range nodes { + resNodeProp := NodeProperty{} + resNodeProp.GroupResourceNameTitle = util.GetGroupResourceNameTitle(n.NodeName) + resNodeProp.Alias = n.Alias + resNodeProp.ReturnType = n.ReturnType + resNodeProp.BaseImportPath = n.BaseImportPath + resNodeProp.GraphqlSchemaFields = n.GraphqlSchemaFields + resNodeProp.IsSingletonNode = n.IsSingletonNode + resNodeProp.CustomQueries = n.CustomQueries + resNodeProp.IsNexusNode = n.IsNexusNode + resNodeProp.ResolverFields = n.ResolverFields + resNodeProp.ResolverCount = n.ResolverCount + resNodeProp.PkgName = n.PkgName + resNodeProp.NodeName = n.NodeName + resNodeProp.SchemaName = n.SchemaName + resNodeProp.GroupName = n.GroupName + resNodeProp.Singular = n.Singular + resNodeProp.Kind = n.Kind + resNodeProp.ResourceName = n.ResourceName + resNodeProp.ResourceVersion = n.ResourceVersion + resNodeProp.CrdName = n.CrdName + + // populate return values for root of the graph + if !n.HasParent && n.IsParentNode { + resNodeProp.Alias = retMap[resNodeProp.PkgName+resNodeProp.NodeName].Alias + resNodeProp.ReturnType = retMap[resNodeProp.PkgName+resNodeProp.NodeName].ReturnType + resNodeProp.IsParentNode = true + } + + // populate return values for child fields + for _, f := range n.ChildFields { + f.ReturnType = retMap[f.FieldTypePkgPath].ReturnType + f.Alias = retMap[f.FieldTypePkgPath].Alias + f.FieldCount = retMap[f.FieldTypePkgPath].FieldCount + f.CRDName = retMap[f.FieldTypePkgPath].CRDName + f.ChainAPI = retMap[f.FieldTypePkgPath].ChainAPI + f.IsSingleton = retMap[f.FieldTypePkgPath].IsSingleton + f.LinkAPI = linkAPI[f.PkgName+f.NodeName] + resNodeProp.ChildFields = append(resNodeProp.ChildFields, f) + } + + // populate return values for multiple child fields + for _, f := range n.ChildrenFields { + f.ReturnType = retMap[f.FieldTypePkgPath].ReturnType + f.Alias = retMap[f.FieldTypePkgPath].Alias + f.FieldCount = retMap[f.FieldTypePkgPath].FieldCount + f.CRDName = retMap[f.FieldTypePkgPath].CRDName + f.ChainAPI = retMap[f.FieldTypePkgPath].ChainAPI + f.IsSingleton = retMap[f.FieldTypePkgPath].IsSingleton + f.LinkAPI = linkAPI[f.PkgName+f.NodeName] + resNodeProp.ChildrenFields = append(resNodeProp.ChildrenFields, f) + } + + // populate return values for link fields + for _, f := range n.LinkFields { + f.ReturnType = retMap[f.FieldTypePkgPath].ReturnType + f.Alias = retMap[f.FieldTypePkgPath].Alias + f.FieldCount = retMap[f.FieldTypePkgPath].FieldCount + f.CRDName = retMap[f.FieldTypePkgPath].CRDName + f.ChainAPI = retMap[f.FieldTypePkgPath].ChainAPI + f.IsSingleton = retMap[f.FieldTypePkgPath].IsSingleton + f.LinkAPI = linkAPI[f.PkgName+f.NodeName] + resNodeProp.LinkFields = append(resNodeProp.LinkFields, f) + } + + // populate return values for multiple link fields + for _, f := range n.LinksFields { + f.ReturnType = retMap[f.FieldTypePkgPath].ReturnType + f.Alias = retMap[f.FieldTypePkgPath].Alias + f.FieldCount = retMap[f.FieldTypePkgPath].FieldCount + f.CRDName = retMap[f.FieldTypePkgPath].CRDName + f.ChainAPI = retMap[f.FieldTypePkgPath].ChainAPI + f.IsSingleton = retMap[f.FieldTypePkgPath].IsSingleton + f.LinkAPI = linkAPI[f.PkgName+f.NodeName] + resNodeProp.LinksFields = append(resNodeProp.LinksFields, f) + } + + nodeProperties = append(nodeProperties, resNodeProp) + } + + return nodeProperties +} + +func tsmPopulateValuesForResolver(nodes []*NodeProperty, parentsMap map[string]parser.NodeHelper, + crdNameMap, nonStructMap map[string]string) (map[string]string, map[string]ReturnStatement) { + linkAPI := make(map[string]string) + retMap := make(map[string]ReturnStatement) + + for _, n := range nodes { + var ( + retType, aliasVal, listRetVal, ChainAPI string + fieldCount int + IsSingleton bool + ) + + retType += fmt.Sprintf("ret := &model.%s%s {\n", n.PkgName, n.NodeName) + if n.IsNexusNode || n.IsSingletonNode { + retType += fmt.Sprintf("\t%s: &%s,\n", "Id", "dn") + aliasVal += fmt.Sprintf("%s := v%s.DisplayName()\n", "dn", n.NodeName) + + retType += fmt.Sprintf("\t%s: %s,\n", "ParentLabels", "parentLabels") + aliasVal += fmt.Sprintf("%s := map[string]interface{}{%q:%s}\n", "parentLabels", n.CrdName, "dn") + + ChainAPI += "nc" + var prevNode parser.NodeHelper + for _, i := range parentsMap[n.CrdName].Parents { + currentNode := parentsMap[i] + + if len(currentNode.Parents) == 0 { + // root of the graph + if currentNode.IsSingleton { + ChainAPI += fmt.Sprintf(".%s()", crdNameMap[i]) + } else { + ChainAPI += fmt.Sprintf(".%s(getParentName(obj.ParentLabels, %q))", crdNameMap[i], i) + } + } else { + if childNode, ok := prevNode.Children[i]; ok { + if currentNode.IsSingleton { + ChainAPI += fmt.Sprintf(".%s()", childNode.FieldName) + } else { + ChainAPI += fmt.Sprintf(".%s(getParentName(obj.ParentLabels, %q))", childNode.FieldName, i) + } + } + } + // cache the non-leaf node + prevNode = currentNode + } + + // Create linkAPI + if n.IsSingletonNode { + IsSingleton = true + if !n.HasParent && n.IsParentNode { + linkAPI[n.PkgName+n.NodeName] = fmt.Sprintf("%s.Get%s(context.TODO())", ChainAPI, n.PkgName+n.NodeName) + } else { + linkAPI[n.PkgName+n.NodeName] = fmt.Sprintf("%s.Get%s(context.TODO())", ChainAPI, prevNode.Children[n.CrdName].FieldName) + } + } else { + IsSingleton = false + if !n.HasParent && n.IsParentNode { + linkAPI[n.PkgName+n.NodeName] = fmt.Sprintf("%s.Get%s(context.TODO(), getParentName(obj.ParentLabels, %q))", ChainAPI, n.PkgName+n.NodeName, n.CrdName) + } else { + linkAPI[n.PkgName+n.NodeName] = fmt.Sprintf("%s.Get%s(context.TODO(), getParentName(obj.ParentLabels, %q))", ChainAPI, prevNode.Children[n.CrdName].FieldName, n.CrdName) + } + } + } + for _, i := range n.ResolverFields[n.PkgName+n.NodeName] { + if i.IsMapTypeField || i.IsStringType { + fieldCount += 1 + retType += fmt.Sprintf("\t%s: &%sData,\n", i.FieldName, i.FieldName) + aliasVal += jsonMarshalResolver(i.FieldName, n.NodeName) + } else if i.IsStdTypeField { + if len(convertGoStdType(i.FieldType)) != 0 { + fieldCount += 1 + retType += fmt.Sprintf("\t%s: &v%s,\n", i.FieldName, i.FieldName) + listRetVal += fmt.Sprintf("v%s := %s(i.%s)\n", i.FieldName, convertGoStdType(i.FieldType), i.FieldName) + aliasVal += fmt.Sprintf("v%s := %s(v%s.Spec.%s)\n", i.FieldName, convertGoStdType(i.FieldType), i.NodeName, i.FieldName) + } + } + } + retType += "\t}" + retMap[n.PkgName+n.NodeName] = ReturnStatement{ + Alias: aliasVal, + ReturnType: retType, + FieldCount: fieldCount, + CRDName: n.CrdName, + ChainAPI: ChainAPI, + IsSingleton: IsSingleton, + } + } + + return linkAPI, retMap +} + +// tsmProcessNonNexusFields process and populates properties for each non nexus fields +// +func tsmProcessNonNexusFields(pkg parser.Package, aliasNameMap map[string]string, node *ast.TypeSpec, nodeProp *NodeProperty, simpleGroupTypeName string, nonNexusTypes *parser.NonNexusTypes) { + resField := make(map[string][]FieldProperty) + for _, f := range parser.GetSpecFields(node) { + var ( + fieldProp FieldProperty + err error + ) + typeString := ConstructType(aliasNameMap, f) + // populate each field properties + if len(f.Names) > 0 { + fieldProp.FieldName, err = parser.GetNodeFieldName(f) + if err != nil { + log.Fatalf("failed to determine field name: %v", err) + } + fieldProp.FieldType = typeString + fieldProp.PkgName = simpleGroupTypeName + fieldProp.NodeName = node.Name.String() + } + + if parser.IgnoreField(f) { + continue + } + + if parser.IsJsonStringField(f) { + fieldProp.IsStringType = true + fieldProp.SchemaFieldName = getTsmGraphqlSchemaFieldName(JsonMarshal, fieldProp.FieldName, "String", "id: ID", f, pkg, nonNexusTypes) + resField[nodeProp.PkgName+nodeProp.NodeName] = append(resField[nodeProp.PkgName+nodeProp.NodeName], fieldProp) + } else if parser.IsFieldAnnotationPresent(f, parser.GRAPHQL_ALIAS_TYPE_ANNOTATION) || parser.IsFieldAnnotationPresent(f, parser.GRAPHQL_ALIAS_NAME_ANNOTATION) { + fieldProp.SchemaFieldName = getTsmGraphqlSchemaFieldName(AliasType, fieldProp.FieldName, "", "", f, pkg, nonNexusTypes) + resField[nodeProp.PkgName+nodeProp.NodeName] = append(resField[nodeProp.PkgName+nodeProp.NodeName], fieldProp) + } else if parser.IsArrayField(f) { + arr := regexp.MustCompile(`^(\[])`).ReplaceAllString(typeString, "") + if !strings.Contains(arr, ".") { + stdType := convertGraphqlStdType(arr) + fieldProp.SchemaFieldName = getTsmGraphqlSchemaFieldName(Array, fieldProp.FieldName, stdType, "id: ID", f, pkg, nonNexusTypes) + resField[nodeProp.PkgName+nodeProp.NodeName] = append(resField[nodeProp.PkgName+nodeProp.NodeName], fieldProp) + } + } else { + stdType := convertGraphqlStdType(typeString) + // standard type + if len(stdType) != 0 { + fieldProp.IsStdTypeField = true + fieldProp.SchemaFieldName = getTsmGraphqlSchemaFieldName(Standard, fieldProp.FieldName, stdType, "id: ID", f, pkg, nonNexusTypes) + resField[nodeProp.PkgName+nodeProp.NodeName] = append(resField[nodeProp.PkgName+nodeProp.NodeName], fieldProp) + } else { + fieldProp.SchemaFieldName = getTsmGraphqlSchemaFieldName(Standard, fieldProp.FieldName, "String", "id: ID", f, pkg, nonNexusTypes) + fieldProp.IsStringType = true + resField[nodeProp.PkgName+nodeProp.NodeName] = append(resField[nodeProp.PkgName+nodeProp.NodeName], fieldProp) + } + } + nodeProp.GraphqlSchemaFields = append(nodeProp.GraphqlSchemaFields, fieldProp) + nodeProp.ResolverFields = resField + } +} + +// tsmProcessNexusFields process and populates properties for each nexus fields +// +func tsmProcessNexusFields(pkg parser.Package, aliasNameMap map[string]string, node *ast.TypeSpec, + nodeProp *NodeProperty, simpleGroupTypeName string, pkgs map[string]parser.Package, + gqlSpecMap map[string]nexus.GraphQLSpec) { + importMap := pkg.GetImportMap() + for _, nf := range parser.GetNexusFields(node) { + var ( + fieldProp FieldProperty + err error + ) + if len(nf.Names) > 0 { + fieldProp.FieldName, err = parser.GetNodeFieldName(nf) + if err != nil { + log.Fatalf("Failed to determine field name: %v", err) + } + fieldProp.PkgName = simpleGroupTypeName + fieldProp.NodeName = node.Name.String() + } + + // Except for nexus fields (nexus.Node and nexus.SingletonNode), + // this will check other fields to see whether they have nexus secrets annotated on them + // If yes, the field is ignored in the response. + if !parser.IsNexusTypeField(nf) { + nfType := parser.GetFieldType(nf) + fieldPkg := &pkg + structType := nfType + + if ptParts := strings.Split(nfType, "."); len(ptParts) == 2 { //service_group.SvcGroup + structType, fieldPkg = findTypeAndPkgForField(ptParts, importMap, pkgs) + } + if len(structType) != 0 { + if _, ok := parser.GetNexusSecretSpecAnnotation(*fieldPkg, structType); ok { + log.Debugf("Ignoring the field %s since the node is annotated as nexus secret", fieldProp.FieldName) + continue + } + } + } + + // `Ignore:true` annotation used to ignore the specific field `nexus-graphql:"ignore:true"` + if parser.IgnoreField(nf) { + continue + } + // `type:string` annotation used to consider the type as string `nexus-graphql:"type:string"` + if parser.IsJsonStringField(nf) { + fieldProp.IsStringType = true + fieldProp.SchemaFieldName = getTsmGraphqlSchemaFieldName(JsonMarshal, fieldProp.FieldName, "String", "id: ID", nf, pkg, nil) + } + + // denote field is nexus or singletonField type + if parser.IsNexusTypeField(nf) { + fieldProp.IsNexusOrSingletonField = true + // get nexus schemaFieldName from GraphQlSpec "IdName" & "IdNullable" + fieldProp.SchemaFieldName = GetNexusSchemaFieldName(nodeProp.GraphQlSpec) + for _, customQuery := range nodeProp.CustomQueries { + cq := CustomQueryToGraphqlSchema(customQuery) + // In TSM DM "@timeseriesAPI" directives is need to added along with returnType "TimeSeriesData" + fieldProp.SchemaFieldName += "\n" + strings.ReplaceAll(cq, "TimeSeriesData", fmt.Sprintf("TimeSeriesData @timeseriesAPI(file: \"../../tsquery/timeSeriesQuery\", handler: \"%s\")", customQuery.Name)) + var customQueryFieldProp FieldProperty + customQueryFieldProp.IsResolver = true + customQueryFieldProp.FieldName = customQuery.Name + nodeProp.GraphqlSchemaFields = append(nodeProp.GraphqlSchemaFields, customQueryFieldProp) + nodeProp.ResolverCount += 1 + } + } + + // nexus link field + typeString := ConstructType(aliasNameMap, nf) + if parser.IsOnlyLinkField(nf) { + schemaTypeName, resolverTypeName := ValidateImportPkg(nodeProp.PkgName, typeString, importMap, pkgs) + fieldProp.SchemaFieldName = getTsmGraphqlSchemaFieldName(Link, fieldProp.FieldName, schemaTypeName, "id: ID", nf, pkg, nil) + fieldProp.IsResolver = true + fieldProp.IsNexusTypeField = true + fieldProp.FieldType = typeString + fieldProp.FieldTypePkgPath = resolverTypeName + fieldProp.SchemaTypeName = schemaTypeName + fieldProp.BaseTypeName = getBaseNodeType(typeString) + nodeProp.LinkFields = append(nodeProp.LinkFields, fieldProp) + } + + // nexus child field + if parser.IsOnlyChildField(nf) { + schemaTypeName, resolverTypeName := ValidateImportPkg(nodeProp.PkgName, typeString, importMap, pkgs) + fieldProp.SchemaFieldName = getTsmGraphqlSchemaFieldName(Child, fieldProp.FieldName, schemaTypeName, "id: ID", nf, pkg, nil) + fieldProp.SchemaTypeName = schemaTypeName + fieldProp.IsResolver = true + fieldProp.IsNexusTypeField = true + fieldProp.FieldType = typeString + fieldProp.FieldTypePkgPath = resolverTypeName + fieldProp.BaseTypeName = getBaseNodeType(typeString) + nodeProp.ChildFields = append(nodeProp.ChildFields, fieldProp) + } + + // nexus children or links field + if parser.IsNamedChildOrLink(nf) { + var listArg string + fieldProp.IsChildrenOrLinks = true + schemaTypeName, resolverTypeName := ValidateImportPkg(nodeProp.PkgName, typeString, importMap, pkgs) + // Annotation `nexus-graphql-args:"name: String"` use to specify graphql arguments + AnnotatedGqlArgs := parser.GetFieldAnnotationVal(nf, parser.GRAPHQL_ARGS_ANNOTATION) + if AnnotatedGqlArgs != "" { + listArg = AnnotatedGqlArgs + } else { + if val, ok := parser.GetNexusGraphqlSpecAnnotation(pkg, typeString); ok { + gqlspec := gqlSpecMap[fmt.Sprintf("%s.%s", pkg.Name, val)] + listArg = GetNexusSchemaFieldName(gqlspec) + } else { + listArg = GetNodeDetails(nodeProp.PkgName, typeString, importMap, pkgs, gqlSpecMap) + } + } + + sType := NamedChild + if parser.IsLinkField(nf) { + sType = NamedLink + } + fieldProp.SchemaFieldName = getTsmGraphqlSchemaFieldName(sType, fieldProp.FieldName, schemaTypeName, listArg, nf, pkg, nil) + fieldProp.IsResolver = true + fieldProp.IsNexusTypeField = true + fieldProp.FieldType = typeString + fieldProp.FieldTypePkgPath = resolverTypeName + fieldProp.BaseTypeName = getBaseNodeType(typeString) + if parser.IsOnlyChildrenField(nf) { + nodeProp.ChildrenFields = append(nodeProp.ChildrenFields, fieldProp) + } else { + nodeProp.LinksFields = append(nodeProp.LinksFields, fieldProp) + } + } + // no. of resolver field in a node + if fieldProp.IsResolver { + nodeProp.ResolverCount += 1 + } + nodeProp.GraphqlSchemaFields = append(nodeProp.GraphqlSchemaFields, fieldProp) + } +} + +// GenerateTsmGraphqlSchemaVars populates the node and its field properties required to generate graphql resolver +func GenerateTsmGraphqlSchemaVars(baseGroupName, crdModulePath string, pkgs parser.Packages, parentsMap map[string]parser.NodeHelper, nonNexusTypes *parser.NonNexusTypes) ([]NodeProperty, error) { + sortedKeys := make([]string, 0, len(pkgs)) + gqlSpecMap := parser.ParseGraphqlSpecs(pkgs) + for k := range pkgs { + sortedKeys = append(sortedKeys, k) + } + sort.Strings(sortedKeys) + sortedPackages := make([]parser.Package, len(pkgs)) + for i, k := range sortedKeys { + sortedPackages[i] = pkgs[k] + } + + // Iterate all the struct type and it's fields in the sortedPackages and + // set the node and field properties accordingly. + var nodes []*NodeProperty + aliasNameMap := make(map[string]string) + //rootOfGraph := false + for _, pkg := range sortedPackages { + simpleGroupTypeName := util.GetSimpleGroupTypeName(pkg.Name) + // Iterating struct type + for _, node := range pkg.GetStructs() { + // Nexus GraphQlSpec by default "IdNullable" value is true + gqlspec := nexus.GraphQLSpec{ + IdName: "", + IdNullable: true, + } + // Skip Empty struct type + if len(parser.GetNexusFields(node)) == 0 && len(parser.GetSpecFields(node)) == 0 { + continue + } + + typeName := parser.GetTypeName(node) + if _, ok := parser.GetNexusSecretSpecAnnotation(pkg, typeName); ok { + log.Debugf("Ignoring the node %s since the node is annotated as nexus secret", typeName) + continue + } + + if val, ok := parser.GetNexusGraphqlSpecAnnotation(pkg, typeName); ok { + gqlspec = gqlSpecMap[fmt.Sprintf("%s.%s", pkg.Name, val)] + } + + nodeProp := &NodeProperty{} + // populate node properties + nodeProp.PkgName = simpleGroupTypeName + nodeProp.NodeName = node.Name.String() + nodeProp.BaseImportPath = crdModulePath + nodeProp.CrdName = util.GetCrdName(node.Name.String(), pkg.Name, baseGroupName) + nodeHelper := parentsMap[nodeProp.CrdName] + nodeProp.IsParentNode = parser.IsNexusNode(node) + nodeProp.CustomQueries = nodeHelper.GraphqlQuerySpec.Queries + nodeProp.GraphQlSpec = gqlspec + nodeProp.GroupName = pkg.Name + "." + baseGroupName + nodeProp.Singular = strings.ToLower(typeName) + nodeProp.Kind = cases.Title(language.Und, cases.NoLower).String(typeName) + nodeProp.ResourceName = util.ToPlural(nodeProp.Singular) + nodeProp.ResourceVersion = "v1" + // crdName := fmt.Sprintf("%s.%s", plural, groupName) + + setNexusProperties(nodeHelper, node, nodeProp) + if pkg.Name == "global" { + nodeProp.SchemaName = parser.GetTypeName(node) + } else if pkg.Name == "tsm" { + continue + } else { + nodeProp.SchemaName = fmt.Sprintf("%s_%s", pkg.Name, parser.GetTypeName(node)) + } + // Iterate each node's nexus fields and set its properties + tsmProcessNexusFields(pkg, aliasNameMap, node, nodeProp, simpleGroupTypeName, pkgs, gqlSpecMap) + + // Iterate each node's non-nexus fields and set its properties + tsmProcessNonNexusFields(pkg, aliasNameMap, node, nodeProp, simpleGroupTypeName, nonNexusTypes) + nodes = append(nodes, nodeProp) + } + } + + crdNameMap := constructNexusTypeMap(nodes) + // populate return values of each Node for resolver + nonStructMap := constructAliasType(sortedPackages) + linkAPI, retMap := tsmPopulateValuesForResolver(nodes, parentsMap, crdNameMap, nonStructMap) + + // populate return values of each node + nodeProperties := tsmPopulateValuesForEachNode(nodes, linkAPI, retMap) + + return nodeProperties, nil +} diff --git a/compiler/pkg/generator/tsm_graphql_generator_test.go b/compiler/pkg/generator/tsm_graphql_generator_test.go new file mode 100644 index 000000000..72874106a --- /dev/null +++ b/compiler/pkg/generator/tsm_graphql_generator_test.go @@ -0,0 +1,79 @@ +package generator_test + +import ( + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + "github.com/vmware-tanzu/graph-framework-for-microservices/nexus/nexus" + + "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/pkg/generator" + "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/pkg/parser" +) + +var _ = Describe("Template renderers tests", func() { + var ( + pkgs parser.Packages + parentsMap map[string]parser.NodeHelper + graphqlQueries map[string]nexus.GraphQLQuerySpec + ) + + BeforeEach(func() { + pkgs = parser.ParseDSLPkg(exampleDSLPath) + graphqlQueries = parser.ParseGraphqlQuerySpecs(pkgs) + graph, _, _ := parser.ParseDSLNodes(exampleDSLPath, baseGroupName, pkgs, graphqlQueries) + parentsMap = parser.CreateParentsMap(graph) + }) + + FIt("should resolve graphql vars", func() { + vars, err := generator.GenerateTsmGraphqlSchemaVars(baseGroupName, crdModulePath, pkgs, parentsMap, nil) + Expect(err).NotTo(HaveOccurred()) + + Expect(len(vars)).To(Equal(45)) + Expect(vars[0].NodeName).To(Equal("Root")) + Expect(vars[3].PkgName).To(Equal("Config")) + Expect(vars[3].NodeName).To(Equal("Config")) + Expect(vars[3].SchemaName).To(Equal("config_Config")) + Expect(vars[3].Alias).To(Equal("")) + Expect(vars[3].ReturnType).To(Equal("")) + + Expect(vars[2].IsParentNode).To(BeFalse()) + Expect(vars[2].HasParent).To(BeFalse()) + Expect(vars[2].IsSingletonNode).To(BeFalse()) + Expect(vars[2].IsNexusNode).To(BeFalse()) + Expect(vars[2].BaseImportPath).To(Equal("nexustempmodule/")) + Expect(vars[2].CrdName).To(Equal("")) + + // Test that nexus-secret Node should not be present + Expect(vars).NotTo(ContainElement(HaveField("NodeName", "Foo"))) + }) + + It("should resolve non-singleton root and singleton child node", func() { + pkgs = parser.ParseDSLPkg("../../example/test-utils/non-singleton-root") + graph, _, _ := parser.ParseDSLNodes("../../example/test-utils/non-singleton-root", baseGroupName, pkgs, graphqlQueries) + parentsMap = parser.CreateParentsMap(graph) + + vars, err := generator.GenerateGraphqlResolverVars(baseGroupName, crdModulePath, pkgs, parentsMap) + Expect(err).NotTo(HaveOccurred()) + Expect(len(vars)).To(Equal(3)) + + Expect(vars[0].NodeName).To(Equal("Root")) + Expect(vars[1].PkgName).To(Equal("Config")) + Expect(vars[1].NodeName).To(Equal("Config")) + Expect(vars[1].SchemaName).To(Equal("config_Config")) + + Expect(vars[1].IsParentNode).To(BeFalse()) + Expect(vars[1].HasParent).To(BeFalse()) + Expect(vars[1].IsSingletonNode).To(BeTrue()) + Expect(vars[1].IsNexusNode).To(BeTrue()) + Expect(vars[1].BaseImportPath).To(Equal("nexustempmodule/")) + Expect(vars[1].CrdName).To(Equal("")) + }) + + It("should validate the import pkg and translate to graphql schema and resolver typeName", func() { + pkg := pkgs["github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/datamodel/config/gns"] + schemaTypeName, resolverTypeName := generator.ValidateImportPkg(pkg.Name, "servicegroup.SvcGroup", pkg.GetImportMap(), pkgs) + + Expect(pkg.Name).To(Equal("gns")) + Expect(schemaTypeName).To(Equal("servicegroup_SvcGroup")) + Expect(resolverTypeName).To(Equal("ServicegroupSvcGroup")) + }) +}) diff --git a/compiler/pkg/openapi_generator/generator.go b/compiler/pkg/openapi_generator/generator.go index 96ce548c8..c2ed99ea2 100644 --- a/compiler/pkg/openapi_generator/generator.go +++ b/compiler/pkg/openapi_generator/generator.go @@ -183,18 +183,6 @@ func (g *Generator) resolveRefsForPackage(pkg string) error { } fmt.Printf("Resolving refs for %v\n", pkg) - // We are forcing camelCase in all field names for consistency - for property, propSchema := range pkgSchema.schema.Properties { - if strings.Contains(property, "_") { - pkgSchema.schema.Properties[convertToCamelCase(property)] = propSchema - delete(pkgSchema.schema.Properties, property) - } - toReplace := make([]string, len(pkgSchema.schema.Required)) - for i, required := range pkgSchema.schema.Required { - toReplace[i] = convertToCamelCase(required) - } - pkgSchema.schema.Required = toReplace - } g.resolveRefsInProperty(pkgSchema.schema) g.resolveRefsInProperties(pkgSchema.schema) diff --git a/compiler/pkg/parser/graphql_file_parser.go b/compiler/pkg/parser/graphql_file_parser.go new file mode 100644 index 000000000..0659ba973 --- /dev/null +++ b/compiler/pkg/parser/graphql_file_parser.go @@ -0,0 +1,39 @@ +package parser + +import ( + log "github.com/sirupsen/logrus" + "io/fs" + "os" + "path/filepath" +) + +// ParseDSLNodes walks recursively through given path and looks for structs types definitions to add them to graph +func ParseGraphQLFiles(startPath string) map[string]string { + graphqlFiles := make(map[string]string, 0) + err := filepath.Walk(startPath, func(path string, info fs.FileInfo, err error) error { + if info.IsDir() { + if info.Name() == "build" { + log.Infof("Ignoring build directory...") + return filepath.SkipDir + } + if info.Name() == "vendor" { + log.Infof("Ignoring vendor directory...") + return filepath.SkipDir + } + } else { + if filepath.Ext(path) == ".graphql" { + data, err := os.ReadFile(path) + if err != nil { + return err + } + graphqlFiles[path] = string(data) + } + } + return nil + }) + if err != nil { + log.Fatalf("Failed to ParseDSLNodes %v", err) + } + + return graphqlFiles +} diff --git a/compiler/pkg/parser/graphql_queries_parser.go b/compiler/pkg/parser/graphql_queries_parser.go index 8f7633696..a43c3af49 100644 --- a/compiler/pkg/parser/graphql_queries_parser.go +++ b/compiler/pkg/parser/graphql_queries_parser.go @@ -117,8 +117,9 @@ func parseQuery(queryComp *ast.CompositeLit, p Package) (newQuery nexus.GraphQLQ } type GraphQlArg struct { - Name string - Type string + Name string + Type string + AliasType bool } func parseArgs(argsTypeName string, p Package) []GraphQlArg { @@ -133,9 +134,25 @@ func parseArgs(argsTypeName string, p Package) []GraphQlArg { if len(field.Names) == 0 { log.Fatalf("Field in graphql args must be named, args %s", argsTypeName) } + // AliasName Annotation + var fName, fType string + var aType bool + if val := GetFieldAnnotationVal(field, GRAPHQL_ALIAS_NAME_ANNOTATION); val != "" { + fName = val + } else { + fName = field.Names[0].Name + } + // AliasType Annotation + if val := GetFieldAnnotationVal(field, GRAPHQL_ALIAS_TYPE_ANNOTATION); val != "" { + fType = val + aType = true + } else { + fType = GetFieldType(field) + } args = append(args, GraphQlArg{ - Name: field.Names[0].Name, - Type: GetFieldType(field), + Name: fName, + Type: fType, + AliasType: aType, }) } } diff --git a/compiler/pkg/parser/graphql_spec_parser.go b/compiler/pkg/parser/graphql_spec_parser.go new file mode 100644 index 000000000..b20024376 --- /dev/null +++ b/compiler/pkg/parser/graphql_spec_parser.go @@ -0,0 +1,56 @@ +package parser + +import ( + "go/ast" + "strconv" + + log "github.com/sirupsen/logrus" + "github.com/vmware-tanzu/graph-framework-for-microservices/nexus/nexus" +) + +func ParseGraphqlSpecs(pkgs Packages) map[string]nexus.GraphQLSpec { + graphQLSpecMap := make(map[string]nexus.GraphQLSpec) + for _, pkg := range pkgs { + GetGraphqlSpecs(graphQLSpecMap, pkg) + } + return graphQLSpecMap +} + +func GetGraphqlSpecs(graphQLSpecMap map[string]nexus.GraphQLSpec, p Package) { + for _, spec := range GetNexusSpecs(p, "nexus.GraphQLSpec") { + graphQLSpecMap[p.Name+"."+spec.Name] = parseGqlSpec(spec.Value, p) + } +} + +func parseGqlSpec(v *ast.CompositeLit, p Package) nexus.GraphQLSpec { + spec := nexus.GraphQLSpec{ + IdName: "", + IdNullable: true, + } + for _, gqlSpecElt := range v.Elts { + gqlSpecKv, ok := gqlSpecElt.(*ast.KeyValueExpr) + if !ok { + log.Fatalf("Wrong format of graphql query spec, please check graphql spec") + } + + gqlSpecFieldName := gqlSpecKv.Key.(*ast.Ident) + switch gqlSpecFieldName.String() { + case "IdName": + gqlSpecFieldValue := gqlSpecKv.Value.(*ast.BasicLit) + name, err := strconv.Unquote(gqlSpecFieldValue.Value) + if err != nil { + log.Fatalf("Internal compiler error, failed to unqote name in graphql") + } + spec.IdName = name + case "IdNullable": + gqlSpecFieldValue := gqlSpecKv.Value.(*ast.Ident) + val := gqlSpecFieldValue.String() + if val == "false" { + spec.IdNullable = false + } else { + spec.IdNullable = true + } + } + } + return spec +} diff --git a/compiler/pkg/parser/graphql_test.go b/compiler/pkg/parser/graphql_test.go index 2bc3ceb5d..244898ef1 100644 --- a/compiler/pkg/parser/graphql_test.go +++ b/compiler/pkg/parser/graphql_test.go @@ -17,7 +17,7 @@ var _ = Describe("Graphql parsing tests", func() { It("should parse graphql query specs", func() { pkgs = parser.ParseDSLPkg(exampleDSLPath) graphqlQueries := parser.ParseGraphqlQuerySpecs(pkgs) - graph = parser.ParseDSLNodes(exampleDSLPath, baseGroupName, pkgs, graphqlQueries) + graph, _, _ = parser.ParseDSLNodes(exampleDSLPath, baseGroupName, pkgs, graphqlQueries) root, ok := graph["roots.root.tsm.tanzu.vmware.com"] Expect(ok).To(BeTrue()) config, ok := root.SingleChildren["Config"] @@ -25,11 +25,11 @@ var _ = Describe("Graphql parsing tests", func() { gns, ok := config.SingleChildren["GNS"] Expect(ok).To(BeTrue()) - Expect(gns.GraphqlSpec.Queries).To(HaveLen(3)) - Expect(gns.GraphqlSpec.Queries[0].Name).To(Equal("queryGns1")) - Expect(gns.GraphqlSpec.Queries[0].ServiceEndpoint.Domain).To(Equal("nexus-query-responder")) - Expect(gns.GraphqlSpec.Queries[0].ServiceEndpoint.Port).To(Equal(15000)) - args := gns.GraphqlSpec.Queries[0].Args.([]parser.GraphQlArg) + Expect(gns.GraphqlQuerySpec.Queries).To(HaveLen(3)) + Expect(gns.GraphqlQuerySpec.Queries[0].Name).To(Equal("queryGns1")) + Expect(gns.GraphqlQuerySpec.Queries[0].ServiceEndpoint.Domain).To(Equal("nexus-query-responder")) + Expect(gns.GraphqlQuerySpec.Queries[0].ServiceEndpoint.Port).To(Equal(15000)) + args := gns.GraphqlQuerySpec.Queries[0].Args.([]parser.GraphQlArg) Expect(len(args)).To(Equal(5)) Expect(args[0].Name).To(Equal("StartTime")) @@ -43,26 +43,26 @@ var _ = Describe("Graphql parsing tests", func() { Expect(args[4].Name).To(Equal("StartVal")) Expect(args[4].Type).To(Equal("int")) - Expect(gns.GraphqlSpec.Queries[1].Name).To(Equal("queryGnsQM1")) - Expect(gns.GraphqlSpec.Queries[1].ServiceEndpoint.Domain).To(Equal("query-manager")) - Expect(gns.GraphqlSpec.Queries[1].ServiceEndpoint.Port).To(Equal(15002)) - Expect(gns.GraphqlSpec.Queries[1].Args).To(BeNil()) + Expect(gns.GraphqlQuerySpec.Queries[1].Name).To(Equal("queryGnsQM1")) + Expect(gns.GraphqlQuerySpec.Queries[1].ServiceEndpoint.Domain).To(Equal("query-manager")) + Expect(gns.GraphqlQuerySpec.Queries[1].ServiceEndpoint.Port).To(Equal(15002)) + Expect(gns.GraphqlQuerySpec.Queries[1].Args).To(BeNil()) }) It("should match graphql query specs from other packages", func() { pkgs = parser.ParseDSLPkg(exampleDSLPath) graphqlQueries := parser.ParseGraphqlQuerySpecs(pkgs) - graph = parser.ParseDSLNodes(exampleDSLPath, baseGroupName, pkgs, graphqlQueries) + graph, _, _ = parser.ParseDSLNodes(exampleDSLPath, baseGroupName, pkgs, graphqlQueries) root, ok := graph["roots.root.tsm.tanzu.vmware.com"] Expect(ok).To(BeTrue()) config, ok := root.SingleChildren["Config"] Expect(ok).To(BeTrue()) - Expect(config.GraphqlSpec.Queries).To(HaveLen(1)) - Expect(config.GraphqlSpec.Queries[0].Name).To(Equal("QueryExample")) - Expect(config.GraphqlSpec.Queries[0].ServiceEndpoint.Domain).To(Equal("query-manager")) - Expect(config.GraphqlSpec.Queries[0].ServiceEndpoint.Port).To(Equal(6000)) - args := config.GraphqlSpec.Queries[0].Args.([]parser.GraphQlArg) + Expect(config.GraphqlQuerySpec.Queries).To(HaveLen(1)) + Expect(config.GraphqlQuerySpec.Queries[0].Name).To(Equal("QueryExample")) + Expect(config.GraphqlQuerySpec.Queries[0].ServiceEndpoint.Domain).To(Equal("query-manager")) + Expect(config.GraphqlQuerySpec.Queries[0].ServiceEndpoint.Port).To(Equal(6000)) + args := config.GraphqlQuerySpec.Queries[0].Args.([]parser.GraphQlArg) Expect(len(args)).To(Equal(5)) }) diff --git a/compiler/pkg/parser/node.go b/compiler/pkg/parser/node.go index 7c5a7ae79..98d469620 100644 --- a/compiler/pkg/parser/node.go +++ b/compiler/pkg/parser/node.go @@ -19,18 +19,20 @@ type Node struct { MultipleChildren map[string]Node SingleLink map[string]Node MultipleLink map[string]Node - GraphqlSpec nexus.GraphQLQuerySpec + GraphqlQuerySpec nexus.GraphQLQuerySpec + GraphqlSpec nexus.GraphQLSpec } type NodeHelper struct { - Name string - RestName string - Parents []string - Children map[string]NodeHelperChild // CRD Name => NodeHelperChild - Links map[string]NodeHelperChild // FieldName => NodeHelperChild - RestMappings map[string]string - IsSingleton bool - GraphqlSpec nexus.GraphQLQuerySpec + Name string + RestName string + Parents []string + Children map[string]NodeHelperChild // CRD Name => NodeHelperChild + Links map[string]NodeHelperChild // FieldName => NodeHelperChild + RestMappings map[string]string + IsSingleton bool + GraphqlQuerySpec nexus.GraphQLQuerySpec + GraphqlSpec nexus.GraphQLSpec } type NodeHelperChild struct { @@ -39,6 +41,12 @@ type NodeHelperChild struct { IsNamed bool `json:"isNamed"` } +type NonNexusTypes struct { + Types map[string]ast.Decl + Values []string + ExternalTypes []string +} + func (node *Node) Walk(fn func(node *Node)) { fn(node) diff --git a/compiler/pkg/parser/node_config.go b/compiler/pkg/parser/node_config.go index 2d56b5378..031ac6168 100644 --- a/compiler/pkg/parser/node_config.go +++ b/compiler/pkg/parser/node_config.go @@ -13,6 +13,7 @@ const ( NexusDescriptionAnnotation = "nexus-description" NexusGraphqlAnnotation = "nexus-graphql-query" NexusSecretSpecAnnotation = "nexus-secret-spec" + NexusGraphqlSpecAnnotation = "nexus-graphql-spec" ) func GetNexusSecretSpecAnnotation(pkg Package, name string) (string, bool) { @@ -35,6 +36,10 @@ func GetNexusGraphqlAnnotation(pkg Package, name string) (string, bool) { return getNexusAnnotation(pkg, name, NexusGraphqlAnnotation) } +func GetNexusGraphqlSpecAnnotation(pkg Package, name string) (string, bool) { + return getNexusAnnotation(pkg, name, NexusGraphqlSpecAnnotation) +} + func getNexusAnnotation(pkg Package, name string, annotationName string) (string, bool) { var annotationValue string diff --git a/compiler/pkg/parser/node_parser.go b/compiler/pkg/parser/node_parser.go index 2a8446ab3..97a48c42b 100644 --- a/compiler/pkg/parser/node_parser.go +++ b/compiler/pkg/parser/node_parser.go @@ -5,7 +5,9 @@ import ( "go/ast" "go/parser" "go/token" + "go/types" "io/fs" + "k8s.io/utils/strings/slices" "path/filepath" "strconv" "strings" @@ -18,12 +20,17 @@ import ( // ParseDSLNodes walks recursively through given path and looks for structs types definitions to add them to graph func ParseDSLNodes(startPath string, baseGroupName string, packages Packages, - graphqlQueries map[string]nexus.GraphQLQuerySpec) map[string]Node { + graphqlQueries map[string]nexus.GraphQLQuerySpec) (map[string]Node, *NonNexusTypes, *token.FileSet) { modulePath := GetModulePath(startPath) rootNodes := make([]string, 0) nodes := make(map[string]Node) pkgsMap := make(map[string]string) + nonNexusTypes := NonNexusTypes{ + Types: map[string]ast.Decl{}, + Values: nil, + } + fileset := token.NewFileSet() err := filepath.Walk(startPath, func(path string, info fs.FileInfo, err error) error { if info.IsDir() { if info.Name() == "build" { @@ -34,7 +41,6 @@ func ParseDSLNodes(startPath string, baseGroupName string, packages Packages, log.Infof("Ignoring vendor directory...") return filepath.SkipDir } - fileset := token.NewFileSet() pkgs, err := parser.ParseDir(fileset, path, nil, parser.ParseComments) if err != nil { log.Fatalf("Failed to parse directory %s: %v", path, err) @@ -87,15 +93,57 @@ func ParseDSLNodes(startPath string, baseGroupName string, packages Packages, // look for spec in current package annotation = v.Name + "." + annotation } - graphqlSpec, ok := graphqlQueries[annotation] + GraphqlQuerySpec, ok := graphqlQueries[annotation] if ok { - node.GraphqlSpec = graphqlSpec + node.GraphqlQuerySpec = GraphqlQuerySpec } } nodes[crdName] = node + } else { + if !strings.Contains(types.ExprString(typeSpec.Type), "nexus.") && v.Name == "global" { + nonNexusTypes.Types[typeSpec.Name.Name] = decl + } + } + } else { + if !strings.Contains(types.ExprString(typeSpec.Type), "nexus.") && v.Name == "global" { + nonNexusTypes.Types[typeSpec.Name.Name] = decl } } } + if valueSpec, ok := spec.(*ast.ValueSpec); ok { + out, err := util.RenderDecl(decl, fileset) + if err != nil { + return err + } + outStr := out.String() + + // ignore nexus vars + if len(valueSpec.Values) > 0 { + value := valueSpec.Values[0] + if val, ok := value.(*ast.CompositeLit); ok { + if sel, ok := val.Type.(*ast.SelectorExpr); ok { + if types.ExprString(sel.X) == "nexus" { + continue + } + } + } + } + if !slices.Contains(nonNexusTypes.Values, outStr) && v.Name == "global" { + nonNexusTypes.Values = append(nonNexusTypes.Values, outStr) + } + } + } + } + + if _, ok := decl.(*ast.FuncDecl); ok { + out, err := util.RenderDecl(decl, fileset) + if err != nil { + return err + } + outStr := out.String() + + if !slices.Contains(nonNexusTypes.Values, outStr) { + nonNexusTypes.Values = append(nonNexusTypes.Values, outStr) } } } @@ -120,20 +168,28 @@ func ParseDSLNodes(startPath string, baseGroupName string, packages Packages, for _, child := range node.SingleChildren { // if rootNode is a child then remove it from the slice if child.CrdName == rootNode { - rootNodes = append(rootNodes[:i], rootNodes[i+1:]...) + if i+1 >= len(rootNodes) { + rootNodes = rootNodes[:i] + } else { + rootNodes = append(rootNodes[:i], rootNodes[i+1:]...) + } } } for _, child := range node.MultipleChildren { // if rootNode is a named child then remove it from the slice if child.CrdName == rootNode { - rootNodes = append(rootNodes[:i], rootNodes[i+1:]...) + if i+1 >= len(rootNodes) { + rootNodes = rootNodes[:i] + } else { + rootNodes = append(rootNodes[:i], rootNodes[i+1:]...) + } } } } }) } - return buildGraph(nodes, rootNodes, baseGroupName) + return buildGraph(nodes, rootNodes, baseGroupName), &nonNexusTypes, fileset } func buildGraph(nodes map[string]Node, rootNodes []string, baseGroupName string) map[string]Node { @@ -200,13 +256,14 @@ func CreateParentsMap(graph map[string]Node) map[string]NodeHelper { } parents[node.CrdName] = NodeHelper{ - Name: node.Name, - RestName: fmt.Sprintf("%s.%s", node.PkgName, node.Name), - Parents: node.Parents, - Children: children, - Links: links, - IsSingleton: node.IsSingleton, - GraphqlSpec: node.GraphqlSpec, + Name: node.Name, + RestName: fmt.Sprintf("%s.%s", node.PkgName, node.Name), + Parents: node.Parents, + Children: children, + Links: links, + IsSingleton: node.IsSingleton, + GraphqlQuerySpec: node.GraphqlQuerySpec, + GraphqlSpec: node.GraphqlSpec, } }) } @@ -249,8 +306,10 @@ func processNode(node *Node, nodes map[string]Node, baseGroupName string) { if !ok { log.Fatalf("Internal compiler failure: couldn't find node for key %v", key) } - n.Parents = node.Parents - n.Parents = append(n.Parents, node.CrdName) + p := make([]string, len(node.Parents)) + copy(p, node.Parents) + + n.Parents = append(p, node.CrdName) processNode(&n, nodes, baseGroupName) if isNamed { diff --git a/compiler/pkg/parser/node_parser_test.go b/compiler/pkg/parser/node_parser_test.go index 8e8ad4438..35ed1366b 100644 --- a/compiler/pkg/parser/node_parser_test.go +++ b/compiler/pkg/parser/node_parser_test.go @@ -23,7 +23,7 @@ var _ = Describe("Node parser tests", func() { ) BeforeEach(func() { - graph = parser.ParseDSLNodes(exampleDSLPath, baseGroupName, nil, nil) + graph, _, _ = parser.ParseDSLNodes(exampleDSLPath, baseGroupName, nil, nil) root, ok = graph["roots.root.tsm.tanzu.vmware.com"] Expect(ok).To(BeTrue()) }) @@ -147,7 +147,7 @@ var _ = Describe("Node parser tests", func() { }) It("should be able to get graphql info from a field", func() { - graph = parser.ParseDSLNodes(exampleDSLPath, baseGroupName, nil, nil) + graph, _, _ = parser.ParseDSLNodes(exampleDSLPath, baseGroupName, nil, nil) config, ok := graph["roots.root.tsm.tanzu.vmware.com"].SingleChildren["Config"] Expect(ok).To(BeTrue()) diff --git a/compiler/pkg/parser/pkg.go b/compiler/pkg/parser/pkg.go index fec0edc3b..da7b1a73c 100644 --- a/compiler/pkg/parser/pkg.go +++ b/compiler/pkg/parser/pkg.go @@ -35,6 +35,24 @@ type Package struct { FileSet *token.FileSet } +type FieldAnnotation string + +const ( + GRAPHQL_ARGS_ANNOTATION = FieldAnnotation("nexus-graphql-args") + GRAPHQL_ALIAS_NAME_ANNOTATION = FieldAnnotation("nexus-alias-name") + GRAPHQL_ALIAS_TYPE_ANNOTATION = FieldAnnotation("nexus-alias-type") + GRAPHQL_TSM_DIRECTIVE_ANNOTATION = FieldAnnotation("nexus-graphql-tsm-directive") + GRAPHQL_NULLABLE_ANNOTATION = FieldAnnotation("nexus-graphql-nullable") + GRAPHQL_TS_TYPE_ANNOTATION = FieldAnnotation("nexus-graphql-ts-type") + GRAPHQL_JSONENCODED_ANNOTATION = FieldAnnotation("nexus-graphql-jsonencoded") + GRAPHQL_RELATION_NAME = FieldAnnotation("nexus-graphql-relation-name") + GRAPHQL_RELATION_PARAMETERS = FieldAnnotation("nexus-graphql-relation-parameters") + GRAPHQL_RELATION_UUIDKEY = FieldAnnotation("nexus-graphql-relation-uuidkey") + GRAPHQL_TYPE_NAME = FieldAnnotation("nexus-graphql-type-name") + GRAPHQL_PROTOBUF_NAME = FieldAnnotation("nexus-graphql-protobuf-name") + GRAPHQL_PROTOBUF_FILE = FieldAnnotation("nexus-graphql-protobuf-file") +) + // func (p *Package) GetImports() []*ast.ImportSpec // func (p *Package) GetNodes() []*ast.StructType // func (p *Package) GetNexusNodes []*ast.StructType @@ -201,7 +219,7 @@ func IsNexusNode(n *ast.TypeSpec) bool { if val, ok := n.Type.(*ast.StructType); ok { for _, field := range val.Fields.List { typeString := types.ExprString(field.Type) - if typeString == "nexus.Node" || typeString == "nexus.SingletonNode" { + if typeString == "nexus.Node" || typeString == "nexus.SingletonNode" || typeString == "NexusNode" { return true } } @@ -248,7 +266,7 @@ func IsNexusTypeField(f *ast.Field) bool { } typeString := types.ExprString(f.Type) - if typeString == "nexus.Node" || typeString == "nexus.SingletonNode" || typeString == "nexus.ID" { + if typeString == "nexus.Node" || typeString == "nexus.SingletonNode" || typeString == "nexus.ID" || typeString == "NexusNode" { return true } @@ -722,3 +740,91 @@ func (p *Package) ValueSpecToString(t *ast.ValueSpec) (string, error) { } return buf.String(), nil } + +func IsNexusGraphqlNullField(f *ast.Field) bool { + if f == nil { + return false + } + + if f.Tag != nil { + tags := ParseFieldTags(f.Tag.Value) + if val, err := tags.Get(string(GRAPHQL_NULLABLE_ANNOTATION)); err == nil { + if strings.ToLower(val.Name) == "false" { + return false + } + } + } + + return true +} + +// Parser for TSM Integration +// func GetGraphqlArgumentKey(f *ast.Field) string { +// if f == nil { +// return "" +// } + +// if f.Tag != nil { +// tags := ParseFieldTags(f.Tag.Value) +// if val, err := tags.Get("nexus-graphql-arg-key"); err == nil { +// return val.Value() +// } +// } +// return "" +// } + +// func GetGraphqlArgumentValue(f *ast.Field) string { +// if f == nil { +// return "" +// } + +// if f.Tag != nil { +// tags := ParseFieldTags(f.Tag.Value) +// if val, err := tags.Get("nexus-graphql-arg-value"); err == nil { +// return val.Value() +// } +// } +// return "" +// } + +func GetFieldAnnotationString(f *ast.Field, annotation FieldAnnotation) string { + if f == nil { + return "" + } + + if f.Tag != nil { + tags := ParseFieldTags(f.Tag.Value) + if val, err := tags.Get(string(annotation)); err == nil { + return val.String() + } + } + return "" +} + +func GetFieldAnnotationVal(f *ast.Field, annotation FieldAnnotation) string { + if f == nil { + return "" + } + + if f.Tag != nil { + tags := ParseFieldTags(f.Tag.Value) + if val, err := tags.Get(string(annotation)); err == nil { + return val.Value() + } + } + return "" +} + +func IsFieldAnnotationPresent(f *ast.Field, annotation FieldAnnotation) bool { + if f == nil { + return false + } + + if f.Tag != nil { + tags := ParseFieldTags(f.Tag.Value) + if _, err := tags.Get(string(annotation)); err == nil { + return true + } + } + return false +} diff --git a/compiler/pkg/parser/pkg_parser.go b/compiler/pkg/parser/pkg_parser.go index 1611d1180..c79b23125 100644 --- a/compiler/pkg/parser/pkg_parser.go +++ b/compiler/pkg/parser/pkg_parser.go @@ -59,7 +59,7 @@ func ParseDSLPkg(startPath string) Packages { FileSet: fileset, Pkg: *v, } - parseGenDecls(v, &pkg) + ParseGenDecls(v, &pkg) packages[pkgImport] = pkg } } @@ -72,7 +72,7 @@ func ParseDSLPkg(startPath string) Packages { return packages } -func parseGenDecls(v *ast.Package, pkg *Package) { +func ParseGenDecls(v *ast.Package, pkg *Package) { sortedKeys := make([]string, 0, len(v.Files)) for k := range v.Files { sortedKeys = append(sortedKeys, k) diff --git a/compiler/pkg/parser/rest/rest_test.go b/compiler/pkg/parser/rest/rest_test.go index 8559cf6bf..779c0a651 100644 --- a/compiler/pkg/parser/rest/rest_test.go +++ b/compiler/pkg/parser/rest/rest_test.go @@ -27,7 +27,7 @@ var _ = Describe("Rest tests", func() { pkgs = parser.ParseDSLPkg(exampleDSLPath) pkg, ok = pkgs["github.com/vmware-tanzu/graph-framework-for-microservices/compiler/example/datamodel/config/gns"] graphqlQueries := parser.ParseGraphqlQuerySpecs(pkgs) - graph := parser.ParseDSLNodes(exampleDSLPath, baseGroupName, pkgs, graphqlQueries) + graph, _, _ := parser.ParseDSLNodes(exampleDSLPath, baseGroupName, pkgs, graphqlQueries) parentsMap = parser.CreateParentsMap(graph) Expect(ok).To(BeTrue()) }) @@ -134,7 +134,7 @@ var _ = Describe("Rest tests", func() { } pkgs := parser.ParseDSLPkg("../../../example/test-utils/duplicated-uris-datamodel") - g := parser.ParseDSLNodes("../../../example/test-utils/duplicated-uris-datamodel", baseGroupName, pkgs, nil) + g, _, _ := parser.ParseDSLNodes("../../../example/test-utils/duplicated-uris-datamodel", baseGroupName, pkgs, nil) parents := parser.CreateParentsMap(g) for _, p := range pkgs { diff --git a/compiler/pkg/preparser/preparser.go b/compiler/pkg/preparser/preparser.go new file mode 100644 index 000000000..0872bc98d --- /dev/null +++ b/compiler/pkg/preparser/preparser.go @@ -0,0 +1,294 @@ +package preparser + +import ( + "bytes" + "fmt" + "go/ast" + goParser "go/parser" + "go/printer" + "go/token" + "go/types" + "io/fs" + "io/ioutil" + "os" + "path/filepath" + "strconv" + "strings" + "text/template" + + cp "github.com/otiai10/copy" + log "github.com/sirupsen/logrus" + "github.com/vmware-tanzu/graph-framework-for-microservices/compiler/pkg/parser" + "golang.org/x/tools/imports" +) + +var pkgImportToPkg = make(map[string]string, 0) + +func Parse(startPath string) map[string][]*parser.Package { + packages := map[string][]*parser.Package{} + modulePath := parser.GetModulePath(startPath) + err := filepath.Walk(startPath, func(path string, info fs.FileInfo, err error) error { + if info.IsDir() { + if info.Name() == "build" { + log.Infof("Ignoring build directory...") + return filepath.SkipDir + } + if info.Name() == "vendor" { + log.Infof("Ignoring vendor directory...") + return filepath.SkipDir + } + + fileset := token.NewFileSet() + pkgs, err := goParser.ParseDir(fileset, path, nil, goParser.ParseComments) + if err != nil { + log.Fatalf("failed to parse directory %s: %v", path, err) + } + pkgImport := strings.TrimSuffix(strings.ReplaceAll(path, startPath, modulePath), "/") + for _, v := range pkgs { + if v.Name == "nexus" { + log.Infof("Ignoring nexus package...") + continue + } + + if parser.SpecialCharsPresent(v.Name) { + log.Fatalf("Invalid package-name <%v>, special characters are not allowed. Please use only lowercase alphanumeric characters.", v.Name) + } + pkgImportToPkg[pkgImport] = v.Name + + pkg := parser.Package{ + Name: v.Name, + ModPath: modulePath, + FullName: pkgImport, + FileSet: fileset, + Pkg: *v, + } + parser.ParseGenDecls(v, &pkg) + packages[pkg.Name] = append(packages[pkg.Name], &pkg) + } + } + return nil + }) + if err != nil { + log.Fatalf("Failed to parse DSL: %v", err) + } + + detectDuplicates(packages) + + return packages +} + +func detectDuplicates(packages map[string][]*parser.Package) { + for _, v := range packages { + for _, pkg := range v { + nodes := pkg.GetNodes() + nexusNodes := pkg.GetNexusNodes() + + nodes = append(nodes, pkg.GetNonStructTypes()...) + + for _, nexusNode := range nexusNodes { + for _, node := range nodes { + if node.Name.String() == fmt.Sprintf("%sSpec", nexusNode.Name) || + node.Name.String() == fmt.Sprintf("%sList", nexusNode.Name) { + log.Fatalf(`Duplicated type (%s) found in package %s ("%s" is already used by node "%s")`, node.Name, pkg.Name, node.Name, nexusNode.Name) + } + } + } + } + } +} + +func removeImportIdentifierFromFields(file *ast.File, pkg string) *ast.File { + for _, decl := range file.Decls { + genDecl, ok := decl.(*ast.GenDecl) + if !ok { + continue + } + + for _, spec := range genDecl.Specs { + typeSpec, ok := spec.(*ast.TypeSpec) + if !ok { + continue + } + + structType, ok := typeSpec.Type.(*ast.StructType) + if !ok { + continue + } + + for _, field := range structType.Fields.List { + selectorExpr, ok := field.Type.(*ast.SelectorExpr) + if !ok { + continue + } + + if types.ExprString(selectorExpr.X) == "nexus" { + continue + } + + var modify bool + for _, imp := range file.Imports { + pkgImport, _ := strconv.Unquote(imp.Path.Value) + if types.ExprString(selectorExpr.X) == imp.Name.String() { + if val := pkgImportToPkg[pkgImport]; val == pkg { + modify = true + } + } + } + + if types.ExprString(selectorExpr.X) == pkg { + modify = true + } + + if modify { + field.Type = selectorExpr.Sel + } + + } + } + } + return file +} + +func Render(dslDir string, packages map[string][]*parser.Package) error { + for k, pkgs := range packages { + if len(pkgs) == 1 { + continue + } + pkgDir := filepath.Join(dslDir, k) + //TODO: create unique directory (e.g. global may already exist) + err := os.MkdirAll(pkgDir, os.ModePerm) + if err != nil { + return err + } + + created := map[string]int{} + for _, pkg := range pkgs { + for _, file := range pkg.Pkg.Files { + file = removeImportIdentifierFromFields(file, pkg.Name) + + // remove src file + srcFile := pkg.FileSet.Position(file.Package).Filename + err := os.Remove(srcFile) + if err != nil { + return err + } + + filename := filepath.Base(srcFile) + if _, ok := created[filename]; ok { + created[filename]++ + filename = fmt.Sprintf("%d_%s", created[filename], filename) + } + + // render AST to buffer + var buf bytes.Buffer + err = printer.Fprint(&buf, pkg.FileSet, file) + if err != nil { + return err + } + + // format file & organize imports using imports package + out, err := imports.Process(filename, buf.Bytes(), nil) + if err != nil { + return err + } + + // create file and write output + f, err := os.Create(filepath.Join(pkgDir, filename)) + if err != nil { + return err + } + _, err = f.Write(out) + if err != nil { + return err + } + + err = f.Close() + if err != nil { + return err + } + + created[filename] = 0 + } + } + + } + + return nil +} + +func CopyPkgsToBuild(dslDir string, outputDir string) error { + dir, err := ioutil.ReadDir(dslDir) + if err != nil { + return err + } + + for _, f := range dir { + if !f.IsDir() || f.Name() == "build" || f.Name() == "vendor" || + f.Name() == "global" || strings.HasPrefix(f.Name(), ".") { + continue + } + + opt := cp.Options{ + Skip: func(srcinfo os.FileInfo, src, dest string) (bool, error) { + return !strings.HasSuffix(src, ".go"), nil + }, + } + + err := cp.Copy(filepath.Join(dslDir, f.Name()), filepath.Join(outputDir, "model", f.Name()), opt) + if err != nil { + return err + } + } + + return nil +} + +var importsTemplate = `{{range .ImportsToRender}}{{.}} +{{end}}` + +type ImportsTemplateVars struct { + ImportsToRender []string +} + +func RenderImports(packages map[string][]*parser.Package, outputDir string, modPath string) error { + importsTemplateVars := ImportsTemplateVars{ + ImportsToRender: []string{}, + } + + for k, pkgs := range packages { + if k != "global" { + continue + } + + for _, v := range pkgs { + for _, importExpr := range v.GetImportMap() { + importStr := strings.Trim(importExpr, "\"") + if strings.HasPrefix(importStr, v.ModPath+"/global") || + !strings.HasPrefix(importStr, v.ModPath) { + continue + } + + namedImport := "nexus_" + importStr[strings.LastIndex(importStr, "/")+1:] + importsTemplateVars.ImportsToRender = append(importsTemplateVars.ImportsToRender, + fmt.Sprintf("%s %s", namedImport, strings.ReplaceAll(importExpr, v.ModPath, modPath))) + } + } + } + + t, err := template.New("tmpl").Parse(importsTemplate) + if err != nil { + return err + } + + b := bytes.Buffer{} + if err = t.Execute(&b, importsTemplateVars); err != nil { + return err + } + + err = os.WriteFile(filepath.Join(outputDir, "model", "nexus-dm-imports"), b.Bytes(), 0644) + if err != nil { + return err + } + + return nil +} diff --git a/compiler/pkg/util/namers.go b/compiler/pkg/util/namers.go index 6764abaf9..c69f7bc51 100644 --- a/compiler/pkg/util/namers.go +++ b/compiler/pkg/util/namers.go @@ -36,7 +36,7 @@ func GetGroupGoName(baseGroupName string) string { } func GetGroupResourceName(nodeName string) string { - return strings.ToLower(ToPlural(nodeName)) // eg roots + return ToPlural(strings.ToLower(nodeName)) // eg roots } func GetNodeNameTitle(nodeName string) string { diff --git a/compiler/pkg/util/plural.go b/compiler/pkg/util/plural.go index 45755934b..88ff02148 100644 --- a/compiler/pkg/util/plural.go +++ b/compiler/pkg/util/plural.go @@ -14,6 +14,10 @@ limitations under the License. package util var consonants = "bcdfghjklmnpqrstvwxyz" +var exceptions = map[string]string{ + // The type name is already in the plural form + "Endpoints": "Endpoints", +} // ToPlural returns the plural form of the type's name. If the type's name is found // in the exceptions map, the map value is returned. @@ -21,6 +25,10 @@ func ToPlural(t string) string { singular := t var plural string + if plural, ok := exceptions[singular]; ok { + return plural + } + if len(singular) < 2 { return singular } diff --git a/compiler/pkg/util/util.go b/compiler/pkg/util/util.go index 08b29e6ee..6ee539e9d 100644 --- a/compiler/pkg/util/util.go +++ b/compiler/pkg/util/util.go @@ -1,6 +1,10 @@ package util import ( + "bytes" + "go/ast" + "go/printer" + "go/token" "regexp" log "github.com/sirupsen/logrus" @@ -23,3 +27,13 @@ func RemoveSpecialChars(value string) string { } return re.ReplaceAllString(value, "") } + +func RenderDecl(decl ast.Decl, fileset *token.FileSet) (bytes.Buffer, error) { + var buf bytes.Buffer + err := printer.Fprint(&buf, fileset, decl) + if err != nil { + return buf, err + } + + return buf, nil +} diff --git a/compiler/scripts/pin_deps.sh b/compiler/scripts/pin_deps.sh index 5d7b3df23..9d5b3a27e 100755 --- a/compiler/scripts/pin_deps.sh +++ b/compiler/scripts/pin_deps.sh @@ -44,4 +44,4 @@ go mod edit -require golang.org/x/oauth2@v0.0.0-20220411215720-9780585627b5 go mod edit -require k8s.io/klog/v2@v2.70.1 go mod edit -require golang.org/x/net@v0.2.0 go mod edit -require google.golang.org/grpc@v1.51.0 - +go mod edit -require k8s.io/utils@v0.0.0-20221128185143-99ec85e7a448 \ No newline at end of file diff --git a/compiler/scripts/pin_graphql_build_version.sh b/compiler/scripts/pin_graphql_build_version.sh index 4d0d50276..56888b94d 100755 --- a/compiler/scripts/pin_graphql_build_version.sh +++ b/compiler/scripts/pin_graphql_build_version.sh @@ -9,13 +9,14 @@ go mod edit -replace github.com/vmware-tanzu/graph-framework-for-microservices/n go mod edit -require github.com/cespare/xxhash/v2@v2.1.2 go mod edit -require github.com/google/gofuzz@v1.1.0 go mod edit -require github.com/imdario/mergo@v0.3.12 -go mod edit -require k8s.io/apimachinery@v0.25.3 -go mod edit -require k8s.io/client-go@v0.25.3 +go mod edit -require k8s.io/apimachinery@v0.26.0 +go mod edit -require k8s.io/client-go@v0.26.0 go mod edit -require golang.org/x/sys@v0.2.0 -go mod edit -require golang.org/x/time@v0.0.0-20220210224613-90d013bbcef8 +go mod edit -require golang.org/x/time@v0.3.0 go mod edit -require golang.org/x/term@v0.2.0 go mod edit -require golang.org/x/text@v0.4.0 go mod edit -require golang.org/x/oauth2@v0.0.0-20220411215720-9780585627b5 go mod edit -require k8s.io/klog/v2@v2.70.1 go mod edit -require golang.org/x/net@v0.2.0 -go mod edit -require google.golang.org/grpc@v1.51.0 \ No newline at end of file +go mod edit -require google.golang.org/grpc@v1.51.0 +go mod edit -require k8s.io/utils@v0.0.0-20221128185143-99ec85e7a448 \ No newline at end of file diff --git a/nexus/nexus/nexus.go b/nexus/nexus/nexus.go index 79eed10e8..2ce455c77 100644 --- a/nexus/nexus/nexus.go +++ b/nexus/nexus/nexus.go @@ -116,3 +116,9 @@ const ( GraphQLQueryApi GraphQlApiType = iota GetMetricsApi ) + +// A GraphQLSpec +type GraphQLSpec struct { + IdName string + IdNullable bool +}